author | nipkow |
Fri, 21 Jul 2000 18:11:54 +0200 | |
changeset 9404 | 99476cf93dad |
parent 9302 | 8adf653d40a1 |
child 9492 | 72e429c66608 |
permissions | -rw-r--r-- |
1461 | 1 |
(* Title: ZF/Ordinal.thy |
435 | 2 |
ID: $Id$ |
1461 | 3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
435 | 4 |
Copyright 1993 University of Cambridge |
5 |
||
5321 | 6 |
Ordinals in Zermelo-Fraenkel Set Theory |
435 | 7 |
*) |
8 |
||
9 |
(*** Rules for Transset ***) |
|
10 |
||
11 |
(** Two neat characterisations of Transset **) |
|
12 |
||
5067 | 13 |
Goalw [Transset_def] "Transset(A) <-> A<=Pow(A)"; |
2925 | 14 |
by (Blast_tac 1); |
760 | 15 |
qed "Transset_iff_Pow"; |
435 | 16 |
|
5067 | 17 |
Goalw [Transset_def] "Transset(A) <-> Union(succ(A)) = A"; |
4091 | 18 |
by (blast_tac (claset() addSEs [equalityE]) 1); |
760 | 19 |
qed "Transset_iff_Union_succ"; |
435 | 20 |
|
21 |
(** Consequences of downwards closure **) |
|
22 |
||
5067 | 23 |
Goalw [Transset_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
24 |
"[| Transset(C); {a,b}: C |] ==> a:C & b: C"; |
2925 | 25 |
by (Blast_tac 1); |
760 | 26 |
qed "Transset_doubleton_D"; |
435 | 27 |
|
28 |
val [prem1,prem2] = goalw Ordinal.thy [Pair_def] |
|
29 |
"[| Transset(C); <a,b>: C |] ==> a:C & b: C"; |
|
1461 | 30 |
by (cut_facts_tac [prem2] 1); |
4091 | 31 |
by (blast_tac (claset() addSDs [prem1 RS Transset_doubleton_D]) 1); |
760 | 32 |
qed "Transset_Pair_D"; |
435 | 33 |
|
34 |
val prem1::prems = goal Ordinal.thy |
|
35 |
"[| Transset(C); A*B <= C; b: B |] ==> A <= C"; |
|
36 |
by (cut_facts_tac prems 1); |
|
4091 | 37 |
by (blast_tac (claset() addSDs [prem1 RS Transset_Pair_D]) 1); |
760 | 38 |
qed "Transset_includes_domain"; |
435 | 39 |
|
40 |
val prem1::prems = goal Ordinal.thy |
|
41 |
"[| Transset(C); A*B <= C; a: A |] ==> B <= C"; |
|
42 |
by (cut_facts_tac prems 1); |
|
4091 | 43 |
by (blast_tac (claset() addSDs [prem1 RS Transset_Pair_D]) 1); |
760 | 44 |
qed "Transset_includes_range"; |
435 | 45 |
|
46 |
(** Closure properties **) |
|
47 |
||
5067 | 48 |
Goalw [Transset_def] "Transset(0)"; |
2925 | 49 |
by (Blast_tac 1); |
760 | 50 |
qed "Transset_0"; |
435 | 51 |
|
5067 | 52 |
Goalw [Transset_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
53 |
"[| Transset(i); Transset(j) |] ==> Transset(i Un j)"; |
2925 | 54 |
by (Blast_tac 1); |
760 | 55 |
qed "Transset_Un"; |
435 | 56 |
|
5067 | 57 |
Goalw [Transset_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
58 |
"[| Transset(i); Transset(j) |] ==> Transset(i Int j)"; |
2925 | 59 |
by (Blast_tac 1); |
760 | 60 |
qed "Transset_Int"; |
435 | 61 |
|
5137 | 62 |
Goalw [Transset_def] "Transset(i) ==> Transset(succ(i))"; |
2925 | 63 |
by (Blast_tac 1); |
760 | 64 |
qed "Transset_succ"; |
435 | 65 |
|
5137 | 66 |
Goalw [Transset_def] "Transset(i) ==> Transset(Pow(i))"; |
2925 | 67 |
by (Blast_tac 1); |
760 | 68 |
qed "Transset_Pow"; |
435 | 69 |
|
5137 | 70 |
Goalw [Transset_def] "Transset(A) ==> Transset(Union(A))"; |
2925 | 71 |
by (Blast_tac 1); |
760 | 72 |
qed "Transset_Union"; |
435 | 73 |
|
5321 | 74 |
val [Transprem] = Goalw [Transset_def] |
435 | 75 |
"[| !!i. i:A ==> Transset(i) |] ==> Transset(Union(A))"; |
4091 | 76 |
by (blast_tac (claset() addDs [Transprem RS bspec RS subsetD]) 1); |
760 | 77 |
qed "Transset_Union_family"; |
435 | 78 |
|
5321 | 79 |
val [prem,Transprem] = Goalw [Transset_def] |
435 | 80 |
"[| j:A; !!i. i:A ==> Transset(i) |] ==> Transset(Inter(A))"; |
81 |
by (cut_facts_tac [prem] 1); |
|
4091 | 82 |
by (blast_tac (claset() addDs [Transprem RS bspec RS subsetD]) 1); |
760 | 83 |
qed "Transset_Inter_family"; |
435 | 84 |
|
85 |
(*** Natural Deduction rules for Ord ***) |
|
86 |
||
5321 | 87 |
val prems = Goalw [Ord_def] |
2717
b29c45ef3d86
best_tac avoids looping with change to RepFun_eqI in claset
paulson
parents:
2493
diff
changeset
|
88 |
"[| Transset(i); !!x. x:i ==> Transset(x) |] ==> Ord(i)"; |
435 | 89 |
by (REPEAT (ares_tac (prems@[ballI,conjI]) 1)); |
760 | 90 |
qed "OrdI"; |
435 | 91 |
|
5321 | 92 |
Goalw [Ord_def] "Ord(i) ==> Transset(i)"; |
93 |
by (Blast_tac 1); |
|
760 | 94 |
qed "Ord_is_Transset"; |
435 | 95 |
|
5321 | 96 |
Goalw [Ord_def] |
435 | 97 |
"[| Ord(i); j:i |] ==> Transset(j) "; |
5321 | 98 |
by (Blast_tac 1); |
760 | 99 |
qed "Ord_contains_Transset"; |
435 | 100 |
|
101 |
(*** Lemmas for ordinals ***) |
|
102 |
||
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5137
diff
changeset
|
103 |
Goalw [Ord_def,Transset_def] "[| Ord(i); j:i |] ==> Ord(j)"; |
2925 | 104 |
by (Blast_tac 1); |
760 | 105 |
qed "Ord_in_Ord"; |
435 | 106 |
|
107 |
(* Ord(succ(j)) ==> Ord(j) *) |
|
108 |
val Ord_succD = succI1 RSN (2, Ord_in_Ord); |
|
109 |
||
3016 | 110 |
AddSDs [Ord_succD]; |
111 |
||
5137 | 112 |
Goal "[| Ord(i); Transset(j); j<=i |] ==> Ord(j)"; |
435 | 113 |
by (REPEAT (ares_tac [OrdI] 1 |
114 |
ORELSE eresolve_tac [Ord_contains_Transset, subsetD] 1)); |
|
760 | 115 |
qed "Ord_subset_Ord"; |
435 | 116 |
|
5143
b94cd208f073
Removal of leading "\!\!..." from most Goal commands
paulson
parents:
5137
diff
changeset
|
117 |
Goalw [Ord_def,Transset_def] "[| j:i; Ord(i) |] ==> j<=i"; |
2925 | 118 |
by (Blast_tac 1); |
760 | 119 |
qed "OrdmemD"; |
435 | 120 |
|
5137 | 121 |
Goal "[| i:j; j:k; Ord(k) |] ==> i:k"; |
435 | 122 |
by (REPEAT (ares_tac [OrdmemD RS subsetD] 1)); |
760 | 123 |
qed "Ord_trans"; |
435 | 124 |
|
5137 | 125 |
Goal "[| i:j; Ord(j) |] ==> succ(i) <= j"; |
435 | 126 |
by (REPEAT (ares_tac [OrdmemD RSN (2,succ_subsetI)] 1)); |
760 | 127 |
qed "Ord_succ_subsetI"; |
435 | 128 |
|
129 |
||
130 |
(*** The construction of ordinals: 0, succ, Union ***) |
|
131 |
||
5067 | 132 |
Goal "Ord(0)"; |
435 | 133 |
by (REPEAT (ares_tac [OrdI,Transset_0] 1 ORELSE etac emptyE 1)); |
760 | 134 |
qed "Ord_0"; |
435 | 135 |
|
5137 | 136 |
Goal "Ord(i) ==> Ord(succ(i))"; |
435 | 137 |
by (REPEAT (ares_tac [OrdI,Transset_succ] 1 |
138 |
ORELSE eresolve_tac [succE,ssubst,Ord_is_Transset, |
|
1461 | 139 |
Ord_contains_Transset] 1)); |
760 | 140 |
qed "Ord_succ"; |
435 | 141 |
|
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
142 |
bind_thm ("Ord_1", Ord_0 RS Ord_succ); |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
143 |
|
5067 | 144 |
Goal "Ord(succ(i)) <-> Ord(i)"; |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
145 |
by (blast_tac (claset() addIs [Ord_succ]) 1); |
760 | 146 |
qed "Ord_succ_iff"; |
435 | 147 |
|
2469 | 148 |
Addsimps [Ord_0, Ord_succ_iff]; |
149 |
AddSIs [Ord_0, Ord_succ]; |
|
6153 | 150 |
AddTCs [Ord_0, Ord_succ]; |
2469 | 151 |
|
5137 | 152 |
Goalw [Ord_def] "[| Ord(i); Ord(j) |] ==> Ord(i Un j)"; |
4091 | 153 |
by (blast_tac (claset() addSIs [Transset_Un]) 1); |
760 | 154 |
qed "Ord_Un"; |
435 | 155 |
|
5137 | 156 |
Goalw [Ord_def] "[| Ord(i); Ord(j) |] ==> Ord(i Int j)"; |
4091 | 157 |
by (blast_tac (claset() addSIs [Transset_Int]) 1); |
760 | 158 |
qed "Ord_Int"; |
6153 | 159 |
AddTCs [Ord_Un, Ord_Int]; |
435 | 160 |
|
5321 | 161 |
val nonempty::prems = Goal |
435 | 162 |
"[| j:A; !!i. i:A ==> Ord(i) |] ==> Ord(Inter(A))"; |
163 |
by (rtac (nonempty RS Transset_Inter_family RS OrdI) 1); |
|
164 |
by (rtac Ord_is_Transset 1); |
|
165 |
by (REPEAT (ares_tac ([Ord_contains_Transset,nonempty]@prems) 1 |
|
166 |
ORELSE etac InterD 1)); |
|
760 | 167 |
qed "Ord_Inter"; |
435 | 168 |
|
5321 | 169 |
val jmemA::prems = Goal |
435 | 170 |
"[| j:A; !!x. x:A ==> Ord(B(x)) |] ==> Ord(INT x:A. B(x))"; |
171 |
by (rtac (jmemA RS RepFunI RS Ord_Inter) 1); |
|
172 |
by (etac RepFunE 1); |
|
173 |
by (etac ssubst 1); |
|
174 |
by (eresolve_tac prems 1); |
|
760 | 175 |
qed "Ord_INT"; |
435 | 176 |
|
177 |
(*There is no set of all ordinals, for then it would contain itself*) |
|
5067 | 178 |
Goal "~ (ALL i. i:X <-> Ord(i))"; |
435 | 179 |
by (rtac notI 1); |
180 |
by (forw_inst_tac [("x", "X")] spec 1); |
|
4091 | 181 |
by (safe_tac (claset() addSEs [mem_irrefl])); |
435 | 182 |
by (swap_res_tac [Ord_is_Transset RSN (2,OrdI)] 1); |
2925 | 183 |
by (Blast_tac 2); |
437 | 184 |
by (rewtac Transset_def); |
4152 | 185 |
by Safe_tac; |
2469 | 186 |
by (Asm_full_simp_tac 1); |
435 | 187 |
by (REPEAT (eresolve_tac [asm_rl, Ord_in_Ord] 1)); |
760 | 188 |
qed "ON_class"; |
435 | 189 |
|
190 |
(*** < is 'less than' for ordinals ***) |
|
191 |
||
5137 | 192 |
Goalw [lt_def] "[| i:j; Ord(j) |] ==> i<j"; |
435 | 193 |
by (REPEAT (ares_tac [conjI] 1)); |
760 | 194 |
qed "ltI"; |
435 | 195 |
|
5321 | 196 |
val major::prems = Goalw [lt_def] |
435 | 197 |
"[| i<j; [| i:j; Ord(i); Ord(j) |] ==> P |] ==> P"; |
198 |
by (rtac (major RS conjE) 1); |
|
199 |
by (REPEAT (ares_tac (prems@[Ord_in_Ord]) 1)); |
|
760 | 200 |
qed "ltE"; |
435 | 201 |
|
5137 | 202 |
Goal "i<j ==> i:j"; |
435 | 203 |
by (etac ltE 1); |
204 |
by (assume_tac 1); |
|
760 | 205 |
qed "ltD"; |
435 | 206 |
|
5067 | 207 |
Goalw [lt_def] "~ i<0"; |
2925 | 208 |
by (Blast_tac 1); |
760 | 209 |
qed "not_lt0"; |
435 | 210 |
|
2469 | 211 |
Addsimps [not_lt0]; |
212 |
||
5137 | 213 |
Goal "j<i ==> Ord(j)"; |
1461 | 214 |
by (etac ltE 1 THEN assume_tac 1); |
830
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
215 |
qed "lt_Ord"; |
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
216 |
|
5137 | 217 |
Goal "j<i ==> Ord(i)"; |
1461 | 218 |
by (etac ltE 1 THEN assume_tac 1); |
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
219 |
qed "lt_Ord2"; |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
220 |
|
1034 | 221 |
(* "ja le j ==> Ord(j)" *) |
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
222 |
bind_thm ("le_Ord2", lt_Ord2 RS Ord_succD); |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
223 |
|
435 | 224 |
(* i<0 ==> R *) |
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
772
diff
changeset
|
225 |
bind_thm ("lt0E", not_lt0 RS notE); |
435 | 226 |
|
5137 | 227 |
Goal "[| i<j; j<k |] ==> i<k"; |
4091 | 228 |
by (blast_tac (claset() addSIs [ltI] addSEs [ltE] addIs [Ord_trans]) 1); |
760 | 229 |
qed "lt_trans"; |
435 | 230 |
|
5465 | 231 |
Goalw [lt_def] "i<j ==> ~ (j<i)"; |
232 |
by (blast_tac (claset() addEs [mem_asym]) 1); |
|
233 |
qed "lt_not_sym"; |
|
234 |
||
235 |
(* [| i<j; ~P ==> j<i |] ==> P *) |
|
236 |
bind_thm ("lt_asym", lt_not_sym RS swap); |
|
435 | 237 |
|
9180 | 238 |
val [major]= goal Ordinal.thy "i<i ==> P"; |
239 |
by (rtac (major RS (major RS lt_asym)) 1) ; |
|
240 |
qed "lt_irrefl"; |
|
435 | 241 |
|
9180 | 242 |
Goal "~ i<i"; |
243 |
by (rtac notI 1); |
|
244 |
by (etac lt_irrefl 1) ; |
|
245 |
qed "lt_not_refl"; |
|
435 | 246 |
|
2469 | 247 |
AddSEs [lt_irrefl, lt0E]; |
248 |
||
435 | 249 |
(** le is less than or equals; recall i le j abbrevs i<succ(j) !! **) |
250 |
||
5067 | 251 |
Goalw [lt_def] "i le j <-> i<j | (i=j & Ord(j))"; |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
252 |
by (Blast_tac 1); |
760 | 253 |
qed "le_iff"; |
435 | 254 |
|
772 | 255 |
(*Equivalently, i<j ==> i < succ(j)*) |
5137 | 256 |
Goal "i<j ==> i le j"; |
4091 | 257 |
by (asm_simp_tac (simpset() addsimps [le_iff]) 1); |
760 | 258 |
qed "leI"; |
435 | 259 |
|
5137 | 260 |
Goal "[| i=j; Ord(j) |] ==> i le j"; |
4091 | 261 |
by (asm_simp_tac (simpset() addsimps [le_iff]) 1); |
760 | 262 |
qed "le_eqI"; |
435 | 263 |
|
264 |
val le_refl = refl RS le_eqI; |
|
265 |
||
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
266 |
Goal "i le i <-> Ord(i)"; |
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
267 |
by (asm_simp_tac (simpset() addsimps [lt_not_refl, le_iff]) 1); |
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
268 |
qed "le_refl_iff"; |
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
269 |
|
9302 | 270 |
AddIffs [le_refl_iff]; |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
271 |
|
5321 | 272 |
val [prem] = Goal "(~ (i=j & Ord(j)) ==> i<j) ==> i le j"; |
435 | 273 |
by (rtac (disjCI RS (le_iff RS iffD2)) 1); |
274 |
by (etac prem 1); |
|
760 | 275 |
qed "leCI"; |
435 | 276 |
|
5321 | 277 |
val major::prems = Goal |
435 | 278 |
"[| i le j; i<j ==> P; [| i=j; Ord(j) |] ==> P |] ==> P"; |
279 |
by (rtac (major RS (le_iff RS iffD1 RS disjE)) 1); |
|
280 |
by (DEPTH_SOLVE (ares_tac prems 1 ORELSE etac conjE 1)); |
|
760 | 281 |
qed "leE"; |
435 | 282 |
|
5137 | 283 |
Goal "[| i le j; j le i |] ==> i=j"; |
4091 | 284 |
by (asm_full_simp_tac (simpset() addsimps [le_iff]) 1); |
285 |
by (blast_tac (claset() addEs [lt_asym]) 1); |
|
760 | 286 |
qed "le_anti_sym"; |
435 | 287 |
|
5067 | 288 |
Goal "i le 0 <-> i=0"; |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
289 |
by (blast_tac (claset() addSEs [leE]) 1); |
760 | 290 |
qed "le0_iff"; |
435 | 291 |
|
782
200a16083201
added bind_thm for theorems defined by "standard ..."
clasohm
parents:
772
diff
changeset
|
292 |
bind_thm ("le0D", le0_iff RS iffD1); |
435 | 293 |
|
2469 | 294 |
AddSDs [le0D]; |
295 |
Addsimps [le0_iff]; |
|
296 |
||
4091 | 297 |
val le_cs = claset() addSIs [leCI] addSEs [leE] addEs [lt_asym]; |
435 | 298 |
|
299 |
||
300 |
(*** Natural Deduction rules for Memrel ***) |
|
301 |
||
5067 | 302 |
Goalw [Memrel_def] "<a,b> : Memrel(A) <-> a:b & a:A & b:A"; |
2925 | 303 |
by (Blast_tac 1); |
760 | 304 |
qed "Memrel_iff"; |
435 | 305 |
|
5137 | 306 |
Goal "[| a: b; a: A; b: A |] ==> <a,b> : Memrel(A)"; |
2925 | 307 |
by (REPEAT (ares_tac [conjI, Memrel_iff RS iffD2] 1)); |
760 | 308 |
qed "MemrelI"; |
435 | 309 |
|
5321 | 310 |
val [major,minor] = Goal |
435 | 311 |
"[| <a,b> : Memrel(A); \ |
312 |
\ [| a: A; b: A; a:b |] ==> P \ |
|
313 |
\ |] ==> P"; |
|
314 |
by (rtac (major RS (Memrel_iff RS iffD1) RS conjE) 1); |
|
315 |
by (etac conjE 1); |
|
316 |
by (rtac minor 1); |
|
317 |
by (REPEAT (assume_tac 1)); |
|
760 | 318 |
qed "MemrelE"; |
435 | 319 |
|
2925 | 320 |
AddSIs [MemrelI]; |
321 |
AddSEs [MemrelE]; |
|
322 |
||
5067 | 323 |
Goalw [Memrel_def] "Memrel(A) <= A*A"; |
2925 | 324 |
by (Blast_tac 1); |
830
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
325 |
qed "Memrel_type"; |
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
326 |
|
5137 | 327 |
Goalw [Memrel_def] "A<=B ==> Memrel(A) <= Memrel(B)"; |
2925 | 328 |
by (Blast_tac 1); |
830
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
329 |
qed "Memrel_mono"; |
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
330 |
|
5067 | 331 |
Goalw [Memrel_def] "Memrel(0) = 0"; |
2925 | 332 |
by (Blast_tac 1); |
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
333 |
qed "Memrel_0"; |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
334 |
|
5067 | 335 |
Goalw [Memrel_def] "Memrel(1) = 0"; |
2925 | 336 |
by (Blast_tac 1); |
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
337 |
qed "Memrel_1"; |
830
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
338 |
|
2469 | 339 |
Addsimps [Memrel_0, Memrel_1]; |
340 |
||
435 | 341 |
(*The membership relation (as a set) is well-founded. |
342 |
Proof idea: show A<=B by applying the foundation axiom to A-B *) |
|
5067 | 343 |
Goalw [wf_def] "wf(Memrel(A))"; |
435 | 344 |
by (EVERY1 [rtac (foundation RS disjE RS allI), |
1461 | 345 |
etac disjI1, |
346 |
etac bexE, |
|
347 |
rtac (impI RS allI RS bexI RS disjI2), |
|
348 |
etac MemrelE, |
|
349 |
etac bspec, |
|
350 |
REPEAT o assume_tac]); |
|
760 | 351 |
qed "wf_Memrel"; |
435 | 352 |
|
353 |
(*Transset(i) does not suffice, though ALL j:i.Transset(j) does*) |
|
5067 | 354 |
Goalw [Ord_def, Transset_def, trans_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
355 |
"Ord(i) ==> trans(Memrel(i))"; |
2925 | 356 |
by (Blast_tac 1); |
760 | 357 |
qed "trans_Memrel"; |
435 | 358 |
|
359 |
(*If Transset(A) then Memrel(A) internalizes the membership relation below A*) |
|
5067 | 360 |
Goalw [Transset_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
361 |
"Transset(A) ==> <a,b> : Memrel(A) <-> a:b & b:A"; |
2925 | 362 |
by (Blast_tac 1); |
760 | 363 |
qed "Transset_Memrel_iff"; |
435 | 364 |
|
365 |
||
366 |
(*** Transfinite induction ***) |
|
367 |
||
368 |
(*Epsilon induction over a transitive set*) |
|
5321 | 369 |
val major::prems = Goalw [Transset_def] |
435 | 370 |
"[| i: k; Transset(k); \ |
371 |
\ !!x.[| x: k; ALL y:x. P(y) |] ==> P(x) \ |
|
372 |
\ |] ==> P(i)"; |
|
373 |
by (rtac (major RS (wf_Memrel RS wf_induct2)) 1); |
|
2925 | 374 |
by (Blast_tac 1); |
435 | 375 |
by (resolve_tac prems 1); |
376 |
by (assume_tac 1); |
|
377 |
by (cut_facts_tac prems 1); |
|
2925 | 378 |
by (Blast_tac 1); |
760 | 379 |
qed "Transset_induct"; |
435 | 380 |
|
381 |
(*Induction over an ordinal*) |
|
382 |
val Ord_induct = Ord_is_Transset RSN (2, Transset_induct); |
|
383 |
||
384 |
(*Induction over the class of ordinals -- a useful corollary of Ord_induct*) |
|
5321 | 385 |
val [major,indhyp] = Goal |
435 | 386 |
"[| Ord(i); \ |
387 |
\ !!x.[| Ord(x); ALL y:x. P(y) |] ==> P(x) \ |
|
388 |
\ |] ==> P(i)"; |
|
389 |
by (rtac (major RS Ord_succ RS (succI1 RS Ord_induct)) 1); |
|
390 |
by (rtac indhyp 1); |
|
391 |
by (rtac (major RS Ord_succ RS Ord_in_Ord) 1); |
|
392 |
by (REPEAT (assume_tac 1)); |
|
760 | 393 |
qed "trans_induct"; |
435 | 394 |
|
395 |
(*Perform induction on i, then prove the Ord(i) subgoal using prems. *) |
|
396 |
fun trans_ind_tac a prems i = |
|
397 |
EVERY [res_inst_tac [("i",a)] trans_induct i, |
|
1461 | 398 |
rename_last_tac a ["1"] (i+1), |
399 |
ares_tac prems i]; |
|
435 | 400 |
|
401 |
||
402 |
(*** Fundamental properties of the epsilon ordering (< on ordinals) ***) |
|
403 |
||
404 |
(*Finds contradictions for the following proof*) |
|
405 |
val Ord_trans_tac = EVERY' [etac notE, etac Ord_trans, REPEAT o atac]; |
|
406 |
||
407 |
(** Proving that < is a linear ordering on the ordinals **) |
|
408 |
||
5321 | 409 |
Goal "Ord(i) ==> (ALL j. Ord(j) --> i:j | i=j | j:i)"; |
410 |
by (etac trans_induct 1); |
|
435 | 411 |
by (rtac (impI RS allI) 1); |
412 |
by (trans_ind_tac "j" [] 1); |
|
2493 | 413 |
by (DEPTH_SOLVE (Step_tac 1 ORELSE Ord_trans_tac 1)); |
3736
39ee3d31cfbc
Much tidying including step_tac -> clarify_tac or safe_tac; sometimes
paulson
parents:
3016
diff
changeset
|
414 |
qed_spec_mp "Ord_linear"; |
435 | 415 |
|
416 |
(*The trichotomy law for ordinals!*) |
|
5321 | 417 |
val ordi::ordj::prems = Goalw [lt_def] |
435 | 418 |
"[| Ord(i); Ord(j); i<j ==> P; i=j ==> P; j<i ==> P |] ==> P"; |
419 |
by (rtac ([ordi,ordj] MRS Ord_linear RS disjE) 1); |
|
420 |
by (etac disjE 2); |
|
421 |
by (DEPTH_SOLVE (ares_tac ([ordi,ordj,conjI] @ prems) 1)); |
|
760 | 422 |
qed "Ord_linear_lt"; |
435 | 423 |
|
5321 | 424 |
val prems = Goal |
435 | 425 |
"[| Ord(i); Ord(j); i<j ==> P; j le i ==> P |] ==> P"; |
426 |
by (res_inst_tac [("i","i"),("j","j")] Ord_linear_lt 1); |
|
427 |
by (DEPTH_SOLVE (ares_tac ([leI, sym RS le_eqI] @ prems) 1)); |
|
760 | 428 |
qed "Ord_linear2"; |
435 | 429 |
|
5321 | 430 |
val prems = Goal |
435 | 431 |
"[| Ord(i); Ord(j); i le j ==> P; j le i ==> P |] ==> P"; |
432 |
by (res_inst_tac [("i","i"),("j","j")] Ord_linear_lt 1); |
|
433 |
by (DEPTH_SOLVE (ares_tac ([leI,le_eqI] @ prems) 1)); |
|
760 | 434 |
qed "Ord_linear_le"; |
435 | 435 |
|
5137 | 436 |
Goal "j le i ==> ~ i<j"; |
2925 | 437 |
by (blast_tac le_cs 1); |
760 | 438 |
qed "le_imp_not_lt"; |
435 | 439 |
|
5137 | 440 |
Goal "[| ~ i<j; Ord(i); Ord(j) |] ==> j le i"; |
435 | 441 |
by (res_inst_tac [("i","i"),("j","j")] Ord_linear2 1); |
442 |
by (REPEAT (SOMEGOAL assume_tac)); |
|
2925 | 443 |
by (blast_tac le_cs 1); |
760 | 444 |
qed "not_lt_imp_le"; |
435 | 445 |
|
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
446 |
(** Some rewrite rules for <, le **) |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
447 |
|
5137 | 448 |
Goalw [lt_def] "Ord(j) ==> i:j <-> i<j"; |
2925 | 449 |
by (Blast_tac 1); |
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
450 |
qed "Ord_mem_iff_lt"; |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
451 |
|
5137 | 452 |
Goal "[| Ord(i); Ord(j) |] ==> ~ i<j <-> j le i"; |
435 | 453 |
by (REPEAT (ares_tac [iffI, le_imp_not_lt, not_lt_imp_le] 1)); |
760 | 454 |
qed "not_lt_iff_le"; |
435 | 455 |
|
5137 | 456 |
Goal "[| Ord(i); Ord(j) |] ==> ~ i le j <-> j<i"; |
4091 | 457 |
by (asm_simp_tac (simpset() addsimps [not_lt_iff_le RS iff_sym]) 1); |
760 | 458 |
qed "not_le_iff_lt"; |
435 | 459 |
|
1610 | 460 |
(*This is identical to 0<succ(i) *) |
5137 | 461 |
Goal "Ord(i) ==> 0 le i"; |
435 | 462 |
by (etac (not_lt_iff_le RS iffD1) 1); |
463 |
by (REPEAT (resolve_tac [Ord_0, not_lt0] 1)); |
|
760 | 464 |
qed "Ord_0_le"; |
435 | 465 |
|
5137 | 466 |
Goal "[| Ord(i); i~=0 |] ==> 0<i"; |
435 | 467 |
by (etac (not_le_iff_lt RS iffD1) 1); |
468 |
by (rtac Ord_0 1); |
|
2925 | 469 |
by (Blast_tac 1); |
760 | 470 |
qed "Ord_0_lt"; |
435 | 471 |
|
472 |
(*** Results about less-than or equals ***) |
|
473 |
||
474 |
(** For ordinals, j<=i (subset) implies j le i (less-than or equals) **) |
|
475 |
||
5137 | 476 |
Goal "[| j<=i; Ord(i); Ord(j) |] ==> j le i"; |
435 | 477 |
by (rtac (not_lt_iff_le RS iffD1) 1); |
478 |
by (assume_tac 1); |
|
479 |
by (assume_tac 1); |
|
4091 | 480 |
by (blast_tac (claset() addEs [ltE, mem_irrefl]) 1); |
760 | 481 |
qed "subset_imp_le"; |
435 | 482 |
|
5137 | 483 |
Goal "i le j ==> i<=j"; |
435 | 484 |
by (etac leE 1); |
2925 | 485 |
by (Blast_tac 2); |
486 |
by (blast_tac (subset_cs addIs [OrdmemD] addEs [ltE]) 1); |
|
760 | 487 |
qed "le_imp_subset"; |
435 | 488 |
|
5067 | 489 |
Goal "j le i <-> j<=i & Ord(i) & Ord(j)"; |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
490 |
by (blast_tac (claset() addDs [subset_imp_le, le_imp_subset] addEs [ltE]) 1); |
760 | 491 |
qed "le_subset_iff"; |
435 | 492 |
|
5067 | 493 |
Goal "i le succ(j) <-> i le j | i=succ(j) & Ord(i)"; |
4091 | 494 |
by (simp_tac (simpset() addsimps [le_iff]) 1); |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
495 |
by (Blast_tac 1); |
760 | 496 |
qed "le_succ_iff"; |
435 | 497 |
|
498 |
(*Just a variant of subset_imp_le*) |
|
5321 | 499 |
val [ordi,ordj,minor] = Goal |
435 | 500 |
"[| Ord(i); Ord(j); !!x. x<j ==> x<i |] ==> j le i"; |
501 |
by (REPEAT_FIRST (ares_tac [notI RS not_lt_imp_le, ordi, ordj])); |
|
437 | 502 |
by (etac (minor RS lt_irrefl) 1); |
760 | 503 |
qed "all_lt_imp_le"; |
435 | 504 |
|
505 |
(** Transitive laws **) |
|
506 |
||
5137 | 507 |
Goal "[| i le j; j<k |] ==> i<k"; |
4091 | 508 |
by (blast_tac (claset() addSEs [leE] addIs [lt_trans]) 1); |
760 | 509 |
qed "lt_trans1"; |
435 | 510 |
|
5137 | 511 |
Goal "[| i<j; j le k |] ==> i<k"; |
4091 | 512 |
by (blast_tac (claset() addSEs [leE] addIs [lt_trans]) 1); |
760 | 513 |
qed "lt_trans2"; |
435 | 514 |
|
5137 | 515 |
Goal "[| i le j; j le k |] ==> i le k"; |
435 | 516 |
by (REPEAT (ares_tac [lt_trans1] 1)); |
760 | 517 |
qed "le_trans"; |
435 | 518 |
|
5137 | 519 |
Goal "i<j ==> succ(i) le j"; |
435 | 520 |
by (rtac (not_lt_iff_le RS iffD1) 1); |
2925 | 521 |
by (blast_tac le_cs 3); |
4091 | 522 |
by (ALLGOALS (blast_tac (claset() addEs [ltE]))); |
760 | 523 |
qed "succ_leI"; |
435 | 524 |
|
830
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
525 |
(*Identical to succ(i) < succ(j) ==> i<j *) |
5137 | 526 |
Goal "succ(i) le j ==> i<j"; |
435 | 527 |
by (rtac (not_le_iff_lt RS iffD1) 1); |
4475 | 528 |
by (blast_tac le_cs 3); |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
529 |
by (ALLGOALS (blast_tac (claset() addEs [ltE]))); |
760 | 530 |
qed "succ_leE"; |
435 | 531 |
|
5067 | 532 |
Goal "succ(i) le j <-> i<j"; |
435 | 533 |
by (REPEAT (ares_tac [iffI,succ_leI,succ_leE] 1)); |
760 | 534 |
qed "succ_le_iff"; |
435 | 535 |
|
2469 | 536 |
Addsimps [succ_le_iff]; |
537 |
||
5137 | 538 |
Goal "succ(i) le succ(j) ==> i le j"; |
4091 | 539 |
by (blast_tac (claset() addSDs [succ_leE]) 1); |
830
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
540 |
qed "succ_le_imp_le"; |
18240b5d8a06
Moved Transset_includes_summands and Transset_sum_Int_subset to
lcp
parents:
782
diff
changeset
|
541 |
|
6176
707b6f9859d2
tidied, with left_inverse & right_inverse as default simprules
paulson
parents:
6153
diff
changeset
|
542 |
Goal "[| i <= j; j<k; Ord(i) |] ==> i<k"; |
707b6f9859d2
tidied, with left_inverse & right_inverse as default simprules
paulson
parents:
6153
diff
changeset
|
543 |
by (resolve_tac [subset_imp_le RS lt_trans1] 1); |
707b6f9859d2
tidied, with left_inverse & right_inverse as default simprules
paulson
parents:
6153
diff
changeset
|
544 |
by (REPEAT (eresolve_tac [asm_rl, ltE] 1)); |
707b6f9859d2
tidied, with left_inverse & right_inverse as default simprules
paulson
parents:
6153
diff
changeset
|
545 |
qed "lt_subset_trans"; |
707b6f9859d2
tidied, with left_inverse & right_inverse as default simprules
paulson
parents:
6153
diff
changeset
|
546 |
|
435 | 547 |
(** Union and Intersection **) |
548 |
||
5137 | 549 |
Goal "[| Ord(i); Ord(j) |] ==> i le i Un j"; |
435 | 550 |
by (rtac (Un_upper1 RS subset_imp_le) 1); |
551 |
by (REPEAT (ares_tac [Ord_Un] 1)); |
|
760 | 552 |
qed "Un_upper1_le"; |
435 | 553 |
|
5137 | 554 |
Goal "[| Ord(i); Ord(j) |] ==> j le i Un j"; |
435 | 555 |
by (rtac (Un_upper2 RS subset_imp_le) 1); |
556 |
by (REPEAT (ares_tac [Ord_Un] 1)); |
|
760 | 557 |
qed "Un_upper2_le"; |
435 | 558 |
|
559 |
(*Replacing k by succ(k') yields the similar rule for le!*) |
|
5137 | 560 |
Goal "[| i<k; j<k |] ==> i Un j < k"; |
435 | 561 |
by (res_inst_tac [("i","i"),("j","j")] Ord_linear_le 1); |
2033 | 562 |
by (stac Un_commute 4); |
4091 | 563 |
by (asm_full_simp_tac (simpset() addsimps [le_subset_iff, subset_Un_iff]) 4); |
564 |
by (asm_full_simp_tac (simpset() addsimps [le_subset_iff, subset_Un_iff]) 3); |
|
435 | 565 |
by (REPEAT (eresolve_tac [asm_rl, ltE] 1)); |
760 | 566 |
qed "Un_least_lt"; |
435 | 567 |
|
5137 | 568 |
Goal "[| Ord(i); Ord(j) |] ==> i Un j < k <-> i<k & j<k"; |
4091 | 569 |
by (safe_tac (claset() addSIs [Un_least_lt])); |
437 | 570 |
by (rtac (Un_upper2_le RS lt_trans1) 2); |
571 |
by (rtac (Un_upper1_le RS lt_trans1) 1); |
|
435 | 572 |
by (REPEAT_SOME assume_tac); |
760 | 573 |
qed "Un_least_lt_iff"; |
435 | 574 |
|
575 |
val [ordi,ordj,ordk] = goal Ordinal.thy |
|
576 |
"[| Ord(i); Ord(j); Ord(k) |] ==> i Un j : k <-> i:k & j:k"; |
|
8551 | 577 |
by (cut_inst_tac [("k","k")] ([ordi,ordj] MRS Un_least_lt_iff) 1); |
4091 | 578 |
by (asm_full_simp_tac (simpset() addsimps [lt_def,ordi,ordj,ordk]) 1); |
760 | 579 |
qed "Un_least_mem_iff"; |
435 | 580 |
|
581 |
(*Replacing k by succ(k') yields the similar rule for le!*) |
|
5137 | 582 |
Goal "[| i<k; j<k |] ==> i Int j < k"; |
435 | 583 |
by (res_inst_tac [("i","i"),("j","j")] Ord_linear_le 1); |
2033 | 584 |
by (stac Int_commute 4); |
4091 | 585 |
by (asm_full_simp_tac (simpset() addsimps [le_subset_iff, subset_Int_iff]) 4); |
586 |
by (asm_full_simp_tac (simpset() addsimps [le_subset_iff, subset_Int_iff]) 3); |
|
435 | 587 |
by (REPEAT (eresolve_tac [asm_rl, ltE] 1)); |
760 | 588 |
qed "Int_greatest_lt"; |
435 | 589 |
|
590 |
(*FIXME: the Intersection duals are missing!*) |
|
591 |
||
592 |
||
593 |
(*** Results about limits ***) |
|
594 |
||
5321 | 595 |
val prems = Goal "[| !!i. i:A ==> Ord(i) |] ==> Ord(Union(A))"; |
435 | 596 |
by (rtac (Ord_is_Transset RS Transset_Union_family RS OrdI) 1); |
597 |
by (REPEAT (etac UnionE 1 ORELSE ares_tac ([Ord_contains_Transset]@prems) 1)); |
|
760 | 598 |
qed "Ord_Union"; |
435 | 599 |
|
5321 | 600 |
val prems = Goal |
435 | 601 |
"[| !!x. x:A ==> Ord(B(x)) |] ==> Ord(UN x:A. B(x))"; |
602 |
by (rtac Ord_Union 1); |
|
603 |
by (etac RepFunE 1); |
|
604 |
by (etac ssubst 1); |
|
605 |
by (eresolve_tac prems 1); |
|
760 | 606 |
qed "Ord_UN"; |
435 | 607 |
|
608 |
(* No < version; consider (UN i:nat.i)=nat *) |
|
5321 | 609 |
val [ordi,limit] = Goal |
435 | 610 |
"[| Ord(i); !!x. x:A ==> b(x) le i |] ==> (UN x:A. b(x)) le i"; |
611 |
by (rtac (le_imp_subset RS UN_least RS subset_imp_le) 1); |
|
612 |
by (REPEAT (ares_tac [ordi, Ord_UN, limit] 1 ORELSE etac (limit RS ltE) 1)); |
|
760 | 613 |
qed "UN_least_le"; |
435 | 614 |
|
5321 | 615 |
val [jlti,limit] = Goal |
435 | 616 |
"[| j<i; !!x. x:A ==> b(x)<j |] ==> (UN x:A. succ(b(x))) < i"; |
617 |
by (rtac (jlti RS ltE) 1); |
|
618 |
by (rtac (UN_least_le RS lt_trans2) 1); |
|
619 |
by (REPEAT (ares_tac [jlti, succ_leI, limit] 1)); |
|
760 | 620 |
qed "UN_succ_least_lt"; |
435 | 621 |
|
5321 | 622 |
val prems = Goal |
435 | 623 |
"[| a: A; i le b(a); !!x. x:A ==> Ord(b(x)) |] ==> i le (UN x:A. b(x))"; |
624 |
by (resolve_tac (prems RL [ltE]) 1); |
|
625 |
by (rtac (le_imp_subset RS subset_trans RS subset_imp_le) 1); |
|
626 |
by (REPEAT (ares_tac (prems @ [UN_upper, Ord_UN]) 1)); |
|
760 | 627 |
qed "UN_upper_le"; |
435 | 628 |
|
5321 | 629 |
val [leprem] = Goal |
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
630 |
"[| !!x. x:A ==> c(x) le d(x) |] ==> (UN x:A. c(x)) le (UN x:A. d(x))"; |
1461 | 631 |
by (rtac UN_least_le 1); |
632 |
by (rtac UN_upper_le 2); |
|
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
633 |
by (REPEAT (ares_tac [leprem] 2)); |
1461 | 634 |
by (rtac Ord_UN 1); |
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
635 |
by (REPEAT (eresolve_tac [asm_rl, leprem RS ltE] 1 |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
636 |
ORELSE dtac Ord_succD 1)); |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
637 |
qed "le_implies_UN_le_UN"; |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
638 |
|
5137 | 639 |
Goal "Ord(i) ==> (UN y:i. succ(y)) = i"; |
4091 | 640 |
by (blast_tac (claset() addIs [Ord_trans]) 1); |
760 | 641 |
qed "Ord_equality"; |
435 | 642 |
|
643 |
(*Holds for all transitive sets, not just ordinals*) |
|
5137 | 644 |
Goal "Ord(i) ==> Union(i) <= i"; |
4091 | 645 |
by (blast_tac (claset() addIs [Ord_trans]) 1); |
760 | 646 |
qed "Ord_Union_subset"; |
435 | 647 |
|
648 |
||
649 |
(*** Limit ordinals -- general properties ***) |
|
650 |
||
5137 | 651 |
Goalw [Limit_def] "Limit(i) ==> Union(i) = i"; |
4091 | 652 |
by (fast_tac (claset() addSIs [ltI] addSEs [ltE] addEs [Ord_trans]) 1); |
760 | 653 |
qed "Limit_Union_eq"; |
435 | 654 |
|
5137 | 655 |
Goalw [Limit_def] "Limit(i) ==> Ord(i)"; |
435 | 656 |
by (etac conjunct1 1); |
760 | 657 |
qed "Limit_is_Ord"; |
435 | 658 |
|
5137 | 659 |
Goalw [Limit_def] "Limit(i) ==> 0 < i"; |
435 | 660 |
by (etac (conjunct2 RS conjunct1) 1); |
760 | 661 |
qed "Limit_has_0"; |
435 | 662 |
|
5137 | 663 |
Goalw [Limit_def] "[| Limit(i); j<i |] ==> succ(j) < i"; |
2925 | 664 |
by (Blast_tac 1); |
760 | 665 |
qed "Limit_has_succ"; |
435 | 666 |
|
5067 | 667 |
Goalw [Limit_def] |
5147
825877190618
More tidying and removal of "\!\!... from Goal commands
paulson
parents:
5143
diff
changeset
|
668 |
"[| 0<i; ALL y. succ(y) ~= i |] ==> Limit(i)"; |
435 | 669 |
by (safe_tac subset_cs); |
670 |
by (rtac (not_le_iff_lt RS iffD1) 2); |
|
2925 | 671 |
by (blast_tac le_cs 4); |
435 | 672 |
by (REPEAT (eresolve_tac [asm_rl, ltE, Ord_succ] 1)); |
760 | 673 |
qed "non_succ_LimitI"; |
435 | 674 |
|
5137 | 675 |
Goal "Limit(succ(i)) ==> P"; |
437 | 676 |
by (rtac lt_irrefl 1); |
677 |
by (rtac Limit_has_succ 1); |
|
678 |
by (assume_tac 1); |
|
679 |
by (etac (Limit_is_Ord RS Ord_succD RS le_refl) 1); |
|
760 | 680 |
qed "succ_LimitE"; |
435 | 681 |
|
5137 | 682 |
Goal "[| Limit(i); i le succ(j) |] ==> i le j"; |
4091 | 683 |
by (safe_tac (claset() addSEs [succ_LimitE, leE])); |
760 | 684 |
qed "Limit_le_succD"; |
435 | 685 |
|
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
686 |
(** Traditional 3-way case analysis on ordinals **) |
435 | 687 |
|
5137 | 688 |
Goal "Ord(i) ==> i=0 | (EX j. Ord(j) & i=succ(j)) | Limit(i)"; |
8127
68c6159440f1
new lemmas for Ntree recursor example; more simprules; more lemmas borrowed
paulson
parents:
6176
diff
changeset
|
689 |
by (blast_tac (claset() addSIs [non_succ_LimitI, Ord_0_lt]) 1); |
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
690 |
qed "Ord_cases_disj"; |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
691 |
|
5321 | 692 |
val major::prems = Goal |
1461 | 693 |
"[| Ord(i); \ |
694 |
\ i=0 ==> P; \ |
|
695 |
\ !!j. [| Ord(j); i=succ(j) |] ==> P; \ |
|
696 |
\ Limit(i) ==> P \ |
|
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
697 |
\ |] ==> P"; |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
698 |
by (cut_facts_tac [major RS Ord_cases_disj] 1); |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
699 |
by (REPEAT (eresolve_tac (prems@[asm_rl, disjE, exE, conjE]) 1)); |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
700 |
qed "Ord_cases"; |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
701 |
|
5321 | 702 |
val major::prems = Goal |
1461 | 703 |
"[| Ord(i); \ |
704 |
\ P(0); \ |
|
705 |
\ !!x. [| Ord(x); P(x) |] ==> P(succ(x)); \ |
|
706 |
\ !!x. [| Limit(x); ALL y:x. P(y) |] ==> P(x) \ |
|
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
707 |
\ |] ==> P(i)"; |
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
708 |
by (resolve_tac [major RS trans_induct] 1); |
1461 | 709 |
by (etac Ord_cases 1); |
4091 | 710 |
by (ALLGOALS (blast_tac (claset() addIs prems))); |
851
f9172c4625f1
Moved theorems Ord_cases_lemma and Ord_cases here from Univ,
lcp
parents:
830
diff
changeset
|
711 |
qed "trans_induct3"; |