author | wenzelm |
Tue, 24 Nov 1998 12:03:09 +0100 | |
changeset 5953 | d6017ce6b93e |
parent 5774 | c675d4a8c26a |
child 6053 | 8a1059aa01f0 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/Zorn.ML |
485 | 2 |
ID: $Id$ |
1461 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
485 | 4 |
Copyright 1994 University of Cambridge |
5 |
||
516 | 6 |
Proofs from the paper |
485 | 7 |
Abrial & Laffitte, |
8 |
Towards the Mechanization of the Proofs of Some |
|
9 |
Classical Theorems of Set Theory. |
|
10 |
*) |
|
11 |
||
516 | 12 |
open Zorn; |
485 | 13 |
|
516 | 14 |
(*** Section 1. Mathematical Preamble ***) |
15 |
||
5774 | 16 |
Goal "(ALL x:C. x<=A | B<=x) ==> Union(C)<=A | B<=Union(C)"; |
2925 | 17 |
by (Blast_tac 1); |
760 | 18 |
qed "Union_lemma0"; |
516 | 19 |
|
5774 | 20 |
Goal "[| c:C; ALL x:C. A<=x | x<=B |] ==> A<=Inter(C) | Inter(C)<=B"; |
2925 | 21 |
by (Blast_tac 1); |
760 | 22 |
qed "Inter_lemma0"; |
516 | 23 |
|
24 |
||
25 |
(*** Section 2. The Transfinite Construction ***) |
|
26 |
||
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
27 |
Goalw [increasing_def] "f: increasing(A) ==> f: Pow(A)->Pow(A)"; |
804 | 28 |
by (etac CollectD1 1); |
760 | 29 |
qed "increasingD1"; |
516 | 30 |
|
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
31 |
Goalw [increasing_def] "[| f: increasing(A); x<=A |] ==> x <= f`x"; |
516 | 32 |
by (eresolve_tac [CollectD2 RS spec RS mp] 1); |
33 |
by (assume_tac 1); |
|
760 | 34 |
qed "increasingD2"; |
516 | 35 |
|
485 | 36 |
(*Introduction rules*) |
516 | 37 |
val [TFin_nextI, Pow_TFin_UnionI] = TFin.intrs; |
485 | 38 |
val TFin_UnionI = PowI RS Pow_TFin_UnionI; |
39 |
||
516 | 40 |
val TFin_is_subset = TFin.dom_subset RS subsetD RS PowD; |
485 | 41 |
|
42 |
||
43 |
(** Structural induction on TFin(S,next) **) |
|
44 |
||
5321 | 45 |
val major::prems = Goal |
485 | 46 |
"[| n: TFin(S,next); \ |
47 |
\ !!x. [| x : TFin(S,next); P(x); next: increasing(S) |] ==> P(next`x); \ |
|
48 |
\ !!Y. [| Y <= TFin(S,next); ALL y:Y. P(y) |] ==> P(Union(Y)) \ |
|
49 |
\ |] ==> P(n)"; |
|
516 | 50 |
by (rtac (major RS TFin.induct) 1); |
4091 | 51 |
by (ALLGOALS (fast_tac (claset() addIs prems))); |
760 | 52 |
qed "TFin_induct"; |
485 | 53 |
|
54 |
(*Perform induction on n, then prove the major premise using prems. *) |
|
55 |
fun TFin_ind_tac a prems i = |
|
56 |
EVERY [res_inst_tac [("n",a)] TFin_induct i, |
|
1461 | 57 |
rename_last_tac a ["1"] (i+1), |
58 |
rename_last_tac a ["2"] (i+2), |
|
59 |
ares_tac prems i]; |
|
485 | 60 |
|
61 |
(*** Section 3. Some Properties of the Transfinite Construction ***) |
|
62 |
||
803
4c8333ab3eae
changed useless "qed" calls for lemmas back to uses of "result",
lcp
parents:
760
diff
changeset
|
63 |
bind_thm ("increasing_trans", |
1461 | 64 |
TFin_is_subset RSN (3, increasingD2 RSN (2,subset_trans))); |
485 | 65 |
|
66 |
(*Lemma 1 of section 3.1*) |
|
5321 | 67 |
Goal "[| n: TFin(S,next); m: TFin(S,next); \ |
68 |
\ ALL x: TFin(S,next) . x<=m --> x=m | next`x<=m \ |
|
69 |
\ |] ==> n<=m | next`m<=n"; |
|
70 |
by (etac TFin_induct 1); |
|
2925 | 71 |
by (etac Union_lemma0 2); (*or just Blast_tac*) |
2929 | 72 |
by (blast_tac (subset_cs addIs [increasing_trans]) 1); |
760 | 73 |
qed "TFin_linear_lemma1"; |
485 | 74 |
|
75 |
(*Lemma 2 of section 3.2. Interesting in its own right! |
|
76 |
Requires next: increasing(S) in the second induction step. *) |
|
77 |
val [major,ninc] = goal Zorn.thy |
|
78 |
"[| m: TFin(S,next); next: increasing(S) \ |
|
79 |
\ |] ==> ALL n: TFin(S,next) . n<=m --> n=m | next`n<=m"; |
|
804 | 80 |
by (rtac (major RS TFin_induct) 1); |
81 |
by (rtac (impI RS ballI) 1); |
|
485 | 82 |
(*case split using TFin_linear_lemma1*) |
83 |
by (res_inst_tac [("n1","n"), ("m1","x")] |
|
84 |
(TFin_linear_lemma1 RS disjE) 1 THEN REPEAT (assume_tac 1)); |
|
85 |
by (dres_inst_tac [("x","n")] bspec 1 THEN assume_tac 1); |
|
2929 | 86 |
by (blast_tac (subset_cs addIs [increasing_trans]) 1); |
485 | 87 |
by (REPEAT (ares_tac [disjI1,equalityI] 1)); |
88 |
(*second induction step*) |
|
804 | 89 |
by (rtac (impI RS ballI) 1); |
90 |
by (rtac (Union_lemma0 RS disjE) 1); |
|
91 |
by (etac disjI2 3); |
|
485 | 92 |
by (REPEAT (ares_tac [disjI1,equalityI] 2)); |
804 | 93 |
by (rtac ballI 1); |
485 | 94 |
by (ball_tac 1); |
95 |
by (set_mp_tac 1); |
|
96 |
by (res_inst_tac [("n1","n"), ("m1","x")] |
|
97 |
(TFin_linear_lemma1 RS disjE) 1 THEN REPEAT (assume_tac 1)); |
|
2929 | 98 |
by (blast_tac subset_cs 1); |
804 | 99 |
by (rtac (ninc RS increasingD2 RS subset_trans RS disjI1) 1); |
485 | 100 |
by (REPEAT (ares_tac [TFin_is_subset] 1)); |
760 | 101 |
qed "TFin_linear_lemma2"; |
485 | 102 |
|
103 |
(*a more convenient form for Lemma 2*) |
|
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
104 |
Goal "[| n<=m; m: TFin(S,next); n: TFin(S,next); next: increasing(S) |] \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
105 |
\ ==> n=m | next`n<=m"; |
804 | 106 |
by (rtac (TFin_linear_lemma2 RS bspec RS mp) 1); |
485 | 107 |
by (REPEAT (assume_tac 1)); |
760 | 108 |
qed "TFin_subsetD"; |
485 | 109 |
|
110 |
(*Consequences from section 3.3 -- Property 3.2, the ordering is total*) |
|
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
111 |
Goal "[| m: TFin(S,next); n: TFin(S,next); next: increasing(S) |] \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
112 |
\ ==> n<=m | m<=n"; |
804 | 113 |
by (rtac (TFin_linear_lemma2 RSN (3,TFin_linear_lemma1) RS disjE) 1); |
485 | 114 |
by (REPEAT (assume_tac 1) THEN etac disjI2 1); |
2929 | 115 |
by (blast_tac (subset_cs addIs [increasingD2 RS subset_trans, |
1461 | 116 |
TFin_is_subset]) 1); |
760 | 117 |
qed "TFin_subset_linear"; |
485 | 118 |
|
119 |
||
120 |
(*Lemma 3 of section 3.3*) |
|
5321 | 121 |
Goal "[| n: TFin(S,next); m: TFin(S,next); m = next`m |] ==> n<=m"; |
122 |
by (etac TFin_induct 1); |
|
804 | 123 |
by (dtac TFin_subsetD 1); |
485 | 124 |
by (REPEAT (assume_tac 1)); |
4091 | 125 |
by (fast_tac (claset() addEs [ssubst]) 1); |
2929 | 126 |
by (blast_tac (subset_cs addIs [TFin_is_subset]) 1); |
760 | 127 |
qed "equal_next_upper"; |
485 | 128 |
|
129 |
(*Property 3.3 of section 3.3*) |
|
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
130 |
Goal "[| m: TFin(S,next); next: increasing(S) |] \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
131 |
\ ==> m = next`m <-> m = Union(TFin(S,next))"; |
804 | 132 |
by (rtac iffI 1); |
133 |
by (rtac (Union_upper RS equalityI) 1); |
|
134 |
by (rtac (equal_next_upper RS Union_least) 2); |
|
485 | 135 |
by (REPEAT (assume_tac 1)); |
804 | 136 |
by (etac ssubst 1); |
485 | 137 |
by (rtac (increasingD2 RS equalityI) 1 THEN assume_tac 1); |
138 |
by (ALLGOALS |
|
2929 | 139 |
(blast_tac (subset_cs addIs [TFin_UnionI, TFin_nextI, TFin_is_subset]))); |
760 | 140 |
qed "equal_next_Union"; |
485 | 141 |
|
142 |
||
143 |
(*** Section 4. Hausdorff's Theorem: every set contains a maximal chain ***) |
|
144 |
(*** NB: We assume the partial ordering is <=, the subset relation! **) |
|
145 |
||
146 |
(** Defining the "next" operation for Hausdorff's Theorem **) |
|
147 |
||
5067 | 148 |
Goalw [chain_def] "chain(A) <= Pow(A)"; |
804 | 149 |
by (rtac Collect_subset 1); |
760 | 150 |
qed "chain_subset_Pow"; |
485 | 151 |
|
5067 | 152 |
Goalw [super_def] "super(A,c) <= chain(A)"; |
804 | 153 |
by (rtac Collect_subset 1); |
760 | 154 |
qed "super_subset_chain"; |
485 | 155 |
|
5067 | 156 |
Goalw [maxchain_def] "maxchain(A) <= chain(A)"; |
804 | 157 |
by (rtac Collect_subset 1); |
760 | 158 |
qed "maxchain_subset_chain"; |
485 | 159 |
|
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
160 |
Goal "[| ch : (PROD X:Pow(chain(S)) - {0}. X); \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
161 |
\ X : chain(S); X ~: maxchain(S) |] \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
162 |
\ ==> ch ` super(S,X) : super(S,X)"; |
804 | 163 |
by (etac apply_type 1); |
485 | 164 |
by (rewrite_goals_tac [super_def, maxchain_def]); |
2925 | 165 |
by (Blast_tac 1); |
760 | 166 |
qed "choice_super"; |
485 | 167 |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
168 |
Goal "[| ch : (PROD X:Pow(chain(S)) - {0}. X); \ |
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
169 |
\ X : chain(S); X ~: maxchain(S) |] \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
170 |
\ ==> ch ` super(S,X) ~= X"; |
804 | 171 |
by (rtac notI 1); |
172 |
by (dtac choice_super 1); |
|
485 | 173 |
by (assume_tac 1); |
174 |
by (assume_tac 1); |
|
4091 | 175 |
by (asm_full_simp_tac (simpset() addsimps [super_def]) 1); |
760 | 176 |
qed "choice_not_equals"; |
485 | 177 |
|
178 |
(*This justifies Definition 4.4*) |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
179 |
Goal "ch: (PROD X: Pow(chain(S))-{0}. X) ==> \ |
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
180 |
\ EX next: increasing(S). ALL X: Pow(S). \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
181 |
\ next`X = if(X: chain(S)-maxchain(S), ch`super(S,X), X)"; |
485 | 182 |
by (rtac bexI 1); |
183 |
by (rtac ballI 1); |
|
804 | 184 |
by (rtac beta 1); |
485 | 185 |
by (assume_tac 1); |
804 | 186 |
by (rewtac increasing_def); |
485 | 187 |
by (rtac CollectI 1); |
188 |
by (rtac lam_type 1); |
|
5137 | 189 |
by (Asm_simp_tac 1); |
4091 | 190 |
by (fast_tac (claset() addSIs [super_subset_chain RS subsetD, |
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
191 |
chain_subset_Pow RS subsetD, |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
192 |
choice_super]) 1); |
485 | 193 |
(*Now, verify that it increases*) |
5137 | 194 |
by (asm_simp_tac (simpset() addsimps [Pow_iff, subset_refl]) 1); |
4152 | 195 |
by Safe_tac; |
804 | 196 |
by (dtac choice_super 1); |
485 | 197 |
by (REPEAT (assume_tac 1)); |
804 | 198 |
by (rewtac super_def); |
2925 | 199 |
by (Blast_tac 1); |
760 | 200 |
qed "Hausdorff_next_exists"; |
485 | 201 |
|
202 |
(*Lemma 4*) |
|
5268 | 203 |
Goal " [| c: TFin(S,next); \ |
1461 | 204 |
\ ch: (PROD X: Pow(chain(S))-{0}. X); \ |
205 |
\ next: increasing(S); \ |
|
206 |
\ ALL X: Pow(S). next`X = \ |
|
207 |
\ if(X: chain(S)-maxchain(S), ch`super(S,X), X) \ |
|
485 | 208 |
\ |] ==> c: chain(S)"; |
804 | 209 |
by (etac TFin_induct 1); |
485 | 210 |
by (asm_simp_tac |
4091 | 211 |
(simpset() addsimps [chain_subset_Pow RS subsetD, |
5137 | 212 |
choice_super RS (super_subset_chain RS subsetD)]) 1); |
804 | 213 |
by (rewtac chain_def); |
2925 | 214 |
by (rtac CollectI 1 THEN Blast_tac 1); |
4152 | 215 |
by Safe_tac; |
485 | 216 |
by (res_inst_tac [("m1","B"), ("n1","Ba")] (TFin_subset_linear RS disjE) 1); |
5469 | 217 |
by (ALLGOALS Fast_tac); (*Blast_tac's slow*) |
760 | 218 |
qed "TFin_chain_lemma4"; |
485 | 219 |
|
5067 | 220 |
Goal "EX c. c : maxchain(S)"; |
485 | 221 |
by (rtac (AC_Pi_Pow RS exE) 1); |
222 |
by (rtac (Hausdorff_next_exists RS bexE) 1); |
|
223 |
by (assume_tac 1); |
|
224 |
by (rename_tac "ch next" 1); |
|
225 |
by (subgoal_tac "Union(TFin(S,next)) : chain(S)" 1); |
|
226 |
by (REPEAT (ares_tac [TFin_chain_lemma4, subset_refl RS TFin_UnionI] 2)); |
|
227 |
by (res_inst_tac [("x", "Union(TFin(S,next))")] exI 1); |
|
804 | 228 |
by (rtac classical 1); |
485 | 229 |
by (subgoal_tac "next ` Union(TFin(S,next)) = Union(TFin(S,next))" 1); |
230 |
by (resolve_tac [equal_next_Union RS iffD2 RS sym] 2); |
|
231 |
by (resolve_tac [subset_refl RS TFin_UnionI] 2); |
|
232 |
by (assume_tac 2); |
|
804 | 233 |
by (rtac refl 2); |
485 | 234 |
by (asm_full_simp_tac |
4091 | 235 |
(simpset() addsimps [subset_refl RS TFin_UnionI RS |
5137 | 236 |
(TFin.dom_subset RS subsetD)]) 1); |
485 | 237 |
by (eresolve_tac [choice_not_equals RS notE] 1); |
238 |
by (REPEAT (assume_tac 1)); |
|
760 | 239 |
qed "Hausdorff"; |
485 | 240 |
|
241 |
||
242 |
(*** Section 5. Zorn's Lemma: if all chains in S have upper bounds in S |
|
243 |
then S contains a maximal element ***) |
|
244 |
||
245 |
(*Used in the proof of Zorn's Lemma*) |
|
5067 | 246 |
Goalw [chain_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
247 |
"[| c: chain(A); z: A; ALL x:c. x<=z |] ==> cons(z,c) : chain(A)"; |
2925 | 248 |
by (Blast_tac 1); |
760 | 249 |
qed "chain_extend"; |
485 | 250 |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
251 |
Goal "ALL c: chain(S). Union(c) : S ==> EX y:S. ALL z:S. y<=z --> y=z"; |
485 | 252 |
by (resolve_tac [Hausdorff RS exE] 1); |
4091 | 253 |
by (asm_full_simp_tac (simpset() addsimps [maxchain_def]) 1); |
485 | 254 |
by (rename_tac "c" 1); |
255 |
by (res_inst_tac [("x", "Union(c)")] bexI 1); |
|
5469 | 256 |
by (Blast_tac 2); |
4152 | 257 |
by Safe_tac; |
485 | 258 |
by (rename_tac "z" 1); |
804 | 259 |
by (rtac classical 1); |
485 | 260 |
by (subgoal_tac "cons(z,c): super(S,c)" 1); |
4091 | 261 |
by (blast_tac (claset() addEs [equalityE]) 1); |
804 | 262 |
by (rewtac super_def); |
4152 | 263 |
by Safe_tac; |
4091 | 264 |
by (fast_tac (claset() addEs [chain_extend]) 1); |
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
265 |
by (fast_tac (claset() addEs [equalityE]) 1); |
760 | 266 |
qed "Zorn"; |
485 | 267 |
|
268 |
||
269 |
(*** Section 6. Zermelo's Theorem: every set can be well-ordered ***) |
|
270 |
||
271 |
(*Lemma 5*) |
|
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
272 |
Goal "[| n: TFin(S,next); Z <= TFin(S,next); z:Z; ~ Inter(Z) : Z |] \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
273 |
\ ==> ALL m:Z. n<=m"; |
5321 | 274 |
by (etac TFin_induct 1); |
2925 | 275 |
by (Blast_tac 2); (*second induction step is easy*) |
804 | 276 |
by (rtac ballI 1); |
277 |
by (rtac (bspec RS TFin_subsetD RS disjE) 1); |
|
485 | 278 |
by (REPEAT_SOME (eresolve_tac [asm_rl,subsetD])); |
279 |
by (subgoal_tac "x = Inter(Z)" 1); |
|
2925 | 280 |
by (Blast_tac 1); |
281 |
by (Blast_tac 1); |
|
760 | 282 |
qed "TFin_well_lemma5"; |
485 | 283 |
|
284 |
(*Well-ordering of TFin(S,next)*) |
|
5137 | 285 |
Goal "[| Z <= TFin(S,next); z:Z |] ==> Inter(Z) : Z"; |
804 | 286 |
by (rtac classical 1); |
485 | 287 |
by (subgoal_tac "Z = {Union(TFin(S,next))}" 1); |
4091 | 288 |
by (asm_simp_tac (simpset() addsimps [Inter_singleton]) 1); |
804 | 289 |
by (etac equal_singleton 1); |
290 |
by (rtac (Union_upper RS equalityI) 1); |
|
291 |
by (rtac (subset_refl RS TFin_UnionI RS TFin_well_lemma5 RS bspec) 2); |
|
485 | 292 |
by (REPEAT_SOME (eresolve_tac [asm_rl,subsetD])); |
760 | 293 |
qed "well_ord_TFin_lemma"; |
485 | 294 |
|
295 |
(*This theorem just packages the previous result*) |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
296 |
Goal "next: increasing(S) ==> \ |
485 | 297 |
\ well_ord(TFin(S,next), Subset_rel(TFin(S,next)))"; |
804 | 298 |
by (rtac well_ordI 1); |
485 | 299 |
by (rewrite_goals_tac [Subset_rel_def, linear_def]); |
300 |
(*Prove the linearity goal first*) |
|
301 |
by (REPEAT (rtac ballI 2)); |
|
302 |
by (excluded_middle_tac "x=y" 2); |
|
2925 | 303 |
by (Blast_tac 3); |
485 | 304 |
(*The x~=y case remains*) |
305 |
by (res_inst_tac [("n1","x"), ("m1","y")] |
|
306 |
(TFin_subset_linear RS disjE) 2 THEN REPEAT (assume_tac 2)); |
|
2925 | 307 |
by (Blast_tac 2); |
308 |
by (Blast_tac 2); |
|
485 | 309 |
(*Now prove the well_foundedness goal*) |
804 | 310 |
by (rtac wf_onI 1); |
485 | 311 |
by (forward_tac [well_ord_TFin_lemma] 1 THEN assume_tac 1); |
312 |
by (dres_inst_tac [("x","Inter(Z)")] bspec 1 THEN assume_tac 1); |
|
2925 | 313 |
by (Blast_tac 1); |
760 | 314 |
qed "well_ord_TFin"; |
485 | 315 |
|
316 |
(** Defining the "next" operation for Zermelo's Theorem **) |
|
317 |
||
318 |
(*This justifies Definition 6.1*) |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
319 |
Goal "ch: (PROD X: Pow(S)-{0}. X) ==> \ |
1461 | 320 |
\ EX next: increasing(S). ALL X: Pow(S). \ |
485 | 321 |
\ next`X = if(X=S, S, cons(ch`(S-X), X))"; |
322 |
by (rtac bexI 1); |
|
323 |
by (rtac ballI 1); |
|
804 | 324 |
by (rtac beta 1); |
485 | 325 |
by (assume_tac 1); |
804 | 326 |
by (rewtac increasing_def); |
485 | 327 |
by (rtac CollectI 1); |
328 |
by (rtac lam_type 1); |
|
329 |
(*Verify that it increases*) |
|
804 | 330 |
by (rtac allI 2); |
331 |
by (rtac impI 2); |
|
5137 | 332 |
by (asm_simp_tac (simpset() addsimps [Pow_iff, subset_consI, subset_refl]) 2); |
485 | 333 |
(*Type checking is surprisingly hard!*) |
5137 | 334 |
by (asm_simp_tac |
335 |
(simpset() addsimps [Pow_iff, cons_subset_iff, subset_refl]) 1); |
|
4091 | 336 |
by (blast_tac (claset() addSIs [choice_Diff RS DiffD1]) 1); |
760 | 337 |
qed "Zermelo_next_exists"; |
485 | 338 |
|
339 |
||
340 |
(*The construction of the injection*) |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
341 |
Goal "[| ch: (PROD X: Pow(S)-{0}. X); \ |
5666
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
342 |
\ next: increasing(S); \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
343 |
\ ALL X: Pow(S). next`X = if(X=S, S, cons(ch`(S-X), X)) |] \ |
822db50b3ec5
fixed some indenting; changed a VERY slow blast_tac to fast_tac
paulson
parents:
5469
diff
changeset
|
344 |
\ ==> (lam x:S. Union({y: TFin(S,next). x~: y})) \ |
485 | 345 |
\ : inj(S, TFin(S,next) - {S})"; |
346 |
by (res_inst_tac [("d", "%y. ch`(S-y)")] lam_injective 1); |
|
347 |
by (rtac DiffI 1); |
|
348 |
by (resolve_tac [Collect_subset RS TFin_UnionI] 1); |
|
4091 | 349 |
by (blast_tac (claset() addSIs [Collect_subset RS TFin_UnionI] |
2469 | 350 |
addEs [equalityE]) 1); |
485 | 351 |
by (subgoal_tac "x ~: Union({y: TFin(S,next). x~: y})" 1); |
4091 | 352 |
by (blast_tac (claset() addEs [equalityE]) 2); |
485 | 353 |
by (subgoal_tac "Union({y: TFin(S,next). x~: y}) ~= S" 1); |
4091 | 354 |
by (blast_tac (claset() addEs [equalityE]) 2); |
485 | 355 |
(*For proving x : next`Union(...); |
356 |
Abrial & Laffitte's justification appears to be faulty.*) |
|
357 |
by (subgoal_tac "~ next ` Union({y: TFin(S,next). x~: y}) <= \ |
|
358 |
\ Union({y: TFin(S,next). x~: y})" 1); |
|
359 |
by (asm_simp_tac |
|
4091 | 360 |
(simpset() delsimps [Union_iff] |
2493 | 361 |
addsimps [Collect_subset RS TFin_UnionI RS TFin_is_subset, |
1461 | 362 |
Pow_iff, cons_subset_iff, subset_refl, |
5137 | 363 |
choice_Diff RS DiffD2]) 2); |
485 | 364 |
by (subgoal_tac "x : next ` Union({y: TFin(S,next). x~: y})" 1); |
2929 | 365 |
by (blast_tac (subset_cs addSIs [Collect_subset RS TFin_UnionI, TFin_nextI]) 2); |
485 | 366 |
(*End of the lemmas!*) |
367 |
by (asm_full_simp_tac |
|
4091 | 368 |
(simpset() addsimps [Collect_subset RS TFin_UnionI RS TFin_is_subset, |
5137 | 369 |
Pow_iff, cons_subset_iff, subset_refl]) 1); |
485 | 370 |
by (REPEAT (eresolve_tac [asm_rl, consE, sym, notE] 1)); |
760 | 371 |
qed "choice_imp_injection"; |
485 | 372 |
|
373 |
(*The wellordering theorem*) |
|
5067 | 374 |
Goal "EX r. well_ord(S,r)"; |
485 | 375 |
by (rtac (AC_Pi_Pow RS exE) 1); |
376 |
by (rtac (Zermelo_next_exists RS bexE) 1); |
|
377 |
by (assume_tac 1); |
|
804 | 378 |
by (rtac exI 1); |
379 |
by (rtac well_ord_rvimage 1); |
|
380 |
by (etac well_ord_TFin 2); |
|
485 | 381 |
by (resolve_tac [choice_imp_injection RS inj_weaken_type] 1); |
382 |
by (REPEAT (ares_tac [Diff_subset] 1)); |
|
760 | 383 |
qed "AC_well_ord"; |