author | paulson |
Wed, 07 Jun 2000 17:14:58 +0200 | |
changeset 9055 | f020e00c6304 |
parent 8127 | 68c6159440f1 |
child 9173 | 422968aeed49 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/Univ |
0 | 2 |
ID: $Id$ |
1461 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
435 | 4 |
Copyright 1994 University of Cambridge |
0 | 5 |
|
6 |
The cumulative hierarchy and a small universe for recursive types |
|
7 |
*) |
|
8 |
||
9 |
(*NOT SUITABLE FOR REWRITING -- RECURSIVE!*) |
|
5067 | 10 |
Goal "Vfrom(A,i) = A Un (UN j:i. Pow(Vfrom(A,j)))"; |
2033 | 11 |
by (stac (Vfrom_def RS def_transrec) 1); |
2469 | 12 |
by (Simp_tac 1); |
760 | 13 |
qed "Vfrom"; |
0 | 14 |
|
15 |
(** Monotonicity **) |
|
16 |
||
5137 | 17 |
Goal "A<=B ==> ALL j. i<=j --> Vfrom(A,i) <= Vfrom(B,j)"; |
0 | 18 |
by (eps_ind_tac "i" 1); |
19 |
by (rtac (impI RS allI) 1); |
|
2033 | 20 |
by (stac Vfrom 1); |
21 |
by (stac Vfrom 1); |
|
0 | 22 |
by (etac Un_mono 1); |
23 |
by (rtac UN_mono 1); |
|
24 |
by (assume_tac 1); |
|
25 |
by (rtac Pow_mono 1); |
|
26 |
by (etac (bspec RS spec RS mp) 1); |
|
27 |
by (assume_tac 1); |
|
28 |
by (rtac subset_refl 1); |
|
3736
39ee3d31cfbc
Much tidying including step_tac -> clarify_tac or safe_tac; sometimes
paulson
parents:
3074
diff
changeset
|
29 |
qed_spec_mp "Vfrom_mono"; |
0 | 30 |
|
31 |
||
32 |
(** A fundamental equality: Vfrom does not require ordinals! **) |
|
33 |
||
5067 | 34 |
Goal "Vfrom(A,x) <= Vfrom(A,rank(x))"; |
0 | 35 |
by (eps_ind_tac "x" 1); |
2033 | 36 |
by (stac Vfrom 1); |
37 |
by (stac Vfrom 1); |
|
4091 | 38 |
by (blast_tac (claset() addSIs [rank_lt RS ltD]) 1); |
760 | 39 |
qed "Vfrom_rank_subset1"; |
0 | 40 |
|
5067 | 41 |
Goal "Vfrom(A,rank(x)) <= Vfrom(A,x)"; |
0 | 42 |
by (eps_ind_tac "x" 1); |
2033 | 43 |
by (stac Vfrom 1); |
44 |
by (stac Vfrom 1); |
|
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
45 |
by (rtac (subset_refl RS Un_mono) 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
46 |
by (rtac UN_least 1); |
27 | 47 |
(*expand rank(x1) = (UN y:x1. succ(rank(y))) in assumptions*) |
48 |
by (etac (rank RS equalityD1 RS subsetD RS UN_E) 1); |
|
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
49 |
by (rtac subset_trans 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
50 |
by (etac UN_upper 2); |
27 | 51 |
by (rtac (subset_refl RS Vfrom_mono RS subset_trans RS Pow_mono) 1); |
52 |
by (etac (ltI RS le_imp_subset) 1); |
|
53 |
by (rtac (Ord_rank RS Ord_succ) 1); |
|
0 | 54 |
by (etac bspec 1); |
55 |
by (assume_tac 1); |
|
760 | 56 |
qed "Vfrom_rank_subset2"; |
0 | 57 |
|
5067 | 58 |
Goal "Vfrom(A,rank(x)) = Vfrom(A,x)"; |
0 | 59 |
by (rtac equalityI 1); |
60 |
by (rtac Vfrom_rank_subset2 1); |
|
61 |
by (rtac Vfrom_rank_subset1 1); |
|
760 | 62 |
qed "Vfrom_rank_eq"; |
0 | 63 |
|
64 |
||
65 |
(*** Basic closure properties ***) |
|
66 |
||
5137 | 67 |
Goal "y:x ==> 0 : Vfrom(A,x)"; |
2033 | 68 |
by (stac Vfrom 1); |
2925 | 69 |
by (Blast_tac 1); |
760 | 70 |
qed "zero_in_Vfrom"; |
0 | 71 |
|
5067 | 72 |
Goal "i <= Vfrom(A,i)"; |
0 | 73 |
by (eps_ind_tac "i" 1); |
2033 | 74 |
by (stac Vfrom 1); |
2925 | 75 |
by (Blast_tac 1); |
760 | 76 |
qed "i_subset_Vfrom"; |
0 | 77 |
|
5067 | 78 |
Goal "A <= Vfrom(A,i)"; |
2033 | 79 |
by (stac Vfrom 1); |
0 | 80 |
by (rtac Un_upper1 1); |
760 | 81 |
qed "A_subset_Vfrom"; |
0 | 82 |
|
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
83 |
bind_thm ("A_into_Vfrom", A_subset_Vfrom RS subsetD); |
488 | 84 |
|
5137 | 85 |
Goal "a <= Vfrom(A,i) ==> a: Vfrom(A,succ(i))"; |
2033 | 86 |
by (stac Vfrom 1); |
2925 | 87 |
by (Blast_tac 1); |
760 | 88 |
qed "subset_mem_Vfrom"; |
0 | 89 |
|
90 |
(** Finite sets and ordered pairs **) |
|
91 |
||
5137 | 92 |
Goal "a: Vfrom(A,i) ==> {a} : Vfrom(A,succ(i))"; |
0 | 93 |
by (rtac subset_mem_Vfrom 1); |
4152 | 94 |
by Safe_tac; |
760 | 95 |
qed "singleton_in_Vfrom"; |
0 | 96 |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
97 |
Goal "[| a: Vfrom(A,i); b: Vfrom(A,i) |] ==> {a,b} : Vfrom(A,succ(i))"; |
0 | 98 |
by (rtac subset_mem_Vfrom 1); |
4152 | 99 |
by Safe_tac; |
760 | 100 |
qed "doubleton_in_Vfrom"; |
0 | 101 |
|
5067 | 102 |
Goalw [Pair_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
103 |
"[| a: Vfrom(A,i); b: Vfrom(A,i) |] ==> \ |
0 | 104 |
\ <a,b> : Vfrom(A,succ(succ(i)))"; |
105 |
by (REPEAT (ares_tac [doubleton_in_Vfrom] 1)); |
|
760 | 106 |
qed "Pair_in_Vfrom"; |
0 | 107 |
|
5321 | 108 |
Goal "a<=Vfrom(A,i) ==> succ(a) : Vfrom(A,succ(succ(i)))"; |
0 | 109 |
by (REPEAT (resolve_tac [subset_mem_Vfrom, succ_subsetI] 1)); |
110 |
by (rtac (Vfrom_mono RSN (2,subset_trans)) 2); |
|
5321 | 111 |
by (REPEAT (ares_tac [subset_refl, subset_succI] 1)); |
760 | 112 |
qed "succ_in_Vfrom"; |
0 | 113 |
|
114 |
(*** 0, successor and limit equations fof Vfrom ***) |
|
115 |
||
5067 | 116 |
Goal "Vfrom(A,0) = A"; |
2033 | 117 |
by (stac Vfrom 1); |
2925 | 118 |
by (Blast_tac 1); |
760 | 119 |
qed "Vfrom_0"; |
0 | 120 |
|
5137 | 121 |
Goal "Ord(i) ==> Vfrom(A,succ(i)) = A Un Pow(Vfrom(A,i))"; |
0 | 122 |
by (rtac (Vfrom RS trans) 1); |
6
8ce8c4d13d4d
Installation of new simplifier for ZF. Deleted all congruence rules not
lcp
parents:
0
diff
changeset
|
123 |
by (rtac (succI1 RS RepFunI RS Union_upper RSN |
1461 | 124 |
(2, equalityI RS subst_context)) 1); |
0 | 125 |
by (rtac UN_least 1); |
126 |
by (rtac (subset_refl RS Vfrom_mono RS Pow_mono) 1); |
|
27 | 127 |
by (etac (ltI RS le_imp_subset) 1); |
128 |
by (etac Ord_succ 1); |
|
760 | 129 |
qed "Vfrom_succ_lemma"; |
0 | 130 |
|
5067 | 131 |
Goal "Vfrom(A,succ(i)) = A Un Pow(Vfrom(A,i))"; |
0 | 132 |
by (res_inst_tac [("x1", "succ(i)")] (Vfrom_rank_eq RS subst) 1); |
133 |
by (res_inst_tac [("x1", "i")] (Vfrom_rank_eq RS subst) 1); |
|
2033 | 134 |
by (stac rank_succ 1); |
0 | 135 |
by (rtac (Ord_rank RS Vfrom_succ_lemma) 1); |
760 | 136 |
qed "Vfrom_succ"; |
0 | 137 |
|
138 |
(*The premise distinguishes this from Vfrom(A,0); allowing X=0 forces |
|
139 |
the conclusion to be Vfrom(A,Union(X)) = A Un (UN y:X. Vfrom(A,y)) *) |
|
5321 | 140 |
Goal "y:X ==> Vfrom(A,Union(X)) = (UN y:X. Vfrom(A,y))"; |
141 |
by (stac Vfrom 1); |
|
142 |
by (rtac equalityI 1); |
|
143 |
(*first inclusion*) |
|
144 |
by (rtac Un_least 1); |
|
145 |
by (rtac (A_subset_Vfrom RS subset_trans) 1); |
|
146 |
by (rtac UN_upper 1); |
|
147 |
by (assume_tac 1); |
|
148 |
by (rtac UN_least 1); |
|
149 |
by (etac UnionE 1); |
|
150 |
by (rtac subset_trans 1); |
|
151 |
by (etac UN_upper 2 THEN stac Vfrom 1 THEN |
|
152 |
etac ([UN_upper, Un_upper2] MRS subset_trans) 1); |
|
153 |
(*opposite inclusion*) |
|
154 |
by (rtac UN_least 1); |
|
155 |
by (stac Vfrom 1); |
|
156 |
by (Blast_tac 1); |
|
157 |
qed "Vfrom_Union"; |
|
158 |
||
0 | 159 |
val [prem] = goal Univ.thy "y:X ==> Vfrom(A,Union(X)) = (UN y:X. Vfrom(A,y))"; |
2033 | 160 |
by (stac Vfrom 1); |
0 | 161 |
by (rtac equalityI 1); |
162 |
(*first inclusion*) |
|
163 |
by (rtac Un_least 1); |
|
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
164 |
by (rtac (A_subset_Vfrom RS subset_trans) 1); |
5321 | 165 |
|
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
166 |
by (rtac (prem RS UN_upper) 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
167 |
by (rtac UN_least 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
168 |
by (etac UnionE 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
169 |
by (rtac subset_trans 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
170 |
by (etac UN_upper 2); |
2033 | 171 |
by (stac Vfrom 1); |
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
172 |
by (etac ([UN_upper, Un_upper2] MRS subset_trans) 1); |
0 | 173 |
(*opposite inclusion*) |
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
174 |
by (rtac UN_least 1); |
2033 | 175 |
by (stac Vfrom 1); |
2925 | 176 |
by (Blast_tac 1); |
760 | 177 |
qed "Vfrom_Union"; |
0 | 178 |
|
179 |
(*** Vfrom applied to Limit ordinals ***) |
|
180 |
||
181 |
(*NB. limit ordinals are non-empty; |
|
182 |
Vfrom(A,0) = A = A Un (UN y:0. Vfrom(A,y)) *) |
|
183 |
val [limiti] = goal Univ.thy |
|
184 |
"Limit(i) ==> Vfrom(A,i) = (UN y:i. Vfrom(A,y))"; |
|
27 | 185 |
by (rtac (limiti RS (Limit_has_0 RS ltD) RS Vfrom_Union RS subst) 1); |
2033 | 186 |
by (stac (limiti RS Limit_Union_eq) 1); |
0 | 187 |
by (rtac refl 1); |
760 | 188 |
qed "Limit_Vfrom_eq"; |
0 | 189 |
|
5137 | 190 |
Goal "[| a: Vfrom(A,j); Limit(i); j<i |] ==> a : Vfrom(A,i)"; |
27 | 191 |
by (rtac (Limit_Vfrom_eq RS equalityD2 RS subsetD) 1); |
192 |
by (REPEAT (ares_tac [ltD RS UN_I] 1)); |
|
760 | 193 |
qed "Limit_VfromI"; |
27 | 194 |
|
5321 | 195 |
val prems = Goal |
1461 | 196 |
"[| a: Vfrom(A,i); Limit(i); \ |
197 |
\ !!x. [| x<i; a: Vfrom(A,x) |] ==> R \ |
|
27 | 198 |
\ |] ==> R"; |
199 |
by (rtac (Limit_Vfrom_eq RS equalityD1 RS subsetD RS UN_E) 1); |
|
200 |
by (REPEAT (ares_tac (prems @ [ltI, Limit_is_Ord]) 1)); |
|
760 | 201 |
qed "Limit_VfromE"; |
0 | 202 |
|
516 | 203 |
val zero_in_VLimit = Limit_has_0 RS ltD RS zero_in_Vfrom; |
484 | 204 |
|
0 | 205 |
val [major,limiti] = goal Univ.thy |
206 |
"[| a: Vfrom(A,i); Limit(i) |] ==> {a} : Vfrom(A,i)"; |
|
27 | 207 |
by (rtac ([major,limiti] MRS Limit_VfromE) 1); |
208 |
by (etac ([singleton_in_Vfrom, limiti] MRS Limit_VfromI) 1); |
|
0 | 209 |
by (etac (limiti RS Limit_has_succ) 1); |
760 | 210 |
qed "singleton_in_VLimit"; |
0 | 211 |
|
212 |
val Vfrom_UnI1 = Un_upper1 RS (subset_refl RS Vfrom_mono RS subsetD) |
|
213 |
and Vfrom_UnI2 = Un_upper2 RS (subset_refl RS Vfrom_mono RS subsetD); |
|
214 |
||
215 |
(*Hard work is finding a single j:i such that {a,b}<=Vfrom(A,j)*) |
|
216 |
val [aprem,bprem,limiti] = goal Univ.thy |
|
217 |
"[| a: Vfrom(A,i); b: Vfrom(A,i); Limit(i) |] ==> \ |
|
218 |
\ {a,b} : Vfrom(A,i)"; |
|
27 | 219 |
by (rtac ([aprem,limiti] MRS Limit_VfromE) 1); |
220 |
by (rtac ([bprem,limiti] MRS Limit_VfromE) 1); |
|
221 |
by (rtac ([doubleton_in_Vfrom, limiti] MRS Limit_VfromI) 1); |
|
222 |
by (etac Vfrom_UnI1 1); |
|
223 |
by (etac Vfrom_UnI2 1); |
|
224 |
by (REPEAT (ares_tac [limiti, Limit_has_succ, Un_least_lt] 1)); |
|
760 | 225 |
qed "doubleton_in_VLimit"; |
0 | 226 |
|
227 |
val [aprem,bprem,limiti] = goal Univ.thy |
|
228 |
"[| a: Vfrom(A,i); b: Vfrom(A,i); Limit(i) |] ==> \ |
|
229 |
\ <a,b> : Vfrom(A,i)"; |
|
230 |
(*Infer that a, b occur at ordinals x,xa < i.*) |
|
27 | 231 |
by (rtac ([aprem,limiti] MRS Limit_VfromE) 1); |
232 |
by (rtac ([bprem,limiti] MRS Limit_VfromE) 1); |
|
233 |
by (rtac ([Pair_in_Vfrom, limiti] MRS Limit_VfromI) 1); |
|
0 | 234 |
(*Infer that succ(succ(x Un xa)) < i *) |
27 | 235 |
by (etac Vfrom_UnI1 1); |
236 |
by (etac Vfrom_UnI2 1); |
|
237 |
by (REPEAT (ares_tac [limiti, Limit_has_succ, Un_least_lt] 1)); |
|
760 | 238 |
qed "Pair_in_VLimit"; |
484 | 239 |
|
5137 | 240 |
Goal "Limit(i) ==> Vfrom(A,i)*Vfrom(A,i) <= Vfrom(A,i)"; |
516 | 241 |
by (REPEAT (ares_tac [subsetI,Pair_in_VLimit] 1 |
484 | 242 |
ORELSE eresolve_tac [SigmaE, ssubst] 1)); |
760 | 243 |
qed "product_VLimit"; |
484 | 244 |
|
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
245 |
bind_thm ("Sigma_subset_VLimit", |
1461 | 246 |
[Sigma_mono, product_VLimit] MRS subset_trans); |
484 | 247 |
|
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
248 |
bind_thm ("nat_subset_VLimit", |
1461 | 249 |
[nat_le_Limit RS le_imp_subset, i_subset_Vfrom] MRS subset_trans); |
484 | 250 |
|
5137 | 251 |
Goal "[| n: nat; Limit(i) |] ==> n : Vfrom(A,i)"; |
516 | 252 |
by (REPEAT (ares_tac [nat_subset_VLimit RS subsetD] 1)); |
760 | 253 |
qed "nat_into_VLimit"; |
484 | 254 |
|
255 |
(** Closure under disjoint union **) |
|
256 |
||
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
257 |
bind_thm ("zero_in_VLimit", Limit_has_0 RS ltD RS zero_in_Vfrom); |
484 | 258 |
|
5137 | 259 |
Goal "Limit(i) ==> 1 : Vfrom(A,i)"; |
516 | 260 |
by (REPEAT (ares_tac [nat_into_VLimit, nat_0I, nat_succI] 1)); |
760 | 261 |
qed "one_in_VLimit"; |
484 | 262 |
|
5067 | 263 |
Goalw [Inl_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
264 |
"[| a: Vfrom(A,i); Limit(i) |] ==> Inl(a) : Vfrom(A,i)"; |
516 | 265 |
by (REPEAT (ares_tac [zero_in_VLimit, Pair_in_VLimit] 1)); |
760 | 266 |
qed "Inl_in_VLimit"; |
484 | 267 |
|
5067 | 268 |
Goalw [Inr_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
269 |
"[| b: Vfrom(A,i); Limit(i) |] ==> Inr(b) : Vfrom(A,i)"; |
516 | 270 |
by (REPEAT (ares_tac [one_in_VLimit, Pair_in_VLimit] 1)); |
760 | 271 |
qed "Inr_in_VLimit"; |
484 | 272 |
|
5137 | 273 |
Goal "Limit(i) ==> Vfrom(C,i)+Vfrom(C,i) <= Vfrom(C,i)"; |
4091 | 274 |
by (blast_tac (claset() addSIs [Inl_in_VLimit, Inr_in_VLimit]) 1); |
760 | 275 |
qed "sum_VLimit"; |
484 | 276 |
|
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
277 |
bind_thm ("sum_subset_VLimit", [sum_mono, sum_VLimit] MRS subset_trans); |
484 | 278 |
|
0 | 279 |
|
280 |
||
281 |
(*** Properties assuming Transset(A) ***) |
|
282 |
||
5137 | 283 |
Goal "Transset(A) ==> Transset(Vfrom(A,i))"; |
0 | 284 |
by (eps_ind_tac "i" 1); |
2033 | 285 |
by (stac Vfrom 1); |
4091 | 286 |
by (blast_tac (claset() addSIs [Transset_Union_family, Transset_Un, |
1461 | 287 |
Transset_Pow]) 1); |
760 | 288 |
qed "Transset_Vfrom"; |
0 | 289 |
|
5137 | 290 |
Goal "Transset(A) ==> Vfrom(A, succ(i)) = Pow(Vfrom(A,i))"; |
0 | 291 |
by (rtac (Vfrom_succ RS trans) 1); |
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
292 |
by (rtac (Un_upper2 RSN (2,equalityI)) 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
293 |
by (rtac (subset_refl RSN (2,Un_least)) 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
294 |
by (rtac (A_subset_Vfrom RS subset_trans) 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
295 |
by (etac (Transset_Vfrom RS (Transset_iff_Pow RS iffD1)) 1); |
760 | 296 |
qed "Transset_Vfrom_succ"; |
0 | 297 |
|
5321 | 298 |
Goalw [Pair_def,Transset_def] "[| <a,b> <= C; Transset(C) |] ==> a: C & b: C"; |
2925 | 299 |
by (Blast_tac 1); |
760 | 300 |
qed "Transset_Pair_subset"; |
0 | 301 |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
302 |
Goal "[| <a,b> <= Vfrom(A,i); Transset(A); Limit(i) |] ==> \ |
0 | 303 |
\ <a,b> : Vfrom(A,i)"; |
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
304 |
by (etac (Transset_Pair_subset RS conjE) 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
305 |
by (etac Transset_Vfrom 1); |
516 | 306 |
by (REPEAT (ares_tac [Pair_in_VLimit] 1)); |
760 | 307 |
qed "Transset_Pair_subset_VLimit"; |
0 | 308 |
|
309 |
||
310 |
(*** Closure under product/sum applied to elements -- thus Vfrom(A,i) |
|
311 |
is a model of simple type theory provided A is a transitive set |
|
312 |
and i is a limit ordinal |
|
313 |
***) |
|
314 |
||
187 | 315 |
(*General theorem for membership in Vfrom(A,i) when i is a limit ordinal*) |
5321 | 316 |
val [aprem,bprem,limiti,step] = Goal |
1461 | 317 |
"[| a: Vfrom(A,i); b: Vfrom(A,i); Limit(i); \ |
187 | 318 |
\ !!x y j. [| j<i; 1:j; x: Vfrom(A,j); y: Vfrom(A,j) \ |
1461 | 319 |
\ |] ==> EX k. h(x,y): Vfrom(A,k) & k<i |] ==> \ |
187 | 320 |
\ h(a,b) : Vfrom(A,i)"; |
321 |
(*Infer that a, b occur at ordinals x,xa < i.*) |
|
322 |
by (rtac ([aprem,limiti] MRS Limit_VfromE) 1); |
|
323 |
by (rtac ([bprem,limiti] MRS Limit_VfromE) 1); |
|
828 | 324 |
by (res_inst_tac [("j1", "x Un xa Un 2")] (step RS exE) 1); |
6071 | 325 |
by (blast_tac (claset() addIs [Limit_VfromI, limiti]) 5); |
187 | 326 |
by (etac (Vfrom_UnI2 RS Vfrom_UnI1) 4); |
327 |
by (etac (Vfrom_UnI1 RS Vfrom_UnI1) 3); |
|
328 |
by (rtac (succI1 RS UnI2) 2); |
|
329 |
by (REPEAT (ares_tac [limiti, Limit_has_0, Limit_has_succ, Un_least_lt] 1)); |
|
760 | 330 |
qed "in_VLimit"; |
0 | 331 |
|
332 |
(** products **) |
|
333 |
||
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
334 |
Goal "[| a: Vfrom(A,j); b: Vfrom(A,j); Transset(A) |] ==> \ |
187 | 335 |
\ a*b : Vfrom(A, succ(succ(succ(j))))"; |
0 | 336 |
by (dtac Transset_Vfrom 1); |
337 |
by (rtac subset_mem_Vfrom 1); |
|
338 |
by (rewtac Transset_def); |
|
4091 | 339 |
by (blast_tac (claset() addIs [Pair_in_Vfrom]) 1); |
760 | 340 |
qed "prod_in_Vfrom"; |
0 | 341 |
|
342 |
val [aprem,bprem,limiti,transset] = goal Univ.thy |
|
343 |
"[| a: Vfrom(A,i); b: Vfrom(A,i); Limit(i); Transset(A) |] ==> \ |
|
344 |
\ a*b : Vfrom(A,i)"; |
|
516 | 345 |
by (rtac ([aprem,bprem,limiti] MRS in_VLimit) 1); |
187 | 346 |
by (REPEAT (ares_tac [exI, conjI, prod_in_Vfrom, transset, |
1461 | 347 |
limiti RS Limit_has_succ] 1)); |
760 | 348 |
qed "prod_in_VLimit"; |
0 | 349 |
|
350 |
(** Disjoint sums, aka Quine ordered pairs **) |
|
351 |
||
5067 | 352 |
Goalw [sum_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
353 |
"[| a: Vfrom(A,j); b: Vfrom(A,j); Transset(A); 1:j |] ==> \ |
187 | 354 |
\ a+b : Vfrom(A, succ(succ(succ(j))))"; |
0 | 355 |
by (dtac Transset_Vfrom 1); |
356 |
by (rtac subset_mem_Vfrom 1); |
|
357 |
by (rewtac Transset_def); |
|
4091 | 358 |
by (blast_tac (claset() addIs [zero_in_Vfrom, Pair_in_Vfrom, |
1461 | 359 |
i_subset_Vfrom RS subsetD]) 1); |
760 | 360 |
qed "sum_in_Vfrom"; |
0 | 361 |
|
362 |
val [aprem,bprem,limiti,transset] = goal Univ.thy |
|
363 |
"[| a: Vfrom(A,i); b: Vfrom(A,i); Limit(i); Transset(A) |] ==> \ |
|
364 |
\ a+b : Vfrom(A,i)"; |
|
516 | 365 |
by (rtac ([aprem,bprem,limiti] MRS in_VLimit) 1); |
187 | 366 |
by (REPEAT (ares_tac [exI, conjI, sum_in_Vfrom, transset, |
1461 | 367 |
limiti RS Limit_has_succ] 1)); |
760 | 368 |
qed "sum_in_VLimit"; |
0 | 369 |
|
370 |
(** function space! **) |
|
371 |
||
5067 | 372 |
Goalw [Pi_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
373 |
"[| a: Vfrom(A,j); b: Vfrom(A,j); Transset(A) |] ==> \ |
187 | 374 |
\ a->b : Vfrom(A, succ(succ(succ(succ(j)))))"; |
0 | 375 |
by (dtac Transset_Vfrom 1); |
376 |
by (rtac subset_mem_Vfrom 1); |
|
377 |
by (rtac (Collect_subset RS subset_trans) 1); |
|
2033 | 378 |
by (stac Vfrom 1); |
0 | 379 |
by (rtac (subset_trans RS subset_trans) 1); |
380 |
by (rtac Un_upper2 3); |
|
381 |
by (rtac (succI1 RS UN_upper) 2); |
|
382 |
by (rtac Pow_mono 1); |
|
383 |
by (rewtac Transset_def); |
|
4091 | 384 |
by (blast_tac (claset() addIs [Pair_in_Vfrom]) 1); |
760 | 385 |
qed "fun_in_Vfrom"; |
0 | 386 |
|
387 |
val [aprem,bprem,limiti,transset] = goal Univ.thy |
|
388 |
"[| a: Vfrom(A,i); b: Vfrom(A,i); Limit(i); Transset(A) |] ==> \ |
|
389 |
\ a->b : Vfrom(A,i)"; |
|
516 | 390 |
by (rtac ([aprem,bprem,limiti] MRS in_VLimit) 1); |
187 | 391 |
by (REPEAT (ares_tac [exI, conjI, fun_in_Vfrom, transset, |
1461 | 392 |
limiti RS Limit_has_succ] 1)); |
760 | 393 |
qed "fun_in_VLimit"; |
0 | 394 |
|
5067 | 395 |
Goalw [Pi_def] |
5321 | 396 |
"[| a: Vfrom(A,j); Transset(A) |] ==> Pow(a) : Vfrom(A, succ(succ(j)))"; |
3074 | 397 |
by (dtac Transset_Vfrom 1); |
398 |
by (rtac subset_mem_Vfrom 1); |
|
399 |
by (rewtac Transset_def); |
|
400 |
by (stac Vfrom 1); |
|
401 |
by (Blast_tac 1); |
|
402 |
qed "Pow_in_Vfrom"; |
|
403 |
||
5268 | 404 |
Goal "[| a: Vfrom(A,i); Limit(i); Transset(A) |] ==> Pow(a) : Vfrom(A,i)"; |
5479 | 405 |
by (blast_tac (claset() addEs [Limit_VfromE] |
406 |
addIs [Limit_has_succ, Pow_in_Vfrom, Limit_VfromI]) 1); |
|
3074 | 407 |
qed "Pow_in_VLimit"; |
408 |
||
0 | 409 |
|
410 |
(*** The set Vset(i) ***) |
|
411 |
||
5067 | 412 |
Goal "Vset(i) = (UN j:i. Pow(Vset(j)))"; |
2033 | 413 |
by (stac Vfrom 1); |
2925 | 414 |
by (Blast_tac 1); |
760 | 415 |
qed "Vset"; |
0 | 416 |
|
417 |
val Vset_succ = Transset_0 RS Transset_Vfrom_succ; |
|
418 |
||
419 |
val Transset_Vset = Transset_0 RS Transset_Vfrom; |
|
420 |
||
421 |
(** Characterisation of the elements of Vset(i) **) |
|
422 |
||
5321 | 423 |
Goal "Ord(i) ==> ALL b. b : Vset(i) --> rank(b) < i"; |
424 |
by (etac trans_induct 1); |
|
2033 | 425 |
by (stac Vset 1); |
4152 | 426 |
by Safe_tac; |
2033 | 427 |
by (stac rank 1); |
27 | 428 |
by (rtac UN_succ_least_lt 1); |
2925 | 429 |
by (Blast_tac 2); |
27 | 430 |
by (REPEAT (ares_tac [ltI] 1)); |
3736
39ee3d31cfbc
Much tidying including step_tac -> clarify_tac or safe_tac; sometimes
paulson
parents:
3074
diff
changeset
|
431 |
qed_spec_mp "VsetD"; |
0 | 432 |
|
5321 | 433 |
Goal "Ord(i) ==> ALL b. rank(b) : i --> b : Vset(i)"; |
434 |
by (etac trans_induct 1); |
|
0 | 435 |
by (rtac allI 1); |
2033 | 436 |
by (stac Vset 1); |
4091 | 437 |
by (blast_tac (claset() addSIs [rank_lt RS ltD]) 1); |
3736
39ee3d31cfbc
Much tidying including step_tac -> clarify_tac or safe_tac; sometimes
paulson
parents:
3074
diff
changeset
|
438 |
val lemma = result(); |
0 | 439 |
|
5137 | 440 |
Goal "rank(x)<i ==> x : Vset(i)"; |
27 | 441 |
by (etac ltE 1); |
3736
39ee3d31cfbc
Much tidying including step_tac -> clarify_tac or safe_tac; sometimes
paulson
parents:
3074
diff
changeset
|
442 |
by (etac (lemma RS spec RS mp) 1); |
27 | 443 |
by (assume_tac 1); |
760 | 444 |
qed "VsetI"; |
0 | 445 |
|
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
446 |
(*Merely a lemma for the result following*) |
5137 | 447 |
Goal "Ord(i) ==> b : Vset(i) <-> rank(b) < i"; |
0 | 448 |
by (rtac iffI 1); |
27 | 449 |
by (REPEAT (eresolve_tac [asm_rl, VsetD, VsetI] 1)); |
760 | 450 |
qed "Vset_Ord_rank_iff"; |
0 | 451 |
|
5067 | 452 |
Goal "b : Vset(a) <-> rank(b) < rank(a)"; |
0 | 453 |
by (rtac (Vfrom_rank_eq RS subst) 1); |
454 |
by (rtac (Ord_rank RS Vset_Ord_rank_iff) 1); |
|
760 | 455 |
qed "Vset_rank_iff"; |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
456 |
Addsimps [Vset_rank_iff]; |
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
457 |
|
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
458 |
(*This is rank(rank(a)) = rank(a) *) |
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
459 |
Addsimps [Ord_rank RS rank_of_Ord]; |
0 | 460 |
|
5137 | 461 |
Goal "Ord(i) ==> rank(Vset(i)) = i"; |
2033 | 462 |
by (stac rank 1); |
0 | 463 |
by (rtac equalityI 1); |
4152 | 464 |
by Safe_tac; |
828 | 465 |
by (EVERY' [rtac UN_I, |
1461 | 466 |
etac (i_subset_Vfrom RS subsetD), |
467 |
etac (Ord_in_Ord RS rank_of_Ord RS ssubst), |
|
468 |
assume_tac, |
|
469 |
rtac succI1] 3); |
|
27 | 470 |
by (REPEAT (eresolve_tac [asm_rl, VsetD RS ltD, Ord_trans] 1)); |
760 | 471 |
qed "rank_Vset"; |
0 | 472 |
|
473 |
(** Lemmas for reasoning about sets in terms of their elements' ranks **) |
|
474 |
||
5067 | 475 |
Goal "a <= Vset(rank(a))"; |
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
476 |
by (rtac subsetI 1); |
27 | 477 |
by (etac (rank_lt RS VsetI) 1); |
760 | 478 |
qed "arg_subset_Vset_rank"; |
0 | 479 |
|
5321 | 480 |
val [iprem] = Goal |
0 | 481 |
"[| !!i. Ord(i) ==> a Int Vset(i) <= b |] ==> a <= b"; |
27 | 482 |
by (rtac ([subset_refl, arg_subset_Vset_rank] MRS |
1461 | 483 |
Int_greatest RS subset_trans) 1); |
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
484 |
by (rtac (Ord_rank RS iprem) 1); |
760 | 485 |
qed "Int_Vset_subset"; |
0 | 486 |
|
487 |
(** Set up an environment for simplification **) |
|
488 |
||
5067 | 489 |
Goalw [Inl_def] "rank(a) < rank(Inl(a))"; |
3889
59bab7a52b4c
moved rank_Inl, rank_Inr from Epsilon.ML to Univ.ML;
wenzelm
parents:
3736
diff
changeset
|
490 |
by (rtac rank_pair2 1); |
59bab7a52b4c
moved rank_Inl, rank_Inr from Epsilon.ML to Univ.ML;
wenzelm
parents:
3736
diff
changeset
|
491 |
qed "rank_Inl"; |
59bab7a52b4c
moved rank_Inl, rank_Inr from Epsilon.ML to Univ.ML;
wenzelm
parents:
3736
diff
changeset
|
492 |
|
5067 | 493 |
Goalw [Inr_def] "rank(a) < rank(Inr(a))"; |
3889
59bab7a52b4c
moved rank_Inl, rank_Inr from Epsilon.ML to Univ.ML;
wenzelm
parents:
3736
diff
changeset
|
494 |
by (rtac rank_pair2 1); |
59bab7a52b4c
moved rank_Inl, rank_Inr from Epsilon.ML to Univ.ML;
wenzelm
parents:
3736
diff
changeset
|
495 |
qed "rank_Inr"; |
59bab7a52b4c
moved rank_Inl, rank_Inr from Epsilon.ML to Univ.ML;
wenzelm
parents:
3736
diff
changeset
|
496 |
|
0 | 497 |
val rank_rls = [rank_Inl, rank_Inr, rank_pair1, rank_pair2]; |
27 | 498 |
val rank_trans_rls = rank_rls @ (rank_rls RLN (2, [lt_trans])); |
0 | 499 |
|
4091 | 500 |
val rank_ss = simpset() addsimps [VsetI] addsimps rank_trans_rls; |
0 | 501 |
|
502 |
(** Recursion over Vset levels! **) |
|
503 |
||
504 |
(*NOT SUITABLE FOR REWRITING: recursive!*) |
|
5067 | 505 |
Goalw [Vrec_def] "Vrec(a,H) = H(a, lam x:Vset(rank(a)). Vrec(x,H))"; |
2033 | 506 |
by (stac transrec 1); |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
507 |
by (Simp_tac 1); |
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
508 |
by (rtac (refl RS lam_cong RS subst_context) 1); |
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
509 |
by (Asm_full_simp_tac 1); |
760 | 510 |
qed "Vrec"; |
0 | 511 |
|
512 |
(*This form avoids giant explosions in proofs. NOTE USE OF == *) |
|
5321 | 513 |
val rew::prems = Goal |
0 | 514 |
"[| !!x. h(x)==Vrec(x,H) |] ==> \ |
515 |
\ h(a) = H(a, lam x: Vset(rank(a)). h(x))"; |
|
516 |
by (rewtac rew); |
|
517 |
by (rtac Vrec 1); |
|
760 | 518 |
qed "def_Vrec"; |
0 | 519 |
|
6053
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
520 |
(*NOT SUITABLE FOR REWRITING: recursive!*) |
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
521 |
Goalw [Vrecursor_def] |
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
522 |
"Vrecursor(H,a) = H(lam x:Vset(rank(a)). Vrecursor(H,x), a)"; |
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
523 |
by (stac transrec 1); |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
524 |
by (Simp_tac 1); |
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
525 |
by (rtac (refl RS lam_cong RS subst_context) 1); |
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6071
diff
changeset
|
526 |
by (Asm_full_simp_tac 1); |
6053
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
527 |
qed "Vrecursor"; |
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
528 |
|
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
529 |
(*This form avoids giant explosions in proofs. NOTE USE OF == *) |
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
530 |
Goal "h == Vrecursor(H) ==> h(a) = H(lam x: Vset(rank(a)). h(x), a)"; |
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
531 |
by (Asm_simp_tac 1); |
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
532 |
by (rtac Vrecursor 1); |
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
533 |
qed "def_Vrecursor"; |
8a1059aa01f0
new inductive, datatype and primrec packages, etc.
paulson
parents:
5479
diff
changeset
|
534 |
|
0 | 535 |
|
536 |
(*** univ(A) ***) |
|
537 |
||
5137 | 538 |
Goalw [univ_def] "A<=B ==> univ(A) <= univ(B)"; |
0 | 539 |
by (etac Vfrom_mono 1); |
540 |
by (rtac subset_refl 1); |
|
760 | 541 |
qed "univ_mono"; |
0 | 542 |
|
5137 | 543 |
Goalw [univ_def] "Transset(A) ==> Transset(univ(A))"; |
0 | 544 |
by (etac Transset_Vfrom 1); |
760 | 545 |
qed "Transset_univ"; |
0 | 546 |
|
547 |
(** univ(A) as a limit **) |
|
548 |
||
5067 | 549 |
Goalw [univ_def] "univ(A) = (UN i:nat. Vfrom(A,i))"; |
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
550 |
by (rtac (Limit_nat RS Limit_Vfrom_eq) 1); |
760 | 551 |
qed "univ_eq_UN"; |
0 | 552 |
|
5137 | 553 |
Goal "c <= univ(A) ==> c = (UN i:nat. c Int Vfrom(A,i))"; |
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
554 |
by (rtac (subset_UN_iff_eq RS iffD1) 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
555 |
by (etac (univ_eq_UN RS subst) 1); |
760 | 556 |
qed "subset_univ_eq_Int"; |
0 | 557 |
|
5321 | 558 |
val [aprem, iprem] = Goal |
1461 | 559 |
"[| a <= univ(X); \ |
560 |
\ !!i. i:nat ==> a Int Vfrom(X,i) <= b \ |
|
0 | 561 |
\ |] ==> a <= b"; |
2033 | 562 |
by (stac (aprem RS subset_univ_eq_Int) 1); |
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
563 |
by (rtac UN_least 1); |
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
564 |
by (etac iprem 1); |
760 | 565 |
qed "univ_Int_Vfrom_subset"; |
0 | 566 |
|
5321 | 567 |
val prems = Goal |
0 | 568 |
"[| a <= univ(X); b <= univ(X); \ |
569 |
\ !!i. i:nat ==> a Int Vfrom(X,i) = b Int Vfrom(X,i) \ |
|
570 |
\ |] ==> a = b"; |
|
15
6c6d2f6e3185
ex/{bin.ML,comb.ML,prop.ML}: replaced NewSext by Syntax.simple_sext
lcp
parents:
6
diff
changeset
|
571 |
by (rtac equalityI 1); |
0 | 572 |
by (ALLGOALS |
573 |
(resolve_tac (prems RL [univ_Int_Vfrom_subset]) THEN' |
|
574 |
eresolve_tac (prems RL [equalityD1,equalityD2] RL [subset_trans]) THEN' |
|
575 |
rtac Int_lower1)); |
|
760 | 576 |
qed "univ_Int_Vfrom_eq"; |
0 | 577 |
|
578 |
(** Closure properties **) |
|
579 |
||
5067 | 580 |
Goalw [univ_def] "0 : univ(A)"; |
0 | 581 |
by (rtac (nat_0I RS zero_in_Vfrom) 1); |
760 | 582 |
qed "zero_in_univ"; |
0 | 583 |
|
5067 | 584 |
Goalw [univ_def] "A <= univ(A)"; |
0 | 585 |
by (rtac A_subset_Vfrom 1); |
760 | 586 |
qed "A_subset_univ"; |
0 | 587 |
|
588 |
val A_into_univ = A_subset_univ RS subsetD; |
|
589 |
||
590 |
(** Closure under unordered and ordered pairs **) |
|
591 |
||
5137 | 592 |
Goalw [univ_def] "a: univ(A) ==> {a} : univ(A)"; |
516 | 593 |
by (REPEAT (ares_tac [singleton_in_VLimit, Limit_nat] 1)); |
760 | 594 |
qed "singleton_in_univ"; |
0 | 595 |
|
5067 | 596 |
Goalw [univ_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
597 |
"[| a: univ(A); b: univ(A) |] ==> {a,b} : univ(A)"; |
516 | 598 |
by (REPEAT (ares_tac [doubleton_in_VLimit, Limit_nat] 1)); |
760 | 599 |
qed "doubleton_in_univ"; |
0 | 600 |
|
5067 | 601 |
Goalw [univ_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
602 |
"[| a: univ(A); b: univ(A) |] ==> <a,b> : univ(A)"; |
516 | 603 |
by (REPEAT (ares_tac [Pair_in_VLimit, Limit_nat] 1)); |
760 | 604 |
qed "Pair_in_univ"; |
0 | 605 |
|
5067 | 606 |
Goalw [univ_def] "univ(A)*univ(A) <= univ(A)"; |
516 | 607 |
by (rtac (Limit_nat RS product_VLimit) 1); |
760 | 608 |
qed "product_univ"; |
0 | 609 |
|
610 |
||
611 |
(** The natural numbers **) |
|
612 |
||
5067 | 613 |
Goalw [univ_def] "nat <= univ(A)"; |
0 | 614 |
by (rtac i_subset_Vfrom 1); |
760 | 615 |
qed "nat_subset_univ"; |
0 | 616 |
|
617 |
(* n:nat ==> n:univ(A) *) |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
618 |
bind_thm ("nat_into_univ", (nat_subset_univ RS subsetD)); |
0 | 619 |
|
620 |
(** instances for 1 and 2 **) |
|
621 |
||
5067 | 622 |
Goalw [univ_def] "1 : univ(A)"; |
516 | 623 |
by (rtac (Limit_nat RS one_in_VLimit) 1); |
760 | 624 |
qed "one_in_univ"; |
0 | 625 |
|
626 |
(*unused!*) |
|
5067 | 627 |
Goal "2 : univ(A)"; |
0 | 628 |
by (REPEAT (ares_tac [nat_into_univ, nat_0I, nat_succI] 1)); |
760 | 629 |
qed "two_in_univ"; |
0 | 630 |
|
5067 | 631 |
Goalw [bool_def] "bool <= univ(A)"; |
4091 | 632 |
by (blast_tac (claset() addSIs [zero_in_univ,one_in_univ]) 1); |
760 | 633 |
qed "bool_subset_univ"; |
0 | 634 |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
760
diff
changeset
|
635 |
bind_thm ("bool_into_univ", (bool_subset_univ RS subsetD)); |
0 | 636 |
|
637 |
||
638 |
(** Closure under disjoint union **) |
|
639 |
||
5137 | 640 |
Goalw [univ_def] "a: univ(A) ==> Inl(a) : univ(A)"; |
516 | 641 |
by (etac (Limit_nat RSN (2,Inl_in_VLimit)) 1); |
760 | 642 |
qed "Inl_in_univ"; |
0 | 643 |
|
5137 | 644 |
Goalw [univ_def] "b: univ(A) ==> Inr(b) : univ(A)"; |
516 | 645 |
by (etac (Limit_nat RSN (2,Inr_in_VLimit)) 1); |
760 | 646 |
qed "Inr_in_univ"; |
0 | 647 |
|
5067 | 648 |
Goalw [univ_def] "univ(C)+univ(C) <= univ(C)"; |
516 | 649 |
by (rtac (Limit_nat RS sum_VLimit) 1); |
760 | 650 |
qed "sum_univ"; |
0 | 651 |
|
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
652 |
bind_thm ("sum_subset_univ", [sum_mono, sum_univ] MRS subset_trans); |
484 | 653 |
|
654 |
||
0 | 655 |
(** Closure under binary union -- use Un_least **) |
656 |
(** Closure under Collect -- use (Collect_subset RS subset_trans) **) |
|
657 |
(** Closure under RepFun -- use RepFun_subset **) |
|
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
658 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
659 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
660 |
(*** Finite Branching Closure Properties ***) |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
661 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
662 |
(** Closure under finite powerset **) |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
663 |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
664 |
Goal "[| b: Fin(Vfrom(A,i)); Limit(i) |] ==> EX j. b <= Vfrom(A,j) & j<i"; |
1461 | 665 |
by (etac Fin_induct 1); |
4091 | 666 |
by (blast_tac (claset() addSDs [Limit_has_0]) 1); |
4152 | 667 |
by Safe_tac; |
1461 | 668 |
by (etac Limit_VfromE 1); |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
669 |
by (assume_tac 1); |
4091 | 670 |
by (blast_tac (claset() addSIs [Un_least_lt] addIs [Vfrom_UnI1, Vfrom_UnI2]) 1); |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
671 |
val Fin_Vfrom_lemma = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
672 |
|
5137 | 673 |
Goal "Limit(i) ==> Fin(Vfrom(A,i)) <= Vfrom(A,i)"; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
674 |
by (rtac subsetI 1); |
1461 | 675 |
by (dtac Fin_Vfrom_lemma 1); |
4152 | 676 |
by Safe_tac; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
677 |
by (resolve_tac [Vfrom RS ssubst] 1); |
4091 | 678 |
by (blast_tac (claset() addSDs [ltD]) 1); |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
679 |
val Fin_VLimit = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
680 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
681 |
bind_thm ("Fin_subset_VLimit", [Fin_mono, Fin_VLimit] MRS subset_trans); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
682 |
|
5067 | 683 |
Goalw [univ_def] "Fin(univ(A)) <= univ(A)"; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
684 |
by (rtac (Limit_nat RS Fin_VLimit) 1); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
685 |
val Fin_univ = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
686 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
687 |
(** Closure under finite powers (functions from a fixed natural number) **) |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
688 |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
689 |
Goal "[| n: nat; Limit(i) |] ==> n -> Vfrom(A,i) <= Vfrom(A,i)"; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
690 |
by (eresolve_tac [nat_fun_subset_Fin RS subset_trans] 1); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
691 |
by (REPEAT (ares_tac [Fin_subset_VLimit, Sigma_subset_VLimit, |
1461 | 692 |
nat_subset_VLimit, subset_refl] 1)); |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
693 |
val nat_fun_VLimit = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
694 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
695 |
bind_thm ("nat_fun_subset_VLimit", [Pi_mono, nat_fun_VLimit] MRS subset_trans); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
696 |
|
5137 | 697 |
Goalw [univ_def] "n: nat ==> n -> univ(A) <= univ(A)"; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
698 |
by (etac (Limit_nat RSN (2,nat_fun_VLimit)) 1); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
699 |
val nat_fun_univ = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
700 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
701 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
702 |
(** Closure under finite function space **) |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
703 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
704 |
(*General but seldom-used version; normally the domain is fixed*) |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
705 |
Goal "Limit(i) ==> Vfrom(A,i) -||> Vfrom(A,i) <= Vfrom(A,i)"; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
706 |
by (resolve_tac [FiniteFun.dom_subset RS subset_trans] 1); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
707 |
by (REPEAT (ares_tac [Fin_subset_VLimit, Sigma_subset_VLimit, subset_refl] 1)); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
708 |
val FiniteFun_VLimit1 = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
709 |
|
5067 | 710 |
Goalw [univ_def] "univ(A) -||> univ(A) <= univ(A)"; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
711 |
by (rtac (Limit_nat RS FiniteFun_VLimit1) 1); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
712 |
val FiniteFun_univ1 = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
713 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
714 |
(*Version for a fixed domain*) |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
715 |
Goal "[| W <= Vfrom(A,i); Limit(i) |] ==> W -||> Vfrom(A,i) <= Vfrom(A,i)"; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
716 |
by (eresolve_tac [subset_refl RSN (2, FiniteFun_mono) RS subset_trans] 1); |
1461 | 717 |
by (etac FiniteFun_VLimit1 1); |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
718 |
val FiniteFun_VLimit = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
719 |
|
5067 | 720 |
Goalw [univ_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
721 |
"W <= univ(A) ==> W -||> univ(A) <= univ(A)"; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
722 |
by (etac (Limit_nat RSN (2, FiniteFun_VLimit)) 1); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
723 |
val FiniteFun_univ = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
724 |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
725 |
Goal "[| f: W -||> univ(A); W <= univ(A) |] ==> f : univ(A)"; |
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
726 |
by (eresolve_tac [FiniteFun_univ RS subsetD] 1); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
727 |
by (assume_tac 1); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
728 |
val FiniteFun_in_univ = result(); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
729 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
730 |
(*Remove <= from the rule above*) |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
731 |
val FiniteFun_in_univ' = subsetI RSN (2, FiniteFun_in_univ); |
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
732 |
|
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
782
diff
changeset
|
733 |
|
5321 | 734 |
(**** For QUniv. Properties of Vfrom analogous to the "take-lemma" ****) |
735 |
||
736 |
(*** Intersecting a*b with Vfrom... ***) |
|
737 |
||
738 |
(*This version says a, b exist one level down, in the smaller set Vfrom(X,i)*) |
|
739 |
Goal "[| {a,b} : Vfrom(X,succ(i)); Transset(X) |] \ |
|
740 |
\ ==> a: Vfrom(X,i) & b: Vfrom(X,i)"; |
|
741 |
by (dtac (Transset_Vfrom_succ RS equalityD1 RS subsetD RS PowD) 1); |
|
742 |
by (assume_tac 1); |
|
743 |
by (Fast_tac 1); |
|
744 |
qed "doubleton_in_Vfrom_D"; |
|
745 |
||
746 |
(*This weaker version says a, b exist at the same level*) |
|
747 |
bind_thm ("Vfrom_doubleton_D", Transset_Vfrom RS Transset_doubleton_D); |
|
748 |
||
749 |
(** Using only the weaker theorem would prove <a,b> : Vfrom(X,i) |
|
750 |
implies a, b : Vfrom(X,i), which is useless for induction. |
|
751 |
Using only the stronger theorem would prove <a,b> : Vfrom(X,succ(succ(i))) |
|
752 |
implies a, b : Vfrom(X,i), leaving the succ(i) case untreated. |
|
753 |
The combination gives a reduction by precisely one level, which is |
|
754 |
most convenient for proofs. |
|
755 |
**) |
|
756 |
||
757 |
Goalw [Pair_def] |
|
758 |
"[| <a,b> : Vfrom(X,succ(i)); Transset(X) |] \ |
|
759 |
\ ==> a: Vfrom(X,i) & b: Vfrom(X,i)"; |
|
760 |
by (blast_tac (claset() addSDs [doubleton_in_Vfrom_D, Vfrom_doubleton_D]) 1); |
|
761 |
qed "Pair_in_Vfrom_D"; |
|
762 |
||
763 |
Goal "Transset(X) ==> \ |
|
764 |
\ (a*b) Int Vfrom(X, succ(i)) <= (a Int Vfrom(X,i)) * (b Int Vfrom(X,i))"; |
|
765 |
by (blast_tac (claset() addSDs [Pair_in_Vfrom_D]) 1); |
|
766 |
qed "product_Int_Vfrom_subset"; |
|
767 |