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