src/ZF/Ordinal.thy
author paulson
Sat, 17 Mar 2012 12:36:11 +0000
changeset 46993 7371429c527d
parent 46954 d8b3412cdb99
child 58871 c399ae4b836f
permissions -rw-r--r--
tidying and structured proofs
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
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
    12
    "Memrel(A)   == {z\<in>A*A . \<exists>x y. z=<x,y> & x\<in>y }"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    16
    "Transset(i) == \<forall>x\<in>i. x<=i"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    20
    "Ord(i)      == Transset(i) & (\<forall>x\<in>i. Transset(x))"
13155
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
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
    24
    "i<j         == i\<in>j & Ord(j)"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    28
    "Limit(i)    == Ord(i) & 0<i & (\<forall>y. y<i \<longrightarrow> 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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    48
lemma Transset_iff_Union_succ: "Transset(A) <-> \<Union>(succ(A)) = A"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    53
lemma Transset_iff_Union_subset: "Transset(A) <-> \<Union>(A) \<subseteq> A"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    58
lemma Transset_doubleton_D:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
    59
    "[| Transset(C); {a,b}: C |] ==> a\<in>C & b\<in>C"
13155
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:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
    63
    "[| Transset(C); <a,b>\<in>C |] ==> a\<in>C & b\<in>C"
13155
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:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
    69
    "[| Transset(C); A*B \<subseteq> C; b \<in> B |] ==> A \<subseteq> C"
13155
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:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
    73
    "[| Transset(C); A*B \<subseteq> C; a \<in> A |] ==> B \<subseteq> C"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    81
lemma Transset_Un:
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    82
    "[| Transset(i);  Transset(j) |] ==> Transset(i \<union> j)"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    85
lemma Transset_Int:
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    86
    "[| Transset(i);  Transset(j) |] ==> Transset(i \<inter> j)"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    95
lemma Transset_Union: "Transset(A) ==> Transset(\<Union>(A))"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
    98
lemma Transset_Union_family:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
    99
    "[| !!i. i\<in>A ==> Transset(i) |] ==> Transset(\<Union>(A))"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   102
lemma Transset_Inter_family:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   103
    "[| !!i. i\<in>A ==> Transset(i) |] ==> Transset(\<Inter>(A))"
13203
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))"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   108
by (rule Transset_Union_family, auto)
13203
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))"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   112
by (rule Transset_Inter_family, auto)
13203
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:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   118
    "[| Transset(i);  !!x. x\<in>i ==> Transset(x) |]  ==>  Ord(i)"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   119
by (simp add: Ord_def)
13155
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)"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   122
by (simp add: Ord_def)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   123
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   124
lemma Ord_contains_Transset:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   125
    "[| Ord(i);  j\<in>i |] ==> Transset(j) "
13155
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
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   129
lemma Ord_in_Ord: "[| Ord(i);  j\<in>i |] ==> Ord(j)"
13155
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*)
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   133
lemma Ord_in_Ord': "[| j\<in>i; Ord(i) |] ==> Ord(j)"
13243
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
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   142
lemma OrdmemD: "[| j\<in>i;  Ord(i) |] ==> j<=i"
13155
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
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   145
lemma Ord_trans: "[| i\<in>j;  j\<in>k;  Ord(k) |] ==> i\<in>k"
13155
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
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   148
lemma Ord_succ_subsetI: "[| i\<in>j;  Ord(j) |] ==> succ(i) \<subseteq> j"
13155
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   165
lemma Ord_Un [intro,simp,TC]: "[| Ord(i); Ord(j) |] ==> Ord(i \<union> 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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   170
lemma Ord_Int [TC]: "[| Ord(i); Ord(j) |] ==> Ord(i \<inter> j)"
13155
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
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   175
text{*There is no set of all ordinals, for then it would contain itself*}
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   176
lemma ON_class: "~ (\<forall>i. i\<in>X <-> Ord(i))"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   177
proof (rule notI)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   178
  assume X: "\<forall>i. i \<in> X \<longleftrightarrow> Ord(i)"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   179
  have "\<forall>x y. x\<in>X \<longrightarrow> y\<in>x \<longrightarrow> y\<in>X"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   180
    by (simp add: X, blast intro: Ord_in_Ord)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   181
  hence "Transset(X)"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   182
     by (auto simp add: Transset_def)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   183
  moreover have "\<And>x. x \<in> X \<Longrightarrow> Transset(x)"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   184
     by (simp add: X Ord_def)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   185
  ultimately have "Ord(X)" by (rule OrdI)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   186
  hence "X \<in> X" by (simp add: X)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   187
  thus "False" by (rule mem_irrefl)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   188
qed
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   189
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   190
subsection{*< is 'less Than' for Ordinals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   191
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   192
lemma ltI: "[| i\<in>j;  Ord(j) |] ==> i<j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   193
by (unfold lt_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   194
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   195
lemma ltE:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   196
    "[| i<j;  [| i\<in>j;  Ord(i);  Ord(j) |] ==> P |] ==> P"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   197
apply (unfold lt_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   198
apply (blast intro: Ord_in_Ord)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   199
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   200
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   201
lemma ltD: "i<j ==> i\<in>j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   202
by (erule ltE, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   203
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   204
lemma not_lt0 [simp]: "~ i<0"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   205
by (unfold lt_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   206
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   207
lemma lt_Ord: "j<i ==> Ord(j)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   208
by (erule ltE, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   209
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   210
lemma lt_Ord2: "j<i ==> Ord(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   211
by (erule ltE, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   212
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   213
(* @{term"ja \<le> j ==> Ord(j)"} *)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   214
lemmas le_Ord2 = lt_Ord2 [THEN Ord_succD]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   215
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   216
(* i<0 ==> R *)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   217
lemmas lt0E = not_lt0 [THEN notE, elim!]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   218
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   219
lemma lt_trans [trans]: "[| i<j;  j<k |] ==> i<k"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   220
by (blast intro!: ltI elim!: ltE intro: Ord_trans)
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
lemma lt_not_sym: "i<j ==> ~ (j<i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   223
apply (unfold lt_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   224
apply (blast elim: mem_asym)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   225
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   226
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   227
(* [| i<j;  ~P ==> j<i |] ==> P *)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   228
lemmas lt_asym = lt_not_sym [THEN swap]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   229
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   230
lemma lt_irrefl [elim!]: "i<i ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   231
by (blast intro: lt_asym)
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
lemma lt_not_refl: "~ i<i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   234
apply (rule notI)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   235
apply (erule lt_irrefl)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   236
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   237
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   238
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   239
text{* Recall that  @{term"i \<le> j"}  abbreviates  @{term"i<succ(j)"} !! *}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   240
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   241
lemma le_iff: "i \<le> j <-> i<j | (i=j & Ord(j))"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   242
by (unfold lt_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   243
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   244
(*Equivalently, i<j ==> i < succ(j)*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   245
lemma leI: "i<j ==> i \<le> j"
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   246
by (simp add: le_iff)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   247
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   248
lemma le_eqI: "[| i=j;  Ord(j) |] ==> i \<le> j"
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   249
by (simp add: le_iff)
13155
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
lemmas le_refl = refl [THEN le_eqI]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   252
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   253
lemma le_refl_iff [iff]: "i \<le> i <-> Ord(i)"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   254
by (simp (no_asm_simp) add: lt_not_refl le_iff)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   255
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   256
lemma leCI: "(~ (i=j & Ord(j)) ==> i<j) ==> i \<le> j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   257
by (simp add: le_iff, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   258
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   259
lemma leE:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   260
    "[| i \<le> j;  i<j ==> P;  [| i=j;  Ord(j) |] ==> P |] ==> P"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   261
by (simp add: le_iff, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   262
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   263
lemma le_anti_sym: "[| i \<le> j;  j \<le> i |] ==> i=j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   264
apply (simp add: le_iff)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   265
apply (blast elim: lt_asym)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   266
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   267
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   268
lemma le0_iff [simp]: "i \<le> 0 <-> i=0"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   269
by (blast elim!: leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   270
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   271
lemmas le0D = le0_iff [THEN iffD1, dest!]
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   272
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   273
subsection{*Natural Deduction Rules for Memrel*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   274
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   275
(*The lemmas MemrelI/E give better speed than [iff] here*)
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   276
lemma Memrel_iff [simp]: "<a,b> \<in> Memrel(A) <-> a\<in>b & a\<in>A & b\<in>A"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   277
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   278
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   279
lemma MemrelI [intro!]: "[| a \<in> b;  a \<in> A;  b \<in> A |] ==> <a,b> \<in> Memrel(A)"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   280
by auto
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   281
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   282
lemma MemrelE [elim!]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   283
    "[| <a,b> \<in> Memrel(A);
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   284
        [| a \<in> A;  b \<in> A;  a\<in>b |]  ==> P |]
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   285
     ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   286
by auto
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   287
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   288
lemma Memrel_type: "Memrel(A) \<subseteq> A*A"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   289
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   290
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   291
lemma Memrel_mono: "A<=B ==> Memrel(A) \<subseteq> Memrel(B)"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   292
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   293
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   294
lemma Memrel_0 [simp]: "Memrel(0) = 0"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   295
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   296
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   297
lemma Memrel_1 [simp]: "Memrel(1) = 0"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   298
by (unfold Memrel_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   299
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13243
diff changeset
   300
lemma relation_Memrel: "relation(Memrel(A))"
14864
419b45cdb400 new rules for simplifying quantifiers with Sigma
paulson
parents: 14565
diff changeset
   301
by (simp add: relation_def Memrel_def)
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13243
diff changeset
   302
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   303
(*The membership relation (as a set) is well-founded.
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   304
  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
   305
lemma wf_Memrel: "wf(Memrel(A))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   306
apply (unfold wf_def)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   307
apply (rule foundation [THEN disjE, THEN allI], erule disjI1, blast)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   308
done
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{*The premise @{term "Ord(i)"} does not suffice.*}
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   311
lemma trans_Memrel:
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   312
    "Ord(i) ==> trans(Memrel(i))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   313
by (unfold Ord_def Transset_def trans_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   314
13396
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   315
text{*However, the following premise is strong enough.*}
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   316
lemma Transset_trans_Memrel:
13396
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   317
    "\<forall>j\<in>i. Transset(j) ==> trans(Memrel(i))"
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   318
by (unfold Transset_def trans_def, blast)
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
   319
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   320
(*If Transset(A) then Memrel(A) internalizes the membership relation below A*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   321
lemma Transset_Memrel_iff:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   322
    "Transset(A) ==> <a,b> \<in> Memrel(A) <-> a\<in>b & b\<in>A"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   323
by (unfold Transset_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   324
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   325
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   326
subsection{*Transfinite Induction*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   327
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   328
(*Epsilon induction over a transitive set*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   329
lemma Transset_induct:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   330
    "[| i \<in> k;  Transset(k);
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   331
        !!x.[| x \<in> k;  \<forall>y\<in>x. P(y) |] ==> P(x) |]
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   332
     ==>  P(i)"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   333
apply (simp add: Transset_def)
13269
3ba9be497c33 Tidying and introduction of various new theorems
paulson
parents: 13243
diff changeset
   334
apply (erule wf_Memrel [THEN wf_induct2], blast+)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   335
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   336
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   337
(*Induction over an ordinal*)
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   338
lemmas Ord_induct [consumes 2] = Transset_induct [rule_format, OF _ Ord_is_Transset]
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   339
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   340
(*Induction over the class of ordinals -- a useful corollary of Ord_induct*)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   341
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   342
lemma trans_induct [rule_format, consumes 1, case_names step]:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   343
    "[| Ord(i);
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   344
        !!x.[| Ord(x);  \<forall>y\<in>x. P(y) |] ==> P(x) |]
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   345
     ==>  P(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   346
apply (rule Ord_succ [THEN succI1 [THEN Ord_induct]], assumption)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   347
apply (blast intro: Ord_succ [THEN Ord_in_Ord])
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   348
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   349
13534
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   350
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   351
section{*Fundamental properties of the epsilon ordering (< on ordinals)*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   352
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   353
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   354
subsubsection{*Proving That < is a Linear Ordering on the Ordinals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   355
46993
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   356
lemma Ord_linear:
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   357
     "Ord(i) \<Longrightarrow> Ord(j) \<Longrightarrow> i\<in>j | i=j | j\<in>i"
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   358
proof (induct i arbitrary: j rule: trans_induct)
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   359
  case (step i)
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   360
  note step_i = step
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   361
  show ?case using `Ord(j)`
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   362
    proof (induct j rule: trans_induct)
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   363
      case (step j)
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   364
      thus ?case using step_i
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   365
        by (blast dest: Ord_trans)
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   366
    qed
7371429c527d tidying and structured proofs
paulson
parents: 46954
diff changeset
   367
qed
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   368
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   369
text{*The trichotomy law for ordinals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   370
lemma Ord_linear_lt:
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   371
 assumes o: "Ord(i)" "Ord(j)"
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   372
 obtains (lt) "i<j" | (eq) "i=j" | (gt) "j<i"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   373
apply (simp add: lt_def)
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   374
apply (rule_tac i1=i and j1=j in Ord_linear [THEN disjE])
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   375
apply (blast intro: o)+
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   376
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   377
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   378
lemma Ord_linear2:
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   379
 assumes o: "Ord(i)" "Ord(j)"
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   380
 obtains (lt) "i<j" | (ge) "j \<le> i"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   381
apply (rule_tac i = i and j = j in Ord_linear_lt)
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   382
apply (blast intro: leI le_eqI sym o) +
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   383
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   384
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   385
lemma Ord_linear_le:
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   386
 assumes o: "Ord(i)" "Ord(j)"
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   387
 obtains (le) "i \<le> j" | (ge) "j \<le> i"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   388
apply (rule_tac i = i and j = j in Ord_linear_lt)
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   389
apply (blast intro: leI le_eqI o) +
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   390
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   391
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   392
lemma le_imp_not_lt: "j \<le> i ==> ~ i<j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   393
by (blast elim!: leE elim: lt_asym)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   394
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   395
lemma not_lt_imp_le: "[| ~ i<j;  Ord(i);  Ord(j) |] ==> j \<le> i"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   396
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
   397
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   398
subsubsection{*Some Rewrite Rules for <, le*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   399
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   400
lemma Ord_mem_iff_lt: "Ord(j) ==> i\<in>j <-> i<j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   401
by (unfold lt_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   402
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   403
lemma not_lt_iff_le: "[| Ord(i);  Ord(j) |] ==> ~ i<j <-> j \<le> i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   404
by (blast dest: le_imp_not_lt not_lt_imp_le)
2540
ba8311047f18 added symbols syntax;
wenzelm
parents: 2539
diff changeset
   405
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   406
lemma not_le_iff_lt: "[| Ord(i);  Ord(j) |] ==> ~ i \<le> j <-> j<i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   407
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
   408
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   409
(*This is identical to 0<succ(i) *)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   410
lemma Ord_0_le: "Ord(i) ==> 0 \<le> i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   411
by (erule not_lt_iff_le [THEN iffD1], auto)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   412
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   413
lemma Ord_0_lt: "[| Ord(i);  i\<noteq>0 |] ==> 0<i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   414
apply (erule not_le_iff_lt [THEN iffD1])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   415
apply (rule Ord_0, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   416
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   417
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   418
lemma Ord_0_lt_iff: "Ord(i) ==> i\<noteq>0 <-> 0<i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   419
by (blast intro: Ord_0_lt)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   420
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   421
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   422
subsection{*Results about Less-Than or Equals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   423
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   424
(** For ordinals, @{term"j\<subseteq>i"} implies @{term"j \<le> i"} (less-than or equals) **)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   425
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   426
lemma zero_le_succ_iff [iff]: "0 \<le> succ(x) <-> Ord(x)"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   427
by (blast intro: Ord_0_le elim: ltE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   428
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   429
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
   430
apply (rule not_lt_iff_le [THEN iffD1], assumption+)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   431
apply (blast elim: ltE mem_irrefl)
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   434
lemma le_imp_subset: "i \<le> j ==> i<=j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   435
by (blast dest: OrdmemD elim: ltE leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   436
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   437
lemma le_subset_iff: "j \<le> i <-> j<=i & Ord(i) & Ord(j)"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   438
by (blast dest: subset_imp_le le_imp_subset elim: ltE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   439
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   440
lemma le_succ_iff: "i \<le> succ(j) <-> i \<le> j | i=succ(j) & Ord(i)"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   441
apply (simp (no_asm) add: le_iff)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   442
apply blast
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   443
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   444
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   445
(*Just a variant of subset_imp_le*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   446
lemma all_lt_imp_le: "[| Ord(i);  Ord(j);  !!x. x<j ==> x<i |] ==> j \<le> i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   447
by (blast intro: not_lt_imp_le dest: lt_irrefl)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   448
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   449
subsubsection{*Transitivity Laws*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   450
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   451
lemma lt_trans1: "[| i \<le> j;  j<k |] ==> i<k"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   452
by (blast elim!: leE intro: lt_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   453
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   454
lemma lt_trans2: "[| i<j;  j \<le> k |] ==> i<k"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   455
by (blast elim!: leE intro: lt_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   456
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   457
lemma le_trans: "[| i \<le> j;  j \<le> k |] ==> i \<le> k"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   458
by (blast intro: lt_trans1)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   459
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   460
lemma succ_leI: "i<j ==> succ(i) \<le> j"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   461
apply (rule not_lt_iff_le [THEN iffD1])
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   462
apply (blast elim: ltE leE lt_asym)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   463
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   464
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   465
(*Identical to  succ(i) < succ(j) ==> i<j  *)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   466
lemma succ_leE: "succ(i) \<le> j ==> i<j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   467
apply (rule not_le_iff_lt [THEN iffD1])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   468
apply (blast elim: ltE leE lt_asym)+
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
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   471
lemma succ_le_iff [iff]: "succ(i) \<le> j <-> i<j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   472
by (blast intro: succ_leI succ_leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   473
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   474
lemma succ_le_imp_le: "succ(i) \<le> succ(j) ==> i \<le> j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   475
by (blast dest!: succ_leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   476
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   477
lemma lt_subset_trans: "[| i \<subseteq> j;  j<k;  Ord(i) |] ==> i<k"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   478
apply (rule subset_imp_le [THEN lt_trans1])
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   479
apply (blast intro: elim: ltE) +
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   480
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   481
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   482
lemma lt_imp_0_lt: "j<i ==> 0<i"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   483
by (blast intro: lt_trans1 Ord_0_le [OF lt_Ord])
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   484
13243
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   485
lemma succ_lt_iff: "succ(i) < j <-> i<j & succ(i) \<noteq> j"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   486
apply auto
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   487
apply (blast intro: lt_trans le_refl dest: lt_Ord)
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   488
apply (frule lt_Ord)
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   489
apply (rule not_le_iff_lt [THEN iffD1])
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   490
  apply (blast intro: lt_Ord2)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   491
 apply blast
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   492
apply (simp add: lt_Ord lt_Ord2 le_iff)
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   493
apply (blast dest: lt_asym)
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   494
done
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   495
13243
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   496
lemma Ord_succ_mem_iff: "Ord(j) ==> succ(i) \<in> succ(j) <-> i\<in>j"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   497
apply (insert succ_le_iff [of i j])
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   498
apply (simp add: lt_def)
13243
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   499
done
ba53d07d32d5 new lemmas
paulson
parents: 13203
diff changeset
   500
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   501
subsubsection{*Union and Intersection*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   502
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   503
lemma Un_upper1_le: "[| Ord(i); Ord(j) |] ==> i \<le> i \<union> j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   504
by (rule Un_upper1 [THEN subset_imp_le], auto)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   505
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   506
lemma Un_upper2_le: "[| Ord(i); Ord(j) |] ==> j \<le> i \<union> j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   507
by (rule Un_upper2 [THEN subset_imp_le], auto)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   508
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   509
(*Replacing k by succ(k') yields the similar rule for le!*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   510
lemma Un_least_lt: "[| i<k;  j<k |] ==> i \<union> j < k"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   511
apply (rule_tac i = i and j = j in Ord_linear_le)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   512
apply (auto simp add: Un_commute le_subset_iff subset_Un_iff lt_Ord)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   513
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   514
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   515
lemma Un_least_lt_iff: "[| Ord(i); Ord(j) |] ==> i \<union> j < k  <->  i<k & j<k"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   516
apply (safe intro!: Un_least_lt)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   517
apply (rule_tac [2] Un_upper2_le [THEN lt_trans1])
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   518
apply (rule Un_upper1_le [THEN lt_trans1], auto)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   519
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   520
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   521
lemma Un_least_mem_iff:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   522
    "[| Ord(i); Ord(j); Ord(k) |] ==> i \<union> j \<in> k  <->  i\<in>k & j\<in>k"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   523
apply (insert Un_least_lt_iff [of i j k])
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   524
apply (simp add: lt_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   525
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   526
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   527
(*Replacing k by succ(k') yields the similar rule for le!*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   528
lemma Int_greatest_lt: "[| i<k;  j<k |] ==> i \<inter> j < k"
13784
b9f6154427a4 tidying (by script)
paulson
parents: 13615
diff changeset
   529
apply (rule_tac i = i and j = j in Ord_linear_le)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   530
apply (auto simp add: Int_commute le_subset_iff subset_Int_iff lt_Ord)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   531
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   532
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   533
lemma Ord_Un_if:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   534
     "[| 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
   535
by (simp add: not_lt_iff_le le_imp_subset leI
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   536
              subset_Un_iff [symmetric]  subset_Un_iff2 [symmetric])
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   537
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   538
lemma succ_Un_distrib:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   539
     "[| Ord(i); Ord(j) |] ==> succ(i \<union> j) = succ(i) \<union> succ(j)"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   540
by (simp add: Ord_Un_if lt_Ord le_Ord2)
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   541
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   542
lemma lt_Un_iff:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   543
     "[| Ord(i); Ord(j) |] ==> k < i \<union> j <-> k < i | k < j"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   544
apply (simp add: Ord_Un_if not_lt_iff_le)
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   545
apply (blast intro: leI lt_trans2)+
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   546
done
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   547
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   548
lemma le_Un_iff:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   549
     "[| Ord(i); Ord(j) |] ==> k \<le> i \<union> j <-> k \<le> i | k \<le> j"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   550
by (simp add: succ_Un_distrib lt_Un_iff [symmetric])
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   551
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   552
lemma Un_upper1_lt: "[|k < i; Ord(j)|] ==> k < i \<union> j"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   553
by (simp add: lt_Un_iff lt_Ord2)
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   554
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   555
lemma Un_upper2_lt: "[|k < j; Ord(i)|] ==> k < i \<union> j"
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   556
by (simp add: lt_Un_iff lt_Ord2)
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   557
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   558
(*See also Transset_iff_Union_succ*)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   559
lemma Ord_Union_succ_eq: "Ord(i) ==> \<Union>(succ(i)) = i"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   560
by (blast intro: Ord_trans)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   561
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 13155
diff changeset
   562
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   563
subsection{*Results about Limits*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   564
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   565
lemma Ord_Union [intro,simp,TC]: "[| !!i. i\<in>A ==> Ord(i) |] ==> Ord(\<Union>(A))"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   566
apply (rule Ord_is_Transset [THEN Transset_Union_family, THEN OrdI])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   567
apply (blast intro: Ord_contains_Transset)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   568
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   569
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   570
lemma Ord_UN [intro,simp,TC]:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   571
     "[| !!x. x\<in>A ==> Ord(B(x)) |] ==> Ord(\<Union>x\<in>A. B(x))"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   572
by (rule Ord_Union, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   573
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   574
lemma Ord_Inter [intro,simp,TC]:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   575
    "[| !!i. i\<in>A ==> Ord(i) |] ==> Ord(\<Inter>(A))"
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   576
apply (rule Transset_Inter_family [THEN OrdI])
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   577
apply (blast intro: Ord_is_Transset)
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   578
apply (simp add: Inter_def)
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   579
apply (blast intro: Ord_contains_Transset)
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   580
done
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   581
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   582
lemma Ord_INT [intro,simp,TC]:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   583
    "[| !!x. x\<in>A ==> Ord(B(x)) |] ==> Ord(\<Inter>x\<in>A. B(x))"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   584
by (rule Ord_Inter, blast)
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   585
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13172
diff changeset
   586
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   587
(* No < version of this theorem: consider that @{term"(\<Union>i\<in>nat.i)=nat"}! *)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   588
lemma UN_least_le:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   589
    "[| Ord(i);  !!x. x\<in>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
   590
apply (rule le_imp_subset [THEN UN_least, THEN subset_imp_le])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   591
apply (blast intro: Ord_UN elim: ltE)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   592
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   593
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   594
lemma UN_succ_least_lt:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   595
    "[| j<i;  !!x. x\<in>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
   596
apply (rule ltE, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   597
apply (rule UN_least_le [THEN lt_trans2])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   598
apply (blast intro: succ_leI)+
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 UN_upper_lt:
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   602
     "[| a\<in>A;  i < b(a);  Ord(\<Union>x\<in>A. b(x)) |] ==> i < (\<Union>x\<in>A. b(x))"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   603
by (unfold lt_def, blast)
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   604
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   605
lemma UN_upper_le:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   606
     "[| a \<in> 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
   607
apply (frule ltD)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   608
apply (rule le_imp_subset [THEN subset_trans, THEN subset_imp_le])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   609
apply (blast intro: lt_Ord UN_upper)+
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   610
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   611
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   612
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
   613
by (auto simp: lt_def Ord_Union)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   614
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   615
lemma Union_upper_le:
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   616
     "[| j \<in> J;  i\<le>j;  Ord(\<Union>(J)) |] ==> i \<le> \<Union>J"
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   617
apply (subst Union_eq_UN)
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   618
apply (rule UN_upper_le, auto)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   619
done
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   620
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   621
lemma le_implies_UN_le_UN:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   622
    "[| !!x. x\<in>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
   623
apply (rule UN_least_le)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   624
apply (rule_tac [2] UN_upper_le)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   625
apply (blast intro: Ord_UN le_Ord2)+
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   626
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   627
13615
449a70d88b38 Numerous cosmetic changes, prompted by the new simplifier
paulson
parents: 13544
diff changeset
   628
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
   629
by (blast intro: Ord_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   630
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   631
(*Holds for all transitive sets, not just ordinals*)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   632
lemma Ord_Union_subset: "Ord(i) ==> \<Union>(i) \<subseteq> i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   633
by (blast intro: Ord_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   634
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   635
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   636
subsection{*Limit Ordinals -- General Properties*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   637
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   638
lemma Limit_Union_eq: "Limit(i) ==> \<Union>(i) = i"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   639
apply (unfold Limit_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   640
apply (fast intro!: ltI elim!: ltE elim: Ord_trans)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   641
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   642
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   643
lemma Limit_is_Ord: "Limit(i) ==> Ord(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   644
apply (unfold Limit_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   645
apply (erule conjunct1)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   646
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   647
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   648
lemma Limit_has_0: "Limit(i) ==> 0 < i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   649
apply (unfold Limit_def)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   650
apply (erule conjunct2 [THEN conjunct1])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   651
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   652
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   653
lemma Limit_nonzero: "Limit(i) ==> i \<noteq> 0"
13544
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   654
by (drule Limit_has_0, blast)
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   655
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   656
lemma Limit_has_succ: "[| Limit(i);  j<i |] ==> succ(j) < i"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   657
by (unfold Limit_def, blast)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   658
13544
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   659
lemma Limit_succ_lt_iff [simp]: "Limit(i) ==> succ(j) < i <-> (j<i)"
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   660
apply (safe intro!: Limit_has_succ)
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   661
apply (frule lt_Ord)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   662
apply (blast intro: lt_trans)
13544
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   663
done
895994073bdf various new lemmas for Constructible
paulson
parents: 13534
diff changeset
   664
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   665
lemma zero_not_Limit [iff]: "~ Limit(0)"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   666
by (simp add: Limit_def)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   667
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   668
lemma Limit_has_1: "Limit(i) ==> 1 < i"
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   669
by (blast intro: Limit_has_0 Limit_has_succ)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   670
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   671
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
   672
apply (unfold Limit_def, simp add: lt_Ord2, clarify)
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   673
apply (drule_tac i=y in ltD)
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   674
apply (blast intro: lt_trans1 [OF _ ltI] lt_Ord2)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   675
done
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   676
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   677
lemma non_succ_LimitI:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   678
  assumes i: "0<i" and nsucc: "\<And>y. succ(y) \<noteq> i"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   679
  shows "Limit(i)"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   680
proof -
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   681
  have Oi: "Ord(i)" using i by (simp add: lt_def)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   682
  { fix y
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   683
    assume yi: "y<i"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   684
    hence Osy: "Ord(succ(y))" by (simp add: lt_Ord Ord_succ)
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   685
    have "~ i \<le> y" using yi by (blast dest: le_imp_not_lt)
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   686
    hence "succ(y) < i" using nsucc [of y]
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   687
      by (blast intro: Ord_linear_lt [OF Osy Oi]) }
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   688
  thus ?thesis using i Oi by (auto simp add: Limit_def)
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   689
qed
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   690
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   691
lemma succ_LimitE [elim!]: "Limit(succ(i)) ==> P"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   692
apply (rule lt_irrefl)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   693
apply (rule Limit_has_succ, assumption)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   694
apply (erule Limit_is_Ord [THEN Ord_succD, THEN le_refl])
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   695
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   696
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   697
lemma not_succ_Limit [simp]: "~ Limit(succ(i))"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   698
by blast
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   699
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   700
lemma Limit_le_succD: "[| Limit(i);  i \<le> succ(j) |] ==> i \<le> j"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   701
by (blast elim!: leE)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   702
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   703
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13269
diff changeset
   704
subsubsection{*Traditional 3-Way Case Analysis on Ordinals*}
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   705
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   706
lemma Ord_cases_disj: "Ord(i) ==> i=0 | (\<exists>j. Ord(j) & i=succ(j)) | Limit(i)"
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   707
by (blast intro!: non_succ_LimitI Ord_0_lt)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   708
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   709
lemma Ord_cases:
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   710
 assumes i: "Ord(i)"
46954
d8b3412cdb99 beautification and structured proofs
paulson
parents: 46953
diff changeset
   711
 obtains ("0") "i=0" | (succ) j where "Ord(j)" "i=succ(j)" | (limit) "Limit(i)"
46935
38ecb2dc3636 structured case and induct rules
paulson
parents: 46927
diff changeset
   712
by (insert Ord_cases_disj [OF i], auto)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   713
46927
faf4a0b02b71 rationalising the induction rule trans_induct3
paulson
parents: 46841
diff changeset
   714
lemma trans_induct3_raw:
46820
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   715
     "[| Ord(i);
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   716
         P(0);
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   717
         !!x. [| Ord(x);  P(x) |] ==> P(succ(x));
c656222c4dc1 mathematical symbols instead of ASCII
paulson
parents: 35762
diff changeset
   718
         !!x. [| Limit(x);  \<forall>y\<in>x. P(y) |] ==> P(x)
13155
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   719
      |] ==> P(i)"
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   720
apply (erule trans_induct)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   721
apply (erule Ord_cases, blast+)
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   722
done
dcbf6cb95534 converting Ordinal.ML to Isar format
paulson
parents: 12114
diff changeset
   723
46927
faf4a0b02b71 rationalising the induction rule trans_induct3
paulson
parents: 46841
diff changeset
   724
lemmas trans_induct3 = trans_induct3_raw [rule_format, case_names 0 succ limit, consumes 1]
13534
ca6debb89d77 avoid duplicate fact bindings;
wenzelm
parents: 13396
diff changeset
   725
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   726
text{*A set of ordinals is either empty, contains its own union, or its
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   727
union is a limit ordinal.*}
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   728
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   729
lemma Union_le: "[| !!x. x\<in>I ==> x\<le>j; Ord(j) |] ==> \<Union>(I) \<le> j"
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   730
  by (auto simp add: le_subset_iff Union_least)
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   731
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   732
lemma Ord_set_cases:
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   733
  assumes I: "\<forall>i\<in>I. Ord(i)"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   734
  shows "I=0 \<or> \<Union>(I) \<in> I \<or> (\<Union>(I) \<notin> I \<and> Limit(\<Union>(I)))"
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   735
proof (cases "\<Union>(I)" rule: Ord_cases)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   736
  show "Ord(\<Union>I)" using I by (blast intro: Ord_Union)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   737
next
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   738
  assume "\<Union>I = 0" thus ?thesis by (simp, blast intro: subst_elem)
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   739
next
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   740
  fix j
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   741
  assume j: "Ord(j)" and UIj:"\<Union>(I) = succ(j)"
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   742
  { assume "\<forall>i\<in>I. i\<le>j"
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   743
    hence "\<Union>(I) \<le> j"
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   744
      by (simp add: Union_le j)
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   745
    hence False
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   746
      by (simp add: UIj lt_not_refl) }
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   747
  then obtain i where i: "i \<in> I" "succ(j) \<le> i" using I j
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   748
    by (atomize, auto simp add: not_le_iff_lt)
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   749
  have "\<Union>(I) \<le> succ(j)" using UIj j by auto
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   750
  hence "i \<le> succ(j)" using i
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   751
    by (simp add: le_subset_iff Union_subset_iff)
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   752
  hence "succ(j) = i" using i
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   753
    by (blast intro: le_anti_sym)
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   754
  hence "succ(j) \<in> I" by (simp add: i)
46953
2b6e55924af3 replacing ":" by "\<in>"
paulson
parents: 46935
diff changeset
   755
  thus ?thesis by (simp add: UIj)
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   756
next
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   757
  assume "Limit(\<Union>I)" thus ?thesis by auto
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   758
qed
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   759
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   760
text{*If the union of a set of ordinals is a successor, then it is an element of that set.*}
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   761
lemma Ord_Union_eq_succD: "[|\<forall>x\<in>X. Ord(x);  \<Union>X = succ(j)|] ==> succ(j) \<in> X"
46841
49b91b716cbe Structured and calculation-based proofs (with new trans rules!)
paulson
parents: 46820
diff changeset
   762
  by (drule Ord_set_cases, auto)
13172
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   763
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   764
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
   765
apply (simp add: Limit_def lt_def)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   766
apply (blast intro!: equalityI)
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   767
done
03a5afa7b888 tidying up
paulson
parents: 13162
diff changeset
   768
435
ca5356bd315a Addition of cardinals and order types, various tidying
lcp
parents:
diff changeset
   769
end