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