234 apply (rule notI) |
234 apply (rule notI) |
235 apply (erule lt_irrefl) |
235 apply (erule lt_irrefl) |
236 done |
236 done |
237 |
237 |
238 |
238 |
239 (** Recall that @{term"i \<le> j"} abbreviates @{term"i<succ(j)"} !! **) |
239 text{* Recall that @{term"i \<le> j"} abbreviates @{term"i<succ(j)"} !! *} |
240 |
240 |
241 lemma le_iff: "i \<le> j <-> i<j | (i=j & Ord(j))" |
241 lemma le_iff: "i \<le> j <-> i<j | (i=j & Ord(j))" |
242 by (unfold lt_def, blast) |
242 by (unfold lt_def, blast) |
243 |
243 |
244 (*Equivalently, i<j ==> i < succ(j)*) |
244 (*Equivalently, i<j ==> i < succ(j)*) |
333 apply (simp add: Transset_def) |
333 apply (simp add: Transset_def) |
334 apply (erule wf_Memrel [THEN wf_induct2], blast+) |
334 apply (erule wf_Memrel [THEN wf_induct2], blast+) |
335 done |
335 done |
336 |
336 |
337 (*Induction over an ordinal*) |
337 (*Induction over an ordinal*) |
338 lemmas Ord_induct [consumes 2] = Transset_induct [OF _ Ord_is_Transset] |
338 lemmas Ord_induct [consumes 2] = Transset_induct [rule_format, OF _ Ord_is_Transset] |
339 lemmas Ord_induct_rule = Ord_induct [rule_format, consumes 2] |
|
340 |
339 |
341 (*Induction over the class of ordinals -- a useful corollary of Ord_induct*) |
340 (*Induction over the class of ordinals -- a useful corollary of Ord_induct*) |
342 |
341 |
343 lemma trans_induct [consumes 1]: |
342 lemma trans_induct [rule_format, consumes 1, case_names step]: |
344 "[| Ord(i); |
343 "[| Ord(i); |
345 !!x.[| Ord(x); \<forall>y\<in>x. P(y) |] ==> P(x) |] |
344 !!x.[| Ord(x); \<forall>y\<in>x. P(y) |] ==> P(x) |] |
346 ==> P(i)" |
345 ==> P(i)" |
347 apply (rule Ord_succ [THEN succI1 [THEN Ord_induct]], assumption) |
346 apply (rule Ord_succ [THEN succI1 [THEN Ord_induct]], assumption) |
348 apply (blast intro: Ord_succ [THEN Ord_in_Ord]) |
347 apply (blast intro: Ord_succ [THEN Ord_in_Ord]) |
349 done |
348 done |
350 |
349 |
351 lemmas trans_induct_rule = trans_induct [rule_format, consumes 1] |
350 |
352 |
351 section{*Fundamental properties of the epsilon ordering (< on ordinals)*} |
353 |
|
354 (*** Fundamental properties of the epsilon ordering (< on ordinals) ***) |
|
355 |
352 |
356 |
353 |
357 subsubsection{*Proving That < is a Linear Ordering on the Ordinals*} |
354 subsubsection{*Proving That < is a Linear Ordering on the Ordinals*} |
358 |
355 |
359 lemma Ord_linear [rule_format]: |
356 lemma Ord_linear [rule_format]: |
362 apply (rule impI [THEN allI]) |
359 apply (rule impI [THEN allI]) |
363 apply (erule_tac i=j in trans_induct) |
360 apply (erule_tac i=j in trans_induct) |
364 apply (blast dest: Ord_trans) |
361 apply (blast dest: Ord_trans) |
365 done |
362 done |
366 |
363 |
367 (*The trichotomy law for ordinals!*) |
364 text{*The trichotomy law for ordinals*} |
368 lemma Ord_linear_lt: |
365 lemma Ord_linear_lt: |
369 "[| Ord(i); Ord(j); i<j ==> P; i=j ==> P; j<i ==> P |] ==> P" |
366 assumes o: "Ord(i)" "Ord(j)" |
|
367 obtains (lt) "i<j" | (eq) "i=j" | (gt) "j<i" |
370 apply (simp add: lt_def) |
368 apply (simp add: lt_def) |
371 apply (rule_tac i1=i and j1=j in Ord_linear [THEN disjE], blast+) |
369 apply (rule_tac i1=i and j1=j in Ord_linear [THEN disjE]) |
|
370 apply (blast intro: o)+ |
372 done |
371 done |
373 |
372 |
374 lemma Ord_linear2: |
373 lemma Ord_linear2: |
375 "[| Ord(i); Ord(j); i<j ==> P; j \<le> i ==> P |] ==> P" |
374 assumes o: "Ord(i)" "Ord(j)" |
|
375 obtains (lt) "i<j" | (ge) "j \<le> i" |
376 apply (rule_tac i = i and j = j in Ord_linear_lt) |
376 apply (rule_tac i = i and j = j in Ord_linear_lt) |
377 apply (blast intro: leI le_eqI sym ) + |
377 apply (blast intro: leI le_eqI sym o) + |
378 done |
378 done |
379 |
379 |
380 lemma Ord_linear_le: |
380 lemma Ord_linear_le: |
381 "[| Ord(i); Ord(j); i \<le> j ==> P; j \<le> i ==> P |] ==> P" |
381 assumes o: "Ord(i)" "Ord(j)" |
|
382 obtains (le) "i \<le> j" | (ge) "j \<le> i" |
382 apply (rule_tac i = i and j = j in Ord_linear_lt) |
383 apply (rule_tac i = i and j = j in Ord_linear_lt) |
383 apply (blast intro: leI le_eqI ) + |
384 apply (blast intro: leI le_eqI o) + |
384 done |
385 done |
385 |
386 |
386 lemma le_imp_not_lt: "j \<le> i ==> ~ i<j" |
387 lemma le_imp_not_lt: "j \<le> i ==> ~ i<j" |
387 by (blast elim!: leE elim: lt_asym) |
388 by (blast elim!: leE elim: lt_asym) |
388 |
389 |
699 |
700 |
700 lemma Ord_cases_disj: "Ord(i) ==> i=0 | (\<exists>j. Ord(j) & i=succ(j)) | Limit(i)" |
701 lemma Ord_cases_disj: "Ord(i) ==> i=0 | (\<exists>j. Ord(j) & i=succ(j)) | Limit(i)" |
701 by (blast intro!: non_succ_LimitI Ord_0_lt) |
702 by (blast intro!: non_succ_LimitI Ord_0_lt) |
702 |
703 |
703 lemma Ord_cases: |
704 lemma Ord_cases: |
704 "[| Ord(i); |
705 assumes i: "Ord(i)" |
705 i=0 ==> P; |
706 obtains (0) "i=0" | (succ) j where "Ord(j)" "i=succ(j)" | (limit) "Limit(i)" |
706 !!j. [| Ord(j); i=succ(j) |] ==> P; |
707 by (insert Ord_cases_disj [OF i], auto) |
707 Limit(i) ==> P |
|
708 |] ==> P" |
|
709 by (drule Ord_cases_disj, blast) |
|
710 |
708 |
711 lemma trans_induct3_raw: |
709 lemma trans_induct3_raw: |
712 "[| Ord(i); |
710 "[| Ord(i); |
713 P(0); |
711 P(0); |
714 !!x. [| Ord(x); P(x) |] ==> P(succ(x)); |
712 !!x. [| Ord(x); P(x) |] ==> P(succ(x)); |