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