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