src/ZF/ex/Data.ML
author paulson
Wed, 08 Jan 1997 15:04:27 +0100
changeset 2493 bdeb5024353a
parent 2469 b50b8c0eec01
child 2496 40efb87985b5
permissions -rw-r--r--
Removal of sum_cs and eq_cs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
     1
(*  Title:      ZF/ex/Data.ML
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
     5
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
     6
Sample datatype definition.  
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
     7
It has four contructors, of arities 0-3, and two parameters A and B.
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
     8
*)
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
     9
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 503
diff changeset
    10
open Data;
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    11
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 503
diff changeset
    12
goal Data.thy "data(A,B) = ({0} + A) + (A*B + A*B*data(A,B))";
529
f0d16216e394 ZF/List, ex/Brouwer,Data,LList,Ntree,TF,Term: much simplified proof of _unfold
lcp
parents: 515
diff changeset
    13
let open data;  val rew = rewrite_rule con_defs in  
2493
bdeb5024353a Removal of sum_cs and eq_cs
paulson
parents: 2469
diff changeset
    14
by (fast_tac (!claset addSIs (equalityI :: map rew intrs)
529
f0d16216e394 ZF/List, ex/Brouwer,Data,LList,Ntree,TF,Term: much simplified proof of _unfold
lcp
parents: 515
diff changeset
    15
                     addEs [rew elim]) 1)
f0d16216e394 ZF/List, ex/Brouwer,Data,LList,Ntree,TF,Term: much simplified proof of _unfold
lcp
parents: 515
diff changeset
    16
end;
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 529
diff changeset
    17
qed "data_unfold";
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    18
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    19
(**  Lemmas to justify using "data" in other recursive type definitions **)
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    20
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 503
diff changeset
    21
goalw Data.thy data.defs "!!A B. [| A<=C; B<=D |] ==> data(A,B) <= data(C,D)";
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    22
by (rtac lfp_mono 1);
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 503
diff changeset
    23
by (REPEAT (rtac data.bnd_mono 1));
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    24
by (REPEAT (ares_tac (univ_mono::Un_mono::basic_monos) 1));
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 529
diff changeset
    25
qed "data_mono";
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    26
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 503
diff changeset
    27
goalw Data.thy (data.defs@data.con_defs) "data(univ(A),univ(A)) <= univ(A)";
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    28
by (rtac lfp_lowerbound 1);
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    29
by (rtac ([A_subset_univ, Un_upper1] MRS subset_trans RS univ_mono) 2);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
    30
by (fast_tac (!claset addSIs [zero_in_univ, Inl_in_univ, Inr_in_univ,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    31
                            Pair_in_univ]) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 529
diff changeset
    32
qed "data_univ";
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    33
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 529
diff changeset
    34
bind_thm ("data_subset_univ", ([data_mono, data_univ] MRS subset_trans));
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    35
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    36