src/ZF/Ordinal.thy
author wenzelm
Fri, 06 May 2011 17:52:08 +0200
changeset 42711 159c4d1d4c42
parent 35762 af3ff2ba4c54
child 46820 c656222c4dc1
permissions -rw-r--r--
removed \underscoreon which is from Larry's iman.sty, not underscore.sty;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     1
(*  Title:      ZF/Ordinal.thy
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     3
    Copyright   1994  University of Cambridge
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     4
*)
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
     5
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
     6
header{*Transitive Sets and Ordinals*}
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
     7
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 14864
diff changeset
     8
theory Ordinal imports WF Bool equalities begin
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
     9
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    10
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    11
  Memrel        :: "i=>i"  where
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    12
    "Memrel(A)   == {z: A*A . EX x y. z=<x,y> & x:y }"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    13
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    14
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    15
  Transset  :: "i=>o"  where
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    16
    "Transset(i) == ALL x:i. x<=i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    17
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    18
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    19
  Ord  :: "i=>o"  where
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    20
    "Ord(i)      == Transset(i) & (ALL x:i. Transset(x))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    21
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    22
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    23
  lt        :: "[i,i] => o"  (infixl "<" 50)   (*less-than on ordinals*)  where
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    24
    "i<j         == i:j & Ord(j)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    25
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    26
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22808
diff changeset
    27
  Limit         :: "i=>o"  where
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    28
    "Limit(i)    == Ord(i) & 0<i & (ALL y. y<i --> succ(y)<i)"
2539
ddd22ceee8cc turned some consts into syntax;
wenzelm
parents: 2469
diff changeset
    29
22808
a7daa74e2980 eliminated unnamed infixes, tuned syntax;
wenzelm
parents: 16417
diff changeset
    30
abbreviation
a7daa74e2980 eliminated unnamed infixes, tuned syntax;
wenzelm
parents: 16417
diff changeset
    31
  le  (infixl "le" 50) where
a7daa74e2980 eliminated unnamed infixes, tuned syntax;
wenzelm
parents: 16417
diff changeset
    32
  "x le y == x < succ(y)"
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    33
22808
a7daa74e2980 eliminated unnamed infixes, tuned syntax;
wenzelm
parents: 16417
diff changeset
    34
notation (xsymbols)
a7daa74e2980 eliminated unnamed infixes, tuned syntax;
wenzelm
parents: 16417
diff changeset
    35
  le  (infixl "\<le>" 50)
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
    36
22808
a7daa74e2980 eliminated unnamed infixes, tuned syntax;
wenzelm
parents: 16417
diff changeset
    37
notation (HTML output)
a7daa74e2980 eliminated unnamed infixes, tuned syntax;
wenzelm
parents: 16417
diff changeset
    38
  le  (infixl "\<le>" 50)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    39
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    40
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
    41
subsection{*Rules for Transset*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    42
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
    43
subsubsection{*Three Neat Characterisations of Transset*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    44
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    45
lemma Transset_iff_Pow: "Transset(A) <-> A<=Pow(A)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    46
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    47
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    48
lemma Transset_iff_Union_succ: "Transset(A) <-> Union(succ(A)) = A"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    49
apply (unfold Transset_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    50
apply (blast elim!: equalityE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    51
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    52
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    53
lemma Transset_iff_Union_subset: "Transset(A) <-> Union(A) <= A"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    54
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    55
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
    56
subsubsection{*Consequences of Downwards Closure*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    57
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    58
lemma Transset_doubleton_D: 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    59
    "[| Transset(C); {a,b}: C |] ==> a:C & b: C"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    60
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    61
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    62
lemma Transset_Pair_D:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    63
    "[| Transset(C); <a,b>: C |] ==> a:C & b: C"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    64
apply (simp add: Pair_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    65
apply (blast dest: Transset_doubleton_D)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    66
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    67
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    68
lemma Transset_includes_domain:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    69
    "[| Transset(C); A*B <= C; b: B |] ==> A <= C"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    70
by (blast dest: Transset_Pair_D)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    71
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    72
lemma Transset_includes_range:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    73
    "[| Transset(C); A*B <= C; a: A |] ==> B <= C"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    74
by (blast dest: Transset_Pair_D)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    75
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
    76
subsubsection{*Closure Properties*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    77
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    78
lemma Transset_0: "Transset(0)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    79
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    80
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    81
lemma Transset_Un: 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    82
    "[| Transset(i);  Transset(j) |] ==> Transset(i Un j)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    83
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    84
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    85
lemma Transset_Int: 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    86
    "[| Transset(i);  Transset(j) |] ==> Transset(i Int j)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    87
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    88
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    89
lemma Transset_succ: "Transset(i) ==> Transset(succ(i))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    90
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    91
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    92
lemma Transset_Pow: "Transset(i) ==> Transset(Pow(i))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    93
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    94
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    95
lemma Transset_Union: "Transset(A) ==> Transset(Union(A))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    96
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    97
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    98
lemma Transset_Union_family: 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
    99
    "[| !!i. i:A ==> Transset(i) |] ==> Transset(Union(A))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   100
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   101
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   102
lemma Transset_Inter_family: 
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   103
    "[| !!i. i:A ==> Transset(i) |] ==> Transset(Inter(A))"
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   104
by (unfold Inter_def Transset_def, blast)
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   105
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   106
lemma Transset_UN:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   107
     "(!!x. x \<in> A ==> Transset(B(x))) ==> Transset (\<Union>x\<in>A. B(x))"
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   108
by (rule Transset_Union_family, auto) 
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   109
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   110
lemma Transset_INT:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   111
     "(!!x. x \<in> A ==> Transset(B(x))) ==> Transset (\<Inter>x\<in>A. B(x))"
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   112
by (rule Transset_Inter_family, auto) 
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   113
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   114
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   115
subsection{*Lemmas for Ordinals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   116
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   117
lemma OrdI:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   118
    "[| Transset(i);  !!x. x:i ==> Transset(x) |]  ==>  Ord(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   119
by (simp add: Ord_def) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   120
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   121
lemma Ord_is_Transset: "Ord(i) ==> Transset(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   122
by (simp add: Ord_def) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   123
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   124
lemma Ord_contains_Transset: 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   125
    "[| Ord(i);  j:i |] ==> Transset(j) "
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   126
by (unfold Ord_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   127
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   128
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   129
lemma Ord_in_Ord: "[| Ord(i);  j:i |] ==> Ord(j)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   130
by (unfold Ord_def Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   131
13243
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   132
(*suitable for rewriting PROVIDED i has been fixed*)
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   133
lemma Ord_in_Ord': "[| j:i; Ord(i) |] ==> Ord(j)"
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   134
by (blast intro: Ord_in_Ord)
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   135
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   136
(* Ord(succ(j)) ==> Ord(j) *)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   137
lemmas Ord_succD = Ord_in_Ord [OF _ succI1]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   138
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   139
lemma Ord_subset_Ord: "[| Ord(i);  Transset(j);  j<=i |] ==> Ord(j)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   140
by (simp add: Ord_def Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   141
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   142
lemma OrdmemD: "[| j:i;  Ord(i) |] ==> j<=i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   143
by (unfold Ord_def Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   144
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   145
lemma Ord_trans: "[| i:j;  j:k;  Ord(k) |] ==> i:k"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   146
by (blast dest: OrdmemD)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   147
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   148
lemma Ord_succ_subsetI: "[| i:j;  Ord(j) |] ==> succ(i) <= j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   149
by (blast dest: OrdmemD)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   150
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   151
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   152
subsection{*The Construction of Ordinals: 0, succ, Union*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   153
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   154
lemma Ord_0 [iff,TC]: "Ord(0)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   155
by (blast intro: OrdI Transset_0)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   156
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   157
lemma Ord_succ [TC]: "Ord(i) ==> Ord(succ(i))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   158
by (blast intro: OrdI Transset_succ Ord_is_Transset Ord_contains_Transset)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   159
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   160
lemmas Ord_1 = Ord_0 [THEN Ord_succ]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   161
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   162
lemma Ord_succ_iff [iff]: "Ord(succ(i)) <-> Ord(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   163
by (blast intro: Ord_succ dest!: Ord_succD)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   164
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   165
lemma Ord_Un [intro,simp,TC]: "[| Ord(i); Ord(j) |] ==> Ord(i Un j)"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   166
apply (unfold Ord_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   167
apply (blast intro!: Transset_Un)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   168
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   169
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   170
lemma Ord_Int [TC]: "[| Ord(i); Ord(j) |] ==> Ord(i Int j)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   171
apply (unfold Ord_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   172
apply (blast intro!: Transset_Int)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   173
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   174
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   175
(*There is no set of all ordinals, for then it would contain itself*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   176
lemma ON_class: "~ (ALL i. i:X <-> Ord(i))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   177
apply (rule notI)
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   178
apply (frule_tac x = X in spec)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   179
apply (safe elim!: mem_irrefl)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   180
apply (erule swap, rule OrdI [OF _ Ord_is_Transset])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   181
apply (simp add: Transset_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   182
apply (blast intro: Ord_in_Ord)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   183
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   184
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   185
subsection{*< is 'less Than' for Ordinals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   186
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   187
lemma ltI: "[| i:j;  Ord(j) |] ==> i<j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   188
by (unfold lt_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   189
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   190
lemma ltE:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   191
    "[| i<j;  [| i:j;  Ord(i);  Ord(j) |] ==> P |] ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   192
apply (unfold lt_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   193
apply (blast intro: Ord_in_Ord)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   194
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   195
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   196
lemma ltD: "i<j ==> i:j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   197
by (erule ltE, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   198
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   199
lemma not_lt0 [simp]: "~ i<0"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   200
by (unfold lt_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   201
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   202
lemma lt_Ord: "j<i ==> Ord(j)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   203
by (erule ltE, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   204
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   205
lemma lt_Ord2: "j<i ==> Ord(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   206
by (erule ltE, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   207
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   208
(* "ja le j ==> Ord(j)" *)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   209
lemmas le_Ord2 = lt_Ord2 [THEN Ord_succD]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   210
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   211
(* i<0 ==> R *)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   212
lemmas lt0E = not_lt0 [THEN notE, elim!]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   213
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   214
lemma lt_trans: "[| i<j;  j<k |] ==> i<k"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   215
by (blast intro!: ltI elim!: ltE intro: Ord_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   216
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   217
lemma lt_not_sym: "i<j ==> ~ (j<i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   218
apply (unfold lt_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   219
apply (blast elim: mem_asym)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   220
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   221
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   222
(* [| i<j;  ~P ==> j<i |] ==> P *)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   223
lemmas lt_asym = lt_not_sym [THEN swap]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   224
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   225
lemma lt_irrefl [elim!]: "i<i ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   226
by (blast intro: lt_asym)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   227
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   228
lemma lt_not_refl: "~ i<i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   229
apply (rule notI)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   230
apply (erule lt_irrefl)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   231
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   232
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   233
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   234
(** le is less than or equals;  recall  i le j  abbrevs  i<succ(j) !! **)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   235
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   236
lemma le_iff: "i le j <-> i<j | (i=j & Ord(j))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   237
by (unfold lt_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   238
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   239
(*Equivalently, i<j ==> i < succ(j)*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   240
lemma leI: "i<j ==> i le j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   241
by (simp (no_asm_simp) add: le_iff)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   242
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   243
lemma le_eqI: "[| i=j;  Ord(j) |] ==> i le j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   244
by (simp (no_asm_simp) add: le_iff)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   245
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   246
lemmas le_refl = refl [THEN le_eqI]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   247
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   248
lemma le_refl_iff [iff]: "i le i <-> Ord(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   249
by (simp (no_asm_simp) add: lt_not_refl le_iff)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   250
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   251
lemma leCI: "(~ (i=j & Ord(j)) ==> i<j) ==> i le j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   252
by (simp add: le_iff, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   253
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   254
lemma leE:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   255
    "[| i le j;  i<j ==> P;  [| i=j;  Ord(j) |] ==> P |] ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   256
by (simp add: le_iff, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   257
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   258
lemma le_anti_sym: "[| i le j;  j le i |] ==> i=j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   259
apply (simp add: le_iff)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   260
apply (blast elim: lt_asym)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   261
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   262
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   263
lemma le0_iff [simp]: "i le 0 <-> i=0"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   264
by (blast elim!: leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   265
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   266
lemmas le0D = le0_iff [THEN iffD1, dest!]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   267
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   268
subsection{*Natural Deduction Rules for Memrel*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   269
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   270
(*The lemmas MemrelI/E give better speed than [iff] here*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   271
lemma Memrel_iff [simp]: "<a,b> : Memrel(A) <-> a:b & a:A & b:A"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   272
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   273
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   274
lemma MemrelI [intro!]: "[| a: b;  a: A;  b: A |] ==> <a,b> : Memrel(A)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   275
by auto
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   276
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   277
lemma MemrelE [elim!]:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   278
    "[| <a,b> : Memrel(A);   
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   279
        [| a: A;  b: A;  a:b |]  ==> P |]  
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   280
     ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   281
by auto
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   282
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   283
lemma Memrel_type: "Memrel(A) <= A*A"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   284
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   285
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   286
lemma Memrel_mono: "A<=B ==> Memrel(A) <= Memrel(B)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   287
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   288
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   289
lemma Memrel_0 [simp]: "Memrel(0) = 0"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   290
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   291
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   292
lemma Memrel_1 [simp]: "Memrel(1) = 0"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   293
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   294
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13243
diff changeset
   295
lemma relation_Memrel: "relation(Memrel(A))"
14864
419b45cdb400 new rules for simplifying quantifiers with Sigma
paulson
parents: 14565
diff changeset
   296
by (simp add: relation_def Memrel_def)
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13243
diff changeset
   297
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   298
(*The membership relation (as a set) is well-founded.
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   299
  Proof idea: show A<=B by applying the foundation axiom to A-B *)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   300
lemma wf_Memrel: "wf(Memrel(A))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   301
apply (unfold wf_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   302
apply (rule foundation [THEN disjE, THEN allI], erule disjI1, blast) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   303
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   304
13396
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   305
text{*The premise @{term "Ord(i)"} does not suffice.*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   306
lemma trans_Memrel: 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   307
    "Ord(i) ==> trans(Memrel(i))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   308
by (unfold Ord_def Transset_def trans_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   309
13396
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   310
text{*However, the following premise is strong enough.*}
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   311
lemma Transset_trans_Memrel: 
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   312
    "\<forall>j\<in>i. Transset(j) ==> trans(Memrel(i))"
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   313
by (unfold Transset_def trans_def, blast)
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   314
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   315
(*If Transset(A) then Memrel(A) internalizes the membership relation below A*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   316
lemma Transset_Memrel_iff: 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   317
    "Transset(A) ==> <a,b> : Memrel(A) <-> a:b & b:A"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   318
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   319
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   320
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   321
subsection{*Transfinite Induction*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   322
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   323
(*Epsilon induction over a transitive set*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   324
lemma Transset_induct: 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   325
    "[| i: k;  Transset(k);                           
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   326
        !!x.[| x: k;  ALL y:x. P(y) |] ==> P(x) |]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   327
     ==>  P(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   328
apply (simp add: Transset_def) 
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13243
diff changeset
   329
apply (erule wf_Memrel [THEN wf_induct2], blast+)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   330
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   331
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   332
(*Induction over an ordinal*)
13534
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   333
lemmas Ord_induct [consumes 2] = Transset_induct [OF _ Ord_is_Transset]
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   334
lemmas Ord_induct_rule = Ord_induct [rule_format, consumes 2]
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   335
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   336
(*Induction over the class of ordinals -- a useful corollary of Ord_induct*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   337
13534
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   338
lemma trans_induct [consumes 1]:
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   339
    "[| Ord(i);  
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   340
        !!x.[| Ord(x);  ALL y:x. P(y) |] ==> P(x) |]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   341
     ==>  P(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   342
apply (rule Ord_succ [THEN succI1 [THEN Ord_induct]], assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   343
apply (blast intro: Ord_succ [THEN Ord_in_Ord]) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   344
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   345
13534
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   346
lemmas trans_induct_rule = trans_induct [rule_format, consumes 1]
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   347
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   348
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   349
(*** Fundamental properties of the epsilon ordering (< on ordinals) ***)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   350
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   351
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   352
subsubsection{*Proving That < is a Linear Ordering on the Ordinals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   353
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   354
lemma Ord_linear [rule_format]:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   355
     "Ord(i) ==> (ALL j. Ord(j) --> i:j | i=j | j:i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   356
apply (erule trans_induct)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   357
apply (rule impI [THEN allI])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   358
apply (erule_tac i=j in trans_induct) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   359
apply (blast dest: Ord_trans) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   360
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   361
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   362
(*The trichotomy law for ordinals!*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   363
lemma Ord_linear_lt:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   364
    "[| Ord(i);  Ord(j);  i<j ==> P;  i=j ==> P;  j<i ==> P |] ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   365
apply (simp add: lt_def) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   366
apply (rule_tac i1=i and j1=j in Ord_linear [THEN disjE], blast+)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   367
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   368
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   369
lemma Ord_linear2:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   370
    "[| Ord(i);  Ord(j);  i<j ==> P;  j le i ==> P |]  ==> P"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   371
apply (rule_tac i = i and j = j in Ord_linear_lt)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   372
apply (blast intro: leI le_eqI sym ) +
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   373
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   374
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   375
lemma Ord_linear_le:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   376
    "[| Ord(i);  Ord(j);  i le j ==> P;  j le i ==> P |]  ==> P"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   377
apply (rule_tac i = i and j = j in Ord_linear_lt)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   378
apply (blast intro: leI le_eqI ) +
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   379
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   380
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   381
lemma le_imp_not_lt: "j le i ==> ~ i<j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   382
by (blast elim!: leE elim: lt_asym)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   383
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   384
lemma not_lt_imp_le: "[| ~ i<j;  Ord(i);  Ord(j) |] ==> j le i"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   385
by (rule_tac i = i and j = j in Ord_linear2, auto)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   386
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   387
subsubsection{*Some Rewrite Rules for <, le*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   388
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   389
lemma Ord_mem_iff_lt: "Ord(j) ==> i:j <-> i<j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   390
by (unfold lt_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   391
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   392
lemma not_lt_iff_le: "[| Ord(i);  Ord(j) |] ==> ~ i<j <-> j le i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   393
by (blast dest: le_imp_not_lt not_lt_imp_le)
2540
ba8311047f18 added symbols syntax;
wenzelm
parents: 2539
diff changeset
   394
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   395
lemma not_le_iff_lt: "[| Ord(i);  Ord(j) |] ==> ~ i le j <-> j<i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   396
by (simp (no_asm_simp) add: not_lt_iff_le [THEN iff_sym])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   397
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   398
(*This is identical to 0<succ(i) *)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   399
lemma Ord_0_le: "Ord(i) ==> 0 le i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   400
by (erule not_lt_iff_le [THEN iffD1], auto)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   401
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   402
lemma Ord_0_lt: "[| Ord(i);  i~=0 |] ==> 0<i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   403
apply (erule not_le_iff_lt [THEN iffD1])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   404
apply (rule Ord_0, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   405
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   406
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   407
lemma Ord_0_lt_iff: "Ord(i) ==> i~=0 <-> 0<i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   408
by (blast intro: Ord_0_lt)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   409
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   410
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   411
subsection{*Results about Less-Than or Equals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   412
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   413
(** For ordinals, j<=i (subset) implies j le i (less-than or equals) **)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   414
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   415
lemma zero_le_succ_iff [iff]: "0 le succ(x) <-> Ord(x)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   416
by (blast intro: Ord_0_le elim: ltE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   417
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   418
lemma subset_imp_le: "[| j<=i;  Ord(i);  Ord(j) |] ==> j le i"
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13243
diff changeset
   419
apply (rule not_lt_iff_le [THEN iffD1], assumption+)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   420
apply (blast elim: ltE mem_irrefl)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   421
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   422
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   423
lemma le_imp_subset: "i le j ==> i<=j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   424
by (blast dest: OrdmemD elim: ltE leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   425
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   426
lemma le_subset_iff: "j le i <-> j<=i & Ord(i) & Ord(j)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   427
by (blast dest: subset_imp_le le_imp_subset elim: ltE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   428
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   429
lemma le_succ_iff: "i le succ(j) <-> i le j | i=succ(j) & Ord(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   430
apply (simp (no_asm) add: le_iff)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   431
apply blast
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   432
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   433
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   434
(*Just a variant of subset_imp_le*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   435
lemma all_lt_imp_le: "[| Ord(i);  Ord(j);  !!x. x<j ==> x<i |] ==> j le i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   436
by (blast intro: not_lt_imp_le dest: lt_irrefl)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   437
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   438
subsubsection{*Transitivity Laws*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   439
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   440
lemma lt_trans1: "[| i le j;  j<k |] ==> i<k"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   441
by (blast elim!: leE intro: lt_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   442
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   443
lemma lt_trans2: "[| i<j;  j le k |] ==> i<k"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   444
by (blast elim!: leE intro: lt_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   445
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   446
lemma le_trans: "[| i le j;  j le k |] ==> i le k"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   447
by (blast intro: lt_trans1)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   448
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   449
lemma succ_leI: "i<j ==> succ(i) le j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   450
apply (rule not_lt_iff_le [THEN iffD1]) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   451
apply (blast elim: ltE leE lt_asym)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   452
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   453
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   454
(*Identical to  succ(i) < succ(j) ==> i<j  *)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   455
lemma succ_leE: "succ(i) le j ==> i<j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   456
apply (rule not_le_iff_lt [THEN iffD1])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   457
apply (blast elim: ltE leE lt_asym)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   458
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   459
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   460
lemma succ_le_iff [iff]: "succ(i) le j <-> i<j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   461
by (blast intro: succ_leI succ_leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   462
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   463
lemma succ_le_imp_le: "succ(i) le succ(j) ==> i le j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   464
by (blast dest!: succ_leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   465
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   466
lemma lt_subset_trans: "[| i <= j;  j<k;  Ord(i) |] ==> i<k"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   467
apply (rule subset_imp_le [THEN lt_trans1]) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   468
apply (blast intro: elim: ltE) +
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   469
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   470
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   471
lemma lt_imp_0_lt: "j<i ==> 0<i"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   472
by (blast intro: lt_trans1 Ord_0_le [OF lt_Ord]) 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   473
13243
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   474
lemma succ_lt_iff: "succ(i) < j <-> i<j & succ(i) \<noteq> j"
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   475
apply auto 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   476
apply (blast intro: lt_trans le_refl dest: lt_Ord) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   477
apply (frule lt_Ord) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   478
apply (rule not_le_iff_lt [THEN iffD1]) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   479
  apply (blast intro: lt_Ord2)
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   480
 apply blast  
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   481
apply (simp add: lt_Ord lt_Ord2 le_iff) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   482
apply (blast dest: lt_asym) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   483
done
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   484
13243
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   485
lemma Ord_succ_mem_iff: "Ord(j) ==> succ(i) \<in> succ(j) <-> i\<in>j"
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   486
apply (insert succ_le_iff [of i j]) 
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   487
apply (simp add: lt_def) 
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   488
done
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   489
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   490
subsubsection{*Union and Intersection*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   491
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   492
lemma Un_upper1_le: "[| Ord(i); Ord(j) |] ==> i le i Un j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   493
by (rule Un_upper1 [THEN subset_imp_le], auto)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   494
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   495
lemma Un_upper2_le: "[| Ord(i); Ord(j) |] ==> j le i Un j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   496
by (rule Un_upper2 [THEN subset_imp_le], auto)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   497
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   498
(*Replacing k by succ(k') yields the similar rule for le!*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   499
lemma Un_least_lt: "[| i<k;  j<k |] ==> i Un j < k"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   500
apply (rule_tac i = i and j = j in Ord_linear_le)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   501
apply (auto simp add: Un_commute le_subset_iff subset_Un_iff lt_Ord) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   502
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   503
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   504
lemma Un_least_lt_iff: "[| Ord(i); Ord(j) |] ==> i Un j < k  <->  i<k & j<k"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   505
apply (safe intro!: Un_least_lt)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   506
apply (rule_tac [2] Un_upper2_le [THEN lt_trans1])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   507
apply (rule Un_upper1_le [THEN lt_trans1], auto) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   508
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   509
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   510
lemma Un_least_mem_iff:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   511
    "[| Ord(i); Ord(j); Ord(k) |] ==> i Un j : k  <->  i:k & j:k"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   512
apply (insert Un_least_lt_iff [of i j k]) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   513
apply (simp add: lt_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   514
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   515
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   516
(*Replacing k by succ(k') yields the similar rule for le!*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   517
lemma Int_greatest_lt: "[| i<k;  j<k |] ==> i Int j < k"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   518
apply (rule_tac i = i and j = j in Ord_linear_le)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   519
apply (auto simp add: Int_commute le_subset_iff subset_Int_iff lt_Ord) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   520
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   521
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   522
lemma Ord_Un_if:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   523
     "[| Ord(i); Ord(j) |] ==> i \<union> j = (if j<i then i else j)"
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   524
by (simp add: not_lt_iff_le le_imp_subset leI
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   525
              subset_Un_iff [symmetric]  subset_Un_iff2 [symmetric]) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   526
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   527
lemma succ_Un_distrib:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   528
     "[| Ord(i); Ord(j) |] ==> succ(i \<union> j) = succ(i) \<union> succ(j)"
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   529
by (simp add: Ord_Un_if lt_Ord le_Ord2) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   530
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   531
lemma lt_Un_iff:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   532
     "[| Ord(i); Ord(j) |] ==> k < i \<union> j <-> k < i | k < j";
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   533
apply (simp add: Ord_Un_if not_lt_iff_le) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   534
apply (blast intro: leI lt_trans2)+ 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   535
done
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   536
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   537
lemma le_Un_iff:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   538
     "[| Ord(i); Ord(j) |] ==> k \<le> i \<union> j <-> k \<le> i | k \<le> j";
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   539
by (simp add: succ_Un_distrib lt_Un_iff [symmetric]) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   540
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   541
lemma Un_upper1_lt: "[|k < i; Ord(j)|] ==> k < i Un j"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   542
by (simp add: lt_Un_iff lt_Ord2) 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   543
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   544
lemma Un_upper2_lt: "[|k < j; Ord(i)|] ==> k < i Un j"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   545
by (simp add: lt_Un_iff lt_Ord2) 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   546
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   547
(*See also Transset_iff_Union_succ*)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   548
lemma Ord_Union_succ_eq: "Ord(i) ==> \<Union>(succ(i)) = i"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   549
by (blast intro: Ord_trans)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   550
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   551
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   552
subsection{*Results about Limits*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   553
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   554
lemma Ord_Union [intro,simp,TC]: "[| !!i. i:A ==> Ord(i) |] ==> Ord(Union(A))"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   555
apply (rule Ord_is_Transset [THEN Transset_Union_family, THEN OrdI])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   556
apply (blast intro: Ord_contains_Transset)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   557
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   558
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   559
lemma Ord_UN [intro,simp,TC]:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   560
     "[| !!x. x:A ==> Ord(B(x)) |] ==> Ord(\<Union>x\<in>A. B(x))"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   561
by (rule Ord_Union, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   562
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   563
lemma Ord_Inter [intro,simp,TC]:
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   564
    "[| !!i. i:A ==> Ord(i) |] ==> Ord(Inter(A))" 
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   565
apply (rule Transset_Inter_family [THEN OrdI])
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   566
apply (blast intro: Ord_is_Transset) 
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   567
apply (simp add: Inter_def) 
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   568
apply (blast intro: Ord_contains_Transset) 
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   569
done
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   570
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   571
lemma Ord_INT [intro,simp,TC]:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   572
    "[| !!x. x:A ==> Ord(B(x)) |] ==> Ord(\<Inter>x\<in>A. B(x))"
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   573
by (rule Ord_Inter, blast) 
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   574
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   575
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   576
(* No < version; consider (\<Union>i\<in>nat.i)=nat *)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   577
lemma UN_least_le:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   578
    "[| Ord(i);  !!x. x:A ==> b(x) le i |] ==> (\<Union>x\<in>A. b(x)) le i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   579
apply (rule le_imp_subset [THEN UN_least, THEN subset_imp_le])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   580
apply (blast intro: Ord_UN elim: ltE)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   581
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   582
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   583
lemma UN_succ_least_lt:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   584
    "[| j<i;  !!x. x:A ==> b(x)<j |] ==> (\<Union>x\<in>A. succ(b(x))) < i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   585
apply (rule ltE, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   586
apply (rule UN_least_le [THEN lt_trans2])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   587
apply (blast intro: succ_leI)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   588
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   589
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   590
lemma UN_upper_lt:
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   591
     "[| a\<in>A;  i < b(a);  Ord(\<Union>x\<in>A. b(x)) |] ==> i < (\<Union>x\<in>A. b(x))"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   592
by (unfold lt_def, blast) 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   593
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   594
lemma UN_upper_le:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   595
     "[| a: A;  i le b(a);  Ord(\<Union>x\<in>A. b(x)) |] ==> i le (\<Union>x\<in>A. b(x))"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   596
apply (frule ltD)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   597
apply (rule le_imp_subset [THEN subset_trans, THEN subset_imp_le])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   598
apply (blast intro: lt_Ord UN_upper)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   599
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   600
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   601
lemma lt_Union_iff: "\<forall>i\<in>A. Ord(i) ==> (j < \<Union>(A)) <-> (\<exists>i\<in>A. j<i)"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   602
by (auto simp: lt_def Ord_Union)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   603
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   604
lemma Union_upper_le:
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   605
     "[| j: J;  i\<le>j;  Ord(\<Union>(J)) |] ==> i \<le> \<Union>J"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   606
apply (subst Union_eq_UN)  
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   607
apply (rule UN_upper_le, auto)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   608
done
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   609
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   610
lemma le_implies_UN_le_UN:
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   611
    "[| !!x. x:A ==> c(x) le d(x) |] ==> (\<Union>x\<in>A. c(x)) le (\<Union>x\<in>A. d(x))"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   612
apply (rule UN_least_le)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   613
apply (rule_tac [2] UN_upper_le)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   614
apply (blast intro: Ord_UN le_Ord2)+ 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   615
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   616
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   617
lemma Ord_equality: "Ord(i) ==> (\<Union>y\<in>i. succ(y)) = i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   618
by (blast intro: Ord_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   619
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   620
(*Holds for all transitive sets, not just ordinals*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   621
lemma Ord_Union_subset: "Ord(i) ==> Union(i) <= i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   622
by (blast intro: Ord_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   623
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   624
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   625
subsection{*Limit Ordinals -- General Properties*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   626
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   627
lemma Limit_Union_eq: "Limit(i) ==> Union(i) = i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   628
apply (unfold Limit_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   629
apply (fast intro!: ltI elim!: ltE elim: Ord_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   630
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   631
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   632
lemma Limit_is_Ord: "Limit(i) ==> Ord(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   633
apply (unfold Limit_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   634
apply (erule conjunct1)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   635
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   636
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   637
lemma Limit_has_0: "Limit(i) ==> 0 < i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   638
apply (unfold Limit_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   639
apply (erule conjunct2 [THEN conjunct1])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   640
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   641
13544
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   642
lemma Limit_nonzero: "Limit(i) ==> i ~= 0"
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   643
by (drule Limit_has_0, blast)
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   644
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   645
lemma Limit_has_succ: "[| Limit(i);  j<i |] ==> succ(j) < i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   646
by (unfold Limit_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   647
13544
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   648
lemma Limit_succ_lt_iff [simp]: "Limit(i) ==> succ(j) < i <-> (j<i)"
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   649
apply (safe intro!: Limit_has_succ)
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   650
apply (frule lt_Ord)
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   651
apply (blast intro: lt_trans)   
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   652
done
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   653
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   654
lemma zero_not_Limit [iff]: "~ Limit(0)"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   655
by (simp add: Limit_def)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   656
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   657
lemma Limit_has_1: "Limit(i) ==> 1 < i"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   658
by (blast intro: Limit_has_0 Limit_has_succ)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   659
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   660
lemma increasing_LimitI: "[| 0<l; \<forall>x\<in>l. \<exists>y\<in>l. x<y |] ==> Limit(l)"
13544
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   661
apply (unfold Limit_def, simp add: lt_Ord2, clarify)
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   662
apply (drule_tac i=y in ltD) 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   663
apply (blast intro: lt_trans1 [OF _ ltI] lt_Ord2)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   664
done
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   665
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   666
lemma non_succ_LimitI: 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   667
    "[| 0<i;  ALL y. succ(y) ~= i |] ==> Limit(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   668
apply (unfold Limit_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   669
apply (safe del: subsetI)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   670
apply (rule_tac [2] not_le_iff_lt [THEN iffD1])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   671
apply (simp_all add: lt_Ord lt_Ord2) 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   672
apply (blast elim: leE lt_asym)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   673
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   674
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   675
lemma succ_LimitE [elim!]: "Limit(succ(i)) ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   676
apply (rule lt_irrefl)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   677
apply (rule Limit_has_succ, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   678
apply (erule Limit_is_Ord [THEN Ord_succD, THEN le_refl])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   679
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   680
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   681
lemma not_succ_Limit [simp]: "~ Limit(succ(i))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   682
by blast
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   683
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   684
lemma Limit_le_succD: "[| Limit(i);  i le succ(j) |] ==> i le j"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   685
by (blast elim!: leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   686
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   687
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   688
subsubsection{*Traditional 3-Way Case Analysis on Ordinals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   689
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   690
lemma Ord_cases_disj: "Ord(i) ==> i=0 | (EX j. Ord(j) & i=succ(j)) | Limit(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   691
by (blast intro!: non_succ_LimitI Ord_0_lt)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   692
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   693
lemma Ord_cases:
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   694
    "[| Ord(i);                  
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   695
        i=0                          ==> P;      
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   696
        !!j. [| Ord(j); i=succ(j) |] ==> P;      
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   697
        Limit(i)                     ==> P       
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   698
     |] ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   699
by (drule Ord_cases_disj, blast)  
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   700
13534
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   701
lemma trans_induct3 [case_names 0 succ limit, consumes 1]:
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   702
     "[| Ord(i);                 
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   703
         P(0);                   
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   704
         !!x. [| Ord(x);  P(x) |] ==> P(succ(x));        
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   705
         !!x. [| Limit(x);  ALL y:x. P(y) |] ==> P(x)    
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   706
      |] ==> P(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   707
apply (erule trans_induct)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   708
apply (erule Ord_cases, blast+)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   709
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   710
13534
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   711
lemmas trans_induct3_rule = trans_induct3 [rule_format, case_names 0 succ limit, consumes 1]
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   712
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   713
text{*A set of ordinals is either empty, contains its own union, or its
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   714
union is a limit ordinal.*}
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   715
lemma Ord_set_cases:
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   716
   "\<forall>i\<in>I. Ord(i) ==> I=0 \<or> \<Union>(I) \<in> I \<or> (\<Union>(I) \<notin> I \<and> Limit(\<Union>(I)))"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   717
apply (clarify elim!: not_emptyE) 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   718
apply (cases "\<Union>(I)" rule: Ord_cases) 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   719
   apply (blast intro: Ord_Union)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   720
  apply (blast intro: subst_elem)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   721
 apply auto 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   722
apply (clarify elim!: equalityE succ_subsetE)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   723
apply (simp add: Union_subset_iff)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   724
apply (subgoal_tac "B = succ(j)", blast)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   725
apply (rule le_anti_sym) 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   726
 apply (simp add: le_subset_iff) 
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   727
apply (simp add: ltI)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   728
done
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   729
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   730
text{*If the union of a set of ordinals is a successor, then it is
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   731
an element of that set.*}
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   732
lemma Ord_Union_eq_succD: "[|\<forall>x\<in>X. Ord(x);  \<Union>X = succ(j)|] ==> succ(j) \<in> X"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   733
by (drule Ord_set_cases, auto)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   734
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   735
lemma Limit_Union [rule_format]: "[| I \<noteq> 0;  \<forall>i\<in>I. Limit(i) |] ==> Limit(\<Union>I)"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   736
apply (simp add: Limit_def lt_def)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   737
apply (blast intro!: equalityI)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   738
done
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   739
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   740
end