src/ZF/ex/TF.ML
author wenzelm
Sat, 27 Oct 2001 00:09:59 +0200
changeset 11963 a6608d44a46b
parent 11316 b4e71bd751e4
permissions -rw-r--r--
impose hyps on initial goal configuration (prevents res_inst_tac problems);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
     1
(*  Title:      ZF/ex/tf.ML
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Trees & forests, a mutually recursive type definition.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
     9
Addsimps tree_forest.intrs;
6153
bff90585cce5 new typechecking solver for the simplifier
paulson
parents: 6046
diff changeset
    10
AddTCs   tree_forest.intrs;
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
(** tree_forest(A) as the union of tree(A) and forest(A) **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
739
786f32e0b64e modified for new treatment of mutual recursion
lcp
parents: 529
diff changeset
    14
val [_, tree_def, forest_def] = tree_forest.defs;
786f32e0b64e modified for new treatment of mutual recursion
lcp
parents: 529
diff changeset
    15
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    16
Goalw [tree_def] "tree(A) \\<subseteq> tree_forest(A)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
by (rtac Part_subset 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    18
qed "tree_subset_TF";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    20
Goalw [forest_def] "forest(A) \\<subseteq> tree_forest(A)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
by (rtac Part_subset 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    22
qed "forest_subset_TF";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    24
Goal "tree(A) Un forest(A) = tree_forest(A)";
739
786f32e0b64e modified for new treatment of mutual recursion
lcp
parents: 529
diff changeset
    25
by (safe_tac (subset_cs addSIs [equalityI, tree_subset_TF, forest_subset_TF]));
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    26
by (fast_tac (claset() addSIs tree_forest.intrs addEs [tree_forest.elim]) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    27
qed "TF_equals_Un";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
(** NOT useful, but interesting... **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    31
Goalw [tree_def, forest_def] 
434
89d45187f04d Various updates and tidying
lcp
parents: 279
diff changeset
    32
    "tree_forest(A) = (A*forest(A)) + ({0} + tree(A)*forest(A))";
529
f0d16216e394 ZF/List, ex/Brouwer,Data,LList,Ntree,TF,Term: much simplified proof of _unfold
lcp
parents: 515
diff changeset
    33
let open tree_forest;  
f0d16216e394 ZF/List, ex/Brouwer,Data,LList,Ntree,TF,Term: much simplified proof of _unfold
lcp
parents: 515
diff changeset
    34
    val rew = rewrite_rule (con_defs @ tl defs) in  
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    35
by (fast_tac (claset() addSIs (map rew intrs RL [PartD1]) 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
    36
end;
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 739
diff changeset
    37
qed "tree_forest_unfold";
434
89d45187f04d Various updates and tidying
lcp
parents: 279
diff changeset
    38
739
786f32e0b64e modified for new treatment of mutual recursion
lcp
parents: 529
diff changeset
    39
val tree_forest_unfold' = rewrite_rule [tree_def, forest_def] 
529
f0d16216e394 ZF/List, ex/Brouwer,Data,LList,Ntree,TF,Term: much simplified proof of _unfold
lcp
parents: 515
diff changeset
    40
                          tree_forest_unfold;
434
89d45187f04d Various updates and tidying
lcp
parents: 279
diff changeset
    41
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    42
Goalw [tree_def, forest_def]
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    43
    "tree(A) = {Inl(x). x \\<in> A*forest(A)}";
438
52e8393ccd77 minor tidying up (ordered rewriting in Integ.ML)
lcp
parents: 434
diff changeset
    44
by (rtac (Part_Inl RS subst) 1);
52e8393ccd77 minor tidying up (ordered rewriting in Integ.ML)
lcp
parents: 434
diff changeset
    45
by (rtac (tree_forest_unfold' RS subst_context) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    46
qed "tree_unfold";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4091
diff changeset
    48
Goalw [tree_def, forest_def]
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    49
    "forest(A) = {Inr(x). x \\<in> {0} + tree(A)*forest(A)}";
438
52e8393ccd77 minor tidying up (ordered rewriting in Integ.ML)
lcp
parents: 434
diff changeset
    50
by (rtac (Part_Inr RS subst) 1);
52e8393ccd77 minor tidying up (ordered rewriting in Integ.ML)
lcp
parents: 434
diff changeset
    51
by (rtac (tree_forest_unfold' RS subst_context) 1);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    52
qed "forest_unfold";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
434
89d45187f04d Various updates and tidying
lcp
parents: 279
diff changeset
    54
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
    55
(** Type checking for recursor: Not needed; possibly interesting (??) **)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    56
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    57
val major::prems = goal TF.thy
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    58
    "[| z \\<in> tree_forest(A);  \
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    59
\       !!x f r. [| x \\<in> A;  f \\<in> forest(A);  r \\<in> C(f)               \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    60
\                 |] ==> b(x,f,r): C(Tcons(x,f));       \
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    61
\       c \\<in> C(Fnil);                                            \
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    62
\       !!t f r1 r2. [| t \\<in> tree(A);  f \\<in> forest(A);  r1: C(t); r2: C(f) \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    63
\                     |] ==> d(t,f,r1,r2): C(Fcons(t,f))        \
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    64
\    |] ==> tree_forest_rec(b,c,d,z) \\<in> C(z)";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    65
by (rtac (major RS tree_forest.induct) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    66
by (ALLGOALS (asm_simp_tac (simpset() addsimps prems)));
760
f0200e91b272 added qed and qed_goal[w]
clasohm
parents: 739
diff changeset
    67
qed "TF_rec_type";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    68
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    69
(*Mutually recursive version*)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    70
val prems = goal TF.thy
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    71
    "[| !!x f r. [| x \\<in> A;  f \\<in> forest(A);  r \\<in> D(f)               \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    72
\                 |] ==> b(x,f,r): C(Tcons(x,f));               \
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    73
\       c \\<in> D(Fnil);                                            \
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    74
\       !!t f r1 r2. [| t \\<in> tree(A);  f \\<in> forest(A);  r1: C(t); r2: D(f) \
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 782
diff changeset
    75
\                     |] ==> d(t,f,r1,r2): D(Fcons(t,f))        \
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    76
\    |] ==> (\\<forall>t \\<in> tree(A).    tree_forest_rec(b,c,d,t)  \\<in> C(t)) &       \
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    77
\           (\\<forall>f \\<in> forest(A). tree_forest_rec(b,c,d,f) \\<in> D(f))";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    78
by (rewtac Ball_def);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    79
by (rtac tree_forest.mutual_induct 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3840
diff changeset
    80
by (ALLGOALS (asm_simp_tac (simpset() addsimps prems)));
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    81
qed "tree_forest_rec_type";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    82
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    83
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
    84
(** list_of_TF and of_list **)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    85
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    86
Goal "z \\<in> tree_forest(A) ==> list_of_TF(z) \\<in> list(tree(A))";
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
    87
by (etac tree_forest.induct 1);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
    88
by (ALLGOALS Asm_simp_tac);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
    89
qed "list_of_TF_type";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    90
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
    91
Goal "l \\<in> list(tree(A)) ==> of_list(l) \\<in> forest(A)";
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
    92
by (etac list.induct 1);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
    93
by (ALLGOALS Asm_simp_tac);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
    94
qed "of_list_type";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    95
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    96
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
    97
(** map **)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
    98
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
    99
val prems = Goal
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   100
    "[| !!x. x \\<in> A ==> h(x): B |] ==> \
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   101
\      (\\<forall>t \\<in> tree(A). map(h,t) \\<in> tree(B)) &  \
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   102
\      (\\<forall>f \\<in> forest(A). map(h,f) \\<in> forest(B))";
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   103
by (rewtac Ball_def);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   104
by (rtac tree_forest.mutual_induct 1);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   105
by (ALLGOALS (asm_simp_tac (simpset() addsimps prems)));
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   106
qed "map_type";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   107
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   108
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   109
(** size **)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   110
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   111
Goal "z \\<in> tree_forest(A) ==> size(z) \\<in> nat";
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   112
by (etac tree_forest.induct 1);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   113
by (ALLGOALS Asm_simp_tac);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   114
qed "size_type";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   115
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   116
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   117
(** preorder **)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   118
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   119
Goal "z \\<in> tree_forest(A) ==> preorder(z) \\<in> list(A)";
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   120
by (etac tree_forest.induct 1);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   121
by (ALLGOALS Asm_simp_tac);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   122
qed "preorder_type";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   123
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   124
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   125
(** Term simplification **)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   126
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   127
val treeI = tree_subset_TF RS subsetD
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   128
and forestI = forest_subset_TF RS subsetD;
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   129
6154
6a00a5baef2b automatic insertion of datatype intr rules into claset
paulson
parents: 6153
diff changeset
   130
AddTCs [treeI, forestI, list_of_TF_type, map_type, size_type, preorder_type];
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   131
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   132
(** theorems about list_of_TF and of_list **)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   133
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   134
(*essentially the same as list induction*)
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   135
val major::prems = Goal
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   136
    "[| f \\<in> forest(A);   \
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   137
\       R(Fnil);        \
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   138
\       !!t f. [| t \\<in> tree(A);  f \\<in> forest(A);  R(f) |] ==> R(Fcons(t,f))  \
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   139
\    |] ==> R(f)";
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   140
by (rtac (major RS (tree_forest.mutual_induct RS conjunct2 RS spec RSN (2,rev_mp))) 1);
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   141
by (REPEAT (ares_tac (TrueI::prems) 1));
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   142
qed "forest_induct";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   143
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   144
Goal "f \\<in> forest(A) ==> of_list(list_of_TF(f)) = f";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   145
by (etac forest_induct 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   146
by (ALLGOALS Asm_simp_tac);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   147
qed "forest_iso";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   148
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   149
Goal "ts: list(tree(A)) ==> list_of_TF(of_list(ts)) = ts";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   150
by (etac list.induct 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   151
by (ALLGOALS Asm_simp_tac);
782
200a16083201 added bind_thm for theorems defined by "standard ..."
clasohm
parents: 760
diff changeset
   152
qed "tree_list_iso";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   153
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   154
(** theorems about map **)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   155
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   156
Goal "z \\<in> tree_forest(A) ==> map(%u. u, z) = z";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   157
by (etac tree_forest.induct 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   158
by (ALLGOALS Asm_simp_tac);
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   159
qed "map_ident";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   160
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   161
Goal "z \\<in> tree_forest(A) ==> map(h, map(j,z)) = map(%u. h(j(u)), z)";
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   162
by (etac tree_forest.induct 1);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   163
by (ALLGOALS Asm_simp_tac);
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   164
qed "map_compose";
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   165
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   166
(** theorems about size **)
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   167
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   168
Goal "z \\<in> tree_forest(A) ==> size(map(h,z)) = size(z)";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   169
by (etac tree_forest.induct 1);
2469
b50b8c0eec01 Implicit simpsets and clasets for FOL and ZF
paulson
parents: 1461
diff changeset
   170
by (ALLGOALS Asm_simp_tac);
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   171
qed "size_map";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   172
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   173
Goal "z \\<in> tree_forest(A) ==> size(z) = length(preorder(z))";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   174
by (etac tree_forest.induct 1);
6154
6a00a5baef2b automatic insertion of datatype intr rules into claset
paulson
parents: 6153
diff changeset
   175
by (ALLGOALS (asm_simp_tac (simpset() addsimps [length_app])));
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   176
qed "size_length";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   177
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   178
(** theorems about preorder **)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   179
11316
b4e71bd751e4 X-symbols for set theory
paulson
parents: 6154
diff changeset
   180
Goal "z \\<in> tree_forest(A) ==> preorder(TF.map(h,z)) = List.map(h, preorder(z))";
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 486
diff changeset
   181
by (etac tree_forest.induct 1);
6154
6a00a5baef2b automatic insertion of datatype intr rules into claset
paulson
parents: 6153
diff changeset
   182
by (ALLGOALS (asm_simp_tac (simpset() addsimps [map_app_distrib])));
6046
2c8a8be36c94 converted to use new primrec section
paulson
parents: 5147
diff changeset
   183
qed "preorder_map";