author | paulson |
Thu, 13 Jan 2000 17:31:30 +0100 | |
changeset 8123 | a71686059be0 |
parent 7499 | 23e090051cb8 |
child 9402 | 480a1b40fdd6 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/AC/DC.ML |
2 |
ID: $Id$ |
|
3 |
Author: Krzysztof Grabczewski |
|
1196 | 4 |
|
5 |
The proofs concerning the Axiom of Dependent Choice |
|
6 |
*) |
|
7 |
||
8 |
(* ********************************************************************** *) |
|
1461 | 9 |
(* DC ==> DC(omega) *) |
10 |
(* *) |
|
11 |
(* The scheme of the proof: *) |
|
12 |
(* *) |
|
5482 | 13 |
(* Assume DC. Let R and X satisfy the premise of DC(omega). *) |
1461 | 14 |
(* *) |
15 |
(* Define XX and RR as follows: *) |
|
16 |
(* *) |
|
17 |
(* XX = (UN n:nat. {f:n->X. ALL k:n. <f``k, f`k> : R}) *) |
|
18 |
(* f RR g iff domain(g)=succ(domain(f)) & *) |
|
19 |
(* restrict(g, domain(f)) = f *) |
|
20 |
(* *) |
|
21 |
(* Then RR satisfies the hypotheses of DC. *) |
|
22 |
(* So applying DC: *) |
|
23 |
(* *) |
|
24 |
(* EX f:nat->XX. ALL n:nat. f`n RR f`succ(n) *) |
|
25 |
(* *) |
|
26 |
(* Thence *) |
|
27 |
(* *) |
|
28 |
(* ff = {<n, f`succ(n)`n>. n:nat} *) |
|
29 |
(* *) |
|
30 |
(* is the desired function. *) |
|
31 |
(* *) |
|
1196 | 32 |
(* ********************************************************************** *) |
33 |
||
5482 | 34 |
Open_locale "DC0_imp"; |
35 |
||
36 |
val all_ex = thm "all_ex"; |
|
37 |
val XX_def = thm "XX_def"; |
|
38 |
val RR_def = thm "RR_def"; |
|
1196 | 39 |
|
5482 | 40 |
Goalw [RR_def] "RR <= XX*XX"; |
41 |
by (Fast_tac 1); |
|
42 |
qed "lemma1_1"; |
|
43 |
||
44 |
Goalw [RR_def, XX_def] "RR ~= 0"; |
|
45 |
by (rtac (all_ex RS ballE) 1); |
|
1196 | 46 |
by (eresolve_tac [empty_subsetI RS PowI RSN (2, notE)] 2); |
47 |
by (eresolve_tac [nat_0I RS n_lesspoll_nat RSN (2, impE)] 1); |
|
1207 | 48 |
by (etac bexE 1); |
1196 | 49 |
by (res_inst_tac [("a","<0, {<0, x>}>")] not_emptyI 1); |
1207 | 50 |
by (rtac CollectI 1); |
51 |
by (rtac SigmaI 1); |
|
4091 | 52 |
by (fast_tac (claset() addSIs [nat_0I RS UN_I, empty_fun]) 1); |
2493 | 53 |
by (rtac (nat_1I RS UN_I) 1); |
5482 | 54 |
by (asm_full_simp_tac (simpset() addsimps [singleton_0]) 2); |
55 |
by (force_tac (claset() addSIs [singleton_fun RS Pi_type], |
|
56 |
simpset() addsimps [singleton_0 RS sym]) 1); |
|
57 |
qed "lemma1_2"; |
|
1196 | 58 |
|
5482 | 59 |
Goalw [RR_def, XX_def] "range(RR) <= domain(RR)"; |
1207 | 60 |
by (rtac range_subset_domain 1); |
5482 | 61 |
by (Blast_tac 2); |
62 |
by (Clarify_tac 1); |
|
63 |
by (forward_tac [fun_is_rel RS image_subset RS PowI RS (all_ex RS bspec)] 1); |
|
1196 | 64 |
by (eresolve_tac [[n_lesspoll_nat, nat_into_Ord RSN (2, image_Ord_lepoll)] |
1461 | 65 |
MRS lepoll_lesspoll_lesspoll RSN (2, impE)] 1 |
66 |
THEN REPEAT (assume_tac 1)); |
|
1207 | 67 |
by (etac bexE 1); |
1196 | 68 |
by (res_inst_tac [("x","cons(<n,x>, g)")] exI 1); |
1207 | 69 |
by (rtac CollectI 1); |
5482 | 70 |
by (force_tac (claset() addSEs [cons_fun_type2], |
71 |
simpset() addsimps [cons_image_n, cons_val_n, |
|
72 |
cons_image_k, cons_val_k]) 1); |
|
4091 | 73 |
by (asm_full_simp_tac (simpset() |
5482 | 74 |
addsimps [domain_of_fun, succ_def, restrict_cons_eq]) 1); |
75 |
qed "lemma1_3"; |
|
1196 | 76 |
|
77 |
||
5482 | 78 |
Goal "[| ALL n:nat. <f`n, f`succ(n)> : RR; f: nat -> XX; n:nat |] \ |
79 |
\ ==> EX k:nat. f`succ(n) : k -> X & n:k \ |
|
80 |
\ & <f`succ(n)``n, f`succ(n)`n> : R"; |
|
6070 | 81 |
by (induct_tac "n" 1); |
1196 | 82 |
by (dresolve_tac [nat_1I RSN (2, apply_type)] 1); |
83 |
by (dresolve_tac [nat_0I RSN (2, bspec)] 1); |
|
5482 | 84 |
by (asm_full_simp_tac (simpset() addsimps [XX_def]) 1); |
3731 | 85 |
by Safe_tac; |
1207 | 86 |
by (rtac bexI 1 THEN (assume_tac 2)); |
5482 | 87 |
by (force_tac (claset() addIs [ltD] |
88 |
addSEs [nat_0_le RS leE] |
|
89 |
addEs [sym RS trans RS succ_neq_0, domain_of_fun], |
|
90 |
simpset() addsimps [RR_def]) 1); |
|
91 |
(** LEVEL 7, other subgoal **) |
|
1196 | 92 |
by (dresolve_tac [nat_succI RSN (2, bspec)] 1 THEN (assume_tac 1)); |
2469 | 93 |
by (subgoal_tac "f ` succ(succ(x)) : succ(k)->X" 1); |
1196 | 94 |
by (dresolve_tac [nat_succI RS nat_succI RSN (2, apply_type)] 1 |
1461 | 95 |
THEN (assume_tac 1)); |
5482 | 96 |
by (full_simp_tac (simpset() addsimps [XX_def,RR_def]) 1); |
3731 | 97 |
by Safe_tac; |
2469 | 98 |
by (forw_inst_tac [("a","succ(k)")] (domain_of_fun RS sym RS trans) 1 THEN |
99 |
(assume_tac 1)); |
|
100 |
by (forw_inst_tac [("a","xa")] (domain_of_fun RS sym RS trans) 1 THEN |
|
101 |
(assume_tac 1)); |
|
5482 | 102 |
by (fast_tac (claset() addSEs [nat_into_Ord RS succ_in_succ] |
1461 | 103 |
addSDs [nat_into_Ord RS succ_in_succ RSN (2, bspec)]) 1); |
2469 | 104 |
by (dtac domain_of_fun 1); |
5482 | 105 |
by (full_simp_tac (simpset() addsimps [XX_def,RR_def]) 1); |
4091 | 106 |
by (deepen_tac (claset() addDs [domain_of_fun RS sym RS trans]) 0 1); |
5482 | 107 |
qed "lemma2"; |
1196 | 108 |
|
5482 | 109 |
Goal "[| ALL n:nat. <f`n, f`succ(n)> : RR; f: nat -> XX; m:nat |] \ |
110 |
\ ==> {f`succ(x)`x. x:m} = {f`succ(m)`x. x:m}"; |
|
111 |
by (subgoal_tac "ALL x:m. f`succ(m)`x = f`succ(x)`x" 1); |
|
112 |
by (Asm_full_simp_tac 1); |
|
6070 | 113 |
by (induct_tac "m" 1); |
2469 | 114 |
by (Fast_tac 1); |
1207 | 115 |
by (rtac ballI 1); |
116 |
by (etac succE 1); |
|
117 |
by (rtac restrict_eq_imp_val_eq 1); |
|
1196 | 118 |
by (dresolve_tac [nat_succI RSN (2, bspec)] 1 THEN (assume_tac 1)); |
5482 | 119 |
by (asm_full_simp_tac (simpset() addsimps [RR_def]) 1); |
1207 | 120 |
by (dtac lemma2 1 THEN REPEAT (assume_tac 1)); |
4091 | 121 |
by (fast_tac (claset() addSDs [domain_of_fun]) 1); |
1196 | 122 |
by (dres_inst_tac [("x","xa")] bspec 1 THEN (assume_tac 1)); |
123 |
by (eresolve_tac [sym RS trans RS sym] 1); |
|
124 |
by (resolve_tac [restrict_eq_imp_val_eq RS sym] 1); |
|
125 |
by (dresolve_tac [nat_succI RSN (2, bspec)] 1 THEN (assume_tac 1)); |
|
5482 | 126 |
by (asm_full_simp_tac (simpset() addsimps [RR_def]) 1); |
1207 | 127 |
by (dtac lemma2 1 THEN REPEAT (assume_tac 1)); |
5482 | 128 |
by (blast_tac (claset() addSDs [domain_of_fun] |
129 |
addIs [nat_into_Ord RSN (2, OrdmemD) RS subsetD]) 1); |
|
130 |
qed "lemma3_1"; |
|
1196 | 131 |
|
5482 | 132 |
Goal "[| ALL n:nat. <f`n, f`succ(n)> : RR; f: nat -> XX; m:nat |] \ |
133 |
\ ==> (lam x:nat. f`succ(x)`x) `` m = f`succ(m)``m"; |
|
1207 | 134 |
by (etac natE 1); |
5482 | 135 |
by (Asm_simp_tac 1); |
136 |
by (stac image_lam 1); |
|
4091 | 137 |
by (fast_tac (claset() addSEs [[nat_succI, Ord_nat] MRS OrdmemD]) 1); |
5482 | 138 |
by (stac lemma3_1 1 THEN REPEAT (assume_tac 1)); |
139 |
by (Fast_tac 1); |
|
140 |
by (fast_tac (claset() addSDs [lemma2] |
|
141 |
addSEs [nat_into_Ord RSN (2, OrdmemD) RSN |
|
2469 | 142 |
(2, image_fun RS sym)]) 1); |
5482 | 143 |
qed "lemma3"; |
1196 | 144 |
|
6021 | 145 |
Close_locale "DC0_imp"; |
1196 | 146 |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
147 |
Goalw [DC_def, DC0_def] "DC0 ==> DC(nat)"; |
5482 | 148 |
by (Clarify_tac 1); |
149 |
by (REPEAT (etac allE 1)); |
|
150 |
by (etac impE 1); |
|
151 |
(*these three results comprise Lemma 1*) |
|
152 |
by (blast_tac (claset() addSIs (map export [lemma1_1, lemma1_2, lemma1_3])) 1); |
|
1207 | 153 |
by (etac bexE 1); |
1196 | 154 |
by (res_inst_tac [("x","lam n:nat. f`succ(n)`n")] bexI 1); |
5482 | 155 |
by (fast_tac (claset() addSIs [lam_type] addSDs [export lemma2] |
156 |
addSEs [fun_weaken_type, apply_type]) 2); |
|
1207 | 157 |
by (rtac oallI 1); |
5482 | 158 |
by (forward_tac [ltD RSN (3, export lemma2)] 1 |
1461 | 159 |
THEN assume_tac 2); |
5482 | 160 |
by (fast_tac (claset() addSEs [fun_weaken_type]) 1); |
161 |
(** LEVEL 10: last subgoal **) |
|
162 |
by (stac (ltD RSN (3, export lemma3)) 1); |
|
163 |
by (Force_tac 4); |
|
164 |
by (assume_tac 3); |
|
165 |
by (assume_tac 1); |
|
166 |
by (fast_tac (claset() addSEs [fun_weaken_type]) 1); |
|
167 |
qed "DC0_imp_DC_nat"; |
|
168 |
||
1196 | 169 |
|
3862 | 170 |
(* ************************************************************************ |
171 |
DC(omega) ==> DC |
|
172 |
||
173 |
The scheme of the proof: |
|
174 |
||
175 |
Assume DC(omega). Let R and x satisfy the premise of DC. |
|
176 |
||
177 |
Define XX and RR as follows: |
|
178 |
||
179 |
XX = (UN n:nat. {f:succ(n)->domain(R). ALL k:n. <f`k, f`succ(k)> : R}) |
|
180 |
||
181 |
RR = {<z1,z2>:Fin(XX)*XX. |
|
182 |
(domain(z2)=succ(UN f:z1. domain(f)) & |
|
183 |
(ALL f:z1. restrict(z2, domain(f)) = f)) | |
|
184 |
(~ (EX g:XX. domain(g)=succ(UN f:z1. domain(f)) & |
|
185 |
(ALL f:z1. restrict(g, domain(f)) = f)) & |
|
186 |
z2={<0,x>})} |
|
187 |
||
188 |
Then XX and RR satisfy the hypotheses of DC(omega). |
|
189 |
So applying DC: |
|
190 |
||
191 |
EX f:nat->XX. ALL n:nat. f``n RR f`n |
|
192 |
||
193 |
Thence |
|
194 |
||
195 |
ff = {<n, f`n`n>. n:nat} |
|
196 |
||
197 |
is the desired function. |
|
198 |
||
199 |
************************************************************************* *) |
|
1196 | 200 |
|
5068 | 201 |
Goalw [lesspoll_def, Finite_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
202 |
"A lesspoll nat ==> Finite(A)"; |
8123 | 203 |
by (fast_tac (claset() addSDs [ltD, lepoll_imp_ex_le_eqpoll]) 1); |
3731 | 204 |
qed "lesspoll_nat_is_Finite"; |
1196 | 205 |
|
5137 | 206 |
Goal "n:nat ==> ALL A. (A eqpoll n & A <= X) --> A : Fin(X)"; |
6070 | 207 |
by (induct_tac "n" 1); |
1207 | 208 |
by (rtac allI 1); |
4091 | 209 |
by (fast_tac (claset() addSIs [Fin.emptyI] |
1461 | 210 |
addSDs [eqpoll_imp_lepoll RS lepoll_0_is_0]) 1); |
1207 | 211 |
by (rtac allI 1); |
212 |
by (rtac impI 1); |
|
213 |
by (etac conjE 1); |
|
1196 | 214 |
by (resolve_tac [eqpoll_succ_imp_not_empty RS not_emptyE] 1 |
1461 | 215 |
THEN (assume_tac 1)); |
7499 | 216 |
by (ftac Diff_sing_eqpoll 1 THEN (assume_tac 1)); |
1207 | 217 |
by (etac allE 1); |
218 |
by (etac impE 1); |
|
2469 | 219 |
by (Fast_tac 1); |
1207 | 220 |
by (dtac subsetD 1 THEN (assume_tac 1)); |
1196 | 221 |
by (dresolve_tac [Fin.consI] 1 THEN (assume_tac 1)); |
4091 | 222 |
by (asm_full_simp_tac (simpset() addsimps [cons_Diff]) 1); |
3731 | 223 |
qed "Finite_Fin_lemma"; |
1196 | 224 |
|
5137 | 225 |
Goalw [Finite_def] "[| Finite(A); A <= X |] ==> A : Fin(X)"; |
1207 | 226 |
by (etac bexE 1); |
227 |
by (dtac Finite_Fin_lemma 1); |
|
228 |
by (etac allE 1); |
|
229 |
by (etac impE 1); |
|
1196 | 230 |
by (assume_tac 2); |
2469 | 231 |
by (Fast_tac 1); |
3731 | 232 |
qed "Finite_Fin"; |
1196 | 233 |
|
5482 | 234 |
Goal |
235 |
"x:X ==> {<0,x>}: (UN n:nat. {f:succ(n)->X. ALL k:n. <f`k, f`succ(k)> : R})"; |
|
2493 | 236 |
by (rtac (nat_0I RS UN_I) 1); |
4091 | 237 |
by (fast_tac (claset() addSIs [singleton_fun RS Pi_type] |
238 |
addss (simpset() addsimps [singleton_0 RS sym])) 1); |
|
3731 | 239 |
qed "singleton_in_funs"; |
1196 | 240 |
|
5482 | 241 |
|
242 |
Open_locale "imp_DC0"; |
|
243 |
||
244 |
val XX_def = thm "XX_def"; |
|
245 |
val RR_def = thm "RR_def"; |
|
246 |
val allRR_def = thm "allRR_def"; |
|
247 |
||
248 |
Goal "[| range(R) <= domain(R); x:domain(R) |] \ |
|
249 |
\ ==> RR <= Pow(XX)*XX & \ |
|
250 |
\ (ALL Y:Pow(XX). Y lesspoll nat --> (EX x:XX. <Y,x>:RR))"; |
|
1207 | 251 |
by (rtac conjI 1); |
5482 | 252 |
by (force_tac (claset() addSDs [FinD RS PowI], |
253 |
simpset() addsimps [RR_def]) 1); |
|
2483
95c2f9c0930a
Default rewrite rules for quantification over Collect(A,P)
paulson
parents:
2469
diff
changeset
|
254 |
by (rtac (impI RS ballI) 1); |
1196 | 255 |
by (dresolve_tac [[lesspoll_nat_is_Finite, PowD] MRS Finite_Fin] 1 |
1461 | 256 |
THEN (assume_tac 1)); |
1196 | 257 |
by (excluded_middle_tac "EX g:XX. domain(g)=succ(UN f:Y. domain(f)) \ |
1461 | 258 |
\ & (ALL f:Y. restrict(g, domain(f)) = f)" 1); |
5482 | 259 |
by (fast_tac (claset() addss (simpset() addsimps [RR_def])) 2); |
4091 | 260 |
by (safe_tac (claset() delrules [domainE])); |
5482 | 261 |
by (rewrite_goals_tac [XX_def,RR_def]); |
2483
95c2f9c0930a
Default rewrite rules for quantification over Collect(A,P)
paulson
parents:
2469
diff
changeset
|
262 |
by (swap_res_tac [bexI] 1 THEN etac singleton_in_funs 2); |
4091 | 263 |
by (asm_full_simp_tac (simpset() addsimps [nat_0I RSN (2, bexI), |
5482 | 264 |
cons_fun_type2]) 1); |
265 |
qed "lemma4"; |
|
1196 | 266 |
|
5137 | 267 |
Goal "[| f:nat->X; n:nat |] ==> \ |
1461 | 268 |
\ (UN x:f``succ(n). P(x)) = P(f`n) Un (UN x:f``n. P(x))"; |
4091 | 269 |
by (asm_full_simp_tac (simpset() |
1461 | 270 |
addsimps [Ord_nat RSN (2, OrdmemD) RSN (2, image_fun), |
271 |
[nat_succI, Ord_nat] MRS OrdmemD RSN (2, image_fun)]) 1); |
|
3731 | 272 |
qed "UN_image_succ_eq"; |
1196 | 273 |
|
5137 | 274 |
Goal "[| (UN x:f``n. P(x)) = y; P(f`n) = succ(y); \ |
5482 | 275 |
\ f:nat -> X; n:nat |] ==> (UN x:f``succ(n). P(x)) = succ(y)"; |
4091 | 276 |
by (asm_full_simp_tac (simpset() addsimps [UN_image_succ_eq]) 1); |
2496 | 277 |
by (Fast_tac 1); |
3731 | 278 |
qed "UN_image_succ_eq_succ"; |
1196 | 279 |
|
5137 | 280 |
Goal "[| f:succ(n) -> D; n:nat; \ |
5482 | 281 |
\ domain(f)=succ(x); x=y |] ==> f`y : D"; |
4091 | 282 |
by (fast_tac (claset() addEs [apply_type] |
5482 | 283 |
addSDs [[sym, domain_of_fun] MRS trans]) 1); |
3731 | 284 |
qed "apply_domain_type"; |
1196 | 285 |
|
5137 | 286 |
Goal "[| f : nat -> X; n:nat |] ==> f``succ(n) = cons(f`n, f``n)"; |
4091 | 287 |
by (asm_full_simp_tac (simpset() |
1461 | 288 |
addsimps [nat_succI, Ord_nat RSN (2, OrdmemD), image_fun]) 1); |
3731 | 289 |
qed "image_fun_succ"; |
1196 | 290 |
|
5482 | 291 |
Goalw [XX_def] "[| domain(f`n) = succ(u); f : nat -> XX; u=k; n:nat |] \ |
292 |
\ ==> f`n : succ(k) -> domain(R)"; |
|
1207 | 293 |
by (dtac apply_type 1 THEN (assume_tac 1)); |
5482 | 294 |
by (fast_tac (claset() addEs [domain_eq_imp_fun_type]) 1); |
3731 | 295 |
qed "f_n_type"; |
1196 | 296 |
|
5482 | 297 |
Goalw [XX_def] |
298 |
"[| f : nat -> XX; domain(f`n) = succ(k); n:nat |] \ |
|
299 |
\ ==> ALL i:k. <f`n`i, f`n`succ(i)> : R"; |
|
1207 | 300 |
by (dtac apply_type 1 THEN (assume_tac 1)); |
301 |
by (etac UN_E 1); |
|
302 |
by (etac CollectE 1); |
|
1196 | 303 |
by (dresolve_tac [domain_of_fun RS sym RS trans] 1 THEN (assume_tac 1)); |
2469 | 304 |
by (Asm_full_simp_tac 1); |
3731 | 305 |
qed "f_n_pairs_in_R"; |
1196 | 306 |
|
5068 | 307 |
Goalw [restrict_def] |
5482 | 308 |
"[| restrict(f, domain(x))=x; f:n->X; domain(x) <= n |] \ |
309 |
\ ==> restrict(cons(<n, y>, f), domain(x)) = x"; |
|
1196 | 310 |
by (eresolve_tac [sym RS trans RS sym] 1); |
1207 | 311 |
by (rtac fun_extension 1); |
4091 | 312 |
by (fast_tac (claset() addSIs [lam_type]) 1); |
313 |
by (fast_tac (claset() addSIs [lam_type]) 1); |
|
314 |
by (asm_full_simp_tac (simpset() addsimps [subsetD RS cons_val_k]) 1); |
|
3731 | 315 |
qed "restrict_cons_eq_restrict"; |
1196 | 316 |
|
5137 | 317 |
Goal "[| ALL x:f``n. restrict(f`n, domain(x))=x; \ |
5482 | 318 |
\ f : nat -> XX; \ |
319 |
\ n:nat; domain(f`n) = succ(n); \ |
|
320 |
\ (UN x:f``n. domain(x)) <= n |] \ |
|
321 |
\ ==> ALL x:f``succ(n). restrict(cons(<succ(n),y>, f`n), domain(x)) = x"; |
|
1207 | 322 |
by (rtac ballI 1); |
4091 | 323 |
by (asm_full_simp_tac (simpset() addsimps [image_fun_succ]) 1); |
1207 | 324 |
by (dtac f_n_type 1 THEN REPEAT (ares_tac [refl] 1)); |
2469 | 325 |
by (etac disjE 1); |
5482 | 326 |
by (asm_full_simp_tac (simpset() addsimps [domain_of_fun,restrict_cons_eq]) 1); |
1207 | 327 |
by (dtac bspec 1 THEN (assume_tac 1)); |
4091 | 328 |
by (fast_tac (claset() addSEs [restrict_cons_eq_restrict]) 1); |
3731 | 329 |
qed "all_in_image_restrict_eq"; |
1196 | 330 |
|
5482 | 331 |
Goalw [RR_def, allRR_def] |
332 |
"[| ALL b<nat. <f``b, f`b> : RR; \ |
|
333 |
\ f: nat -> XX; range(R) <= domain(R); x:domain(R)|] \ |
|
334 |
\ ==> allRR"; |
|
1207 | 335 |
by (rtac oallI 1); |
336 |
by (dtac ltD 1); |
|
337 |
by (etac nat_induct 1); |
|
1196 | 338 |
by (dresolve_tac [[nat_0I, Ord_nat] MRS ltI RSN (2, ospec)] 1); |
1200 | 339 |
by (fast_tac (FOL_cs addss |
4091 | 340 |
(simpset() addsimps [singleton_fun RS domain_of_fun, |
2493 | 341 |
singleton_0, singleton_in_funs])) 1); |
2469 | 342 |
(*induction step*) (** LEVEL 5 **) |
3862 | 343 |
by (full_simp_tac (*prevent simplification of ~EX to ALL~*) |
344 |
(FOL_ss addsimps [separation, split]) 1); |
|
1196 | 345 |
by (dresolve_tac [[nat_succI, Ord_nat] MRS ltI RSN (2, ospec)] 1 |
1461 | 346 |
THEN (assume_tac 1)); |
2469 | 347 |
by (REPEAT (eresolve_tac [conjE, disjE] 1)); |
5482 | 348 |
by (force_tac (FOL_cs addSEs [trans, subst_context] |
349 |
addSIs [UN_image_succ_eq_succ], simpset()) 1); |
|
1207 | 350 |
by (etac conjE 1); |
351 |
by (etac notE 1); |
|
5482 | 352 |
by (asm_lr_simp_tac (simpset() addsimps [XX_def, UN_image_succ_eq_succ]) 1); |
2469 | 353 |
(** LEVEL 12 **) |
354 |
by (REPEAT (eresolve_tac [conjE, bexE] 1)); |
|
355 |
by (dtac apply_domain_type 1 THEN REPEAT (assume_tac 1)); |
|
1207 | 356 |
by (etac domainE 1); |
357 |
by (etac domainE 1); |
|
5482 | 358 |
by (forward_tac [export f_n_type] 1 THEN REPEAT (assume_tac 1)); |
2493 | 359 |
by (rtac bexI 1); |
2483
95c2f9c0930a
Default rewrite rules for quantification over Collect(A,P)
paulson
parents:
2469
diff
changeset
|
360 |
by (etac nat_succI 2); |
1196 | 361 |
by (res_inst_tac [("x","cons(<succ(xa), ya>, f`xa)")] bexI 1); |
2493 | 362 |
by (rtac conjI 1); |
1196 | 363 |
by (fast_tac (FOL_cs |
1461 | 364 |
addEs [subst_context RSN (2, trans) RS domain_cons_eq_succ, |
5482 | 365 |
subst_context, export all_in_image_restrict_eq, |
366 |
trans, equalityD1]) 2); |
|
2483
95c2f9c0930a
Default rewrite rules for quantification over Collect(A,P)
paulson
parents:
2469
diff
changeset
|
367 |
by (eresolve_tac [rangeI RSN (2, subsetD) RSN (2, cons_fun_type2)] 2 |
95c2f9c0930a
Default rewrite rules for quantification over Collect(A,P)
paulson
parents:
2469
diff
changeset
|
368 |
THEN REPEAT (assume_tac 2)); |
1207 | 369 |
by (rtac ballI 1); |
370 |
by (etac succE 1); |
|
2469 | 371 |
(** LEVEL 25 **) |
5482 | 372 |
by (dresolve_tac [domain_of_fun RSN (2, export f_n_pairs_in_R)] 2 |
2469 | 373 |
THEN REPEAT (assume_tac 2)); |
374 |
by (dtac bspec 2 THEN (assume_tac 2)); |
|
4091 | 375 |
by (asm_full_simp_tac (simpset() |
2469 | 376 |
addsimps [nat_into_Ord RS succ_in_succ, succI2, cons_val_k]) 2); |
4091 | 377 |
by (asm_full_simp_tac (simpset() addsimps [cons_val_n, cons_val_k]) 1); |
3731 | 378 |
qed "simplify_recursion"; |
1196 | 379 |
|
2483
95c2f9c0930a
Default rewrite rules for quantification over Collect(A,P)
paulson
parents:
2469
diff
changeset
|
380 |
|
5482 | 381 |
Goalw [allRR_def] |
382 |
"[| allRR; f: nat -> XX; range(R) <= domain(R); x:domain(R); n:nat |] \ |
|
383 |
\ ==> f`n : succ(n) -> domain(R) & (ALL i:n. <f`n`i, f`n`succ(i)>:R)"; |
|
1207 | 384 |
by (dtac ospec 1); |
1196 | 385 |
by (eresolve_tac [Ord_nat RSN (2, ltI)] 1); |
1207 | 386 |
by (etac CollectE 1); |
2469 | 387 |
by (Asm_full_simp_tac 1); |
1207 | 388 |
by (rtac conjI 1); |
5482 | 389 |
by (fast_tac (FOL_cs addSEs [conjE, f_n_pairs_in_R, trans, subst_context]) 2); |
390 |
by (rewtac XX_def); |
|
4091 | 391 |
by (fast_tac (claset() |
1461 | 392 |
addSEs [trans RS domain_eq_imp_fun_type, subst_context]) 1); |
5482 | 393 |
qed "lemma2"; |
1196 | 394 |
|
5482 | 395 |
Goal "[| allRR; f : nat -> XX; n:nat; range(R) <= domain(R); x:domain(R) \ |
1461 | 396 |
\ |] ==> f`n`n = f`succ(n)`n"; |
1196 | 397 |
by (forward_tac [lemma2 RS conjunct1 RS domain_of_fun] 1 |
1461 | 398 |
THEN REPEAT (assume_tac 1)); |
5482 | 399 |
by (rewtac allRR_def); |
1196 | 400 |
by (dresolve_tac [[nat_succI, Ord_nat] MRS ltI RSN (2, ospec)] 1 |
1461 | 401 |
THEN (assume_tac 1)); |
2469 | 402 |
by (Asm_full_simp_tac 1); |
1207 | 403 |
by (REPEAT (etac conjE 1)); |
404 |
by (etac ballE 1); |
|
1196 | 405 |
by (eresolve_tac [restrict_eq_imp_val_eq RS sym] 1); |
4091 | 406 |
by (fast_tac (claset() addSEs [ssubst]) 1); |
407 |
by (asm_full_simp_tac (simpset() |
|
1461 | 408 |
addsimps [[nat_succI, Ord_nat] MRS OrdmemD RSN (2, image_fun)]) 1); |
5482 | 409 |
qed "lemma3"; |
410 |
||
6021 | 411 |
Close_locale "imp_DC0"; |
1196 | 412 |
|
3862 | 413 |
|
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
414 |
Goalw [DC_def, DC0_def] "DC(nat) ==> DC0"; |
1196 | 415 |
by (REPEAT (resolve_tac [allI, impI] 1)); |
416 |
by (REPEAT (eresolve_tac [asm_rl, conjE, ex_in_domain RS exE, allE] 1)); |
|
5482 | 417 |
by (eresolve_tac [export lemma4 RSN (2, impE)] 1 |
1461 | 418 |
THEN REPEAT (assume_tac 1)); |
1207 | 419 |
by (etac bexE 1); |
5482 | 420 |
by (dresolve_tac [export simplify_recursion] 1 |
1461 | 421 |
THEN REPEAT (assume_tac 1)); |
1196 | 422 |
by (res_inst_tac [("x","lam n:nat. f`n`n")] bexI 1); |
1207 | 423 |
by (rtac lam_type 2); |
5482 | 424 |
by (eresolve_tac [[export lemma2 RS conjunct1, succI1] MRS apply_type] 2 |
1461 | 425 |
THEN REPEAT (assume_tac 2)); |
1207 | 426 |
by (rtac ballI 1); |
5482 | 427 |
by (forward_tac [export (nat_succI RSN (5,lemma2)) RS conjunct2] 1 |
1461 | 428 |
THEN REPEAT (assume_tac 1)); |
5482 | 429 |
by (dresolve_tac [export lemma3] 1 THEN REPEAT (assume_tac 1)); |
4091 | 430 |
by (asm_full_simp_tac (simpset() addsimps [nat_succI]) 1); |
5482 | 431 |
qed "DC_nat_imp_DC0"; |
1196 | 432 |
|
433 |
(* ********************************************************************** *) |
|
1461 | 434 |
(* ALL K. Card(K) --> DC(K) ==> WO3 *) |
1196 | 435 |
(* ********************************************************************** *) |
436 |
||
5068 | 437 |
Goalw [lesspoll_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5137
diff
changeset
|
438 |
"[| ~ A lesspoll B; C lesspoll B |] ==> A - C ~= 0"; |
4091 | 439 |
by (fast_tac (claset() addSDs [Diff_eq_0_iff RS iffD1 RS subset_imp_lepoll] |
1461 | 440 |
addSIs [eqpollI] addEs [notE] addSEs [eqpollE, lepoll_trans]) 1); |
5482 | 441 |
qed "lesspoll_lemma"; |
1196 | 442 |
|
443 |
val [f_type, Ord_a, not_eq] = goalw thy [inj_def] |
|
5482 | 444 |
"[| f:a->X; Ord(a); (!!b c. [| b<c; c:a |] ==> f`b~=f`c) |] \ |
445 |
\ ==> f:inj(a, X)"; |
|
1196 | 446 |
by (resolve_tac [f_type RS CollectI] 1); |
447 |
by (REPEAT (resolve_tac [ballI,impI] 1)); |
|
448 |
by (resolve_tac [Ord_a RS Ord_in_Ord RS Ord_linear_lt] 1 |
|
1461 | 449 |
THEN (assume_tac 1)); |
1196 | 450 |
by (eres_inst_tac [("j","x")] (Ord_a RS Ord_in_Ord) 1); |
4091 | 451 |
by (REPEAT (fast_tac (claset() addDs [not_eq, not_eq RS not_sym]) 1)); |
3731 | 452 |
qed "fun_Ord_inj"; |
1196 | 453 |
|
5137 | 454 |
Goal "[| f:X->Y; A<=X; a:A |] ==> f`a : f``A"; |
4091 | 455 |
by (fast_tac (claset() addSEs [image_fun RS ssubst]) 1); |
3731 | 456 |
qed "value_in_image"; |
1196 | 457 |
|
5482 | 458 |
Goalw [DC_def, WO3_def] "ALL K. Card(K) --> DC(K) ==> WO3"; |
1207 | 459 |
by (rtac allI 1); |
1196 | 460 |
by (excluded_middle_tac "A lesspoll Hartog(A)" 1); |
4091 | 461 |
by (fast_tac (claset() addSDs [lesspoll_imp_ex_lt_eqpoll] |
1461 | 462 |
addSIs [Ord_Hartog, leI RS le_imp_subset]) 2); |
1196 | 463 |
by (REPEAT (eresolve_tac [allE, impE] 1)); |
1207 | 464 |
by (rtac Card_Hartog 1); |
1196 | 465 |
by (eres_inst_tac [("x","A")] allE 1); |
2469 | 466 |
by (eres_inst_tac [("x","{<z1,z2>:Pow(A)*A . z1 \ |
467 |
\ lesspoll Hartog(A) & z2 ~: z1}")] allE 1); |
|
468 |
by (Asm_full_simp_tac 1); |
|
1207 | 469 |
by (etac impE 1); |
4091 | 470 |
by (fast_tac (claset() addEs [lesspoll_lemma RS not_emptyE]) 1); |
1207 | 471 |
by (etac bexE 1); |
1196 | 472 |
by (resolve_tac [exI RS (lepoll_def RS (def_imp_iff RS iffD2)) |
1461 | 473 |
RS (HartogI RS notE)] 1); |
1196 | 474 |
by (resolve_tac [Ord_Hartog RSN (2, fun_Ord_inj)] 1 THEN (assume_tac 1)); |
475 |
by (dresolve_tac [Ord_Hartog RSN (2, OrdmemD) RSN (2, |
|
1461 | 476 |
ltD RSN (3, value_in_image))] 1 |
477 |
THEN REPEAT (assume_tac 1)); |
|
5482 | 478 |
by (force_tac (claset() addSDs [Ord_Hartog RSN (2, ltI) RSN (2, ospec)], |
479 |
simpset()) 1); |
|
1196 | 480 |
qed "DC_WO3"; |
481 |
||
482 |
(* ********************************************************************** *) |
|
1461 | 483 |
(* WO1 ==> ALL K. Card(K) --> DC(K) *) |
1196 | 484 |
(* ********************************************************************** *) |
485 |
||
5268 | 486 |
Goal "[| Ord(a); b:a |] ==> (lam x:a. P(x))``b = (lam x:b. P(x))``b"; |
1207 | 487 |
by (rtac images_eq 1); |
4091 | 488 |
by (REPEAT (fast_tac (claset() addSEs [RepFunI, OrdmemD] |
1461 | 489 |
addSIs [lam_type]) 2)); |
1207 | 490 |
by (rtac ballI 1); |
1196 | 491 |
by (dresolve_tac [OrdmemD RS subsetD] 1 |
1461 | 492 |
THEN REPEAT (assume_tac 1)); |
2469 | 493 |
by (Asm_full_simp_tac 1); |
3731 | 494 |
qed "lam_images_eq"; |
1196 | 495 |
|
5137 | 496 |
Goalw [lesspoll_def] "[| Card(K); b:K |] ==> b lesspoll K"; |
4091 | 497 |
by (asm_full_simp_tac (simpset() addsimps [Card_iff_initial]) 1); |
498 |
by (fast_tac (claset() addSIs [le_imp_lepoll, ltI, leI]) 1); |
|
3731 | 499 |
qed "in_Card_imp_lesspoll"; |
1196 | 500 |
|
5068 | 501 |
Goal "(lam b:a. P(b)) : a -> {P(b). b:a}"; |
4091 | 502 |
by (fast_tac (claset() addSIs [lam_type, RepFunI]) 1); |
3731 | 503 |
qed "lam_type_RepFun"; |
1196 | 504 |
|
5482 | 505 |
Goal "[| ALL Y:Pow(X). Y lesspoll K --> (EX x:X. <Y, x> : R); \ |
506 |
\ b:K; Z:Pow(X); Z lesspoll K |] \ |
|
5241 | 507 |
\ ==> {x:X. <Z,x> : R} ~= 0"; |
5265
9d1d4c43c76d
Disjointness reasoning by AddEs [equals0E, sym RS equals0E]
paulson
parents:
5241
diff
changeset
|
508 |
by (Blast_tac 1); |
5482 | 509 |
qed "lemmaX"; |
1196 | 510 |
|
5137 | 511 |
Goal "[| Card(K); well_ord(X,Q); \ |
1461 | 512 |
\ ALL Y:Pow(X). Y lesspoll K --> (EX x:X. <Y, x> : R); b:K |] \ |
513 |
\ ==> ff(b, X, Q, R) : {x:X. <(lam c:b. ff(c, X, Q, R))``b, x> : R}"; |
|
1196 | 514 |
by (res_inst_tac [("P","b:K")] impE 1 THEN TRYALL assume_tac); |
515 |
by (res_inst_tac [("i","b")] (Card_is_Ord RS Ord_in_Ord RS trans_induct) 1 |
|
1461 | 516 |
THEN REPEAT (assume_tac 1)); |
1207 | 517 |
by (rtac impI 1); |
1196 | 518 |
by (resolve_tac [ff_def RS def_transrec RS ssubst] 1); |
1207 | 519 |
by (etac the_first_in 1); |
2469 | 520 |
by (Fast_tac 1); |
4091 | 521 |
by (asm_full_simp_tac (simpset() |
1461 | 522 |
addsimps [[lam_type_RepFun, subset_refl] MRS image_fun]) 1); |
5241 | 523 |
by (etac lemmaX 1 THEN assume_tac 1); |
524 |
by (blast_tac (claset() addIs [Card_is_Ord RSN (2, OrdmemD) RS subsetD]) 1); |
|
4091 | 525 |
by (fast_tac (claset() addSEs [[in_Card_imp_lesspoll, RepFun_lepoll] |
5241 | 526 |
MRS lepoll_lesspoll_lesspoll]) 1); |
5482 | 527 |
qed "lemma"; |
1196 | 528 |
|
5482 | 529 |
Goalw [DC_def, WO1_def] "WO1 ==> ALL K. Card(K) --> DC(K)"; |
1196 | 530 |
by (REPEAT (resolve_tac [allI,impI] 1)); |
531 |
by (REPEAT (eresolve_tac [allE,exE,conjE] 1)); |
|
532 |
by (res_inst_tac [("x","lam b:K. ff(b, X, Ra, R)")] bexI 1); |
|
1207 | 533 |
by (rtac lam_type 2); |
1196 | 534 |
by (resolve_tac [lemma RS CollectD1] 2 THEN REPEAT (assume_tac 2)); |
4091 | 535 |
by (asm_full_simp_tac (simpset() |
1461 | 536 |
addsimps [[Card_is_Ord, ltD] MRS lam_images_eq]) 1); |
4091 | 537 |
by (fast_tac (claset() addSEs [ltE, lemma RS CollectD2]) 1); |
4723
9e2609b1bfb1
Adapted proofs because of new simplification tactics.
nipkow
parents:
4091
diff
changeset
|
538 |
qed "WO1_DC_Card"; |