src/ZF/ex/Data.ML
author wenzelm
Fri, 06 Oct 2000 17:35:58 +0200
changeset 10168 50be659d4222
parent 5137 60205b0de9b9
child 11316 b4e71bd751e4
permissions -rw-r--r--
final tuning;
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
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    12
Goal "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  
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 2496
diff changeset
    14
by (fast_tac (claset() addSIs (map rew intrs) addEs [rew elim]) 1)
529
f0d16216e394 ZF/List, ex/Brouwer,Data,LList,Ntree,TF,Term: much simplified proof of _unfold
lcp
parents: 515
diff changeset
    15
end;
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 529
diff changeset
    16
qed "data_unfold";
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    17
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    18
(**  Lemmas to justify using "data" in other recursive type definitions **)
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    19
5137
60205b0de9b9 Huge tidy-up: removal of leading \!\!
paulson
parents: 5068
diff changeset
    20
Goalw data.defs "[| 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
    21
by (rtac lfp_mono 1);
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 503
diff changeset
    22
by (REPEAT (rtac data.bnd_mono 1));
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    23
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
    24
qed "data_mono";
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    25
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    26
Goalw (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
    27
by (rtac lfp_lowerbound 1);
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    28
by (rtac ([A_subset_univ, Un_upper1] MRS subset_trans RS univ_mono) 2);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 2496
diff changeset
    29
by (fast_tac (claset() addSIs [zero_in_univ, Inl_in_univ, Inr_in_univ,
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    30
                            Pair_in_univ]) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 529
diff changeset
    31
qed "data_univ";
56
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    32
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 529
diff changeset
    33
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
    34
2caa6f49f06e ZF/ex/tf/tree,forest_unfold: streamlined the proofs
lcp
parents:
diff changeset
    35