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