| author | kleing | 
| Tue, 21 Nov 2000 13:48:47 +0100 | |
| changeset 10501 | 98fe9e987a17 | 
| parent 8551 | 5c22595bc599 | 
| child 11317 | 7f9e4c389318 | 
| permissions | -rw-r--r-- | 
| 1461 | 1  | 
(* Title: ZF/AC/WO6_WO1.ML  | 
| 992 | 2  | 
ID: $Id$  | 
| 1461 | 3  | 
Author: Krzysztof Grabczewski  | 
| 992 | 4  | 
|
| 1041 | 5  | 
The proof of "WO6 ==> WO1". Simplified by L C Paulson.  | 
| 992 | 6  | 
|
7  | 
From the book "Equivalents of the Axiom of Choice" by Rubin & Rubin,  | 
|
8  | 
pages 2-5  | 
|
9  | 
*)  | 
|
10  | 
||
| 1041 | 11  | 
goal OrderType.thy  | 
12  | 
"!!i j k. [| k < i++j; Ord(i); Ord(j) |] ==> \  | 
|
13  | 
\ k < i | (~ k<i & k = i ++ (k--i) & (k--i)<j)";  | 
|
14  | 
by (res_inst_tac [("i","k"),("j","i")] Ord_linear2 1);
 | 
|
15  | 
by (dtac odiff_lt_mono2 4 THEN assume_tac 4);  | 
|
16  | 
by (asm_full_simp_tac  | 
|
| 4091 | 17  | 
(simpset() addsimps [oadd_odiff_inverse, odiff_oadd_inverse]) 4);  | 
18  | 
by (safe_tac (claset() addSEs [lt_Ord]));  | 
|
| 3731 | 19  | 
qed "lt_oadd_odiff_disj";  | 
| 1041 | 20  | 
|
21  | 
(*The corresponding elimination rule*)  | 
|
| 4152 | 22  | 
val lt_oadd_odiff_cases = rule_by_tactic Safe_tac  | 
| 1041 | 23  | 
(lt_oadd_odiff_disj RS disjE);  | 
24  | 
||
| 992 | 25  | 
(* ********************************************************************** *)  | 
| 1461 | 26  | 
(* The most complicated part of the proof - lemma ii - p. 2-4 *)  | 
| 992 | 27  | 
(* ********************************************************************** *)  | 
28  | 
||
29  | 
(* ********************************************************************** *)  | 
|
| 1461 | 30  | 
(* some properties of relation uu(beta, gamma, delta) - p. 2 *)  | 
| 992 | 31  | 
(* ********************************************************************** *)  | 
32  | 
||
| 5068 | 33  | 
Goalw [uu_def] "domain(uu(f,b,g,d)) <= f`b";  | 
| 3731 | 34  | 
by (Blast_tac 1);  | 
35  | 
qed "domain_uu_subset";  | 
|
| 992 | 36  | 
|
| 5137 | 37  | 
Goal "ALL b<a. f`b lepoll m ==> \  | 
| 1041 | 38  | 
\ ALL b<a. ALL g<a. ALL d<a. domain(uu(f,b,g,d)) lepoll m";  | 
| 4091 | 39  | 
by (fast_tac (claset() addSEs  | 
| 1461 | 40  | 
[domain_uu_subset RS subset_imp_lepoll RS lepoll_trans]) 1);  | 
| 3731 | 41  | 
qed "quant_domain_uu_lepoll_m";  | 
| 992 | 42  | 
|
| 5068 | 43  | 
Goalw [uu_def] "uu(f,b,g,d) <= f`b * f`g";  | 
| 3731 | 44  | 
by (Blast_tac 1);  | 
45  | 
qed "uu_subset1";  | 
|
| 992 | 46  | 
|
| 5068 | 47  | 
Goalw [uu_def] "uu(f,b,g,d) <= f`d";  | 
| 3731 | 48  | 
by (Blast_tac 1);  | 
49  | 
qed "uu_subset2";  | 
|
| 992 | 50  | 
|
| 5137 | 51  | 
Goal "[| ALL b<a. f`b lepoll m; d<a |] ==> uu(f,b,g,d) lepoll m";  | 
| 4091 | 52  | 
by (fast_tac (claset()  | 
| 1461 | 53  | 
addSEs [uu_subset2 RS subset_imp_lepoll RS lepoll_trans]) 1);  | 
| 3731 | 54  | 
qed "uu_lepoll_m";  | 
| 992 | 55  | 
|
56  | 
(* ********************************************************************** *)  | 
|
| 1461 | 57  | 
(* Two cases for lemma ii *)  | 
| 992 | 58  | 
(* ********************************************************************** *)  | 
| 5068 | 59  | 
Goalw [lesspoll_def]  | 
| 8123 | 60  | 
"ALL b<a. ALL g<a. ALL d<a. u(f,b,g,d) lepoll m \  | 
61  | 
\ ==> (ALL b<a. f`b ~= 0 --> \  | 
|
62  | 
\ (EX g<a. EX d<a. u(f,b,g,d) ~= 0 & u(f,b,g,d) lesspoll m)) \  | 
|
63  | 
\ | (EX b<a. f`b ~= 0 & (ALL g<a. ALL d<a. u(f,b,g,d) ~= 0 --> \  | 
|
| 1461 | 64  | 
\ u(f,b,g,d) eqpoll m))";  | 
| 2469 | 65  | 
by (Asm_simp_tac 1);  | 
| 4091 | 66  | 
by (blast_tac (claset() delrules [equalityI]) 1);  | 
| 3731 | 67  | 
qed "cases";  | 
| 992 | 68  | 
|
69  | 
(* ********************************************************************** *)  | 
|
| 1461 | 70  | 
(* Lemmas used in both cases *)  | 
| 992 | 71  | 
(* ********************************************************************** *)  | 
| 5137 | 72  | 
Goal "Ord(a) ==> (UN b<a++a. C(b)) = (UN b<a. C(b) Un C(a++b))";  | 
| 4091 | 73  | 
by (fast_tac (claset() addSIs [equalityI] addIs [ltI]  | 
| 1041 | 74  | 
addSDs [lt_oadd_disj]  | 
75  | 
addSEs [lt_oadd1, oadd_lt_mono2]) 1);  | 
|
| 3731 | 76  | 
qed "UN_oadd";  | 
| 992 | 77  | 
|
78  | 
||
79  | 
(* ********************************************************************** *)  | 
|
| 1461 | 80  | 
(* Case 1 : lemmas *)  | 
| 992 | 81  | 
(* ********************************************************************** *)  | 
82  | 
||
| 5068 | 83  | 
Goalw [vv1_def] "vv1(f,m,b) <= f`b";  | 
| 1450 | 84  | 
by (rtac (LetI RS LetI) 1);  | 
| 4091 | 85  | 
by (simp_tac (simpset() addsimps [domain_uu_subset]) 1);  | 
| 3731 | 86  | 
qed "vv1_subset";  | 
| 992 | 87  | 
|
88  | 
(* ********************************************************************** *)  | 
|
| 1461 | 89  | 
(* Case 1 : Union of images is the whole "y" *)  | 
| 992 | 90  | 
(* ********************************************************************** *)  | 
| 5068 | 91  | 
Goalw [gg1_def]  | 
| 1461 | 92  | 
"!! a f y. [| Ord(a); m:nat |] ==> \  | 
93  | 
\ (UN b<a++a. gg1(f,a,m)`b) = (UN b<a. f`b)";  | 
|
| 1041 | 94  | 
by (asm_simp_tac  | 
| 4091 | 95  | 
(simpset() addsimps [UN_oadd, lt_oadd1,  | 
| 1461 | 96  | 
oadd_le_self RS le_imp_not_lt, lt_Ord,  | 
97  | 
odiff_oadd_inverse, ltD,  | 
|
98  | 
vv1_subset RS Diff_partition, ww1_def]) 1);  | 
|
| 3731 | 99  | 
qed "UN_gg1_eq";  | 
| 1041 | 100  | 
|
| 5068 | 101  | 
Goal "domain(gg1(f,a,m)) = a++a";  | 
| 4091 | 102  | 
by (simp_tac (simpset() addsimps [lam_funtype RS domain_of_fun, gg1_def]) 1);  | 
| 3731 | 103  | 
qed "domain_gg1";  | 
| 992 | 104  | 
|
105  | 
(* ********************************************************************** *)  | 
|
| 1461 | 106  | 
(* every value of defined function is less than or equipollent to m *)  | 
| 992 | 107  | 
(* ********************************************************************** *)  | 
| 5137 | 108  | 
Goal "[| P(a, b); Ord(a); Ord(b); \  | 
| 1461 | 109  | 
\ Least_a = (LEAST a. EX x. Ord(x) & P(a, x)) |] \  | 
110  | 
\ ==> P(Least_a, LEAST b. P(Least_a, b))";  | 
|
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
111  | 
by (etac ssubst 1);  | 
| 992 | 112  | 
by (res_inst_tac [("Q","%z. P(z, LEAST b. P(z, b))")] LeastI2 1);
 | 
| 4091 | 113  | 
by (REPEAT (fast_tac (claset() addSEs [LeastI]) 1));  | 
| 3731 | 114  | 
qed "nested_LeastI";  | 
| 992 | 115  | 
|
| 8551 | 116  | 
bind_thm ("nested_Least_instance",
 | 
117  | 
inst "P"  | 
|
118  | 
"%g d. domain(uu(f,b,g,d)) ~= 0 & domain(uu(f,b,g,d)) lepoll m"  | 
|
119  | 
nested_LeastI);  | 
|
| 992 | 120  | 
|
| 5068 | 121  | 
Goalw [gg1_def]  | 
| 1041 | 122  | 
"!!a. [| Ord(a); m:nat; \  | 
| 1461 | 123  | 
\ ALL b<a. f`b ~=0 --> \  | 
124  | 
\ (EX g<a. EX d<a. domain(uu(f,b,g,d)) ~= 0 & \  | 
|
125  | 
\ domain(uu(f,b,g,d)) lepoll m); \  | 
|
126  | 
\ ALL b<a. f`b lepoll succ(m); b<a++a \  | 
|
127  | 
\ |] ==> gg1(f,a,m)`b lepoll m";  | 
|
| 2469 | 128  | 
by (Asm_simp_tac 1);  | 
| 4091 | 129  | 
by (safe_tac (claset() addSEs [lt_oadd_odiff_cases]));  | 
| 1041 | 130  | 
(*Case b<a : show vv1(f,m,b) lepoll m *)  | 
| 5137 | 131  | 
by (asm_simp_tac (simpset() addsimps [vv1_def, Let_def]) 1);  | 
| 4091 | 132  | 
by (fast_tac (claset() addIs [nested_Least_instance RS conjunct2]  | 
| 1461 | 133  | 
addSEs [lt_Ord]  | 
134  | 
addSIs [empty_lepollI]) 1);  | 
|
| 1041 | 135  | 
(*Case a le b: show ww1(f,m,b--a) lepoll m *)  | 
| 4091 | 136  | 
by (asm_simp_tac (simpset() addsimps [ww1_def]) 1);  | 
| 1041 | 137  | 
by (excluded_middle_tac "f`(b--a) = 0" 1);  | 
| 4091 | 138  | 
by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 2);  | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
139  | 
by (rtac Diff_lepoll 1);  | 
| 3731 | 140  | 
by (Blast_tac 1);  | 
| 1041 | 141  | 
by (rtac vv1_subset 1);  | 
142  | 
by (dtac (ospec RS mp) 1);  | 
|
| 6153 | 143  | 
by (REPEAT (eresolve_tac [asm_rl, oexE, conjE] 1));  | 
| 4091 | 144  | 
by (asm_simp_tac (simpset()  | 
| 1461 | 145  | 
addsimps [vv1_def, Let_def, lt_Ord,  | 
146  | 
nested_Least_instance RS conjunct1]) 1);  | 
|
| 3731 | 147  | 
qed "gg1_lepoll_m";  | 
| 992 | 148  | 
|
149  | 
(* ********************************************************************** *)  | 
|
| 1461 | 150  | 
(* Case 2 : lemmas *)  | 
| 992 | 151  | 
(* ********************************************************************** *)  | 
152  | 
||
153  | 
(* ********************************************************************** *)  | 
|
| 1461 | 154  | 
(* Case 2 : vv2_subset *)  | 
| 992 | 155  | 
(* ********************************************************************** *)  | 
156  | 
||
| 5137 | 157  | 
Goalw [uu_def] "[| b<a; g<a; f`b~=0; f`g~=0; \  | 
| 5315 | 158  | 
\ y*y <= y; (UN b<a. f`b)=y \  | 
159  | 
\ |] ==> EX d<a. uu(f,b,g,d) ~= 0";  | 
|
| 4091 | 160  | 
by (fast_tac (claset() addSIs [not_emptyI]  | 
| 1461 | 161  | 
addSDs [SigmaI RSN (2, subsetD)]  | 
162  | 
addSEs [not_emptyE]) 1);  | 
|
| 3731 | 163  | 
qed "ex_d_uu_not_empty";  | 
| 992 | 164  | 
|
| 5137 | 165  | 
Goal "[| b<a; g<a; f`b~=0; f`g~=0; \  | 
| 5315 | 166  | 
\ y*y<=y; (UN b<a. f`b)=y |] \  | 
167  | 
\ ==> uu(f,b,g,LEAST d. (uu(f,b,g,d) ~= 0)) ~= 0";  | 
|
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
168  | 
by (dtac ex_d_uu_not_empty 1 THEN REPEAT (assume_tac 1));  | 
| 4091 | 169  | 
by (fast_tac (claset() addSEs [LeastI, lt_Ord]) 1);  | 
| 3731 | 170  | 
qed "uu_not_empty";  | 
| 992 | 171  | 
|
| 
5325
 
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
 
paulson 
parents: 
5315 
diff
changeset
 | 
172  | 
Goal "[| r<=A*B; r~=0 |] ==> domain(r)~=0";  | 
| 
 
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
 
paulson 
parents: 
5315 
diff
changeset
 | 
173  | 
by (Blast_tac 1);  | 
| 3731 | 174  | 
qed "not_empty_rel_imp_domain";  | 
| 992 | 175  | 
|
| 5137 | 176  | 
Goal "[| b<a; g<a; f`b~=0; f`g~=0; \  | 
| 5315 | 177  | 
\ y*y <= y; (UN b<a. f`b)=y |] \  | 
178  | 
\ ==> (LEAST d. uu(f,b,g,d) ~= 0) < a";  | 
|
| 992 | 179  | 
by (eresolve_tac [ex_d_uu_not_empty RS oexE] 1  | 
| 1461 | 180  | 
THEN REPEAT (assume_tac 1));  | 
| 992 | 181  | 
by (resolve_tac [Least_le RS lt_trans1] 1  | 
| 1461 | 182  | 
THEN (REPEAT (ares_tac [lt_Ord] 1)));  | 
| 3731 | 183  | 
qed "Least_uu_not_empty_lt_a";  | 
| 992 | 184  | 
|
| 
5325
 
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
 
paulson 
parents: 
5315 
diff
changeset
 | 
185  | 
Goal "[| B<=A; a~:B |] ==> B <= A-{a}";
 | 
| 3731 | 186  | 
by (Blast_tac 1);  | 
187  | 
qed "subset_Diff_sing";  | 
|
| 992 | 188  | 
|
| 1041 | 189  | 
(*Could this be proved more directly?*)  | 
| 5137 | 190  | 
Goal "[| A lepoll m; m lepoll B; B <= A; m:nat |] ==> A=B";  | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
191  | 
by (etac natE 1);  | 
| 4091 | 192  | 
by (fast_tac (claset() addSDs [lepoll_0_is_0] addSIs [equalityI]) 1);  | 
| 
5325
 
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
 
paulson 
parents: 
5315 
diff
changeset
 | 
193  | 
by (safe_tac (claset() addSIs [equalityI]));  | 
| 
 
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
 
paulson 
parents: 
5315 
diff
changeset
 | 
194  | 
by (rtac ccontr 1);  | 
| 
 
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
 
paulson 
parents: 
5315 
diff
changeset
 | 
195  | 
by (etac (subset_Diff_sing RS subset_imp_lepoll  | 
| 
 
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
 
paulson 
parents: 
5315 
diff
changeset
 | 
196  | 
RSN (2, Diff_sing_lepoll RSN (3, lepoll_trans RS lepoll_trans)) RS  | 
| 
 
f7a5e06adea1
Yet more removal of "goal" commands, especially "goal ZF.thy", so ZF.thy
 
paulson 
parents: 
5315 
diff
changeset
 | 
197  | 
succ_lepoll_natE) 1  | 
| 1461 | 198  | 
THEN REPEAT (assume_tac 1));  | 
| 3731 | 199  | 
qed "supset_lepoll_imp_eq";  | 
| 992 | 200  | 
|
| 5268 | 201  | 
Goal "[| ALL g<a. ALL d<a. domain(uu(f, b, g, d))~=0 --> \  | 
| 1461 | 202  | 
\ domain(uu(f, b, g, d)) eqpoll succ(m); \  | 
203  | 
\ ALL b<a. f`b lepoll succ(m); y*y <= y; \  | 
|
204  | 
\ (UN b<a. f`b)=y; b<a; g<a; d<a; \  | 
|
205  | 
\ f`b~=0; f`g~=0; m:nat; s:f`b \  | 
|
| 1071 | 206  | 
\ |] ==> uu(f, b, g, LEAST d. uu(f,b,g,d)~=0) : f`b -> f`g";  | 
207  | 
by (dres_inst_tac [("x2","g")] (ospec RS ospec RS mp) 1);
 | 
|
208  | 
by (rtac ([uu_subset1, uu_not_empty] MRS not_empty_rel_imp_domain) 3);  | 
|
209  | 
by (rtac Least_uu_not_empty_lt_a 2 THEN TRYALL assume_tac);  | 
|
| 992 | 210  | 
by (resolve_tac [eqpoll_sym RS eqpoll_imp_lepoll RS  | 
| 1461 | 211  | 
(Least_uu_not_empty_lt_a RSN (2, uu_lepoll_m) RSN (2,  | 
212  | 
uu_subset1 RSN (4, rel_is_fun)))] 1  | 
|
213  | 
THEN TRYALL assume_tac);  | 
|
| 1071 | 214  | 
by (rtac (eqpoll_sym RS eqpoll_imp_lepoll RSN (2, supset_lepoll_imp_eq)) 1);  | 
| 5137 | 215  | 
by (REPEAT (fast_tac (claset() addSIs [domain_uu_subset]) 1));  | 
| 3731 | 216  | 
qed "uu_Least_is_fun";  | 
| 992 | 217  | 
|
| 5068 | 218  | 
Goalw [vv2_def]  | 
| 1461 | 219  | 
"!!a. [| ALL g<a. ALL d<a. domain(uu(f, b, g, d))~=0 --> \  | 
220  | 
\ domain(uu(f, b, g, d)) eqpoll succ(m); \  | 
|
221  | 
\ ALL b<a. f`b lepoll succ(m); y*y <= y; \  | 
|
222  | 
\ (UN b<a. f`b)=y; b<a; g<a; m:nat; s:f`b \  | 
|
223  | 
\ |] ==> vv2(f,b,g,s) <= f`g";  | 
|
| 
5116
 
8eb343ab5748
Renamed expand_if to split_if and setloop split_tac to addsplits,
 
paulson 
parents: 
5068 
diff
changeset
 | 
224  | 
by (split_tac [split_if] 1);  | 
| 3731 | 225  | 
by Safe_tac;  | 
| 2493 | 226  | 
by (etac (uu_Least_is_fun RS apply_type) 1);  | 
| 4091 | 227  | 
by (REPEAT_SOME (fast_tac (claset() addSIs [not_emptyI, singleton_subsetI])));  | 
| 3731 | 228  | 
qed "vv2_subset";  | 
| 992 | 229  | 
|
230  | 
(* ********************************************************************** *)  | 
|
| 1461 | 231  | 
(* Case 2 : Union of images is the whole "y" *)  | 
| 992 | 232  | 
(* ********************************************************************** *)  | 
| 5068 | 233  | 
Goalw [gg2_def]  | 
| 1461 | 234  | 
"!!a. [| ALL g<a. ALL d<a. domain(uu(f,b,g,d)) ~= 0 --> \  | 
235  | 
\ domain(uu(f,b,g,d)) eqpoll succ(m); \  | 
|
236  | 
\ ALL b<a. f`b lepoll succ(m); y*y<=y; \  | 
|
| 3840 | 237  | 
\ (UN b<a. f`b)=y; Ord(a); m:nat; s:f`b; b<a \  | 
| 1461 | 238  | 
\ |] ==> (UN g<a++a. gg2(f,a,b,s) ` g) = y";  | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
239  | 
by (dtac sym 1);  | 
| 1041 | 240  | 
by (asm_simp_tac  | 
| 4091 | 241  | 
(simpset() addsimps [UN_oadd, lt_oadd1,  | 
| 1461 | 242  | 
oadd_le_self RS le_imp_not_lt, lt_Ord,  | 
243  | 
odiff_oadd_inverse, ww2_def,  | 
|
244  | 
vv2_subset RS Diff_partition]) 1);  | 
|
| 3731 | 245  | 
qed "UN_gg2_eq";  | 
| 1041 | 246  | 
|
| 5068 | 247  | 
Goal "domain(gg2(f,a,b,s)) = a++a";  | 
| 4091 | 248  | 
by (simp_tac (simpset() addsimps [lam_funtype RS domain_of_fun, gg2_def]) 1);  | 
| 3731 | 249  | 
qed "domain_gg2";  | 
| 992 | 250  | 
|
251  | 
(* ********************************************************************** *)  | 
|
| 1461 | 252  | 
(* every value of defined function is less than or equipollent to m *)  | 
| 992 | 253  | 
(* ********************************************************************** *)  | 
254  | 
||
| 5315 | 255  | 
Goalw [vv2_def] "[| m:nat; m~=0 |] ==> vv2(f,b,g,s) lepoll m";  | 
| 5137 | 256  | 
by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 1);  | 
| 4091 | 257  | 
by (fast_tac (claset()  | 
| 1461 | 258  | 
addSDs [le_imp_subset RS subset_imp_lepoll RS lepoll_0_is_0]  | 
259  | 
addSIs [singleton_eqpoll_1 RS eqpoll_imp_lepoll RS lepoll_trans,  | 
|
260  | 
not_lt_imp_le RS le_imp_subset RS subset_imp_lepoll,  | 
|
261  | 
nat_into_Ord, nat_1I]) 1);  | 
|
| 3731 | 262  | 
qed "vv2_lepoll";  | 
| 992 | 263  | 
|
| 5068 | 264  | 
Goalw [ww2_def]  | 
| 5315 | 265  | 
"[| ALL b<a. f`b lepoll succ(m); g<a; m:nat; vv2(f,b,g,d) <= f`g |] \  | 
266  | 
\ ==> ww2(f,b,g,d) lepoll m";  | 
|
| 1041 | 267  | 
by (excluded_middle_tac "f`g = 0" 1);  | 
| 4091 | 268  | 
by (asm_simp_tac (simpset() addsimps [empty_lepollI]) 2);  | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
269  | 
by (dtac ospec 1 THEN (assume_tac 1));  | 
| 5137 | 270  | 
by (rtac Diff_lepoll 1 THEN (TRYALL assume_tac));  | 
271  | 
by (asm_simp_tac (simpset() addsimps [vv2_def, not_emptyI]) 1);  | 
|
| 3731 | 272  | 
qed "ww2_lepoll";  | 
| 1041 | 273  | 
|
| 5068 | 274  | 
Goalw [gg2_def]  | 
| 1461 | 275  | 
"!!a. [| ALL g<a. ALL d<a. domain(uu(f,b,g,d)) ~= 0 --> \  | 
276  | 
\ domain(uu(f,b,g,d)) eqpoll succ(m); \  | 
|
277  | 
\ ALL b<a. f`b lepoll succ(m); y*y <= y; \  | 
|
278  | 
\ (UN b<a. f`b)=y; b<a; s:f`b; m:nat; m~= 0; g<a++a \  | 
|
| 1041 | 279  | 
\ |] ==> gg2(f,a,b,s) ` g lepoll m";  | 
| 2469 | 280  | 
by (Asm_simp_tac 1);  | 
| 4091 | 281  | 
by (safe_tac (claset() addSEs [lt_oadd_odiff_cases, lt_Ord2]));  | 
282  | 
by (asm_simp_tac (simpset() addsimps [vv2_lepoll]) 1);  | 
|
283  | 
by (asm_simp_tac (simpset() addsimps [ww2_lepoll, vv2_subset]) 1);  | 
|
| 3731 | 284  | 
qed "gg2_lepoll_m";  | 
| 992 | 285  | 
|
286  | 
(* ********************************************************************** *)  | 
|
| 1461 | 287  | 
(* lemma ii *)  | 
| 992 | 288  | 
(* ********************************************************************** *)  | 
| 5315 | 289  | 
Goalw [NN_def] "[| succ(m) : NN(y); y*y <= y; m:nat; m~=0 |] ==> m : NN(y)";  | 
| 992 | 290  | 
by (REPEAT (eresolve_tac [CollectE, exE, conjE] 1));  | 
291  | 
by (resolve_tac [quant_domain_uu_lepoll_m RS cases RS disjE] 1  | 
|
| 1041 | 292  | 
THEN (assume_tac 1));  | 
| 992 | 293  | 
(* case 1 *)  | 
| 4091 | 294  | 
by (asm_full_simp_tac (simpset() addsimps [lesspoll_succ_iff]) 1);  | 
| 1041 | 295  | 
by (res_inst_tac [("x","a++a")] exI 1);
 | 
| 4091 | 296  | 
by (fast_tac (claset() addSIs [Ord_oadd, domain_gg1, UN_gg1_eq,  | 
| 1461 | 297  | 
gg1_lepoll_m]) 1);  | 
| 992 | 298  | 
(* case 2 *)  | 
299  | 
by (REPEAT (eresolve_tac [oexE, conjE] 1));  | 
|
| 1041 | 300  | 
by (res_inst_tac [("A","f`?B")] not_emptyE 1 THEN (assume_tac 1));
 | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
301  | 
by (rtac CollectI 1);  | 
| 
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
302  | 
by (etac succ_natD 1);  | 
| 992 | 303  | 
by (res_inst_tac [("x","a++a")] exI 1);
 | 
| 1041 | 304  | 
by (res_inst_tac [("x","gg2(f,a,b,x)")] exI 1);
 | 
305  | 
(*Calling fast_tac might get rid of the res_inst_tac calls, but it  | 
|
306  | 
is just too slow.*)  | 
|
| 4091 | 307  | 
by (asm_simp_tac (simpset() addsimps  | 
| 1461 | 308  | 
[Ord_oadd, domain_gg2, UN_gg2_eq, gg2_lepoll_m]) 1);  | 
| 3731 | 309  | 
qed "lemma_ii";  | 
| 992 | 310  | 
|
311  | 
||
312  | 
(* ********************************************************************** *)  | 
|
313  | 
(* lemma iv - p. 4 : *)  | 
|
314  | 
(* For every set x there is a set y such that x Un (y * y) <= y *)  | 
|
315  | 
(* ********************************************************************** *)  | 
|
316  | 
||
317  | 
(* the quantifier ALL looks inelegant but makes the proofs shorter *)  | 
|
318  | 
(* (used only in the following two lemmas) *)  | 
|
319  | 
||
| 5068 | 320  | 
Goal "ALL n:nat. rec(n, x, %k r. r Un r*r) <= \  | 
| 992 | 321  | 
\ rec(succ(n), x, %k r. r Un r*r)";  | 
| 4091 | 322  | 
by (fast_tac (claset() addIs [rec_succ RS ssubst]) 1);  | 
| 3731 | 323  | 
qed "z_n_subset_z_succ_n";  | 
| 992 | 324  | 
|
| 5137 | 325  | 
Goal "[| ALL n:nat. f(n)<=f(succ(n)); n le m; n : nat; m: nat |] \  | 
| 5315 | 326  | 
\ ==> f(n)<=f(m)";  | 
| 2469 | 327  | 
by (eres_inst_tac [("P","n le m")] rev_mp 1);
 | 
| 992 | 328  | 
by (res_inst_tac [("P","%z. n le z --> f(n) <= f(z)")] nat_induct 1);
 | 
| 2469 | 329  | 
by (REPEAT (fast_tac le_cs 1));  | 
| 3731 | 330  | 
qed "le_subsets";  | 
| 992 | 331  | 
|
| 5137 | 332  | 
Goal "[| n le m; m:nat |] ==> \  | 
| 1461 | 333  | 
\ rec(n, x, %k r. r Un r*r) <= rec(m, x, %k r. r Un r*r)";  | 
| 992 | 334  | 
by (resolve_tac [z_n_subset_z_succ_n RS le_subsets] 1  | 
| 1041 | 335  | 
THEN (TRYALL assume_tac));  | 
| 992 | 336  | 
by (eresolve_tac [Ord_nat RSN (2, ltI) RSN (2, lt_trans1) RS ltD] 1  | 
| 1041 | 337  | 
THEN (assume_tac 1));  | 
| 3731 | 338  | 
qed "le_imp_rec_subset";  | 
| 992 | 339  | 
|
| 5068 | 340  | 
Goal "EX y. x Un y*y <= y";  | 
| 992 | 341  | 
by (res_inst_tac [("x","UN n:nat. rec(n, x, %k r. r Un r*r)")] exI 1);
 | 
| 4152 | 342  | 
by Safe_tac;  | 
| 2493 | 343  | 
by (rtac (nat_0I RS UN_I) 1);  | 
| 2469 | 344  | 
by (Asm_simp_tac 1);  | 
| 992 | 345  | 
by (res_inst_tac [("a","succ(n Un na)")] UN_I 1);
 | 
| 1041 | 346  | 
by (eresolve_tac [Un_nat_type RS nat_succI] 1 THEN (assume_tac 1));  | 
| 992 | 347  | 
by (fast_tac (ZF_cs addIs [le_imp_rec_subset RS subsetD]  | 
| 1461 | 348  | 
addSIs [Un_upper1_le, Un_upper2_le, Un_nat_type]  | 
| 4091 | 349  | 
addSEs [nat_into_Ord] addss (simpset())) 1);  | 
| 3731 | 350  | 
qed "lemma_iv";  | 
| 992 | 351  | 
|
352  | 
(* ********************************************************************** *)  | 
|
| 1461 | 353  | 
(* Rubin & Rubin wrote : *)  | 
| 992 | 354  | 
(* "It follows from (ii) and mathematical induction that if y*y <= y then *)  | 
| 1461 | 355  | 
(* y can be well-ordered" *)  | 
| 992 | 356  | 
|
| 1461 | 357  | 
(* In fact we have to prove : *)  | 
358  | 
(* * WO6 ==> NN(y) ~= 0 *)  | 
|
359  | 
(* * reverse induction which lets us infer that 1 : NN(y) *)  | 
|
360  | 
(* * 1 : NN(y) ==> y can be well-ordered *)  | 
|
| 992 | 361  | 
(* ********************************************************************** *)  | 
362  | 
||
363  | 
(* ********************************************************************** *)  | 
|
| 1461 | 364  | 
(* WO6 ==> NN(y) ~= 0 *)  | 
| 992 | 365  | 
(* ********************************************************************** *)  | 
366  | 
||
| 5315 | 367  | 
Goalw [WO6_def, NN_def] "WO6 ==> NN(y) ~= 0";  | 
| 
5265
 
9d1d4c43c76d
Disjointness reasoning by  AddEs [equals0E, sym RS equals0E]
 
paulson 
parents: 
5241 
diff
changeset
 | 
368  | 
by (fast_tac ZF_cs 1); (*SLOW if current claset is used*)  | 
| 3731 | 369  | 
qed "WO6_imp_NN_not_empty";  | 
| 992 | 370  | 
|
371  | 
(* ********************************************************************** *)  | 
|
| 1461 | 372  | 
(* 1 : NN(y) ==> y can be well-ordered *)  | 
| 992 | 373  | 
(* ********************************************************************** *)  | 
374  | 
||
| 5137 | 375  | 
Goal "[| (UN b<a. f`b)=y; x:y; ALL b<a. f`b lepoll 1; Ord(a) |] \  | 
| 5315 | 376  | 
\     ==> EX c<a. f`c = {x}";
 | 
| 4091 | 377  | 
by (fast_tac (claset() addSEs [lepoll_1_is_sing]) 1);  | 
| 992 | 378  | 
val lemma1 = result();  | 
379  | 
||
| 5137 | 380  | 
Goal "[| (UN b<a. f`b)=y; x:y; ALL b<a. f`b lepoll 1; Ord(a) |] \  | 
| 5315 | 381  | 
\     ==> f` (LEAST i. f`i = {x}) = {x}";
 | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
382  | 
by (dtac lemma1 1 THEN REPEAT (assume_tac 1));  | 
| 4091 | 383  | 
by (fast_tac (claset() addSEs [lt_Ord] addIs [LeastI]) 1);  | 
| 992 | 384  | 
val lemma2 = result();  | 
385  | 
||
| 5137 | 386  | 
Goalw [NN_def] "1 : NN(y) ==> EX a f. Ord(a) & f:inj(y, a)";  | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
387  | 
by (etac CollectE 1);  | 
| 992 | 388  | 
by (REPEAT (eresolve_tac [exE, conjE] 1));  | 
389  | 
by (res_inst_tac [("x","a")] exI 1);
 | 
|
390  | 
by (res_inst_tac [("x","lam x:y. LEAST i. f`i = {x}")] exI 1);
 | 
|
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
391  | 
by (rtac conjI 1 THEN (assume_tac 1));  | 
| 992 | 392  | 
by (res_inst_tac [("d","%i. THE x. x:f`i")] lam_injective 1);
 | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
393  | 
by (dtac lemma1 1 THEN REPEAT (assume_tac 1));  | 
| 4091 | 394  | 
by (fast_tac (claset() addSEs [Least_le RS lt_trans1 RS ltD, lt_Ord]) 1);  | 
| 1041 | 395  | 
by (resolve_tac [lemma2 RS ssubst] 1 THEN REPEAT (assume_tac 1));  | 
| 5505 | 396  | 
by (Blast_tac 1);  | 
| 3731 | 397  | 
qed "NN_imp_ex_inj";  | 
| 992 | 398  | 
|
| 5137 | 399  | 
Goal "[| y*y <= y; 1 : NN(y) |] ==> EX r. well_ord(y, r)";  | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
400  | 
by (dtac NN_imp_ex_inj 1);  | 
| 4091 | 401  | 
by (fast_tac (claset() addSEs [well_ord_Memrel RSN (2, well_ord_rvimage)]) 1);  | 
| 3731 | 402  | 
qed "y_well_ord";  | 
| 992 | 403  | 
|
404  | 
(* ********************************************************************** *)  | 
|
| 1461 | 405  | 
(* reverse induction which lets us infer that 1 : NN(y) *)  | 
| 992 | 406  | 
(* ********************************************************************** *)  | 
407  | 
||
408  | 
val [prem1, prem2] = goal thy  | 
|
| 1461 | 409  | 
"[| n:nat; !!m. [| m:nat; m~=0; P(succ(m)) |] ==> P(m) |] \  | 
410  | 
\ ==> n~=0 --> P(n) --> P(1)";  | 
|
| 6070 | 411  | 
by (rtac (prem1 RS nat_induct) 1);  | 
| 3731 | 412  | 
by (Blast_tac 1);  | 
| 992 | 413  | 
by (excluded_middle_tac "x=0" 1);  | 
| 3731 | 414  | 
by (Blast_tac 2);  | 
| 4091 | 415  | 
by (fast_tac (claset() addSIs [prem2]) 1);  | 
| 3731 | 416  | 
qed "rev_induct_lemma";  | 
| 992 | 417  | 
|
| 5315 | 418  | 
val prems =  | 
419  | 
Goal "[| P(n); n:nat; n~=0; \  | 
|
420  | 
\ !!m. [| m:nat; m~=0; P(succ(m)) |] ==> P(m) |] \  | 
|
421  | 
\ ==> P(1)";  | 
|
| 992 | 422  | 
by (resolve_tac [rev_induct_lemma RS impE] 1);  | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
423  | 
by (etac impE 4 THEN (assume_tac 5));  | 
| 992 | 424  | 
by (REPEAT (ares_tac prems 1));  | 
| 3731 | 425  | 
qed "rev_induct";  | 
| 992 | 426  | 
|
| 5137 | 427  | 
Goalw [NN_def] "n:NN(y) ==> n:nat";  | 
| 1057 | 428  | 
by (etac CollectD1 1);  | 
| 3731 | 429  | 
qed "NN_into_nat";  | 
| 992 | 430  | 
|
| 5137 | 431  | 
Goal "[| n:NN(y); y*y <= y; n~=0 |] ==> 1:NN(y)";  | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
432  | 
by (rtac rev_induct 1 THEN REPEAT (ares_tac [NN_into_nat] 1));  | 
| 
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
433  | 
by (rtac lemma_ii 1 THEN REPEAT (assume_tac 1));  | 
| 992 | 434  | 
val lemma3 = result();  | 
435  | 
||
436  | 
(* ********************************************************************** *)  | 
|
| 1461 | 437  | 
(* Main theorem "WO6 ==> WO1" *)  | 
| 992 | 438  | 
(* ********************************************************************** *)  | 
439  | 
||
440  | 
(* another helpful lemma *)  | 
|
| 5137 | 441  | 
Goalw [NN_def] "0:NN(y) ==> y=0";  | 
| 4091 | 442  | 
by (fast_tac (claset() addSIs [equalityI]  | 
| 5315 | 443  | 
addSDs [lepoll_0_is_0] addEs [subst]) 1);  | 
| 3731 | 444  | 
qed "NN_y_0";  | 
| 992 | 445  | 
|
| 5137 | 446  | 
Goalw [WO1_def] "WO6 ==> WO1";  | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
447  | 
by (rtac allI 1);  | 
| 992 | 448  | 
by (excluded_middle_tac "A=0" 1);  | 
| 4091 | 449  | 
by (fast_tac (claset() addSIs [well_ord_Memrel, nat_0I RS nat_into_Ord]) 2);  | 
| 992 | 450  | 
by (res_inst_tac [("x1","A")] (lemma_iv RS revcut_rl) 1);
 | 
| 
1208
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
451  | 
by (etac exE 1);  | 
| 
 
bc3093616ba4
Ran expandshort and corrected spelling of Grabczewski
 
paulson 
parents: 
1071 
diff
changeset
 | 
452  | 
by (dtac WO6_imp_NN_not_empty 1);  | 
| 992 | 453  | 
by (eresolve_tac [Un_subset_iff RS iffD1 RS conjE] 1);  | 
454  | 
by (eres_inst_tac [("A","NN(y)")] not_emptyE 1);
 | 
|
| 7499 | 455  | 
by (ftac y_well_ord 1);  | 
| 4091 | 456  | 
by (fast_tac (claset() addEs [well_ord_subset]) 2);  | 
457  | 
by (fast_tac (claset() addSIs [lemma3] addSDs [NN_y_0] addSEs [not_emptyE]) 1);  | 
|
| 992 | 458  | 
qed "WO6_imp_WO1";  | 
459  |