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