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