src/ZF/co-inductive.ML
changeset 0 a5a9c433f639
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/ZF/co-inductive.ML	Thu Sep 16 12:20:38 1993 +0200
     1.3 @@ -0,0 +1,67 @@
     1.4 +(*  Title: 	ZF/co-inductive.ML
     1.5 +    ID:         $Id$
     1.6 +    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
     1.7 +    Copyright   1993  University of Cambridge
     1.8 +
     1.9 +Co-inductive Definitions for Zermelo-Fraenkel Set Theory
    1.10 +
    1.11 +Uses greatest fixedpoints with Quine-inspired products and sums
    1.12 +
    1.13 +Sums are used only for mutual recursion;
    1.14 +Products are used only to derive "streamlined" induction rules for relations
    1.15 +*)
    1.16 +
    1.17 +structure Gfp =
    1.18 +  struct
    1.19 +  val oper	= Const("gfp",      [iT,iT-->iT]--->iT)
    1.20 +  val bnd_mono	= Const("bnd_mono", [iT,iT-->iT]--->oT)
    1.21 +  val bnd_monoI	= bnd_monoI
    1.22 +  val subs	= def_gfp_subset
    1.23 +  val Tarski	= def_gfp_Tarski
    1.24 +  val induct	= def_Collect_coinduct
    1.25 +  end;
    1.26 +
    1.27 +structure Quine_Prod =
    1.28 +  struct
    1.29 +  val sigma	= Const("QSigma", [iT, iT-->iT]--->iT)
    1.30 +  val pair	= Const("QPair", [iT,iT]--->iT)
    1.31 +  val split_const	= Const("qsplit", [[iT,iT]--->iT, iT]--->iT)
    1.32 +  val fsplit_const	= Const("qfsplit", [[iT,iT]--->oT, iT]--->oT)
    1.33 +  val pair_iff	= QPair_iff
    1.34 +  val split_eq	= qsplit
    1.35 +  val fsplitI	= qfsplitI
    1.36 +  val fsplitD	= qfsplitD
    1.37 +  val fsplitE	= qfsplitE
    1.38 +  end;
    1.39 +
    1.40 +structure Quine_Sum =
    1.41 +  struct
    1.42 +  val sum	= Const("op <+>", [iT,iT]--->iT)
    1.43 +  val inl	= Const("QInl", iT-->iT)
    1.44 +  val inr	= Const("QInr", iT-->iT)
    1.45 +  val elim	= Const("qcase", [iT-->iT, iT-->iT, iT]--->iT)
    1.46 +  val case_inl	= qcase_QInl
    1.47 +  val case_inr	= qcase_QInr
    1.48 +  val inl_iff	= QInl_iff
    1.49 +  val inr_iff	= QInr_iff
    1.50 +  val distinct	= QInl_QInr_iff
    1.51 +  val distinct' = QInr_QInl_iff
    1.52 +  end;
    1.53 +
    1.54 +signature CO_INDRULE =
    1.55 +  sig
    1.56 +  val co_induct : thm
    1.57 +  end;
    1.58 +
    1.59 +
    1.60 +functor Co_Inductive_Fun (Ind: INDUCTIVE) 
    1.61 +          : sig include INTR_ELIM CO_INDRULE end =
    1.62 +struct
    1.63 +structure Intr_elim = 
    1.64 +    Intr_elim_Fun(structure Ind=Ind and Fp=Gfp and 
    1.65 +		  Pr=Quine_Prod and Su=Quine_Sum);
    1.66 +
    1.67 +open Intr_elim 
    1.68 +val co_induct = raw_induct
    1.69 +end;
    1.70 +