renaming/removal of filenames to correct case
authorlcp
Fri May 06 15:35:35 1994 +0200 (1994-05-06)
changeset 365796c5e305b31
parent 364 6573122322d7
child 366 5b6e4340085b
renaming/removal of filenames to correct case
src/ZF/ex/CoUnit.ML
src/ZF/ex/ROOT.ML
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/ZF/ex/CoUnit.ML	Fri May 06 15:35:35 1994 +0200
     1.3 @@ -0,0 +1,109 @@
     1.4 +(*  Title: 	ZF/ex/counit.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 +Trivial codatatype definitions, one of which goes wrong!
    1.10 +
    1.11 +Need to find sufficient conditions for codatatypes to work correctly!
    1.12 +*)
    1.13 +
    1.14 +(*This degenerate definition does not work well because the one constructor's
    1.15 +  definition is trivial!  The same thing occurs with Aczel's Special Final
    1.16 +  Coalgebra Theorem
    1.17 +*)
    1.18 +structure CoUnit = CoDatatype_Fun
    1.19 + (val thy = QUniv.thy;
    1.20 +  val rec_specs = 
    1.21 +      [("counit", "quniv(0)",
    1.22 +	  [(["Con"],	"i=>i")])];
    1.23 +  val rec_styp = "i";
    1.24 +  val ext = None
    1.25 +  val sintrs = ["x: counit ==> Con(x) : counit"];
    1.26 +  val monos = [];
    1.27 +  val type_intrs = codatatype_intrs
    1.28 +  val type_elims = codatatype_elims);
    1.29 +  
    1.30 +val [ConI] = CoUnit.intrs;
    1.31 +
    1.32 +(*USELESS because folding on Con(?xa) == ?xa fails*)
    1.33 +val ConE = CoUnit.mk_cases CoUnit.con_defs "Con(x) : counit";
    1.34 +
    1.35 +(*Proving freeness results*)
    1.36 +val Con_iff = CoUnit.mk_free "Con(x)=Con(y) <-> x=y";
    1.37 +
    1.38 +(*Should be a singleton, not everything!*)
    1.39 +goal CoUnit.thy "counit = quniv(0)";
    1.40 +by (rtac (CoUnit.dom_subset RS equalityI) 1);
    1.41 +by (rtac subsetI 1);
    1.42 +by (etac CoUnit.coinduct 1);
    1.43 +by (rtac subset_refl 1);
    1.44 +by (rewrite_goals_tac CoUnit.con_defs);
    1.45 +by (fast_tac ZF_cs 1);
    1.46 +val counit_eq_univ = result();
    1.47 +
    1.48 +
    1.49 +(*****************************************************************)
    1.50 +
    1.51 +(*A similar example, but the constructor is non-degenerate and it works!
    1.52 +  The resulting set is a singleton.
    1.53 +*)
    1.54 +
    1.55 +structure CoUnit2 = CoDatatype_Fun
    1.56 + (val thy = QUniv.thy;
    1.57 +  val rec_specs = 
    1.58 +      [("counit2", "quniv(0)",
    1.59 +	  [(["Con2"],	"[i,i]=>i")])];
    1.60 +  val rec_styp = "i";
    1.61 +  val ext = None
    1.62 +  val sintrs = ["[| x: counit2;  y: counit2 |] ==> Con2(x,y) : counit2"];
    1.63 +  val monos = [];
    1.64 +  val type_intrs = codatatype_intrs
    1.65 +  val type_elims = codatatype_elims);
    1.66 +
    1.67 +val [Con2I] = CoUnit2.intrs;
    1.68 +
    1.69 +val Con2E = CoUnit2.mk_cases CoUnit2.con_defs "Con2(x,y) : counit2";
    1.70 +
    1.71 +(*Proving freeness results*)
    1.72 +val Con2_iff = CoUnit2.mk_free "Con2(x,y)=Con2(x',y') <-> x=x' & y=y'";
    1.73 +
    1.74 +goalw CoUnit2.thy CoUnit2.con_defs "bnd_mono(univ(0), %x. Con2(x,x))";
    1.75 +by (rtac bnd_monoI 1);
    1.76 +by (REPEAT (ares_tac [subset_refl, QPair_subset_univ, QPair_mono] 1));
    1.77 +val Con2_bnd_mono = result();
    1.78 +
    1.79 +goal CoUnit2.thy "lfp(univ(0), %x. Con2(x,x)) : counit2";
    1.80 +by (rtac (singletonI RS CoUnit2.coinduct) 1);
    1.81 +by (rtac (qunivI RS singleton_subsetI) 1);
    1.82 +by (rtac ([lfp_subset, empty_subsetI RS univ_mono] MRS subset_trans) 1);
    1.83 +by (fast_tac (ZF_cs addSIs [Con2_bnd_mono RS lfp_Tarski]) 1);
    1.84 +val lfp_Con2_in_counit2 = result();
    1.85 +
    1.86 +(*Lemma for proving finality.  Borrowed from ex/llist_eq.ML!*)
    1.87 +goal CoUnit2.thy
    1.88 +    "!!i. Ord(i) ==> ALL x y. x: counit2 & y: counit2 --> x Int Vset(i) <= y";
    1.89 +by (etac trans_induct 1);
    1.90 +by (safe_tac subset_cs);
    1.91 +by (etac CoUnit2.elim 1);
    1.92 +by (etac CoUnit2.elim 1);
    1.93 +by (rewrite_goals_tac CoUnit2.con_defs);
    1.94 +by (fast_tac lleq_cs 1);
    1.95 +val counit2_Int_Vset_subset_lemma = result();
    1.96 +
    1.97 +val counit2_Int_Vset_subset = standard
    1.98 +	(counit2_Int_Vset_subset_lemma RS spec RS spec RS mp);
    1.99 +
   1.100 +goal CoUnit2.thy "!!x y. [| x: counit2;  y: counit2 |] ==> x=y";
   1.101 +by (rtac equalityI 1);
   1.102 +by (REPEAT (ares_tac [conjI, counit2_Int_Vset_subset RS Int_Vset_subset] 1));
   1.103 +val counit2_implies_equal = result();
   1.104 +
   1.105 +goal CoUnit2.thy "counit2 = {lfp(univ(0), %x. Con2(x,x))}";
   1.106 +by (rtac equalityI 1);
   1.107 +by (rtac (lfp_Con2_in_counit2 RS singleton_subsetI) 2);
   1.108 +by (rtac subsetI 1);
   1.109 +by (dtac (lfp_Con2_in_counit2 RS counit2_implies_equal) 1);
   1.110 +by (etac subst 1);
   1.111 +by (rtac singletonI 1);
   1.112 +val counit2_eq_univ = result();
     2.1 --- a/src/ZF/ex/ROOT.ML	Fri May 06 15:16:11 1994 +0200
     2.2 +++ b/src/ZF/ex/ROOT.ML	Fri May 06 15:35:35 1994 +0200
     2.3 @@ -43,6 +43,6 @@
     2.4  (** CoDatatypes **)
     2.5  time_use_thy "ex/LList";
     2.6  time_use_thy "ex/LListFn";
     2.7 -time_use     "ex/counit.ML";
     2.8 +time_use     "ex/CoUnit.ML";
     2.9  
    2.10  maketest"END: Root file for ZF Set Theory examples";