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