src/ZF/ex/acc.ML
changeset 0 a5a9c433f639
child 95 2246a80b1cb5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/ZF/ex/acc.ML	Thu Sep 16 12:20:38 1993 +0200
     1.3 @@ -0,0 +1,65 @@
     1.4 +(*  Title: 	ZF/ex/acc
     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 +Inductive definition of acc(r)
    1.10 +
    1.11 +See Ch. Paulin-Mohring, Inductive Definitions in the System Coq.
    1.12 +Research Report 92-49, LIP, ENS Lyon.  Dec 1992.
    1.13 +*)
    1.14 +
    1.15 +structure Acc = Inductive_Fun
    1.16 + (val thy = WF.thy addconsts [(["acc"],"i=>i")];
    1.17 +  val rec_doms = [("acc", "field(r)")];
    1.18 +  val sintrs = 
    1.19 +      ["[| r-``{b} : Pow(acc(r));  b : field(r) |] ==> b : acc(r)"];
    1.20 +  val monos = [Pow_mono];
    1.21 +  val con_defs = [];
    1.22 +  val type_intrs = [];
    1.23 +  val type_elims = []);
    1.24 +
    1.25 +goal Acc.thy "!!a b r. [| b: acc(r);  <a,b>: r |] ==> a: acc(r)";
    1.26 +by (etac Acc.elim 1);
    1.27 +by (fast_tac ZF_cs 1);
    1.28 +val acc_downward = result();
    1.29 +
    1.30 +val [major] = goal Acc.thy "field(r) <= acc(r) ==> wf(r)";
    1.31 +by (rtac (major RS wfI2) 1);
    1.32 +by (rtac subsetI 1);
    1.33 +by (etac Acc.induct 1);
    1.34 +by (etac (bspec RS mp) 1);
    1.35 +by (resolve_tac Acc.intrs 1);
    1.36 +by (assume_tac 2);
    1.37 +by (ALLGOALS (fast_tac ZF_cs));
    1.38 +val acc_wfI = result();
    1.39 +
    1.40 +goal ZF.thy "!!r A. field(r Int A*A) <= field(r) Int A";
    1.41 +by (fast_tac ZF_cs 1);
    1.42 +val field_Int_prodself = result();
    1.43 +
    1.44 +goal Acc.thy "wf(r Int (acc(r)*acc(r)))";
    1.45 +by (rtac (field_Int_prodself RS wfI2) 1);
    1.46 +by (rtac subsetI 1);
    1.47 +by (etac IntE 1);
    1.48 +by (etac Acc.induct 1);
    1.49 +by (etac (bspec RS mp) 1);
    1.50 +by (rtac IntI 1);
    1.51 +by (assume_tac 1);
    1.52 +by (resolve_tac Acc.intrs 1);
    1.53 +by (assume_tac 2);
    1.54 +by (ALLGOALS (fast_tac ZF_cs));
    1.55 +val wf_acc_Int = result();
    1.56 +
    1.57 +val [major] = goal Acc.thy "wf(r) ==> field(r) <= acc(r)";
    1.58 +by (rtac subsetI 1);
    1.59 +by (etac (major RS wf_induct2) 1);
    1.60 +by (rtac subset_refl 1);
    1.61 +by (resolve_tac Acc.intrs 1);
    1.62 +by (assume_tac 2);
    1.63 +by (fast_tac ZF_cs 1);
    1.64 +val acc_wfD = result();
    1.65 +
    1.66 +goal Acc.thy "wf(r) <-> field(r) <= acc(r)";
    1.67 +by (EVERY1 [rtac iffI, etac acc_wfD, etac acc_wfI]);
    1.68 +val wf_acc_iff = result();