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