--- a/src/ZF/List.ML Tue Oct 05 17:49:23 1993 +0100
+++ b/src/ZF/List.ML Wed Oct 06 09:58:53 1993 +0100
@@ -67,11 +67,11 @@
(** For recursion **)
-goalw List.thy List.con_defs "rank(a) : rank(Cons(a,l))";
+goalw List.thy List.con_defs "rank(a) < rank(Cons(a,l))";
by (simp_tac rank_ss 1);
val rank_Cons1 = result();
-goalw List.thy List.con_defs "rank(l) : rank(Cons(a,l))";
+goalw List.thy List.con_defs "rank(l) < rank(Cons(a,l))";
by (simp_tac rank_ss 1);
val rank_Cons2 = result();
--- a/src/ZF/Nat.ML Tue Oct 05 17:49:23 1993 +0100
+++ b/src/ZF/Nat.ML Wed Oct 06 09:58:53 1993 +0100
@@ -69,13 +69,13 @@
by (REPEAT (ares_tac [Ord_0, Ord_succ] 1));
val naturals_are_ordinals = result();
-(* i: nat ==> 0: succ(i) *)
-val nat_0_in_succ = naturals_are_ordinals RS Ord_0_in_succ;
+(* i: nat ==> 0 le i *)
+val nat_0_le = naturals_are_ordinals RS Ord_0_le;
goal Nat.thy "!!n. n: nat ==> n=0 | 0:n";
by (etac nat_induct 1);
by (fast_tac ZF_cs 1);
-by (fast_tac (ZF_cs addIs [nat_0_in_succ]) 1);
+by (fast_tac (ZF_cs addIs [nat_0_le]) 1);
val natE0 = result();
goal Nat.thy "Ord(nat)";
@@ -93,6 +93,13 @@
(* [| succ(i): k; k: nat |] ==> i: k *)
val succ_in_naturalD = [succI1, asm_rl, naturals_are_ordinals] MRS Ord_trans;
+goal Nat.thy "!!m n. [| m<n; n: nat |] ==> m: nat";
+by (etac ltE 1);
+by (etac (Ord_nat RSN (3,Ord_trans)) 1);
+by (assume_tac 1);
+val lt_nat_in_nat = result();
+
+
(** Variations on mathematical induction **)
(*complete induction*)
@@ -100,20 +107,19 @@
val prems = goal Nat.thy
"[| m: nat; n: nat; \
-\ !!x. [| x: nat; m<=x; P(x) |] ==> P(succ(x)) \
-\ |] ==> m <= n --> P(m) --> P(n)";
+\ !!x. [| x: nat; m le x; P(x) |] ==> P(succ(x)) \
+\ |] ==> m le n --> P(m) --> P(n)";
by (nat_ind_tac "n" prems 1);
by (ALLGOALS
(asm_simp_tac
- (ZF_ss addsimps (prems@distrib_rews@[subset_empty_iff, subset_succ_iff,
- naturals_are_ordinals]))));
+ (ZF_ss addsimps (prems@distrib_rews@[le0_iff, le_succ_iff]))));
val nat_induct_from_lemma = result();
(*Induction starting from m rather than 0*)
val prems = goal Nat.thy
- "[| m <= n; m: nat; n: nat; \
+ "[| m le n; m: nat; n: nat; \
\ P(m); \
-\ !!x. [| x: nat; m<=x; P(x) |] ==> P(succ(x)) \
+\ !!x. [| x: nat; m le x; P(x) |] ==> P(succ(x)) \
\ |] ==> P(n)";
by (rtac (nat_induct_from_lemma RS mp RS mp) 1);
by (REPEAT (ares_tac prems 1));
@@ -122,8 +128,8 @@
(*Induction suitable for subtraction and less-than*)
val prems = goal Nat.thy
"[| m: nat; n: nat; \
-\ !!x. [| x: nat |] ==> P(x,0); \
-\ !!y. [| y: nat |] ==> P(0,succ(y)); \
+\ !!x. x: nat ==> P(x,0); \
+\ !!y. y: nat ==> P(0,succ(y)); \
\ !!x y. [| x: nat; y: nat; P(x,y) |] ==> P(succ(x),succ(y)) \
\ |] ==> P(m,n)";
by (res_inst_tac [("x","m")] bspec 1);
@@ -138,23 +144,22 @@
goal Nat.thy
"!!m. m: nat ==> P(m,succ(m)) --> (ALL x: nat. P(m,x) --> P(m,succ(x))) --> \
-\ (ALL n:nat. m:n --> P(m,n))";
+\ (ALL n:nat. m<n --> P(m,n))";
by (etac nat_induct 1);
by (ALLGOALS
(EVERY' [rtac (impI RS impI), rtac (nat_induct RS ballI), assume_tac,
- fast_tac ZF_cs, fast_tac ZF_cs]));
-val succ_less_induct_lemma = result();
+ fast_tac lt_cs, fast_tac lt_cs]));
+val succ_lt_induct_lemma = result();
val prems = goal Nat.thy
- "[| m: n; n: nat; \
-\ P(m,succ(m)); \
-\ !!x. [| x: nat; P(m,x) |] ==> P(m,succ(x)) \
+ "[| m<n; n: nat; \
+\ P(m,succ(m)); \
+\ !!x. [| x: nat; P(m,x) |] ==> P(m,succ(x)) \
\ |] ==> P(m,n)";
by (res_inst_tac [("P4","P")]
- (succ_less_induct_lemma RS mp RS mp RS bspec RS mp) 1);
-by (rtac (Ord_nat RSN (3,Ord_trans)) 1);
-by (REPEAT (ares_tac (prems @ [ballI,impI]) 1));
-val succ_less_induct = result();
+ (succ_lt_induct_lemma RS mp RS mp RS bspec RS mp) 1);
+by (REPEAT (ares_tac (prems @ [ballI, impI, lt_nat_in_nat]) 1));
+val succ_lt_induct = result();
(** nat_case **)
@@ -170,14 +175,13 @@
"[| n: nat; a: C(0); !!m. m: nat ==> b(m): C(succ(m)) \
\ |] ==> nat_case(a,b,n) : C(n)";
by (rtac (major RS nat_induct) 1);
-by (REPEAT (resolve_tac [nat_case_0 RS ssubst,
- nat_case_succ RS ssubst] 1
- THEN resolve_tac prems 1));
-by (assume_tac 1);
+by (ALLGOALS
+ (asm_simp_tac (ZF_ss addsimps (prems @ [nat_case_0, nat_case_succ]))));
val nat_case_type = result();
-(** nat_rec -- used to define eclose and transrec, then obsolete **)
+(** nat_rec -- used to define eclose and transrec, then obsolete;
+ rec, from arith.ML, has fewer typing conditions **)
val nat_rec_trans = wf_Memrel RS (nat_rec_def RS def_wfrec RS trans);
@@ -195,9 +199,12 @@
(** The union of two natural numbers is a natural number -- their maximum **)
-(* [| i : nat; j : nat |] ==> i Un j : nat *)
-val Un_nat_type = standard (Ord_nat RSN (3,Ord_member_UnI));
+goal Nat.thy "!!i j. [| i: nat; j: nat |] ==> i Un j: nat";
+by (rtac (Un_least_lt RS ltD) 1);
+by (REPEAT (ares_tac [ltI, Ord_nat] 1));
+val Un_nat_type = result();
-(* [| i : nat; j : nat |] ==> i Int j : nat *)
-val Int_nat_type = standard (Ord_nat RSN (3,Ord_member_IntI));
-
+goal Nat.thy "!!i j. [| i: nat; j: nat |] ==> i Int j: nat";
+by (rtac (Int_greatest_lt RS ltD) 1);
+by (REPEAT (ares_tac [ltI, Ord_nat] 1));
+val Int_nat_type = result();
--- a/src/ZF/Ord.ML Tue Oct 05 17:49:23 1993 +0100
+++ b/src/ZF/Ord.ML Wed Oct 06 09:58:53 1993 +0100
@@ -120,6 +120,9 @@
by (fast_tac ZF_cs 1);
val Ord_in_Ord = result();
+(* Ord(succ(j)) ==> Ord(j) *)
+val Ord_succD = succI1 RSN (2, Ord_in_Ord);
+
goal Ord.thy "!!i j. [| Ord(i); Transset(j); j<=i |] ==> Ord(j)";
by (REPEAT (ares_tac [OrdI] 1
ORELSE eresolve_tac [Ord_contains_Transset, subsetD] 1));
@@ -150,6 +153,10 @@
Ord_contains_Transset] 1));
val Ord_succ = result();
+goal Ord.thy "Ord(succ(i)) <-> Ord(i)";
+by (fast_tac (ZF_cs addIs [Ord_succ] addDs [Ord_succD]) 1);
+val Ord_succ_iff = result();
+
val nonempty::prems = goal Ord.thy
"[| j:A; !!i. i:A ==> Ord(i) |] ==> Ord(Inter(A))";
by (rtac (nonempty RS Transset_Inter_family RS OrdI) 1);
@@ -167,6 +174,88 @@
val Ord_INT = result();
+(*** < is 'less than' for ordinals ***)
+
+goalw Ord.thy [lt_def] "!!i j. [| i:j; Ord(j) |] ==> i<j";
+by (REPEAT (ares_tac [conjI] 1));
+val ltI = result();
+
+val major::prems = goalw Ord.thy [lt_def]
+ "[| i<j; [| i:j; Ord(i); Ord(j) |] ==> P |] ==> P";
+by (rtac (major RS conjE) 1);
+by (REPEAT (ares_tac (prems@[Ord_in_Ord]) 1));
+val ltE = result();
+
+goal Ord.thy "!!i j. i<j ==> i:j";
+by (etac ltE 1);
+by (assume_tac 1);
+val ltD = result();
+
+goalw Ord.thy [lt_def] "~ i<0";
+by (fast_tac ZF_cs 1);
+val not_lt0 = result();
+
+(* i<0 ==> R *)
+val lt0E = standard (not_lt0 RS notE);
+
+goal Ord.thy "!!i j k. [| i<j; j<k |] ==> i<k";
+by (fast_tac (ZF_cs addSIs [ltI] addSEs [ltE, Ord_trans]) 1);
+val lt_trans = result();
+
+goalw Ord.thy [lt_def] "!!i j. [| i<j; j<i |] ==> P";
+by (REPEAT (eresolve_tac [asm_rl, conjE, mem_anti_sym] 1));
+val lt_anti_sym = result();
+
+val lt_anti_refl = prove_goal Ord.thy "i<i ==> P"
+ (fn [major]=> [ (rtac (major RS (major RS lt_anti_sym)) 1) ]);
+
+val lt_not_refl = prove_goal Ord.thy "~ i<i"
+ (fn _=> [ (rtac notI 1), (etac lt_anti_refl 1) ]);
+
+(** le is less than or equals; recall i le j abbrevs i<succ(j) !! **)
+
+goalw Ord.thy [lt_def] "i le j <-> i<j | (i=j & Ord(j))";
+by (fast_tac (ZF_cs addSIs [Ord_succ] addSDs [Ord_succD]) 1);
+val le_iff = result();
+
+goal Ord.thy "!!i j. i<j ==> i le j";
+by (asm_simp_tac (ZF_ss addsimps [le_iff]) 1);
+val leI = result();
+
+goal Ord.thy "!!i. [| i=j; Ord(j) |] ==> i le j";
+by (asm_simp_tac (ZF_ss addsimps [le_iff]) 1);
+val le_eqI = result();
+
+val le_refl = refl RS le_eqI;
+
+val [prem] = goal Ord.thy "(~ (i=j & Ord(j)) ==> i<j) ==> i le j";
+by (rtac (disjCI RS (le_iff RS iffD2)) 1);
+by (etac prem 1);
+val leCI = result();
+
+val major::prems = goal Ord.thy
+ "[| i le j; i<j ==> P; [| i=j; Ord(j) |] ==> P |] ==> P";
+by (rtac (major RS (le_iff RS iffD1 RS disjE)) 1);
+by (DEPTH_SOLVE (ares_tac prems 1 ORELSE etac conjE 1));
+val leE = result();
+
+goal Ord.thy "!!i j. [| i le j; j le i |] ==> i=j";
+by (asm_full_simp_tac (ZF_ss addsimps [le_iff]) 1);
+by (fast_tac (ZF_cs addEs [lt_anti_sym]) 1);
+val le_asym = result();
+
+goal Ord.thy "i le 0 <-> i=0";
+by (fast_tac (ZF_cs addSIs [Ord_0 RS le_refl] addSEs [leE, lt0E]) 1);
+val le0_iff = result();
+
+val le0D = standard (le0_iff RS iffD1);
+
+val lt_cs =
+ ZF_cs addSIs [le_refl, leCI]
+ addSDs [le0D]
+ addSEs [lt_anti_refl, lt0E, leE];
+
+
(*** Natural Deduction rules for Memrel ***)
goalw Ord.thy [Memrel_def] "<a,b> : Memrel(A) <-> a:b & a:A & b:A";
@@ -240,7 +329,7 @@
(*Finds contradictions for the following proof*)
val Ord_trans_tac = EVERY' [etac notE, etac Ord_trans, REPEAT o atac];
-(** Proving that "member" is a linear ordering on the ordinals **)
+(** Proving that < is a linear ordering on the ordinals **)
val prems = goal Ord.thy
"Ord(i) ==> (ALL j. Ord(j) --> i:j | i=j | j:i)";
@@ -254,124 +343,123 @@
ORELSE Ord_trans_tac 1));
val Ord_linear_lemma = result();
-val ordi::ordj::prems = goal Ord.thy
- "[| Ord(i); Ord(j); i:j ==> P; i=j ==> P; j:i ==> P |] \
-\ ==> P";
-by (rtac (ordi RS Ord_linear_lemma RS spec RS impE) 1);
-by (rtac ordj 1);
-by (REPEAT (eresolve_tac (prems@[asm_rl,disjE]) 1));
-val Ord_linear = result();
+(*The trichotomy law for ordinals!*)
+val ordi::ordj::prems = goalw Ord.thy [lt_def]
+ "[| Ord(i); Ord(j); i<j ==> P; i=j ==> P; j<i ==> P |] ==> P";
+by (rtac ([ordi,ordj] MRS (Ord_linear_lemma RS spec RS impE)) 1);
+by (REPEAT (FIRSTGOAL (etac disjE)));
+by (DEPTH_SOLVE (ares_tac ([ordi,ordj,conjI] @ prems) 1));
+val Ord_linear_lt = result();
val prems = goal Ord.thy
- "[| Ord(i); Ord(j); i<=j ==> P; j<=i ==> P |] \
-\ ==> P";
-by (res_inst_tac [("i","i"),("j","j")] Ord_linear 1);
-by (DEPTH_SOLVE (ares_tac (prems@[subset_refl]) 1
- ORELSE eresolve_tac [asm_rl,OrdmemD,ssubst] 1));
-val Ord_subset = result();
+ "[| Ord(i); Ord(j); i le j ==> P; j le i ==> P |] ==> P";
+by (res_inst_tac [("i","i"),("j","j")] Ord_linear_lt 1);
+by (DEPTH_SOLVE (ares_tac ([leI,le_eqI] @ prems) 1));
+val Ord_linear_le = result();
+
+goal Ord.thy "!!i j. j le i ==> ~ i<j";
+by (fast_tac (lt_cs addEs [lt_anti_sym]) 1);
+val le_imp_not_lt = result();
-goal Ord.thy "!!i j. [| j<=i; ~ i<=j; Ord(i); Ord(j) |] ==> j:i";
-by (etac Ord_linear 1);
-by (REPEAT (ares_tac [subset_refl] 1
- ORELSE eresolve_tac [notE,OrdmemD,ssubst] 1));
-val Ord_member = result();
+goal Ord.thy "!!i j. [| ~ i<j; Ord(i); Ord(j) |] ==> j le i";
+by (res_inst_tac [("i","i"),("j","j")] Ord_linear_le 1);
+by (REPEAT (SOMEGOAL assume_tac));
+by (fast_tac (lt_cs addEs [lt_anti_sym]) 1);
+val not_lt_imp_le = result();
-val [prem] = goal Ord.thy "Ord(i) ==> 0: succ(i)";
-by (rtac (empty_subsetI RS Ord_member) 1);
-by (fast_tac ZF_cs 1);
-by (rtac (prem RS Ord_succ) 1);
-by (rtac Ord_0 1);
-val Ord_0_in_succ = result();
+goal Ord.thy "!!i j. [| Ord(i); Ord(j) |] ==> ~ i<j <-> j le i";
+by (REPEAT (ares_tac [iffI, le_imp_not_lt, not_lt_imp_le] 1));
+val not_lt_iff_le = result();
-goal Ord.thy "!!i j. [| Ord(i); Ord(j) |] ==> j:i <-> j<=i & ~(i<=j)";
-by (rtac iffI 1);
-by (rtac conjI 1);
-by (etac OrdmemD 1);
-by (rtac (mem_anti_refl RS notI) 2);
-by (etac subsetD 2);
-by (REPEAT (eresolve_tac [asm_rl, conjE, Ord_member] 1));
-val Ord_member_iff = result();
+goal Ord.thy "!!i j. [| Ord(i); Ord(j) |] ==> ~ i le j <-> j<i";
+by (asm_simp_tac (ZF_ss addsimps [not_lt_iff_le RS iff_sym]) 1);
+val not_le_iff_lt = result();
+
+goal Ord.thy "!!i. Ord(i) ==> 0 le i";
+by (etac (not_lt_iff_le RS iffD1) 1);
+by (REPEAT (resolve_tac [Ord_0, not_lt0] 1));
+val Ord_0_le = result();
-goal Ord.thy "!!i. Ord(i) ==> 0:i <-> ~ i=0";
-by (etac (Ord_0 RSN (2,Ord_member_iff) RS iff_trans) 1);
-by (fast_tac eq_cs 1);
-val Ord_0_member_iff = result();
-
-(** For ordinals, i: succ(j) means 'less-than or equals' **)
+goal Ord.thy "!!i. [| Ord(i); ~ i=0 |] ==> 0<i";
+by (etac (not_le_iff_lt RS iffD1) 1);
+by (rtac Ord_0 1);
+by (fast_tac lt_cs 1);
+val Ord_0_lt = result();
-goal Ord.thy "!!i j. [| j<=i; Ord(i); Ord(j) |] ==> j : succ(i)";
-by (rtac Ord_member 1);
-by (REPEAT (ares_tac [Ord_succ] 3));
-by (rtac (mem_anti_refl RS notI) 2);
-by (etac subsetD 2);
-by (ALLGOALS (fast_tac ZF_cs));
-val member_succI = result();
+(*** Results about less-than or equals ***)
+
+(** For ordinals, j<=i (subset) implies j le i (less-than or equals) **)
-(*Recall Ord_succ_subsetI, namely [| i:j; Ord(j) |] ==> succ(i) <= j *)
-goalw Ord.thy [Transset_def,Ord_def]
- "!!i j. [| i : succ(j); Ord(j) |] ==> i<=j";
-by (fast_tac ZF_cs 1);
-val member_succD = result();
-
-goal Ord.thy "!!i j. [| Ord(i); Ord(j) |] ==> j:succ(i) <-> j<=i";
-by (fast_tac (subset_cs addSEs [member_succI, member_succD]) 1);
-val member_succ_iff = result();
+goal Ord.thy "!!i j. [| j<=i; Ord(i); Ord(j) |] ==> j le i";
+by (rtac (not_lt_iff_le RS iffD1) 1);
+by (assume_tac 1);
+by (assume_tac 1);
+by (fast_tac (ZF_cs addEs [ltE, mem_anti_refl]) 1);
+val subset_imp_le = result();
-goal Ord.thy
- "!!i j. [| Ord(i); Ord(j) |] ==> i<=succ(j) <-> i<=j | i=succ(j)";
-by (asm_simp_tac (ZF_ss addsimps [member_succ_iff RS iff_sym, Ord_succ]) 1);
-by (fast_tac ZF_cs 1);
-val subset_succ_iff = result();
+goal Ord.thy "!!i j. i le j ==> i<=j";
+by (etac leE 1);
+by (fast_tac ZF_cs 2);
+by (fast_tac (subset_cs addIs [OrdmemD] addEs [ltE]) 1);
+val le_imp_subset = result();
-goal Ord.thy "!!i j. [| i:succ(j); j:k; Ord(k) |] ==> i:k";
-by (fast_tac (ZF_cs addEs [Ord_trans]) 1);
-val Ord_trans1 = result();
+goal Ord.thy "j le i <-> j<=i & Ord(i) & Ord(j)";
+by (fast_tac (ZF_cs addSEs [subset_imp_le, le_imp_subset]
+ addEs [ltE, make_elim Ord_succD]) 1);
+val le_subset_iff = result();
+
+goal Ord.thy "i le succ(j) <-> i le j | i=succ(j) & Ord(i)";
+by (simp_tac (ZF_ss addsimps [le_iff]) 1);
+by (fast_tac (ZF_cs addIs [Ord_succ] addDs [Ord_succD]) 1);
+val le_succ_iff = result();
-goal Ord.thy "!!i j. [| i:j; j:succ(k); Ord(k) |] ==> i:k";
-by (fast_tac (ZF_cs addEs [Ord_trans]) 1);
-val Ord_trans2 = result();
+goal Ord.thy "!!i j. [| i le j; j<k |] ==> i<k";
+by (fast_tac (ZF_cs addEs [leE, lt_trans]) 1);
+val lt_trans1 = result();
-goal Ord.thy "!!i jk. [| i:j; j<=k; Ord(k) |] ==> i:k";
-by (fast_tac (ZF_cs addEs [Ord_trans]) 1);
-val Ord_transsub2 = result();
+goal Ord.thy "!!i j. [| i<j; j le k |] ==> i<k";
+by (fast_tac (ZF_cs addEs [leE, lt_trans]) 1);
+val lt_trans2 = result();
+
+goal Ord.thy "!!i j. [| i le j; j le k |] ==> i le k";
+by (REPEAT (ares_tac [lt_trans1] 1));
+val le_trans = result();
-goal Ord.thy "!!i j. [| i:j; Ord(j) |] ==> succ(i) : succ(j)";
-by (rtac member_succI 1);
-by (REPEAT (ares_tac [subsetI,Ord_succ,Ord_in_Ord] 1
- ORELSE eresolve_tac [succE,Ord_trans,ssubst] 1));
-val succ_mem_succI = result();
+goal Ord.thy "!!i j. i<j ==> succ(i) le j";
+by (rtac (not_lt_iff_le RS iffD1) 1);
+by (fast_tac (lt_cs addEs [lt_anti_sym]) 3);
+by (ALLGOALS (fast_tac (ZF_cs addEs [ltE] addIs [Ord_succ])));
+val succ_leI = result();
-goal Ord.thy "!!i j. [| succ(i) : succ(j); Ord(j) |] ==> i:j";
-by (REPEAT (eresolve_tac [asm_rl, make_elim member_succD, succ_subsetE] 1));
-val succ_mem_succE = result();
+goal Ord.thy "!!i j. succ(i) le j ==> i<j";
+by (rtac (not_le_iff_lt RS iffD1) 1);
+by (fast_tac (lt_cs addEs [lt_anti_sym]) 3);
+by (ALLGOALS (fast_tac (ZF_cs addEs [ltE, make_elim Ord_succD])));
+val succ_leE = result();
-goal Ord.thy "!!i j. Ord(j) ==> succ(i) : succ(j) <-> i:j";
-by (REPEAT (ares_tac [iffI,succ_mem_succI,succ_mem_succE] 1));
-val succ_mem_succ_iff = result();
-
-goal Ord.thy "!!i j. [| i<=j; Ord(i); Ord(j) |] ==> succ(i) <= succ(j)";
-by (rtac (member_succI RS succ_mem_succI RS member_succD) 1);
-by (REPEAT (ares_tac [Ord_succ] 1));
-val Ord_succ_mono = result();
+goal Ord.thy "succ(i) le j <-> i<j";
+by (REPEAT (ares_tac [iffI,succ_leI,succ_leE] 1));
+val succ_le_iff = result();
(** Union and Intersection **)
-goal Ord.thy "!!i j k. [| i:k; j:k; Ord(k) |] ==> i Un j : k";
-by (res_inst_tac [("i","i"),("j","j")] Ord_subset 1);
-by (REPEAT (eresolve_tac [asm_rl, Ord_in_Ord] 1));
-by (asm_simp_tac (ZF_ss addsimps [subset_Un_iff RS iffD1]) 1);
-by (rtac (Un_commute RS ssubst) 1);
-by (asm_simp_tac (ZF_ss addsimps [subset_Un_iff RS iffD1]) 1);
-val Ord_member_UnI = result();
+(*Replacing k by succ(k') yields the similar rule for le!*)
+goal Ord.thy "!!i j k. [| i<k; j<k |] ==> i Un j < k";
+by (res_inst_tac [("i","i"),("j","j")] Ord_linear_le 1);
+by (rtac (Un_commute RS ssubst) 4);
+by (asm_full_simp_tac (ZF_ss addsimps [le_subset_iff, subset_Un_iff]) 4);
+by (asm_full_simp_tac (ZF_ss addsimps [le_subset_iff, subset_Un_iff]) 3);
+by (REPEAT (eresolve_tac [asm_rl, ltE] 1));
+val Un_least_lt = result();
-goal Ord.thy "!!i j k. [| i:k; j:k; Ord(k) |] ==> i Int j : k";
-by (res_inst_tac [("i","i"),("j","j")] Ord_subset 1);
-by (REPEAT (eresolve_tac [asm_rl, Ord_in_Ord] 1));
-by (asm_simp_tac (ZF_ss addsimps [subset_Int_iff RS iffD1]) 1);
-by (rtac (Int_commute RS ssubst) 1);
-by (asm_simp_tac (ZF_ss addsimps [subset_Int_iff RS iffD1]) 1);
-val Ord_member_IntI = result();
-
+(*Replacing k by succ(k') yields the similar rule for le!*)
+goal Ord.thy "!!i j k. [| i<k; j<k |] ==> i Int j < k";
+by (res_inst_tac [("i","i"),("j","j")] Ord_linear_le 1);
+by (rtac (Int_commute RS ssubst) 4);
+by (asm_full_simp_tac (ZF_ss addsimps [le_subset_iff, subset_Int_iff]) 4);
+by (asm_full_simp_tac (ZF_ss addsimps [le_subset_iff, subset_Int_iff]) 3);
+by (REPEAT (eresolve_tac [asm_rl, ltE] 1));
+val Int_greatest_lt = result();
(*** Results about limits ***)
@@ -387,24 +475,29 @@
by (eresolve_tac prems 1);
val Ord_UN = result();
-(*The upper bound must be a successor ordinal --
- consider that (UN i:nat.i)=nat although nat is an upper bound of each i*)
+(* No < version; consider (UN i:nat.i)=nat *)
val [ordi,limit] = goal Ord.thy
- "[| Ord(i); !!y. y:A ==> f(y): succ(i) |] ==> (UN y:A. f(y)) : succ(i)";
-by (rtac (member_succD RS UN_least RS member_succI) 1);
-by (REPEAT (ares_tac [ordi, Ord_UN, ordi RS Ord_succ RS Ord_in_Ord,
- limit] 1));
-val sup_least = result();
+ "[| Ord(i); !!x. x:A ==> b(x) le i |] ==> (UN x:A. b(x)) le i";
+by (rtac (le_imp_subset RS UN_least RS subset_imp_le) 1);
+by (REPEAT (ares_tac [ordi, Ord_UN, limit] 1 ORELSE etac (limit RS ltE) 1));
+val UN_least_le = result();
-val [jmemi,ordi,limit] = goal Ord.thy
- "[| j: i; Ord(i); !!y. y:A ==> f(y): j |] ==> (UN y:A. succ(f(y))) : i";
-by (cut_facts_tac [jmemi RS (ordi RS Ord_in_Ord)] 1);
-by (rtac (sup_least RS Ord_trans2) 1);
-by (REPEAT (ares_tac [jmemi, ordi, succ_mem_succI, limit] 1));
-val sup_least2 = result();
+val [jlti,limit] = goal Ord.thy
+ "[| j<i; !!x. x:A ==> b(x)<j |] ==> (UN x:A. succ(b(x))) < i";
+by (rtac (jlti RS ltE) 1);
+by (rtac (UN_least_le RS lt_trans2) 1);
+by (REPEAT (ares_tac [jlti, succ_leI, limit] 1));
+val UN_succ_least_lt = result();
+
+val prems = goal Ord.thy
+ "[| a: A; i le b(a); !!x. x:A ==> Ord(b(x)) |] ==> i le (UN x:A. b(x))";
+by (resolve_tac (prems RL [ltE]) 1);
+by (rtac (le_imp_subset RS subset_trans RS subset_imp_le) 1);
+by (REPEAT (ares_tac (prems @ [UN_upper, Ord_UN]) 1));
+val UN_upper_le = result();
goal Ord.thy "!!i. Ord(i) ==> (UN y:i. succ(y)) = i";
-by (fast_tac (eq_cs addSEs [Ord_trans1]) 1);
+by (fast_tac (eq_cs addEs [Ord_trans]) 1);
val Ord_equality = result();
(*Holds for all transitive sets, not just ordinals*)
--- a/src/ZF/Ord.thy Tue Oct 05 17:49:23 1993 +0100
+++ b/src/ZF/Ord.thy Wed Oct 06 09:58:53 1993 +0100
@@ -1,19 +1,25 @@
(* Title: ZF/ordinal.thy
ID: $Id$
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
- Copyright 1992 University of Cambridge
+ Copyright 1993 University of Cambridge
Ordinals in Zermelo-Fraenkel Set Theory
*)
Ord = WF +
consts
- Memrel :: "i=>i"
- Transset,Ord :: "i=>o"
+ Memrel :: "i=>i"
+ Transset,Ord :: "i=>o"
+ "<" :: "[i,i] => o" (infixl 50) (*less than on ordinals*)
+ "le" :: "[i,i] => o" (infixl 50) (*less than or equals*)
+
+translations
+ "x le y" == "x < succ(y)"
rules
Memrel_def "Memrel(A) == {z: A*A . EX x y. z=<x,y> & x:y }"
Transset_def "Transset(i) == ALL x:i. x<=i"
Ord_def "Ord(i) == Transset(i) & (ALL x:i. Transset(x))"
+ lt_def "i<j == i:j & Ord(j)"
end
--- a/src/ZF/list.ML Tue Oct 05 17:49:23 1993 +0100
+++ b/src/ZF/list.ML Wed Oct 06 09:58:53 1993 +0100
@@ -67,11 +67,11 @@
(** For recursion **)
-goalw List.thy List.con_defs "rank(a) : rank(Cons(a,l))";
+goalw List.thy List.con_defs "rank(a) < rank(Cons(a,l))";
by (simp_tac rank_ss 1);
val rank_Cons1 = result();
-goalw List.thy List.con_defs "rank(l) : rank(Cons(a,l))";
+goalw List.thy List.con_defs "rank(l) < rank(Cons(a,l))";
by (simp_tac rank_ss 1);
val rank_Cons2 = result();
--- a/src/ZF/nat.ML Tue Oct 05 17:49:23 1993 +0100
+++ b/src/ZF/nat.ML Wed Oct 06 09:58:53 1993 +0100
@@ -69,13 +69,13 @@
by (REPEAT (ares_tac [Ord_0, Ord_succ] 1));
val naturals_are_ordinals = result();
-(* i: nat ==> 0: succ(i) *)
-val nat_0_in_succ = naturals_are_ordinals RS Ord_0_in_succ;
+(* i: nat ==> 0 le i *)
+val nat_0_le = naturals_are_ordinals RS Ord_0_le;
goal Nat.thy "!!n. n: nat ==> n=0 | 0:n";
by (etac nat_induct 1);
by (fast_tac ZF_cs 1);
-by (fast_tac (ZF_cs addIs [nat_0_in_succ]) 1);
+by (fast_tac (ZF_cs addIs [nat_0_le]) 1);
val natE0 = result();
goal Nat.thy "Ord(nat)";
@@ -93,6 +93,13 @@
(* [| succ(i): k; k: nat |] ==> i: k *)
val succ_in_naturalD = [succI1, asm_rl, naturals_are_ordinals] MRS Ord_trans;
+goal Nat.thy "!!m n. [| m<n; n: nat |] ==> m: nat";
+by (etac ltE 1);
+by (etac (Ord_nat RSN (3,Ord_trans)) 1);
+by (assume_tac 1);
+val lt_nat_in_nat = result();
+
+
(** Variations on mathematical induction **)
(*complete induction*)
@@ -100,20 +107,19 @@
val prems = goal Nat.thy
"[| m: nat; n: nat; \
-\ !!x. [| x: nat; m<=x; P(x) |] ==> P(succ(x)) \
-\ |] ==> m <= n --> P(m) --> P(n)";
+\ !!x. [| x: nat; m le x; P(x) |] ==> P(succ(x)) \
+\ |] ==> m le n --> P(m) --> P(n)";
by (nat_ind_tac "n" prems 1);
by (ALLGOALS
(asm_simp_tac
- (ZF_ss addsimps (prems@distrib_rews@[subset_empty_iff, subset_succ_iff,
- naturals_are_ordinals]))));
+ (ZF_ss addsimps (prems@distrib_rews@[le0_iff, le_succ_iff]))));
val nat_induct_from_lemma = result();
(*Induction starting from m rather than 0*)
val prems = goal Nat.thy
- "[| m <= n; m: nat; n: nat; \
+ "[| m le n; m: nat; n: nat; \
\ P(m); \
-\ !!x. [| x: nat; m<=x; P(x) |] ==> P(succ(x)) \
+\ !!x. [| x: nat; m le x; P(x) |] ==> P(succ(x)) \
\ |] ==> P(n)";
by (rtac (nat_induct_from_lemma RS mp RS mp) 1);
by (REPEAT (ares_tac prems 1));
@@ -122,8 +128,8 @@
(*Induction suitable for subtraction and less-than*)
val prems = goal Nat.thy
"[| m: nat; n: nat; \
-\ !!x. [| x: nat |] ==> P(x,0); \
-\ !!y. [| y: nat |] ==> P(0,succ(y)); \
+\ !!x. x: nat ==> P(x,0); \
+\ !!y. y: nat ==> P(0,succ(y)); \
\ !!x y. [| x: nat; y: nat; P(x,y) |] ==> P(succ(x),succ(y)) \
\ |] ==> P(m,n)";
by (res_inst_tac [("x","m")] bspec 1);
@@ -138,23 +144,22 @@
goal Nat.thy
"!!m. m: nat ==> P(m,succ(m)) --> (ALL x: nat. P(m,x) --> P(m,succ(x))) --> \
-\ (ALL n:nat. m:n --> P(m,n))";
+\ (ALL n:nat. m<n --> P(m,n))";
by (etac nat_induct 1);
by (ALLGOALS
(EVERY' [rtac (impI RS impI), rtac (nat_induct RS ballI), assume_tac,
- fast_tac ZF_cs, fast_tac ZF_cs]));
-val succ_less_induct_lemma = result();
+ fast_tac lt_cs, fast_tac lt_cs]));
+val succ_lt_induct_lemma = result();
val prems = goal Nat.thy
- "[| m: n; n: nat; \
-\ P(m,succ(m)); \
-\ !!x. [| x: nat; P(m,x) |] ==> P(m,succ(x)) \
+ "[| m<n; n: nat; \
+\ P(m,succ(m)); \
+\ !!x. [| x: nat; P(m,x) |] ==> P(m,succ(x)) \
\ |] ==> P(m,n)";
by (res_inst_tac [("P4","P")]
- (succ_less_induct_lemma RS mp RS mp RS bspec RS mp) 1);
-by (rtac (Ord_nat RSN (3,Ord_trans)) 1);
-by (REPEAT (ares_tac (prems @ [ballI,impI]) 1));
-val succ_less_induct = result();
+ (succ_lt_induct_lemma RS mp RS mp RS bspec RS mp) 1);
+by (REPEAT (ares_tac (prems @ [ballI, impI, lt_nat_in_nat]) 1));
+val succ_lt_induct = result();
(** nat_case **)
@@ -170,14 +175,13 @@
"[| n: nat; a: C(0); !!m. m: nat ==> b(m): C(succ(m)) \
\ |] ==> nat_case(a,b,n) : C(n)";
by (rtac (major RS nat_induct) 1);
-by (REPEAT (resolve_tac [nat_case_0 RS ssubst,
- nat_case_succ RS ssubst] 1
- THEN resolve_tac prems 1));
-by (assume_tac 1);
+by (ALLGOALS
+ (asm_simp_tac (ZF_ss addsimps (prems @ [nat_case_0, nat_case_succ]))));
val nat_case_type = result();
-(** nat_rec -- used to define eclose and transrec, then obsolete **)
+(** nat_rec -- used to define eclose and transrec, then obsolete;
+ rec, from arith.ML, has fewer typing conditions **)
val nat_rec_trans = wf_Memrel RS (nat_rec_def RS def_wfrec RS trans);
@@ -195,9 +199,12 @@
(** The union of two natural numbers is a natural number -- their maximum **)
-(* [| i : nat; j : nat |] ==> i Un j : nat *)
-val Un_nat_type = standard (Ord_nat RSN (3,Ord_member_UnI));
+goal Nat.thy "!!i j. [| i: nat; j: nat |] ==> i Un j: nat";
+by (rtac (Un_least_lt RS ltD) 1);
+by (REPEAT (ares_tac [ltI, Ord_nat] 1));
+val Un_nat_type = result();
-(* [| i : nat; j : nat |] ==> i Int j : nat *)
-val Int_nat_type = standard (Ord_nat RSN (3,Ord_member_IntI));
-
+goal Nat.thy "!!i j. [| i: nat; j: nat |] ==> i Int j: nat";
+by (rtac (Int_greatest_lt RS ltD) 1);
+by (REPEAT (ares_tac [ltI, Ord_nat] 1));
+val Int_nat_type = result();
--- a/src/ZF/ord.ML Tue Oct 05 17:49:23 1993 +0100
+++ b/src/ZF/ord.ML Wed Oct 06 09:58:53 1993 +0100
@@ -120,6 +120,9 @@
by (fast_tac ZF_cs 1);
val Ord_in_Ord = result();
+(* Ord(succ(j)) ==> Ord(j) *)
+val Ord_succD = succI1 RSN (2, Ord_in_Ord);
+
goal Ord.thy "!!i j. [| Ord(i); Transset(j); j<=i |] ==> Ord(j)";
by (REPEAT (ares_tac [OrdI] 1
ORELSE eresolve_tac [Ord_contains_Transset, subsetD] 1));
@@ -150,6 +153,10 @@
Ord_contains_Transset] 1));
val Ord_succ = result();
+goal Ord.thy "Ord(succ(i)) <-> Ord(i)";
+by (fast_tac (ZF_cs addIs [Ord_succ] addDs [Ord_succD]) 1);
+val Ord_succ_iff = result();
+
val nonempty::prems = goal Ord.thy
"[| j:A; !!i. i:A ==> Ord(i) |] ==> Ord(Inter(A))";
by (rtac (nonempty RS Transset_Inter_family RS OrdI) 1);
@@ -167,6 +174,88 @@
val Ord_INT = result();
+(*** < is 'less than' for ordinals ***)
+
+goalw Ord.thy [lt_def] "!!i j. [| i:j; Ord(j) |] ==> i<j";
+by (REPEAT (ares_tac [conjI] 1));
+val ltI = result();
+
+val major::prems = goalw Ord.thy [lt_def]
+ "[| i<j; [| i:j; Ord(i); Ord(j) |] ==> P |] ==> P";
+by (rtac (major RS conjE) 1);
+by (REPEAT (ares_tac (prems@[Ord_in_Ord]) 1));
+val ltE = result();
+
+goal Ord.thy "!!i j. i<j ==> i:j";
+by (etac ltE 1);
+by (assume_tac 1);
+val ltD = result();
+
+goalw Ord.thy [lt_def] "~ i<0";
+by (fast_tac ZF_cs 1);
+val not_lt0 = result();
+
+(* i<0 ==> R *)
+val lt0E = standard (not_lt0 RS notE);
+
+goal Ord.thy "!!i j k. [| i<j; j<k |] ==> i<k";
+by (fast_tac (ZF_cs addSIs [ltI] addSEs [ltE, Ord_trans]) 1);
+val lt_trans = result();
+
+goalw Ord.thy [lt_def] "!!i j. [| i<j; j<i |] ==> P";
+by (REPEAT (eresolve_tac [asm_rl, conjE, mem_anti_sym] 1));
+val lt_anti_sym = result();
+
+val lt_anti_refl = prove_goal Ord.thy "i<i ==> P"
+ (fn [major]=> [ (rtac (major RS (major RS lt_anti_sym)) 1) ]);
+
+val lt_not_refl = prove_goal Ord.thy "~ i<i"
+ (fn _=> [ (rtac notI 1), (etac lt_anti_refl 1) ]);
+
+(** le is less than or equals; recall i le j abbrevs i<succ(j) !! **)
+
+goalw Ord.thy [lt_def] "i le j <-> i<j | (i=j & Ord(j))";
+by (fast_tac (ZF_cs addSIs [Ord_succ] addSDs [Ord_succD]) 1);
+val le_iff = result();
+
+goal Ord.thy "!!i j. i<j ==> i le j";
+by (asm_simp_tac (ZF_ss addsimps [le_iff]) 1);
+val leI = result();
+
+goal Ord.thy "!!i. [| i=j; Ord(j) |] ==> i le j";
+by (asm_simp_tac (ZF_ss addsimps [le_iff]) 1);
+val le_eqI = result();
+
+val le_refl = refl RS le_eqI;
+
+val [prem] = goal Ord.thy "(~ (i=j & Ord(j)) ==> i<j) ==> i le j";
+by (rtac (disjCI RS (le_iff RS iffD2)) 1);
+by (etac prem 1);
+val leCI = result();
+
+val major::prems = goal Ord.thy
+ "[| i le j; i<j ==> P; [| i=j; Ord(j) |] ==> P |] ==> P";
+by (rtac (major RS (le_iff RS iffD1 RS disjE)) 1);
+by (DEPTH_SOLVE (ares_tac prems 1 ORELSE etac conjE 1));
+val leE = result();
+
+goal Ord.thy "!!i j. [| i le j; j le i |] ==> i=j";
+by (asm_full_simp_tac (ZF_ss addsimps [le_iff]) 1);
+by (fast_tac (ZF_cs addEs [lt_anti_sym]) 1);
+val le_asym = result();
+
+goal Ord.thy "i le 0 <-> i=0";
+by (fast_tac (ZF_cs addSIs [Ord_0 RS le_refl] addSEs [leE, lt0E]) 1);
+val le0_iff = result();
+
+val le0D = standard (le0_iff RS iffD1);
+
+val lt_cs =
+ ZF_cs addSIs [le_refl, leCI]
+ addSDs [le0D]
+ addSEs [lt_anti_refl, lt0E, leE];
+
+
(*** Natural Deduction rules for Memrel ***)
goalw Ord.thy [Memrel_def] "<a,b> : Memrel(A) <-> a:b & a:A & b:A";
@@ -240,7 +329,7 @@
(*Finds contradictions for the following proof*)
val Ord_trans_tac = EVERY' [etac notE, etac Ord_trans, REPEAT o atac];
-(** Proving that "member" is a linear ordering on the ordinals **)
+(** Proving that < is a linear ordering on the ordinals **)
val prems = goal Ord.thy
"Ord(i) ==> (ALL j. Ord(j) --> i:j | i=j | j:i)";
@@ -254,124 +343,123 @@
ORELSE Ord_trans_tac 1));
val Ord_linear_lemma = result();
-val ordi::ordj::prems = goal Ord.thy
- "[| Ord(i); Ord(j); i:j ==> P; i=j ==> P; j:i ==> P |] \
-\ ==> P";
-by (rtac (ordi RS Ord_linear_lemma RS spec RS impE) 1);
-by (rtac ordj 1);
-by (REPEAT (eresolve_tac (prems@[asm_rl,disjE]) 1));
-val Ord_linear = result();
+(*The trichotomy law for ordinals!*)
+val ordi::ordj::prems = goalw Ord.thy [lt_def]
+ "[| Ord(i); Ord(j); i<j ==> P; i=j ==> P; j<i ==> P |] ==> P";
+by (rtac ([ordi,ordj] MRS (Ord_linear_lemma RS spec RS impE)) 1);
+by (REPEAT (FIRSTGOAL (etac disjE)));
+by (DEPTH_SOLVE (ares_tac ([ordi,ordj,conjI] @ prems) 1));
+val Ord_linear_lt = result();
val prems = goal Ord.thy
- "[| Ord(i); Ord(j); i<=j ==> P; j<=i ==> P |] \
-\ ==> P";
-by (res_inst_tac [("i","i"),("j","j")] Ord_linear 1);
-by (DEPTH_SOLVE (ares_tac (prems@[subset_refl]) 1
- ORELSE eresolve_tac [asm_rl,OrdmemD,ssubst] 1));
-val Ord_subset = result();
+ "[| Ord(i); Ord(j); i le j ==> P; j le i ==> P |] ==> P";
+by (res_inst_tac [("i","i"),("j","j")] Ord_linear_lt 1);
+by (DEPTH_SOLVE (ares_tac ([leI,le_eqI] @ prems) 1));
+val Ord_linear_le = result();
+
+goal Ord.thy "!!i j. j le i ==> ~ i<j";
+by (fast_tac (lt_cs addEs [lt_anti_sym]) 1);
+val le_imp_not_lt = result();
-goal Ord.thy "!!i j. [| j<=i; ~ i<=j; Ord(i); Ord(j) |] ==> j:i";
-by (etac Ord_linear 1);
-by (REPEAT (ares_tac [subset_refl] 1
- ORELSE eresolve_tac [notE,OrdmemD,ssubst] 1));
-val Ord_member = result();
+goal Ord.thy "!!i j. [| ~ i<j; Ord(i); Ord(j) |] ==> j le i";
+by (res_inst_tac [("i","i"),("j","j")] Ord_linear_le 1);
+by (REPEAT (SOMEGOAL assume_tac));
+by (fast_tac (lt_cs addEs [lt_anti_sym]) 1);
+val not_lt_imp_le = result();
-val [prem] = goal Ord.thy "Ord(i) ==> 0: succ(i)";
-by (rtac (empty_subsetI RS Ord_member) 1);
-by (fast_tac ZF_cs 1);
-by (rtac (prem RS Ord_succ) 1);
-by (rtac Ord_0 1);
-val Ord_0_in_succ = result();
+goal Ord.thy "!!i j. [| Ord(i); Ord(j) |] ==> ~ i<j <-> j le i";
+by (REPEAT (ares_tac [iffI, le_imp_not_lt, not_lt_imp_le] 1));
+val not_lt_iff_le = result();
-goal Ord.thy "!!i j. [| Ord(i); Ord(j) |] ==> j:i <-> j<=i & ~(i<=j)";
-by (rtac iffI 1);
-by (rtac conjI 1);
-by (etac OrdmemD 1);
-by (rtac (mem_anti_refl RS notI) 2);
-by (etac subsetD 2);
-by (REPEAT (eresolve_tac [asm_rl, conjE, Ord_member] 1));
-val Ord_member_iff = result();
+goal Ord.thy "!!i j. [| Ord(i); Ord(j) |] ==> ~ i le j <-> j<i";
+by (asm_simp_tac (ZF_ss addsimps [not_lt_iff_le RS iff_sym]) 1);
+val not_le_iff_lt = result();
+
+goal Ord.thy "!!i. Ord(i) ==> 0 le i";
+by (etac (not_lt_iff_le RS iffD1) 1);
+by (REPEAT (resolve_tac [Ord_0, not_lt0] 1));
+val Ord_0_le = result();
-goal Ord.thy "!!i. Ord(i) ==> 0:i <-> ~ i=0";
-by (etac (Ord_0 RSN (2,Ord_member_iff) RS iff_trans) 1);
-by (fast_tac eq_cs 1);
-val Ord_0_member_iff = result();
-
-(** For ordinals, i: succ(j) means 'less-than or equals' **)
+goal Ord.thy "!!i. [| Ord(i); ~ i=0 |] ==> 0<i";
+by (etac (not_le_iff_lt RS iffD1) 1);
+by (rtac Ord_0 1);
+by (fast_tac lt_cs 1);
+val Ord_0_lt = result();
-goal Ord.thy "!!i j. [| j<=i; Ord(i); Ord(j) |] ==> j : succ(i)";
-by (rtac Ord_member 1);
-by (REPEAT (ares_tac [Ord_succ] 3));
-by (rtac (mem_anti_refl RS notI) 2);
-by (etac subsetD 2);
-by (ALLGOALS (fast_tac ZF_cs));
-val member_succI = result();
+(*** Results about less-than or equals ***)
+
+(** For ordinals, j<=i (subset) implies j le i (less-than or equals) **)
-(*Recall Ord_succ_subsetI, namely [| i:j; Ord(j) |] ==> succ(i) <= j *)
-goalw Ord.thy [Transset_def,Ord_def]
- "!!i j. [| i : succ(j); Ord(j) |] ==> i<=j";
-by (fast_tac ZF_cs 1);
-val member_succD = result();
-
-goal Ord.thy "!!i j. [| Ord(i); Ord(j) |] ==> j:succ(i) <-> j<=i";
-by (fast_tac (subset_cs addSEs [member_succI, member_succD]) 1);
-val member_succ_iff = result();
+goal Ord.thy "!!i j. [| j<=i; Ord(i); Ord(j) |] ==> j le i";
+by (rtac (not_lt_iff_le RS iffD1) 1);
+by (assume_tac 1);
+by (assume_tac 1);
+by (fast_tac (ZF_cs addEs [ltE, mem_anti_refl]) 1);
+val subset_imp_le = result();
-goal Ord.thy
- "!!i j. [| Ord(i); Ord(j) |] ==> i<=succ(j) <-> i<=j | i=succ(j)";
-by (asm_simp_tac (ZF_ss addsimps [member_succ_iff RS iff_sym, Ord_succ]) 1);
-by (fast_tac ZF_cs 1);
-val subset_succ_iff = result();
+goal Ord.thy "!!i j. i le j ==> i<=j";
+by (etac leE 1);
+by (fast_tac ZF_cs 2);
+by (fast_tac (subset_cs addIs [OrdmemD] addEs [ltE]) 1);
+val le_imp_subset = result();
-goal Ord.thy "!!i j. [| i:succ(j); j:k; Ord(k) |] ==> i:k";
-by (fast_tac (ZF_cs addEs [Ord_trans]) 1);
-val Ord_trans1 = result();
+goal Ord.thy "j le i <-> j<=i & Ord(i) & Ord(j)";
+by (fast_tac (ZF_cs addSEs [subset_imp_le, le_imp_subset]
+ addEs [ltE, make_elim Ord_succD]) 1);
+val le_subset_iff = result();
+
+goal Ord.thy "i le succ(j) <-> i le j | i=succ(j) & Ord(i)";
+by (simp_tac (ZF_ss addsimps [le_iff]) 1);
+by (fast_tac (ZF_cs addIs [Ord_succ] addDs [Ord_succD]) 1);
+val le_succ_iff = result();
-goal Ord.thy "!!i j. [| i:j; j:succ(k); Ord(k) |] ==> i:k";
-by (fast_tac (ZF_cs addEs [Ord_trans]) 1);
-val Ord_trans2 = result();
+goal Ord.thy "!!i j. [| i le j; j<k |] ==> i<k";
+by (fast_tac (ZF_cs addEs [leE, lt_trans]) 1);
+val lt_trans1 = result();
-goal Ord.thy "!!i jk. [| i:j; j<=k; Ord(k) |] ==> i:k";
-by (fast_tac (ZF_cs addEs [Ord_trans]) 1);
-val Ord_transsub2 = result();
+goal Ord.thy "!!i j. [| i<j; j le k |] ==> i<k";
+by (fast_tac (ZF_cs addEs [leE, lt_trans]) 1);
+val lt_trans2 = result();
+
+goal Ord.thy "!!i j. [| i le j; j le k |] ==> i le k";
+by (REPEAT (ares_tac [lt_trans1] 1));
+val le_trans = result();
-goal Ord.thy "!!i j. [| i:j; Ord(j) |] ==> succ(i) : succ(j)";
-by (rtac member_succI 1);
-by (REPEAT (ares_tac [subsetI,Ord_succ,Ord_in_Ord] 1
- ORELSE eresolve_tac [succE,Ord_trans,ssubst] 1));
-val succ_mem_succI = result();
+goal Ord.thy "!!i j. i<j ==> succ(i) le j";
+by (rtac (not_lt_iff_le RS iffD1) 1);
+by (fast_tac (lt_cs addEs [lt_anti_sym]) 3);
+by (ALLGOALS (fast_tac (ZF_cs addEs [ltE] addIs [Ord_succ])));
+val succ_leI = result();
-goal Ord.thy "!!i j. [| succ(i) : succ(j); Ord(j) |] ==> i:j";
-by (REPEAT (eresolve_tac [asm_rl, make_elim member_succD, succ_subsetE] 1));
-val succ_mem_succE = result();
+goal Ord.thy "!!i j. succ(i) le j ==> i<j";
+by (rtac (not_le_iff_lt RS iffD1) 1);
+by (fast_tac (lt_cs addEs [lt_anti_sym]) 3);
+by (ALLGOALS (fast_tac (ZF_cs addEs [ltE, make_elim Ord_succD])));
+val succ_leE = result();
-goal Ord.thy "!!i j. Ord(j) ==> succ(i) : succ(j) <-> i:j";
-by (REPEAT (ares_tac [iffI,succ_mem_succI,succ_mem_succE] 1));
-val succ_mem_succ_iff = result();
-
-goal Ord.thy "!!i j. [| i<=j; Ord(i); Ord(j) |] ==> succ(i) <= succ(j)";
-by (rtac (member_succI RS succ_mem_succI RS member_succD) 1);
-by (REPEAT (ares_tac [Ord_succ] 1));
-val Ord_succ_mono = result();
+goal Ord.thy "succ(i) le j <-> i<j";
+by (REPEAT (ares_tac [iffI,succ_leI,succ_leE] 1));
+val succ_le_iff = result();
(** Union and Intersection **)
-goal Ord.thy "!!i j k. [| i:k; j:k; Ord(k) |] ==> i Un j : k";
-by (res_inst_tac [("i","i"),("j","j")] Ord_subset 1);
-by (REPEAT (eresolve_tac [asm_rl, Ord_in_Ord] 1));
-by (asm_simp_tac (ZF_ss addsimps [subset_Un_iff RS iffD1]) 1);
-by (rtac (Un_commute RS ssubst) 1);
-by (asm_simp_tac (ZF_ss addsimps [subset_Un_iff RS iffD1]) 1);
-val Ord_member_UnI = result();
+(*Replacing k by succ(k') yields the similar rule for le!*)
+goal Ord.thy "!!i j k. [| i<k; j<k |] ==> i Un j < k";
+by (res_inst_tac [("i","i"),("j","j")] Ord_linear_le 1);
+by (rtac (Un_commute RS ssubst) 4);
+by (asm_full_simp_tac (ZF_ss addsimps [le_subset_iff, subset_Un_iff]) 4);
+by (asm_full_simp_tac (ZF_ss addsimps [le_subset_iff, subset_Un_iff]) 3);
+by (REPEAT (eresolve_tac [asm_rl, ltE] 1));
+val Un_least_lt = result();
-goal Ord.thy "!!i j k. [| i:k; j:k; Ord(k) |] ==> i Int j : k";
-by (res_inst_tac [("i","i"),("j","j")] Ord_subset 1);
-by (REPEAT (eresolve_tac [asm_rl, Ord_in_Ord] 1));
-by (asm_simp_tac (ZF_ss addsimps [subset_Int_iff RS iffD1]) 1);
-by (rtac (Int_commute RS ssubst) 1);
-by (asm_simp_tac (ZF_ss addsimps [subset_Int_iff RS iffD1]) 1);
-val Ord_member_IntI = result();
-
+(*Replacing k by succ(k') yields the similar rule for le!*)
+goal Ord.thy "!!i j k. [| i<k; j<k |] ==> i Int j < k";
+by (res_inst_tac [("i","i"),("j","j")] Ord_linear_le 1);
+by (rtac (Int_commute RS ssubst) 4);
+by (asm_full_simp_tac (ZF_ss addsimps [le_subset_iff, subset_Int_iff]) 4);
+by (asm_full_simp_tac (ZF_ss addsimps [le_subset_iff, subset_Int_iff]) 3);
+by (REPEAT (eresolve_tac [asm_rl, ltE] 1));
+val Int_greatest_lt = result();
(*** Results about limits ***)
@@ -387,24 +475,29 @@
by (eresolve_tac prems 1);
val Ord_UN = result();
-(*The upper bound must be a successor ordinal --
- consider that (UN i:nat.i)=nat although nat is an upper bound of each i*)
+(* No < version; consider (UN i:nat.i)=nat *)
val [ordi,limit] = goal Ord.thy
- "[| Ord(i); !!y. y:A ==> f(y): succ(i) |] ==> (UN y:A. f(y)) : succ(i)";
-by (rtac (member_succD RS UN_least RS member_succI) 1);
-by (REPEAT (ares_tac [ordi, Ord_UN, ordi RS Ord_succ RS Ord_in_Ord,
- limit] 1));
-val sup_least = result();
+ "[| Ord(i); !!x. x:A ==> b(x) le i |] ==> (UN x:A. b(x)) le i";
+by (rtac (le_imp_subset RS UN_least RS subset_imp_le) 1);
+by (REPEAT (ares_tac [ordi, Ord_UN, limit] 1 ORELSE etac (limit RS ltE) 1));
+val UN_least_le = result();
-val [jmemi,ordi,limit] = goal Ord.thy
- "[| j: i; Ord(i); !!y. y:A ==> f(y): j |] ==> (UN y:A. succ(f(y))) : i";
-by (cut_facts_tac [jmemi RS (ordi RS Ord_in_Ord)] 1);
-by (rtac (sup_least RS Ord_trans2) 1);
-by (REPEAT (ares_tac [jmemi, ordi, succ_mem_succI, limit] 1));
-val sup_least2 = result();
+val [jlti,limit] = goal Ord.thy
+ "[| j<i; !!x. x:A ==> b(x)<j |] ==> (UN x:A. succ(b(x))) < i";
+by (rtac (jlti RS ltE) 1);
+by (rtac (UN_least_le RS lt_trans2) 1);
+by (REPEAT (ares_tac [jlti, succ_leI, limit] 1));
+val UN_succ_least_lt = result();
+
+val prems = goal Ord.thy
+ "[| a: A; i le b(a); !!x. x:A ==> Ord(b(x)) |] ==> i le (UN x:A. b(x))";
+by (resolve_tac (prems RL [ltE]) 1);
+by (rtac (le_imp_subset RS subset_trans RS subset_imp_le) 1);
+by (REPEAT (ares_tac (prems @ [UN_upper, Ord_UN]) 1));
+val UN_upper_le = result();
goal Ord.thy "!!i. Ord(i) ==> (UN y:i. succ(y)) = i";
-by (fast_tac (eq_cs addSEs [Ord_trans1]) 1);
+by (fast_tac (eq_cs addEs [Ord_trans]) 1);
val Ord_equality = result();
(*Holds for all transitive sets, not just ordinals*)
--- a/src/ZF/ord.thy Tue Oct 05 17:49:23 1993 +0100
+++ b/src/ZF/ord.thy Wed Oct 06 09:58:53 1993 +0100
@@ -1,19 +1,25 @@
(* Title: ZF/ordinal.thy
ID: $Id$
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
- Copyright 1992 University of Cambridge
+ Copyright 1993 University of Cambridge
Ordinals in Zermelo-Fraenkel Set Theory
*)
Ord = WF +
consts
- Memrel :: "i=>i"
- Transset,Ord :: "i=>o"
+ Memrel :: "i=>i"
+ Transset,Ord :: "i=>o"
+ "<" :: "[i,i] => o" (infixl 50) (*less than on ordinals*)
+ "le" :: "[i,i] => o" (infixl 50) (*less than or equals*)
+
+translations
+ "x le y" == "x < succ(y)"
rules
Memrel_def "Memrel(A) == {z: A*A . EX x y. z=<x,y> & x:y }"
Transset_def "Transset(i) == ALL x:i. x<=i"
Ord_def "Ord(i) == Transset(i) & (ALL x:i. Transset(x))"
+ lt_def "i<j == i:j & Ord(j)"
end