1.1 --- a/src/HOL/Algebra/poly/PolyHomo.ML Fri Oct 05 21:50:37 2001 +0200
1.2 +++ b/src/HOL/Algebra/poly/PolyHomo.ML Fri Oct 05 21:52:39 2001 +0200
1.3 @@ -112,15 +112,15 @@
1.4 (* Examples *)
1.5
1.6 Goal
1.7 - "EVAL (x::'a::domain) (a*X^2 + b*X^1 + c*X^0) = a * x ^ 2 + b * x ^ 1 + c";
1.8 + "EVAL (x::'a::domain) (a*X^# 2 + b*X^1 + c*X^0) = a * x ^ # 2 + b * x ^ 1 + c";
1.9 by (asm_simp_tac (simpset() delsimps [power_Suc]
1.10 addsimps [EVAL_homo, EVAL_monom, EVAL_smult]) 1);
1.11 result();
1.12
1.13 Goal
1.14 "EVAL (y::'a::domain) \
1.15 -\ (EVAL (const x) (monom 1 + const (a*X^2 + b*X^1 + c*X^0))) = \
1.16 -\ x ^ 1 + (a * y ^ 2 + b * y ^ 1 + c)";
1.17 +\ (EVAL (const x) (monom 1 + const (a*X^# 2 + b*X^1 + c*X^0))) = \
1.18 +\ x ^ 1 + (a * y ^ # 2 + b * y ^ 1 + c)";
1.19 by (asm_simp_tac (simpset() delsimps [power_Suc]
1.20 addsimps [EVAL_homo, EVAL_monom, EVAL_smult, EVAL_const]) 1);
1.21 result();
2.1 --- a/src/HOL/Auth/KerberosIV.thy Fri Oct 05 21:50:37 2001 +0200
2.2 +++ b/src/HOL/Auth/KerberosIV.thy Fri Oct 05 21:52:39 2001 +0200
2.3 @@ -65,10 +65,10 @@
2.4 RespLife :: nat
2.5
2.6 rules
2.7 - AuthLife_LB "#2 <= AuthLife"
2.8 - ServLife_LB "#2 <= ServLife"
2.9 - AutcLife_LB "1' <= AutcLife"
2.10 - RespLife_LB "1' <= RespLife"
2.11 + AuthLife_LB "# 2 <= AuthLife"
2.12 + ServLife_LB "# 2 <= ServLife"
2.13 + AutcLife_LB "Suc 0 <= AutcLife"
2.14 + RespLife_LB "Suc 0 <= RespLife"
2.15
2.16 translations
2.17 "CT" == "length"
3.1 --- a/src/HOL/Auth/Kerberos_BAN.thy Fri Oct 05 21:50:37 2001 +0200
3.2 +++ b/src/HOL/Auth/Kerberos_BAN.thy Fri Oct 05 21:52:39 2001 +0200
3.3 @@ -30,10 +30,10 @@
3.4
3.5 rules
3.6 (*The ticket should remain fresh for two journeys on the network at least*)
3.7 - SesKeyLife_LB "#2 <= SesKeyLife"
3.8 + SesKeyLife_LB "# 2 <= SesKeyLife"
3.9
3.10 (*The authenticator only for one journey*)
3.11 - AutLife_LB "1' <= AutLife"
3.12 + AutLife_LB "Suc 0 <= AutLife"
3.13
3.14 translations
3.15 "CT" == "length"
4.1 --- a/src/HOL/Datatype_Universe.ML Fri Oct 05 21:50:37 2001 +0200
4.2 +++ b/src/HOL/Datatype_Universe.ML Fri Oct 05 21:52:39 2001 +0200
4.3 @@ -80,7 +80,7 @@
4.4
4.5 (** Scons vs Atom **)
4.6
4.7 -Goalw [Atom_def,Scons_def,Push_Node_def,One_def]
4.8 +Goalw [Atom_def,Scons_def,Push_Node_def,One_nat_def]
4.9 "Scons M N ~= Atom(a)";
4.10 by (rtac notI 1);
4.11 by (etac (equalityD2 RS subsetD RS UnE) 1);
4.12 @@ -141,11 +141,11 @@
4.13
4.14 (** Injectiveness of Scons **)
4.15
4.16 -Goalw [Scons_def,One_def] "Scons M N <= Scons M' N' ==> M<=M'";
4.17 +Goalw [Scons_def,One_nat_def] "Scons M N <= Scons M' N' ==> M<=M'";
4.18 by (blast_tac (claset() addSDs [Push_Node_inject]) 1);
4.19 qed "Scons_inject_lemma1";
4.20
4.21 -Goalw [Scons_def,One_def] "Scons M N <= Scons M' N' ==> N<=N'";
4.22 +Goalw [Scons_def,One_nat_def] "Scons M N <= Scons M' N' ==> N<=N'";
4.23 by (blast_tac (claset() addSDs [Push_Node_inject]) 1);
4.24 qed "Scons_inject_lemma2";
4.25
4.26 @@ -252,7 +252,7 @@
4.27 by (rtac ntrunc_Atom 1);
4.28 qed "ntrunc_Numb";
4.29
4.30 -Goalw [Scons_def,ntrunc_def,One_def]
4.31 +Goalw [Scons_def,ntrunc_def,One_nat_def]
4.32 "ntrunc (Suc k) (Scons M N) = Scons (ntrunc k M) (ntrunc k N)";
4.33 by (safe_tac (claset() addSIs [imageI]));
4.34 by (REPEAT (stac ndepth_Push_Node 3 THEN etac Suc_mono 3));
4.35 @@ -266,7 +266,7 @@
4.36
4.37 (** Injection nodes **)
4.38
4.39 -Goalw [In0_def] "ntrunc 1' (In0 M) = {}";
4.40 +Goalw [In0_def] "ntrunc (Suc 0) (In0 M) = {}";
4.41 by (Simp_tac 1);
4.42 by (rewtac Scons_def);
4.43 by (Blast_tac 1);
4.44 @@ -277,7 +277,7 @@
4.45 by (Simp_tac 1);
4.46 qed "ntrunc_In0";
4.47
4.48 -Goalw [In1_def] "ntrunc 1' (In1 M) = {}";
4.49 +Goalw [In1_def] "ntrunc (Suc 0) (In1 M) = {}";
4.50 by (Simp_tac 1);
4.51 by (rewtac Scons_def);
4.52 by (Blast_tac 1);
4.53 @@ -339,7 +339,7 @@
4.54
4.55 (** Injection **)
4.56
4.57 -Goalw [In0_def,In1_def,One_def] "In0(M) ~= In1(N)";
4.58 +Goalw [In0_def,In1_def,One_nat_def] "In0(M) ~= In1(N)";
4.59 by (rtac notI 1);
4.60 by (etac (Scons_inject1 RS Numb_inject RS Zero_neq_Suc) 1);
4.61 qed "In0_not_In1";
5.1 --- a/src/HOL/Datatype_Universe.thy Fri Oct 05 21:50:37 2001 +0200
5.2 +++ b/src/HOL/Datatype_Universe.thy Fri Oct 05 21:52:39 2001 +0200
5.3 @@ -63,7 +63,7 @@
5.4
5.5 (*S-expression constructors*)
5.6 Atom_def "Atom == (%x. {Abs_Node((%k. Inr 0, x))})"
5.7 - Scons_def "Scons M N == (Push_Node (Inr 1) ` M) Un (Push_Node (Inr 2) ` N)"
5.8 + Scons_def "Scons M N == (Push_Node (Inr 1) ` M) Un (Push_Node (Inr (Suc 1)) ` N)"
5.9
5.10 (*Leaf nodes, with arbitrary or nat labels*)
5.11 Leaf_def "Leaf == Atom o Inl"
6.1 --- a/src/HOL/Divides.ML Fri Oct 05 21:50:37 2001 +0200
6.2 +++ b/src/HOL/Divides.ML Fri Oct 05 21:52:39 2001 +0200
6.3 @@ -65,7 +65,7 @@
6.4 by (asm_simp_tac (simpset() addsimps [mod_geq]) 1);
6.5 qed "mod_if";
6.6
6.7 -Goal "m mod 1' = 0";
6.8 +Goal "m mod Suc 0 = 0";
6.9 by (induct_tac "m" 1);
6.10 by (ALLGOALS (asm_simp_tac (simpset() addsimps [mod_geq])));
6.11 qed "mod_1";
6.12 @@ -387,7 +387,7 @@
6.13
6.14 (*** Further facts about div and mod ***)
6.15
6.16 -Goal "m div 1' = m";
6.17 +Goal "m div Suc 0 = m";
6.18 by (induct_tac "m" 1);
6.19 by (ALLGOALS (asm_simp_tac (simpset() addsimps [div_geq])));
6.20 qed "div_1";
6.21 @@ -529,12 +529,12 @@
6.22 qed "dvd_0_left_iff";
6.23 AddIffs [dvd_0_left_iff];
6.24
6.25 -Goalw [dvd_def] "1' dvd k";
6.26 +Goalw [dvd_def] "Suc 0 dvd k";
6.27 by (Simp_tac 1);
6.28 qed "dvd_1_left";
6.29 AddIffs [dvd_1_left];
6.30
6.31 -Goal "(m dvd 1') = (m = 1')";
6.32 +Goal "(m dvd Suc 0) = (m = Suc 0)";
6.33 by (simp_tac (simpset() addsimps [dvd_def]) 1);
6.34 qed "dvd_1_iff_1";
6.35 Addsimps [dvd_1_iff_1];
6.36 @@ -615,14 +615,14 @@
6.37 by (asm_full_simp_tac (simpset() addsimps mult_ac) 1);
6.38 qed "dvd_mult_cancel";
6.39
6.40 -Goal "0<m ==> (m*n dvd m) = (n=1)";
6.41 +Goal "0<m ==> (m*n dvd m) = (n = (1::nat))";
6.42 by Auto_tac;
6.43 by (subgoal_tac "m*n dvd m*1" 1);
6.44 by (dtac dvd_mult_cancel 1);
6.45 by Auto_tac;
6.46 qed "dvd_mult_cancel1";
6.47
6.48 -Goal "0<m ==> (n*m dvd m) = (n=1)";
6.49 +Goal "0<m ==> (n*m dvd m) = (n = (1::nat))";
6.50 by (stac mult_commute 1);
6.51 by (etac dvd_mult_cancel1 1);
6.52 qed "dvd_mult_cancel2";
7.1 --- a/src/HOL/Finite.ML Fri Oct 05 21:50:37 2001 +0200
7.2 +++ b/src/HOL/Finite.ML Fri Oct 05 21:52:39 2001 +0200
7.3 @@ -490,7 +490,7 @@
7.4
7.5 (*** Cardinality of the Powerset ***)
7.6
7.7 -Goal "finite A ==> card (Pow A) = 2 ^ card A";
7.8 +Goal "finite A ==> card (Pow A) = Suc (Suc 0) ^ card A"; (* FIXME numeral 2 (!?) *)
7.9 by (etac finite_induct 1);
7.10 by (ALLGOALS (asm_simp_tac (simpset() addsimps [Pow_insert])));
7.11 by (stac card_Un_disjoint 1);
8.1 --- a/src/HOL/GroupTheory/Exponent.ML Fri Oct 05 21:50:37 2001 +0200
8.2 +++ b/src/HOL/GroupTheory/Exponent.ML Fri Oct 05 21:52:39 2001 +0200
8.3 @@ -8,11 +8,11 @@
8.4
8.5 val prime_def = thm "prime_def";
8.6
8.7 -Goalw [prime_def] "p\\<in>prime ==> 1' < p";
8.8 +Goalw [prime_def] "p\\<in>prime ==> Suc 0 < p";
8.9 by (force_tac (claset(), simpset() addsimps []) 1);
8.10 qed "prime_imp_one_less";
8.11
8.12 -Goal "(p\\<in>prime) = (1'<p & (\\<forall>a b. p dvd a*b --> (p dvd a) | (p dvd b)))";
8.13 +Goal "(p\\<in>prime) = (Suc 0 < p & (\\<forall>a b. p dvd a*b --> (p dvd a) | (p dvd b)))";
8.14 by (auto_tac (claset(), simpset() addsimps [prime_imp_one_less]));
8.15 by (blast_tac (claset() addSDs [thm "prime_dvd_mult"]) 1);
8.16 by (auto_tac (claset(), simpset() addsimps [prime_def]));
8.17 @@ -201,24 +201,24 @@
8.18 qed "div_combine";
8.19
8.20 (*Lemma for power_dvd_bound*)
8.21 -Goal "1' < p ==> Suc n <= p^n";
8.22 +Goal "Suc 0 < p ==> Suc n <= p^n";
8.23 by (induct_tac "n" 1);
8.24 by (Asm_simp_tac 1);
8.25 by (Asm_full_simp_tac 1);
8.26 -by (subgoal_tac "2*n + #2 <= p * p^n" 1);
8.27 +by (subgoal_tac "# 2 * n + # 2 <= p * p^n" 1);
8.28 by (Asm_full_simp_tac 1);
8.29 -by (subgoal_tac "#2 * p^n <= p * p^n" 1);
8.30 +by (subgoal_tac "# 2 * p^n <= p * p^n" 1);
8.31 (*?arith_tac should handle all of this!*)
8.32 by (rtac order_trans 1);
8.33 by (assume_tac 2);
8.34 -by (dres_inst_tac [("k","#2")] mult_le_mono2 1);
8.35 +by (dres_inst_tac [("k","# 2")] mult_le_mono2 1);
8.36 by (Asm_full_simp_tac 1);
8.37 by (rtac mult_le_mono1 1);
8.38 by (Asm_full_simp_tac 1);
8.39 qed "Suc_le_power";
8.40
8.41 (*An upper bound for the n such that p^n dvd a: needed for GREATEST to exist*)
8.42 -Goal "[|p^n dvd a; 1' < p; 0 < a|] ==> n < a";
8.43 +Goal "[|p^n dvd a; Suc 0 < p; 0 < a|] ==> n < a";
8.44 by (dtac dvd_imp_le 1);
8.45 by (dres_inst_tac [("n","n")] Suc_le_power 2);
8.46 by Auto_tac;
8.47 @@ -267,7 +267,7 @@
8.48 Addsimps [exponent_eq_0];
8.49
8.50
8.51 -(* exponent_mult_add, easy inclusion. Could weaken p\\<in>prime to 1'<p *)
8.52 +(* exponent_mult_add, easy inclusion. Could weaken p\\<in>prime to Suc 0 < p *)
8.53 Goal "[| 0 < a; 0 < b |] \
8.54 \ ==> (exponent p a) + (exponent p b) <= exponent p (a * b)";
8.55 by (case_tac "p \\<in> prime" 1);
8.56 @@ -312,7 +312,7 @@
8.57 by (auto_tac (claset() addDs [dvd_mult_left], simpset()));
8.58 qed "not_divides_exponent_0";
8.59
8.60 -Goal "exponent p 1' = 0";
8.61 +Goal "exponent p (Suc 0) = 0";
8.62 by (case_tac "p \\<in> prime" 1);
8.63 by (auto_tac (claset(),
8.64 simpset() addsimps [prime_iff, not_divides_exponent_0]));
8.65 @@ -357,7 +357,7 @@
8.66
8.67
8.68 Goal "[| 0 < (k::nat); k < p^a; 0 < p; (p^r) dvd (p^a) - k |] ==> r <= a";
8.69 -by (res_inst_tac [("m","1'")] p_fac_forw_lemma 1);
8.70 +by (res_inst_tac [("m","Suc 0")] p_fac_forw_lemma 1);
8.71 by Auto_tac;
8.72 qed "r_le_a_forw";
8.73
8.74 @@ -422,7 +422,7 @@
8.75 qed "p_not_div_choose";
8.76
8.77
8.78 -Goal "0 < m ==> exponent p ((p^a * m - 1') choose (p^a - 1')) = 0";
8.79 +Goal "0 < m ==> exponent p ((p^a * m - Suc 0) choose (p^a - Suc 0)) = 0";
8.80 by (case_tac "p \\<in> prime" 1);
8.81 by (Asm_simp_tac 2);
8.82 by (forw_inst_tac [("a","a")] zero_less_prime_power 1);
9.1 --- a/src/HOL/Hoare/Arith2.ML Fri Oct 05 21:50:37 2001 +0200
9.2 +++ b/src/HOL/Hoare/Arith2.ML Fri Oct 05 21:52:39 2001 +0200
9.3 @@ -63,7 +63,7 @@
9.4
9.5 (*** pow ***)
9.6
9.7 -Goal "m mod #2 = 0 ==> ((n::nat)*n)^(m div #2) = n^m";
9.8 +Goal "m mod # 2 = 0 ==> ((n::nat)*n)^(m div # 2) = n^m";
9.9 by (asm_simp_tac (simpset() addsimps [power_two RS sym, power_mult RS sym,
9.10 mult_div_cancel]) 1);
9.11 qed "sq_pow_div2";
10.1 --- a/src/HOL/Hoare/Examples.ML Fri Oct 05 21:50:37 2001 +0200
10.2 +++ b/src/HOL/Hoare/Examples.ML Fri Oct 05 21:52:39 2001 +0200
10.3 @@ -13,7 +13,7 @@
10.4 \ m := 0; s := 0; \
10.5 \ WHILE m~=a \
10.6 \ INV {s=m*b & a=A & b=B} \
10.7 -\ DO s := s+b; m := m+1 OD \
10.8 +\ DO s := s+b; m := m+(1::nat) OD \
10.9 \ {s = A*B}";
10.10 by (hoare_tac (Asm_full_simp_tac) 1);
10.11 qed "multiply_by_add";
10.12 @@ -50,9 +50,9 @@
10.13 Goal "|- VARS a b x y. \
10.14 \ {0<A & 0<B & a=A & b=B & x=B & y=A} \
10.15 \ WHILE a ~= b \
10.16 -\ INV {0<a & 0<b & gcd A B = gcd a b & #2*A*B = a*x + b*y} \
10.17 +\ INV {0<a & 0<b & gcd A B = gcd a b & # 2*A*B = a*x + b*y} \
10.18 \ DO IF a<b THEN (b := b-a; x := x+y) ELSE (a := a-b; y := y+x) FI OD \
10.19 -\ {a = gcd A B & #2*A*B = a*(x+y)}";
10.20 +\ {a = gcd A B & # 2*A*B = a*(x+y)}";
10.21 by (hoare_tac (K all_tac) 1);
10.22 by(Asm_simp_tac 1);
10.23 by(asm_simp_tac (simpset() addsimps
10.24 @@ -65,13 +65,13 @@
10.25
10.26 Goal "|- VARS a b c. \
10.27 \ {a=A & b=B} \
10.28 -\ c := 1; \
10.29 +\ c := (1::nat); \
10.30 \ WHILE b ~= 0 \
10.31 \ INV {A^B = c * a^b} \
10.32 -\ DO WHILE b mod #2 = 0 \
10.33 +\ DO WHILE b mod # 2 = 0 \
10.34 \ INV {A^B = c * a^b} \
10.35 -\ DO a := a*a; b := b div #2 OD; \
10.36 -\ c := c*a; b := b-1 \
10.37 +\ DO a := a*a; b := b div # 2 OD; \
10.38 +\ c := c*a; b := b - 1 \
10.39 \ OD \
10.40 \ {c = A^B}";
10.41 by (hoare_tac (Asm_full_simp_tac) 1);
10.42 @@ -87,7 +87,7 @@
10.43 \ b := 1; \
10.44 \ WHILE a ~= 0 \
10.45 \ INV {fac A = b * fac a} \
10.46 -\ DO b := b*a; a := a-1 OD \
10.47 +\ DO b := b*a; a := a - 1 OD \
10.48 \ {b = fac A}";
10.49 by (hoare_tac (asm_full_simp_tac (simpset() addsplits [nat_diff_split])) 1);
10.50 by Auto_tac;
10.51 @@ -99,7 +99,7 @@
10.52
10.53 Goal "|- VARS r x. \
10.54 \ {True} \
10.55 -\ x := X; r := 0; \
10.56 +\ x := X; r := (0::nat); \
10.57 \ WHILE (r+1)*(r+1) <= x \
10.58 \ INV {r*r <= x & x=X} \
10.59 \ DO r := r+1 OD \
10.60 @@ -111,10 +111,10 @@
10.61
10.62 Goal "|- VARS u w r x. \
10.63 \ {True} \
10.64 -\ x := X; u := 1; w := 1; r := 0; \
10.65 +\ x := X; u := 1; w := 1; r := (0::nat); \
10.66 \ WHILE w <= x \
10.67 \ INV {u = r+r+1 & w = (r+1)*(r+1) & r*r <= x & x=X} \
10.68 -\ DO r := r+1; w := w+u+2; u := u+2 OD \
10.69 +\ DO r := r + 1; w := w + u + # 2; u := u + # 2 OD \
10.70 \ {r*r <= X & X < (r+1)*(r+1)}";
10.71 by (hoare_tac (SELECT_GOAL Auto_tac) 1);
10.72 qed "sqrt_without_multiplication";
10.73 @@ -175,7 +175,7 @@
10.74 Ambiguity warnings of parser are due to := being used
10.75 both for assignment and list update.
10.76 *)
10.77 -Goal "m - 1' < n ==> m < Suc n";
10.78 +Goal "m - Suc 0 < n ==> m < Suc n";
10.79 by (arith_tac 1);
10.80 qed "lemma";
10.81
10.82 @@ -184,7 +184,7 @@
10.83 \ geq == %A i. !k. i<k & k<length A --> pivot <= A!k |] ==> \
10.84 \ |- VARS A u l.\
10.85 \ {0 < length(A::('a::order)list)} \
10.86 -\ l := 0; u := length A - 1'; \
10.87 +\ l := 0; u := length A - Suc 0; \
10.88 \ WHILE l <= u \
10.89 \ INV {leq A l & geq A u & u<length A & l<=length A} \
10.90 \ DO WHILE l < length A & A!l <= pivot \
10.91 @@ -192,7 +192,7 @@
10.92 \ DO l := l+1 OD; \
10.93 \ WHILE 0 < u & pivot <= A!u \
10.94 \ INV {leq A l & geq A u & u<length A & l<=length A} \
10.95 -\ DO u := u-1 OD; \
10.96 +\ DO u := u - 1 OD; \
10.97 \ IF l <= u THEN A := A[l := A!u, u := A!l] ELSE SKIP FI \
10.98 \ OD \
10.99 \ {leq A u & (!k. u<k & k<l --> A!k = pivot) & geq A l}";
11.1 --- a/src/HOL/Hyperreal/HRealAbs.ML Fri Oct 05 21:50:37 2001 +0200
11.2 +++ b/src/HOL/Hyperreal/HRealAbs.ML Fri Oct 05 21:52:39 2001 +0200
11.3 @@ -32,28 +32,28 @@
11.4 (adapted version of previously proved theorems about abs)
11.5 ------------------------------------------------------------*)
11.6
11.7 -Goal "abs (#0::hypreal) = #0";
11.8 +Goal "abs (Numeral0::hypreal) = Numeral0";
11.9 by (simp_tac (simpset() addsimps [hrabs_def]) 1);
11.10 qed "hrabs_zero";
11.11 Addsimps [hrabs_zero];
11.12
11.13 -Goal "(#0::hypreal)<=x ==> abs x = x";
11.14 +Goal "(Numeral0::hypreal)<=x ==> abs x = x";
11.15 by (asm_simp_tac (simpset() addsimps [hrabs_def]) 1);
11.16 qed "hrabs_eqI1";
11.17
11.18 -Goal "(#0::hypreal)<x ==> abs x = x";
11.19 +Goal "(Numeral0::hypreal)<x ==> abs x = x";
11.20 by (asm_simp_tac (simpset() addsimps [order_less_imp_le, hrabs_eqI1]) 1);
11.21 qed "hrabs_eqI2";
11.22
11.23 -Goal "x<(#0::hypreal) ==> abs x = -x";
11.24 +Goal "x<(Numeral0::hypreal) ==> abs x = -x";
11.25 by (asm_simp_tac (simpset() addsimps [hypreal_le_def, hrabs_def]) 1);
11.26 qed "hrabs_minus_eqI2";
11.27
11.28 -Goal "x<=(#0::hypreal) ==> abs x = -x";
11.29 +Goal "x<=(Numeral0::hypreal) ==> abs x = -x";
11.30 by (auto_tac (claset() addDs [order_antisym], simpset() addsimps [hrabs_def]));
11.31 qed "hrabs_minus_eqI1";
11.32
11.33 -Goal "(#0::hypreal)<= abs x";
11.34 +Goal "(Numeral0::hypreal)<= abs x";
11.35 by (auto_tac (claset() addDs [hypreal_minus_zero_less_iff RS iffD2,
11.36 hypreal_less_asym],
11.37 simpset() addsimps [hypreal_le_def, hrabs_def]));
11.38 @@ -66,7 +66,7 @@
11.39 qed "hrabs_idempotent";
11.40 Addsimps [hrabs_idempotent];
11.41
11.42 -Goalw [hrabs_def] "(abs x = (#0::hypreal)) = (x=#0)";
11.43 +Goalw [hrabs_def] "(abs x = (Numeral0::hypreal)) = (x=Numeral0)";
11.44 by (Simp_tac 1);
11.45 qed "hrabs_zero_iff";
11.46 AddIffs [hrabs_zero_iff];
11.47 @@ -90,7 +90,7 @@
11.48 Addsimps [hrabs_mult];
11.49
11.50 Goal "abs(inverse(x)) = inverse(abs(x::hypreal))";
11.51 -by (hypreal_div_undefined_case_tac "x=#0" 1);
11.52 +by (hypreal_div_undefined_case_tac "x=Numeral0" 1);
11.53 by (simp_tac (simpset() addsimps [HYPREAL_DIVIDE_ZERO]) 1);
11.54 by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
11.55 by (auto_tac (claset(),
11.56 @@ -128,10 +128,10 @@
11.57 qed "hrabs_add_less";
11.58
11.59 Goal "[| abs x<r; abs y<s |] ==> abs x * abs y < r * (s::hypreal)";
11.60 -by (subgoal_tac "#0 < r" 1);
11.61 +by (subgoal_tac "Numeral0 < r" 1);
11.62 by (asm_full_simp_tac (simpset() addsimps [hrabs_def]
11.63 addsplits [split_if_asm]) 2);
11.64 -by (case_tac "y = #0" 1);
11.65 +by (case_tac "y = Numeral0" 1);
11.66 by (asm_full_simp_tac (simpset() addsimps [hypreal_0_less_mult_iff]) 1);
11.67 by (rtac hypreal_mult_less_mono 1);
11.68 by (auto_tac (claset(),
11.69 @@ -139,18 +139,18 @@
11.70 addsplits [split_if_asm]));
11.71 qed "hrabs_mult_less";
11.72
11.73 -Goal "((#0::hypreal) < abs x) = (x ~= 0)";
11.74 +Goal "((Numeral0::hypreal) < abs x) = (x ~= 0)";
11.75 by (simp_tac (simpset() addsimps [hrabs_def]) 1);
11.76 by (arith_tac 1);
11.77 qed "hypreal_0_less_abs_iff";
11.78 Addsimps [hypreal_0_less_abs_iff];
11.79
11.80 -Goal "abs x < r ==> (#0::hypreal) < r";
11.81 +Goal "abs x < r ==> (Numeral0::hypreal) < r";
11.82 by (blast_tac (claset() addSIs [order_le_less_trans, hrabs_ge_zero]) 1);
11.83 qed "hrabs_less_gt_zero";
11.84
11.85 Goal "abs x = (x::hypreal) | abs x = -x";
11.86 -by (cut_inst_tac [("x","#0"),("y","x")] hypreal_linear 1);
11.87 +by (cut_inst_tac [("x","Numeral0"),("y","x")] hypreal_linear 1);
11.88 by (fast_tac (claset() addIs [hrabs_eqI2,hrabs_minus_eqI2,
11.89 hrabs_zero]) 1);
11.90 qed "hrabs_disj";
11.91 @@ -247,13 +247,13 @@
11.92
11.93 (*"neg" is used in rewrite rules for binary comparisons*)
11.94 Goal "hypreal_of_nat (number_of v :: nat) = \
11.95 -\ (if neg (number_of v) then #0 \
11.96 +\ (if neg (number_of v) then Numeral0 \
11.97 \ else (number_of v :: hypreal))";
11.98 by (simp_tac (simpset() addsimps [hypreal_of_nat_def]) 1);
11.99 qed "hypreal_of_nat_number_of";
11.100 Addsimps [hypreal_of_nat_number_of];
11.101
11.102 -Goal "hypreal_of_nat 0 = #0";
11.103 +Goal "hypreal_of_nat 0 = Numeral0";
11.104 by (simp_tac (simpset() delsimps [numeral_0_eq_0]
11.105 addsimps [numeral_0_eq_0 RS sym]) 1);
11.106 qed "hypreal_of_nat_zero";
12.1 --- a/src/HOL/Hyperreal/HSeries.ML Fri Oct 05 21:50:37 2001 +0200
12.2 +++ b/src/HOL/Hyperreal/HSeries.ML Fri Oct 05 21:52:39 2001 +0200
12.3 @@ -35,7 +35,7 @@
12.4
12.5 (* Theorem corresponding to base case in def of sumr *)
12.6 Goalw [hypnat_zero_def]
12.7 - "sumhr (m,0,f) = #0";
12.8 + "sumhr (m,0,f) = Numeral0";
12.9 by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
12.10 by (auto_tac (claset(),
12.11 simpset() addsimps [sumhr, symmetric hypreal_zero_def]));
12.12 @@ -44,7 +44,7 @@
12.13
12.14 (* Theorem corresponding to recursive case in def of sumr *)
12.15 Goalw [hypnat_one_def]
12.16 - "sumhr(m,n+1hn,f) = (if n + 1hn <= m then #0 \
12.17 + "sumhr(m,n+1hn,f) = (if n + 1hn <= m then Numeral0 \
12.18 \ else sumhr(m,n,f) + (*fNat* f) n)";
12.19 by (simp_tac (HOL_ss addsimps
12.20 [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1);
12.21 @@ -55,7 +55,7 @@
12.22 by (ALLGOALS(Ultra_tac));
12.23 qed "sumhr_if";
12.24
12.25 -Goalw [hypnat_one_def] "sumhr (n + 1hn, n, f) = #0";
12.26 +Goalw [hypnat_one_def] "sumhr (n + 1hn, n, f) = Numeral0";
12.27 by (simp_tac (HOL_ss addsimps
12.28 [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1);
12.29 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
12.30 @@ -64,7 +64,7 @@
12.31 qed "sumhr_Suc_zero";
12.32 Addsimps [sumhr_Suc_zero];
12.33
12.34 -Goal "sumhr (n,n,f) = #0";
12.35 +Goal "sumhr (n,n,f) = Numeral0";
12.36 by (simp_tac (HOL_ss addsimps
12.37 [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1);
12.38 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
12.39 @@ -80,7 +80,7 @@
12.40 qed "sumhr_Suc";
12.41 Addsimps [sumhr_Suc];
12.42
12.43 -Goal "sumhr(m+k,k,f) = #0";
12.44 +Goal "sumhr(m+k,k,f) = Numeral0";
12.45 by (simp_tac (HOL_ss addsimps
12.46 [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1);
12.47 by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
12.48 @@ -156,7 +156,7 @@
12.49 hypreal_minus,sumr_add RS sym]) 1);
12.50 qed "sumhr_add_mult_const";
12.51
12.52 -Goal "n < m ==> sumhr (m,n,f) = #0";
12.53 +Goal "n < m ==> sumhr (m,n,f) = Numeral0";
12.54 by (simp_tac (HOL_ss addsimps
12.55 [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1);
12.56 by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
12.57 @@ -185,13 +185,13 @@
12.58 by summing to some infinite hypernatural (such as whn)
12.59 -----------------------------------------------------------------*)
12.60 Goalw [hypnat_omega_def,hypnat_zero_def]
12.61 - "sumhr(0,whn,%i. #1) = hypreal_of_hypnat whn";
12.62 + "sumhr(0,whn,%i. Numeral1) = hypreal_of_hypnat whn";
12.63 by (auto_tac (claset(),
12.64 simpset() addsimps [sumhr, hypreal_of_hypnat]));
12.65 qed "sumhr_hypreal_of_hypnat_omega";
12.66
12.67 Goalw [hypnat_omega_def,hypnat_zero_def,omega_def]
12.68 - "sumhr(0, whn, %i. #1) = omega - #1";
12.69 + "sumhr(0, whn, %i. Numeral1) = omega - Numeral1";
12.70 by (simp_tac (HOL_ss addsimps
12.71 [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
12.72 by (auto_tac (claset(),
12.73 @@ -199,7 +199,7 @@
12.74 qed "sumhr_hypreal_omega_minus_one";
12.75
12.76 Goalw [hypnat_zero_def, hypnat_omega_def]
12.77 - "sumhr(0, whn + whn, %i. (-#1) ^ (i+1)) = #0";
12.78 + "sumhr(0, whn + whn, %i. (-Numeral1) ^ (i+1)) = Numeral0";
12.79 by (simp_tac (HOL_ss addsimps
12.80 [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1);
12.81 by (simp_tac (simpset() addsimps [sumhr,hypnat_add,double_lemma]
12.82 @@ -223,7 +223,7 @@
12.83 qed "starfunNat_sumr";
12.84
12.85 Goal "sumhr (0, M, f) @= sumhr (0, N, f) \
12.86 -\ ==> abs (sumhr (M, N, f)) @= #0";
12.87 +\ ==> abs (sumhr (M, N, f)) @= Numeral0";
12.88 by (cut_inst_tac [("x","M"),("y","N")] hypnat_linear 1);
12.89 by (auto_tac (claset(), simpset() addsimps [approx_refl]));
12.90 by (dtac (approx_sym RS (approx_minus_iff RS iffD1)) 1);
12.91 @@ -265,12 +265,12 @@
12.92 sums_unique]) 1);
12.93 qed "NSsums_unique";
12.94
12.95 -Goal "ALL m. n <= Suc m --> f(m) = #0 ==> f NSsums (sumr 0 n f)";
12.96 +Goal "ALL m. n <= Suc m --> f(m) = Numeral0 ==> f NSsums (sumr 0 n f)";
12.97 by (asm_simp_tac (simpset() addsimps [sums_NSsums_iff RS sym, series_zero]) 1);
12.98 qed "NSseries_zero";
12.99
12.100 Goal "NSsummable f = \
12.101 -\ (ALL M: HNatInfinite. ALL N: HNatInfinite. abs (sumhr(M,N,f)) @= #0)";
12.102 +\ (ALL M: HNatInfinite. ALL N: HNatInfinite. abs (sumhr(M,N,f)) @= Numeral0)";
12.103 by (auto_tac (claset(),
12.104 simpset() addsimps [summable_NSsummable_iff RS sym,
12.105 summable_convergent_sumr_iff, convergent_NSconvergent_iff,
12.106 @@ -287,7 +287,7 @@
12.107 (*-------------------------------------------------------------------
12.108 Terms of a convergent series tend to zero
12.109 -------------------------------------------------------------------*)
12.110 -Goalw [NSLIMSEQ_def] "NSsummable f ==> f ----NS> #0";
12.111 +Goalw [NSLIMSEQ_def] "NSsummable f ==> f ----NS> Numeral0";
12.112 by (auto_tac (claset(), simpset() addsimps [NSsummable_NSCauchy]));
12.113 by (dtac bspec 1 THEN Auto_tac);
12.114 by (dres_inst_tac [("x","N + 1hn")] bspec 1);
12.115 @@ -297,7 +297,7 @@
12.116 qed "NSsummable_NSLIMSEQ_zero";
12.117
12.118 (* Easy to prove stsandard case now *)
12.119 -Goal "summable f ==> f ----> #0";
12.120 +Goal "summable f ==> f ----> Numeral0";
12.121 by (auto_tac (claset(),
12.122 simpset() addsimps [summable_NSsummable_iff,
12.123 LIMSEQ_NSLIMSEQ_iff, NSsummable_NSLIMSEQ_zero]));
13.1 --- a/src/HOL/Hyperreal/HyperArith0.ML Fri Oct 05 21:50:37 2001 +0200
13.2 +++ b/src/HOL/Hyperreal/HyperArith0.ML Fri Oct 05 21:52:39 2001 +0200
13.3 @@ -8,7 +8,7 @@
13.4 Also, common factor cancellation
13.5 *)
13.6
13.7 -Goal "((x * y = #0) = (x = #0 | y = (#0::hypreal)))";
13.8 +Goal "((x * y = Numeral0) = (x = Numeral0 | y = (Numeral0::hypreal)))";
13.9 by Auto_tac;
13.10 by (cut_inst_tac [("x","x"),("y","y")] hypreal_mult_zero_disj 1);
13.11 by Auto_tac;
13.12 @@ -17,13 +17,13 @@
13.13
13.14 (** Division and inverse **)
13.15
13.16 -Goal "#0/x = (#0::hypreal)";
13.17 +Goal "Numeral0/x = (Numeral0::hypreal)";
13.18 by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1);
13.19 qed "hypreal_0_divide";
13.20 Addsimps [hypreal_0_divide];
13.21
13.22 -Goal "((#0::hypreal) < inverse x) = (#0 < x)";
13.23 -by (case_tac "x=#0" 1);
13.24 +Goal "((Numeral0::hypreal) < inverse x) = (Numeral0 < x)";
13.25 +by (case_tac "x=Numeral0" 1);
13.26 by (asm_simp_tac (HOL_ss addsimps [rename_numerals HYPREAL_INVERSE_ZERO]) 1);
13.27 by (auto_tac (claset() addDs [hypreal_inverse_less_0],
13.28 simpset() addsimps [linorder_neq_iff,
13.29 @@ -31,8 +31,8 @@
13.30 qed "hypreal_0_less_inverse_iff";
13.31 Addsimps [hypreal_0_less_inverse_iff];
13.32
13.33 -Goal "(inverse x < (#0::hypreal)) = (x < #0)";
13.34 -by (case_tac "x=#0" 1);
13.35 +Goal "(inverse x < (Numeral0::hypreal)) = (x < Numeral0)";
13.36 +by (case_tac "x=Numeral0" 1);
13.37 by (asm_simp_tac (HOL_ss addsimps [rename_numerals HYPREAL_INVERSE_ZERO]) 1);
13.38 by (auto_tac (claset() addDs [hypreal_inverse_less_0],
13.39 simpset() addsimps [linorder_neq_iff,
13.40 @@ -40,49 +40,49 @@
13.41 qed "hypreal_inverse_less_0_iff";
13.42 Addsimps [hypreal_inverse_less_0_iff];
13.43
13.44 -Goal "((#0::hypreal) <= inverse x) = (#0 <= x)";
13.45 +Goal "((Numeral0::hypreal) <= inverse x) = (Numeral0 <= x)";
13.46 by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1);
13.47 qed "hypreal_0_le_inverse_iff";
13.48 Addsimps [hypreal_0_le_inverse_iff];
13.49
13.50 -Goal "(inverse x <= (#0::hypreal)) = (x <= #0)";
13.51 +Goal "(inverse x <= (Numeral0::hypreal)) = (x <= Numeral0)";
13.52 by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1);
13.53 qed "hypreal_inverse_le_0_iff";
13.54 Addsimps [hypreal_inverse_le_0_iff];
13.55
13.56 -Goalw [hypreal_divide_def] "x/(#0::hypreal) = #0";
13.57 +Goalw [hypreal_divide_def] "x/(Numeral0::hypreal) = Numeral0";
13.58 by (stac (rename_numerals HYPREAL_INVERSE_ZERO) 1);
13.59 by (Simp_tac 1);
13.60 qed "HYPREAL_DIVIDE_ZERO";
13.61
13.62 -Goal "inverse (x::hypreal) = #1/x";
13.63 +Goal "inverse (x::hypreal) = Numeral1/x";
13.64 by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1);
13.65 qed "hypreal_inverse_eq_divide";
13.66
13.67 -Goal "((#0::hypreal) < x/y) = (#0 < x & #0 < y | x < #0 & y < #0)";
13.68 +Goal "((Numeral0::hypreal) < x/y) = (Numeral0 < x & Numeral0 < y | x < Numeral0 & y < Numeral0)";
13.69 by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_0_less_mult_iff]) 1);
13.70 qed "hypreal_0_less_divide_iff";
13.71 Addsimps [inst "x" "number_of ?w" hypreal_0_less_divide_iff];
13.72
13.73 -Goal "(x/y < (#0::hypreal)) = (#0 < x & y < #0 | x < #0 & #0 < y)";
13.74 +Goal "(x/y < (Numeral0::hypreal)) = (Numeral0 < x & y < Numeral0 | x < Numeral0 & Numeral0 < y)";
13.75 by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_less_0_iff]) 1);
13.76 qed "hypreal_divide_less_0_iff";
13.77 Addsimps [inst "x" "number_of ?w" hypreal_divide_less_0_iff];
13.78
13.79 -Goal "((#0::hypreal) <= x/y) = ((x <= #0 | #0 <= y) & (#0 <= x | y <= #0))";
13.80 +Goal "((Numeral0::hypreal) <= x/y) = ((x <= Numeral0 | Numeral0 <= y) & (Numeral0 <= x | y <= Numeral0))";
13.81 by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_0_le_mult_iff]) 1);
13.82 by Auto_tac;
13.83 qed "hypreal_0_le_divide_iff";
13.84 Addsimps [inst "x" "number_of ?w" hypreal_0_le_divide_iff];
13.85
13.86 -Goal "(x/y <= (#0::hypreal)) = ((x <= #0 | y <= #0) & (#0 <= x | #0 <= y))";
13.87 +Goal "(x/y <= (Numeral0::hypreal)) = ((x <= Numeral0 | y <= Numeral0) & (Numeral0 <= x | Numeral0 <= y))";
13.88 by (simp_tac (simpset() addsimps [hypreal_divide_def,
13.89 hypreal_mult_le_0_iff]) 1);
13.90 by Auto_tac;
13.91 qed "hypreal_divide_le_0_iff";
13.92 Addsimps [inst "x" "number_of ?w" hypreal_divide_le_0_iff];
13.93
13.94 -Goal "(inverse(x::hypreal) = #0) = (x = #0)";
13.95 +Goal "(inverse(x::hypreal) = Numeral0) = (x = Numeral0)";
13.96 by (auto_tac (claset(),
13.97 simpset() addsimps [rename_numerals HYPREAL_INVERSE_ZERO]));
13.98 by (rtac ccontr 1);
13.99 @@ -90,12 +90,12 @@
13.100 qed "hypreal_inverse_zero_iff";
13.101 Addsimps [hypreal_inverse_zero_iff];
13.102
13.103 -Goal "(x/y = #0) = (x=#0 | y=(#0::hypreal))";
13.104 +Goal "(x/y = Numeral0) = (x=Numeral0 | y=(Numeral0::hypreal))";
13.105 by (auto_tac (claset(), simpset() addsimps [hypreal_divide_def]));
13.106 qed "hypreal_divide_eq_0_iff";
13.107 Addsimps [hypreal_divide_eq_0_iff];
13.108
13.109 -Goal "h ~= (#0::hypreal) ==> h/h = #1";
13.110 +Goal "h ~= (Numeral0::hypreal) ==> h/h = Numeral1";
13.111 by (asm_simp_tac
13.112 (simpset() addsimps [hypreal_divide_def, hypreal_mult_inverse_left]) 1);
13.113 qed "hypreal_divide_self_eq";
13.114 @@ -140,7 +140,7 @@
13.115 by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [hypreal_mult_commute])));
13.116 qed "hypreal_mult_le_mono2_neg";
13.117
13.118 -Goal "(m*k < n*k) = (((#0::hypreal) < k & m<n) | (k < #0 & n<m))";
13.119 +Goal "(m*k < n*k) = (((Numeral0::hypreal) < k & m<n) | (k < Numeral0 & n<m))";
13.120 by (case_tac "k = (0::hypreal)" 1);
13.121 by (auto_tac (claset(),
13.122 simpset() addsimps [linorder_neq_iff,
13.123 @@ -155,32 +155,32 @@
13.124 hypreal_mult_le_mono1_neg]));
13.125 qed "hypreal_mult_less_cancel2";
13.126
13.127 -Goal "(m*k <= n*k) = (((#0::hypreal) < k --> m<=n) & (k < #0 --> n<=m))";
13.128 +Goal "(m*k <= n*k) = (((Numeral0::hypreal) < k --> m<=n) & (k < Numeral0 --> n<=m))";
13.129 by (simp_tac (simpset() addsimps [linorder_not_less RS sym,
13.130 hypreal_mult_less_cancel2]) 1);
13.131 qed "hypreal_mult_le_cancel2";
13.132
13.133 -Goal "(k*m < k*n) = (((#0::hypreal) < k & m<n) | (k < #0 & n<m))";
13.134 +Goal "(k*m < k*n) = (((Numeral0::hypreal) < k & m<n) | (k < Numeral0 & n<m))";
13.135 by (simp_tac (simpset() addsimps [inst "z" "k" hypreal_mult_commute,
13.136 hypreal_mult_less_cancel2]) 1);
13.137 qed "hypreal_mult_less_cancel1";
13.138
13.139 -Goal "!!k::hypreal. (k*m <= k*n) = ((#0 < k --> m<=n) & (k < #0 --> n<=m))";
13.140 +Goal "!!k::hypreal. (k*m <= k*n) = ((Numeral0 < k --> m<=n) & (k < Numeral0 --> n<=m))";
13.141 by (simp_tac (simpset() addsimps [linorder_not_less RS sym,
13.142 hypreal_mult_less_cancel1]) 1);
13.143 qed "hypreal_mult_le_cancel1";
13.144
13.145 -Goal "!!k::hypreal. (k*m = k*n) = (k = #0 | m=n)";
13.146 +Goal "!!k::hypreal. (k*m = k*n) = (k = Numeral0 | m=n)";
13.147 by (case_tac "k=0" 1);
13.148 by (auto_tac (claset(), simpset() addsimps [hypreal_mult_left_cancel]));
13.149 qed "hypreal_mult_eq_cancel1";
13.150
13.151 -Goal "!!k::hypreal. (m*k = n*k) = (k = #0 | m=n)";
13.152 +Goal "!!k::hypreal. (m*k = n*k) = (k = Numeral0 | m=n)";
13.153 by (case_tac "k=0" 1);
13.154 by (auto_tac (claset(), simpset() addsimps [hypreal_mult_right_cancel]));
13.155 qed "hypreal_mult_eq_cancel2";
13.156
13.157 -Goal "!!k::hypreal. k~=#0 ==> (k*m) / (k*n) = (m/n)";
13.158 +Goal "!!k::hypreal. k~=Numeral0 ==> (k*m) / (k*n) = (m/n)";
13.159 by (asm_simp_tac
13.160 (simpset() addsimps [hypreal_divide_def, hypreal_inverse_distrib]) 1);
13.161 by (subgoal_tac "k * m * (inverse k * inverse n) = \
13.162 @@ -190,7 +190,7 @@
13.163 qed "hypreal_mult_div_cancel1";
13.164
13.165 (*For ExtractCommonTerm*)
13.166 -Goal "(k*m) / (k*n) = (if k = (#0::hypreal) then #0 else m/n)";
13.167 +Goal "(k*m) / (k*n) = (if k = (Numeral0::hypreal) then Numeral0 else m/n)";
13.168 by (simp_tac (simpset() addsimps [hypreal_mult_div_cancel1]) 1);
13.169 qed "hypreal_mult_div_cancel_disj";
13.170
13.171 @@ -288,34 +288,34 @@
13.172 set trace_simp;
13.173 fun test s = (Goal s; by (Simp_tac 1));
13.174
13.175 -test "#0 <= (y::hypreal) * #-2";
13.176 -test "#9*x = #12 * (y::hypreal)";
13.177 -test "(#9*x) / (#12 * (y::hypreal)) = z";
13.178 -test "#9*x < #12 * (y::hypreal)";
13.179 -test "#9*x <= #12 * (y::hypreal)";
13.180 +test "Numeral0 <= (y::hypreal) * # -2";
13.181 +test "# 9*x = # 12 * (y::hypreal)";
13.182 +test "(# 9*x) / (# 12 * (y::hypreal)) = z";
13.183 +test "# 9*x < # 12 * (y::hypreal)";
13.184 +test "# 9*x <= # 12 * (y::hypreal)";
13.185
13.186 -test "#-99*x = #132 * (y::hypreal)";
13.187 -test "(#-99*x) / (#132 * (y::hypreal)) = z";
13.188 -test "#-99*x < #132 * (y::hypreal)";
13.189 -test "#-99*x <= #132 * (y::hypreal)";
13.190 +test "# -99*x = # 123 * (y::hypreal)";
13.191 +test "(# -99*x) / (# 123 * (y::hypreal)) = z";
13.192 +test "# -99*x < # 123 * (y::hypreal)";
13.193 +test "# -99*x <= # 123 * (y::hypreal)";
13.194
13.195 -test "#999*x = #-396 * (y::hypreal)";
13.196 -test "(#999*x) / (#-396 * (y::hypreal)) = z";
13.197 -test "#999*x < #-396 * (y::hypreal)";
13.198 -test "#999*x <= #-396 * (y::hypreal)";
13.199 +test "# 999*x = # -396 * (y::hypreal)";
13.200 +test "(# 999*x) / (# -396 * (y::hypreal)) = z";
13.201 +test "# 999*x < # -396 * (y::hypreal)";
13.202 +test "# 999*x <= # -396 * (y::hypreal)";
13.203
13.204 -test "#-99*x = #-81 * (y::hypreal)";
13.205 -test "(#-99*x) / (#-81 * (y::hypreal)) = z";
13.206 -test "#-99*x <= #-81 * (y::hypreal)";
13.207 -test "#-99*x < #-81 * (y::hypreal)";
13.208 +test "# -99*x = # -81 * (y::hypreal)";
13.209 +test "(# -99*x) / (# -81 * (y::hypreal)) = z";
13.210 +test "# -99*x <= # -81 * (y::hypreal)";
13.211 +test "# -99*x < # -81 * (y::hypreal)";
13.212
13.213 -test "#-2 * x = #-1 * (y::hypreal)";
13.214 -test "#-2 * x = -(y::hypreal)";
13.215 -test "(#-2 * x) / (#-1 * (y::hypreal)) = z";
13.216 -test "#-2 * x < -(y::hypreal)";
13.217 -test "#-2 * x <= #-1 * (y::hypreal)";
13.218 -test "-x < #-23 * (y::hypreal)";
13.219 -test "-x <= #-23 * (y::hypreal)";
13.220 +test "# -2 * x = # -1 * (y::hypreal)";
13.221 +test "# -2 * x = -(y::hypreal)";
13.222 +test "(# -2 * x) / (# -1 * (y::hypreal)) = z";
13.223 +test "# -2 * x < -(y::hypreal)";
13.224 +test "# -2 * x <= # -1 * (y::hypreal)";
13.225 +test "-x < # -23 * (y::hypreal)";
13.226 +test "-x <= # -23 * (y::hypreal)";
13.227 *)
13.228
13.229
13.230 @@ -391,7 +391,7 @@
13.231
13.232 (*** Simplification of inequalities involving literal divisors ***)
13.233
13.234 -Goal "#0<z ==> ((x::hypreal) <= y/z) = (x*z <= y)";
13.235 +Goal "Numeral0<z ==> ((x::hypreal) <= y/z) = (x*z <= y)";
13.236 by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
13.237 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.238 by (etac ssubst 1);
13.239 @@ -400,7 +400,7 @@
13.240 qed "pos_hypreal_le_divide_eq";
13.241 Addsimps [inst "z" "number_of ?w" pos_hypreal_le_divide_eq];
13.242
13.243 -Goal "z<#0 ==> ((x::hypreal) <= y/z) = (y <= x*z)";
13.244 +Goal "z<Numeral0 ==> ((x::hypreal) <= y/z) = (y <= x*z)";
13.245 by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
13.246 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.247 by (etac ssubst 1);
13.248 @@ -409,7 +409,7 @@
13.249 qed "neg_hypreal_le_divide_eq";
13.250 Addsimps [inst "z" "number_of ?w" neg_hypreal_le_divide_eq];
13.251
13.252 -Goal "#0<z ==> (y/z <= (x::hypreal)) = (y <= x*z)";
13.253 +Goal "Numeral0<z ==> (y/z <= (x::hypreal)) = (y <= x*z)";
13.254 by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
13.255 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.256 by (etac ssubst 1);
13.257 @@ -418,7 +418,7 @@
13.258 qed "pos_hypreal_divide_le_eq";
13.259 Addsimps [inst "z" "number_of ?w" pos_hypreal_divide_le_eq];
13.260
13.261 -Goal "z<#0 ==> (y/z <= (x::hypreal)) = (x*z <= y)";
13.262 +Goal "z<Numeral0 ==> (y/z <= (x::hypreal)) = (x*z <= y)";
13.263 by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
13.264 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.265 by (etac ssubst 1);
13.266 @@ -427,7 +427,7 @@
13.267 qed "neg_hypreal_divide_le_eq";
13.268 Addsimps [inst "z" "number_of ?w" neg_hypreal_divide_le_eq];
13.269
13.270 -Goal "#0<z ==> ((x::hypreal) < y/z) = (x*z < y)";
13.271 +Goal "Numeral0<z ==> ((x::hypreal) < y/z) = (x*z < y)";
13.272 by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
13.273 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.274 by (etac ssubst 1);
13.275 @@ -436,7 +436,7 @@
13.276 qed "pos_hypreal_less_divide_eq";
13.277 Addsimps [inst "z" "number_of ?w" pos_hypreal_less_divide_eq];
13.278
13.279 -Goal "z<#0 ==> ((x::hypreal) < y/z) = (y < x*z)";
13.280 +Goal "z<Numeral0 ==> ((x::hypreal) < y/z) = (y < x*z)";
13.281 by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
13.282 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.283 by (etac ssubst 1);
13.284 @@ -445,7 +445,7 @@
13.285 qed "neg_hypreal_less_divide_eq";
13.286 Addsimps [inst "z" "number_of ?w" neg_hypreal_less_divide_eq];
13.287
13.288 -Goal "#0<z ==> (y/z < (x::hypreal)) = (y < x*z)";
13.289 +Goal "Numeral0<z ==> (y/z < (x::hypreal)) = (y < x*z)";
13.290 by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
13.291 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.292 by (etac ssubst 1);
13.293 @@ -454,7 +454,7 @@
13.294 qed "pos_hypreal_divide_less_eq";
13.295 Addsimps [inst "z" "number_of ?w" pos_hypreal_divide_less_eq];
13.296
13.297 -Goal "z<#0 ==> (y/z < (x::hypreal)) = (x*z < y)";
13.298 +Goal "z<Numeral0 ==> (y/z < (x::hypreal)) = (x*z < y)";
13.299 by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
13.300 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.301 by (etac ssubst 1);
13.302 @@ -463,7 +463,7 @@
13.303 qed "neg_hypreal_divide_less_eq";
13.304 Addsimps [inst "z" "number_of ?w" neg_hypreal_divide_less_eq];
13.305
13.306 -Goal "z~=#0 ==> ((x::hypreal) = y/z) = (x*z = y)";
13.307 +Goal "z~=Numeral0 ==> ((x::hypreal) = y/z) = (x*z = y)";
13.308 by (subgoal_tac "(x*z = y) = (x*z = (y/z)*z)" 1);
13.309 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.310 by (etac ssubst 1);
13.311 @@ -472,7 +472,7 @@
13.312 qed "hypreal_eq_divide_eq";
13.313 Addsimps [inst "z" "number_of ?w" hypreal_eq_divide_eq];
13.314
13.315 -Goal "z~=#0 ==> (y/z = (x::hypreal)) = (y = x*z)";
13.316 +Goal "z~=Numeral0 ==> (y/z = (x::hypreal)) = (y = x*z)";
13.317 by (subgoal_tac "(y = x*z) = ((y/z)*z = x*z)" 1);
13.318 by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2);
13.319 by (etac ssubst 1);
13.320 @@ -481,21 +481,21 @@
13.321 qed "hypreal_divide_eq_eq";
13.322 Addsimps [inst "z" "number_of ?w" hypreal_divide_eq_eq];
13.323
13.324 -Goal "(m/k = n/k) = (k = #0 | m = (n::hypreal))";
13.325 -by (case_tac "k=#0" 1);
13.326 +Goal "(m/k = n/k) = (k = Numeral0 | m = (n::hypreal))";
13.327 +by (case_tac "k=Numeral0" 1);
13.328 by (asm_simp_tac (simpset() addsimps [HYPREAL_DIVIDE_ZERO]) 1);
13.329 by (asm_simp_tac (simpset() addsimps [hypreal_divide_eq_eq, hypreal_eq_divide_eq,
13.330 hypreal_mult_eq_cancel2]) 1);
13.331 qed "hypreal_divide_eq_cancel2";
13.332
13.333 -Goal "(k/m = k/n) = (k = #0 | m = (n::hypreal))";
13.334 -by (case_tac "m=#0 | n = #0" 1);
13.335 +Goal "(k/m = k/n) = (k = Numeral0 | m = (n::hypreal))";
13.336 +by (case_tac "m=Numeral0 | n = Numeral0" 1);
13.337 by (auto_tac (claset(),
13.338 simpset() addsimps [HYPREAL_DIVIDE_ZERO, hypreal_divide_eq_eq,
13.339 hypreal_eq_divide_eq, hypreal_mult_eq_cancel1]));
13.340 qed "hypreal_divide_eq_cancel1";
13.341
13.342 -Goal "[| #0 < r; #0 < x|] ==> (inverse x < inverse (r::hypreal)) = (r < x)";
13.343 +Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x < inverse (r::hypreal)) = (r < x)";
13.344 by (auto_tac (claset() addIs [hypreal_inverse_less_swap], simpset()));
13.345 by (res_inst_tac [("t","r")] (hypreal_inverse_inverse RS subst) 1);
13.346 by (res_inst_tac [("t","x")] (hypreal_inverse_inverse RS subst) 1);
13.347 @@ -504,30 +504,30 @@
13.348 addsimps [hypreal_inverse_gt_zero]));
13.349 qed "hypreal_inverse_less_iff";
13.350
13.351 -Goal "[| #0 < r; #0 < x|] ==> (inverse x <= inverse r) = (r <= (x::hypreal))";
13.352 +Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x <= inverse r) = (r <= (x::hypreal))";
13.353 by (asm_simp_tac (simpset() addsimps [linorder_not_less RS sym,
13.354 hypreal_inverse_less_iff]) 1);
13.355 qed "hypreal_inverse_le_iff";
13.356
13.357 (** Division by 1, -1 **)
13.358
13.359 -Goal "(x::hypreal)/#1 = x";
13.360 +Goal "(x::hypreal)/Numeral1 = x";
13.361 by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1);
13.362 qed "hypreal_divide_1";
13.363 Addsimps [hypreal_divide_1];
13.364
13.365 -Goal "x/#-1 = -(x::hypreal)";
13.366 +Goal "x/# -1 = -(x::hypreal)";
13.367 by (Simp_tac 1);
13.368 qed "hypreal_divide_minus1";
13.369 Addsimps [hypreal_divide_minus1];
13.370
13.371 -Goal "#-1/(x::hypreal) = - (#1/x)";
13.372 +Goal "# -1/(x::hypreal) = - (Numeral1/x)";
13.373 by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_minus_inverse]) 1);
13.374 qed "hypreal_minus1_divide";
13.375 Addsimps [hypreal_minus1_divide];
13.376
13.377 -Goal "[| (#0::hypreal) < d1; #0 < d2 |] ==> EX e. #0 < e & e < d1 & e < d2";
13.378 -by (res_inst_tac [("x","(min d1 d2)/#2")] exI 1);
13.379 +Goal "[| (Numeral0::hypreal) < d1; Numeral0 < d2 |] ==> EX e. Numeral0 < e & e < d1 & e < d2";
13.380 +by (res_inst_tac [("x","(min d1 d2)/# 2")] exI 1);
13.381 by (asm_simp_tac (simpset() addsimps [min_def]) 1);
13.382 qed "hypreal_lbound_gt_zero";
13.383
13.384 @@ -560,7 +560,7 @@
13.385 by Auto_tac;
13.386 qed "hypreal_minus_equation";
13.387
13.388 -Goal "(x + - a = (#0::hypreal)) = (x=a)";
13.389 +Goal "(x + - a = (Numeral0::hypreal)) = (x=a)";
13.390 by (arith_tac 1);
13.391 qed "hypreal_add_minus_iff";
13.392 Addsimps [hypreal_add_minus_iff];
13.393 @@ -588,44 +588,44 @@
13.394 [hypreal_minus_less, hypreal_minus_le, hypreal_minus_equation]);
13.395
13.396
13.397 -(*** Simprules combining x+y and #0 ***)
13.398 +(*** Simprules combining x+y and Numeral0 ***)
13.399
13.400 -Goal "(x+y = (#0::hypreal)) = (y = -x)";
13.401 +Goal "(x+y = (Numeral0::hypreal)) = (y = -x)";
13.402 by Auto_tac;
13.403 qed "hypreal_add_eq_0_iff";
13.404 AddIffs [hypreal_add_eq_0_iff];
13.405
13.406 -Goal "(x+y < (#0::hypreal)) = (y < -x)";
13.407 +Goal "(x+y < (Numeral0::hypreal)) = (y < -x)";
13.408 by Auto_tac;
13.409 qed "hypreal_add_less_0_iff";
13.410 AddIffs [hypreal_add_less_0_iff];
13.411
13.412 -Goal "((#0::hypreal) < x+y) = (-x < y)";
13.413 +Goal "((Numeral0::hypreal) < x+y) = (-x < y)";
13.414 by Auto_tac;
13.415 qed "hypreal_0_less_add_iff";
13.416 AddIffs [hypreal_0_less_add_iff];
13.417
13.418 -Goal "(x+y <= (#0::hypreal)) = (y <= -x)";
13.419 +Goal "(x+y <= (Numeral0::hypreal)) = (y <= -x)";
13.420 by Auto_tac;
13.421 qed "hypreal_add_le_0_iff";
13.422 AddIffs [hypreal_add_le_0_iff];
13.423
13.424 -Goal "((#0::hypreal) <= x+y) = (-x <= y)";
13.425 +Goal "((Numeral0::hypreal) <= x+y) = (-x <= y)";
13.426 by Auto_tac;
13.427 qed "hypreal_0_le_add_iff";
13.428 AddIffs [hypreal_0_le_add_iff];
13.429
13.430
13.431 -(** Simprules combining x-y and #0; see also hypreal_less_iff_diff_less_0 etc
13.432 +(** Simprules combining x-y and Numeral0; see also hypreal_less_iff_diff_less_0 etc
13.433 in HyperBin
13.434 **)
13.435
13.436 -Goal "((#0::hypreal) < x-y) = (y < x)";
13.437 +Goal "((Numeral0::hypreal) < x-y) = (y < x)";
13.438 by Auto_tac;
13.439 qed "hypreal_0_less_diff_iff";
13.440 AddIffs [hypreal_0_less_diff_iff];
13.441
13.442 -Goal "((#0::hypreal) <= x-y) = (y <= x)";
13.443 +Goal "((Numeral0::hypreal) <= x-y) = (y <= x)";
13.444 by Auto_tac;
13.445 qed "hypreal_0_le_diff_iff";
13.446 AddIffs [hypreal_0_le_diff_iff];
13.447 @@ -644,11 +644,11 @@
13.448
13.449 (*** Density of the Hyperreals ***)
13.450
13.451 -Goal "x < y ==> x < (x+y) / (#2::hypreal)";
13.452 +Goal "x < y ==> x < (x+y) / (# 2::hypreal)";
13.453 by Auto_tac;
13.454 qed "hypreal_less_half_sum";
13.455
13.456 -Goal "x < y ==> (x+y)/(#2::hypreal) < y";
13.457 +Goal "x < y ==> (x+y)/(# 2::hypreal) < y";
13.458 by Auto_tac;
13.459 qed "hypreal_gt_half_sum";
13.460
13.461 @@ -657,7 +657,7 @@
13.462 qed "hypreal_dense";
13.463
13.464
13.465 -(*Replaces "inverse #nn" by #1/#nn *)
13.466 +(*Replaces "inverse #nn" by Numeral1/#nn *)
13.467 Addsimps [inst "x" "number_of ?w" hypreal_inverse_eq_divide];
13.468
13.469
14.1 --- a/src/HOL/Hyperreal/HyperBin.ML Fri Oct 05 21:50:37 2001 +0200
14.2 +++ b/src/HOL/Hyperreal/HyperBin.ML Fri Oct 05 21:52:39 2001 +0200
14.3 @@ -13,11 +13,11 @@
14.4 qed "hypreal_number_of";
14.5 Addsimps [hypreal_number_of];
14.6
14.7 -Goalw [hypreal_number_of_def] "(0::hypreal) = #0";
14.8 +Goalw [hypreal_number_of_def] "(0::hypreal) = Numeral0";
14.9 by (simp_tac (simpset() addsimps [hypreal_of_real_zero RS sym]) 1);
14.10 qed "zero_eq_numeral_0";
14.11
14.12 -Goalw [hypreal_number_of_def] "1hr = #1";
14.13 +Goalw [hypreal_number_of_def] "1hr = Numeral1";
14.14 by (simp_tac (simpset() addsimps [hypreal_of_real_one RS sym]) 1);
14.15 qed "one_eq_numeral_1";
14.16
14.17 @@ -57,18 +57,18 @@
14.18 qed "mult_hypreal_number_of";
14.19 Addsimps [mult_hypreal_number_of];
14.20
14.21 -Goal "(#2::hypreal) = #1 + #1";
14.22 +Goal "(# 2::hypreal) = Numeral1 + Numeral1";
14.23 by (Simp_tac 1);
14.24 val lemma = result();
14.25
14.26 (*For specialist use: NOT as default simprules*)
14.27 -Goal "#2 * z = (z+z::hypreal)";
14.28 +Goal "# 2 * z = (z+z::hypreal)";
14.29 by (simp_tac (simpset ()
14.30 addsimps [lemma, hypreal_add_mult_distrib,
14.31 one_eq_numeral_1 RS sym]) 1);
14.32 qed "hypreal_mult_2";
14.33
14.34 -Goal "z * #2 = (z+z::hypreal)";
14.35 +Goal "z * # 2 = (z+z::hypreal)";
14.36 by (stac hypreal_mult_commute 1 THEN rtac hypreal_mult_2 1);
14.37 qed "hypreal_mult_2_right";
14.38
14.39 @@ -107,11 +107,11 @@
14.40
14.41 (*** New versions of existing theorems involving 0, 1hr ***)
14.42
14.43 -Goal "- #1 = (#-1::hypreal)";
14.44 +Goal "- Numeral1 = (# -1::hypreal)";
14.45 by (Simp_tac 1);
14.46 qed "minus_numeral_one";
14.47
14.48 -(*Maps 0 to #0 and 1hr to #1 and -1hr to #-1*)
14.49 +(*Maps 0 to Numeral0 and 1hr to Numeral1 and -1hr to # -1*)
14.50 val hypreal_numeral_ss =
14.51 real_numeral_ss addsimps [zero_eq_numeral_0, one_eq_numeral_1,
14.52 minus_numeral_one];
14.53 @@ -176,15 +176,15 @@
14.54
14.55 (** Combining of literal coefficients in sums of products **)
14.56
14.57 -Goal "(x < y) = (x-y < (#0::hypreal))";
14.58 +Goal "(x < y) = (x-y < (Numeral0::hypreal))";
14.59 by (simp_tac (simpset() addsimps [hypreal_diff_less_eq]) 1);
14.60 qed "hypreal_less_iff_diff_less_0";
14.61
14.62 -Goal "(x = y) = (x-y = (#0::hypreal))";
14.63 +Goal "(x = y) = (x-y = (Numeral0::hypreal))";
14.64 by (simp_tac (simpset() addsimps [hypreal_diff_eq_eq]) 1);
14.65 qed "hypreal_eq_iff_diff_eq_0";
14.66
14.67 -Goal "(x <= y) = (x-y <= (#0::hypreal))";
14.68 +Goal "(x <= y) = (x-y <= (Numeral0::hypreal))";
14.69 by (simp_tac (simpset() addsimps [hypreal_diff_le_eq]) 1);
14.70 qed "hypreal_le_iff_diff_le_0";
14.71
14.72 @@ -242,14 +242,14 @@
14.73 hypreal_add_ac@rel_iff_rel_0_rls) 1);
14.74 qed "hypreal_le_add_iff2";
14.75
14.76 -Goal "(z::hypreal) * #-1 = -z";
14.77 +Goal "(z::hypreal) * # -1 = -z";
14.78 by (stac (minus_numeral_one RS sym) 1);
14.79 by (stac (hypreal_minus_mult_eq2 RS sym) 1);
14.80 by Auto_tac;
14.81 qed "hypreal_mult_minus_1_right";
14.82 Addsimps [hypreal_mult_minus_1_right];
14.83
14.84 -Goal "#-1 * (z::hypreal) = -z";
14.85 +Goal "# -1 * (z::hypreal) = -z";
14.86 by (simp_tac (simpset() addsimps [hypreal_mult_commute]) 1);
14.87 qed "hypreal_mult_minus_1";
14.88 Addsimps [hypreal_mult_minus_1];
14.89 @@ -275,7 +275,7 @@
14.90
14.91 val uminus_const = Const ("uminus", hyprealT --> hyprealT);
14.92
14.93 -(*Thus mk_sum[t] yields t+#0; longer sums don't have a trailing zero*)
14.94 +(*Thus mk_sum[t] yields t+Numeral0; longer sums don't have a trailing zero*)
14.95 fun mk_sum [] = zero
14.96 | mk_sum [t,u] = mk_plus (t, u)
14.97 | mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
14.98 @@ -335,7 +335,7 @@
14.99 handle TERM _ => find_first_coeff (t::past) u terms;
14.100
14.101
14.102 -(*Simplify #1*n and n*#1 to n*)
14.103 +(*Simplify Numeral1*n and n*Numeral1 to n*)
14.104 val add_0s = map rename_numerals
14.105 [hypreal_add_zero_left, hypreal_add_zero_right];
14.106 val mult_plus_1s = map rename_numerals
14.107 @@ -471,7 +471,7 @@
14.108 structure CombineNumeralsData =
14.109 struct
14.110 val add = op + : int*int -> int
14.111 - val mk_sum = long_mk_sum (*to work for e.g. #2*x + #3*x *)
14.112 + val mk_sum = long_mk_sum (*to work for e.g. # 2*x + # 3*x *)
14.113 val dest_sum = dest_sum
14.114 val mk_coeff = mk_coeff
14.115 val dest_coeff = dest_coeff 1
14.116 @@ -530,34 +530,34 @@
14.117 set trace_simp;
14.118 fun test s = (Goal s, by (Simp_tac 1));
14.119
14.120 -test "l + #2 + #2 + #2 + (l + #2) + (oo + #2) = (uu::hypreal)";
14.121 -test "#2*u = (u::hypreal)";
14.122 -test "(i + j + #12 + (k::hypreal)) - #15 = y";
14.123 -test "(i + j + #12 + (k::hypreal)) - #5 = y";
14.124 +test "l + # 2 + # 2 + # 2 + (l + # 2) + (oo + # 2) = (uu::hypreal)";
14.125 +test "# 2*u = (u::hypreal)";
14.126 +test "(i + j + # 12 + (k::hypreal)) - # 15 = y";
14.127 +test "(i + j + # 12 + (k::hypreal)) - # 5 = y";
14.128
14.129 test "y - b < (b::hypreal)";
14.130 -test "y - (#3*b + c) < (b::hypreal) - #2*c";
14.131 +test "y - (# 3*b + c) < (b::hypreal) - # 2*c";
14.132
14.133 -test "(#2*x - (u*v) + y) - v*#3*u = (w::hypreal)";
14.134 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u*#4 = (w::hypreal)";
14.135 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u = (w::hypreal)";
14.136 -test "u*v - (x*u*v + (u*v)*#4 + y) = (w::hypreal)";
14.137 +test "(# 2*x - (u*v) + y) - v*# 3*u = (w::hypreal)";
14.138 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u*# 4 = (w::hypreal)";
14.139 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u = (w::hypreal)";
14.140 +test "u*v - (x*u*v + (u*v)*# 4 + y) = (w::hypreal)";
14.141
14.142 -test "(i + j + #12 + (k::hypreal)) = u + #15 + y";
14.143 -test "(i + j*#2 + #12 + (k::hypreal)) = j + #5 + y";
14.144 +test "(i + j + # 12 + (k::hypreal)) = u + # 15 + y";
14.145 +test "(i + j*# 2 + # 12 + (k::hypreal)) = j + # 5 + y";
14.146
14.147 -test "#2*y + #3*z + #6*w + #2*y + #3*z + #2*u = #2*y' + #3*z' + #6*w' + #2*y' + #3*z' + u + (vv::hypreal)";
14.148 +test "# 2*y + # 3*z + # 6*w + # 2*y + # 3*z + # 2*u = # 2*y' + # 3*z' + # 6*w' + # 2*y' + # 3*z' + u + (vv::hypreal)";
14.149
14.150 test "a + -(b+c) + b = (d::hypreal)";
14.151 test "a + -(b+c) - b = (d::hypreal)";
14.152
14.153 (*negative numerals*)
14.154 -test "(i + j + #-2 + (k::hypreal)) - (u + #5 + y) = zz";
14.155 -test "(i + j + #-3 + (k::hypreal)) < u + #5 + y";
14.156 -test "(i + j + #3 + (k::hypreal)) < u + #-6 + y";
14.157 -test "(i + j + #-12 + (k::hypreal)) - #15 = y";
14.158 -test "(i + j + #12 + (k::hypreal)) - #-15 = y";
14.159 -test "(i + j + #-12 + (k::hypreal)) - #-15 = y";
14.160 +test "(i + j + # -2 + (k::hypreal)) - (u + # 5 + y) = zz";
14.161 +test "(i + j + # -3 + (k::hypreal)) < u + # 5 + y";
14.162 +test "(i + j + # 3 + (k::hypreal)) < u + # -6 + y";
14.163 +test "(i + j + # -12 + (k::hypreal)) - # 15 = y";
14.164 +test "(i + j + # 12 + (k::hypreal)) - # -15 = y";
14.165 +test "(i + j + # -12 + (k::hypreal)) - # -15 = y";
14.166 *)
14.167
14.168
15.1 --- a/src/HOL/Hyperreal/HyperDef.ML Fri Oct 05 21:50:37 2001 +0200
15.2 +++ b/src/HOL/Hyperreal/HyperDef.ML Fri Oct 05 21:52:39 2001 +0200
15.3 @@ -304,7 +304,7 @@
15.4 by (asm_full_simp_tac (simpset() addsimps [hypreal_minus_minus]) 1);
15.5 qed "inj_hypreal_minus";
15.6
15.7 -Goalw [hypreal_zero_def] "-0 = (0::hypreal)";
15.8 +Goalw [hypreal_zero_def] "- 0 = (0::hypreal)";
15.9 by (simp_tac (simpset() addsimps [hypreal_minus]) 1);
15.10 qed "hypreal_minus_zero";
15.11 Addsimps [hypreal_minus_zero];
15.12 @@ -622,13 +622,13 @@
15.13 (**** multiplicative inverse on hypreal ****)
15.14
15.15 Goalw [congruent_def]
15.16 - "congruent hyprel (%X. hyprel``{%n. if X n = #0 then #0 else inverse(X n)})";
15.17 + "congruent hyprel (%X. hyprel``{%n. if X n = Numeral0 then Numeral0 else inverse(X n)})";
15.18 by (Auto_tac THEN Ultra_tac 1);
15.19 qed "hypreal_inverse_congruent";
15.20
15.21 Goalw [hypreal_inverse_def]
15.22 "inverse (Abs_hypreal(hyprel``{%n. X n})) = \
15.23 -\ Abs_hypreal(hyprel `` {%n. if X n = #0 then #0 else inverse(X n)})";
15.24 +\ Abs_hypreal(hyprel `` {%n. if X n = Numeral0 then Numeral0 else inverse(X n)})";
15.25 by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
15.26 by (simp_tac (simpset() addsimps
15.27 [hyprel_in_hypreal RS Abs_hypreal_inverse,
15.28 @@ -840,8 +840,8 @@
15.29 Trichotomy of the hyperreals
15.30 --------------------------------------------------------------------------------*)
15.31
15.32 -Goalw [hyprel_def] "EX x. x: hyprel `` {%n. #0}";
15.33 -by (res_inst_tac [("x","%n. #0")] exI 1);
15.34 +Goalw [hyprel_def] "EX x. x: hyprel `` {%n. Numeral0}";
15.35 +by (res_inst_tac [("x","%n. Numeral0")] exI 1);
15.36 by (Step_tac 1);
15.37 by (auto_tac (claset() addSIs [FreeUltrafilterNat_Nat_set], simpset()));
15.38 qed "lemma_hyprel_0r_mem";
15.39 @@ -1101,22 +1101,22 @@
15.40 (*DON'T insert this or the next one as default simprules.
15.41 They are used in both orientations and anyway aren't the ones we finally
15.42 need, which would use binary literals.*)
15.43 -Goalw [hypreal_of_real_def,hypreal_one_def] "hypreal_of_real #1 = 1hr";
15.44 +Goalw [hypreal_of_real_def,hypreal_one_def] "hypreal_of_real Numeral1 = 1hr";
15.45 by (Step_tac 1);
15.46 qed "hypreal_of_real_one";
15.47
15.48 -Goalw [hypreal_of_real_def,hypreal_zero_def] "hypreal_of_real #0 = 0";
15.49 +Goalw [hypreal_of_real_def,hypreal_zero_def] "hypreal_of_real Numeral0 = 0";
15.50 by (Step_tac 1);
15.51 qed "hypreal_of_real_zero";
15.52
15.53 -Goal "(hypreal_of_real r = 0) = (r = #0)";
15.54 +Goal "(hypreal_of_real r = 0) = (r = Numeral0)";
15.55 by (auto_tac (claset() addIs [FreeUltrafilterNat_P],
15.56 simpset() addsimps [hypreal_of_real_def,
15.57 hypreal_zero_def,FreeUltrafilterNat_Nat_set]));
15.58 qed "hypreal_of_real_zero_iff";
15.59
15.60 Goal "hypreal_of_real (inverse r) = inverse (hypreal_of_real r)";
15.61 -by (case_tac "r=#0" 1);
15.62 +by (case_tac "r=Numeral0" 1);
15.63 by (asm_simp_tac (simpset() addsimps [REAL_DIVIDE_ZERO, INVERSE_ZERO,
15.64 HYPREAL_INVERSE_ZERO, hypreal_of_real_zero]) 1);
15.65 by (res_inst_tac [("c1","hypreal_of_real r")]
16.1 --- a/src/HOL/Hyperreal/HyperDef.thy Fri Oct 05 21:50:37 2001 +0200
16.2 +++ b/src/HOL/Hyperreal/HyperDef.thy Fri Oct 05 21:52:39 2001 +0200
16.3 @@ -35,10 +35,10 @@
16.4 defs
16.5
16.6 hypreal_zero_def
16.7 - "0 == Abs_hypreal(hyprel``{%n::nat. (#0::real)})"
16.8 + "0 == Abs_hypreal(hyprel``{%n::nat. (Numeral0::real)})"
16.9
16.10 hypreal_one_def
16.11 - "1hr == Abs_hypreal(hyprel``{%n::nat. (#1::real)})"
16.12 + "1hr == Abs_hypreal(hyprel``{%n::nat. (Numeral1::real)})"
16.13
16.14 hypreal_minus_def
16.15 "- P == Abs_hypreal(UN X: Rep_hypreal(P). hyprel``{%n::nat. - (X n)})"
16.16 @@ -48,7 +48,7 @@
16.17
16.18 hypreal_inverse_def
16.19 "inverse P == Abs_hypreal(UN X: Rep_hypreal(P).
16.20 - hyprel``{%n. if X n = #0 then #0 else inverse (X n)})"
16.21 + hyprel``{%n. if X n = Numeral0 then Numeral0 else inverse (X n)})"
16.22
16.23 hypreal_divide_def
16.24 "P / Q::hypreal == P * inverse Q"
17.1 --- a/src/HOL/Hyperreal/HyperNat.ML Fri Oct 05 21:50:37 2001 +0200
17.2 +++ b/src/HOL/Hyperreal/HyperNat.ML Fri Oct 05 21:52:39 2001 +0200
17.3 @@ -682,7 +682,7 @@
17.4 Goalw [hypnat_one_def,hypnat_zero_def,hypnat_less_def]
17.5 "(0::hypnat) < 1hn";
17.6 by (res_inst_tac [("x","%n. 0")] exI 1);
17.7 -by (res_inst_tac [("x","%n. 1'")] exI 1);
17.8 +by (res_inst_tac [("x","%n. Suc 0")] exI 1);
17.9 by Auto_tac;
17.10 qed "hypnat_zero_less_one";
17.11
17.12 @@ -806,7 +806,7 @@
17.13 by Auto_tac;
17.14 qed "hypnat_of_nat_le_iff";
17.15
17.16 -Goalw [hypnat_of_nat_def,hypnat_one_def] "hypnat_of_nat 1' = 1hn";
17.17 +Goalw [hypnat_of_nat_def,hypnat_one_def] "hypnat_of_nat (Suc 0) = 1hn";
17.18 by (Simp_tac 1);
17.19 qed "hypnat_of_nat_one";
17.20
17.21 @@ -903,7 +903,7 @@
17.22 qed "SHNat_hypnat_of_nat";
17.23 Addsimps [SHNat_hypnat_of_nat];
17.24
17.25 -Goal "hypnat_of_nat 1' : Nats";
17.26 +Goal "hypnat_of_nat (Suc 0) : Nats";
17.27 by (Simp_tac 1);
17.28 qed "SHNat_hypnat_of_nat_one";
17.29
17.30 @@ -1246,14 +1246,14 @@
17.31 Addsimps [hypnat_of_nat_eq_cancel];
17.32
17.33 Goalw [hypnat_zero_def]
17.34 - "hypreal_of_hypnat 0 = #0";
17.35 + "hypreal_of_hypnat 0 = Numeral0";
17.36 by (simp_tac (HOL_ss addsimps
17.37 [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1);
17.38 by (simp_tac (simpset() addsimps [hypreal_of_hypnat, real_of_nat_zero]) 1);
17.39 qed "hypreal_of_hypnat_zero";
17.40
17.41 Goalw [hypnat_one_def]
17.42 - "hypreal_of_hypnat 1hn = #1";
17.43 + "hypreal_of_hypnat 1hn = Numeral1";
17.44 by (simp_tac (HOL_ss addsimps
17.45 [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
17.46 by (simp_tac (simpset() addsimps [hypreal_of_hypnat, real_of_nat_one]) 1);
17.47 @@ -1283,7 +1283,7 @@
17.48 qed "hypreal_of_hypnat_less_iff";
17.49 Addsimps [hypreal_of_hypnat_less_iff];
17.50
17.51 -Goal "(hypreal_of_hypnat N = #0) = (N = 0)";
17.52 +Goal "(hypreal_of_hypnat N = Numeral0) = (N = 0)";
17.53 by (simp_tac (simpset() addsimps [hypreal_of_hypnat_zero RS sym]) 1);
17.54 qed "hypreal_of_hypnat_eq_zero_iff";
17.55 Addsimps [hypreal_of_hypnat_eq_zero_iff];
18.1 --- a/src/HOL/Hyperreal/HyperOrd.ML Fri Oct 05 21:50:37 2001 +0200
18.2 +++ b/src/HOL/Hyperreal/HyperOrd.ML Fri Oct 05 21:52:39 2001 +0200
18.3 @@ -47,7 +47,7 @@
18.4 val eq_diff_eq = hypreal_eq_diff_eq
18.5 val eqI_rules = [hypreal_less_eqI, hypreal_eq_eqI, hypreal_le_eqI]
18.6 fun dest_eqI th =
18.7 - #1 (HOLogic.dest_bin "op =" HOLogic.boolT
18.8 + #1 (HOLogic.dest_bin "op =" HOLogic.boolT
18.9 (HOLogic.dest_Trueprop (concl_of th)))
18.10
18.11 val diff_def = hypreal_diff_def
18.12 @@ -150,8 +150,8 @@
18.13 qed "hypreal_mult_less_zero";
18.14
18.15 Goalw [hypreal_one_def,hypreal_zero_def,hypreal_less_def] "0 < 1hr";
18.16 -by (res_inst_tac [("x","%n. #0")] exI 1);
18.17 -by (res_inst_tac [("x","%n. #1")] exI 1);
18.18 +by (res_inst_tac [("x","%n. Numeral0")] exI 1);
18.19 +by (res_inst_tac [("x","%n. Numeral1")] exI 1);
18.20 by (auto_tac (claset(),
18.21 simpset() addsimps [real_zero_less_one, FreeUltrafilterNat_Nat_set]));
18.22 qed "hypreal_zero_less_one";
19.1 --- a/src/HOL/Hyperreal/HyperPow.ML Fri Oct 05 21:50:37 2001 +0200
19.2 +++ b/src/HOL/Hyperreal/HyperPow.ML Fri Oct 05 21:52:39 2001 +0200
19.3 @@ -6,17 +6,17 @@
19.4 Exponentials on the hyperreals
19.5 *)
19.6
19.7 -Goal "(#0::hypreal) ^ (Suc n) = 0";
19.8 +Goal "(Numeral0::hypreal) ^ (Suc n) = 0";
19.9 by (Auto_tac);
19.10 qed "hrealpow_zero";
19.11 Addsimps [hrealpow_zero];
19.12
19.13 -Goal "r ~= (#0::hypreal) --> r ^ n ~= 0";
19.14 +Goal "r ~= (Numeral0::hypreal) --> r ^ n ~= 0";
19.15 by (induct_tac "n" 1);
19.16 by Auto_tac;
19.17 qed_spec_mp "hrealpow_not_zero";
19.18
19.19 -Goal "r ~= (#0::hypreal) --> inverse(r ^ n) = (inverse r) ^ n";
19.20 +Goal "r ~= (Numeral0::hypreal) --> inverse(r ^ n) = (inverse r) ^ n";
19.21 by (induct_tac "n" 1);
19.22 by (Auto_tac);
19.23 by (forw_inst_tac [("n","n")] hrealpow_not_zero 1);
19.24 @@ -33,49 +33,49 @@
19.25 by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac));
19.26 qed "hrealpow_add";
19.27
19.28 -Goal "(r::hypreal) ^ 1' = r";
19.29 +Goal "(r::hypreal) ^ Suc 0 = r";
19.30 by (Simp_tac 1);
19.31 qed "hrealpow_one";
19.32 Addsimps [hrealpow_one];
19.33
19.34 -Goal "(r::hypreal) ^ 2 = r * r";
19.35 +Goal "(r::hypreal) ^ Suc (Suc 0) = r * r";
19.36 by (Simp_tac 1);
19.37 qed "hrealpow_two";
19.38
19.39 -Goal "(#0::hypreal) <= r --> #0 <= r ^ n";
19.40 +Goal "(Numeral0::hypreal) <= r --> Numeral0 <= r ^ n";
19.41 by (induct_tac "n" 1);
19.42 by (auto_tac (claset(), simpset() addsimps [hypreal_0_le_mult_iff]));
19.43 qed_spec_mp "hrealpow_ge_zero";
19.44
19.45 -Goal "(#0::hypreal) < r --> #0 < r ^ n";
19.46 +Goal "(Numeral0::hypreal) < r --> Numeral0 < r ^ n";
19.47 by (induct_tac "n" 1);
19.48 by (auto_tac (claset(), simpset() addsimps [hypreal_0_less_mult_iff]));
19.49 qed_spec_mp "hrealpow_gt_zero";
19.50
19.51 -Goal "x <= y & (#0::hypreal) < x --> x ^ n <= y ^ n";
19.52 +Goal "x <= y & (Numeral0::hypreal) < x --> x ^ n <= y ^ n";
19.53 by (induct_tac "n" 1);
19.54 by (auto_tac (claset() addSIs [hypreal_mult_le_mono], simpset()));
19.55 by (asm_simp_tac (simpset() addsimps [hrealpow_ge_zero]) 1);
19.56 qed_spec_mp "hrealpow_le";
19.57
19.58 -Goal "x < y & (#0::hypreal) < x & 0 < n --> x ^ n < y ^ n";
19.59 +Goal "x < y & (Numeral0::hypreal) < x & 0 < n --> x ^ n < y ^ n";
19.60 by (induct_tac "n" 1);
19.61 by (auto_tac (claset() addIs [hypreal_mult_less_mono,gr0I],
19.62 simpset() addsimps [hrealpow_gt_zero]));
19.63 qed "hrealpow_less";
19.64
19.65 -Goal "#1 ^ n = (#1::hypreal)";
19.66 +Goal "Numeral1 ^ n = (Numeral1::hypreal)";
19.67 by (induct_tac "n" 1);
19.68 by (Auto_tac);
19.69 qed "hrealpow_eq_one";
19.70 Addsimps [hrealpow_eq_one];
19.71
19.72 -Goal "abs(-(#1 ^ n)) = (#1::hypreal)";
19.73 +Goal "abs(-(Numeral1 ^ n)) = (Numeral1::hypreal)";
19.74 by Auto_tac;
19.75 qed "hrabs_minus_hrealpow_one";
19.76 Addsimps [hrabs_minus_hrealpow_one];
19.77
19.78 -Goal "abs(#-1 ^ n) = (#1::hypreal)";
19.79 +Goal "abs(# -1 ^ n) = (Numeral1::hypreal)";
19.80 by (induct_tac "n" 1);
19.81 by Auto_tac;
19.82 qed "hrabs_hrealpow_minus_one";
19.83 @@ -86,61 +86,61 @@
19.84 by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac));
19.85 qed "hrealpow_mult";
19.86
19.87 -Goal "(#0::hypreal) <= r ^ 2";
19.88 +Goal "(Numeral0::hypreal) <= r ^Suc (Suc 0)";
19.89 by (auto_tac (claset(), simpset() addsimps [hypreal_0_le_mult_iff]));
19.90 qed "hrealpow_two_le";
19.91 Addsimps [hrealpow_two_le];
19.92
19.93 -Goal "(#0::hypreal) <= u ^ 2 + v ^ 2";
19.94 +Goal "(Numeral0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0)";
19.95 by (simp_tac (HOL_ss addsimps [hrealpow_two_le,
19.96 rename_numerals hypreal_le_add_order]) 1);
19.97 qed "hrealpow_two_le_add_order";
19.98 Addsimps [hrealpow_two_le_add_order];
19.99
19.100 -Goal "(#0::hypreal) <= u ^ 2 + v ^ 2 + w ^ 2";
19.101 +Goal "(Numeral0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0) + w ^ Suc (Suc 0)";
19.102 by (simp_tac (HOL_ss addsimps [hrealpow_two_le,
19.103 rename_numerals hypreal_le_add_order]) 1);
19.104 qed "hrealpow_two_le_add_order2";
19.105 Addsimps [hrealpow_two_le_add_order2];
19.106
19.107 -Goal "(x ^ 2 + y ^ 2 + z ^ 2 = (#0::hypreal)) = (x = #0 & y = #0 & z = #0)";
19.108 +Goal "(x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + z ^ Suc (Suc 0) = (Numeral0::hypreal)) = (x = Numeral0 & y = Numeral0 & z = Numeral0)";
19.109 by (simp_tac (HOL_ss addsimps
19.110 [rename_numerals hypreal_three_squares_add_zero_iff, hrealpow_two]) 1);
19.111 qed "hrealpow_three_squares_add_zero_iff";
19.112 Addsimps [hrealpow_three_squares_add_zero_iff];
19.113
19.114 -Goal "abs(x ^ 2) = (x::hypreal) ^ 2";
19.115 +Goal "abs(x ^ Suc (Suc 0)) = (x::hypreal) ^ Suc (Suc 0)";
19.116 by (auto_tac (claset(),
19.117 simpset() addsimps [hrabs_def, hypreal_0_le_mult_iff]));
19.118 qed "hrabs_hrealpow_two";
19.119 Addsimps [hrabs_hrealpow_two];
19.120
19.121 -Goal "abs(x) ^ 2 = (x::hypreal) ^ 2";
19.122 +Goal "abs(x) ^ Suc (Suc 0) = (x::hypreal) ^ Suc (Suc 0)";
19.123 by (simp_tac (simpset() addsimps [hrealpow_hrabs, hrabs_eqI1]
19.124 delsimps [hpowr_Suc]) 1);
19.125 qed "hrealpow_two_hrabs";
19.126 Addsimps [hrealpow_two_hrabs];
19.127
19.128 -Goal "(#1::hypreal) < r ==> #1 < r ^ 2";
19.129 +Goal "(Numeral1::hypreal) < r ==> Numeral1 < r ^ Suc (Suc 0)";
19.130 by (auto_tac (claset(), simpset() addsimps [hrealpow_two]));
19.131 -by (res_inst_tac [("y","#1*#1")] order_le_less_trans 1);
19.132 +by (res_inst_tac [("y","Numeral1*Numeral1")] order_le_less_trans 1);
19.133 by (rtac hypreal_mult_less_mono 2);
19.134 by Auto_tac;
19.135 qed "hrealpow_two_gt_one";
19.136
19.137 -Goal "(#1::hypreal) <= r ==> #1 <= r ^ 2";
19.138 +Goal "(Numeral1::hypreal) <= r ==> Numeral1 <= r ^ Suc (Suc 0)";
19.139 by (etac (order_le_imp_less_or_eq RS disjE) 1);
19.140 by (etac (hrealpow_two_gt_one RS order_less_imp_le) 1);
19.141 by Auto_tac;
19.142 qed "hrealpow_two_ge_one";
19.143
19.144 -Goal "(#1::hypreal) <= #2 ^ n";
19.145 -by (res_inst_tac [("y","#1 ^ n")] order_trans 1);
19.146 +Goal "(Numeral1::hypreal) <= # 2 ^ n";
19.147 +by (res_inst_tac [("y","Numeral1 ^ n")] order_trans 1);
19.148 by (rtac hrealpow_le 2);
19.149 by Auto_tac;
19.150 qed "two_hrealpow_ge_one";
19.151
19.152 -Goal "hypreal_of_nat n < #2 ^ n";
19.153 +Goal "hypreal_of_nat n < # 2 ^ n";
19.154 by (induct_tac "n" 1);
19.155 by (auto_tac (claset(),
19.156 simpset() addsimps [hypreal_of_nat_Suc, hypreal_add_mult_distrib]));
19.157 @@ -149,34 +149,34 @@
19.158 qed "two_hrealpow_gt";
19.159 Addsimps [two_hrealpow_gt,two_hrealpow_ge_one];
19.160
19.161 -Goal "#-1 ^ (#2*n) = (#1::hypreal)";
19.162 +Goal "# -1 ^ (# 2*n) = (Numeral1::hypreal)";
19.163 by (induct_tac "n" 1);
19.164 by (Auto_tac);
19.165 qed "hrealpow_minus_one";
19.166
19.167 -Goal "n+n = (#2*n::nat)";
19.168 +Goal "n+n = (# 2*n::nat)";
19.169 by Auto_tac;
19.170 qed "double_lemma";
19.171
19.172 (*ugh: need to get rid fo the n+n*)
19.173 -Goal "#-1 ^ (n + n) = (#1::hypreal)";
19.174 +Goal "# -1 ^ (n + n) = (Numeral1::hypreal)";
19.175 by (auto_tac (claset(),
19.176 simpset() addsimps [double_lemma, hrealpow_minus_one]));
19.177 qed "hrealpow_minus_one2";
19.178 Addsimps [hrealpow_minus_one2];
19.179
19.180 -Goal "(-(x::hypreal)) ^ 2 = x ^ 2";
19.181 +Goal "(-(x::hypreal)) ^ Suc (Suc 0) = x ^ Suc (Suc 0)";
19.182 by (Auto_tac);
19.183 qed "hrealpow_minus_two";
19.184 Addsimps [hrealpow_minus_two];
19.185
19.186 -Goal "(#0::hypreal) < r & r < #1 --> r ^ Suc n < r ^ n";
19.187 +Goal "(Numeral0::hypreal) < r & r < Numeral1 --> r ^ Suc n < r ^ n";
19.188 by (induct_tac "n" 1);
19.189 by (auto_tac (claset(),
19.190 simpset() addsimps [hypreal_mult_less_mono2]));
19.191 qed_spec_mp "hrealpow_Suc_less";
19.192
19.193 -Goal "(#0::hypreal) <= r & r < #1 --> r ^ Suc n <= r ^ n";
19.194 +Goal "(Numeral0::hypreal) <= r & r < Numeral1 --> r ^ Suc n <= r ^ n";
19.195 by (induct_tac "n" 1);
19.196 by (auto_tac (claset() addIs [order_less_imp_le]
19.197 addSDs [order_le_imp_less_or_eq,hrealpow_Suc_less],
19.198 @@ -191,8 +191,8 @@
19.199 one_eq_numeral_1 RS sym]));
19.200 qed "hrealpow";
19.201
19.202 -Goal "(x + (y::hypreal)) ^ 2 = \
19.203 -\ x ^ 2 + y ^ 2 + (hypreal_of_nat 2)*x*y";
19.204 +Goal "(x + (y::hypreal)) ^ Suc (Suc 0) = \
19.205 +\ x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + (hypreal_of_nat (Suc (Suc 0)))*x*y";
19.206 by (simp_tac (simpset() addsimps
19.207 [hypreal_add_mult_distrib2, hypreal_add_mult_distrib,
19.208 hypreal_of_nat_zero, hypreal_of_nat_Suc]) 1);
19.209 @@ -204,7 +204,7 @@
19.210 property for the real rather than prove it directly
19.211 using induction: proof is much simpler this way!
19.212 ---------------------------------------------------------------*)
19.213 -Goal "[|(#0::hypreal) <= x; #0 <= y;x ^ Suc n <= y ^ Suc n |] ==> x <= y";
19.214 +Goal "[|(Numeral0::hypreal) <= x; Numeral0 <= y;x ^ Suc n <= y ^ Suc n |] ==> x <= y";
19.215 by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
19.216 by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
19.217 by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
19.218 @@ -241,14 +241,14 @@
19.219 by (Fuf_tac 1);
19.220 qed "hyperpow";
19.221
19.222 -Goalw [hypnat_one_def] "(#0::hypreal) pow (n + 1hn) = #0";
19.223 +Goalw [hypnat_one_def] "(Numeral0::hypreal) pow (n + 1hn) = Numeral0";
19.224 by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
19.225 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
19.226 by (auto_tac (claset(), simpset() addsimps [hyperpow,hypnat_add]));
19.227 qed "hyperpow_zero";
19.228 Addsimps [hyperpow_zero];
19.229
19.230 -Goal "r ~= (#0::hypreal) --> r pow n ~= #0";
19.231 +Goal "r ~= (Numeral0::hypreal) --> r pow n ~= Numeral0";
19.232 by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
19.233 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
19.234 by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
19.235 @@ -258,7 +258,7 @@
19.236 simpset()) 1);
19.237 qed_spec_mp "hyperpow_not_zero";
19.238
19.239 -Goal "r ~= (#0::hypreal) --> inverse(r pow n) = (inverse r) pow n";
19.240 +Goal "r ~= (Numeral0::hypreal) --> inverse(r pow n) = (inverse r) pow n";
19.241 by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
19.242 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
19.243 by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
19.244 @@ -298,7 +298,7 @@
19.245 simpset() addsimps [hyperpow,hypnat_add, hypreal_mult]));
19.246 qed "hyperpow_two";
19.247
19.248 -Goal "(#0::hypreal) < r --> #0 < r pow n";
19.249 +Goal "(Numeral0::hypreal) < r --> Numeral0 < r pow n";
19.250 by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
19.251 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
19.252 by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
19.253 @@ -306,7 +306,7 @@
19.254 simpset() addsimps [hyperpow,hypreal_less, hypreal_le]));
19.255 qed_spec_mp "hyperpow_gt_zero";
19.256
19.257 -Goal "(#0::hypreal) <= r --> #0 <= r pow n";
19.258 +Goal "(Numeral0::hypreal) <= r --> Numeral0 <= r pow n";
19.259 by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
19.260 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
19.261 by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
19.262 @@ -314,7 +314,7 @@
19.263 simpset() addsimps [hyperpow,hypreal_le]));
19.264 qed "hyperpow_ge_zero";
19.265
19.266 -Goal "(#0::hypreal) < x & x <= y --> x pow n <= y pow n";
19.267 +Goal "(Numeral0::hypreal) < x & x <= y --> x pow n <= y pow n";
19.268 by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
19.269 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
19.270 by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
19.271 @@ -326,22 +326,22 @@
19.272 by (auto_tac (claset() addIs [realpow_le], simpset()));
19.273 qed_spec_mp "hyperpow_le";
19.274
19.275 -Goal "#1 pow n = (#1::hypreal)";
19.276 +Goal "Numeral1 pow n = (Numeral1::hypreal)";
19.277 by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
19.278 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
19.279 by (auto_tac (claset(), simpset() addsimps [hyperpow]));
19.280 qed "hyperpow_eq_one";
19.281 Addsimps [hyperpow_eq_one];
19.282
19.283 -Goal "abs(-(#1 pow n)) = (#1::hypreal)";
19.284 +Goal "abs(-(Numeral1 pow n)) = (Numeral1::hypreal)";
19.285 by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
19.286 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
19.287 by (auto_tac (claset(), simpset() addsimps [hyperpow,hypreal_hrabs]));
19.288 qed "hrabs_minus_hyperpow_one";
19.289 Addsimps [hrabs_minus_hyperpow_one];
19.290
19.291 -Goal "abs(#-1 pow n) = (#1::hypreal)";
19.292 -by (subgoal_tac "abs((-1hr) pow n) = 1hr" 1);
19.293 +Goal "abs(# -1 pow n) = (Numeral1::hypreal)";
19.294 +by (subgoal_tac "abs((- 1hr) pow n) = 1hr" 1);
19.295 by (Asm_full_simp_tac 1);
19.296 by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1);
19.297 by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
19.298 @@ -358,7 +358,7 @@
19.299 simpset() addsimps [hyperpow, hypreal_mult,realpow_mult]));
19.300 qed "hyperpow_mult";
19.301
19.302 -Goal "(#0::hypreal) <= r pow (1hn + 1hn)";
19.303 +Goal "(Numeral0::hypreal) <= r pow (1hn + 1hn)";
19.304 by (auto_tac (claset(),
19.305 simpset() addsimps [hyperpow_two, hypreal_0_le_mult_iff]));
19.306 qed "hyperpow_two_le";
19.307 @@ -375,21 +375,21 @@
19.308 Addsimps [hyperpow_two_hrabs];
19.309
19.310 (*? very similar to hrealpow_two_gt_one *)
19.311 -Goal "(#1::hypreal) < r ==> #1 < r pow (1hn + 1hn)";
19.312 +Goal "(Numeral1::hypreal) < r ==> Numeral1 < r pow (1hn + 1hn)";
19.313 by (auto_tac (claset(), simpset() addsimps [hyperpow_two]));
19.314 -by (res_inst_tac [("y","#1*#1")] order_le_less_trans 1);
19.315 +by (res_inst_tac [("y","Numeral1*Numeral1")] order_le_less_trans 1);
19.316 by (rtac hypreal_mult_less_mono 2);
19.317 by Auto_tac;
19.318 qed "hyperpow_two_gt_one";
19.319
19.320 -Goal "(#1::hypreal) <= r ==> #1 <= r pow (1hn + 1hn)";
19.321 +Goal "(Numeral1::hypreal) <= r ==> Numeral1 <= r pow (1hn + 1hn)";
19.322 by (auto_tac (claset() addSDs [order_le_imp_less_or_eq]
19.323 addIs [hyperpow_two_gt_one,order_less_imp_le],
19.324 simpset()));
19.325 qed "hyperpow_two_ge_one";
19.326
19.327 -Goal "(#1::hypreal) <= #2 pow n";
19.328 -by (res_inst_tac [("y","#1 pow n")] order_trans 1);
19.329 +Goal "(Numeral1::hypreal) <= # 2 pow n";
19.330 +by (res_inst_tac [("y","Numeral1 pow n")] order_trans 1);
19.331 by (rtac hyperpow_le 2);
19.332 by Auto_tac;
19.333 qed "two_hyperpow_ge_one";
19.334 @@ -397,7 +397,7 @@
19.335
19.336 Addsimps [simplify (simpset()) realpow_minus_one];
19.337
19.338 -Goal "#-1 pow ((1hn + 1hn)*n) = (#1::hypreal)";
19.339 +Goal "# -1 pow ((1hn + 1hn)*n) = (Numeral1::hypreal)";
19.340 by (subgoal_tac "(-(1hr)) pow ((1hn + 1hn)*n) = 1hr" 1);
19.341 by (Asm_full_simp_tac 1);
19.342 by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1);
19.343 @@ -409,7 +409,7 @@
19.344 Addsimps [hyperpow_minus_one2];
19.345
19.346 Goalw [hypnat_one_def]
19.347 - "(#0::hypreal) < r & r < #1 --> r pow (n + 1hn) < r pow n";
19.348 + "(Numeral0::hypreal) < r & r < Numeral1 --> r pow (n + 1hn) < r pow n";
19.349 by (full_simp_tac
19.350 (HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,
19.351 one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
19.352 @@ -421,7 +421,7 @@
19.353 qed_spec_mp "hyperpow_Suc_less";
19.354
19.355 Goalw [hypnat_one_def]
19.356 - "#0 <= r & r < (#1::hypreal) --> r pow (n + 1hn) <= r pow n";
19.357 + "Numeral0 <= r & r < (Numeral1::hypreal) --> r pow (n + 1hn) <= r pow n";
19.358 by (full_simp_tac
19.359 (HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,
19.360 one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
19.361 @@ -434,7 +434,7 @@
19.362 qed_spec_mp "hyperpow_Suc_le";
19.363
19.364 Goalw [hypnat_one_def]
19.365 - "(#0::hypreal) <= r & r < #1 & n < N --> r pow N <= r pow n";
19.366 + "(Numeral0::hypreal) <= r & r < Numeral1 & n < N --> r pow N <= r pow n";
19.367 by (full_simp_tac
19.368 (HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,
19.369 one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
19.370 @@ -449,12 +449,12 @@
19.371 simpset()));
19.372 qed_spec_mp "hyperpow_less_le";
19.373
19.374 -Goal "[| (#0::hypreal) <= r; r < #1 |] \
19.375 +Goal "[| (Numeral0::hypreal) <= r; r < Numeral1 |] \
19.376 \ ==> ALL N n. n < N --> r pow N <= r pow n";
19.377 by (blast_tac (claset() addSIs [hyperpow_less_le]) 1);
19.378 qed "hyperpow_less_le2";
19.379
19.380 -Goal "[| #0 <= r; r < (#1::hypreal); N : HNatInfinite |] \
19.381 +Goal "[| Numeral0 <= r; r < (Numeral1::hypreal); N : HNatInfinite |] \
19.382 \ ==> ALL n: Nats. r pow N <= r pow n";
19.383 by (auto_tac (claset() addSIs [hyperpow_less_le],
19.384 simpset() addsimps [HNatInfinite_iff]));
19.385 @@ -471,23 +471,23 @@
19.386 qed "hyperpow_SReal";
19.387 Addsimps [hyperpow_SReal];
19.388
19.389 -Goal "N : HNatInfinite ==> (#0::hypreal) pow N = 0";
19.390 +Goal "N : HNatInfinite ==> (Numeral0::hypreal) pow N = 0";
19.391 by (dtac HNatInfinite_is_Suc 1);
19.392 by (Auto_tac);
19.393 qed "hyperpow_zero_HNatInfinite";
19.394 Addsimps [hyperpow_zero_HNatInfinite];
19.395
19.396 -Goal "[| (#0::hypreal) <= r; r < #1; n <= N |] ==> r pow N <= r pow n";
19.397 +Goal "[| (Numeral0::hypreal) <= r; r < Numeral1; n <= N |] ==> r pow N <= r pow n";
19.398 by (dres_inst_tac [("y","N")] hypnat_le_imp_less_or_eq 1);
19.399 by (auto_tac (claset() addIs [hyperpow_less_le], simpset()));
19.400 qed "hyperpow_le_le";
19.401
19.402 -Goal "[| (#0::hypreal) < r; r < #1 |] ==> r pow (n + 1hn) <= r";
19.403 +Goal "[| (Numeral0::hypreal) < r; r < Numeral1 |] ==> r pow (n + 1hn) <= r";
19.404 by (dres_inst_tac [("n","1hn")] (order_less_imp_le RS hyperpow_le_le) 1);
19.405 by (Auto_tac);
19.406 qed "hyperpow_Suc_le_self";
19.407
19.408 -Goal "[| (#0::hypreal) <= r; r < #1 |] ==> r pow (n + 1hn) <= r";
19.409 +Goal "[| (Numeral0::hypreal) <= r; r < Numeral1 |] ==> r pow (n + 1hn) <= r";
19.410 by (dres_inst_tac [("n","1hn")] hyperpow_le_le 1);
19.411 by (Auto_tac);
19.412 qed "hyperpow_Suc_le_self2";
20.1 --- a/src/HOL/Hyperreal/Lim.ML Fri Oct 05 21:50:37 2001 +0200
20.2 +++ b/src/HOL/Hyperreal/Lim.ML Fri Oct 05 21:52:39 2001 +0200
20.3 @@ -29,7 +29,7 @@
20.4 Goalw [LIM_def]
20.5 "[| f -- x --> l; g -- x --> m |] ==> (%x. f(x) + g(x)) -- x --> (l + m)";
20.6 by (Clarify_tac 1);
20.7 -by (REPEAT(dres_inst_tac [("x","r/#2")] spec 1));
20.8 +by (REPEAT(dres_inst_tac [("x","r/# 2")] spec 1));
20.9 by (Asm_full_simp_tac 1);
20.10 by (Clarify_tac 1);
20.11 by (res_inst_tac [("R1.0","s"),("R2.0","sa")]
20.12 @@ -65,7 +65,7 @@
20.13 (*----------------------------------------------
20.14 LIM_zero
20.15 ----------------------------------------------*)
20.16 -Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> #0";
20.17 +Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> Numeral0";
20.18 by (res_inst_tac [("z1","l")] (rename_numerals (real_add_minus RS subst)) 1);
20.19 by (rtac LIM_add_minus 1 THEN Auto_tac);
20.20 qed "LIM_zero";
20.21 @@ -73,8 +73,8 @@
20.22 (*--------------------------
20.23 Limit not zero
20.24 --------------------------*)
20.25 -Goalw [LIM_def] "k \\<noteq> #0 ==> ~ ((%x. k) -- x --> #0)";
20.26 -by (res_inst_tac [("R1.0","k"),("R2.0","#0")] real_linear_less2 1);
20.27 +Goalw [LIM_def] "k \\<noteq> Numeral0 ==> ~ ((%x. k) -- x --> Numeral0)";
20.28 +by (res_inst_tac [("R1.0","k"),("R2.0","Numeral0")] real_linear_less2 1);
20.29 by (auto_tac (claset(), simpset() addsimps [real_abs_def]));
20.30 by (res_inst_tac [("x","-k")] exI 1);
20.31 by (res_inst_tac [("x","k")] exI 2);
20.32 @@ -85,7 +85,7 @@
20.33 by Auto_tac;
20.34 qed "LIM_not_zero";
20.35
20.36 -(* [| k \\<noteq> #0; (%x. k) -- x --> #0 |] ==> R *)
20.37 +(* [| k \\<noteq> Numeral0; (%x. k) -- x --> Numeral0 |] ==> R *)
20.38 bind_thm("LIM_not_zeroE", LIM_not_zero RS notE);
20.39
20.40 Goal "(%x. k) -- x --> L ==> k = L";
20.41 @@ -108,9 +108,9 @@
20.42 LIM_mult_zero
20.43 -------------*)
20.44 Goalw [LIM_def]
20.45 - "[| f -- x --> #0; g -- x --> #0 |] ==> (%x. f(x)*g(x)) -- x --> #0";
20.46 + "[| f -- x --> Numeral0; g -- x --> Numeral0 |] ==> (%x. f(x)*g(x)) -- x --> Numeral0";
20.47 by Safe_tac;
20.48 -by (dres_inst_tac [("x","#1")] spec 1);
20.49 +by (dres_inst_tac [("x","Numeral1")] spec 1);
20.50 by (dres_inst_tac [("x","r")] spec 1);
20.51 by (cut_facts_tac [real_zero_less_one] 1);
20.52 by (asm_full_simp_tac (simpset() addsimps
20.53 @@ -146,7 +146,7 @@
20.54 by (auto_tac (claset(), simpset() addsimps [real_add_minus_iff]));
20.55 qed "LIM_equal";
20.56
20.57 -Goal "[| (%x. f(x) + -g(x)) -- a --> #0; g -- a --> l |] \
20.58 +Goal "[| (%x. f(x) + -g(x)) -- a --> Numeral0; g -- a --> l |] \
20.59 \ ==> f -- a --> l";
20.60 by (dtac LIM_add 1 THEN assume_tac 1);
20.61 by (auto_tac (claset(), simpset() addsimps [real_add_assoc]));
20.62 @@ -181,7 +181,7 @@
20.63 Limit: NS definition ==> standard definition
20.64 ---------------------------------------------------------------------*)
20.65
20.66 -Goal "\\<forall>s. #0 < s --> (\\<exists>xa. xa \\<noteq> x & \
20.67 +Goal "\\<forall>s. Numeral0 < s --> (\\<exists>xa. xa \\<noteq> x & \
20.68 \ abs (xa + - x) < s & r \\<le> abs (f xa + -L)) \
20.69 \ ==> \\<forall>n::nat. \\<exists>xa. xa \\<noteq> x & \
20.70 \ abs(xa + -x) < inverse(real(Suc n)) & r \\<le> abs(f xa + -L)";
20.71 @@ -191,7 +191,7 @@
20.72 by Auto_tac;
20.73 val lemma_LIM = result();
20.74
20.75 -Goal "\\<forall>s. #0 < s --> (\\<exists>xa. xa \\<noteq> x & \
20.76 +Goal "\\<forall>s. Numeral0 < s --> (\\<exists>xa. xa \\<noteq> x & \
20.77 \ abs (xa + - x) < s & r \\<le> abs (f xa + -L)) \
20.78 \ ==> \\<exists>X. \\<forall>n::nat. X n \\<noteq> x & \
20.79 \ abs(X n + -x) < inverse(real(Suc n)) & r \\<le> abs(f (X n) + -L)";
20.80 @@ -320,7 +320,7 @@
20.81 NSLIM_inverse
20.82 -----------------------------*)
20.83 Goalw [NSLIM_def]
20.84 - "[| f -- a --NS> L; L \\<noteq> #0 |] \
20.85 + "[| f -- a --NS> L; L \\<noteq> Numeral0 |] \
20.86 \ ==> (%x. inverse(f(x))) -- a --NS> (inverse L)";
20.87 by (Clarify_tac 1);
20.88 by (dtac spec 1);
20.89 @@ -329,28 +329,28 @@
20.90 qed "NSLIM_inverse";
20.91
20.92 Goal "[| f -- a --> L; \
20.93 -\ L \\<noteq> #0 |] ==> (%x. inverse(f(x))) -- a --> (inverse L)";
20.94 +\ L \\<noteq> Numeral0 |] ==> (%x. inverse(f(x))) -- a --> (inverse L)";
20.95 by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_inverse]) 1);
20.96 qed "LIM_inverse";
20.97
20.98 (*------------------------------
20.99 NSLIM_zero
20.100 ------------------------------*)
20.101 -Goal "f -- a --NS> l ==> (%x. f(x) + -l) -- a --NS> #0";
20.102 +Goal "f -- a --NS> l ==> (%x. f(x) + -l) -- a --NS> Numeral0";
20.103 by (res_inst_tac [("z1","l")] (rename_numerals (real_add_minus RS subst)) 1);
20.104 by (rtac NSLIM_add_minus 1 THEN Auto_tac);
20.105 qed "NSLIM_zero";
20.106
20.107 -Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> #0";
20.108 +Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> Numeral0";
20.109 by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_zero]) 1);
20.110 qed "LIM_zero2";
20.111
20.112 -Goal "(%x. f(x) - l) -- x --NS> #0 ==> f -- x --NS> l";
20.113 +Goal "(%x. f(x) - l) -- x --NS> Numeral0 ==> f -- x --NS> l";
20.114 by (dres_inst_tac [("g","%x. l"),("m","l")] NSLIM_add 1);
20.115 by (auto_tac (claset(),simpset() addsimps [real_diff_def, real_add_assoc]));
20.116 qed "NSLIM_zero_cancel";
20.117
20.118 -Goal "(%x. f(x) - l) -- x --> #0 ==> f -- x --> l";
20.119 +Goal "(%x. f(x) - l) -- x --> Numeral0 ==> f -- x --> l";
20.120 by (dres_inst_tac [("g","%x. l"),("m","l")] LIM_add 1);
20.121 by (auto_tac (claset(),simpset() addsimps [real_diff_def, real_add_assoc]));
20.122 qed "LIM_zero_cancel";
20.123 @@ -359,17 +359,17 @@
20.124 (*--------------------------
20.125 NSLIM_not_zero
20.126 --------------------------*)
20.127 -Goalw [NSLIM_def] "k \\<noteq> #0 ==> ~ ((%x. k) -- x --NS> #0)";
20.128 +Goalw [NSLIM_def] "k \\<noteq> Numeral0 ==> ~ ((%x. k) -- x --NS> Numeral0)";
20.129 by Auto_tac;
20.130 by (res_inst_tac [("x","hypreal_of_real x + epsilon")] exI 1);
20.131 by (auto_tac (claset() addIs [Infinitesimal_add_approx_self RS approx_sym],
20.132 simpset() addsimps [rename_numerals hypreal_epsilon_not_zero]));
20.133 qed "NSLIM_not_zero";
20.134
20.135 -(* [| k \\<noteq> #0; (%x. k) -- x --NS> #0 |] ==> R *)
20.136 +(* [| k \\<noteq> Numeral0; (%x. k) -- x --NS> Numeral0 |] ==> R *)
20.137 bind_thm("NSLIM_not_zeroE", NSLIM_not_zero RS notE);
20.138
20.139 -Goal "k \\<noteq> #0 ==> ~ ((%x. k) -- x --> #0)";
20.140 +Goal "k \\<noteq> Numeral0 ==> ~ ((%x. k) -- x --> Numeral0)";
20.141 by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_not_zero]) 1);
20.142 qed "LIM_not_zero2";
20.143
20.144 @@ -405,16 +405,16 @@
20.145 (*--------------------
20.146 NSLIM_mult_zero
20.147 --------------------*)
20.148 -Goal "[| f -- x --NS> #0; g -- x --NS> #0 |] \
20.149 -\ ==> (%x. f(x)*g(x)) -- x --NS> #0";
20.150 +Goal "[| f -- x --NS> Numeral0; g -- x --NS> Numeral0 |] \
20.151 +\ ==> (%x. f(x)*g(x)) -- x --NS> Numeral0";
20.152 by (dtac NSLIM_mult 1 THEN Auto_tac);
20.153 qed "NSLIM_mult_zero";
20.154
20.155 (* we can use the corresponding thm LIM_mult2 *)
20.156 (* for standard definition of limit *)
20.157
20.158 -Goal "[| f -- x --> #0; g -- x --> #0 |] \
20.159 -\ ==> (%x. f(x)*g(x)) -- x --> #0";
20.160 +Goal "[| f -- x --> Numeral0; g -- x --> Numeral0 |] \
20.161 +\ ==> (%x. f(x)*g(x)) -- x --> Numeral0";
20.162 by (dtac LIM_mult2 1 THEN Auto_tac);
20.163 qed "LIM_mult_zero2";
20.164
20.165 @@ -499,7 +499,7 @@
20.166 --------------------------------------------------------------------------*)
20.167 (* Prove equivalence between NS limits - *)
20.168 (* seems easier than using standard def *)
20.169 -Goalw [NSLIM_def] "(f -- a --NS> L) = ((%h. f(a + h)) -- #0 --NS> L)";
20.170 +Goalw [NSLIM_def] "(f -- a --NS> L) = ((%h. f(a + h)) -- Numeral0 --NS> L)";
20.171 by (auto_tac (claset(),simpset() addsimps [hypreal_of_real_zero]));
20.172 by (dres_inst_tac [("x","hypreal_of_real a + x")] spec 1);
20.173 by (dres_inst_tac [("x","-hypreal_of_real a + x")] spec 2);
20.174 @@ -516,15 +516,15 @@
20.175 hypreal_add, real_add_assoc, approx_refl, hypreal_zero_def]));
20.176 qed "NSLIM_h_iff";
20.177
20.178 -Goal "(f -- a --NS> f a) = ((%h. f(a + h)) -- #0 --NS> f a)";
20.179 +Goal "(f -- a --NS> f a) = ((%h. f(a + h)) -- Numeral0 --NS> f a)";
20.180 by (rtac NSLIM_h_iff 1);
20.181 qed "NSLIM_isCont_iff";
20.182
20.183 -Goal "(f -- a --> f a) = ((%h. f(a + h)) -- #0 --> f(a))";
20.184 +Goal "(f -- a --> f a) = ((%h. f(a + h)) -- Numeral0 --> f(a))";
20.185 by (simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_isCont_iff]) 1);
20.186 qed "LIM_isCont_iff";
20.187
20.188 -Goalw [isCont_def] "(isCont f x) = ((%h. f(x + h)) -- #0 --> f(x))";
20.189 +Goalw [isCont_def] "(isCont f x) = ((%h. f(x + h)) -- Numeral0 --> f(x))";
20.190 by (simp_tac (simpset() addsimps [LIM_isCont_iff]) 1);
20.191 qed "isCont_iff";
20.192
20.193 @@ -574,11 +574,11 @@
20.194 qed "isCont_minus";
20.195
20.196 Goalw [isCont_def]
20.197 - "[| isCont f x; f x \\<noteq> #0 |] ==> isCont (%x. inverse (f x)) x";
20.198 + "[| isCont f x; f x \\<noteq> Numeral0 |] ==> isCont (%x. inverse (f x)) x";
20.199 by (blast_tac (claset() addIs [LIM_inverse]) 1);
20.200 qed "isCont_inverse";
20.201
20.202 -Goal "[| isNSCont f x; f x \\<noteq> #0 |] ==> isNSCont (%x. inverse (f x)) x";
20.203 +Goal "[| isNSCont f x; f x \\<noteq> Numeral0 |] ==> isNSCont (%x. inverse (f x)) x";
20.204 by (auto_tac (claset() addIs [isCont_inverse],simpset() addsimps
20.205 [isNSCont_isCont_iff]));
20.206 qed "isNSCont_inverse";
20.207 @@ -690,7 +690,7 @@
20.208 by (Ultra_tac 1);
20.209 qed "isUCont_isNSUCont";
20.210
20.211 -Goal "\\<forall>s. #0 < s --> (\\<exists>z y. abs (z + - y) < s & r \\<le> abs (f z + -f y)) \
20.212 +Goal "\\<forall>s. Numeral0 < s --> (\\<exists>z y. abs (z + - y) < s & r \\<le> abs (f z + -f y)) \
20.213 \ ==> \\<forall>n::nat. \\<exists>z y. \
20.214 \ abs(z + -y) < inverse(real(Suc n)) & \
20.215 \ r \\<le> abs(f z + -f y)";
20.216 @@ -700,7 +700,7 @@
20.217 by Auto_tac;
20.218 val lemma_LIMu = result();
20.219
20.220 -Goal "\\<forall>s. #0 < s --> (\\<exists>z y. abs (z + - y) < s & r \\<le> abs (f z + -f y)) \
20.221 +Goal "\\<forall>s. Numeral0 < s --> (\\<exists>z y. abs (z + - y) < s & r \\<le> abs (f z + -f y)) \
20.222 \ ==> \\<exists>X Y. \\<forall>n::nat. \
20.223 \ abs(X n + -(Y n)) < inverse(real(Suc n)) & \
20.224 \ r \\<le> abs(f (X n) + -f (Y n))";
20.225 @@ -745,23 +745,23 @@
20.226 Derivatives
20.227 ------------------------------------------------------------------*)
20.228 Goalw [deriv_def]
20.229 - "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- #0 --> D)";
20.230 + "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- Numeral0 --> D)";
20.231 by (Blast_tac 1);
20.232 qed "DERIV_iff";
20.233
20.234 Goalw [deriv_def]
20.235 - "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- #0 --NS> D)";
20.236 + "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- Numeral0 --NS> D)";
20.237 by (simp_tac (simpset() addsimps [LIM_NSLIM_iff]) 1);
20.238 qed "DERIV_NS_iff";
20.239
20.240 Goalw [deriv_def]
20.241 "DERIV f x :> D \
20.242 -\ ==> (%h. (f(x + h) + - f(x))/h) -- #0 --> D";
20.243 +\ ==> (%h. (f(x + h) + - f(x))/h) -- Numeral0 --> D";
20.244 by (Blast_tac 1);
20.245 qed "DERIVD";
20.246
20.247 Goalw [deriv_def] "DERIV f x :> D ==> \
20.248 -\ (%h. (f(x + h) + - f(x))/h) -- #0 --NS> D";
20.249 +\ (%h. (f(x + h) + - f(x))/h) -- Numeral0 --NS> D";
20.250 by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff]) 1);
20.251 qed "NS_DERIVD";
20.252
20.253 @@ -809,7 +809,7 @@
20.254 -------------------------------------------------------*)
20.255
20.256 Goalw [LIM_def]
20.257 - "((%h. (f(a + h) + - f(a))/h) -- #0 --> D) = \
20.258 + "((%h. (f(a + h) + - f(a))/h) -- Numeral0 --> D) = \
20.259 \ ((%x. (f(x) + -f(a)) / (x + -a)) -- a --> D)";
20.260 by Safe_tac;
20.261 by (ALLGOALS(dtac spec));
20.262 @@ -836,7 +836,7 @@
20.263
20.264 (*--- first equivalence ---*)
20.265 Goalw [nsderiv_def,NSLIM_def]
20.266 - "(NSDERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- #0 --NS> D)";
20.267 + "(NSDERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- Numeral0 --NS> D)";
20.268 by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero]));
20.269 by (dres_inst_tac [("x","xa")] bspec 1);
20.270 by (rtac ccontr 3);
20.271 @@ -956,12 +956,12 @@
20.272 ------------------------*)
20.273
20.274 (* use simple constant nslimit theorem *)
20.275 -Goal "(NSDERIV (%x. k) x :> #0)";
20.276 +Goal "(NSDERIV (%x. k) x :> Numeral0)";
20.277 by (simp_tac (simpset() addsimps [NSDERIV_NSLIM_iff]) 1);
20.278 qed "NSDERIV_const";
20.279 Addsimps [NSDERIV_const];
20.280
20.281 -Goal "(DERIV (%x. k) x :> #0)";
20.282 +Goal "(DERIV (%x. k) x :> Numeral0)";
20.283 by (simp_tac (simpset() addsimps [NSDERIV_DERIV_iff RS sym]) 1);
20.284 qed "DERIV_const";
20.285 Addsimps [DERIV_const];
20.286 @@ -1000,7 +1000,7 @@
20.287
20.288 Goal "[| (x + y) / z = hypreal_of_real D + yb; z \\<noteq> 0; \
20.289 \ z \\<in> Infinitesimal; yb \\<in> Infinitesimal |] \
20.290 -\ ==> x + y \\<approx> #0";
20.291 +\ ==> x + y \\<approx> Numeral0";
20.292 by (forw_inst_tac [("c1","z")] (hypreal_mult_right_cancel RS iffD2) 1
20.293 THEN assume_tac 1);
20.294 by (thin_tac "(x + y) / z = hypreal_of_real D + yb" 1);
20.295 @@ -1127,7 +1127,7 @@
20.296 qed "incrementI2";
20.297
20.298 (* The Increment theorem -- Keisler p. 65 *)
20.299 -Goal "[| NSDERIV f x :> D; h \\<in> Infinitesimal; h \\<noteq> #0 |] \
20.300 +Goal "[| NSDERIV f x :> D; h \\<in> Infinitesimal; h \\<noteq> Numeral0 |] \
20.301 \ ==> \\<exists>e \\<in> Infinitesimal. increment f x h = hypreal_of_real(D)*h + e*h";
20.302 by (forw_inst_tac [("h","h")] incrementI2 1 THEN rewtac nsderiv_def);
20.303 by (dtac bspec 1 THEN Auto_tac);
20.304 @@ -1143,15 +1143,15 @@
20.305 simpset() addsimps [hypreal_add_mult_distrib]));
20.306 qed "increment_thm";
20.307
20.308 -Goal "[| NSDERIV f x :> D; h \\<approx> #0; h \\<noteq> #0 |] \
20.309 +Goal "[| NSDERIV f x :> D; h \\<approx> Numeral0; h \\<noteq> Numeral0 |] \
20.310 \ ==> \\<exists>e \\<in> Infinitesimal. increment f x h = \
20.311 \ hypreal_of_real(D)*h + e*h";
20.312 by (blast_tac (claset() addSDs [mem_infmal_iff RS iffD2]
20.313 addSIs [increment_thm]) 1);
20.314 qed "increment_thm2";
20.315
20.316 -Goal "[| NSDERIV f x :> D; h \\<approx> #0; h \\<noteq> #0 |] \
20.317 -\ ==> increment f x h \\<approx> #0";
20.318 +Goal "[| NSDERIV f x :> D; h \\<approx> Numeral0; h \\<noteq> Numeral0 |] \
20.319 +\ ==> increment f x h \\<approx> Numeral0";
20.320 by (dtac increment_thm2 1 THEN auto_tac (claset() addSIs
20.321 [Infinitesimal_HFinite_mult2,HFinite_add],simpset() addsimps
20.322 [hypreal_add_mult_distrib RS sym,mem_infmal_iff RS sym]));
20.323 @@ -1172,16 +1172,16 @@
20.324 "[| NSDERIV g x :> D; \
20.325 \ (*f* g) (hypreal_of_real(x) + xa) = hypreal_of_real(g x);\
20.326 \ xa \\<in> Infinitesimal;\
20.327 -\ xa \\<noteq> #0 \
20.328 -\ |] ==> D = #0";
20.329 +\ xa \\<noteq> Numeral0 \
20.330 +\ |] ==> D = Numeral0";
20.331 by (dtac bspec 1);
20.332 by Auto_tac;
20.333 qed "NSDERIV_zero";
20.334
20.335 (* can be proved differently using NSLIM_isCont_iff *)
20.336 Goalw [nsderiv_def]
20.337 - "[| NSDERIV f x :> D; h \\<in> Infinitesimal; h \\<noteq> #0 |] \
20.338 -\ ==> (*f* f) (hypreal_of_real(x) + h) + -hypreal_of_real(f x) \\<approx> #0";
20.339 + "[| NSDERIV f x :> D; h \\<in> Infinitesimal; h \\<noteq> Numeral0 |] \
20.340 +\ ==> (*f* f) (hypreal_of_real(x) + h) + -hypreal_of_real(f x) \\<approx> Numeral0";
20.341 by (asm_full_simp_tac (simpset() addsimps
20.342 [mem_infmal_iff RS sym]) 1);
20.343 by (rtac Infinitesimal_ratio 1);
20.344 @@ -1214,7 +1214,7 @@
20.345 ----------------- \\<approx> Db
20.346 h
20.347 --------------------------------------------------------------*)
20.348 -Goal "[| NSDERIV g x :> Db; xa \\<in> Infinitesimal; xa \\<noteq> #0 |] \
20.349 +Goal "[| NSDERIV g x :> Db; xa \\<in> Infinitesimal; xa \\<noteq> Numeral0 |] \
20.350 \ ==> ((*f* g) (hypreal_of_real(x) + xa) + - hypreal_of_real(g x)) / xa \
20.351 \ \\<approx> hypreal_of_real(Db)";
20.352 by (auto_tac (claset(),
20.353 @@ -1266,7 +1266,7 @@
20.354 (*------------------------------------------------------------------
20.355 Differentiation of natural number powers
20.356 ------------------------------------------------------------------*)
20.357 -Goal "NSDERIV (%x. x) x :> #1";
20.358 +Goal "NSDERIV (%x. x) x :> Numeral1";
20.359 by (auto_tac (claset(),
20.360 simpset() addsimps [NSDERIV_NSLIM_iff,
20.361 NSLIM_def ,starfun_Id, hypreal_of_real_zero,
20.362 @@ -1275,7 +1275,7 @@
20.363 Addsimps [NSDERIV_Id];
20.364
20.365 (*derivative of the identity function*)
20.366 -Goal "DERIV (%x. x) x :> #1";
20.367 +Goal "DERIV (%x. x) x :> Numeral1";
20.368 by (simp_tac (simpset() addsimps [NSDERIV_DERIV_iff RS sym]) 1);
20.369 qed "DERIV_Id";
20.370 Addsimps [DERIV_Id];
20.371 @@ -1294,7 +1294,7 @@
20.372 qed "NSDERIV_cmult_Id";
20.373 Addsimps [NSDERIV_cmult_Id];
20.374
20.375 -Goal "DERIV (%x. x ^ n) x :> real n * (x ^ (n - 1'))";
20.376 +Goal "DERIV (%x. x ^ n) x :> real n * (x ^ (n - Suc 0))";
20.377 by (induct_tac "n" 1);
20.378 by (dtac (DERIV_Id RS DERIV_mult) 2);
20.379 by (auto_tac (claset(),
20.380 @@ -1306,7 +1306,7 @@
20.381 qed "DERIV_pow";
20.382
20.383 (* NS version *)
20.384 -Goal "NSDERIV (%x. x ^ n) x :> real n * (x ^ (n - 1'))";
20.385 +Goal "NSDERIV (%x. x ^ n) x :> real n * (x ^ (n - Suc 0))";
20.386 by (simp_tac (simpset() addsimps [NSDERIV_DERIV_iff, DERIV_pow]) 1);
20.387 qed "NSDERIV_pow";
20.388
20.389 @@ -1314,9 +1314,9 @@
20.390 Power of -1
20.391 ---------------------------------------------------------------*)
20.392
20.393 -(*Can't get rid of x \\<noteq> #0 because it isn't continuous at zero*)
20.394 +(*Can't get rid of x \\<noteq> Numeral0 because it isn't continuous at zero*)
20.395 Goalw [nsderiv_def]
20.396 - "x \\<noteq> #0 ==> NSDERIV (%x. inverse(x)) x :> (- (inverse x ^ 2))";
20.397 + "x \\<noteq> Numeral0 ==> NSDERIV (%x. inverse(x)) x :> (- (inverse x ^ Suc (Suc 0)))";
20.398 by (rtac ballI 1 THEN Asm_full_simp_tac 1 THEN Step_tac 1);
20.399 by (forward_tac [Infinitesimal_add_not_zero] 1);
20.400 by (asm_full_simp_tac (simpset() addsimps [hypreal_add_commute]) 2);
20.401 @@ -1345,7 +1345,7 @@
20.402 qed "NSDERIV_inverse";
20.403
20.404
20.405 -Goal "x \\<noteq> #0 ==> DERIV (%x. inverse(x)) x :> (-(inverse x ^ 2))";
20.406 +Goal "x \\<noteq> Numeral0 ==> DERIV (%x. inverse(x)) x :> (-(inverse x ^ Suc (Suc 0)))";
20.407 by (asm_simp_tac (simpset() addsimps [NSDERIV_inverse,
20.408 NSDERIV_DERIV_iff RS sym] delsimps [realpow_Suc]) 1);
20.409 qed "DERIV_inverse";
20.410 @@ -1353,8 +1353,8 @@
20.411 (*--------------------------------------------------------------
20.412 Derivative of inverse
20.413 -------------------------------------------------------------*)
20.414 -Goal "[| DERIV f x :> d; f(x) \\<noteq> #0 |] \
20.415 -\ ==> DERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ 2)))";
20.416 +Goal "[| DERIV f x :> d; f(x) \\<noteq> Numeral0 |] \
20.417 +\ ==> DERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ Suc (Suc 0))))";
20.418 by (rtac (real_mult_commute RS subst) 1);
20.419 by (asm_simp_tac (simpset() addsimps [real_minus_mult_eq1,
20.420 realpow_inverse] delsimps [realpow_Suc,
20.421 @@ -1363,8 +1363,8 @@
20.422 by (blast_tac (claset() addSIs [DERIV_chain,DERIV_inverse]) 1);
20.423 qed "DERIV_inverse_fun";
20.424
20.425 -Goal "[| NSDERIV f x :> d; f(x) \\<noteq> #0 |] \
20.426 -\ ==> NSDERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ 2)))";
20.427 +Goal "[| NSDERIV f x :> d; f(x) \\<noteq> Numeral0 |] \
20.428 +\ ==> NSDERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ Suc (Suc 0))))";
20.429 by (asm_full_simp_tac (simpset() addsimps [NSDERIV_DERIV_iff,
20.430 DERIV_inverse_fun] delsimps [realpow_Suc]) 1);
20.431 qed "NSDERIV_inverse_fun";
20.432 @@ -1372,8 +1372,8 @@
20.433 (*--------------------------------------------------------------
20.434 Derivative of quotient
20.435 -------------------------------------------------------------*)
20.436 -Goal "[| DERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> #0 |] \
20.437 -\ ==> DERIV (%y. f(y) / (g y)) x :> (d*g(x) + -(e*f(x))) / (g(x) ^ 2)";
20.438 +Goal "[| DERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> Numeral0 |] \
20.439 +\ ==> DERIV (%y. f(y) / (g y)) x :> (d*g(x) + -(e*f(x))) / (g(x) ^ Suc (Suc 0))";
20.440 by (dres_inst_tac [("f","g")] DERIV_inverse_fun 1);
20.441 by (dtac DERIV_mult 2);
20.442 by (REPEAT(assume_tac 1));
20.443 @@ -1384,9 +1384,9 @@
20.444 real_minus_mult_eq2 RS sym]) 1);
20.445 qed "DERIV_quotient";
20.446
20.447 -Goal "[| NSDERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> #0 |] \
20.448 +Goal "[| NSDERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> Numeral0 |] \
20.449 \ ==> NSDERIV (%y. f(y) / (g y)) x :> (d*g(x) \
20.450 -\ + -(e*f(x))) / (g(x) ^ 2)";
20.451 +\ + -(e*f(x))) / (g(x) ^ Suc (Suc 0))";
20.452 by (asm_full_simp_tac (simpset() addsimps [NSDERIV_DERIV_iff,
20.453 DERIV_quotient] delsimps [realpow_Suc]) 1);
20.454 qed "NSDERIV_quotient";
20.455 @@ -1401,7 +1401,7 @@
20.456 by (res_inst_tac
20.457 [("x","%z. if z = x then l else (f(z) - f(x)) / (z - x)")] exI 1);
20.458 by (auto_tac (claset(),simpset() addsimps [real_mult_assoc,
20.459 - ARITH_PROVE "z \\<noteq> x ==> z - x \\<noteq> (#0::real)"]));
20.460 + ARITH_PROVE "z \\<noteq> x ==> z - x \\<noteq> (Numeral0::real)"]));
20.461 by (auto_tac (claset(),simpset() addsimps [isCont_iff,DERIV_iff]));
20.462 by (ALLGOALS(rtac (LIM_equal RS iffD1)));
20.463 by (auto_tac (claset(),simpset() addsimps [real_diff_def,real_mult_assoc]));
20.464 @@ -1511,7 +1511,7 @@
20.465 Goal "[| \\<forall>n. f(n) \\<le> f(Suc n); \
20.466 \ \\<forall>n. g(Suc n) \\<le> g(n); \
20.467 \ \\<forall>n. f(n) \\<le> g(n); \
20.468 -\ (%n. f(n) - g(n)) ----> #0 |] \
20.469 +\ (%n. f(n) - g(n)) ----> Numeral0 |] \
20.470 \ ==> \\<exists>l. ((\\<forall>n. f(n) \\<le> l) & f ----> l) & \
20.471 \ ((\\<forall>n. l \\<le> g(n)) & g ----> l)";
20.472 by (dtac lemma_nest 1 THEN Auto_tac);
20.473 @@ -1544,15 +1544,15 @@
20.474 simpset() addsimps [Bolzano_bisect_le, Let_def, split_def]));
20.475 qed "Bolzano_bisect_Suc_le_snd";
20.476
20.477 -Goal "((x::real) = y / (#2 * z)) = (#2 * x = y/z)";
20.478 +Goal "((x::real) = y / (# 2 * z)) = (# 2 * x = y/z)";
20.479 by Auto_tac;
20.480 -by (dres_inst_tac [("f","%u. (#1/#2)*u")] arg_cong 1);
20.481 +by (dres_inst_tac [("f","%u. (Numeral1/# 2)*u")] arg_cong 1);
20.482 by Auto_tac;
20.483 qed "eq_divide_2_times_iff";
20.484
20.485 Goal "a \\<le> b ==> \
20.486 \ snd(Bolzano_bisect P a b n) - fst(Bolzano_bisect P a b n) = \
20.487 -\ (b-a) / (#2 ^ n)";
20.488 +\ (b-a) / (# 2 ^ n)";
20.489 by (induct_tac "n" 1);
20.490 by (auto_tac (claset(),
20.491 simpset() addsimps [eq_divide_2_times_iff, real_add_divide_distrib,
20.492 @@ -1589,7 +1589,7 @@
20.493
20.494
20.495 Goal "[| \\<forall>a b c. P(a,b) & P(b,c) & a \\<le> b & b \\<le> c --> P(a,c); \
20.496 -\ \\<forall>x. \\<exists>d::real. #0 < d & \
20.497 +\ \\<forall>x. \\<exists>d::real. Numeral0 < d & \
20.498 \ (\\<forall>a b. a \\<le> x & x \\<le> b & (b - a) < d --> P(a,b)); \
20.499 \ a \\<le> b |] \
20.500 \ ==> P(a,b)";
20.501 @@ -1604,8 +1604,8 @@
20.502 by (rename_tac "l" 1);
20.503 by (dres_inst_tac [("x","l")] spec 1 THEN Clarify_tac 1);
20.504 by (rewtac LIMSEQ_def);
20.505 -by (dres_inst_tac [("P", "%r. #0<r --> ?Q r"), ("x","d/#2")] spec 1);
20.506 -by (dres_inst_tac [("P", "%r. #0<r --> ?Q r"), ("x","d/#2")] spec 1);
20.507 +by (dres_inst_tac [("P", "%r. Numeral0<r --> ?Q r"), ("x","d/# 2")] spec 1);
20.508 +by (dres_inst_tac [("P", "%r. Numeral0<r --> ?Q r"), ("x","d/# 2")] spec 1);
20.509 by (dtac real_less_half_sum 1);
20.510 by Safe_tac;
20.511 (*linear arithmetic bug if we just use Asm_simp_tac*)
20.512 @@ -1626,7 +1626,7 @@
20.513
20.514
20.515 Goal "((\\<forall>a b c. (a \\<le> b & b \\<le> c & P(a,b) & P(b,c)) --> P(a,c)) & \
20.516 -\ (\\<forall>x. \\<exists>d::real. #0 < d & \
20.517 +\ (\\<forall>x. \\<exists>d::real. Numeral0 < d & \
20.518 \ (\\<forall>a b. a \\<le> x & x \\<le> b & (b - a) < d --> P(a,b)))) \
20.519 \ --> (\\<forall>a b. a \\<le> b --> P(a,b))";
20.520 by (Clarify_tac 1);
20.521 @@ -1654,14 +1654,14 @@
20.522 by (rtac ccontr 1);
20.523 by (subgoal_tac "a \\<le> x & x \\<le> b" 1);
20.524 by (Asm_full_simp_tac 2);
20.525 -by (dres_inst_tac [("P", "%d. #0<d --> ?P d"),("x","#1")] spec 2);
20.526 +by (dres_inst_tac [("P", "%d. Numeral0<d --> ?P d"),("x","Numeral1")] spec 2);
20.527 by (Step_tac 2);
20.528 by (Asm_full_simp_tac 2);
20.529 by (Asm_full_simp_tac 2);
20.530 by (REPEAT(blast_tac (claset() addIs [order_trans]) 2));
20.531 by (REPEAT(dres_inst_tac [("x","x")] spec 1));
20.532 by (Asm_full_simp_tac 1);
20.533 -by (dres_inst_tac [("P", "%r. ?P r --> (\\<exists>s. #0<s & ?Q r s)"),
20.534 +by (dres_inst_tac [("P", "%r. ?P r --> (\\<exists>s. Numeral0<s & ?Q r s)"),
20.535 ("x","abs(y - f x)")] spec 1);
20.536 by Safe_tac;
20.537 by (asm_full_simp_tac (simpset() addsimps []) 1);
20.538 @@ -1738,15 +1738,15 @@
20.539 by (cut_inst_tac [("x","xb"),("y","xa")] linorder_linear 1);
20.540 by (Force_tac 1);
20.541 by (case_tac "a \\<le> x & x \\<le> b" 1);
20.542 -by (res_inst_tac [("x","#1")] exI 2);
20.543 +by (res_inst_tac [("x","Numeral1")] exI 2);
20.544 by (Force_tac 2);
20.545 by (asm_full_simp_tac (simpset() addsimps [LIM_def,isCont_iff]) 1);
20.546 by (dres_inst_tac [("x","x")] spec 1 THEN Auto_tac);
20.547 by (thin_tac "\\<forall>M. \\<exists>x. a \\<le> x & x \\<le> b & ~ f x \\<le> M" 1);
20.548 -by (dres_inst_tac [("x","#1")] spec 1);
20.549 +by (dres_inst_tac [("x","Numeral1")] spec 1);
20.550 by Auto_tac;
20.551 by (res_inst_tac [("x","s")] exI 1 THEN Clarify_tac 1);
20.552 -by (res_inst_tac [("x","abs(f x) + #1")] exI 1 THEN Clarify_tac 1);
20.553 +by (res_inst_tac [("x","abs(f x) + Numeral1")] exI 1 THEN Clarify_tac 1);
20.554 by (dres_inst_tac [("x","xa - x")] spec 1 THEN Safe_tac);
20.555 by (arith_tac 1);
20.556 by (arith_tac 1);
20.557 @@ -1803,23 +1803,23 @@
20.558 "\\<exists>k. \\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x \\<le> k" 1);
20.559 by (rtac isCont_bounded 2);
20.560 by Safe_tac;
20.561 -by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> #0 < inverse(M - f(x))" 1);
20.562 +by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> Numeral0 < inverse(M - f(x))" 1);
20.563 by (Asm_full_simp_tac 1);
20.564 by Safe_tac;
20.565 by (asm_full_simp_tac (simpset() addsimps [real_less_diff_eq]) 2);
20.566 by (subgoal_tac
20.567 - "\\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x < (k + #1)" 1);
20.568 + "\\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x < (k + Numeral1)" 1);
20.569 by Safe_tac;
20.570 by (res_inst_tac [("y","k")] order_le_less_trans 2);
20.571 by (asm_full_simp_tac (simpset() addsimps [real_zero_less_one]) 3);
20.572 by (Asm_full_simp_tac 2);
20.573 by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> \
20.574 -\ inverse(k + #1) < inverse((%x. inverse(M - (f x))) x)" 1);
20.575 +\ inverse(k + Numeral1) < inverse((%x. inverse(M - (f x))) x)" 1);
20.576 by Safe_tac;
20.577 by (rtac real_inverse_less_swap 2);
20.578 by (ALLGOALS Asm_full_simp_tac);
20.579 by (dres_inst_tac [("P", "%N. N<M --> ?Q N"),
20.580 - ("x","M - inverse(k + #1)")] spec 1);
20.581 + ("x","M - inverse(k + Numeral1)")] spec 1);
20.582 by (Step_tac 1 THEN dtac real_leI 1);
20.583 by (dtac (real_le_diff_eq RS iffD1) 1);
20.584 by (REPEAT(dres_inst_tac [("x","a")] spec 1));
20.585 @@ -1879,11 +1879,11 @@
20.586 (*----------------------------------------------------------------------------*)
20.587
20.588 Goalw [deriv_def,LIM_def]
20.589 - "[| DERIV f x :> l; #0 < l |] ==> \
20.590 -\ \\<exists>d. #0 < d & (\\<forall>h. #0 < h & h < d --> f(x) < f(x + h))";
20.591 + "[| DERIV f x :> l; Numeral0 < l |] ==> \
20.592 +\ \\<exists>d. Numeral0 < d & (\\<forall>h. Numeral0 < h & h < d --> f(x) < f(x + h))";
20.593 by (dtac spec 1 THEN Auto_tac);
20.594 by (res_inst_tac [("x","s")] exI 1 THEN Auto_tac);
20.595 -by (subgoal_tac "#0 < l*h" 1);
20.596 +by (subgoal_tac "Numeral0 < l*h" 1);
20.597 by (asm_full_simp_tac (simpset() addsimps [real_0_less_mult_iff]) 2);
20.598 by (dres_inst_tac [("x","h")] spec 1);
20.599 by (asm_full_simp_tac
20.600 @@ -1893,11 +1893,11 @@
20.601 qed "DERIV_left_inc";
20.602
20.603 Goalw [deriv_def,LIM_def]
20.604 - "[| DERIV f x :> l; l < #0 |] ==> \
20.605 -\ \\<exists>d. #0 < d & (\\<forall>h. #0 < h & h < d --> f(x) < f(x - h))";
20.606 + "[| DERIV f x :> l; l < Numeral0 |] ==> \
20.607 +\ \\<exists>d. Numeral0 < d & (\\<forall>h. Numeral0 < h & h < d --> f(x) < f(x - h))";
20.608 by (dres_inst_tac [("x","-l")] spec 1 THEN Auto_tac);
20.609 by (res_inst_tac [("x","s")] exI 1 THEN Auto_tac);
20.610 -by (subgoal_tac "l*h < #0" 1);
20.611 +by (subgoal_tac "l*h < Numeral0" 1);
20.612 by (asm_full_simp_tac (simpset() addsimps [real_mult_less_0_iff]) 2);
20.613 by (dres_inst_tac [("x","-h")] spec 1);
20.614 by (asm_full_simp_tac
20.615 @@ -1905,7 +1905,7 @@
20.616 pos_real_less_divide_eq,
20.617 symmetric real_diff_def]
20.618 addsplits [split_if_asm]) 1);
20.619 -by (subgoal_tac "#0 < (f (x - h) - f x)/h" 1);
20.620 +by (subgoal_tac "Numeral0 < (f (x - h) - f x)/h" 1);
20.621 by (arith_tac 2);
20.622 by (asm_full_simp_tac
20.623 (simpset() addsimps [pos_real_less_divide_eq]) 1);
20.624 @@ -1913,9 +1913,9 @@
20.625
20.626
20.627 Goal "[| DERIV f x :> l; \
20.628 -\ \\<exists>d. #0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)) |] \
20.629 -\ ==> l = #0";
20.630 -by (res_inst_tac [("R1.0","l"),("R2.0","#0")] real_linear_less2 1);
20.631 +\ \\<exists>d. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)) |] \
20.632 +\ ==> l = Numeral0";
20.633 +by (res_inst_tac [("R1.0","l"),("R2.0","Numeral0")] real_linear_less2 1);
20.634 by Safe_tac;
20.635 by (dtac DERIV_left_dec 1);
20.636 by (dtac DERIV_left_inc 3);
20.637 @@ -1933,8 +1933,8 @@
20.638 (*----------------------------------------------------------------------------*)
20.639
20.640 Goal "[| DERIV f x :> l; \
20.641 -\ \\<exists>d::real. #0 < d & (\\<forall>y. abs(x - y) < d --> f(x) \\<le> f(y)) |] \
20.642 -\ ==> l = #0";
20.643 +\ \\<exists>d::real. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(x) \\<le> f(y)) |] \
20.644 +\ ==> l = Numeral0";
20.645 by (dtac (DERIV_minus RS DERIV_local_max) 1);
20.646 by Auto_tac;
20.647 qed "DERIV_local_min";
20.648 @@ -1944,8 +1944,8 @@
20.649 (*----------------------------------------------------------------------------*)
20.650
20.651 Goal "[| DERIV f x :> l; \
20.652 -\ \\<exists>d. #0 < d & (\\<forall>y. abs(x - y) < d --> f(x) = f(y)) |] \
20.653 -\ ==> l = #0";
20.654 +\ \\<exists>d. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(x) = f(y)) |] \
20.655 +\ ==> l = Numeral0";
20.656 by (auto_tac (claset() addSDs [DERIV_local_max],simpset()));
20.657 qed "DERIV_local_const";
20.658
20.659 @@ -1954,7 +1954,7 @@
20.660 (*----------------------------------------------------------------------------*)
20.661
20.662 Goal "[| a < x; x < b |] ==> \
20.663 -\ \\<exists>d::real. #0 < d & (\\<forall>y. abs(x - y) < d --> a < y & y < b)";
20.664 +\ \\<exists>d::real. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> a < y & y < b)";
20.665 by (simp_tac (simpset() addsimps [abs_interval_iff]) 1);
20.666 by (cut_inst_tac [("x","x - a"),("y","b - x")] linorder_linear 1);
20.667 by Safe_tac;
20.668 @@ -1965,7 +1965,7 @@
20.669 qed "lemma_interval_lt";
20.670
20.671 Goal "[| a < x; x < b |] ==> \
20.672 -\ \\<exists>d::real. #0 < d & (\\<forall>y. abs(x - y) < d --> a \\<le> y & y \\<le> b)";
20.673 +\ \\<exists>d::real. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> a \\<le> y & y \\<le> b)";
20.674 by (dtac lemma_interval_lt 1);
20.675 by Auto_tac;
20.676 by (auto_tac (claset() addSIs [exI] ,simpset()));
20.677 @@ -1975,13 +1975,13 @@
20.678 Rolle's Theorem
20.679 If f is defined and continuous on the finite closed interval [a,b]
20.680 and differentiable a least on the open interval (a,b), and f(a) = f(b),
20.681 - then x0 \\<in> (a,b) such that f'(x0) = #0
20.682 + then x0 \\<in> (a,b) such that f'(x0) = Numeral0
20.683 ----------------------------------------------------------------------*)
20.684
20.685 Goal "[| a < b; f(a) = f(b); \
20.686 \ \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
20.687 \ \\<forall>x. a < x & x < b --> f differentiable x \
20.688 -\ |] ==> \\<exists>z. a < z & z < b & DERIV f z :> #0";
20.689 +\ |] ==> \\<exists>z. a < z & z < b & DERIV f z :> Numeral0";
20.690 by (ftac (order_less_imp_le RS isCont_eq_Ub) 1);
20.691 by (EVERY1[assume_tac,Step_tac]);
20.692 by (ftac (order_less_imp_le RS isCont_eq_Lb) 1);
20.693 @@ -1992,7 +1992,7 @@
20.694 by (EVERY1[assume_tac,etac exE]);
20.695 by (res_inst_tac [("x","x")] exI 1 THEN Asm_full_simp_tac 1);
20.696 by (subgoal_tac "(\\<exists>l. DERIV f x :> l) & \
20.697 -\ (\\<exists>d. #0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)))" 1);
20.698 +\ (\\<exists>d. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)))" 1);
20.699 by (Clarify_tac 1 THEN rtac conjI 2);
20.700 by (blast_tac (claset() addIs [differentiableD]) 2);
20.701 by (Blast_tac 2);
20.702 @@ -2004,7 +2004,7 @@
20.703 by (EVERY1[assume_tac,etac exE]);
20.704 by (res_inst_tac [("x","xa")] exI 1 THEN Asm_full_simp_tac 1);
20.705 by (subgoal_tac "(\\<exists>l. DERIV f xa :> l) & \
20.706 -\ (\\<exists>d. #0 < d & (\\<forall>y. abs(xa - y) < d --> f(xa) \\<le> f(y)))" 1);
20.707 +\ (\\<exists>d. Numeral0 < d & (\\<forall>y. abs(xa - y) < d --> f(xa) \\<le> f(y)))" 1);
20.708 by (Clarify_tac 1 THEN rtac conjI 2);
20.709 by (blast_tac (claset() addIs [differentiableD]) 2);
20.710 by (Blast_tac 2);
20.711 @@ -2030,7 +2030,7 @@
20.712 by (forw_inst_tac [("a","a"),("x","r")] lemma_interval 1);
20.713 by (EVERY1[assume_tac, etac exE]);
20.714 by (subgoal_tac "(\\<exists>l. DERIV f r :> l) & \
20.715 -\ (\\<exists>d. #0 < d & (\\<forall>y. abs(r - y) < d --> f(r) = f(y)))" 1);
20.716 +\ (\\<exists>d. Numeral0 < d & (\\<forall>y. abs(r - y) < d --> f(r) = f(y)))" 1);
20.717 by (Clarify_tac 1 THEN rtac conjI 2);
20.718 by (blast_tac (claset() addIs [differentiableD]) 2);
20.719 by (EVERY1[ftac DERIV_local_const, Blast_tac, Blast_tac]);
20.720 @@ -2098,7 +2098,7 @@
20.721
20.722 Goal "[| a < b; \
20.723 \ \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
20.724 -\ \\<forall>x. a < x & x < b --> DERIV f x :> #0 |] \
20.725 +\ \\<forall>x. a < x & x < b --> DERIV f x :> Numeral0 |] \
20.726 \ ==> (f b = f a)";
20.727 by (dtac MVT 1 THEN assume_tac 1);
20.728 by (blast_tac (claset() addIs [differentiableI]) 1);
20.729 @@ -2108,7 +2108,7 @@
20.730
20.731 Goal "[| a < b; \
20.732 \ \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
20.733 -\ \\<forall>x. a < x & x < b --> DERIV f x :> #0 |] \
20.734 +\ \\<forall>x. a < x & x < b --> DERIV f x :> Numeral0 |] \
20.735 \ ==> \\<forall>x. a \\<le> x & x \\<le> b --> f x = f a";
20.736 by Safe_tac;
20.737 by (dres_inst_tac [("x","a")] order_le_imp_less_or_eq 1);
20.738 @@ -2119,13 +2119,13 @@
20.739
20.740 Goal "[| a < b; \
20.741 \ \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
20.742 -\ \\<forall>x. a < x & x < b --> DERIV f x :> #0; \
20.743 +\ \\<forall>x. a < x & x < b --> DERIV f x :> Numeral0; \
20.744 \ a \\<le> x; x \\<le> b |] \
20.745 \ ==> f x = f a";
20.746 by (blast_tac (claset() addDs [DERIV_isconst1]) 1);
20.747 qed "DERIV_isconst2";
20.748
20.749 -Goal "\\<forall>x. DERIV f x :> #0 ==> f(x) = f(y)";
20.750 +Goal "\\<forall>x. DERIV f x :> Numeral0 ==> f(x) = f(y)";
20.751 by (res_inst_tac [("R1.0","x"),("R2.0","y")] real_linear_less2 1);
20.752 by (rtac sym 1);
20.753 by (auto_tac (claset() addIs [DERIV_isCont,DERIV_isconst_end],simpset()));
20.754 @@ -2148,12 +2148,12 @@
20.755 simpset() addsimps [real_mult_assoc]));
20.756 qed "DERIV_const_ratio_const2";
20.757
20.758 -Goal "((a + b) /#2 - a) = (b - a)/(#2::real)";
20.759 +Goal "((a + b) /# 2 - a) = (b - a)/(# 2::real)";
20.760 by Auto_tac;
20.761 qed "real_average_minus_first";
20.762 Addsimps [real_average_minus_first];
20.763
20.764 -Goal "((b + a)/#2 - a) = (b - a)/(#2::real)";
20.765 +Goal "((b + a)/# 2 - a) = (b - a)/(# 2::real)";
20.766 by Auto_tac;
20.767 qed "real_average_minus_second";
20.768 Addsimps [real_average_minus_second];
20.769 @@ -2161,7 +2161,7 @@
20.770
20.771 (* Gallileo's "trick": average velocity = av. of end velocities *)
20.772 Goal "[|a \\<noteq> (b::real); \\<forall>x. DERIV v x :> k|] \
20.773 -\ ==> v((a + b)/#2) = (v a + v b)/#2";
20.774 +\ ==> v((a + b)/# 2) = (v a + v b)/# 2";
20.775 by (res_inst_tac [("R1.0","a"),("R2.0","b")] real_linear_less2 1);
20.776 by Auto_tac;
20.777 by (ftac DERIV_const_ratio_const2 1 THEN assume_tac 1);
20.778 @@ -2182,7 +2182,7 @@
20.779 (* maximum at an end point, not in the middle. *)
20.780 (* ------------------------------------------------------------------------ *)
20.781
20.782 -Goal "[|#0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
20.783 +Goal "[|Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
20.784 \ \\<forall>z. abs(z - x) \\<le> d --> isCont f z |] \
20.785 \ ==> ~(\\<forall>z. abs(z - x) \\<le> d --> f(z) \\<le> f(x))";
20.786 by (rtac notI 1);
20.787 @@ -2221,7 +2221,7 @@
20.788 (* Similar version for lower bound *)
20.789 (* ------------------------------------------------------------------------ *)
20.790
20.791 -Goal "[|#0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
20.792 +Goal "[|Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
20.793 \ \\<forall>z. abs(z - x) \\<le> d --> isCont f z |] \
20.794 \ ==> ~(\\<forall>z. abs(z - x) \\<le> d --> f(x) \\<le> f(z))";
20.795 by (auto_tac (claset() addSDs [(asm_full_simplify (simpset())
20.796 @@ -2236,12 +2236,12 @@
20.797
20.798 Addsimps [zero_eq_numeral_0,one_eq_numeral_1];
20.799
20.800 -val lemma_le = ARITH_PROVE "#0 \\<le> (d::real) ==> -d \\<le> d";
20.801 +val lemma_le = ARITH_PROVE "Numeral0 \\<le> (d::real) ==> -d \\<le> d";
20.802
20.803 (* FIXME: awful proof - needs improvement *)
20.804 -Goal "[| #0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
20.805 +Goal "[| Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
20.806 \ \\<forall>z. abs(z - x) \\<le> d --> isCont f z |] \
20.807 -\ ==> \\<exists>e. #0 < e & \
20.808 +\ ==> \\<exists>e. Numeral0 < e & \
20.809 \ (\\<forall>y. \
20.810 \ abs(y - f(x)) \\<le> e --> \
20.811 \ (\\<exists>z. abs(z - x) \\<le> d & (f z = y)))";
20.812 @@ -2255,8 +2255,8 @@
20.813 by (Asm_full_simp_tac 2);
20.814 by (subgoal_tac "L < f x & f x < M" 1);
20.815 by Safe_tac;
20.816 -by (dres_inst_tac [("x","L")] (ARITH_PROVE "x < y ==> #0 < y - (x::real)") 1);
20.817 -by (dres_inst_tac [("x","f x")] (ARITH_PROVE "x < y ==> #0 < y - (x::real)") 1);
20.818 +by (dres_inst_tac [("x","L")] (ARITH_PROVE "x < y ==> Numeral0 < y - (x::real)") 1);
20.819 +by (dres_inst_tac [("x","f x")] (ARITH_PROVE "x < y ==> Numeral0 < y - (x::real)") 1);
20.820 by (dres_inst_tac [("d1.0","f x - L"),("d2.0","M - f x")]
20.821 (rename_numerals real_lbound_gt_zero) 1);
20.822 by Safe_tac;
20.823 @@ -2284,7 +2284,7 @@
20.824 (* Continuity of inverse function *)
20.825 (* ------------------------------------------------------------------------ *)
20.826
20.827 -Goal "[| #0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f(z)) = z; \
20.828 +Goal "[| Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f(z)) = z; \
20.829 \ \\<forall>z. abs(z - x) \\<le> d --> isCont f z |] \
20.830 \ ==> isCont g (f x)";
20.831 by (simp_tac (simpset() addsimps [isCont_iff,LIM_def]) 1);
21.1 --- a/src/HOL/Hyperreal/Lim.thy Fri Oct 05 21:50:37 2001 +0200
21.2 +++ b/src/HOL/Hyperreal/Lim.thy Fri Oct 05 21:52:39 2001 +0200
21.3 @@ -15,8 +15,8 @@
21.4 LIM :: [real=>real,real,real] => bool
21.5 ("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60)
21.6 "f -- a --> L ==
21.7 - ALL r. #0 < r -->
21.8 - (EX s. #0 < s & (ALL x. (x ~= a & (abs(x + -a) < s)
21.9 + ALL r. Numeral0 < r -->
21.10 + (EX s. Numeral0 < s & (ALL x. (x ~= a & (abs(x + -a) < s)
21.11 --> abs(f x + -L) < r)))"
21.12
21.13 NSLIM :: [real=>real,real,real] => bool
21.14 @@ -36,7 +36,7 @@
21.15 (* differentiation: D is derivative of function f at x *)
21.16 deriv:: [real=>real,real,real] => bool
21.17 ("(DERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
21.18 - "DERIV f x :> D == ((%h. (f(x + h) + -f(x))/h) -- #0 --> D)"
21.19 + "DERIV f x :> D == ((%h. (f(x + h) + -f(x))/h) -- Numeral0 --> D)"
21.20
21.21 nsderiv :: [real=>real,real,real] => bool
21.22 ("(NSDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
21.23 @@ -55,8 +55,8 @@
21.24 inc = (*f* f)(hypreal_of_real x + h) + -hypreal_of_real (f x))"
21.25
21.26 isUCont :: (real=>real) => bool
21.27 - "isUCont f == (ALL r. #0 < r -->
21.28 - (EX s. #0 < s & (ALL x y. abs(x + -y) < s
21.29 + "isUCont f == (ALL r. Numeral0 < r -->
21.30 + (EX s. Numeral0 < s & (ALL x y. abs(x + -y) < s
21.31 --> abs(f x + -f y) < r)))"
21.32
21.33 isNSUCont :: (real=>real) => bool
21.34 @@ -71,8 +71,8 @@
21.35 "Bolzano_bisect P a b 0 = (a,b)"
21.36 "Bolzano_bisect P a b (Suc n) =
21.37 (let (x,y) = Bolzano_bisect P a b n
21.38 - in if P(x, (x+y)/#2) then ((x+y)/#2, y)
21.39 - else (x, (x+y)/#2) )"
21.40 + in if P(x, (x+y)/# 2) then ((x+y)/# 2, y)
21.41 + else (x, (x+y)/# 2) )"
21.42
21.43
21.44 end
22.1 --- a/src/HOL/Hyperreal/NSA.ML Fri Oct 05 21:50:37 2001 +0200
22.2 +++ b/src/HOL/Hyperreal/NSA.ML Fri Oct 05 21:52:39 2001 +0200
22.3 @@ -211,9 +211,9 @@
22.4
22.5 Goalw [SReal_def,HFinite_def] "Reals <= HFinite";
22.6 by Auto_tac;
22.7 -by (res_inst_tac [("x","#1 + abs(hypreal_of_real r)")] exI 1);
22.8 +by (res_inst_tac [("x","Numeral1 + abs(hypreal_of_real r)")] exI 1);
22.9 by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_hrabs]));
22.10 -by (res_inst_tac [("x","#1 + abs r")] exI 1);
22.11 +by (res_inst_tac [("x","Numeral1 + abs r")] exI 1);
22.12 by (Simp_tac 1);
22.13 qed "SReal_subset_HFinite";
22.14
22.15 @@ -238,8 +238,8 @@
22.16 qed "HFinite_number_of";
22.17 Addsimps [HFinite_number_of];
22.18
22.19 -Goal "[|x : HFinite; y <= x; #0 <= y |] ==> y: HFinite";
22.20 -by (case_tac "x <= #0" 1);
22.21 +Goal "[|x : HFinite; y <= x; Numeral0 <= y |] ==> y: HFinite";
22.22 +by (case_tac "x <= Numeral0" 1);
22.23 by (dres_inst_tac [("y","x")] order_trans 1);
22.24 by (dtac hypreal_le_anti_sym 2);
22.25 by (auto_tac (claset() addSDs [not_hypreal_leE], simpset()));
22.26 @@ -251,20 +251,20 @@
22.27 Set of infinitesimals is a subring of the hyperreals
22.28 ------------------------------------------------------------------*)
22.29 Goalw [Infinitesimal_def]
22.30 - "x : Infinitesimal ==> ALL r: Reals. #0 < r --> abs x < r";
22.31 + "x : Infinitesimal ==> ALL r: Reals. Numeral0 < r --> abs x < r";
22.32 by Auto_tac;
22.33 qed "InfinitesimalD";
22.34
22.35 -Goalw [Infinitesimal_def] "#0 : Infinitesimal";
22.36 +Goalw [Infinitesimal_def] "Numeral0 : Infinitesimal";
22.37 by (simp_tac (simpset() addsimps [hrabs_zero]) 1);
22.38 qed "Infinitesimal_zero";
22.39 AddIffs [Infinitesimal_zero];
22.40
22.41 -Goal "x/(#2::hypreal) + x/(#2::hypreal) = x";
22.42 +Goal "x/(# 2::hypreal) + x/(# 2::hypreal) = x";
22.43 by Auto_tac;
22.44 qed "hypreal_sum_of_halves";
22.45
22.46 -Goal "#0 < r ==> #0 < r/(#2::hypreal)";
22.47 +Goal "Numeral0 < r ==> Numeral0 < r/(# 2::hypreal)";
22.48 by Auto_tac;
22.49 qed "hypreal_half_gt_zero";
22.50
22.51 @@ -290,8 +290,8 @@
22.52 Goalw [Infinitesimal_def]
22.53 "[| x : Infinitesimal; y : Infinitesimal |] ==> (x * y) : Infinitesimal";
22.54 by Auto_tac;
22.55 -by (case_tac "y=#0" 1);
22.56 -by (cut_inst_tac [("u","abs x"),("v","#1"),("x","abs y"),("y","r")]
22.57 +by (case_tac "y=Numeral0" 1);
22.58 +by (cut_inst_tac [("u","abs x"),("v","Numeral1"),("x","abs y"),("y","r")]
22.59 hypreal_mult_less_mono 2);
22.60 by Auto_tac;
22.61 qed "Infinitesimal_mult";
22.62 @@ -332,27 +332,27 @@
22.63
22.64 Goalw [HInfinite_def] "[|x: HInfinite;y: HInfinite|] ==> (x*y): HInfinite";
22.65 by Auto_tac;
22.66 -by (eres_inst_tac [("x","#1")] ballE 1);
22.67 +by (eres_inst_tac [("x","Numeral1")] ballE 1);
22.68 by (eres_inst_tac [("x","r")] ballE 1);
22.69 by (case_tac "y=0" 1);
22.70 -by (cut_inst_tac [("x","#1"),("y","abs x"),
22.71 +by (cut_inst_tac [("x","Numeral1"),("y","abs x"),
22.72 ("u","r"),("v","abs y")] hypreal_mult_less_mono 2);
22.73 by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac));
22.74 qed "HInfinite_mult";
22.75
22.76 Goalw [HInfinite_def]
22.77 - "[|x: HInfinite; #0 <= y; #0 <= x|] ==> (x + y): HInfinite";
22.78 + "[|x: HInfinite; Numeral0 <= y; Numeral0 <= x|] ==> (x + y): HInfinite";
22.79 by (auto_tac (claset() addSIs [hypreal_add_zero_less_le_mono],
22.80 simpset() addsimps [hrabs_eqI1, hypreal_add_commute,
22.81 hypreal_le_add_order]));
22.82 qed "HInfinite_add_ge_zero";
22.83
22.84 -Goal "[|x: HInfinite; #0 <= y; #0 <= x|] ==> (y + x): HInfinite";
22.85 +Goal "[|x: HInfinite; Numeral0 <= y; Numeral0 <= x|] ==> (y + x): HInfinite";
22.86 by (auto_tac (claset() addSIs [HInfinite_add_ge_zero],
22.87 simpset() addsimps [hypreal_add_commute]));
22.88 qed "HInfinite_add_ge_zero2";
22.89
22.90 -Goal "[|x: HInfinite; #0 < y; #0 < x|] ==> (x + y): HInfinite";
22.91 +Goal "[|x: HInfinite; Numeral0 < y; Numeral0 < x|] ==> (x + y): HInfinite";
22.92 by (blast_tac (claset() addIs [HInfinite_add_ge_zero,
22.93 order_less_imp_le]) 1);
22.94 qed "HInfinite_add_gt_zero";
22.95 @@ -361,14 +361,14 @@
22.96 by Auto_tac;
22.97 qed "HInfinite_minus_iff";
22.98
22.99 -Goal "[|x: HInfinite; y <= #0; x <= #0|] ==> (x + y): HInfinite";
22.100 +Goal "[|x: HInfinite; y <= Numeral0; x <= Numeral0|] ==> (x + y): HInfinite";
22.101 by (dtac (HInfinite_minus_iff RS iffD2) 1);
22.102 by (rtac (HInfinite_minus_iff RS iffD1) 1);
22.103 by (auto_tac (claset() addIs [HInfinite_add_ge_zero],
22.104 simpset() addsimps [hypreal_minus_zero_le_iff]));
22.105 qed "HInfinite_add_le_zero";
22.106
22.107 -Goal "[|x: HInfinite; y < #0; x < #0|] ==> (x + y): HInfinite";
22.108 +Goal "[|x: HInfinite; y < Numeral0; x < Numeral0|] ==> (x + y): HInfinite";
22.109 by (blast_tac (claset() addIs [HInfinite_add_le_zero,
22.110 order_less_imp_le]) 1);
22.111 qed "HInfinite_add_lt_zero";
22.112 @@ -378,11 +378,11 @@
22.113 by (auto_tac (claset() addIs [HFinite_mult,HFinite_add], simpset()));
22.114 qed "HFinite_sum_squares";
22.115
22.116 -Goal "x ~: Infinitesimal ==> x ~= #0";
22.117 +Goal "x ~: Infinitesimal ==> x ~= Numeral0";
22.118 by Auto_tac;
22.119 qed "not_Infinitesimal_not_zero";
22.120
22.121 -Goal "x: HFinite - Infinitesimal ==> x ~= #0";
22.122 +Goal "x: HFinite - Infinitesimal ==> x ~= Numeral0";
22.123 by Auto_tac;
22.124 qed "not_Infinitesimal_not_zero2";
22.125
22.126 @@ -441,7 +441,7 @@
22.127 by (fast_tac (claset() addDs [not_Infinitesimal_mult]) 1);
22.128 qed "Infinitesimal_mult_disj";
22.129
22.130 -Goal "x: HFinite-Infinitesimal ==> x ~= #0";
22.131 +Goal "x: HFinite-Infinitesimal ==> x ~= Numeral0";
22.132 by (Blast_tac 1);
22.133 qed "HFinite_Infinitesimal_not_zero";
22.134
22.135 @@ -455,7 +455,7 @@
22.136 Goalw [Infinitesimal_def,HFinite_def]
22.137 "Infinitesimal <= HFinite";
22.138 by Auto_tac;
22.139 -by (res_inst_tac [("x","#1")] bexI 1);
22.140 +by (res_inst_tac [("x","Numeral1")] bexI 1);
22.141 by Auto_tac;
22.142 qed "Infinitesimal_subset_HFinite";
22.143
22.144 @@ -474,15 +474,15 @@
22.145 ----------------------------------------------------------------------*)
22.146
22.147 Goalw [Infinitesimal_def,approx_def]
22.148 - "(x:Infinitesimal) = (x @= #0)";
22.149 + "(x:Infinitesimal) = (x @= Numeral0)";
22.150 by (Simp_tac 1);
22.151 qed "mem_infmal_iff";
22.152
22.153 -Goalw [approx_def]" (x @= y) = (x + -y @= #0)";
22.154 +Goalw [approx_def]" (x @= y) = (x + -y @= Numeral0)";
22.155 by (Simp_tac 1);
22.156 qed "approx_minus_iff";
22.157
22.158 -Goalw [approx_def]" (x @= y) = (-y + x @= #0)";
22.159 +Goalw [approx_def]" (x @= y) = (-y + x @= Numeral0)";
22.160 by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
22.161 qed "approx_minus_iff2";
22.162
22.163 @@ -704,36 +704,36 @@
22.164 approx_hypreal_of_real_HFinite,HFinite_hypreal_of_real]) 1);
22.165 qed "approx_mult_hypreal_of_real";
22.166
22.167 -Goal "[| a: Reals; a ~= #0; a*x @= #0 |] ==> x @= #0";
22.168 +Goal "[| a: Reals; a ~= Numeral0; a*x @= Numeral0 |] ==> x @= Numeral0";
22.169 by (dtac (SReal_inverse RS (SReal_subset_HFinite RS subsetD)) 1);
22.170 by (auto_tac (claset() addDs [approx_mult2],
22.171 simpset() addsimps [hypreal_mult_assoc RS sym]));
22.172 qed "approx_SReal_mult_cancel_zero";
22.173
22.174 (* REM comments: newly added *)
22.175 -Goal "[| a: Reals; x @= #0 |] ==> x*a @= #0";
22.176 +Goal "[| a: Reals; x @= Numeral0 |] ==> x*a @= Numeral0";
22.177 by (auto_tac (claset() addDs [(SReal_subset_HFinite RS subsetD),
22.178 approx_mult1], simpset()));
22.179 qed "approx_mult_SReal1";
22.180
22.181 -Goal "[| a: Reals; x @= #0 |] ==> a*x @= #0";
22.182 +Goal "[| a: Reals; x @= Numeral0 |] ==> a*x @= Numeral0";
22.183 by (auto_tac (claset() addDs [(SReal_subset_HFinite RS subsetD),
22.184 approx_mult2], simpset()));
22.185 qed "approx_mult_SReal2";
22.186
22.187 -Goal "[|a : Reals; a ~= #0 |] ==> (a*x @= #0) = (x @= #0)";
22.188 +Goal "[|a : Reals; a ~= Numeral0 |] ==> (a*x @= Numeral0) = (x @= Numeral0)";
22.189 by (blast_tac (claset() addIs [approx_SReal_mult_cancel_zero,
22.190 approx_mult_SReal2]) 1);
22.191 qed "approx_mult_SReal_zero_cancel_iff";
22.192 Addsimps [approx_mult_SReal_zero_cancel_iff];
22.193
22.194 -Goal "[| a: Reals; a ~= #0; a* w @= a*z |] ==> w @= z";
22.195 +Goal "[| a: Reals; a ~= Numeral0; a* w @= a*z |] ==> w @= z";
22.196 by (dtac (SReal_inverse RS (SReal_subset_HFinite RS subsetD)) 1);
22.197 by (auto_tac (claset() addDs [approx_mult2],
22.198 simpset() addsimps [hypreal_mult_assoc RS sym]));
22.199 qed "approx_SReal_mult_cancel";
22.200
22.201 -Goal "[| a: Reals; a ~= #0|] ==> (a* w @= a*z) = (w @= z)";
22.202 +Goal "[| a: Reals; a ~= Numeral0|] ==> (a* w @= a*z) = (w @= z)";
22.203 by (auto_tac (claset() addSIs [approx_mult2,SReal_subset_HFinite RS subsetD]
22.204 addIs [approx_SReal_mult_cancel], simpset()));
22.205 qed "approx_SReal_mult_cancel_iff1";
22.206 @@ -754,50 +754,50 @@
22.207 -----------------------------------------------------------------*)
22.208
22.209 Goalw [Infinitesimal_def]
22.210 - "[| x: Reals; y: Infinitesimal; #0 < x |] ==> y < x";
22.211 + "[| x: Reals; y: Infinitesimal; Numeral0 < x |] ==> y < x";
22.212 by (rtac (hrabs_ge_self RS order_le_less_trans) 1);
22.213 by Auto_tac;
22.214 qed "Infinitesimal_less_SReal";
22.215
22.216 -Goal "y: Infinitesimal ==> ALL r: Reals. #0 < r --> y < r";
22.217 +Goal "y: Infinitesimal ==> ALL r: Reals. Numeral0 < r --> y < r";
22.218 by (blast_tac (claset() addIs [Infinitesimal_less_SReal]) 1);
22.219 qed "Infinitesimal_less_SReal2";
22.220
22.221 Goalw [Infinitesimal_def]
22.222 - "[| #0 < y; y: Reals|] ==> y ~: Infinitesimal";
22.223 + "[| Numeral0 < y; y: Reals|] ==> y ~: Infinitesimal";
22.224 by (auto_tac (claset(), simpset() addsimps [hrabs_def]));
22.225 qed "SReal_not_Infinitesimal";
22.226
22.227 -Goal "[| y < #0; y : Reals |] ==> y ~: Infinitesimal";
22.228 +Goal "[| y < Numeral0; y : Reals |] ==> y ~: Infinitesimal";
22.229 by (stac (Infinitesimal_minus_iff RS sym) 1);
22.230 by (rtac SReal_not_Infinitesimal 1);
22.231 by Auto_tac;
22.232 qed "SReal_minus_not_Infinitesimal";
22.233
22.234 -Goal "Reals Int Infinitesimal = {#0}";
22.235 +Goal "Reals Int Infinitesimal = {Numeral0}";
22.236 by Auto_tac;
22.237 -by (cut_inst_tac [("x","x"),("y","#0")] hypreal_linear 1);
22.238 +by (cut_inst_tac [("x","x"),("y","Numeral0")] hypreal_linear 1);
22.239 by (blast_tac (claset() addDs [SReal_not_Infinitesimal,
22.240 SReal_minus_not_Infinitesimal]) 1);
22.241 qed "SReal_Int_Infinitesimal_zero";
22.242
22.243 -Goal "[| x: Reals; x: Infinitesimal|] ==> x = #0";
22.244 +Goal "[| x: Reals; x: Infinitesimal|] ==> x = Numeral0";
22.245 by (cut_facts_tac [SReal_Int_Infinitesimal_zero] 1);
22.246 by (Blast_tac 1);
22.247 qed "SReal_Infinitesimal_zero";
22.248
22.249 -Goal "[| x : Reals; x ~= #0 |] ==> x : HFinite - Infinitesimal";
22.250 +Goal "[| x : Reals; x ~= Numeral0 |] ==> x : HFinite - Infinitesimal";
22.251 by (auto_tac (claset() addDs [SReal_Infinitesimal_zero,
22.252 SReal_subset_HFinite RS subsetD],
22.253 simpset()));
22.254 qed "SReal_HFinite_diff_Infinitesimal";
22.255
22.256 -Goal "hypreal_of_real x ~= #0 ==> hypreal_of_real x : HFinite - Infinitesimal";
22.257 +Goal "hypreal_of_real x ~= Numeral0 ==> hypreal_of_real x : HFinite - Infinitesimal";
22.258 by (rtac SReal_HFinite_diff_Infinitesimal 1);
22.259 by Auto_tac;
22.260 qed "hypreal_of_real_HFinite_diff_Infinitesimal";
22.261
22.262 -Goal "(hypreal_of_real x : Infinitesimal) = (x=#0)";
22.263 +Goal "(hypreal_of_real x : Infinitesimal) = (x=Numeral0)";
22.264 by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero]));
22.265 by (rtac ccontr 1);
22.266 by (rtac (hypreal_of_real_HFinite_diff_Infinitesimal RS DiffD2) 1);
22.267 @@ -805,12 +805,12 @@
22.268 qed "hypreal_of_real_Infinitesimal_iff_0";
22.269 AddIffs [hypreal_of_real_Infinitesimal_iff_0];
22.270
22.271 -Goal "number_of w ~= (#0::hypreal) ==> number_of w ~: Infinitesimal";
22.272 +Goal "number_of w ~= (Numeral0::hypreal) ==> number_of w ~: Infinitesimal";
22.273 by (fast_tac (claset() addDs [SReal_number_of RS SReal_Infinitesimal_zero]) 1);
22.274 qed "number_of_not_Infinitesimal";
22.275 Addsimps [number_of_not_Infinitesimal];
22.276
22.277 -Goal "[| y: Reals; x @= y; y~= #0 |] ==> x ~= #0";
22.278 +Goal "[| y: Reals; x @= y; y~= Numeral0 |] ==> x ~= Numeral0";
22.279 by (cut_inst_tac [("x","y")] hypreal_trichotomy 1);
22.280 by (Asm_full_simp_tac 1);
22.281 by (blast_tac (claset() addDs
22.282 @@ -828,7 +828,7 @@
22.283
22.284 (*The premise y~=0 is essential; otherwise x/y =0 and we lose the
22.285 HFinite premise.*)
22.286 -Goal "[| y ~= #0; y: Infinitesimal; x/y : HFinite |] ==> x : Infinitesimal";
22.287 +Goal "[| y ~= Numeral0; y: Infinitesimal; x/y : HFinite |] ==> x : Infinitesimal";
22.288 by (dtac Infinitesimal_HFinite_mult2 1);
22.289 by (assume_tac 1);
22.290 by (asm_full_simp_tac
22.291 @@ -912,7 +912,7 @@
22.292 lemma_st_part_nonempty, lemma_st_part_subset]) 1);
22.293 qed "lemma_st_part_lub";
22.294
22.295 -Goal "((t::hypreal) + r <= t) = (r <= #0)";
22.296 +Goal "((t::hypreal) + r <= t) = (r <= Numeral0)";
22.297 by (Step_tac 1);
22.298 by (dres_inst_tac [("x","-t")] hypreal_add_left_le_mono1 1);
22.299 by (dres_inst_tac [("x","t")] hypreal_add_left_le_mono1 2);
22.300 @@ -920,7 +920,7 @@
22.301 qed "lemma_hypreal_le_left_cancel";
22.302
22.303 Goal "[| x: HFinite; isLub Reals {s. s: Reals & s < x} t; \
22.304 -\ r: Reals; #0 < r |] ==> x <= t + r";
22.305 +\ r: Reals; Numeral0 < r |] ==> x <= t + r";
22.306 by (forward_tac [isLubD1a] 1);
22.307 by (rtac ccontr 1 THEN dtac (linorder_not_le RS iffD2) 1);
22.308 by (dres_inst_tac [("x","t")] SReal_add 1 THEN assume_tac 1);
22.309 @@ -945,14 +945,14 @@
22.310 addIs [order_less_imp_le] addSIs [isUbI,setleI], simpset()));
22.311 qed "lemma_st_part_gt_ub";
22.312
22.313 -Goal "t <= t + -r ==> r <= (#0::hypreal)";
22.314 +Goal "t <= t + -r ==> r <= (Numeral0::hypreal)";
22.315 by (dres_inst_tac [("x","-t")] hypreal_add_left_le_mono1 1);
22.316 by (auto_tac (claset(), simpset() addsimps [hypreal_add_assoc RS sym]));
22.317 qed "lemma_minus_le_zero";
22.318
22.319 Goal "[| x: HFinite; \
22.320 \ isLub Reals {s. s: Reals & s < x} t; \
22.321 -\ r: Reals; #0 < r |] \
22.322 +\ r: Reals; Numeral0 < r |] \
22.323 \ ==> t + -r <= x";
22.324 by (forward_tac [isLubD1a] 1);
22.325 by (rtac ccontr 1 THEN dtac not_hypreal_leE 1);
22.326 @@ -970,7 +970,7 @@
22.327
22.328 Goal "[| x: HFinite; \
22.329 \ isLub Reals {s. s: Reals & s < x} t; \
22.330 -\ r: Reals; #0 < r |] \
22.331 +\ r: Reals; Numeral0 < r |] \
22.332 \ ==> x + -t <= r";
22.333 by (blast_tac (claset() addSIs [lemma_hypreal_le_swap RS iffD1,
22.334 lemma_st_part_le1]) 1);
22.335 @@ -982,7 +982,7 @@
22.336
22.337 Goal "[| x: HFinite; \
22.338 \ isLub Reals {s. s: Reals & s < x} t; \
22.339 -\ r: Reals; #0 < r |] \
22.340 +\ r: Reals; Numeral0 < r |] \
22.341 \ ==> -(x + -t) <= r";
22.342 by (blast_tac (claset() addSIs [lemma_hypreal_le_swap2 RS iffD1,
22.343 lemma_st_part_le2]) 1);
22.344 @@ -1004,7 +1004,7 @@
22.345
22.346 Goal "[| x: HFinite; \
22.347 \ isLub Reals {s. s: Reals & s < x} t; \
22.348 -\ r: Reals; #0 < r |] \
22.349 +\ r: Reals; Numeral0 < r |] \
22.350 \ ==> x + -t ~= r";
22.351 by Auto_tac;
22.352 by (forward_tac [isLubD1a RS SReal_minus] 1);
22.353 @@ -1016,7 +1016,7 @@
22.354
22.355 Goal "[| x: HFinite; \
22.356 \ isLub Reals {s. s: Reals & s < x} t; \
22.357 -\ r: Reals; #0 < r |] \
22.358 +\ r: Reals; Numeral0 < r |] \
22.359 \ ==> -(x + -t) ~= r";
22.360 by (auto_tac (claset(), simpset() addsimps [hypreal_minus_add_distrib]));
22.361 by (forward_tac [isLubD1a] 1);
22.362 @@ -1030,7 +1030,7 @@
22.363
22.364 Goal "[| x: HFinite; \
22.365 \ isLub Reals {s. s: Reals & s < x} t; \
22.366 -\ r: Reals; #0 < r |] \
22.367 +\ r: Reals; Numeral0 < r |] \
22.368 \ ==> abs (x + -t) < r";
22.369 by (forward_tac [lemma_st_part1a] 1);
22.370 by (forward_tac [lemma_st_part2a] 4);
22.371 @@ -1042,7 +1042,7 @@
22.372
22.373 Goal "[| x: HFinite; \
22.374 \ isLub Reals {s. s: Reals & s < x} t |] \
22.375 -\ ==> ALL r: Reals. #0 < r --> abs (x + -t) < r";
22.376 +\ ==> ALL r: Reals. Numeral0 < r --> abs (x + -t) < r";
22.377 by (blast_tac (claset() addSDs [lemma_st_part_major]) 1);
22.378 qed "lemma_st_part_major2";
22.379
22.380 @@ -1050,7 +1050,7 @@
22.381 Existence of real and Standard Part Theorem
22.382 ----------------------------------------------*)
22.383 Goal "x: HFinite ==> \
22.384 -\ EX t: Reals. ALL r: Reals. #0 < r --> abs (x + -t) < r";
22.385 +\ EX t: Reals. ALL r: Reals. Numeral0 < r --> abs (x + -t) < r";
22.386 by (forward_tac [lemma_st_part_lub] 1 THEN Step_tac 1);
22.387 by (forward_tac [isLubD1a] 1);
22.388 by (blast_tac (claset() addDs [lemma_st_part_major2]) 1);
22.389 @@ -1089,7 +1089,7 @@
22.390
22.391 Goalw [HInfinite_def, HFinite_def] "x~: HFinite ==> x: HInfinite";
22.392 by Auto_tac;
22.393 -by (dres_inst_tac [("x","r + #1")] bspec 1);
22.394 +by (dres_inst_tac [("x","r + Numeral1")] bspec 1);
22.395 by (auto_tac (claset(), simpset() addsimps [SReal_add]));
22.396 qed "not_HFinite_HInfinite";
22.397
22.398 @@ -1241,16 +1241,16 @@
22.399 by Auto_tac;
22.400 qed "mem_monad_iff";
22.401
22.402 -Goalw [monad_def] "(x:Infinitesimal) = (x:monad #0)";
22.403 +Goalw [monad_def] "(x:Infinitesimal) = (x:monad Numeral0)";
22.404 by (auto_tac (claset() addIs [approx_sym],
22.405 simpset() addsimps [mem_infmal_iff]));
22.406 qed "Infinitesimal_monad_zero_iff";
22.407
22.408 -Goal "(x:monad #0) = (-x:monad #0)";
22.409 +Goal "(x:monad Numeral0) = (-x:monad Numeral0)";
22.410 by (simp_tac (simpset() addsimps [Infinitesimal_monad_zero_iff RS sym]) 1);
22.411 qed "monad_zero_minus_iff";
22.412
22.413 -Goal "(x:monad #0) = (abs x:monad #0)";
22.414 +Goal "(x:monad Numeral0) = (abs x:monad Numeral0)";
22.415 by (res_inst_tac [("x1","x")] (hrabs_disj RS disjE) 1);
22.416 by (auto_tac (claset(), simpset() addsimps [monad_zero_minus_iff RS sym]));
22.417 qed "monad_zero_hrabs_iff";
22.418 @@ -1286,7 +1286,7 @@
22.419 by (blast_tac (claset() addSIs [approx_sym]) 1);
22.420 qed "approx_mem_monad2";
22.421
22.422 -Goal "[| x @= y;x:monad #0 |] ==> y:monad #0";
22.423 +Goal "[| x @= y;x:monad Numeral0 |] ==> y:monad Numeral0";
22.424 by (dtac mem_monad_approx 1);
22.425 by (fast_tac (claset() addIs [approx_mem_monad,approx_trans]) 1);
22.426 qed "approx_mem_monad_zero";
22.427 @@ -1297,7 +1297,7 @@
22.428 monad_zero_hrabs_iff RS iffD1, mem_monad_approx, approx_trans3]) 1);
22.429 qed "Infinitesimal_approx_hrabs";
22.430
22.431 -Goal "[| #0 < x; x ~:Infinitesimal; e :Infinitesimal |] ==> e < x";
22.432 +Goal "[| Numeral0 < x; x ~:Infinitesimal; e :Infinitesimal |] ==> e < x";
22.433 by (rtac ccontr 1);
22.434 by (auto_tac (claset()
22.435 addIs [Infinitesimal_zero RSN (2, Infinitesimal_interval)]
22.436 @@ -1305,38 +1305,38 @@
22.437 simpset()));
22.438 qed "less_Infinitesimal_less";
22.439
22.440 -Goal "[| #0 < x; x ~: Infinitesimal; u: monad x |] ==> #0 < u";
22.441 +Goal "[| Numeral0 < x; x ~: Infinitesimal; u: monad x |] ==> Numeral0 < u";
22.442 by (dtac (mem_monad_approx RS approx_sym) 1);
22.443 by (etac (bex_Infinitesimal_iff2 RS iffD2 RS bexE) 1);
22.444 by (dres_inst_tac [("e","-xa")] less_Infinitesimal_less 1);
22.445 by Auto_tac;
22.446 qed "Ball_mem_monad_gt_zero";
22.447
22.448 -Goal "[| x < #0; x ~: Infinitesimal; u: monad x |] ==> u < #0";
22.449 +Goal "[| x < Numeral0; x ~: Infinitesimal; u: monad x |] ==> u < Numeral0";
22.450 by (dtac (mem_monad_approx RS approx_sym) 1);
22.451 by (etac (bex_Infinitesimal_iff RS iffD2 RS bexE) 1);
22.452 by (cut_inst_tac [("x","-x"),("e","xa")] less_Infinitesimal_less 1);
22.453 by Auto_tac;
22.454 qed "Ball_mem_monad_less_zero";
22.455
22.456 -Goal "[|#0 < x; x ~: Infinitesimal; x @= y|] ==> #0 < y";
22.457 +Goal "[|Numeral0 < x; x ~: Infinitesimal; x @= y|] ==> Numeral0 < y";
22.458 by (blast_tac (claset() addDs [Ball_mem_monad_gt_zero,
22.459 approx_subset_monad]) 1);
22.460 qed "lemma_approx_gt_zero";
22.461
22.462 -Goal "[|x < #0; x ~: Infinitesimal; x @= y|] ==> y < #0";
22.463 +Goal "[|x < Numeral0; x ~: Infinitesimal; x @= y|] ==> y < Numeral0";
22.464 by (blast_tac (claset() addDs [Ball_mem_monad_less_zero,
22.465 approx_subset_monad]) 1);
22.466 qed "lemma_approx_less_zero";
22.467
22.468 -Goal "[| x @= y; x < #0; x ~: Infinitesimal |] ==> abs x @= abs y";
22.469 +Goal "[| x @= y; x < Numeral0; x ~: Infinitesimal |] ==> abs x @= abs y";
22.470 by (forward_tac [lemma_approx_less_zero] 1);
22.471 by (REPEAT(assume_tac 1));
22.472 by (REPEAT(dtac hrabs_minus_eqI2 1));
22.473 by Auto_tac;
22.474 qed "approx_hrabs1";
22.475
22.476 -Goal "[| x @= y; #0 < x; x ~: Infinitesimal |] ==> abs x @= abs y";
22.477 +Goal "[| x @= y; Numeral0 < x; x ~: Infinitesimal |] ==> abs x @= abs y";
22.478 by (forward_tac [lemma_approx_gt_zero] 1);
22.479 by (REPEAT(assume_tac 1));
22.480 by (REPEAT(dtac hrabs_eqI2 1));
22.481 @@ -1345,12 +1345,12 @@
22.482
22.483 Goal "x @= y ==> abs x @= abs y";
22.484 by (res_inst_tac [("Q","x:Infinitesimal")] (excluded_middle RS disjE) 1);
22.485 -by (res_inst_tac [("x1","x"),("y1","#0")] (hypreal_linear RS disjE) 1);
22.486 +by (res_inst_tac [("x1","x"),("y1","Numeral0")] (hypreal_linear RS disjE) 1);
22.487 by (auto_tac (claset() addIs [approx_hrabs1,approx_hrabs2,
22.488 Infinitesimal_approx_hrabs], simpset()));
22.489 qed "approx_hrabs";
22.490
22.491 -Goal "abs(x) @= #0 ==> x @= #0";
22.492 +Goal "abs(x) @= Numeral0 ==> x @= Numeral0";
22.493 by (cut_inst_tac [("x","x")] hrabs_disj 1);
22.494 by (auto_tac (claset() addDs [approx_minus], simpset()));
22.495 qed "approx_hrabs_zero_cancel";
22.496 @@ -1445,7 +1445,7 @@
22.497 hypreal_of_real_le_add_Infininitesimal_cancel]) 1);
22.498 qed "hypreal_of_real_le_add_Infininitesimal_cancel2";
22.499
22.500 -Goal "[| hypreal_of_real x < e; e: Infinitesimal |] ==> hypreal_of_real x <= #0";
22.501 +Goal "[| hypreal_of_real x < e; e: Infinitesimal |] ==> hypreal_of_real x <= Numeral0";
22.502 by (rtac hypreal_leI 1 THEN Step_tac 1);
22.503 by (dtac Infinitesimal_interval 1);
22.504 by (dtac (SReal_hypreal_of_real RS SReal_Infinitesimal_zero) 4);
22.505 @@ -1453,7 +1453,7 @@
22.506 qed "hypreal_of_real_less_Infinitesimal_le_zero";
22.507
22.508 (*used once, in NSDERIV_inverse*)
22.509 -Goal "[| h: Infinitesimal; x ~= #0 |] ==> hypreal_of_real x + h ~= #0";
22.510 +Goal "[| h: Infinitesimal; x ~= Numeral0 |] ==> hypreal_of_real x + h ~= Numeral0";
22.511 by Auto_tac;
22.512 qed "Infinitesimal_add_not_zero";
22.513
22.514 @@ -1524,7 +1524,7 @@
22.515 qed "HFinite_sum_square_cancel3";
22.516 Addsimps [HFinite_sum_square_cancel3];
22.517
22.518 -Goal "[| y: monad x; #0 < hypreal_of_real e |] \
22.519 +Goal "[| y: monad x; Numeral0 < hypreal_of_real e |] \
22.520 \ ==> abs (y + -x) < hypreal_of_real e";
22.521 by (dtac (mem_monad_approx RS approx_sym) 1);
22.522 by (dtac (bex_Infinitesimal_iff RS iffD2) 1);
22.523 @@ -1682,18 +1682,18 @@
22.524 by (blast_tac (claset() addSIs [lemma_st_mult]) 1);
22.525 qed "st_mult";
22.526
22.527 -Goal "x: Infinitesimal ==> st x = #0";
22.528 +Goal "x: Infinitesimal ==> st x = Numeral0";
22.529 by (rtac (st_number_of RS subst) 1);
22.530 by (rtac approx_st_eq 1);
22.531 by (auto_tac (claset() addIs [Infinitesimal_subset_HFinite RS subsetD],
22.532 simpset() addsimps [mem_infmal_iff RS sym]));
22.533 qed "st_Infinitesimal";
22.534
22.535 -Goal "st(x) ~= #0 ==> x ~: Infinitesimal";
22.536 +Goal "st(x) ~= Numeral0 ==> x ~: Infinitesimal";
22.537 by (fast_tac (claset() addIs [st_Infinitesimal]) 1);
22.538 qed "st_not_Infinitesimal";
22.539
22.540 -Goal "[| x: HFinite; st x ~= #0 |] \
22.541 +Goal "[| x: HFinite; st x ~= Numeral0 |] \
22.542 \ ==> st(inverse x) = inverse (st x)";
22.543 by (res_inst_tac [("c1","st x")] (hypreal_mult_left_cancel RS iffD1) 1);
22.544 by (auto_tac (claset(),
22.545 @@ -1703,7 +1703,7 @@
22.546 by Auto_tac;
22.547 qed "st_inverse";
22.548
22.549 -Goal "[| x: HFinite; y: HFinite; st y ~= #0 |] \
22.550 +Goal "[| x: HFinite; y: HFinite; st y ~= Numeral0 |] \
22.551 \ ==> st(x/y) = (st x) / (st y)";
22.552 by (auto_tac (claset(),
22.553 simpset() addsimps [hypreal_divide_def, st_mult, st_not_Infinitesimal,
22.554 @@ -1747,20 +1747,20 @@
22.555 simpset() addsimps [hypreal_add_assoc RS sym]));
22.556 qed "st_le";
22.557
22.558 -Goal "[| #0 <= x; x: HFinite |] ==> #0 <= st x";
22.559 +Goal "[| Numeral0 <= x; x: HFinite |] ==> Numeral0 <= st x";
22.560 by (rtac (st_number_of RS subst) 1);
22.561 by (auto_tac (claset() addIs [st_le],
22.562 simpset() delsimps [st_number_of]));
22.563 qed "st_zero_le";
22.564
22.565 -Goal "[| x <= #0; x: HFinite |] ==> st x <= #0";
22.566 +Goal "[| x <= Numeral0; x: HFinite |] ==> st x <= Numeral0";
22.567 by (rtac (st_number_of RS subst) 1);
22.568 by (auto_tac (claset() addIs [st_le],
22.569 simpset() delsimps [st_number_of]));
22.570 qed "st_zero_ge";
22.571
22.572 Goal "x: HFinite ==> abs(st x) = st(abs x)";
22.573 -by (case_tac "#0 <= x" 1);
22.574 +by (case_tac "Numeral0 <= x" 1);
22.575 by (auto_tac (claset() addSDs [not_hypreal_leE, order_less_imp_le],
22.576 simpset() addsimps [st_zero_le,hrabs_eqI1, hrabs_minus_eqI1,
22.577 st_zero_ge,st_minus]));
22.578 @@ -1834,7 +1834,7 @@
22.579 by Auto_tac;
22.580 qed "lemma_Int_eq1";
22.581
22.582 -Goal "{n. abs (xa n) = u} <= {n. abs (xa n) < u + (#1::real)}";
22.583 +Goal "{n. abs (xa n) = u} <= {n. abs (xa n) < u + (Numeral1::real)}";
22.584 by Auto_tac;
22.585 qed "lemma_FreeUltrafilterNat_one";
22.586
22.587 @@ -1847,7 +1847,7 @@
22.588 \ |] ==> x: HFinite";
22.589 by (rtac FreeUltrafilterNat_HFinite 1);
22.590 by (res_inst_tac [("x","xa")] bexI 1);
22.591 -by (res_inst_tac [("x","u + #1")] exI 1);
22.592 +by (res_inst_tac [("x","u + Numeral1")] exI 1);
22.593 by (Ultra_tac 1 THEN assume_tac 1);
22.594 qed "FreeUltrafilterNat_const_Finite";
22.595
22.596 @@ -1915,7 +1915,7 @@
22.597
22.598 Goalw [Infinitesimal_def]
22.599 "x : Infinitesimal ==> EX X: Rep_hypreal x. \
22.600 -\ ALL u. #0 < u --> {n. abs (X n) < u}: FreeUltrafilterNat";
22.601 +\ ALL u. Numeral0 < u --> {n. abs (X n) < u}: FreeUltrafilterNat";
22.602 by (auto_tac (claset(), simpset() addsimps [hrabs_interval_iff]));
22.603 by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
22.604 by (EVERY[Auto_tac, rtac bexI 1, rtac lemma_hyprel_refl 2, Step_tac 1]);
22.605 @@ -1930,7 +1930,7 @@
22.606
22.607 Goalw [Infinitesimal_def]
22.608 "EX X: Rep_hypreal x. \
22.609 -\ ALL u. #0 < u --> {n. abs (X n) < u} : FreeUltrafilterNat \
22.610 +\ ALL u. Numeral0 < u --> {n. abs (X n) < u} : FreeUltrafilterNat \
22.611 \ ==> x : Infinitesimal";
22.612 by (auto_tac (claset(),
22.613 simpset() addsimps [hrabs_interval_iff,abs_interval_iff]));
22.614 @@ -1942,7 +1942,7 @@
22.615 qed "FreeUltrafilterNat_Infinitesimal";
22.616
22.617 Goal "(x : Infinitesimal) = (EX X: Rep_hypreal x. \
22.618 -\ ALL u. #0 < u --> {n. abs (X n) < u}: FreeUltrafilterNat)";
22.619 +\ ALL u. Numeral0 < u --> {n. abs (X n) < u}: FreeUltrafilterNat)";
22.620 by (blast_tac (claset() addSIs [Infinitesimal_FreeUltrafilterNat,
22.621 FreeUltrafilterNat_Infinitesimal]) 1);
22.622 qed "Infinitesimal_FreeUltrafilterNat_iff";
22.623 @@ -1951,13 +1951,13 @@
22.624 Infinitesimals as smaller than 1/n for all n::nat (> 0)
22.625 ------------------------------------------------------------------------*)
22.626
22.627 -Goal "(ALL r. #0 < r --> x < r) = (ALL n. x < inverse(real (Suc n)))";
22.628 +Goal "(ALL r. Numeral0 < r --> x < r) = (ALL n. x < inverse(real (Suc n)))";
22.629 by (auto_tac (claset(), simpset() addsimps [real_of_nat_Suc_gt_zero]));
22.630 by (blast_tac (claset() addSDs [reals_Archimedean]
22.631 addIs [order_less_trans]) 1);
22.632 qed "lemma_Infinitesimal";
22.633
22.634 -Goal "(ALL r: Reals. #0 < r --> x < r) = \
22.635 +Goal "(ALL r: Reals. Numeral0 < r --> x < r) = \
22.636 \ (ALL n. x < inverse(hypreal_of_nat (Suc n)))";
22.637 by (Step_tac 1);
22.638 by (dres_inst_tac [("x","inverse (hypreal_of_real(real (Suc n)))")]
22.639 @@ -2089,7 +2089,7 @@
22.640 qed "HFinite_epsilon";
22.641 Addsimps [HFinite_epsilon];
22.642
22.643 -Goal "epsilon @= #0";
22.644 +Goal "epsilon @= Numeral0";
22.645 by (simp_tac (simpset() addsimps [mem_infmal_iff RS sym]) 1);
22.646 qed "epsilon_approx_zero";
22.647 Addsimps [epsilon_approx_zero];
22.648 @@ -2109,7 +2109,7 @@
22.649 by (simp_tac (simpset() addsimps [real_of_nat_Suc_gt_zero]) 1);
22.650 qed "real_of_nat_less_inverse_iff";
22.651
22.652 -Goal "#0 < u ==> finite {n. u < inverse(real(Suc n))}";
22.653 +Goal "Numeral0 < u ==> finite {n. u < inverse(real(Suc n))}";
22.654 by (asm_simp_tac (simpset() addsimps [real_of_nat_less_inverse_iff]) 1);
22.655 by (asm_simp_tac (simpset() addsimps [real_of_nat_Suc,
22.656 real_less_diff_eq RS sym]) 1);
22.657 @@ -2122,7 +2122,7 @@
22.658 simpset() addsimps [order_less_imp_le]));
22.659 qed "lemma_real_le_Un_eq2";
22.660
22.661 -Goal "(inverse (real(Suc n)) <= r) = (#1 <= r * real(Suc n))";
22.662 +Goal "(inverse (real(Suc n)) <= r) = (Numeral1 <= r * real(Suc n))";
22.663 by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1);
22.664 by (simp_tac (simpset() addsimps [real_inverse_eq_divide]) 1);
22.665 by (stac pos_real_less_divide_eq 1);
22.666 @@ -2138,18 +2138,18 @@
22.667
22.668 Goal "finite {n::nat. u = inverse(real(Suc n))}";
22.669 by (asm_simp_tac (simpset() addsimps [real_of_nat_inverse_eq_iff]) 1);
22.670 -by (cut_inst_tac [("x","inverse u - #1")] lemma_finite_omega_set 1);
22.671 +by (cut_inst_tac [("x","inverse u - Numeral1")] lemma_finite_omega_set 1);
22.672 by (asm_full_simp_tac (simpset() addsimps [real_of_nat_Suc,
22.673 real_diff_eq_eq RS sym, eq_commute]) 1);
22.674 qed "lemma_finite_omega_set2";
22.675
22.676 -Goal "#0 < u ==> finite {n. u <= inverse(real(Suc n))}";
22.677 +Goal "Numeral0 < u ==> finite {n. u <= inverse(real(Suc n))}";
22.678 by (auto_tac (claset(),
22.679 simpset() addsimps [lemma_real_le_Un_eq2,lemma_finite_omega_set2,
22.680 finite_inverse_real_of_posnat_gt_real]));
22.681 qed "finite_inverse_real_of_posnat_ge_real";
22.682
22.683 -Goal "#0 < u ==> \
22.684 +Goal "Numeral0 < u ==> \
22.685 \ {n. u <= inverse(real(Suc n))} ~: FreeUltrafilterNat";
22.686 by (blast_tac (claset() addSIs [FreeUltrafilterNat_finite,
22.687 finite_inverse_real_of_posnat_ge_real]) 1);
22.688 @@ -2166,7 +2166,7 @@
22.689 simpset() addsimps [not_real_leE]));
22.690 val lemma = result();
22.691
22.692 -Goal "#0 < u ==> \
22.693 +Goal "Numeral0 < u ==> \
22.694 \ {n. inverse(real(Suc n)) < u} : FreeUltrafilterNat";
22.695 by (cut_inst_tac [("u","u")] inverse_real_of_posnat_ge_real_FreeUltrafilterNat 1);
22.696 by (auto_tac (claset() addDs [FreeUltrafilterNat_Compl_mem],
23.1 --- a/src/HOL/Hyperreal/NatStar.ML Fri Oct 05 21:50:37 2001 +0200
23.2 +++ b/src/HOL/Hyperreal/NatStar.ML Fri Oct 05 21:52:39 2001 +0200
23.3 @@ -404,7 +404,7 @@
23.4 Goal "N : HNatInfinite \
23.5 \ ==> (*fNat* (%x::nat. inverse(real x))) N = inverse(hypreal_of_hypnat N)";
23.6 by (res_inst_tac [("f1","inverse")] (starfun_stafunNat_o2 RS subst) 1);
23.7 -by (subgoal_tac "hypreal_of_hypnat N ~= #0" 1);
23.8 +by (subgoal_tac "hypreal_of_hypnat N ~= Numeral0" 1);
23.9 by (auto_tac (claset(),
23.10 simpset() addsimps [starfunNat_real_of_nat, starfun_inverse_inverse]));
23.11 qed "starfunNat_inverse_real_of_nat_eq";
24.1 --- a/src/HOL/Hyperreal/SEQ.ML Fri Oct 05 21:50:37 2001 +0200
24.2 +++ b/src/HOL/Hyperreal/SEQ.ML Fri Oct 05 21:52:39 2001 +0200
24.3 @@ -26,7 +26,7 @@
24.4
24.5 Goalw [LIMSEQ_def]
24.6 "(X ----> L) = \
24.7 -\ (ALL r. #0 <r --> (EX no. ALL n. no <= n --> abs(X n + -L) < r))";
24.8 +\ (ALL r. Numeral0 <r --> (EX no. ALL n. no <= n --> abs(X n + -L) < r))";
24.9 by (Simp_tac 1);
24.10 qed "LIMSEQ_iff";
24.11
24.12 @@ -120,7 +120,7 @@
24.13 by Auto_tac;
24.14 val lemmaLIM2 = result();
24.15
24.16 -Goal "[| #0 < r; ALL n. r <= abs (X (f n) + - L); \
24.17 +Goal "[| Numeral0 < r; ALL n. r <= abs (X (f n) + - L); \
24.18 \ (*fNat* X) (Abs_hypnat (hypnatrel `` {f})) + \
24.19 \ - hypreal_of_real L @= 0 |] ==> False";
24.20 by (auto_tac (claset(),simpset() addsimps [starfunNat,
24.21 @@ -234,7 +234,7 @@
24.22 Proof is like that of NSLIM_inverse.
24.23 --------------------------------------------------------------*)
24.24 Goalw [NSLIMSEQ_def]
24.25 - "[| X ----NS> a; a ~= #0 |] ==> (%n. inverse(X n)) ----NS> inverse(a)";
24.26 + "[| X ----NS> a; a ~= Numeral0 |] ==> (%n. inverse(X n)) ----NS> inverse(a)";
24.27 by (Clarify_tac 1);
24.28 by (dtac bspec 1);
24.29 by (auto_tac (claset(),
24.30 @@ -244,18 +244,18 @@
24.31
24.32
24.33 (*------ Standard version of theorem -------*)
24.34 -Goal "[| X ----> a; a ~= #0 |] ==> (%n. inverse(X n)) ----> inverse(a)";
24.35 +Goal "[| X ----> a; a ~= Numeral0 |] ==> (%n. inverse(X n)) ----> inverse(a)";
24.36 by (asm_full_simp_tac (simpset() addsimps [NSLIMSEQ_inverse,
24.37 LIMSEQ_NSLIMSEQ_iff]) 1);
24.38 qed "LIMSEQ_inverse";
24.39
24.40 -Goal "[| X ----NS> a; Y ----NS> b; b ~= #0 |] \
24.41 +Goal "[| X ----NS> a; Y ----NS> b; b ~= Numeral0 |] \
24.42 \ ==> (%n. X n / Y n) ----NS> a/b";
24.43 by (asm_full_simp_tac (simpset() addsimps [NSLIMSEQ_mult, NSLIMSEQ_inverse,
24.44 real_divide_def]) 1);
24.45 qed "NSLIMSEQ_mult_inverse";
24.46
24.47 -Goal "[| X ----> a; Y ----> b; b ~= #0 |] ==> (%n. X n / Y n) ----> a/b";
24.48 +Goal "[| X ----> a; Y ----> b; b ~= Numeral0 |] ==> (%n. X n / Y n) ----> a/b";
24.49 by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_mult, LIMSEQ_inverse,
24.50 real_divide_def]) 1);
24.51 qed "LIMSEQ_divide";
24.52 @@ -376,16 +376,16 @@
24.53 Bounded Sequence
24.54 ------------------------------------------------------------------*)
24.55 Goalw [Bseq_def]
24.56 - "Bseq X ==> EX K. #0 < K & (ALL n. abs(X n) <= K)";
24.57 + "Bseq X ==> EX K. Numeral0 < K & (ALL n. abs(X n) <= K)";
24.58 by (assume_tac 1);
24.59 qed "BseqD";
24.60
24.61 Goalw [Bseq_def]
24.62 - "[| #0 < K; ALL n. abs(X n) <= K |] ==> Bseq X";
24.63 + "[| Numeral0 < K; ALL n. abs(X n) <= K |] ==> Bseq X";
24.64 by (Blast_tac 1);
24.65 qed "BseqI";
24.66
24.67 -Goal "(EX K. #0 < K & (ALL n. abs(X n) <= K)) = \
24.68 +Goal "(EX K. Numeral0 < K & (ALL n. abs(X n) <= K)) = \
24.69 \ (EX N. ALL n. abs(X n) <= real(Suc N))";
24.70 by Auto_tac;
24.71 by (cut_inst_tac [("x","K")] reals_Archimedean2 1);
24.72 @@ -401,7 +401,7 @@
24.73 by (simp_tac (simpset() addsimps [lemma_NBseq_def]) 1);
24.74 qed "Bseq_iff";
24.75
24.76 -Goal "(EX K. #0 < K & (ALL n. abs(X n) <= K)) = \
24.77 +Goal "(EX K. Numeral0 < K & (ALL n. abs(X n) <= K)) = \
24.78 \ (EX N. ALL n. abs(X n) < real(Suc N))";
24.79 by (stac lemma_NBseq_def 1);
24.80 by Auto_tac;
24.81 @@ -444,7 +444,7 @@
24.82 HNatInfinite_FreeUltrafilterNat_iff]));
24.83 by (EVERY[rtac bexI 1, rtac lemma_hyprel_refl 2]);
24.84 by (dres_inst_tac [("f","Xa")] lemma_Bseq 1);
24.85 -by (res_inst_tac [("x","K+#1")] exI 1);
24.86 +by (res_inst_tac [("x","K+Numeral1")] exI 1);
24.87 by (rotate_tac 2 1 THEN dtac FreeUltrafilterNat_all 1);
24.88 by (Ultra_tac 1);
24.89 qed "Bseq_NSBseq";
24.90 @@ -461,14 +461,14 @@
24.91 is not what we want (read useless!)
24.92 -------------------------------------------------------------------*)
24.93
24.94 -Goal "ALL K. #0 < K --> (EX n. K < abs (X n)) \
24.95 +Goal "ALL K. Numeral0 < K --> (EX n. K < abs (X n)) \
24.96 \ ==> ALL N. EX n. real(Suc N) < abs (X n)";
24.97 by (Step_tac 1);
24.98 by (cut_inst_tac [("n","N")] real_of_nat_Suc_gt_zero 1);
24.99 by (Blast_tac 1);
24.100 val lemmaNSBseq = result();
24.101
24.102 -Goal "ALL K. #0 < K --> (EX n. K < abs (X n)) \
24.103 +Goal "ALL K. Numeral0 < K --> (EX n. K < abs (X n)) \
24.104 \ ==> EX f. ALL N. real(Suc N) < abs (X (f N))";
24.105 by (dtac lemmaNSBseq 1);
24.106 by (dtac choice 1);
24.107 @@ -652,7 +652,7 @@
24.108 Goal "!!(X::nat=> real). \
24.109 \ [| ALL m. X m ~= U; \
24.110 \ isLub UNIV {x. EX n. X n = x} U; \
24.111 -\ #0 < T; \
24.112 +\ Numeral0 < T; \
24.113 \ U + - T < U \
24.114 \ |] ==> EX m. U + -T < X m & X m < U";
24.115 by (dtac lemma_converg2 1 THEN assume_tac 1);
24.116 @@ -722,7 +722,7 @@
24.117
24.118 (***--- alternative formulation for boundedness---***)
24.119 Goalw [Bseq_def]
24.120 - "Bseq X = (EX k x. #0 < k & (ALL n. abs(X(n) + -x) <= k))";
24.121 + "Bseq X = (EX k x. Numeral0 < k & (ALL n. abs(X(n) + -x) <= k))";
24.122 by (Step_tac 1);
24.123 by (res_inst_tac [("x","k + abs(x)")] exI 2);
24.124 by (res_inst_tac [("x","K")] exI 1);
24.125 @@ -733,7 +733,7 @@
24.126 qed "Bseq_iff2";
24.127
24.128 (***--- alternative formulation for boundedness ---***)
24.129 -Goal "Bseq X = (EX k N. #0 < k & (ALL n. abs(X(n) + -X(N)) <= k))";
24.130 +Goal "Bseq X = (EX k N. Numeral0 < k & (ALL n. abs(X(n) + -X(N)) <= k))";
24.131 by (Step_tac 1);
24.132 by (asm_full_simp_tac (simpset() addsimps [Bseq_def]) 1);
24.133 by (Step_tac 1);
24.134 @@ -748,7 +748,7 @@
24.135 qed "Bseq_iff3";
24.136
24.137 Goalw [Bseq_def] "(ALL n. k <= f n & f n <= K) ==> Bseq f";
24.138 -by (res_inst_tac [("x","(abs(k) + abs(K)) + #1")] exI 1);
24.139 +by (res_inst_tac [("x","(abs(k) + abs(K)) + Numeral1")] exI 1);
24.140 by (Auto_tac);
24.141 by (dres_inst_tac [("x","n")] spec 2);
24.142 by (ALLGOALS arith_tac);
24.143 @@ -841,8 +841,8 @@
24.144 -------------------------------------------------------*)
24.145
24.146 (***------------- VARIOUS LEMMAS --------------***)
24.147 -Goal "ALL n. M <= n --> abs (X M + - X n) < (#1::real) \
24.148 -\ ==> ALL n. M <= n --> abs(X n) < #1 + abs(X M)";
24.149 +Goal "ALL n. M <= n --> abs (X M + - X n) < (Numeral1::real) \
24.150 +\ ==> ALL n. M <= n --> abs(X n) < Numeral1 + abs(X M)";
24.151 by (Step_tac 1);
24.152 by (dtac spec 1 THEN Auto_tac);
24.153 by (arith_tac 1);
24.154 @@ -911,7 +911,7 @@
24.155 outlines sketched by various authors would suggest
24.156 ---------------------------------------------------------*)
24.157 Goalw [Cauchy_def,Bseq_def] "Cauchy X ==> Bseq X";
24.158 -by (dres_inst_tac [("x","#1")] spec 1);
24.159 +by (dres_inst_tac [("x","Numeral1")] spec 1);
24.160 by (etac (rename_numerals real_zero_less_one RSN (2,impE)) 1);
24.161 by (Step_tac 1);
24.162 by (dres_inst_tac [("x","M")] spec 1);
24.163 @@ -920,7 +920,7 @@
24.164 by (cut_inst_tac [("M","M"),("X","X")] SUP_rabs_subseq 1);
24.165 by (Step_tac 1);
24.166 by (cut_inst_tac [("R1.0","abs(X m)"),
24.167 - ("R2.0","#1 + abs(X M)")] real_linear 1);
24.168 + ("R2.0","Numeral1 + abs(X M)")] real_linear 1);
24.169 by (Step_tac 1);
24.170 by (dtac lemma_trans1 1 THEN assume_tac 1);
24.171 by (dtac lemma_trans2 3 THEN assume_tac 3);
24.172 @@ -928,8 +928,8 @@
24.173 by (dtac (abs_add_one_gt_zero RS order_less_trans) 3);
24.174 by (dtac lemma_trans4 1);
24.175 by (dtac lemma_trans4 2);
24.176 -by (res_inst_tac [("x","#1 + abs(X M)")] exI 1);
24.177 -by (res_inst_tac [("x","#1 + abs(X M)")] exI 2);
24.178 +by (res_inst_tac [("x","Numeral1 + abs(X M)")] exI 1);
24.179 +by (res_inst_tac [("x","Numeral1 + abs(X M)")] exI 2);
24.180 by (res_inst_tac [("x","abs(X m)")] exI 3);
24.181 by (auto_tac (claset() addSEs [lemma_Nat_covered],
24.182 simpset()));
24.183 @@ -1082,7 +1082,7 @@
24.184 ----------------------------------------------------*)
24.185 (* we can prove this directly since proof is trivial *)
24.186 Goalw [LIMSEQ_def]
24.187 - "((%n. abs(f n)) ----> #0) = (f ----> #0)";
24.188 + "((%n. abs(f n)) ----> Numeral0) = (f ----> Numeral0)";
24.189 by (simp_tac (simpset() addsimps [abs_idempotent]) 1);
24.190 qed "LIMSEQ_rabs_zero";
24.191
24.192 @@ -1092,7 +1092,7 @@
24.193 (* than the direct standard one above! *)
24.194 (*-----------------------------------------------------*)
24.195
24.196 -Goal "((%n. abs(f n)) ----NS> #0) = (f ----NS> #0)";
24.197 +Goal "((%n. abs(f n)) ----NS> Numeral0) = (f ----NS> Numeral0)";
24.198 by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
24.199 LIMSEQ_rabs_zero]) 1);
24.200 qed "NSLIMSEQ_rabs_zero";
24.201 @@ -1119,7 +1119,7 @@
24.202 (* standard proof seems easier *)
24.203 Goalw [LIMSEQ_def]
24.204 "ALL y. EX N. ALL n. N <= n --> y < f(n) \
24.205 -\ ==> (%n. inverse(f n)) ----> #0";
24.206 +\ ==> (%n. inverse(f n)) ----> Numeral0";
24.207 by (Step_tac 1 THEN Asm_full_simp_tac 1);
24.208 by (dres_inst_tac [("x","inverse r")] spec 1 THEN Step_tac 1);
24.209 by (res_inst_tac [("x","N")] exI 1 THEN Step_tac 1);
24.210 @@ -1134,7 +1134,7 @@
24.211 qed "LIMSEQ_inverse_zero";
24.212
24.213 Goal "ALL y. EX N. ALL n. N <= n --> y < f(n) \
24.214 -\ ==> (%n. inverse(f n)) ----NS> #0";
24.215 +\ ==> (%n. inverse(f n)) ----NS> Numeral0";
24.216 by (asm_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
24.217 LIMSEQ_inverse_zero]) 1);
24.218 qed "NSLIMSEQ_inverse_zero";
24.219 @@ -1143,7 +1143,7 @@
24.220 Sequence 1/n --> 0 as n --> infinity
24.221 -------------------------------------------------------------*)
24.222
24.223 -Goal "(%n. inverse(real(Suc n))) ----> #0";
24.224 +Goal "(%n. inverse(real(Suc n))) ----> Numeral0";
24.225 by (rtac LIMSEQ_inverse_zero 1 THEN Step_tac 1);
24.226 by (cut_inst_tac [("x","y")] reals_Archimedean2 1);
24.227 by (Step_tac 1 THEN res_inst_tac [("x","n")] exI 1);
24.228 @@ -1153,7 +1153,7 @@
24.229 by (blast_tac (claset() addIs [order_less_le_trans]) 1);
24.230 qed "LIMSEQ_inverse_real_of_nat";
24.231
24.232 -Goal "(%n. inverse(real(Suc n))) ----NS> #0";
24.233 +Goal "(%n. inverse(real(Suc n))) ----NS> Numeral0";
24.234 by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
24.235 LIMSEQ_inverse_real_of_nat]) 1);
24.236 qed "NSLIMSEQ_inverse_real_of_nat";
24.237 @@ -1188,13 +1188,13 @@
24.238 LIMSEQ_inverse_real_of_posnat_add_minus]) 1);
24.239 qed "NSLIMSEQ_inverse_real_of_posnat_add_minus";
24.240
24.241 -Goal "(%n. r*( #1 + -inverse(real(Suc n)))) ----> r";
24.242 -by (cut_inst_tac [("b","#1")] ([LIMSEQ_const,
24.243 +Goal "(%n. r*( Numeral1 + -inverse(real(Suc n)))) ----> r";
24.244 +by (cut_inst_tac [("b","Numeral1")] ([LIMSEQ_const,
24.245 LIMSEQ_inverse_real_of_posnat_add_minus] MRS LIMSEQ_mult) 1);
24.246 by (Auto_tac);
24.247 qed "LIMSEQ_inverse_real_of_posnat_add_minus_mult";
24.248
24.249 -Goal "(%n. r*( #1 + -inverse(real(Suc n)))) ----NS> r";
24.250 +Goal "(%n. r*( Numeral1 + -inverse(real(Suc n)))) ----NS> r";
24.251 by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
24.252 LIMSEQ_inverse_real_of_posnat_add_minus_mult]) 1);
24.253 qed "NSLIMSEQ_inverse_real_of_posnat_add_minus_mult";
24.254 @@ -1214,22 +1214,22 @@
24.255 qed "LIMSEQ_pow";
24.256
24.257 (*----------------------------------------------------------------
24.258 - 0 <= x < #1 ==> (x ^ n ----> 0)
24.259 + 0 <= x < Numeral1 ==> (x ^ n ----> 0)
24.260 Proof will use (NS) Cauchy equivalence for convergence and
24.261 also fact that bounded and monotonic sequence converges.
24.262 ---------------------------------------------------------------*)
24.263 -Goalw [Bseq_def] "[| #0 <= x; x < #1 |] ==> Bseq (%n. x ^ n)";
24.264 -by (res_inst_tac [("x","#1")] exI 1);
24.265 +Goalw [Bseq_def] "[| Numeral0 <= x; x < Numeral1 |] ==> Bseq (%n. x ^ n)";
24.266 +by (res_inst_tac [("x","Numeral1")] exI 1);
24.267 by (auto_tac (claset() addDs [conjI RS realpow_le]
24.268 addIs [order_less_imp_le],
24.269 simpset() addsimps [abs_eqI1, realpow_abs RS sym] ));
24.270 qed "Bseq_realpow";
24.271
24.272 -Goal "[| #0 <= x; x < #1 |] ==> monoseq (%n. x ^ n)";
24.273 +Goal "[| Numeral0 <= x; x < Numeral1 |] ==> monoseq (%n. x ^ n)";
24.274 by (blast_tac (claset() addSIs [mono_SucI2,realpow_Suc_le3]) 1);
24.275 qed "monoseq_realpow";
24.276
24.277 -Goal "[| #0 <= x; x < #1 |] ==> convergent (%n. x ^ n)";
24.278 +Goal "[| Numeral0 <= x; x < Numeral1 |] ==> convergent (%n. x ^ n)";
24.279 by (blast_tac (claset() addSIs [Bseq_monoseq_convergent,
24.280 Bseq_realpow,monoseq_realpow]) 1);
24.281 qed "convergent_realpow";
24.282 @@ -1238,7 +1238,7 @@
24.283
24.284
24.285 Goalw [NSLIMSEQ_def]
24.286 - "[| #0 <= x; x < #1 |] ==> (%n. x ^ n) ----NS> #0";
24.287 + "[| Numeral0 <= x; x < Numeral1 |] ==> (%n. x ^ n) ----NS> Numeral0";
24.288 by (auto_tac (claset() addSDs [convergent_realpow],
24.289 simpset() addsimps [convergent_NSconvergent_iff]));
24.290 by (forward_tac [NSconvergentD] 1);
24.291 @@ -1258,12 +1258,12 @@
24.292 qed "NSLIMSEQ_realpow_zero";
24.293
24.294 (*--------------- standard version ---------------*)
24.295 -Goal "[| #0 <= x; x < #1 |] ==> (%n. x ^ n) ----> #0";
24.296 +Goal "[| Numeral0 <= x; x < Numeral1 |] ==> (%n. x ^ n) ----> Numeral0";
24.297 by (asm_simp_tac (simpset() addsimps [NSLIMSEQ_realpow_zero,
24.298 LIMSEQ_NSLIMSEQ_iff]) 1);
24.299 qed "LIMSEQ_realpow_zero";
24.300
24.301 -Goal "#1 < x ==> (%n. a / (x ^ n)) ----> #0";
24.302 +Goal "Numeral1 < x ==> (%n. a / (x ^ n)) ----> Numeral0";
24.303 by (cut_inst_tac [("a","a"),("x1","inverse x")]
24.304 ([LIMSEQ_const, LIMSEQ_realpow_zero] MRS LIMSEQ_mult) 1);
24.305 by (auto_tac (claset(),
24.306 @@ -1275,22 +1275,22 @@
24.307 (*----------------------------------------------------------------
24.308 Limit of c^n for |c| < 1
24.309 ---------------------------------------------------------------*)
24.310 -Goal "abs(c) < #1 ==> (%n. abs(c) ^ n) ----> #0";
24.311 +Goal "abs(c) < Numeral1 ==> (%n. abs(c) ^ n) ----> Numeral0";
24.312 by (blast_tac (claset() addSIs [LIMSEQ_realpow_zero,abs_ge_zero]) 1);
24.313 qed "LIMSEQ_rabs_realpow_zero";
24.314
24.315 -Goal "abs(c) < #1 ==> (%n. abs(c) ^ n) ----NS> #0";
24.316 +Goal "abs(c) < Numeral1 ==> (%n. abs(c) ^ n) ----NS> Numeral0";
24.317 by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_rabs_realpow_zero,
24.318 LIMSEQ_NSLIMSEQ_iff RS sym]) 1);
24.319 qed "NSLIMSEQ_rabs_realpow_zero";
24.320
24.321 -Goal "abs(c) < #1 ==> (%n. c ^ n) ----> #0";
24.322 +Goal "abs(c) < Numeral1 ==> (%n. c ^ n) ----> Numeral0";
24.323 by (rtac (LIMSEQ_rabs_zero RS iffD1) 1);
24.324 by (auto_tac (claset() addIs [LIMSEQ_rabs_realpow_zero],
24.325 simpset() addsimps [realpow_abs RS sym]));
24.326 qed "LIMSEQ_rabs_realpow_zero2";
24.327
24.328 -Goal "abs(c) < #1 ==> (%n. c ^ n) ----NS> #0";
24.329 +Goal "abs(c) < Numeral1 ==> (%n. c ^ n) ----NS> Numeral0";
24.330 by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_rabs_realpow_zero2,
24.331 LIMSEQ_NSLIMSEQ_iff RS sym]) 1);
24.332 qed "NSLIMSEQ_rabs_realpow_zero2";
24.333 @@ -1308,7 +1308,7 @@
24.334
24.335 (*** A sequence converging to zero defines an infinitesimal ***)
24.336 Goalw [NSLIMSEQ_def]
24.337 - "X ----NS> #0 ==> Abs_hypreal(hyprel``{X}) : Infinitesimal";
24.338 + "X ----NS> Numeral0 ==> Abs_hypreal(hyprel``{X}) : Infinitesimal";
24.339 by (dres_inst_tac [("x","whn")] bspec 1);
24.340 by (simp_tac (simpset() addsimps [HNatInfinite_whn]) 1);
24.341 by (auto_tac (claset(),
25.1 --- a/src/HOL/Hyperreal/SEQ.thy Fri Oct 05 21:50:37 2001 +0200
25.2 +++ b/src/HOL/Hyperreal/SEQ.thy Fri Oct 05 21:52:39 2001 +0200
25.3 @@ -10,7 +10,7 @@
25.4
25.5 (* Standard definition of convergence of sequence *)
25.6 LIMSEQ :: [nat=>real,real] => bool ("((_)/ ----> (_))" [60, 60] 60)
25.7 - "X ----> L == (ALL r. #0 < r --> (EX no. ALL n. no <= n --> abs (X n + -L) < r))"
25.8 + "X ----> L == (ALL r. Numeral0 < r --> (EX no. ALL n. no <= n --> abs (X n + -L) < r))"
25.9
25.10 (* Nonstandard definition of convergence of sequence *)
25.11 NSLIMSEQ :: [nat=>real,real] => bool ("((_)/ ----NS> (_))" [60, 60] 60)
25.12 @@ -33,7 +33,7 @@
25.13
25.14 (* Standard definition for bounded sequence *)
25.15 Bseq :: (nat => real) => bool
25.16 - "Bseq X == (EX K. (#0 < K & (ALL n. abs(X n) <= K)))"
25.17 + "Bseq X == (EX K. (Numeral0 < K & (ALL n. abs(X n) <= K)))"
25.18
25.19 (* Nonstandard definition for bounded sequence *)
25.20 NSBseq :: (nat=>real) => bool
25.21 @@ -52,7 +52,7 @@
25.22
25.23 (* Standard definition *)
25.24 Cauchy :: (nat => real) => bool
25.25 - "Cauchy X == (ALL e. (#0 < e -->
25.26 + "Cauchy X == (ALL e. (Numeral0 < e -->
25.27 (EX M. (ALL m n. M <= m & M <= n
25.28 --> abs((X m) + -(X n)) < e))))"
25.29
26.1 --- a/src/HOL/Hyperreal/Series.ML Fri Oct 05 21:50:37 2001 +0200
26.2 +++ b/src/HOL/Hyperreal/Series.ML Fri Oct 05 21:52:39 2001 +0200
26.3 @@ -5,13 +5,13 @@
26.4 Description : Finite summation and infinite series
26.5 *)
26.6
26.7 -Goal "sumr (Suc n) n f = #0";
26.8 +Goal "sumr (Suc n) n f = Numeral0";
26.9 by (induct_tac "n" 1);
26.10 by (Auto_tac);
26.11 qed "sumr_Suc_zero";
26.12 Addsimps [sumr_Suc_zero];
26.13
26.14 -Goal "sumr m m f = #0";
26.15 +Goal "sumr m m f = Numeral0";
26.16 by (induct_tac "m" 1);
26.17 by (Auto_tac);
26.18 qed "sumr_eq_bounds";
26.19 @@ -22,7 +22,7 @@
26.20 qed "sumr_Suc_eq";
26.21 Addsimps [sumr_Suc_eq];
26.22
26.23 -Goal "sumr (m+k) k f = #0";
26.24 +Goal "sumr (m+k) k f = Numeral0";
26.25 by (induct_tac "k" 1);
26.26 by (Auto_tac);
26.27 qed "sumr_add_lbound_zero";
26.28 @@ -83,7 +83,7 @@
26.29 by (full_simp_tac (simpset() addsimps [sumr_add_mult_const]) 1);
26.30 qed "sumr_diff_mult_const";
26.31
26.32 -Goal "n < m --> sumr m n f = #0";
26.33 +Goal "n < m --> sumr m n f = Numeral0";
26.34 by (induct_tac "n" 1);
26.35 by (auto_tac (claset() addDs [less_imp_le], simpset()));
26.36 qed_spec_mp "sumr_less_bounds_zero";
26.37 @@ -101,7 +101,7 @@
26.38 by (Auto_tac);
26.39 qed "sumr_shift_bounds";
26.40
26.41 -Goal "sumr 0 (#2*n) (%i. (#-1) ^ Suc i) = #0";
26.42 +Goal "sumr 0 (# 2*n) (%i. (# -1) ^ Suc i) = Numeral0";
26.43 by (induct_tac "n" 1);
26.44 by (Auto_tac);
26.45 qed "sumr_minus_one_realpow_zero";
26.46 @@ -137,7 +137,7 @@
26.47 real_of_nat_Suc]) 1);
26.48 qed_spec_mp "sumr_interval_const2";
26.49
26.50 -Goal "(ALL n. m <= n --> #0 <= f n) & m < k --> sumr 0 m f <= sumr 0 k f";
26.51 +Goal "(ALL n. m <= n --> Numeral0 <= f n) & m < k --> sumr 0 m f <= sumr 0 k f";
26.52 by (induct_tac "k" 1);
26.53 by (Step_tac 1);
26.54 by (ALLGOALS(asm_full_simp_tac (simpset() addsimps [less_Suc_eq_le])));
26.55 @@ -156,21 +156,21 @@
26.56 simpset() addsimps [le_def]));
26.57 qed_spec_mp "sumr_le2";
26.58
26.59 -Goal "(ALL n. #0 <= f n) --> #0 <= sumr m n f";
26.60 +Goal "(ALL n. Numeral0 <= f n) --> Numeral0 <= sumr m n f";
26.61 by (induct_tac "n" 1);
26.62 by Auto_tac;
26.63 by (dres_inst_tac [("x","n")] spec 1);
26.64 by (arith_tac 1);
26.65 qed_spec_mp "sumr_ge_zero";
26.66
26.67 -Goal "(ALL n. m <= n --> #0 <= f n) --> #0 <= sumr m n f";
26.68 +Goal "(ALL n. m <= n --> Numeral0 <= f n) --> Numeral0 <= sumr m n f";
26.69 by (induct_tac "n" 1);
26.70 by Auto_tac;
26.71 by (dres_inst_tac [("x","n")] spec 1);
26.72 by (arith_tac 1);
26.73 qed_spec_mp "sumr_ge_zero2";
26.74
26.75 -Goal "#0 <= sumr m n (%n. abs (f n))";
26.76 +Goal "Numeral0 <= sumr m n (%n. abs (f n))";
26.77 by (induct_tac "n" 1);
26.78 by Auto_tac;
26.79 by (arith_tac 1);
26.80 @@ -184,21 +184,21 @@
26.81 qed "rabs_sumr_rabs_cancel";
26.82 Addsimps [rabs_sumr_rabs_cancel];
26.83
26.84 -Goal "ALL n. N <= n --> f n = #0 \
26.85 -\ ==> ALL m n. N <= m --> sumr m n f = #0";
26.86 +Goal "ALL n. N <= n --> f n = Numeral0 \
26.87 +\ ==> ALL m n. N <= m --> sumr m n f = Numeral0";
26.88 by (Step_tac 1);
26.89 by (induct_tac "n" 1);
26.90 by (Auto_tac);
26.91 qed "sumr_zero";
26.92
26.93 -Goal "ALL n. N <= n --> f (Suc n) = #0 \
26.94 -\ ==> ALL m n. Suc N <= m --> sumr m n f = #0";
26.95 +Goal "ALL n. N <= n --> f (Suc n) = Numeral0 \
26.96 +\ ==> ALL m n. Suc N <= m --> sumr m n f = Numeral0";
26.97 by (rtac sumr_zero 1 THEN Step_tac 1);
26.98 by (case_tac "n" 1);
26.99 by Auto_tac;
26.100 qed "Suc_le_imp_diff_ge2";
26.101
26.102 -Goal "sumr 1' n (%n. f(n) * #0 ^ n) = #0";
26.103 +Goal "sumr (Suc 0) n (%n. f(n) * Numeral0 ^ n) = Numeral0";
26.104 by (induct_tac "n" 1);
26.105 by (case_tac "n" 2);
26.106 by Auto_tac;
26.107 @@ -269,7 +269,7 @@
26.108
26.109 (*
26.110 Goalw [sums_def,LIMSEQ_def]
26.111 - "(ALL m. n <= Suc m --> f(m) = #0) ==> f sums (sumr 0 n f)";
26.112 + "(ALL m. n <= Suc m --> f(m) = Numeral0) ==> f sums (sumr 0 n f)";
26.113 by (Step_tac 1);
26.114 by (res_inst_tac [("x","n")] exI 1);
26.115 by (Step_tac 1 THEN forward_tac [le_imp_less_or_eq] 1);
26.116 @@ -283,7 +283,7 @@
26.117 **********************)
26.118
26.119 Goalw [sums_def,LIMSEQ_def]
26.120 - "(ALL m. n <= m --> f(m) = #0) ==> f sums (sumr 0 n f)";
26.121 + "(ALL m. n <= m --> f(m) = Numeral0) ==> f sums (sumr 0 n f)";
26.122 by (Step_tac 1);
26.123 by (res_inst_tac [("x","n")] exI 1);
26.124 by (Step_tac 1 THEN forward_tac [le_imp_less_or_eq] 1);
26.125 @@ -341,35 +341,35 @@
26.126 by (Auto_tac);
26.127 qed "sums_group";
26.128
26.129 -Goal "[|summable f; ALL d. #0 < (f(n + (2 * d))) + f(n + ((2 * d) + 1))|] \
26.130 +Goal "[|summable f; ALL d. Numeral0 < (f(n + (Suc (Suc 0) * d))) + f(n + ((Suc (Suc 0) * d) + 1))|] \
26.131 \ ==> sumr 0 n f < suminf f";
26.132 by (dtac summable_sums 1);
26.133 by (auto_tac (claset(),simpset() addsimps [sums_def,LIMSEQ_def]));
26.134 by (dres_inst_tac [("x","f(n) + f(n + 1)")] spec 1);
26.135 by (Auto_tac);
26.136 by (rtac ccontr 2 THEN dtac real_leI 2);
26.137 -by (subgoal_tac "sumr 0 (n + 2) f <= sumr 0 (2 * (Suc no) + n) f" 2);
26.138 +by (subgoal_tac "sumr 0 (n + Suc (Suc 0)) f <= sumr 0 (Suc (Suc 0) * (Suc no) + n) f" 2);
26.139 by (induct_tac "no" 3 THEN Simp_tac 3);
26.140 -by (res_inst_tac [("y","sumr 0 (2*(Suc na)+n) f")] order_trans 3);
26.141 +by (res_inst_tac [("y","sumr 0 (Suc (Suc 0)*(Suc na)+n) f")] order_trans 3);
26.142 by (assume_tac 3);
26.143 by (dres_inst_tac [("x","Suc na")] spec 3);
26.144 by (dres_inst_tac [("x","0")] spec 1);
26.145 by (Asm_full_simp_tac 1);
26.146 by (asm_full_simp_tac (simpset() addsimps add_ac) 2);
26.147 -by (rotate_tac 1 1 THEN dres_inst_tac [("x","2 * (Suc no) + n")] spec 1);
26.148 +by (rotate_tac 1 1 THEN dres_inst_tac [("x","Suc (Suc 0) * (Suc no) + n")] spec 1);
26.149 by (Step_tac 1 THEN Asm_full_simp_tac 1);
26.150 by (subgoal_tac "suminf f + (f(n) + f(n + 1)) <= \
26.151 -\ sumr 0 (2 * (Suc no) + n) f" 1);
26.152 -by (res_inst_tac [("y","sumr 0 (n+2) f")] order_trans 2);
26.153 +\ sumr 0 (Suc (Suc 0) * (Suc no) + n) f" 1);
26.154 +by (res_inst_tac [("y","sumr 0 (n+ Suc (Suc 0)) f")] order_trans 2);
26.155 by (assume_tac 3);
26.156 by (res_inst_tac [("y","sumr 0 n f + (f(n) + f(n + 1))")] order_trans 2);
26.157 by (REPEAT(Asm_simp_tac 2));
26.158 -by (subgoal_tac "suminf f <= sumr 0 (2 * (Suc no) + n) f" 1);
26.159 +by (subgoal_tac "suminf f <= sumr 0 (Suc (Suc 0) * (Suc no) + n) f" 1);
26.160 by (res_inst_tac [("y","suminf f + (f(n) + f(n + 1))")] order_trans 2);
26.161 by (assume_tac 3);
26.162 by (dres_inst_tac [("x","0")] spec 2);
26.163 by (Asm_full_simp_tac 2);
26.164 -by (subgoal_tac "#0 <= sumr 0 (2 * Suc no + n) f + - suminf f" 1);
26.165 +by (subgoal_tac "Numeral0 <= sumr 0 (Suc (Suc 0) * Suc no + n) f + - suminf f" 1);
26.166 by (dtac (rename_numerals abs_eqI1) 1 );
26.167 by (Asm_full_simp_tac 1);
26.168 by (auto_tac (claset(),simpset() addsimps [real_le_def]));
26.169 @@ -379,7 +379,7 @@
26.170 Summable series of positive terms has limit >= any partial sum
26.171 ----------------------------------------------------------------*)
26.172 Goal
26.173 - "[| summable f; ALL m. n <= m --> #0 <= f(m) |] \
26.174 + "[| summable f; ALL m. n <= m --> Numeral0 <= f(m) |] \
26.175 \ ==> sumr 0 n f <= suminf f";
26.176 by (dtac summable_sums 1);
26.177 by (rewtac sums_def);
26.178 @@ -390,7 +390,7 @@
26.179 by (auto_tac (claset() addIs [sumr_le], simpset()));
26.180 qed "series_pos_le";
26.181
26.182 -Goal "[| summable f; ALL m. n <= m --> #0 < f(m) |] \
26.183 +Goal "[| summable f; ALL m. n <= m --> Numeral0 < f(m) |] \
26.184 \ ==> sumr 0 n f < suminf f";
26.185 by (res_inst_tac [("y","sumr 0 (Suc n) f")] order_less_le_trans 1);
26.186 by (rtac series_pos_le 2);
26.187 @@ -403,10 +403,10 @@
26.188 sum of geometric progression
26.189 -------------------------------------------------------------------*)
26.190
26.191 -Goal "x ~= #1 ==> sumr 0 n (%n. x ^ n) = (x ^ n - #1) / (x - #1)";
26.192 +Goal "x ~= Numeral1 ==> sumr 0 n (%n. x ^ n) = (x ^ n - Numeral1) / (x - Numeral1)";
26.193 by (induct_tac "n" 1);
26.194 by (Auto_tac);
26.195 -by (res_inst_tac [("c1","x - #1")] (real_mult_right_cancel RS iffD1) 1);
26.196 +by (res_inst_tac [("c1","x - Numeral1")] (real_mult_right_cancel RS iffD1) 1);
26.197 by (auto_tac (claset(),
26.198 simpset() addsimps [real_mult_assoc, real_add_mult_distrib]));
26.199 by (auto_tac (claset(),
26.200 @@ -414,12 +414,12 @@
26.201 real_diff_def, real_mult_commute]));
26.202 qed "sumr_geometric";
26.203
26.204 -Goal "abs(x) < #1 ==> (%n. x ^ n) sums (#1/(#1 - x))";
26.205 -by (case_tac "x = #1" 1);
26.206 +Goal "abs(x) < Numeral1 ==> (%n. x ^ n) sums (Numeral1/(Numeral1 - x))";
26.207 +by (case_tac "x = Numeral1" 1);
26.208 by (auto_tac (claset() addSDs [LIMSEQ_rabs_realpow_zero2],
26.209 simpset() addsimps [sumr_geometric ,sums_def,
26.210 real_diff_def, real_add_divide_distrib]));
26.211 -by (subgoal_tac "#1 / (#1 + - x) = #0/(x-#1) + - #1/(x-#1)" 1);
26.212 +by (subgoal_tac "Numeral1 / (Numeral1 + - x) = Numeral0/(x-Numeral1) + - Numeral1/(x-Numeral1)" 1);
26.213 by (asm_full_simp_tac (simpset() addsimps [real_divide_eq_cancel1,
26.214 real_divide_minus_eq RS sym, real_diff_def]) 2);
26.215 by (etac ssubst 1);
26.216 @@ -437,7 +437,7 @@
26.217 qed "summable_convergent_sumr_iff";
26.218
26.219 Goal "summable f = \
26.220 -\ (ALL e. #0 < e --> (EX N. ALL m n. N <= m --> abs(sumr m n f) < e))";
26.221 +\ (ALL e. Numeral0 < e --> (EX N. ALL m n. N <= m --> abs(sumr m n f) < e))";
26.222 by (auto_tac (claset(),simpset() addsimps [summable_convergent_sumr_iff,
26.223 Cauchy_convergent_iff RS sym,Cauchy_def]));
26.224 by (ALLGOALS(dtac spec) THEN Auto_tac);
26.225 @@ -455,7 +455,7 @@
26.226
26.227 (*-------------------------------------------------------------------
26.228 Terms of a convergent series tend to zero
26.229 - > Goalw [LIMSEQ_def] "summable f ==> f ----> #0";
26.230 + > Goalw [LIMSEQ_def] "summable f ==> f ----> Numeral0";
26.231 Proved easily in HSeries after proving nonstandard case.
26.232 -------------------------------------------------------------------*)
26.233 (*-------------------------------------------------------------------
26.234 @@ -527,10 +527,10 @@
26.235 The ratio test
26.236 -------------------------------------------------------------------*)
26.237
26.238 -Goal "[| c <= #0; abs x <= c * abs y |] ==> x = (#0::real)";
26.239 +Goal "[| c <= Numeral0; abs x <= c * abs y |] ==> x = (Numeral0::real)";
26.240 by (dtac order_le_imp_less_or_eq 1);
26.241 by Auto_tac;
26.242 -by (subgoal_tac "#0 <= c * abs y" 1);
26.243 +by (subgoal_tac "Numeral0 <= c * abs y" 1);
26.244 by (arith_tac 2);
26.245 by (asm_full_simp_tac (simpset() addsimps [real_0_le_mult_iff]) 1);
26.246 qed "rabs_ratiotest_lemma";
26.247 @@ -546,19 +546,19 @@
26.248 by (auto_tac (claset(),simpset() addsimps [le_Suc_ex]));
26.249 qed "le_Suc_ex_iff";
26.250
26.251 -(*All this trouble just to get #0<c *)
26.252 +(*All this trouble just to get Numeral0<c *)
26.253 Goal "[| ALL n. N <= n --> abs(f(Suc n)) <= c*abs(f n) |] \
26.254 -\ ==> #0 < c | summable f";
26.255 +\ ==> Numeral0 < c | summable f";
26.256 by (simp_tac (simpset() addsimps [linorder_not_le RS sym]) 1);
26.257 by (asm_full_simp_tac (simpset() addsimps [summable_Cauchy]) 1);
26.258 -by (Step_tac 1 THEN subgoal_tac "ALL n. N <= n --> f (Suc n) = #0" 1);
26.259 +by (Step_tac 1 THEN subgoal_tac "ALL n. N <= n --> f (Suc n) = Numeral0" 1);
26.260 by (blast_tac (claset() addIs [rabs_ratiotest_lemma]) 2);
26.261 by (res_inst_tac [("x","Suc N")] exI 1);
26.262 by (Clarify_tac 1);
26.263 by (dtac Suc_le_imp_diff_ge2 1 THEN Auto_tac);
26.264 qed "ratio_test_lemma2";
26.265
26.266 -Goal "[| c < #1; ALL n. N <= n --> abs(f(Suc n)) <= c*abs(f n) |] \
26.267 +Goal "[| c < Numeral1; ALL n. N <= n --> abs(f(Suc n)) <= c*abs(f n) |] \
26.268 \ ==> summable f";
26.269 by (forward_tac [ratio_test_lemma2] 1);
26.270 by Auto_tac;
26.271 @@ -573,7 +573,7 @@
26.272 by (auto_tac (claset() addIs [real_mult_le_mono1],
26.273 simpset() addsimps [summable_def]));
26.274 by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 1);
26.275 -by (res_inst_tac [("x","abs(f N) * (#1/(#1 - c)) / (c ^ N)")] exI 1);
26.276 +by (res_inst_tac [("x","abs(f N) * (Numeral1/(Numeral1 - c)) / (c ^ N)")] exI 1);
26.277 by (rtac sums_divide 1);
26.278 by (rtac sums_mult 1);
26.279 by (auto_tac (claset() addSIs [sums_mult,geometric_sums],
27.1 --- a/src/HOL/Hyperreal/Series.thy Fri Oct 05 21:50:37 2001 +0200
27.2 +++ b/src/HOL/Hyperreal/Series.thy Fri Oct 05 21:52:39 2001 +0200
27.3 @@ -9,8 +9,8 @@
27.4
27.5 consts sumr :: "[nat,nat,(nat=>real)] => real"
27.6 primrec
27.7 - sumr_0 "sumr m 0 f = #0"
27.8 - sumr_Suc "sumr m (Suc n) f = (if n < m then #0
27.9 + sumr_0 "sumr m 0 f = Numeral0"
27.10 + sumr_Suc "sumr m (Suc n) f = (if n < m then Numeral0
27.11 else sumr m n f + f(n))"
27.12
27.13 constdefs
28.1 --- a/src/HOL/Hyperreal/hypreal_arith0.ML Fri Oct 05 21:50:37 2001 +0200
28.2 +++ b/src/HOL/Hyperreal/hypreal_arith0.ML Fri Oct 05 21:52:39 2001 +0200
28.3 @@ -115,7 +115,7 @@
28.4 qed "";
28.5
28.6 Goal "!!a::hypreal. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |] \
28.7 -\ ==> #6*a <= #5*l+i";
28.8 +\ ==> # 6*a <= # 5*l+i";
28.9 by (fast_arith_tac 1);
28.10 qed "";
28.11 *)
29.1 --- a/src/HOL/IMP/Compiler.thy Fri Oct 05 21:50:37 2001 +0200
29.2 +++ b/src/HOL/IMP/Compiler.thy Fri Oct 05 21:52:39 2001 +0200
29.3 @@ -39,9 +39,9 @@
29.4 "compile (x:==a) = [ASIN x a]"
29.5 "compile (c1;c2) = compile c1 @ compile c2"
29.6 "compile (IF b THEN c1 ELSE c2) =
29.7 - [JMPF b (length(compile c1)+2)] @ compile c1 @
29.8 + [JMPF b (length(compile c1) + # 2)] @ compile c1 @
29.9 [JMPF (%x. False) (length(compile c2)+1)] @ compile c2"
29.10 -"compile (WHILE b DO c) = [JMPF b (length(compile c)+2)] @ compile c @
29.11 +"compile (WHILE b DO c) = [JMPF b (length(compile c) + # 2)] @ compile c @
29.12 [JMPB (length(compile c)+1)]"
29.13
29.14 declare nth_append[simp];
30.1 --- a/src/HOL/IMP/Examples.ML Fri Oct 05 21:50:37 2001 +0200
30.2 +++ b/src/HOL/IMP/Examples.ML Fri Oct 05 21:52:39 2001 +0200
30.3 @@ -34,7 +34,7 @@
30.4 val step = resolve_tac evalc.intrs 1;
30.5 val simp = Asm_simp_tac 1;
30.6 Goalw [factorial_def] "a~=b ==> \
30.7 -\ <factorial a b, Mem(a:=#3)> -c-> Mem(b:=#6,a:=#0)";
30.8 +\ <factorial a b, Mem(a:=# 3)> -c-> Mem(b:=# 6,a:=Numeral0)";
30.9 by (ftac not_sym 1);
30.10 by step;
30.11 by step;
31.1 --- a/src/HOL/IMPP/EvenOdd.ML Fri Oct 05 21:50:37 2001 +0200
31.2 +++ b/src/HOL/IMPP/EvenOdd.ML Fri Oct 05 21:52:39 2001 +0200
31.3 @@ -11,13 +11,13 @@
31.4 qed "even_0";
31.5 Addsimps [even_0];
31.6
31.7 -Goalw [even_def] "even 1' = False";
31.8 +Goalw [even_def] "even (Suc 0) = False";
31.9 by (Simp_tac 1);
31.10 qed "not_even_1";
31.11 Addsimps [not_even_1];
31.12
31.13 Goalw [even_def] "even (Suc (Suc n)) = even n";
31.14 -by (subgoal_tac "Suc (Suc n) = n+#2" 1);
31.15 +by (subgoal_tac "Suc (Suc n) = n+# 2" 1);
31.16 by (Simp_tac 2);
31.17 by (etac ssubst 1);
31.18 by (rtac dvd_reduce 1);
31.19 @@ -50,13 +50,13 @@
31.20
31.21 section "verification";
31.22
31.23 -Goalw [odd_def] "{{Z=Arg+0}. BODY Even .{Res_ok}}|-{Z=Arg+1'}. odd .{Res_ok}";
31.24 +Goalw [odd_def] "{{Z=Arg+0}. BODY Even .{Res_ok}}|-{Z=Arg+Suc 0}. odd .{Res_ok}";
31.25 by (rtac hoare_derivs.If 1);
31.26 by (rtac (hoare_derivs.Ass RS conseq1) 1);
31.27 by (clarsimp_tac Arg_Res_css 1);
31.28 by (rtac export_s 1);
31.29 by (rtac (hoare_derivs.Call RS conseq1) 1);
31.30 -by (res_inst_tac [("P","Z=Arg+2")] conseq12 1);
31.31 +by (res_inst_tac [("P","Z=Arg+Suc (Suc 0)")] conseq12 1);
31.32 by (rtac single_asm 1);
31.33 by (auto_tac Arg_Res_css);
31.34 qed "Odd_lemma";
32.1 --- a/src/HOL/IMPP/EvenOdd.thy Fri Oct 05 21:50:37 2001 +0200
32.2 +++ b/src/HOL/IMPP/EvenOdd.thy Fri Oct 05 21:52:39 2001 +0200
32.3 @@ -9,7 +9,7 @@
32.4 EvenOdd = Misc +
32.5
32.6 constdefs even :: nat => bool
32.7 - "even n == #2 dvd n"
32.8 + "even n == # 2 dvd n"
32.9
32.10 consts
32.11 Even, Odd :: pname
32.12 @@ -27,7 +27,7 @@
32.13 odd :: com
32.14 "odd == IF (%s. s<Arg>=0)
32.15 THEN Loc Res:==(%s. 1)
32.16 - ELSE(Loc Res:=CALL Even (%s. s<Arg> -1))"
32.17 + ELSE(Loc Res:=CALL Even (%s. s<Arg> - 1))"
32.18
32.19 defs
32.20 bodies_def "bodies == [(Even,evn),(Odd,odd)]"
33.1 --- a/src/HOL/Induct/Com.thy Fri Oct 05 21:50:37 2001 +0200
33.2 +++ b/src/HOL/Induct/Com.thy Fri Oct 05 21:52:39 2001 +0200
33.3 @@ -52,10 +52,10 @@
33.4 IfTrue "[| (e,s) -|[eval]-> (0,s'); (c0,s') -[eval]-> s1 |]
33.5 ==> (IF e THEN c0 ELSE c1, s) -[eval]-> s1"
33.6
33.7 - IfFalse "[| (e,s) -|[eval]-> (1',s'); (c1,s') -[eval]-> s1 |]
33.8 + IfFalse "[| (e,s) -|[eval]-> (Suc 0, s'); (c1,s') -[eval]-> s1 |]
33.9 ==> (IF e THEN c0 ELSE c1, s) -[eval]-> s1"
33.10
33.11 - WhileFalse "(e,s) -|[eval]-> (1',s1) ==> (WHILE e DO c, s) -[eval]-> s1"
33.12 + WhileFalse "(e,s) -|[eval]-> (Suc 0, s1) ==> (WHILE e DO c, s) -[eval]-> s1"
33.13
33.14 WhileTrue "[| (e,s) -|[eval]-> (0,s1);
33.15 (c,s1) -[eval]-> s2; (WHILE e DO c, s2) -[eval]-> s3 |]
34.1 --- a/src/HOL/Induct/Mutil.thy Fri Oct 05 21:50:37 2001 +0200
34.2 +++ b/src/HOL/Induct/Mutil.thy Fri Oct 05 21:52:39 2001 +0200
34.3 @@ -29,7 +29,7 @@
34.4
34.5 constdefs
34.6 coloured :: "nat => (nat \<times> nat) set"
34.7 - "coloured b == {(i, j). (i + j) mod #2 = b}"
34.8 + "coloured b == {(i, j). (i + j) mod # 2 = b}"
34.9
34.10
34.11 text {* \medskip The union of two disjoint tilings is a tiling *}
34.12 @@ -61,14 +61,14 @@
34.13 apply auto
34.14 done
34.15
34.16 -lemma dominoes_tile_row [intro!]: "{i} \<times> lessThan (#2 * n) \<in> tiling domino"
34.17 +lemma dominoes_tile_row [intro!]: "{i} \<times> lessThan (# 2 * n) \<in> tiling domino"
34.18 apply (induct n)
34.19 apply (simp_all add: Un_assoc [symmetric])
34.20 apply (rule tiling.Un)
34.21 apply (auto simp add: sing_Times_lemma)
34.22 done
34.23
34.24 -lemma dominoes_tile_matrix: "(lessThan m) \<times> lessThan (#2 * n) \<in> tiling domino"
34.25 +lemma dominoes_tile_matrix: "(lessThan m) \<times> lessThan (# 2 * n) \<in> tiling domino"
34.26 apply (induct m)
34.27 apply auto
34.28 done
34.29 @@ -78,7 +78,7 @@
34.30
34.31 lemma coloured_insert [simp]:
34.32 "coloured b \<inter> (insert (i, j) t) =
34.33 - (if (i + j) mod #2 = b then insert (i, j) (coloured b \<inter> t)
34.34 + (if (i + j) mod # 2 = b then insert (i, j) (coloured b \<inter> t)
34.35 else coloured b \<inter> t)"
34.36 apply (unfold coloured_def)
34.37 apply auto
34.38 @@ -110,7 +110,7 @@
34.39 Diff_Int_distrib [simp]
34.40
34.41 lemma tiling_domino_0_1:
34.42 - "t \<in> tiling domino ==> card (coloured 0 \<inter> t) = card (coloured 1' \<inter> t)"
34.43 + "t \<in> tiling domino ==> card (coloured 0 \<inter> t) = card (coloured (Suc 0) \<inter> t)"
34.44 apply (erule tiling.induct)
34.45 apply (drule_tac [2] domino_singletons)
34.46 apply auto
34.47 @@ -125,13 +125,13 @@
34.48
34.49 theorem gen_mutil_not_tiling:
34.50 "t \<in> tiling domino ==>
34.51 - (i + j) mod #2 = 0 ==> (m + n) mod #2 = 0 ==>
34.52 + (i + j) mod # 2 = 0 ==> (m + n) mod # 2 = 0 ==>
34.53 {(i, j), (m, n)} \<subseteq> t
34.54 ==> (t - {(i, j)} - {(m, n)}) \<notin> tiling domino"
34.55 apply (rule notI)
34.56 apply (subgoal_tac
34.57 "card (coloured 0 \<inter> (t - {(i, j)} - {(m, n)})) <
34.58 - card (coloured 1' \<inter> (t - {(i, j)} - {(m, n)}))")
34.59 + card (coloured (Suc 0) \<inter> (t - {(i, j)} - {(m, n)}))")
34.60 apply (force simp only: tiling_domino_0_1)
34.61 apply (simp add: tiling_domino_0_1 [symmetric])
34.62 apply (simp add: coloured_def card_Diff2_less)
34.63 @@ -140,8 +140,8 @@
34.64 text {* Apply the general theorem to the well-known case *}
34.65
34.66 theorem mutil_not_tiling:
34.67 - "t = lessThan (#2 * Suc m) \<times> lessThan (#2 * Suc n)
34.68 - ==> t - {(0, 0)} - {(Suc (#2 * m), Suc (#2 * n))} \<notin> tiling domino"
34.69 + "t = lessThan (# 2 * Suc m) \<times> lessThan (# 2 * Suc n)
34.70 + ==> t - {(0, 0)} - {(Suc (# 2 * m), Suc (# 2 * n))} \<notin> tiling domino"
34.71 apply (rule gen_mutil_not_tiling)
34.72 apply (blast intro!: dominoes_tile_matrix)
34.73 apply auto
35.1 --- a/src/HOL/Integ/Bin.ML Fri Oct 05 21:50:37 2001 +0200
35.2 +++ b/src/HOL/Integ/Bin.ML Fri Oct 05 21:52:39 2001 +0200
35.3 @@ -160,7 +160,7 @@
35.4
35.5 (*The correctness of shifting. But it doesn't seem to give a measurable
35.6 speed-up.*)
35.7 -Goal "(#2::int) * number_of w = number_of (w BIT False)";
35.8 +Goal "(# 2::int) * number_of w = number_of (w BIT False)";
35.9 by (induct_tac "w" 1);
35.10 by (ALLGOALS (asm_simp_tac
35.11 (simpset() addsimps bin_mult_simps @ [zadd_zmult_distrib] @ zadd_ac)));
35.12 @@ -169,11 +169,11 @@
35.13
35.14 (** Simplification rules with integer constants **)
35.15
35.16 -Goal "#0 + z = (z::int)";
35.17 +Goal "Numeral0 + z = (z::int)";
35.18 by (Simp_tac 1);
35.19 qed "zadd_0";
35.20
35.21 -Goal "z + #0 = (z::int)";
35.22 +Goal "z + Numeral0 = (z::int)";
35.23 by (Simp_tac 1);
35.24 qed "zadd_0_right";
35.25
35.26 @@ -182,29 +182,29 @@
35.27
35.28 (** Converting simple cases of (int n) to numerals **)
35.29
35.30 -(*int 0 = #0 *)
35.31 +(*int 0 = Numeral0 *)
35.32 bind_thm ("int_0", number_of_Pls RS sym);
35.33
35.34 -Goal "int (Suc n) = #1 + int n";
35.35 +Goal "int (Suc n) = Numeral1 + int n";
35.36 by (simp_tac (simpset() addsimps [zadd_int]) 1);
35.37 qed "int_Suc";
35.38
35.39 -Goal "- (#0) = (#0::int)";
35.40 +Goal "- (Numeral0) = (Numeral0::int)";
35.41 by (Simp_tac 1);
35.42 qed "zminus_0";
35.43
35.44 Addsimps [zminus_0];
35.45
35.46
35.47 -Goal "(#0::int) - x = -x";
35.48 +Goal "(Numeral0::int) - x = -x";
35.49 by (simp_tac (simpset() addsimps [zdiff_def]) 1);
35.50 qed "zdiff0";
35.51
35.52 -Goal "x - (#0::int) = x";
35.53 +Goal "x - (Numeral0::int) = x";
35.54 by (simp_tac (simpset() addsimps [zdiff_def]) 1);
35.55 qed "zdiff0_right";
35.56
35.57 -Goal "x - x = (#0::int)";
35.58 +Goal "x - x = (Numeral0::int)";
35.59 by (simp_tac (simpset() addsimps [zdiff_def]) 1);
35.60 qed "zdiff_self";
35.61
35.62 @@ -234,27 +234,27 @@
35.63
35.64 (** Special-case simplification for small constants **)
35.65
35.66 -Goal "#0 * z = (#0::int)";
35.67 +Goal "Numeral0 * z = (Numeral0::int)";
35.68 by (Simp_tac 1);
35.69 qed "zmult_0";
35.70
35.71 -Goal "z * #0 = (#0::int)";
35.72 +Goal "z * Numeral0 = (Numeral0::int)";
35.73 by (Simp_tac 1);
35.74 qed "zmult_0_right";
35.75
35.76 -Goal "#1 * z = (z::int)";
35.77 +Goal "Numeral1 * z = (z::int)";
35.78 by (Simp_tac 1);
35.79 qed "zmult_1";
35.80
35.81 -Goal "z * #1 = (z::int)";
35.82 +Goal "z * Numeral1 = (z::int)";
35.83 by (Simp_tac 1);
35.84 qed "zmult_1_right";
35.85
35.86 -Goal "#-1 * z = -(z::int)";
35.87 +Goal "# -1 * z = -(z::int)";
35.88 by (simp_tac (simpset() addsimps zcompare_rls@[zmult_zminus]) 1);
35.89 qed "zmult_minus1";
35.90
35.91 -Goal "z * #-1 = -(z::int)";
35.92 +Goal "z * # -1 = -(z::int)";
35.93 by (simp_tac (simpset() addsimps zcompare_rls@[zmult_zminus_right]) 1);
35.94 qed "zmult_minus1_right";
35.95
35.96 @@ -272,61 +272,61 @@
35.97
35.98 (** Inequality reasoning **)
35.99
35.100 -Goal "(m*n = (#0::int)) = (m = #0 | n = #0)";
35.101 +Goal "(m*n = (Numeral0::int)) = (m = Numeral0 | n = Numeral0)";
35.102 by (stac (int_0 RS sym) 1 THEN rtac zmult_eq_int0_iff 1);
35.103 qed "zmult_eq_0_iff";
35.104 AddIffs [zmult_eq_0_iff];
35.105
35.106 -Goal "(w < z + (#1::int)) = (w<z | w=z)";
35.107 +Goal "(w < z + (Numeral1::int)) = (w<z | w=z)";
35.108 by (simp_tac (simpset() addsimps [zless_add_int_Suc_eq]) 1);
35.109 qed "zless_add1_eq";
35.110
35.111 -Goal "(w + (#1::int) <= z) = (w<z)";
35.112 +Goal "(w + (Numeral1::int) <= z) = (w<z)";
35.113 by (simp_tac (simpset() addsimps [add_int_Suc_zle_eq]) 1);
35.114 qed "add1_zle_eq";
35.115
35.116 -Goal "((#1::int) + w <= z) = (w<z)";
35.117 +Goal "((Numeral1::int) + w <= z) = (w<z)";
35.118 by (stac zadd_commute 1);
35.119 by (rtac add1_zle_eq 1);
35.120 qed "add1_left_zle_eq";
35.121
35.122 -Goal "neg x = (x < #0)";
35.123 +Goal "neg x = (x < Numeral0)";
35.124 by (simp_tac (simpset() addsimps [neg_eq_less_int0]) 1);
35.125 qed "neg_eq_less_0";
35.126
35.127 -Goal "(~neg x) = (#0 <= x)";
35.128 +Goal "(~neg x) = (Numeral0 <= x)";
35.129 by (simp_tac (simpset() addsimps [not_neg_eq_ge_int0]) 1);
35.130 qed "not_neg_eq_ge_0";
35.131
35.132 -Goal "#0 <= int m";
35.133 +Goal "Numeral0 <= int m";
35.134 by (Simp_tac 1);
35.135 qed "zero_zle_int";
35.136 AddIffs [zero_zle_int];
35.137
35.138
35.139 -(** Needed because (int 0) rewrites to #0.
35.140 +(** Needed because (int 0) rewrites to Numeral0. (* FIXME !? *)
35.141 Can these be generalized without evaluating large numbers?**)
35.142
35.143 -Goal "~ (int k < #0)";
35.144 +Goal "~ (int k < Numeral0)";
35.145 by (Simp_tac 1);
35.146 qed "int_less_0_conv";
35.147
35.148 -Goal "(int k <= #0) = (k=0)";
35.149 +Goal "(int k <= Numeral0) = (k=0)";
35.150 by (Simp_tac 1);
35.151 qed "int_le_0_conv";
35.152
35.153 -Goal "(int k = #0) = (k=0)";
35.154 +Goal "(int k = Numeral0) = (k=0)";
35.155 by (Simp_tac 1);
35.156 qed "int_eq_0_conv";
35.157
35.158 -Goal "(#0 < int k) = (0<k)";
35.159 +Goal "(Numeral0 < int k) = (0<k)";
35.160 by (Simp_tac 1);
35.161 qed "zero_less_int_conv";
35.162
35.163 Addsimps [int_less_0_conv, int_le_0_conv, int_eq_0_conv, zero_less_int_conv];
35.164
35.165 -Goal "(0 < nat z) = (#0 < z)";
35.166 -by (cut_inst_tac [("w","#0")] zless_nat_conj 1);
35.167 +Goal "(0 < nat z) = (Numeral0 < z)";
35.168 +by (cut_inst_tac [("w","Numeral0")] zless_nat_conj 1);
35.169 by Auto_tac;
35.170 qed "zero_less_nat_eq";
35.171 Addsimps [zero_less_nat_eq];
35.172 @@ -339,7 +339,7 @@
35.173 Goalw [iszero_def]
35.174 "((number_of x::int) = number_of y) = \
35.175 \ iszero (number_of (bin_add x (bin_minus y)))";
35.176 -by (simp_tac (simpset() delsimps [number_of_reorient]
35.177 +by (simp_tac (simpset() delsimps [thm "number_of_reorient"]
35.178 addsimps zcompare_rls @ [number_of_add, number_of_minus]) 1);
35.179 qed "eq_number_of_eq";
35.180
36.1 --- a/src/HOL/Integ/Int.ML Fri Oct 05 21:50:37 2001 +0200
36.2 +++ b/src/HOL/Integ/Int.ML Fri Oct 05 21:52:39 2001 +0200
36.3 @@ -50,7 +50,7 @@
36.4 val eq_diff_eq = eq_zdiff_eq
36.5 val eqI_rules = [zless_eqI, zeq_eqI, zle_eqI]
36.6 fun dest_eqI th =
36.7 - #1 (HOLogic.dest_bin "op =" HOLogic.boolT
36.8 + #1 (HOLogic.dest_bin "op =" HOLogic.boolT
36.9 (HOLogic.dest_Trueprop (concl_of th)))
36.10
36.11 val diff_def = zdiff_def
37.1 --- a/src/HOL/Integ/IntArith.ML Fri Oct 05 21:50:37 2001 +0200
37.2 +++ b/src/HOL/Integ/IntArith.ML Fri Oct 05 21:52:39 2001 +0200
37.3 @@ -20,7 +20,7 @@
37.4
37.5 (*** Intermediate value theorems ***)
37.6
37.7 -Goal "(ALL i<n. abs(f(i+1) - f i) <= #1) --> \
37.8 +Goal "(ALL i<n::nat. abs(f(i+1) - f i) <= Numeral1) --> \
37.9 \ f 0 <= k --> k <= f n --> (EX i <= n. f i = (k::int))";
37.10 by(induct_tac "n" 1);
37.11 by(Asm_simp_tac 1);
37.12 @@ -40,7 +40,7 @@
37.13
37.14 bind_thm("nat0_intermed_int_val", rulify_no_asm lemma);
37.15
37.16 -Goal "[| !i. m <= i & i < n --> abs(f(i+1) - f i) <= #1; m < n; \
37.17 +Goal "[| !i. m <= i & i < n --> abs(f(i + 1::nat) - f i) <= Numeral1; m < n; \
37.18 \ f m <= k; k <= f n |] ==> ? i. m <= i & i <= n & f i = (k::int)";
37.19 by(cut_inst_tac [("n","n-m"),("f", "%i. f(i+m)"),("k","k")]lemma 1);
37.20 by(Asm_full_simp_tac 1);
37.21 @@ -56,22 +56,22 @@
37.22
37.23 (*** Some convenient biconditionals for products of signs ***)
37.24
37.25 -Goal "[| (#0::int) < i; #0 < j |] ==> #0 < i*j";
37.26 +Goal "[| (Numeral0::int) < i; Numeral0 < j |] ==> Numeral0 < i*j";
37.27 by (dtac zmult_zless_mono1 1);
37.28 by Auto_tac;
37.29 qed "zmult_pos";
37.30
37.31 -Goal "[| i < (#0::int); j < #0 |] ==> #0 < i*j";
37.32 +Goal "[| i < (Numeral0::int); j < Numeral0 |] ==> Numeral0 < i*j";
37.33 by (dtac zmult_zless_mono1_neg 1);
37.34 by Auto_tac;
37.35 qed "zmult_neg";
37.36
37.37 -Goal "[| (#0::int) < i; j < #0 |] ==> i*j < #0";
37.38 +Goal "[| (Numeral0::int) < i; j < Numeral0 |] ==> i*j < Numeral0";
37.39 by (dtac zmult_zless_mono1_neg 1);
37.40 by Auto_tac;
37.41 qed "zmult_pos_neg";
37.42
37.43 -Goal "((#0::int) < x*y) = (#0 < x & #0 < y | x < #0 & y < #0)";
37.44 +Goal "((Numeral0::int) < x*y) = (Numeral0 < x & Numeral0 < y | x < Numeral0 & y < Numeral0)";
37.45 by (auto_tac (claset(),
37.46 simpset() addsimps [order_le_less, linorder_not_less,
37.47 zmult_pos, zmult_neg]));
37.48 @@ -84,13 +84,13 @@
37.49 simpset() addsimps [zmult_commute]));
37.50 qed "int_0_less_mult_iff";
37.51
37.52 -Goal "((#0::int) <= x*y) = (#0 <= x & #0 <= y | x <= #0 & y <= #0)";
37.53 +Goal "((Numeral0::int) <= x*y) = (Numeral0 <= x & Numeral0 <= y | x <= Numeral0 & y <= Numeral0)";
37.54 by (auto_tac (claset(),
37.55 simpset() addsimps [order_le_less, linorder_not_less,
37.56 int_0_less_mult_iff]));
37.57 qed "int_0_le_mult_iff";
37.58
37.59 -Goal "(x*y < (#0::int)) = (#0 < x & y < #0 | x < #0 & #0 < y)";
37.60 +Goal "(x*y < (Numeral0::int)) = (Numeral0 < x & y < Numeral0 | x < Numeral0 & Numeral0 < y)";
37.61 by (auto_tac (claset(),
37.62 simpset() addsimps [int_0_le_mult_iff,
37.63 linorder_not_le RS sym]));
37.64 @@ -98,7 +98,7 @@
37.65 simpset() addsimps [linorder_not_le]));
37.66 qed "zmult_less_0_iff";
37.67
37.68 -Goal "(x*y <= (#0::int)) = (#0 <= x & y <= #0 | x <= #0 & #0 <= y)";
37.69 +Goal "(x*y <= (Numeral0::int)) = (Numeral0 <= x & y <= Numeral0 | x <= Numeral0 & Numeral0 <= y)";
37.70 by (auto_tac (claset() addDs [order_less_not_sym],
37.71 simpset() addsimps [int_0_less_mult_iff,
37.72 linorder_not_less RS sym]));
37.73 @@ -109,19 +109,19 @@
37.74 addsimps [zmult_less_0_iff, zle_def]) 1);
37.75 qed "abs_mult";
37.76
37.77 -Goal "(abs x = #0) = (x = (#0::int))";
37.78 +Goal "(abs x = Numeral0) = (x = (Numeral0::int))";
37.79 by (simp_tac (simpset () addsplits [zabs_split]) 1);
37.80 qed "abs_eq_0";
37.81 AddIffs [abs_eq_0];
37.82
37.83 -Goal "(#0 < abs x) = (x ~= (#0::int))";
37.84 +Goal "(Numeral0 < abs x) = (x ~= (Numeral0::int))";
37.85 by (simp_tac (simpset () addsplits [zabs_split]) 1);
37.86 by (arith_tac 1);
37.87 qed "zero_less_abs_iff";
37.88 AddIffs [zero_less_abs_iff];
37.89
37.90 -Goal "#0 <= x * (x::int)";
37.91 -by (subgoal_tac "(- x) * x <= #0" 1);
37.92 +Goal "Numeral0 <= x * (x::int)";
37.93 +by (subgoal_tac "(- x) * x <= Numeral0" 1);
37.94 by (Asm_full_simp_tac 1);
37.95 by (simp_tac (HOL_basic_ss addsimps [zmult_le_0_iff]) 1);
37.96 by Auto_tac;
37.97 @@ -132,48 +132,48 @@
37.98
37.99 (*** Products and 1, by T. M. Rasmussen ***)
37.100
37.101 -Goal "(m = m*(n::int)) = (n = #1 | m = #0)";
37.102 +Goal "(m = m*(n::int)) = (n = Numeral1 | m = Numeral0)";
37.103 by Auto_tac;
37.104 -by (subgoal_tac "m*#1 = m*n" 1);
37.105 +by (subgoal_tac "m*Numeral1 = m*n" 1);
37.106 by (dtac (zmult_cancel1 RS iffD1) 1);
37.107 by Auto_tac;
37.108 qed "zmult_eq_self_iff";
37.109
37.110 -Goal "[| #1 < m; #1 < n |] ==> #1 < m*(n::int)";
37.111 -by (res_inst_tac [("y","#1*n")] order_less_trans 1);
37.112 +Goal "[| Numeral1 < m; Numeral1 < n |] ==> Numeral1 < m*(n::int)";
37.113 +by (res_inst_tac [("y","Numeral1*n")] order_less_trans 1);
37.114 by (rtac zmult_zless_mono1 2);
37.115 by (ALLGOALS Asm_simp_tac);
37.116 qed "zless_1_zmult";
37.117
37.118 -Goal "[| #0 < n; n ~= #1 |] ==> #1 < (n::int)";
37.119 +Goal "[| Numeral0 < n; n ~= Numeral1 |] ==> Numeral1 < (n::int)";
37.120 by (arith_tac 1);
37.121 val lemma = result();
37.122
37.123 -Goal "#0 < (m::int) ==> (m * n = #1) = (m = #1 & n = #1)";
37.124 +Goal "Numeral0 < (m::int) ==> (m * n = Numeral1) = (m = Numeral1 & n = Numeral1)";
37.125 by Auto_tac;
37.126 -by (case_tac "m=#1" 1);
37.127 -by (case_tac "n=#1" 2);
37.128 -by (case_tac "m=#1" 4);
37.129 -by (case_tac "n=#1" 5);
37.130 +by (case_tac "m=Numeral1" 1);
37.131 +by (case_tac "n=Numeral1" 2);
37.132 +by (case_tac "m=Numeral1" 4);
37.133 +by (case_tac "n=Numeral1" 5);
37.134 by Auto_tac;
37.135 by distinct_subgoals_tac;
37.136 -by (subgoal_tac "#1<m*n" 1);
37.137 +by (subgoal_tac "Numeral1<m*n" 1);
37.138 by (Asm_full_simp_tac 1);
37.139 by (rtac zless_1_zmult 1);
37.140 by (ALLGOALS (rtac lemma));
37.141 by Auto_tac;
37.142 -by (subgoal_tac "#0<m*n" 1);
37.143 +by (subgoal_tac "Numeral0<m*n" 1);
37.144 by (Asm_simp_tac 2);
37.145 by (dtac (int_0_less_mult_iff RS iffD1) 1);
37.146 by Auto_tac;
37.147 qed "pos_zmult_eq_1_iff";
37.148
37.149 -Goal "(m*n = (#1::int)) = ((m = #1 & n = #1) | (m = #-1 & n = #-1))";
37.150 -by (case_tac "#0<m" 1);
37.151 +Goal "(m*n = (Numeral1::int)) = ((m = Numeral1 & n = Numeral1) | (m = # -1 & n = # -1))";
37.152 +by (case_tac "Numeral0<m" 1);
37.153 by (asm_simp_tac (simpset() addsimps [pos_zmult_eq_1_iff]) 1);
37.154 -by (case_tac "m=#0" 1);
37.155 +by (case_tac "m=Numeral0" 1);
37.156 by (Asm_simp_tac 1);
37.157 -by (subgoal_tac "#0 < -m" 1);
37.158 +by (subgoal_tac "Numeral0 < -m" 1);
37.159 by (arith_tac 2);
37.160 by (dres_inst_tac [("n","-n")] pos_zmult_eq_1_iff 1);
37.161 by Auto_tac;
38.1 --- a/src/HOL/Integ/IntDef.ML Fri Oct 05 21:50:37 2001 +0200
38.2 +++ b/src/HOL/Integ/IntDef.ML Fri Oct 05 21:52:39 2001 +0200
38.3 @@ -7,8 +7,8 @@
38.4 *)
38.5
38.6
38.7 -(*Rewrite the overloaded 0::int to (int 0)*)
38.8 -Addsimps [Zero_def];
38.9 +(*Rewrite the overloaded 0::int to (int 0)*) (* FIXME !? *)
38.10 +Addsimps [Zero_int_def];
38.11
38.12 Goalw [intrel_def] "(((x1,y1),(x2,y2)): intrel) = (x1+y2 = x2+y1)";
38.13 by (Blast_tac 1);
38.14 @@ -326,7 +326,7 @@
38.15 by (asm_simp_tac (simpset() addsimps [zmult]) 1);
38.16 qed "zmult_int0";
38.17
38.18 -Goalw [int_def] "int 1' * z = z";
38.19 +Goalw [int_def] "int (Suc 0) * z = z";
38.20 by (res_inst_tac [("z","z")] eq_Abs_Integ 1);
38.21 by (asm_simp_tac (simpset() addsimps [zmult]) 1);
38.22 qed "zmult_int1";
38.23 @@ -335,7 +335,7 @@
38.24 by (rtac ([zmult_commute, zmult_int0] MRS trans) 1);
38.25 qed "zmult_int0_right";
38.26
38.27 -Goal "z * int 1' = z";
38.28 +Goal "z * int (Suc 0) = z";
38.29 by (rtac ([zmult_commute, zmult_int1] MRS trans) 1);
38.30 qed "zmult_int1_right";
38.31
39.1 --- a/src/HOL/Integ/IntDef.thy Fri Oct 05 21:50:37 2001 +0200
39.2 +++ b/src/HOL/Integ/IntDef.thy Fri Oct 05 21:52:39 2001 +0200
39.3 @@ -35,7 +35,7 @@
39.4
39.5 defs (*of overloaded constants*)
39.6
39.7 - Zero_def "0 == int 0"
39.8 + Zero_int_def "0 == int 0"
39.9
39.10 zadd_def
39.11 "z + w ==
40.1 --- a/src/HOL/Integ/IntDiv.ML Fri Oct 05 21:50:37 2001 +0200
40.2 +++ b/src/HOL/Integ/IntDiv.ML Fri Oct 05 21:52:39 2001 +0200
40.3 @@ -34,21 +34,21 @@
40.4
40.5 (*** Uniqueness and monotonicity of quotients and remainders ***)
40.6
40.7 -Goal "[| b*q' + r' <= b*q + r; #0 <= r'; #0 < b; r < b |] \
40.8 +Goal "[| b*q' + r' <= b*q + r; Numeral0 <= r'; Numeral0 < b; r < b |] \
40.9 \ ==> q' <= (q::int)";
40.10 by (subgoal_tac "r' + b * (q'-q) <= r" 1);
40.11 by (simp_tac (simpset() addsimps [zdiff_zmult_distrib2]) 2);
40.12 -by (subgoal_tac "#0 < b * (#1 + q - q')" 1);
40.13 +by (subgoal_tac "Numeral0 < b * (Numeral1 + q - q')" 1);
40.14 by (etac order_le_less_trans 2);
40.15 by (full_simp_tac (simpset() addsimps [zdiff_zmult_distrib2,
40.16 zadd_zmult_distrib2]) 2);
40.17 -by (subgoal_tac "b * q' < b * (#1 + q)" 1);
40.18 +by (subgoal_tac "b * q' < b * (Numeral1 + q)" 1);
40.19 by (full_simp_tac (simpset() addsimps [zdiff_zmult_distrib2,
40.20 zadd_zmult_distrib2]) 2);
40.21 by (asm_full_simp_tac (simpset() addsimps [zmult_zless_cancel1]) 1);
40.22 qed "unique_quotient_lemma";
40.23
40.24 -Goal "[| b*q' + r' <= b*q + r; r <= #0; b < #0; b < r' |] \
40.25 +Goal "[| b*q' + r' <= b*q + r; r <= Numeral0; b < Numeral0; b < r' |] \
40.26 \ ==> q <= (q'::int)";
40.27 by (res_inst_tac [("b", "-b"), ("r", "-r'"), ("r'", "-r")]
40.28 unique_quotient_lemma 1);
40.29 @@ -57,7 +57,7 @@
40.30 qed "unique_quotient_lemma_neg";
40.31
40.32
40.33 -Goal "[| quorem ((a,b), (q,r)); quorem ((a,b), (q',r')); b ~= #0 |] \
40.34 +Goal "[| quorem ((a,b), (q,r)); quorem ((a,b), (q',r')); b ~= Numeral0 |] \
40.35 \ ==> q = q'";
40.36 by (asm_full_simp_tac
40.37 (simpset() addsimps split_ifs@
40.38 @@ -72,7 +72,7 @@
40.39 qed "unique_quotient";
40.40
40.41
40.42 -Goal "[| quorem ((a,b), (q,r)); quorem ((a,b), (q',r')); b ~= #0 |] \
40.43 +Goal "[| quorem ((a,b), (q,r)); quorem ((a,b), (q',r')); b ~= Numeral0 |] \
40.44 \ ==> r = r'";
40.45 by (subgoal_tac "q = q'" 1);
40.46 by (blast_tac (claset() addIs [unique_quotient]) 2);
40.47 @@ -84,8 +84,8 @@
40.48
40.49
40.50 Goal "adjust a b (q,r) = (let diff = r-b in \
40.51 -\ if #0 <= diff then (#2*q + #1, diff) \
40.52 -\ else (#2*q, r))";
40.53 +\ if Numeral0 <= diff then (# 2*q + Numeral1, diff) \
40.54 +\ else (# 2*q, r))";
40.55 by (simp_tac (simpset() addsimps [Let_def,adjust_def]) 1);
40.56 qed "adjust_eq";
40.57 Addsimps [adjust_eq];
40.58 @@ -101,9 +101,9 @@
40.59 bind_thm ("posDivAlg_raw_eqn", lemma RS hd posDivAlg.simps);
40.60
40.61 (**use with simproc to avoid re-proving the premise*)
40.62 -Goal "#0 < b ==> \
40.63 +Goal "Numeral0 < b ==> \
40.64 \ posDivAlg (a,b) = \
40.65 -\ (if a<b then (#0,a) else adjust a b (posDivAlg(a, #2*b)))";
40.66 +\ (if a<b then (Numeral0,a) else adjust a b (posDivAlg(a, # 2*b)))";
40.67 by (rtac (posDivAlg_raw_eqn RS trans) 1);
40.68 by (Asm_simp_tac 1);
40.69 qed "posDivAlg_eqn";
40.70 @@ -112,7 +112,7 @@
40.71
40.72
40.73 (*Correctness of posDivAlg: it computes quotients correctly*)
40.74 -Goal "#0 <= a --> #0 < b --> quorem ((a, b), posDivAlg (a, b))";
40.75 +Goal "Numeral0 <= a --> Numeral0 < b --> quorem ((a, b), posDivAlg (a, b))";
40.76 by (induct_thm_tac posDivAlg_induct "a b" 1);
40.77 by Auto_tac;
40.78 by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [quorem_def])));
40.79 @@ -139,9 +139,9 @@
40.80 bind_thm ("negDivAlg_raw_eqn", lemma RS hd negDivAlg.simps);
40.81
40.82 (**use with simproc to avoid re-proving the premise*)
40.83 -Goal "#0 < b ==> \
40.84 +Goal "Numeral0 < b ==> \
40.85 \ negDivAlg (a,b) = \
40.86 -\ (if #0<=a+b then (#-1,a+b) else adjust a b (negDivAlg(a, #2*b)))";
40.87 +\ (if Numeral0<=a+b then (# -1,a+b) else adjust a b (negDivAlg(a, # 2*b)))";
40.88 by (rtac (negDivAlg_raw_eqn RS trans) 1);
40.89 by (Asm_simp_tac 1);
40.90 qed "negDivAlg_eqn";
40.91 @@ -151,7 +151,7 @@
40.92
40.93 (*Correctness of negDivAlg: it computes quotients correctly
40.94 It doesn't work if a=0 because the 0/b=0 rather than -1*)
40.95 -Goal "a < #0 --> #0 < b --> quorem ((a, b), negDivAlg (a, b))";
40.96 +Goal "a < Numeral0 --> Numeral0 < b --> quorem ((a, b), negDivAlg (a, b))";
40.97 by (induct_thm_tac negDivAlg_induct "a b" 1);
40.98 by Auto_tac;
40.99 by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [quorem_def])));
40.100 @@ -168,18 +168,18 @@
40.101 (*** Existence shown by proving the division algorithm to be correct ***)
40.102
40.103 (*the case a=0*)
40.104 -Goal "b ~= #0 ==> quorem ((#0,b), (#0,#0))";
40.105 +Goal "b ~= Numeral0 ==> quorem ((Numeral0,b), (Numeral0,Numeral0))";
40.106 by (auto_tac (claset(),
40.107 simpset() addsimps [quorem_def, linorder_neq_iff]));
40.108 qed "quorem_0";
40.109
40.110 -Goal "posDivAlg (#0, b) = (#0, #0)";
40.111 +Goal "posDivAlg (Numeral0, b) = (Numeral0, Numeral0)";
40.112 by (stac posDivAlg_raw_eqn 1);
40.113 by Auto_tac;
40.114 qed "posDivAlg_0";
40.115 Addsimps [posDivAlg_0];
40.116
40.117 -Goal "negDivAlg (#-1, b) = (#-1, b-#1)";
40.118 +Goal "negDivAlg (# -1, b) = (# -1, b-Numeral1)";
40.119 by (stac negDivAlg_raw_eqn 1);
40.120 by Auto_tac;
40.121 qed "negDivAlg_minus1";
40.122 @@ -194,7 +194,7 @@
40.123 by (auto_tac (claset(), simpset() addsimps split_ifs@[quorem_def]));
40.124 qed "quorem_neg";
40.125
40.126 -Goal "b ~= #0 ==> quorem ((a,b), divAlg(a,b))";
40.127 +Goal "b ~= Numeral0 ==> quorem ((a,b), divAlg(a,b))";
40.128 by (auto_tac (claset(),
40.129 simpset() addsimps [quorem_0, divAlg_def]));
40.130 by (REPEAT_FIRST (resolve_tac [quorem_neg, posDivAlg_correct,
40.131 @@ -206,11 +206,11 @@
40.132 (** Arbitrary definitions for division by zero. Useful to simplify
40.133 certain equations **)
40.134
40.135 -Goal "a div (#0::int) = #0";
40.136 +Goal "a div (Numeral0::int) = Numeral0";
40.137 by (simp_tac (simpset() addsimps [div_def, divAlg_def, posDivAlg_raw_eqn]) 1);
40.138 qed "DIVISION_BY_ZERO_ZDIV"; (*NOT for adding to default simpset*)
40.139
40.140 -Goal "a mod (#0::int) = a";
40.141 +Goal "a mod (Numeral0::int) = a";
40.142 by (simp_tac (simpset() addsimps [mod_def, divAlg_def, posDivAlg_raw_eqn]) 1);
40.143 qed "DIVISION_BY_ZERO_ZMOD"; (*NOT for adding to default simpset*)
40.144
40.145 @@ -222,20 +222,20 @@
40.146 (** Basic laws about division and remainder **)
40.147
40.148 Goal "(a::int) = b * (a div b) + (a mod b)";
40.149 -by (zdiv_undefined_case_tac "b = #0" 1);
40.150 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.151 by (cut_inst_tac [("a","a"),("b","b")] divAlg_correct 1);
40.152 by (auto_tac (claset(),
40.153 simpset() addsimps [quorem_def, div_def, mod_def]));
40.154 qed "zmod_zdiv_equality";
40.155
40.156 -Goal "(#0::int) < b ==> #0 <= a mod b & a mod b < b";
40.157 +Goal "(Numeral0::int) < b ==> Numeral0 <= a mod b & a mod b < b";
40.158 by (cut_inst_tac [("a","a"),("b","b")] divAlg_correct 1);
40.159 by (auto_tac (claset(),
40.160 simpset() addsimps [quorem_def, mod_def]));
40.161 bind_thm ("pos_mod_sign", result() RS conjunct1);
40.162 bind_thm ("pos_mod_bound", result() RS conjunct2);
40.163
40.164 -Goal "b < (#0::int) ==> a mod b <= #0 & b < a mod b";
40.165 +Goal "b < (Numeral0::int) ==> a mod b <= Numeral0 & b < a mod b";
40.166 by (cut_inst_tac [("a","a"),("b","b")] divAlg_correct 1);
40.167 by (auto_tac (claset(),
40.168 simpset() addsimps [quorem_def, div_def, mod_def]));
40.169 @@ -245,7 +245,7 @@
40.170
40.171 (** proving general properties of div and mod **)
40.172
40.173 -Goal "b ~= #0 ==> quorem ((a, b), (a div b, a mod b))";
40.174 +Goal "b ~= Numeral0 ==> quorem ((a, b), (a div b, a mod b))";
40.175 by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
40.176 by (auto_tac
40.177 (claset(),
40.178 @@ -254,43 +254,43 @@
40.179 neg_mod_sign, neg_mod_bound]));
40.180 qed "quorem_div_mod";
40.181
40.182 -Goal "[| quorem((a,b),(q,r)); b ~= #0 |] ==> a div b = q";
40.183 +Goal "[| quorem((a,b),(q,r)); b ~= Numeral0 |] ==> a div b = q";
40.184 by (asm_simp_tac (simpset() addsimps [quorem_div_mod RS unique_quotient]) 1);
40.185 qed "quorem_div";
40.186
40.187 -Goal "[| quorem((a,b),(q,r)); b ~= #0 |] ==> a mod b = r";
40.188 +Goal "[| quorem((a,b),(q,r)); b ~= Numeral0 |] ==> a mod b = r";
40.189 by (asm_simp_tac (simpset() addsimps [quorem_div_mod RS unique_remainder]) 1);
40.190 qed "quorem_mod";
40.191
40.192 -Goal "[| (#0::int) <= a; a < b |] ==> a div b = #0";
40.193 +Goal "[| (Numeral0::int) <= a; a < b |] ==> a div b = Numeral0";
40.194 by (rtac quorem_div 1);
40.195 by (auto_tac (claset(), simpset() addsimps [quorem_def]));
40.196 qed "div_pos_pos_trivial";
40.197
40.198 -Goal "[| a <= (#0::int); b < a |] ==> a div b = #0";
40.199 +Goal "[| a <= (Numeral0::int); b < a |] ==> a div b = Numeral0";
40.200 by (rtac quorem_div 1);
40.201 by (auto_tac (claset(), simpset() addsimps [quorem_def]));
40.202 qed "div_neg_neg_trivial";
40.203
40.204 -Goal "[| (#0::int) < a; a+b <= #0 |] ==> a div b = #-1";
40.205 +Goal "[| (Numeral0::int) < a; a+b <= Numeral0 |] ==> a div b = # -1";
40.206 by (rtac quorem_div 1);
40.207 by (auto_tac (claset(), simpset() addsimps [quorem_def]));
40.208 qed "div_pos_neg_trivial";
40.209
40.210 -(*There is no div_neg_pos_trivial because #0 div b = #0 would supersede it*)
40.211 +(*There is no div_neg_pos_trivial because Numeral0 div b = Numeral0 would supersede it*)
40.212
40.213 -Goal "[| (#0::int) <= a; a < b |] ==> a mod b = a";
40.214 -by (res_inst_tac [("q","#0")] quorem_mod 1);
40.215 +Goal "[| (Numeral0::int) <= a; a < b |] ==> a mod b = a";
40.216 +by (res_inst_tac [("q","Numeral0")] quorem_mod 1);
40.217 by (auto_tac (claset(), simpset() addsimps [quorem_def]));
40.218 qed "mod_pos_pos_trivial";
40.219
40.220 -Goal "[| a <= (#0::int); b < a |] ==> a mod b = a";
40.221 -by (res_inst_tac [("q","#0")] quorem_mod 1);
40.222 +Goal "[| a <= (Numeral0::int); b < a |] ==> a mod b = a";
40.223 +by (res_inst_tac [("q","Numeral0")] quorem_mod 1);
40.224 by (auto_tac (claset(), simpset() addsimps [quorem_def]));
40.225 qed "mod_neg_neg_trivial";
40.226
40.227 -Goal "[| (#0::int) < a; a+b <= #0 |] ==> a mod b = a+b";
40.228 -by (res_inst_tac [("q","#-1")] quorem_mod 1);
40.229 +Goal "[| (Numeral0::int) < a; a+b <= Numeral0 |] ==> a mod b = a+b";
40.230 +by (res_inst_tac [("q","# -1")] quorem_mod 1);
40.231 by (auto_tac (claset(), simpset() addsimps [quorem_def]));
40.232 qed "mod_pos_neg_trivial";
40.233
40.234 @@ -299,7 +299,7 @@
40.235
40.236 (*Simpler laws such as -a div b = -(a div b) FAIL, but see just below*)
40.237 Goal "(-a) div (-b) = a div (b::int)";
40.238 -by (zdiv_undefined_case_tac "b = #0" 1);
40.239 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.240 by (stac ((simplify(simpset()) (quorem_div_mod RS quorem_neg))
40.241 RS quorem_div) 1);
40.242 by Auto_tac;
40.243 @@ -308,7 +308,7 @@
40.244
40.245 (*Simpler laws such as -a mod b = -(a mod b) FAIL, but see just below*)
40.246 Goal "(-a) mod (-b) = - (a mod (b::int))";
40.247 -by (zdiv_undefined_case_tac "b = #0" 1);
40.248 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.249 by (stac ((simplify(simpset()) (quorem_div_mod RS quorem_neg))
40.250 RS quorem_mod) 1);
40.251 by Auto_tac;
40.252 @@ -319,8 +319,8 @@
40.253 (*** div, mod and unary minus ***)
40.254
40.255 Goal "quorem((a,b),(q,r)) \
40.256 -\ ==> quorem ((-a,b), (if r=#0 then -q else -q-#1), \
40.257 -\ (if r=#0 then #0 else b-r))";
40.258 +\ ==> quorem ((-a,b), (if r=Numeral0 then -q else -q-Numeral1), \
40.259 +\ (if r=Numeral0 then Numeral0 else b-r))";
40.260 by (auto_tac
40.261 (claset(),
40.262 simpset() addsimps split_ifs@
40.263 @@ -328,14 +328,14 @@
40.264 zdiff_zmult_distrib2]));
40.265 val lemma = result();
40.266
40.267 -Goal "b ~= (#0::int) \
40.268 +Goal "b ~= (Numeral0::int) \
40.269 \ ==> (-a) div b = \
40.270 -\ (if a mod b = #0 then - (a div b) else - (a div b) - #1)";
40.271 +\ (if a mod b = Numeral0 then - (a div b) else - (a div b) - Numeral1)";
40.272 by (blast_tac (claset() addIs [quorem_div_mod RS lemma RS quorem_div]) 1);
40.273 qed "zdiv_zminus1_eq_if";
40.274
40.275 -Goal "(-a::int) mod b = (if a mod b = #0 then #0 else b - (a mod b))";
40.276 -by (zdiv_undefined_case_tac "b = #0" 1);
40.277 +Goal "(-a::int) mod b = (if a mod b = Numeral0 then Numeral0 else b - (a mod b))";
40.278 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.279 by (blast_tac (claset() addIs [quorem_div_mod RS lemma RS quorem_mod]) 1);
40.280 qed "zmod_zminus1_eq_if";
40.281
40.282 @@ -349,32 +349,32 @@
40.283 by Auto_tac;
40.284 qed "zmod_zminus2";
40.285
40.286 -Goal "b ~= (#0::int) \
40.287 +Goal "b ~= (Numeral0::int) \
40.288 \ ==> a div (-b) = \
40.289 -\ (if a mod b = #0 then - (a div b) else - (a div b) - #1)";
40.290 +\ (if a mod b = Numeral0 then - (a div b) else - (a div b) - Numeral1)";
40.291 by (asm_simp_tac (simpset() addsimps [zdiv_zminus1_eq_if, zdiv_zminus2]) 1);
40.292 qed "zdiv_zminus2_eq_if";
40.293
40.294 -Goal "a mod (-b::int) = (if a mod b = #0 then #0 else (a mod b) - b)";
40.295 +Goal "a mod (-b::int) = (if a mod b = Numeral0 then Numeral0 else (a mod b) - b)";
40.296 by (asm_simp_tac (simpset() addsimps [zmod_zminus1_eq_if, zmod_zminus2]) 1);
40.297 qed "zmod_zminus2_eq_if";
40.298
40.299
40.300 (*** division of a number by itself ***)
40.301
40.302 -Goal "[| (#0::int) < a; a = r + a*q; r < a |] ==> #1 <= q";
40.303 -by (subgoal_tac "#0 < a*q" 1);
40.304 +Goal "[| (Numeral0::int) < a; a = r + a*q; r < a |] ==> Numeral1 <= q";
40.305 +by (subgoal_tac "Numeral0 < a*q" 1);
40.306 by (arith_tac 2);
40.307 by (asm_full_simp_tac (simpset() addsimps [int_0_less_mult_iff]) 1);
40.308 val lemma1 = result();
40.309
40.310 -Goal "[| (#0::int) < a; a = r + a*q; #0 <= r |] ==> q <= #1";
40.311 -by (subgoal_tac "#0 <= a*(#1-q)" 1);
40.312 +Goal "[| (Numeral0::int) < a; a = r + a*q; Numeral0 <= r |] ==> q <= Numeral1";
40.313 +by (subgoal_tac "Numeral0 <= a*(Numeral1-q)" 1);
40.314 by (asm_simp_tac (simpset() addsimps [zdiff_zmult_distrib2]) 2);
40.315 by (asm_full_simp_tac (simpset() addsimps [int_0_le_mult_iff]) 1);
40.316 val lemma2 = result();
40.317
40.318 -Goal "[| quorem((a,a),(q,r)); a ~= (#0::int) |] ==> q = #1";
40.319 +Goal "[| quorem((a,a),(q,r)); a ~= (Numeral0::int) |] ==> q = Numeral1";
40.320 by (asm_full_simp_tac
40.321 (simpset() addsimps split_ifs@[quorem_def, linorder_neq_iff]) 1);
40.322 by (rtac order_antisym 1);
40.323 @@ -386,20 +386,20 @@
40.324 simpset() addsimps [zadd_commute, zmult_zminus]) 1));
40.325 qed "self_quotient";
40.326
40.327 -Goal "[| quorem((a,a),(q,r)); a ~= (#0::int) |] ==> r = #0";
40.328 +Goal "[| quorem((a,a),(q,r)); a ~= (Numeral0::int) |] ==> r = Numeral0";
40.329 by (ftac self_quotient 1);
40.330 by (assume_tac 1);
40.331 by (asm_full_simp_tac (simpset() addsimps [quorem_def]) 1);
40.332 qed "self_remainder";
40.333
40.334 -Goal "a ~= #0 ==> a div a = (#1::int)";
40.335 +Goal "a ~= Numeral0 ==> a div a = (Numeral1::int)";
40.336 by (asm_simp_tac (simpset() addsimps [quorem_div_mod RS self_quotient]) 1);
40.337 qed "zdiv_self";
40.338 Addsimps [zdiv_self];
40.339
40.340 (*Here we have 0 mod 0 = 0, also assumed by Knuth (who puts m mod 0 = 0) *)
40.341 -Goal "a mod a = (#0::int)";
40.342 -by (zdiv_undefined_case_tac "a = #0" 1);
40.343 +Goal "a mod a = (Numeral0::int)";
40.344 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
40.345 by (asm_simp_tac (simpset() addsimps [quorem_div_mod RS self_remainder]) 1);
40.346 qed "zmod_self";
40.347 Addsimps [zmod_self];
40.348 @@ -407,65 +407,65 @@
40.349
40.350 (*** Computation of division and remainder ***)
40.351
40.352 -Goal "(#0::int) div b = #0";
40.353 +Goal "(Numeral0::int) div b = Numeral0";
40.354 by (simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
40.355 qed "zdiv_zero";
40.356
40.357 -Goal "(#0::int) < b ==> #-1 div b = #-1";
40.358 +Goal "(Numeral0::int) < b ==> # -1 div b = # -1";
40.359 by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
40.360 qed "div_eq_minus1";
40.361
40.362 -Goal "(#0::int) mod b = #0";
40.363 +Goal "(Numeral0::int) mod b = Numeral0";
40.364 by (simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
40.365 qed "zmod_zero";
40.366
40.367 Addsimps [zdiv_zero, zmod_zero];
40.368
40.369 -Goal "(#0::int) < b ==> #-1 div b = #-1";
40.370 +Goal "(Numeral0::int) < b ==> # -1 div b = # -1";
40.371 by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
40.372 qed "zdiv_minus1";
40.373
40.374 -Goal "(#0::int) < b ==> #-1 mod b = b-#1";
40.375 +Goal "(Numeral0::int) < b ==> # -1 mod b = b-Numeral1";
40.376 by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
40.377 qed "zmod_minus1";
40.378
40.379 (** a positive, b positive **)
40.380
40.381 -Goal "[| #0 < a; #0 <= b |] ==> a div b = fst (posDivAlg(a,b))";
40.382 +Goal "[| Numeral0 < a; Numeral0 <= b |] ==> a div b = fst (posDivAlg(a,b))";
40.383 by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
40.384 qed "div_pos_pos";
40.385
40.386 -Goal "[| #0 < a; #0 <= b |] ==> a mod b = snd (posDivAlg(a,b))";
40.387 +Goal "[| Numeral0 < a; Numeral0 <= b |] ==> a mod b = snd (posDivAlg(a,b))";
40.388 by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
40.389 qed "mod_pos_pos";
40.390
40.391 (** a negative, b positive **)
40.392
40.393 -Goal "[| a < #0; #0 < b |] ==> a div b = fst (negDivAlg(a,b))";
40.394 +Goal "[| a < Numeral0; Numeral0 < b |] ==> a div b = fst (negDivAlg(a,b))";
40.395 by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
40.396 qed "div_neg_pos";
40.397
40.398 -Goal "[| a < #0; #0 < b |] ==> a mod b = snd (negDivAlg(a,b))";
40.399 +Goal "[| a < Numeral0; Numeral0 < b |] ==> a mod b = snd (negDivAlg(a,b))";
40.400 by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
40.401 qed "mod_neg_pos";
40.402
40.403 (** a positive, b negative **)
40.404
40.405 -Goal "[| #0 < a; b < #0 |] ==> a div b = fst (negateSnd(negDivAlg(-a,-b)))";
40.406 +Goal "[| Numeral0 < a; b < Numeral0 |] ==> a div b = fst (negateSnd(negDivAlg(-a,-b)))";
40.407 by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
40.408 qed "div_pos_neg";
40.409
40.410 -Goal "[| #0 < a; b < #0 |] ==> a mod b = snd (negateSnd(negDivAlg(-a,-b)))";
40.411 +Goal "[| Numeral0 < a; b < Numeral0 |] ==> a mod b = snd (negateSnd(negDivAlg(-a,-b)))";
40.412 by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
40.413 qed "mod_pos_neg";
40.414
40.415 (** a negative, b negative **)
40.416
40.417 -Goal "[| a < #0; b <= #0 |] ==> a div b = fst (negateSnd(posDivAlg(-a,-b)))";
40.418 +Goal "[| a < Numeral0; b <= Numeral0 |] ==> a div b = fst (negateSnd(posDivAlg(-a,-b)))";
40.419 by (asm_simp_tac (simpset() addsimps [div_def, divAlg_def]) 1);
40.420 qed "div_neg_neg";
40.421
40.422 -Goal "[| a < #0; b <= #0 |] ==> a mod b = snd (negateSnd(posDivAlg(-a,-b)))";
40.423 +Goal "[| a < Numeral0; b <= Numeral0 |] ==> a mod b = snd (negateSnd(posDivAlg(-a,-b)))";
40.424 by (asm_simp_tac (simpset() addsimps [mod_def, divAlg_def]) 1);
40.425 qed "mod_neg_neg";
40.426
40.427 @@ -478,28 +478,28 @@
40.428
40.429 (** Special-case simplification **)
40.430
40.431 -Goal "a mod (#1::int) = #0";
40.432 -by (cut_inst_tac [("a","a"),("b","#1")] pos_mod_sign 1);
40.433 -by (cut_inst_tac [("a","a"),("b","#1")] pos_mod_bound 2);
40.434 +Goal "a mod (Numeral1::int) = Numeral0";
40.435 +by (cut_inst_tac [("a","a"),("b","Numeral1")] pos_mod_sign 1);
40.436 +by (cut_inst_tac [("a","a"),("b","Numeral1")] pos_mod_bound 2);
40.437 by Auto_tac;
40.438 qed "zmod_1";
40.439 Addsimps [zmod_1];
40.440
40.441 -Goal "a div (#1::int) = a";
40.442 -by (cut_inst_tac [("a","a"),("b","#1")] zmod_zdiv_equality 1);
40.443 +Goal "a div (Numeral1::int) = a";
40.444 +by (cut_inst_tac [("a","a"),("b","Numeral1")] zmod_zdiv_equality 1);
40.445 by Auto_tac;
40.446 qed "zdiv_1";
40.447 Addsimps [zdiv_1];
40.448
40.449 -Goal "a mod (#-1::int) = #0";
40.450 -by (cut_inst_tac [("a","a"),("b","#-1")] neg_mod_sign 1);
40.451 -by (cut_inst_tac [("a","a"),("b","#-1")] neg_mod_bound 2);
40.452 +Goal "a mod (# -1::int) = Numeral0";
40.453 +by (cut_inst_tac [("a","a"),("b","# -1")] neg_mod_sign 1);
40.454 +by (cut_inst_tac [("a","a"),("b","# -1")] neg_mod_bound 2);
40.455 by Auto_tac;
40.456 qed "zmod_minus1_right";
40.457 Addsimps [zmod_minus1_right];
40.458
40.459 -Goal "a div (#-1::int) = -a";
40.460 -by (cut_inst_tac [("a","a"),("b","#-1")] zmod_zdiv_equality 1);
40.461 +Goal "a div (# -1::int) = -a";
40.462 +by (cut_inst_tac [("a","a"),("b","# -1")] zmod_zdiv_equality 1);
40.463 by Auto_tac;
40.464 qed "zdiv_minus1_right";
40.465 Addsimps [zdiv_minus1_right];
40.466 @@ -507,7 +507,7 @@
40.467
40.468 (*** Monotonicity in the first argument (divisor) ***)
40.469
40.470 -Goal "[| a <= a'; #0 < (b::int) |] ==> a div b <= a' div b";
40.471 +Goal "[| a <= a'; Numeral0 < (b::int) |] ==> a div b <= a' div b";
40.472 by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
40.473 by (cut_inst_tac [("a","a'"),("b","b")] zmod_zdiv_equality 1);
40.474 by (rtac unique_quotient_lemma 1);
40.475 @@ -516,7 +516,7 @@
40.476 by (ALLGOALS (asm_simp_tac (simpset() addsimps [pos_mod_sign,pos_mod_bound])));
40.477 qed "zdiv_mono1";
40.478
40.479 -Goal "[| a <= a'; (b::int) < #0 |] ==> a' div b <= a div b";
40.480 +Goal "[| a <= a'; (b::int) < Numeral0 |] ==> a' div b <= a div b";
40.481 by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
40.482 by (cut_inst_tac [("a","a'"),("b","b")] zmod_zdiv_equality 1);
40.483 by (rtac unique_quotient_lemma_neg 1);
40.484 @@ -528,14 +528,14 @@
40.485
40.486 (*** Monotonicity in the second argument (dividend) ***)
40.487
40.488 -Goal "[| b*q + r = b'*q' + r'; #0 <= b'*q' + r'; \
40.489 -\ r' < b'; #0 <= r; #0 < b'; b' <= b |] \
40.490 +Goal "[| b*q + r = b'*q' + r'; Numeral0 <= b'*q' + r'; \
40.491 +\ r' < b'; Numeral0 <= r; Numeral0 < b'; b' <= b |] \
40.492 \ ==> q <= (q'::int)";
40.493 -by (subgoal_tac "#0 <= q'" 1);
40.494 - by (subgoal_tac "#0 < b'*(q' + #1)" 2);
40.495 +by (subgoal_tac "Numeral0 <= q'" 1);
40.496 + by (subgoal_tac "Numeral0 < b'*(q' + Numeral1)" 2);
40.497 by (asm_simp_tac (simpset() addsimps [zadd_zmult_distrib2]) 3);
40.498 by (asm_full_simp_tac (simpset() addsimps [int_0_less_mult_iff]) 2);
40.499 -by (subgoal_tac "b*q < b*(q' + #1)" 1);
40.500 +by (subgoal_tac "b*q < b*(q' + Numeral1)" 1);
40.501 by (asm_full_simp_tac (simpset() addsimps [zmult_zless_cancel1]) 1);
40.502 by (subgoal_tac "b*q = r' - r + b'*q'" 1);
40.503 by (Simp_tac 2);
40.504 @@ -545,9 +545,9 @@
40.505 by Auto_tac;
40.506 qed "zdiv_mono2_lemma";
40.507
40.508 -Goal "[| (#0::int) <= a; #0 < b'; b' <= b |] \
40.509 +Goal "[| (Numeral0::int) <= a; Numeral0 < b'; b' <= b |] \
40.510 \ ==> a div b <= a div b'";
40.511 -by (subgoal_tac "b ~= #0" 1);
40.512 +by (subgoal_tac "b ~= Numeral0" 1);
40.513 by (arith_tac 2);
40.514 by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
40.515 by (cut_inst_tac [("a","a"),("b","b'")] zmod_zdiv_equality 1);
40.516 @@ -557,14 +557,14 @@
40.517 by (ALLGOALS (asm_simp_tac (simpset() addsimps [pos_mod_sign,pos_mod_bound])));
40.518 qed "zdiv_mono2";
40.519
40.520 -Goal "[| b*q + r = b'*q' + r'; b'*q' + r' < #0; \
40.521 -\ r < b; #0 <= r'; #0 < b'; b' <= b |] \
40.522 +Goal "[| b*q + r = b'*q' + r'; b'*q' + r' < Numeral0; \
40.523 +\ r < b; Numeral0 <= r'; Numeral0 < b'; b' <= b |] \
40.524 \ ==> q' <= (q::int)";
40.525 -by (subgoal_tac "q' < #0" 1);
40.526 - by (subgoal_tac "b'*q' < #0" 2);
40.527 +by (subgoal_tac "q' < Numeral0" 1);
40.528 + by (subgoal_tac "b'*q' < Numeral0" 2);
40.529 by (arith_tac 3);
40.530 by (asm_full_simp_tac (simpset() addsimps [zmult_less_0_iff]) 2);
40.531 -by (subgoal_tac "b*q' < b*(q + #1)" 1);
40.532 +by (subgoal_tac "b*q' < b*(q + Numeral1)" 1);
40.533 by (asm_full_simp_tac (simpset() addsimps [zmult_zless_cancel1]) 1);
40.534 by (asm_simp_tac (simpset() addsimps [zadd_zmult_distrib2]) 1);
40.535 by (subgoal_tac "b*q' <= b'*q'" 1);
40.536 @@ -574,7 +574,7 @@
40.537 by (arith_tac 1);
40.538 qed "zdiv_mono2_neg_lemma";
40.539
40.540 -Goal "[| a < (#0::int); #0 < b'; b' <= b |] \
40.541 +Goal "[| a < (Numeral0::int); Numeral0 < b'; b' <= b |] \
40.542 \ ==> a div b' <= a div b";
40.543 by (cut_inst_tac [("a","a"),("b","b")] zmod_zdiv_equality 1);
40.544 by (cut_inst_tac [("a","a"),("b","b'")] zmod_zdiv_equality 1);
40.545 @@ -589,7 +589,7 @@
40.546
40.547 (** proving (a*b) div c = a * (b div c) + a * (b mod c) **)
40.548
40.549 -Goal "[| quorem((b,c),(q,r)); c ~= #0 |] \
40.550 +Goal "[| quorem((b,c),(q,r)); c ~= Numeral0 |] \
40.551 \ ==> quorem ((a*b, c), (a*q + a*r div c, a*r mod c))";
40.552 by (auto_tac
40.553 (claset(),
40.554 @@ -602,12 +602,12 @@
40.555 val lemma = result();
40.556
40.557 Goal "(a*b) div c = a*(b div c) + a*(b mod c) div (c::int)";
40.558 -by (zdiv_undefined_case_tac "c = #0" 1);
40.559 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
40.560 by (blast_tac (claset() addIs [quorem_div_mod RS lemma RS quorem_div]) 1);
40.561 qed "zdiv_zmult1_eq";
40.562
40.563 Goal "(a*b) mod c = a*(b mod c) mod (c::int)";
40.564 -by (zdiv_undefined_case_tac "c = #0" 1);
40.565 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
40.566 by (blast_tac (claset() addIs [quorem_div_mod RS lemma RS quorem_mod]) 1);
40.567 qed "zmod_zmult1_eq";
40.568
40.569 @@ -623,27 +623,27 @@
40.570 by (rtac zmod_zmult1_eq 1);
40.571 qed "zmod_zmult_distrib";
40.572
40.573 -Goal "b ~= (#0::int) ==> (a*b) div b = a";
40.574 +Goal "b ~= (Numeral0::int) ==> (a*b) div b = a";
40.575 by (asm_simp_tac (simpset() addsimps [zdiv_zmult1_eq]) 1);
40.576 qed "zdiv_zmult_self1";
40.577
40.578 -Goal "b ~= (#0::int) ==> (b*a) div b = a";
40.579 +Goal "b ~= (Numeral0::int) ==> (b*a) div b = a";
40.580 by (stac zmult_commute 1 THEN etac zdiv_zmult_self1 1);
40.581 qed "zdiv_zmult_self2";
40.582
40.583 Addsimps [zdiv_zmult_self1, zdiv_zmult_self2];
40.584
40.585 -Goal "(a*b) mod b = (#0::int)";
40.586 +Goal "(a*b) mod b = (Numeral0::int)";
40.587 by (simp_tac (simpset() addsimps [zmod_zmult1_eq]) 1);
40.588 qed "zmod_zmult_self1";
40.589
40.590 -Goal "(b*a) mod b = (#0::int)";
40.591 +Goal "(b*a) mod b = (Numeral0::int)";
40.592 by (simp_tac (simpset() addsimps [zmult_commute, zmod_zmult1_eq]) 1);
40.593 qed "zmod_zmult_self2";
40.594
40.595 Addsimps [zmod_zmult_self1, zmod_zmult_self2];
40.596
40.597 -Goal "(m mod d = #0) = (EX q::int. m = d*q)";
40.598 +Goal "(m mod d = Numeral0) = (EX q::int. m = d*q)";
40.599 by (cut_inst_tac [("a","m"),("b","d")] zmod_zdiv_equality 1);
40.600 by Auto_tac;
40.601 qed "zmod_eq_0_iff";
40.602 @@ -652,7 +652,7 @@
40.603
40.604 (** proving (a+b) div c = a div c + b div c + ((a mod c + b mod c) div c) **)
40.605
40.606 -Goal "[| quorem((a,c),(aq,ar)); quorem((b,c),(bq,br)); c ~= #0 |] \
40.607 +Goal "[| quorem((a,c),(aq,ar)); quorem((b,c),(bq,br)); c ~= Numeral0 |] \
40.608 \ ==> quorem ((a+b, c), (aq + bq + (ar+br) div c, (ar+br) mod c))";
40.609 by (auto_tac
40.610 (claset(),
40.611 @@ -666,19 +666,19 @@
40.612
40.613 (*NOT suitable for rewriting: the RHS has an instance of the LHS*)
40.614 Goal "(a+b) div (c::int) = a div c + b div c + ((a mod c + b mod c) div c)";
40.615 -by (zdiv_undefined_case_tac "c = #0" 1);
40.616 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
40.617 by (blast_tac (claset() addIs [[quorem_div_mod,quorem_div_mod]
40.618 MRS lemma RS quorem_div]) 1);
40.619 qed "zdiv_zadd1_eq";
40.620
40.621 Goal "(a+b) mod (c::int) = (a mod c + b mod c) mod c";
40.622 -by (zdiv_undefined_case_tac "c = #0" 1);
40.623 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
40.624 by (blast_tac (claset() addIs [[quorem_div_mod,quorem_div_mod]
40.625 MRS lemma RS quorem_mod]) 1);
40.626 qed "zmod_zadd1_eq";
40.627
40.628 -Goal "(a mod b) div b = (#0::int)";
40.629 -by (zdiv_undefined_case_tac "b = #0" 1);
40.630 +Goal "(a mod b) div b = (Numeral0::int)";
40.631 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.632 by (auto_tac (claset(),
40.633 simpset() addsimps [linorder_neq_iff,
40.634 pos_mod_sign, pos_mod_bound, div_pos_pos_trivial,
40.635 @@ -687,7 +687,7 @@
40.636 Addsimps [mod_div_trivial];
40.637
40.638 Goal "(a mod b) mod b = a mod (b::int)";
40.639 -by (zdiv_undefined_case_tac "b = #0" 1);
40.640 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.641 by (auto_tac (claset(),
40.642 simpset() addsimps [linorder_neq_iff,
40.643 pos_mod_sign, pos_mod_bound, mod_pos_pos_trivial,
40.644 @@ -710,22 +710,22 @@
40.645 qed "zmod_zadd_right_eq";
40.646
40.647
40.648 -Goal "a ~= (#0::int) ==> (a+b) div a = b div a + #1";
40.649 +Goal "a ~= (Numeral0::int) ==> (a+b) div a = b div a + Numeral1";
40.650 by (asm_simp_tac (simpset() addsimps [zdiv_zadd1_eq]) 1);
40.651 qed "zdiv_zadd_self1";
40.652
40.653 -Goal "a ~= (#0::int) ==> (b+a) div a = b div a + #1";
40.654 +Goal "a ~= (Numeral0::int) ==> (b+a) div a = b div a + Numeral1";
40.655 by (asm_simp_tac (simpset() addsimps [zdiv_zadd1_eq]) 1);
40.656 qed "zdiv_zadd_self2";
40.657 Addsimps [zdiv_zadd_self1, zdiv_zadd_self2];
40.658
40.659 Goal "(a+b) mod a = b mod (a::int)";
40.660 -by (zdiv_undefined_case_tac "a = #0" 1);
40.661 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
40.662 by (asm_simp_tac (simpset() addsimps [zmod_zadd1_eq]) 1);
40.663 qed "zmod_zadd_self1";
40.664
40.665 Goal "(b+a) mod a = b mod (a::int)";
40.666 -by (zdiv_undefined_case_tac "a = #0" 1);
40.667 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
40.668 by (asm_simp_tac (simpset() addsimps [zmod_zadd1_eq]) 1);
40.669 qed "zmod_zadd_self2";
40.670 Addsimps [zmod_zadd_self1, zmod_zadd_self2];
40.671 @@ -739,8 +739,8 @@
40.672
40.673 (** first, four lemmas to bound the remainder for the cases b<0 and b>0 **)
40.674
40.675 -Goal "[| (#0::int) < c; b < r; r <= #0 |] ==> b*c < b*(q mod c) + r";
40.676 -by (subgoal_tac "b * (c - q mod c) < r * #1" 1);
40.677 +Goal "[| (Numeral0::int) < c; b < r; r <= Numeral0 |] ==> b*c < b*(q mod c) + r";
40.678 +by (subgoal_tac "b * (c - q mod c) < r * Numeral1" 1);
40.679 by (asm_full_simp_tac (simpset() addsimps [zdiff_zmult_distrib2]) 1);
40.680 by (rtac order_le_less_trans 1);
40.681 by (etac zmult_zless_mono1 2);
40.682 @@ -751,20 +751,20 @@
40.683 [zadd_commute, add1_zle_eq, pos_mod_bound]));
40.684 val lemma1 = result();
40.685
40.686 -Goal "[| (#0::int) < c; b < r; r <= #0 |] ==> b * (q mod c) + r <= #0";
40.687 -by (subgoal_tac "b * (q mod c) <= #0" 1);
40.688 +Goal "[| (Numeral0::int) < c; b < r; r <= Numeral0 |] ==> b * (q mod c) + r <= Numeral0";
40.689 +by (subgoal_tac "b * (q mod c) <= Numeral0" 1);
40.690 by (arith_tac 1);
40.691 by (asm_simp_tac (simpset() addsimps [zmult_le_0_iff, pos_mod_sign]) 1);
40.692 val lemma2 = result();
40.693
40.694 -Goal "[| (#0::int) < c; #0 <= r; r < b |] ==> #0 <= b * (q mod c) + r";
40.695 -by (subgoal_tac "#0 <= b * (q mod c)" 1);
40.696 +Goal "[| (Numeral0::int) < c; Numeral0 <= r; r < b |] ==> Numeral0 <= b * (q mod c) + r";
40.697 +by (subgoal_tac "Numeral0 <= b * (q mod c)" 1);
40.698 by (arith_tac 1);
40.699 by (asm_simp_tac (simpset() addsimps [int_0_le_mult_iff, pos_mod_sign]) 1);
40.700 val lemma3 = result();
40.701
40.702 -Goal "[| (#0::int) < c; #0 <= r; r < b |] ==> b * (q mod c) + r < b * c";
40.703 -by (subgoal_tac "r * #1 < b * (c - q mod c)" 1);
40.704 +Goal "[| (Numeral0::int) < c; Numeral0 <= r; r < b |] ==> b * (q mod c) + r < b * c";
40.705 +by (subgoal_tac "r * Numeral1 < b * (c - q mod c)" 1);
40.706 by (asm_full_simp_tac (simpset() addsimps [zdiff_zmult_distrib2]) 1);
40.707 by (rtac order_less_le_trans 1);
40.708 by (etac zmult_zless_mono1 1);
40.709 @@ -775,7 +775,7 @@
40.710 [zadd_commute, add1_zle_eq, pos_mod_bound]));
40.711 val lemma4 = result();
40.712
40.713 -Goal "[| quorem ((a,b), (q,r)); b ~= #0; #0 < c |] \
40.714 +Goal "[| quorem ((a,b), (q,r)); b ~= Numeral0; Numeral0 < c |] \
40.715 \ ==> quorem ((a, b*c), (q div c, b*(q mod c) + r))";
40.716 by (auto_tac
40.717 (claset(),
40.718 @@ -786,15 +786,15 @@
40.719 lemma1, lemma2, lemma3, lemma4]));
40.720 val lemma = result();
40.721
40.722 -Goal "(#0::int) < c ==> a div (b*c) = (a div b) div c";
40.723 -by (zdiv_undefined_case_tac "b = #0" 1);
40.724 +Goal "(Numeral0::int) < c ==> a div (b*c) = (a div b) div c";
40.725 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.726 by (force_tac (claset(),
40.727 simpset() addsimps [quorem_div_mod RS lemma RS quorem_div,
40.728 zmult_eq_0_iff]) 1);
40.729 qed "zdiv_zmult2_eq";
40.730
40.731 -Goal "(#0::int) < c ==> a mod (b*c) = b*(a div b mod c) + a mod b";
40.732 -by (zdiv_undefined_case_tac "b = #0" 1);
40.733 +Goal "(Numeral0::int) < c ==> a mod (b*c) = b*(a div b mod c) + a mod b";
40.734 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.735 by (force_tac (claset(),
40.736 simpset() addsimps [quorem_div_mod RS lemma RS quorem_mod,
40.737 zmult_eq_0_iff]) 1);
40.738 @@ -803,26 +803,26 @@
40.739
40.740 (*** Cancellation of common factors in "div" ***)
40.741
40.742 -Goal "[| (#0::int) < b; c ~= #0 |] ==> (c*a) div (c*b) = a div b";
40.743 +Goal "[| (Numeral0::int) < b; c ~= Numeral0 |] ==> (c*a) div (c*b) = a div b";
40.744 by (stac zdiv_zmult2_eq 1);
40.745 by Auto_tac;
40.746 val lemma1 = result();
40.747
40.748 -Goal "[| b < (#0::int); c ~= #0 |] ==> (c*a) div (c*b) = a div b";
40.749 +Goal "[| b < (Numeral0::int); c ~= Numeral0 |] ==> (c*a) div (c*b) = a div b";
40.750 by (subgoal_tac "(c * (-a)) div (c * (-b)) = (-a) div (-b)" 1);
40.751 by (rtac lemma1 2);
40.752 by Auto_tac;
40.753 val lemma2 = result();
40.754
40.755 -Goal "c ~= (#0::int) ==> (c*a) div (c*b) = a div b";
40.756 -by (zdiv_undefined_case_tac "b = #0" 1);
40.757 +Goal "c ~= (Numeral0::int) ==> (c*a) div (c*b) = a div b";
40.758 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.759 by (auto_tac
40.760 (claset(),
40.761 simpset() addsimps [read_instantiate [("x", "b")] linorder_neq_iff,
40.762 lemma1, lemma2]));
40.763 qed "zdiv_zmult_zmult1";
40.764
40.765 -Goal "c ~= (#0::int) ==> (a*c) div (b*c) = a div b";
40.766 +Goal "c ~= (Numeral0::int) ==> (a*c) div (b*c) = a div b";
40.767 by (dtac zdiv_zmult_zmult1 1);
40.768 by (auto_tac (claset(), simpset() addsimps [zmult_commute]));
40.769 qed "zdiv_zmult_zmult2";
40.770 @@ -831,20 +831,20 @@
40.771
40.772 (*** Distribution of factors over "mod" ***)
40.773
40.774 -Goal "[| (#0::int) < b; c ~= #0 |] ==> (c*a) mod (c*b) = c * (a mod b)";
40.775 +Goal "[| (Numeral0::int) < b; c ~= Numeral0 |] ==> (c*a) mod (c*b) = c * (a mod b)";
40.776 by (stac zmod_zmult2_eq 1);
40.777 by Auto_tac;
40.778 val lemma1 = result();
40.779
40.780 -Goal "[| b < (#0::int); c ~= #0 |] ==> (c*a) mod (c*b) = c * (a mod b)";
40.781 +Goal "[| b < (Numeral0::int); c ~= Numeral0 |] ==> (c*a) mod (c*b) = c * (a mod b)";
40.782 by (subgoal_tac "(c * (-a)) mod (c * (-b)) = c * ((-a) mod (-b))" 1);
40.783 by (rtac lemma1 2);
40.784 by Auto_tac;
40.785 val lemma2 = result();
40.786
40.787 Goal "(c*a) mod (c*b) = (c::int) * (a mod b)";
40.788 -by (zdiv_undefined_case_tac "b = #0" 1);
40.789 -by (zdiv_undefined_case_tac "c = #0" 1);
40.790 +by (zdiv_undefined_case_tac "b = Numeral0" 1);
40.791 +by (zdiv_undefined_case_tac "c = Numeral0" 1);
40.792 by (auto_tac
40.793 (claset(),
40.794 simpset() addsimps [read_instantiate [("x", "b")] linorder_neq_iff,
40.795 @@ -861,13 +861,13 @@
40.796
40.797 (** computing "div" by shifting **)
40.798
40.799 -Goal "(#0::int) <= a ==> (#1 + #2*b) div (#2*a) = b div a";
40.800 -by (zdiv_undefined_case_tac "a = #0" 1);
40.801 -by (subgoal_tac "#1 <= a" 1);
40.802 +Goal "(Numeral0::int) <= a ==> (Numeral1 + # 2*b) div (# 2*a) = b div a";
40.803 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
40.804 +by (subgoal_tac "Numeral1 <= a" 1);
40.805 by (arith_tac 2);
40.806 -by (subgoal_tac "#1 < a * #2" 1);
40.807 +by (subgoal_tac "Numeral1 < a * # 2" 1);
40.808 by (arith_tac 2);
40.809 -by (subgoal_tac "#2*(#1 + b mod a) <= #2*a" 1);
40.810 +by (subgoal_tac "# 2*(Numeral1 + b mod a) <= # 2*a" 1);
40.811 by (rtac zmult_zle_mono2 2);
40.812 by (auto_tac (claset(),
40.813 simpset() addsimps [zadd_commute, zmult_commute,
40.814 @@ -881,18 +881,18 @@
40.815 pos_mod_sign RS zadd_zle_mono1 RSN (2,order_trans)]) 1);
40.816 by (auto_tac (claset(),
40.817 simpset() addsimps [mod_pos_pos_trivial]));
40.818 -by (subgoal_tac "#0 <= b mod a" 1);
40.819 +by (subgoal_tac "Numeral0 <= b mod a" 1);
40.820 by (asm_simp_tac (simpset() addsimps [pos_mod_sign]) 2);
40.821 by (arith_tac 1);
40.822 qed "pos_zdiv_mult_2";
40.823
40.824
40.825 -Goal "a <= (#0::int) ==> (#1 + #2*b) div (#2*a) = (b+#1) div a";
40.826 -by (subgoal_tac "(#1 + #2*(-b-#1)) div (#2 * (-a)) = (-b-#1) div (-a)" 1);
40.827 +Goal "a <= (Numeral0::int) ==> (Numeral1 + # 2*b) div (# 2*a) = (b+Numeral1) div a";
40.828 +by (subgoal_tac "(Numeral1 + # 2*(-b-Numeral1)) div (# 2 * (-a)) = (-b-Numeral1) div (-a)" 1);
40.829 by (rtac pos_zdiv_mult_2 2);
40.830 by (auto_tac (claset(),
40.831 simpset() addsimps [zmult_zminus_right]));
40.832 -by (subgoal_tac "(#-1 - (#2 * b)) = - (#1 + (#2 * b))" 1);
40.833 +by (subgoal_tac "(# -1 - (# 2 * b)) = - (Numeral1 + (# 2 * b))" 1);
40.834 by (Simp_tac 2);
40.835 by (asm_full_simp_tac (HOL_ss
40.836 addsimps [zdiv_zminus_zminus, zdiff_def,
40.837 @@ -902,17 +902,17 @@
40.838
40.839 (*Not clear why this must be proved separately; probably number_of causes
40.840 simplification problems*)
40.841 -Goal "~ #0 <= x ==> x <= (#0::int)";
40.842 +Goal "~ Numeral0 <= x ==> x <= (Numeral0::int)";
40.843 by Auto_tac;
40.844 val lemma = result();
40.845
40.846 Goal "number_of (v BIT b) div number_of (w BIT False) = \
40.847 -\ (if ~b | (#0::int) <= number_of w \
40.848 +\ (if ~b | (Numeral0::int) <= number_of w \
40.849 \ then number_of v div (number_of w) \
40.850 -\ else (number_of v + (#1::int)) div (number_of w))";
40.851 +\ else (number_of v + (Numeral1::int)) div (number_of w))";
40.852 by (simp_tac (simpset_of Int.thy addsimps [zadd_assoc, number_of_BIT]) 1);
40.853 by (asm_simp_tac (simpset()
40.854 - delsimps [number_of_reorient]@bin_arith_extra_simps@bin_rel_simps
40.855 + delsimps [thm "number_of_reorient"]@bin_arith_extra_simps@bin_rel_simps
40.856 addsimps [zdiv_zmult_zmult1, pos_zdiv_mult_2, lemma,
40.857 neg_zdiv_mult_2]) 1);
40.858 qed "zdiv_number_of_BIT";
40.859 @@ -921,13 +921,13 @@
40.860
40.861 (** computing "mod" by shifting (proofs resemble those for "div") **)
40.862
40.863 -Goal "(#0::int) <= a ==> (#1 + #2*b) mod (#2*a) = #1 + #2 * (b mod a)";
40.864 -by (zdiv_undefined_case_tac "a = #0" 1);
40.865 -by (subgoal_tac "#1 <= a" 1);
40.866 +Goal "(Numeral0::int) <= a ==> (Numeral1 + # 2*b) mod (# 2*a) = Numeral1 + # 2 * (b mod a)";
40.867 +by (zdiv_undefined_case_tac "a = Numeral0" 1);
40.868 +by (subgoal_tac "Numeral1 <= a" 1);
40.869 by (arith_tac 2);
40.870 -by (subgoal_tac "#1 < a * #2" 1);
40.871 +by (subgoal_tac "Numeral1 < a * # 2" 1);
40.872 by (arith_tac 2);
40.873 -by (subgoal_tac "#2*(#1 + b mod a) <= #2*a" 1);
40.874 +by (subgoal_tac "# 2*(Numeral1 + b mod a) <= # 2*a" 1);
40.875 by (rtac zmult_zle_mono2 2);
40.876 by (auto_tac (claset(),
40.877 simpset() addsimps [zadd_commute, zmult_commute,
40.878 @@ -941,19 +941,19 @@
40.879 pos_mod_sign RS zadd_zle_mono1 RSN (2,order_trans)]) 1);
40.880 by (auto_tac (claset(),
40.881 simpset() addsimps [mod_pos_pos_trivial]));
40.882 -by (subgoal_tac "#0 <= b mod a" 1);
40.883 +by (subgoal_tac "Numeral0 <= b mod a" 1);
40.884 by (asm_simp_tac (simpset() addsimps [pos_mod_sign]) 2);
40.885 by (arith_tac 1);
40.886 qed "pos_zmod_mult_2";
40.887
40.888
40.889 -Goal "a <= (#0::int) ==> (#1 + #2*b) mod (#2*a) = #2 * ((b+#1) mod a) - #1";
40.890 +Goal "a <= (Numeral0::int) ==> (Numeral1 + # 2*b) mod (# 2*a) = # 2 * ((b+Numeral1) mod a) - Numeral1";
40.891 by (subgoal_tac
40.892 - "(#1 + #2*(-b-#1)) mod (#2*(-a)) = #1 + #2*((-b-#1) mod (-a))" 1);
40.893 + "(Numeral1 + # 2*(-b-Numeral1)) mod (# 2*(-a)) = Numeral1 + # 2*((-b-Numeral1) mod (-a))" 1);
40.894 by (rtac pos_zmod_mult_2 2);
40.895 by (auto_tac (claset(),
40.896 simpset() addsimps [zmult_zminus_right]));
40.897 -by (subgoal_tac "(#-1 - (#2 * b)) = - (#1 + (#2 * b))" 1);
40.898 +by (subgoal_tac "(# -1 - (# 2 * b)) = - (Numeral1 + (# 2 * b))" 1);
40.899 by (Simp_tac 2);
40.900 by (asm_full_simp_tac (HOL_ss
40.901 addsimps [zmod_zminus_zminus, zdiff_def,
40.902 @@ -964,10 +964,10 @@
40.903
40.904 Goal "number_of (v BIT b) mod number_of (w BIT False) = \
40.905 \ (if b then \
40.906 -\ if (#0::int) <= number_of w \
40.907 -\ then #2 * (number_of v mod number_of w) + #1 \
40.908 -\ else #2 * ((number_of v + (#1::int)) mod number_of w) - #1 \
40.909 -\ else #2 * (number_of v mod number_of w))";
40.910 +\ if (Numeral0::int) <= number_of w \
40.911 +\ then # 2 * (number_of v mod number_of w) + Numeral1 \
40.912 +\ else # 2 * ((number_of v + (Numeral1::int)) mod number_of w) - Numeral1 \
40.913 +\ else # 2 * (number_of v mod number_of w))";
40.914 by (simp_tac (simpset_of Int.thy addsimps [zadd_assoc, number_of_BIT]) 1);
40.915 by (asm_simp_tac (simpset()
40.916 delsimps bin_arith_extra_simps@bin_rel_simps
40.917 @@ -980,20 +980,20 @@
40.918
40.919 (** Quotients of signs **)
40.920
40.921 -Goal "[| a < (#0::int); #0 < b |] ==> a div b < #0";
40.922 -by (subgoal_tac "a div b <= #-1" 1);
40.923 +Goal "[| a < (Numeral0::int); Numeral0 < b |] ==> a div b < Numeral0";
40.924 +by (subgoal_tac "a div b <= # -1" 1);
40.925 by (Force_tac 1);
40.926 by (rtac order_trans 1);
40.927 -by (res_inst_tac [("a'","#-1")] zdiv_mono1 1);
40.928 +by (res_inst_tac [("a'","# -1")] zdiv_mono1 1);
40.929 by (auto_tac (claset(), simpset() addsimps [zdiv_minus1]));
40.930 qed "div_neg_pos_less0";
40.931
40.932 -Goal "[| (#0::int) <= a; b < #0 |] ==> a div b <= #0";
40.933 +Goal "[| (Numeral0::int) <= a; b < Numeral0 |] ==> a div b <= Numeral0";
40.934 by (dtac zdiv_mono1_neg 1);
40.935 by Auto_tac;
40.936 qed "div_nonneg_neg_le0";
40.937
40.938 -Goal "(#0::int) < b ==> (#0 <= a div b) = (#0 <= a)";
40.939 +Goal "(Numeral0::int) < b ==> (Numeral0 <= a div b) = (Numeral0 <= a)";
40.940 by Auto_tac;
40.941 by (dtac zdiv_mono1 2);
40.942 by (auto_tac (claset(), simpset() addsimps [linorder_neq_iff]));
40.943 @@ -1001,20 +1001,20 @@
40.944 by (blast_tac (claset() addIs [div_neg_pos_less0]) 1);
40.945 qed "pos_imp_zdiv_nonneg_iff";
40.946
40.947 -Goal "b < (#0::int) ==> (#0 <= a div b) = (a <= (#0::int))";
40.948 +Goal "b < (Numeral0::int) ==> (Numeral0 <= a div b) = (a <= (Numeral0::int))";
40.949 by (stac (zdiv_zminus_zminus RS sym) 1);
40.950 by (stac pos_imp_zdiv_nonneg_iff 1);
40.951 by Auto_tac;
40.952 qed "neg_imp_zdiv_nonneg_iff";
40.953
40.954 (*But not (a div b <= 0 iff a<=0); consider a=1, b=2 when a div b = 0.*)
40.955 -Goal "(#0::int) < b ==> (a div b < #0) = (a < #0)";
40.956 +Goal "(Numeral0::int) < b ==> (a div b < Numeral0) = (a < Numeral0)";
40.957 by (asm_simp_tac (simpset() addsimps [linorder_not_le RS sym,
40.958 pos_imp_zdiv_nonneg_iff]) 1);
40.959 qed "pos_imp_zdiv_neg_iff";
40.960
40.961 (*Again the law fails for <=: consider a = -1, b = -2 when a div b = 0*)
40.962 -Goal "b < (#0::int) ==> (a div b < #0) = (#0 < a)";
40.963 +Goal "b < (Numeral0::int) ==> (a div b < Numeral0) = (Numeral0 < a)";
40.964 by (asm_simp_tac (simpset() addsimps [linorder_not_le RS sym,
40.965 neg_imp_zdiv_nonneg_iff]) 1);
40.966 qed "neg_imp_zdiv_neg_iff";
41.1 --- a/src/HOL/Integ/IntDiv.thy Fri Oct 05 21:50:37 2001 +0200
41.2 +++ b/src/HOL/Integ/IntDiv.thy Fri Oct 05 21:52:39 2001 +0200
41.3 @@ -12,27 +12,27 @@
41.4 quorem :: "(int*int) * (int*int) => bool"
41.5 "quorem == %((a,b), (q,r)).
41.6 a = b*q + r &
41.7 - (if #0<b then #0<=r & r<b else b<r & r <= #0)"
41.8 + (if Numeral0 < b then Numeral0<=r & r<b else b<r & r <= Numeral0)"
41.9
41.10 adjust :: "[int, int, int*int] => int*int"
41.11 - "adjust a b == %(q,r). if #0 <= r-b then (#2*q + #1, r-b)
41.12 - else (#2*q, r)"
41.13 + "adjust a b == %(q,r). if Numeral0 <= r-b then (# 2*q + Numeral1, r-b)
41.14 + else (# 2*q, r)"
41.15
41.16 (** the division algorithm **)
41.17
41.18 (*for the case a>=0, b>0*)
41.19 consts posDivAlg :: "int*int => int*int"
41.20 -recdef posDivAlg "inv_image less_than (%(a,b). nat(a - b + #1))"
41.21 +recdef posDivAlg "inv_image less_than (%(a,b). nat(a - b + Numeral1))"
41.22 "posDivAlg (a,b) =
41.23 - (if (a<b | b<=#0) then (#0,a)
41.24 - else adjust a b (posDivAlg(a, #2*b)))"
41.25 + (if (a<b | b<=Numeral0) then (Numeral0,a)
41.26 + else adjust a b (posDivAlg(a, # 2*b)))"
41.27
41.28 (*for the case a<0, b>0*)
41.29 consts negDivAlg :: "int*int => int*int"
41.30 recdef negDivAlg "inv_image less_than (%(a,b). nat(- a - b))"
41.31 "negDivAlg (a,b) =
41.32 - (if (#0<=a+b | b<=#0) then (#-1,a+b)
41.33 - else adjust a b (negDivAlg(a, #2*b)))"
41.34 + (if (Numeral0<=a+b | b<=Numeral0) then (# -1,a+b)
41.35 + else adjust a b (negDivAlg(a, # 2*b)))"
41.36
41.37 (*for the general case b~=0*)
41.38
41.39 @@ -44,12 +44,12 @@
41.40 including the special case a=0, b<0, because negDivAlg requires a<0*)
41.41 divAlg :: "int*int => int*int"
41.42 "divAlg ==
41.43 - %(a,b). if #0<=a then
41.44 - if #0<=b then posDivAlg (a,b)
41.45 - else if a=#0 then (#0,#0)
41.46 + %(a,b). if Numeral0<=a then
41.47 + if Numeral0<=b then posDivAlg (a,b)
41.48 + else if a=Numeral0 then (Numeral0,Numeral0)
41.49 else negateSnd (negDivAlg (-a,-b))
41.50 else
41.51 - if #0<b then negDivAlg (a,b)
41.52 + if Numeral0<b then negDivAlg (a,b)
41.53 else negateSnd (posDivAlg (-a,-b))"
41.54
41.55 instance
42.1 --- a/src/HOL/Integ/IntPower.ML Fri Oct 05 21:50:37 2001 +0200
42.2 +++ b/src/HOL/Integ/IntPower.ML Fri Oct 05 21:52:39 2001 +0200
42.3 @@ -15,7 +15,7 @@
42.4 by (rtac (zmod_zmult_distrib RS sym) 1);
42.5 qed "zpower_zmod";
42.6
42.7 -Goal "#1^y = (#1::int)";
42.8 +Goal "Numeral1^y = (Numeral1::int)";
42.9 by (induct_tac "y" 1);
42.10 by Auto_tac;
42.11 qed "zpower_1";
43.1 --- a/src/HOL/Integ/IntPower.thy Fri Oct 05 21:50:37 2001 +0200
43.2 +++ b/src/HOL/Integ/IntPower.thy Fri Oct 05 21:52:39 2001 +0200
43.3 @@ -12,7 +12,7 @@
43.4 int :: {power}
43.5
43.6 primrec
43.7 - power_0 "p ^ 0 = #1"
43.8 + power_0 "p ^ 0 = Numeral1"
43.9 power_Suc "p ^ (Suc n) = (p::int) * (p ^ n)"
43.10
43.11 end
44.1 --- a/src/HOL/Integ/NatSimprocs.ML Fri Oct 05 21:50:37 2001 +0200
44.2 +++ b/src/HOL/Integ/NatSimprocs.ML Fri Oct 05 21:52:39 2001 +0200
44.3 @@ -6,16 +6,16 @@
44.4 Simprocs for nat numerals (see also nat_simprocs.ML).
44.5 *)
44.6
44.7 -(** For simplifying Suc m - #n **)
44.8 +(** For simplifying Suc m - # n **)
44.9
44.10 -Goal "#0 < n ==> Suc m - n = m - (n - #1)";
44.11 +Goal "Numeral0 < n ==> Suc m - n = m - (n - Numeral1)";
44.12 by (asm_simp_tac (simpset() addsplits [nat_diff_split]) 1);
44.13 qed "Suc_diff_eq_diff_pred";
44.14
44.15 (*Now just instantiating n to (number_of v) does the right simplification,
44.16 but with some redundant inequality tests.*)
44.17 Goal "neg (number_of (bin_pred v)) = (number_of v = (0::nat))";
44.18 -by (subgoal_tac "neg (number_of (bin_pred v)) = (number_of v < 1')" 1);
44.19 +by (subgoal_tac "neg (number_of (bin_pred v)) = (number_of v < Suc 0)" 1);
44.20 by (asm_simp_tac (HOL_ss addsimps [less_Suc_eq_le, le_0_eq]) 1);
44.21 by (stac less_number_of_Suc 1);
44.22 by (Simp_tac 1);
44.23 @@ -78,54 +78,54 @@
44.24 Addsimps [nat_rec_number_of, nat_rec_add_eq_if];
44.25
44.26
44.27 -(** For simplifying #m - Suc n **)
44.28 +(** For simplifying # m - Suc n **)
44.29
44.30 -Goal "m - Suc n = (m - #1) - n";
44.31 +Goal "m - Suc n = (m - Numeral1) - n";
44.32 by (simp_tac (numeral_ss addsplits [nat_diff_split]) 1);
44.33 qed "diff_Suc_eq_diff_pred";
44.34
44.35 (*Obsolete because of natdiff_cancel_numerals
44.36 Addsimps [inst "m" "number_of ?v" diff_Suc_eq_diff_pred];
44.37 - It LOOPS if #1 is being replaced by 1.
44.38 + It LOOPS if Numeral1 is being replaced by 1.
44.39 *)
44.40
44.41
44.42 (** Evens and Odds, for Mutilated Chess Board **)
44.43
44.44 -(*Case analysis on b<#2*)
44.45 -Goal "(n::nat) < #2 ==> n = #0 | n = #1";
44.46 +(*Case analysis on b<# 2*)
44.47 +Goal "(n::nat) < # 2 ==> n = Numeral0 | n = Numeral1";
44.48 by (arith_tac 1);
44.49 qed "less_2_cases";
44.50
44.51 -Goal "Suc(Suc(m)) mod #2 = m mod #2";
44.52 -by (subgoal_tac "m mod #2 < #2" 1);
44.53 +Goal "Suc(Suc(m)) mod # 2 = m mod # 2";
44.54 +by (subgoal_tac "m mod # 2 < # 2" 1);
44.55 by (Asm_simp_tac 2);
44.56 be (less_2_cases RS disjE) 1;
44.57 by (ALLGOALS (asm_simp_tac (simpset() addsimps [mod_Suc])));
44.58 qed "mod2_Suc_Suc";
44.59 Addsimps [mod2_Suc_Suc];
44.60
44.61 -Goal "!!m::nat. (0 < m mod #2) = (m mod #2 = #1)";
44.62 -by (subgoal_tac "m mod #2 < #2" 1);
44.63 +Goal "!!m::nat. (0 < m mod # 2) = (m mod # 2 = Numeral1)";
44.64 +by (subgoal_tac "m mod # 2 < # 2" 1);
44.65 by (Asm_simp_tac 2);
44.66 by (auto_tac (claset(), simpset() delsimps [mod_less_divisor]));
44.67 qed "mod2_gr_0";
44.68 Addsimps [mod2_gr_0, rename_numerals mod2_gr_0];
44.69
44.70 -(** Removal of small numerals: #0, #1 and (in additive positions) #2 **)
44.71 +(** Removal of small numerals: Numeral0, Numeral1 and (in additive positions) # 2 **)
44.72
44.73 -Goal "#2 + n = Suc (Suc n)";
44.74 +Goal "# 2 + n = Suc (Suc n)";
44.75 by (Simp_tac 1);
44.76 qed "add_2_eq_Suc";
44.77
44.78 -Goal "n + #2 = Suc (Suc n)";
44.79 +Goal "n + # 2 = Suc (Suc n)";
44.80 by (Simp_tac 1);
44.81 qed "add_2_eq_Suc'";
44.82
44.83 Addsimps [numeral_0_eq_0, numeral_1_eq_1, add_2_eq_Suc, add_2_eq_Suc'];
44.84
44.85 (*Can be used to eliminate long strings of Sucs, but not by default*)
44.86 -Goal "Suc (Suc (Suc n)) = #3 + n";
44.87 +Goal "Suc (Suc (Suc n)) = # 3 + n";
44.88 by (Simp_tac 1);
44.89 qed "Suc3_eq_add_3";
44.90
44.91 @@ -136,21 +136,21 @@
44.92 We already have some rules to simplify operands smaller than 3.
44.93 **)
44.94
44.95 -Goal "m div (Suc (Suc (Suc n))) = m div (#3+n)";
44.96 +Goal "m div (Suc (Suc (Suc n))) = m div (# 3+n)";
44.97 by (simp_tac (simpset() addsimps [Suc3_eq_add_3]) 1);
44.98 qed "div_Suc_eq_div_add3";
44.99
44.100 -Goal "m mod (Suc (Suc (Suc n))) = m mod (#3+n)";
44.101 +Goal "m mod (Suc (Suc (Suc n))) = m mod (# 3+n)";
44.102 by (simp_tac (simpset() addsimps [Suc3_eq_add_3]) 1);
44.103 qed "mod_Suc_eq_mod_add3";
44.104
44.105 Addsimps [div_Suc_eq_div_add3, mod_Suc_eq_mod_add3];
44.106
44.107 -Goal "(Suc (Suc (Suc m))) div n = (#3+m) div n";
44.108 +Goal "(Suc (Suc (Suc m))) div n = (# 3+m) div n";
44.109 by (simp_tac (simpset() addsimps [Suc3_eq_add_3]) 1);
44.110 qed "Suc_div_eq_add3_div";
44.111
44.112 -Goal "(Suc (Suc (Suc m))) mod n = (#3+m) mod n";
44.113 +Goal "(Suc (Suc (Suc m))) mod n = (# 3+m) mod n";
44.114 by (simp_tac (simpset() addsimps [Suc3_eq_add_3]) 1);
44.115 qed "Suc_mod_eq_add3_mod";
44.116
45.1 --- a/src/HOL/Integ/int_arith1.ML Fri Oct 05 21:50:37 2001 +0200
45.2 +++ b/src/HOL/Integ/int_arith1.ML Fri Oct 05 21:52:39 2001 +0200
45.3 @@ -9,15 +9,15 @@
45.4
45.5 (** Combining of literal coefficients in sums of products **)
45.6
45.7 -Goal "(x < y) = (x-y < (#0::int))";
45.8 +Goal "(x < y) = (x-y < (Numeral0::int))";
45.9 by (simp_tac (simpset() addsimps zcompare_rls) 1);
45.10 qed "zless_iff_zdiff_zless_0";
45.11
45.12 -Goal "(x = y) = (x-y = (#0::int))";
45.13 +Goal "(x = y) = (x-y = (Numeral0::int))";
45.14 by (simp_tac (simpset() addsimps zcompare_rls) 1);
45.15 qed "eq_iff_zdiff_eq_0";
45.16
45.17 -Goal "(x <= y) = (x-y <= (#0::int))";
45.18 +Goal "(x <= y) = (x-y <= (Numeral0::int))";
45.19 by (simp_tac (simpset() addsimps zcompare_rls) 1);
45.20 qed "zle_iff_zdiff_zle_0";
45.21
45.22 @@ -97,7 +97,7 @@
45.23
45.24 val uminus_const = Const ("uminus", HOLogic.intT --> HOLogic.intT);
45.25
45.26 -(*Thus mk_sum[t] yields t+#0; longer sums don't have a trailing zero*)
45.27 +(*Thus mk_sum[t] yields t+Numeral0; longer sums don't have a trailing zero*)
45.28 fun mk_sum [] = zero
45.29 | mk_sum [t,u] = mk_plus (t, u)
45.30 | mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
45.31 @@ -157,7 +157,7 @@
45.32 handle TERM _ => find_first_coeff (t::past) u terms;
45.33
45.34
45.35 -(*Simplify #1*n and n*#1 to n*)
45.36 +(*Simplify Numeral1*n and n*Numeral1 to n*)
45.37 val add_0s = [zadd_0, zadd_0_right];
45.38 val mult_1s = [zmult_1, zmult_1_right, zmult_minus1, zmult_minus1_right];
45.39
45.40 @@ -279,7 +279,7 @@
45.41 structure CombineNumeralsData =
45.42 struct
45.43 val add = op + : int*int -> int
45.44 - val mk_sum = long_mk_sum (*to work for e.g. #2*x + #3*x *)
45.45 + val mk_sum = long_mk_sum (*to work for e.g. # 2*x + # 3*x *)
45.46 val dest_sum = dest_sum
45.47 val mk_coeff = mk_coeff
45.48 val dest_coeff = dest_coeff 1
45.49 @@ -318,35 +318,35 @@
45.50 set trace_simp;
45.51 fun test s = (Goal s; by (Simp_tac 1));
45.52
45.53 -test "l + #2 + #2 + #2 + (l + #2) + (oo + #2) = (uu::int)";
45.54 +test "l + # 2 + # 2 + # 2 + (l + # 2) + (oo + # 2) = (uu::int)";
45.55
45.56 -test "#2*u = (u::int)";
45.57 -test "(i + j + #12 + (k::int)) - #15 = y";
45.58 -test "(i + j + #12 + (k::int)) - #5 = y";
45.59 +test "# 2*u = (u::int)";
45.60 +test "(i + j + # 12 + (k::int)) - # 15 = y";
45.61 +test "(i + j + # 12 + (k::int)) - # 5 = y";
45.62
45.63 test "y - b < (b::int)";
45.64 -test "y - (#3*b + c) < (b::int) - #2*c";
45.65 +test "y - (# 3*b + c) < (b::int) - # 2*c";
45.66
45.67 -test "(#2*x - (u*v) + y) - v*#3*u = (w::int)";
45.68 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u*#4 = (w::int)";
45.69 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u = (w::int)";
45.70 -test "u*v - (x*u*v + (u*v)*#4 + y) = (w::int)";
45.71 +test "(# 2*x - (u*v) + y) - v*# 3*u = (w::int)";
45.72 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u*# 4 = (w::int)";
45.73 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u = (w::int)";
45.74 +test "u*v - (x*u*v + (u*v)*# 4 + y) = (w::int)";
45.75
45.76 -test "(i + j + #12 + (k::int)) = u + #15 + y";
45.77 -test "(i + j*#2 + #12 + (k::int)) = j + #5 + y";
45.78 +test "(i + j + # 12 + (k::int)) = u + # 15 + y";
45.79 +test "(i + j*# 2 + # 12 + (k::int)) = j + # 5 + y";
45.80
45.81 -test "#2*y + #3*z + #6*w + #2*y + #3*z + #2*u = #2*y' + #3*z' + #6*w' + #2*y' + #3*z' + u + (vv::int)";
45.82 +test "# 2*y + # 3*z + # 6*w + # 2*y + # 3*z + # 2*u = # 2*y' + # 3*z' + # 6*w' + # 2*y' + # 3*z' + u + (vv::int)";
45.83
45.84 test "a + -(b+c) + b = (d::int)";
45.85 test "a + -(b+c) - b = (d::int)";
45.86
45.87 (*negative numerals*)
45.88 -test "(i + j + #-2 + (k::int)) - (u + #5 + y) = zz";
45.89 -test "(i + j + #-3 + (k::int)) < u + #5 + y";
45.90 -test "(i + j + #3 + (k::int)) < u + #-6 + y";
45.91 -test "(i + j + #-12 + (k::int)) - #15 = y";
45.92 -test "(i + j + #12 + (k::int)) - #-15 = y";
45.93 -test "(i + j + #-12 + (k::int)) - #-15 = y";
45.94 +test "(i + j + # -2 + (k::int)) - (u + # 5 + y) = zz";
45.95 +test "(i + j + # -3 + (k::int)) < u + # 5 + y";
45.96 +test "(i + j + # 3 + (k::int)) < u + # -6 + y";
45.97 +test "(i + j + # -12 + (k::int)) - # 15 = y";
45.98 +test "(i + j + # 12 + (k::int)) - # -15 = y";
45.99 +test "(i + j + # -12 + (k::int)) - # -15 = y";
45.100 *)
45.101
45.102
45.103 @@ -410,7 +410,7 @@
45.104 zmult_1, zmult_1_right,
45.105 zmult_minus1, zmult_minus1_right,
45.106 zminus_zadd_distrib, zminus_zminus, zmult_assoc,
45.107 - IntDef.Zero_def, int_0, zadd_int RS sym, int_Suc];
45.108 + Zero_int_def, int_0, zadd_int RS sym, int_Suc];
45.109
45.110 val simprocs = [Int_Times_Assoc.conv, Int_Numeral_Simprocs.combine_numerals]@
45.111 Int_Numeral_Simprocs.cancel_numerals;
45.112 @@ -455,9 +455,9 @@
45.113 (* Some test data
45.114 Goal "!!a::int. [| a <= b; c <= d; x+y<z |] ==> a+c <= b+d";
45.115 by (fast_arith_tac 1);
45.116 -Goal "!!a::int. [| a < b; c < d |] ==> a-d+ #2 <= b+(-c)";
45.117 +Goal "!!a::int. [| a < b; c < d |] ==> a-d+ # 2 <= b+(-c)";
45.118 by (fast_arith_tac 1);
45.119 -Goal "!!a::int. [| a < b; c < d |] ==> a+c+ #1 < b+d";
45.120 +Goal "!!a::int. [| a < b; c < d |] ==> a+c+ Numeral1 < b+d";
45.121 by (fast_arith_tac 1);
45.122 Goal "!!a::int. [| a <= b; b+b <= c |] ==> a+a <= c";
45.123 by (fast_arith_tac 1);
45.124 @@ -465,7 +465,7 @@
45.125 \ ==> a+a <= j+j";
45.126 by (fast_arith_tac 1);
45.127 Goal "!!a::int. [| a+b < i+j; a<b; i<j |] \
45.128 -\ ==> a+a - - #-1 < j+j - #3";
45.129 +\ ==> a+a - - # -1 < j+j - # 3";
45.130 by (fast_arith_tac 1);
45.131 Goal "!!a::int. a+b+c <= i+j+k & a<=b & b<=c & i<=j & j<=k --> a+a+a <= k+k+k";
45.132 by (arith_tac 1);
45.133 @@ -482,6 +482,6 @@
45.134 \ ==> a+a+a+a+a+a <= l+l+l+l+i+l";
45.135 by (fast_arith_tac 1);
45.136 Goal "!!a::int. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |] \
45.137 -\ ==> #6*a <= #5*l+i";
45.138 +\ ==> # 6*a <= # 5*l+i";
45.139 by (fast_arith_tac 1);
45.140 *)
46.1 --- a/src/HOL/Integ/int_arith2.ML Fri Oct 05 21:50:37 2001 +0200
46.2 +++ b/src/HOL/Integ/int_arith2.ML Fri Oct 05 21:52:39 2001 +0200
46.3 @@ -5,17 +5,17 @@
46.4
46.5 (** Simplification of inequalities involving numerical constants **)
46.6
46.7 -Goal "(w <= z - (#1::int)) = (w<(z::int))";
46.8 +Goal "(w <= z - (Numeral1::int)) = (w<(z::int))";
46.9 by (arith_tac 1);
46.10 qed "zle_diff1_eq";
46.11 Addsimps [zle_diff1_eq];
46.12
46.13 -Goal "(w < z + #1) = (w<=(z::int))";
46.14 +Goal "(w < z + Numeral1) = (w<=(z::int))";
46.15 by (arith_tac 1);
46.16 qed "zle_add1_eq_le";
46.17 Addsimps [zle_add1_eq_le];
46.18
46.19 -Goal "(z = z + w) = (w = (#0::int))";
46.20 +Goal "(z = z + w) = (w = (Numeral0::int))";
46.21 by (arith_tac 1);
46.22 qed "zadd_left_cancel0";
46.23 Addsimps [zadd_left_cancel0];
46.24 @@ -23,13 +23,13 @@
46.25
46.26 (* nat *)
46.27
46.28 -Goal "#0 <= z ==> int (nat z) = z";
46.29 +Goal "Numeral0 <= z ==> int (nat z) = z";
46.30 by (asm_full_simp_tac
46.31 (simpset() addsimps [neg_eq_less_0, zle_def, not_neg_nat]) 1);
46.32 qed "nat_0_le";
46.33
46.34 -Goal "z <= #0 ==> nat z = 0";
46.35 -by (case_tac "z = #0" 1);
46.36 +Goal "z <= Numeral0 ==> nat z = 0";
46.37 +by (case_tac "z = Numeral0" 1);
46.38 by (asm_simp_tac (simpset() addsimps [nat_le_int0]) 1);
46.39 by (asm_full_simp_tac
46.40 (simpset() addsimps [neg_eq_less_0, neg_nat, linorder_neq_iff]) 1);
46.41 @@ -37,19 +37,19 @@
46.42
46.43 Addsimps [nat_0_le, nat_le_0];
46.44
46.45 -val [major,minor] = Goal "[| #0 <= z; !!m. z = int m ==> P |] ==> P";
46.46 +val [major,minor] = Goal "[| Numeral0 <= z; !!m. z = int m ==> P |] ==> P";
46.47 by (rtac (major RS nat_0_le RS sym RS minor) 1);
46.48 qed "nonneg_eq_int";
46.49
46.50 -Goal "(nat w = m) = (if #0 <= w then w = int m else m=0)";
46.51 +Goal "(nat w = m) = (if Numeral0 <= w then w = int m else m=0)";
46.52 by Auto_tac;
46.53 qed "nat_eq_iff";
46.54
46.55 -Goal "(m = nat w) = (if #0 <= w then w = int m else m=0)";
46.56 +Goal "(m = nat w) = (if Numeral0 <= w then w = int m else m=0)";
46.57 by Auto_tac;
46.58 qed "nat_eq_iff2";
46.59
46.60 -Goal "#0 <= w ==> (nat w < m) = (w < int m)";
46.61 +Goal "Numeral0 <= w ==> (nat w < m) = (w < int m)";
46.62 by (rtac iffI 1);
46.63 by (asm_full_simp_tac
46.64 (simpset() delsimps [zless_int] addsimps [zless_int RS sym]) 2);
46.65 @@ -57,7 +57,7 @@
46.66 by (Simp_tac 1);
46.67 qed "nat_less_iff";
46.68
46.69 -Goal "(int m = z) = (m = nat z & #0 <= z)";
46.70 +Goal "(int m = z) = (m = nat z & Numeral0 <= z)";
46.71 by (auto_tac (claset(), simpset() addsimps [nat_eq_iff2]));
46.72 qed "int_eq_iff";
46.73
46.74 @@ -67,26 +67,26 @@
46.75 (*Users don't want to see (int 0), int(Suc 0) or w + - z*)
46.76 Addsimps [int_0, int_Suc, symmetric zdiff_def];
46.77
46.78 -Goal "nat #0 = 0";
46.79 +Goal "nat Numeral0 = 0";
46.80 by (simp_tac (simpset() addsimps [nat_eq_iff]) 1);
46.81 qed "nat_0";
46.82
46.83 -Goal "nat #1 = 1";
46.84 +Goal "nat Numeral1 = Suc 0";
46.85 by (simp_tac (simpset() addsimps [nat_eq_iff]) 1);
46.86 qed "nat_1";
46.87
46.88 -Goal "nat #2 = 2";
46.89 +Goal "nat # 2 = Suc (Suc 0)";
46.90 by (simp_tac (simpset() addsimps [nat_eq_iff]) 1);
46.91 qed "nat_2";
46.92
46.93 -Goal "#0 <= w ==> (nat w < nat z) = (w<z)";
46.94 +Goal "Numeral0 <= w ==> (nat w < nat z) = (w<z)";
46.95 by (case_tac "neg z" 1);
46.96 by (auto_tac (claset(), simpset() addsimps [nat_less_iff]));
46.97 by (auto_tac (claset() addIs [zless_trans],
46.98 simpset() addsimps [neg_eq_less_0, zle_def]));
46.99 qed "nat_less_eq_zless";
46.100
46.101 -Goal "#0 < w | #0 <= z ==> (nat w <= nat z) = (w<=z)";
46.102 +Goal "Numeral0 < w | Numeral0 <= z ==> (nat w <= nat z) = (w<=z)";
46.103 by (auto_tac (claset(),
46.104 simpset() addsimps [linorder_not_less RS sym,
46.105 zless_nat_conj]));
46.106 @@ -106,11 +106,11 @@
46.107 *)
46.108
46.109 Goalw [zabs_def]
46.110 - "P(abs(i::int)) = ((#0 <= i --> P i) & (i < #0 --> P(-i)))";
46.111 + "P(abs(i::int)) = ((Numeral0 <= i --> P i) & (i < Numeral0 --> P(-i)))";
46.112 by(Simp_tac 1);
46.113 qed "zabs_split";
46.114
46.115 -Goal "#0 <= abs (z::int)";
46.116 +Goal "Numeral0 <= abs (z::int)";
46.117 by (simp_tac (simpset() addsimps [zabs_def]) 1);
46.118 qed "zero_le_zabs";
46.119 AddIffs [zero_le_zabs];
47.1 --- a/src/HOL/Integ/int_factor_simprocs.ML Fri Oct 05 21:50:37 2001 +0200
47.2 +++ b/src/HOL/Integ/int_factor_simprocs.ML Fri Oct 05 21:52:39 2001 +0200
47.3 @@ -10,27 +10,27 @@
47.4
47.5 (** Factor cancellation theorems for "int" **)
47.6
47.7 -Goal "!!k::int. (k*m <= k*n) = ((#0 < k --> m<=n) & (k < #0 --> n<=m))";
47.8 +Goal "!!k::int. (k*m <= k*n) = ((Numeral0 < k --> m<=n) & (k < Numeral0 --> n<=m))";
47.9 by (stac zmult_zle_cancel1 1);
47.10 by Auto_tac;
47.11 qed "int_mult_le_cancel1";
47.12
47.13 -Goal "!!k::int. (k*m < k*n) = ((#0 < k & m<n) | (k < #0 & n<m))";
47.14 +Goal "!!k::int. (k*m < k*n) = ((Numeral0 < k & m<n) | (k < Numeral0 & n<m))";
47.15 by (stac zmult_zless_cancel1 1);
47.16 by Auto_tac;
47.17 qed "int_mult_less_cancel1";
47.18
47.19 -Goal "!!k::int. (k*m = k*n) = (k = #0 | m=n)";
47.20 +Goal "!!k::int. (k*m = k*n) = (k = Numeral0 | m=n)";
47.21 by Auto_tac;
47.22 qed "int_mult_eq_cancel1";
47.23
47.24 -Goal "!!k::int. k~=#0 ==> (k*m) div (k*n) = (m div n)";
47.25 +Goal "!!k::int. k~=Numeral0 ==> (k*m) div (k*n) = (m div n)";
47.26 by (stac zdiv_zmult_zmult1 1);
47.27 by Auto_tac;
47.28 qed "int_mult_div_cancel1";
47.29
47.30 (*For ExtractCommonTermFun, cancelling common factors*)
47.31 -Goal "(k*m) div (k*n) = (if k = (#0::int) then #0 else m div n)";
47.32 +Goal "(k*m) div (k*n) = (if k = (Numeral0::int) then Numeral0 else m div n)";
47.33 by (simp_tac (simpset() addsimps [int_mult_div_cancel1]) 1);
47.34 qed "int_mult_div_cancel_disj";
47.35
47.36 @@ -114,33 +114,33 @@
47.37 set trace_simp;
47.38 fun test s = (Goal s; by (Simp_tac 1));
47.39
47.40 -test "#9*x = #12 * (y::int)";
47.41 -test "(#9*x) div (#12 * (y::int)) = z";
47.42 -test "#9*x < #12 * (y::int)";
47.43 -test "#9*x <= #12 * (y::int)";
47.44 +test "# 9*x = # 12 * (y::int)";
47.45 +test "(# 9*x) div (# 12 * (y::int)) = z";
47.46 +test "# 9*x < # 12 * (y::int)";
47.47 +test "# 9*x <= # 12 * (y::int)";
47.48
47.49 -test "#-99*x = #132 * (y::int)";
47.50 -test "(#-99*x) div (#132 * (y::int)) = z";
47.51 -test "#-99*x < #132 * (y::int)";
47.52 -test "#-99*x <= #132 * (y::int)";
47.53 +test "# -99*x = # 132 * (y::int)";
47.54 +test "(# -99*x) div (# 132 * (y::int)) = z";
47.55 +test "# -99*x < # 132 * (y::int)";
47.56 +test "# -99*x <= # 132 * (y::int)";
47.57
47.58 -test "#999*x = #-396 * (y::int)";
47.59 -test "(#999*x) div (#-396 * (y::int)) = z";
47.60 -test "#999*x < #-396 * (y::int)";
47.61 -test "#999*x <= #-396 * (y::int)";
47.62 +test "# 999*x = # -396 * (y::int)";
47.63 +test "(# 999*x) div (# -396 * (y::int)) = z";
47.64 +test "# 999*x < # -396 * (y::int)";
47.65 +test "# 999*x <= # -396 * (y::int)";
47.66
47.67 -test "#-99*x = #-81 * (y::int)";
47.68 -test "(#-99*x) div (#-81 * (y::int)) = z";
47.69 -test "#-99*x <= #-81 * (y::int)";
47.70 -test "#-99*x < #-81 * (y::int)";
47.71 +test "# -99*x = # -81 * (y::int)";
47.72 +test "(# -99*x) div (# -81 * (y::int)) = z";
47.73 +test "# -99*x <= # -81 * (y::int)";
47.74 +test "# -99*x < # -81 * (y::int)";
47.75
47.76 -test "#-2 * x = #-1 * (y::int)";
47.77 -test "#-2 * x = -(y::int)";
47.78 -test "(#-2 * x) div (#-1 * (y::int)) = z";
47.79 -test "#-2 * x < -(y::int)";
47.80 -test "#-2 * x <= #-1 * (y::int)";
47.81 -test "-x < #-23 * (y::int)";
47.82 -test "-x <= #-23 * (y::int)";
47.83 +test "# -2 * x = # -1 * (y::int)";
47.84 +test "# -2 * x = -(y::int)";
47.85 +test "(# -2 * x) div (# -1 * (y::int)) = z";
47.86 +test "# -2 * x < -(y::int)";
47.87 +test "# -2 * x <= # -1 * (y::int)";
47.88 +test "-x < # -23 * (y::int)";
47.89 +test "-x <= # -23 * (y::int)";
47.90 *)
47.91
47.92
48.1 --- a/src/HOL/Integ/nat_bin.ML Fri Oct 05 21:50:37 2001 +0200
48.2 +++ b/src/HOL/Integ/nat_bin.ML Fri Oct 05 21:52:39 2001 +0200
48.3 @@ -17,16 +17,16 @@
48.4
48.5 (*These rewrites should one day be re-oriented...*)
48.6
48.7 -Goal "#0 = (0::nat)";
48.8 +Goal "Numeral0 = (0::nat)";
48.9 by (simp_tac (HOL_basic_ss addsimps [nat_0, nat_number_of_def]) 1);
48.10 qed "numeral_0_eq_0";
48.11
48.12 -Goal "#1 = (1::nat)";
48.13 -by (simp_tac (HOL_basic_ss addsimps [nat_1, nat_number_of_def]) 1);
48.14 +Goal "Numeral1 = (1::nat)";
48.15 +by (simp_tac (HOL_basic_ss addsimps [nat_1, nat_number_of_def, One_nat_def]) 1);
48.16 qed "numeral_1_eq_1";
48.17
48.18 -Goal "#2 = (2::nat)";
48.19 -by (simp_tac (HOL_basic_ss addsimps [nat_2, nat_number_of_def]) 1);
48.20 +Goal "# 2 = Suc 1";
48.21 +by (simp_tac (HOL_basic_ss addsimps [nat_2, nat_number_of_def, One_nat_def]) 1);
48.22 qed "numeral_2_eq_2";
48.23
48.24 bind_thm ("zero_eq_numeral_0", numeral_0_eq_0 RS sym);
48.25 @@ -35,7 +35,7 @@
48.26
48.27 (*"neg" is used in rewrite rules for binary comparisons*)
48.28 Goal "int (number_of v :: nat) = \
48.29 -\ (if neg (number_of v) then #0 \
48.30 +\ (if neg (number_of v) then Numeral0 \
48.31 \ else (number_of v :: int))";
48.32 by (simp_tac
48.33 (simpset_of Int.thy addsimps [neg_nat, nat_number_of_def,
48.34 @@ -54,13 +54,13 @@
48.35
48.36 (** Successor **)
48.37
48.38 -Goal "(#0::int) <= z ==> Suc (nat z) = nat (#1 + z)";
48.39 +Goal "(Numeral0::int) <= z ==> Suc (nat z) = nat (Numeral1 + z)";
48.40 by (rtac sym 1);
48.41 by (asm_simp_tac (simpset() addsimps [nat_eq_iff]) 1);
48.42 qed "Suc_nat_eq_nat_zadd1";
48.43
48.44 Goal "Suc (number_of v) = \
48.45 -\ (if neg (number_of v) then #1 else number_of (bin_succ v))";
48.46 +\ (if neg (number_of v) then Numeral1 else number_of (bin_succ v))";
48.47 by (simp_tac
48.48 (simpset_of Int.thy addsimps [neg_nat, nat_1, not_neg_eq_ge_0,
48.49 nat_number_of_def, int_Suc,
48.50 @@ -69,21 +69,21 @@
48.51 Addsimps [Suc_nat_number_of];
48.52
48.53 Goal "Suc (number_of v + n) = \
48.54 -\ (if neg (number_of v) then #1+n else number_of (bin_succ v) + n)";
48.55 +\ (if neg (number_of v) then Numeral1+n else number_of (bin_succ v) + n)";
48.56 by (Simp_tac 1);
48.57 qed "Suc_nat_number_of_add";
48.58
48.59 -Goal "Suc #0 = #1";
48.60 +Goal "Suc Numeral0 = Numeral1";
48.61 by (Simp_tac 1);
48.62 qed "Suc_numeral_0_eq_1";
48.63
48.64 -Goal "Suc #1 = #2";
48.65 +Goal "Suc Numeral1 = # 2";
48.66 by (Simp_tac 1);
48.67 qed "Suc_numeral_1_eq_2";
48.68
48.69 (** Addition **)
48.70
48.71 -Goal "[| (#0::int) <= z; #0 <= z' |] ==> nat (z+z') = nat z + nat z'";
48.72 +Goal "[| (Numeral0::int) <= z; Numeral0 <= z' |] ==> nat (z+z') = nat z + nat z'";
48.73 by (rtac (inj_int RS injD) 1);
48.74 by (asm_simp_tac (simpset() addsimps [zadd_int RS sym]) 1);
48.75 qed "nat_add_distrib";
48.76 @@ -103,7 +103,7 @@
48.77
48.78 (** Subtraction **)
48.79
48.80 -Goal "[| (#0::int) <= z'; z' <= z |] ==> nat (z-z') = nat z - nat z'";
48.81 +Goal "[| (Numeral0::int) <= z'; z' <= z |] ==> nat (z-z') = nat z - nat z'";
48.82 by (rtac (inj_int RS injD) 1);
48.83 by (asm_simp_tac (simpset() addsimps [zdiff_int RS sym, nat_le_eq_zle]) 1);
48.84 qed "nat_diff_distrib";
48.85 @@ -122,7 +122,7 @@
48.86 "(number_of v :: nat) - number_of v' = \
48.87 \ (if neg (number_of v') then number_of v \
48.88 \ else let d = number_of (bin_add v (bin_minus v')) in \
48.89 -\ if neg d then #0 else nat d)";
48.90 +\ if neg d then Numeral0 else nat d)";
48.91 by (simp_tac
48.92 (simpset_of Int.thy delcongs [if_weak_cong]
48.93 addsimps [not_neg_eq_ge_0, nat_0,
48.94 @@ -134,22 +134,22 @@
48.95
48.96 (** Multiplication **)
48.97
48.98 -Goal "(#0::int) <= z ==> nat (z*z') = nat z * nat z'";
48.99 -by (case_tac "#0 <= z'" 1);
48.100 +Goal "(Numeral0::int) <= z ==> nat (z*z') = nat z * nat z'";
48.101 +by (case_tac "Numeral0 <= z'" 1);
48.102 by (asm_full_simp_tac (simpset() addsimps [zmult_le_0_iff]) 2);
48.103 by (rtac (inj_int RS injD) 1);
48.104 by (asm_simp_tac (simpset() addsimps [zmult_int RS sym,
48.105 int_0_le_mult_iff]) 1);
48.106 qed "nat_mult_distrib";
48.107
48.108 -Goal "z <= (#0::int) ==> nat(z*z') = nat(-z) * nat(-z')";
48.109 +Goal "z <= (Numeral0::int) ==> nat(z*z') = nat(-z) * nat(-z')";
48.110 by (rtac trans 1);
48.111 by (rtac nat_mult_distrib 2);
48.112 by Auto_tac;
48.113 qed "nat_mult_distrib_neg";
48.114
48.115 Goal "(number_of v :: nat) * number_of v' = \
48.116 -\ (if neg (number_of v) then #0 else number_of (bin_mult v v'))";
48.117 +\ (if neg (number_of v) then Numeral0 else number_of (bin_mult v v'))";
48.118 by (simp_tac
48.119 (simpset_of Int.thy addsimps [neg_nat, not_neg_eq_ge_0, nat_number_of_def,
48.120 nat_mult_distrib RS sym, number_of_mult,
48.121 @@ -161,15 +161,15 @@
48.122
48.123 (** Quotient **)
48.124
48.125 -Goal "(#0::int) <= z ==> nat (z div z') = nat z div nat z'";
48.126 -by (case_tac "#0 <= z'" 1);
48.127 +Goal "(Numeral0::int) <= z ==> nat (z div z') = nat z div nat z'";
48.128 +by (case_tac "Numeral0 <= z'" 1);
48.129 by (auto_tac (claset(),
48.130 simpset() addsimps [div_nonneg_neg_le0, DIVISION_BY_ZERO_DIV]));
48.131 -by (zdiv_undefined_case_tac "z' = #0" 1);
48.132 +by (zdiv_undefined_case_tac "z' = Numeral0" 1);
48.133 by (simp_tac (simpset() addsimps [numeral_0_eq_0, DIVISION_BY_ZERO_DIV]) 1);
48.134 by (auto_tac (claset() addSEs [nonneg_eq_int], simpset()));
48.135 by (rename_tac "m m'" 1);
48.136 -by (subgoal_tac "#0 <= int m div int m'" 1);
48.137 +by (subgoal_tac "Numeral0 <= int m div int m'" 1);
48.138 by (asm_full_simp_tac
48.139 (simpset() addsimps [numeral_0_eq_0, pos_imp_zdiv_nonneg_iff]) 2);
48.140 by (rtac (inj_int RS injD) 1);
48.141 @@ -184,7 +184,7 @@
48.142 qed "nat_div_distrib";
48.143
48.144 Goal "(number_of v :: nat) div number_of v' = \
48.145 -\ (if neg (number_of v) then #0 \
48.146 +\ (if neg (number_of v) then Numeral0 \
48.147 \ else nat (number_of v div number_of v'))";
48.148 by (simp_tac
48.149 (simpset_of Int.thy addsimps [not_neg_eq_ge_0, nat_number_of_def, neg_nat,
48.150 @@ -197,12 +197,12 @@
48.151 (** Remainder **)
48.152
48.153 (*Fails if z'<0: the LHS collapses to (nat z) but the RHS doesn't*)
48.154 -Goal "[| (#0::int) <= z; #0 <= z' |] ==> nat (z mod z') = nat z mod nat z'";
48.155 -by (zdiv_undefined_case_tac "z' = #0" 1);
48.156 +Goal "[| (Numeral0::int) <= z; Numeral0 <= z' |] ==> nat (z mod z') = nat z mod nat z'";
48.157 +by (zdiv_undefined_case_tac "z' = Numeral0" 1);
48.158 by (simp_tac (simpset() addsimps [numeral_0_eq_0, DIVISION_BY_ZERO_MOD]) 1);
48.159 by (auto_tac (claset() addSEs [nonneg_eq_int], simpset()));
48.160 by (rename_tac "m m'" 1);
48.161 -by (subgoal_tac "#0 <= int m mod int m'" 1);
48.162 +by (subgoal_tac "Numeral0 <= int m mod int m'" 1);
48.163 by (asm_full_simp_tac
48.164 (simpset() addsimps [nat_less_iff, numeral_0_eq_0, pos_mod_sign]) 2);
48.165 by (rtac (inj_int RS injD) 1);
48.166 @@ -217,7 +217,7 @@
48.167 qed "nat_mod_distrib";
48.168
48.169 Goal "(number_of v :: nat) mod number_of v' = \
48.170 -\ (if neg (number_of v) then #0 \
48.171 +\ (if neg (number_of v) then Numeral0 \
48.172 \ else if neg (number_of v') then number_of v \
48.173 \ else nat (number_of v mod number_of v'))";
48.174 by (simp_tac
48.175 @@ -233,7 +233,7 @@
48.176
48.177 (** Equals (=) **)
48.178
48.179 -Goal "[| (#0::int) <= z; #0 <= z' |] ==> (nat z = nat z') = (z=z')";
48.180 +Goal "[| (Numeral0::int) <= z; Numeral0 <= z' |] ==> (nat z = nat z') = (z=z')";
48.181 by (auto_tac (claset() addSEs [nonneg_eq_int], simpset()));
48.182 qed "eq_nat_nat_iff";
48.183
48.184 @@ -280,22 +280,22 @@
48.185
48.186 (*** New versions of existing theorems involving 0, 1, 2 ***)
48.187
48.188 -(*Maps n to #n for n = 0, 1, 2*)
48.189 -val numeral_sym_ss =
48.190 - HOL_ss addsimps [numeral_0_eq_0 RS sym,
48.191 - numeral_1_eq_1 RS sym,
48.192 +(*Maps n to # n for n = 0, 1, 2*)
48.193 +val numeral_sym_ss =
48.194 + HOL_ss addsimps [numeral_0_eq_0 RS sym,
48.195 + numeral_1_eq_1 RS sym,
48.196 numeral_2_eq_2 RS sym,
48.197 Suc_numeral_1_eq_2, Suc_numeral_0_eq_1];
48.198
48.199 fun rename_numerals th = simplify numeral_sym_ss (Thm.transfer (the_context ()) th);
48.200
48.201 -(*Maps #n to n for n = 0, 1, 2*)
48.202 +(*Maps # n to n for n = 0, 1, 2*)
48.203 bind_thms ("numerals", [numeral_0_eq_0, numeral_1_eq_1, numeral_2_eq_2]);
48.204 val numeral_ss = simpset() addsimps numerals;
48.205
48.206 (** Nat **)
48.207
48.208 -Goal "#0 < n ==> n = Suc(n - #1)";
48.209 +Goal "Numeral0 < n ==> n = Suc(n - Numeral1)";
48.210 by (asm_full_simp_tac numeral_ss 1);
48.211 qed "Suc_pred'";
48.212
48.213 @@ -329,28 +329,28 @@
48.214
48.215 AddIffs (map rename_numerals [add_is_0, add_gr_0]);
48.216
48.217 -Goal "Suc n = n + #1";
48.218 +Goal "Suc n = n + Numeral1";
48.219 by (asm_simp_tac numeral_ss 1);
48.220 qed "Suc_eq_add_numeral_1";
48.221
48.222 (* These two can be useful when m = number_of... *)
48.223
48.224 -Goal "(m::nat) + n = (if m=#0 then n else Suc ((m - #1) + n))";
48.225 +Goal "(m::nat) + n = (if m=Numeral0 then n else Suc ((m - Numeral1) + n))";
48.226 by (case_tac "m" 1);
48.227 by (ALLGOALS (asm_simp_tac numeral_ss));
48.228 qed "add_eq_if";
48.229
48.230 -Goal "(m::nat) * n = (if m=#0 then #0 else n + ((m - #1) * n))";
48.231 +Goal "(m::nat) * n = (if m=Numeral0 then Numeral0 else n + ((m - Numeral1) * n))";
48.232 by (case_tac "m" 1);
48.233 by (ALLGOALS (asm_simp_tac numeral_ss));
48.234 qed "mult_eq_if";
48.235
48.236 -Goal "(p ^ m :: nat) = (if m=#0 then #1 else p * (p ^ (m - #1)))";
48.237 +Goal "(p ^ m :: nat) = (if m=Numeral0 then Numeral1 else p * (p ^ (m - Numeral1)))";
48.238 by (case_tac "m" 1);
48.239 by (ALLGOALS (asm_simp_tac numeral_ss));
48.240 qed "power_eq_if";
48.241
48.242 -Goal "[| #0<n; #0<m |] ==> m - n < (m::nat)";
48.243 +Goal "[| Numeral0<n; Numeral0<m |] ==> m - n < (m::nat)";
48.244 by (asm_full_simp_tac (numeral_ss addsimps [diff_less]) 1);
48.245 qed "diff_less'";
48.246
48.247 @@ -375,20 +375,20 @@
48.248
48.249 (** Power **)
48.250
48.251 -Goal "(p::nat) ^ #0 = #1";
48.252 +Goal "(p::nat) ^ Numeral0 = Numeral1";
48.253 by (simp_tac numeral_ss 1);
48.254 qed "power_zero";
48.255
48.256 -Goal "(p::nat) ^ #1 = p";
48.257 +Goal "(p::nat) ^ Numeral1 = p";
48.258 by (simp_tac numeral_ss 1);
48.259 qed "power_one";
48.260 Addsimps [power_zero, power_one];
48.261
48.262 -Goal "(p::nat) ^ #2 = p*p";
48.263 +Goal "(p::nat) ^ # 2 = p*p";
48.264 by (simp_tac numeral_ss 1);
48.265 qed "power_two";
48.266
48.267 -Goal "#0 < (i::nat) ==> #0 < i^n";
48.268 +Goal "Numeral0 < (i::nat) ==> Numeral0 < i^n";
48.269 by (asm_simp_tac numeral_ss 1);
48.270 qed "zero_less_power'";
48.271 Addsimps [zero_less_power'];
48.272 @@ -495,9 +495,9 @@
48.273 by Auto_tac;
48.274 val lemma1 = result();
48.275
48.276 -Goal "m+m ~= int 1' + n + n";
48.277 +Goal "m+m ~= int (Suc 0) + n + n";
48.278 by Auto_tac;
48.279 -by (dres_inst_tac [("f", "%x. x mod #2")] arg_cong 1);
48.280 +by (dres_inst_tac [("f", "%x. x mod # 2")] arg_cong 1);
48.281 by (full_simp_tac (simpset() addsimps [zmod_zadd1_eq]) 1);
48.282 val lemma2 = result();
48.283
48.284 @@ -514,7 +514,7 @@
48.285 by (res_inst_tac [("x", "number_of v")] spec 1);
48.286 by Safe_tac;
48.287 by (ALLGOALS Full_simp_tac);
48.288 -by (dres_inst_tac [("f", "%x. x mod #2")] arg_cong 1);
48.289 +by (dres_inst_tac [("f", "%x. x mod # 2")] arg_cong 1);
48.290 by (full_simp_tac (simpset() addsimps [zmod_zadd1_eq]) 1);
48.291 qed "eq_number_of_BIT_Pls";
48.292
48.293 @@ -524,7 +524,7 @@
48.294 [number_of_BIT, number_of_Min, eq_commute]) 1);
48.295 by (res_inst_tac [("x", "number_of v")] spec 1);
48.296 by Auto_tac;
48.297 -by (dres_inst_tac [("f", "%x. x mod #2")] arg_cong 1);
48.298 +by (dres_inst_tac [("f", "%x. x mod # 2")] arg_cong 1);
48.299 by Auto_tac;
48.300 qed "eq_number_of_BIT_Min";
48.301
48.302 @@ -536,7 +536,7 @@
48.303 (*** Further lemmas about "nat" ***)
48.304
48.305 Goal "nat (abs (w * z)) = nat (abs w) * nat (abs z)";
48.306 -by (case_tac "z=#0 | w=#0" 1);
48.307 +by (case_tac "z=Numeral0 | w=Numeral0" 1);
48.308 by Auto_tac;
48.309 by (simp_tac (simpset() addsimps [zabs_def, nat_mult_distrib RS sym,
48.310 nat_mult_distrib_neg RS sym, zmult_less_0_iff]) 1);
49.1 --- a/src/HOL/Integ/nat_simprocs.ML Fri Oct 05 21:50:37 2001 +0200
49.2 +++ b/src/HOL/Integ/nat_simprocs.ML Fri Oct 05 21:52:39 2001 +0200
49.3 @@ -66,19 +66,19 @@
49.4
49.5 (** For cancel_numeral_factors **)
49.6
49.7 -Goal "(#0::nat) < k ==> (k*m <= k*n) = (m<=n)";
49.8 +Goal "(Numeral0::nat) < k ==> (k*m <= k*n) = (m<=n)";
49.9 by Auto_tac;
49.10 qed "nat_mult_le_cancel1";
49.11
49.12 -Goal "(#0::nat) < k ==> (k*m < k*n) = (m<n)";
49.13 +Goal "(Numeral0::nat) < k ==> (k*m < k*n) = (m<n)";
49.14 by Auto_tac;
49.15 qed "nat_mult_less_cancel1";
49.16
49.17 -Goal "(#0::nat) < k ==> (k*m = k*n) = (m=n)";
49.18 +Goal "(Numeral0::nat) < k ==> (k*m = k*n) = (m=n)";
49.19 by Auto_tac;
49.20 qed "nat_mult_eq_cancel1";
49.21
49.22 -Goal "(#0::nat) < k ==> (k*m) div (k*n) = (m div n)";
49.23 +Goal "(Numeral0::nat) < k ==> (k*m) div (k*n) = (m div n)";
49.24 by Auto_tac;
49.25 qed "nat_mult_div_cancel1";
49.26
49.27 @@ -125,7 +125,7 @@
49.28 val zero = mk_numeral 0;
49.29 val mk_plus = HOLogic.mk_binop "op +";
49.30
49.31 -(*Thus mk_sum[t] yields t+#0; longer sums don't have a trailing zero*)
49.32 +(*Thus mk_sum[t] yields t+Numeral0; longer sums don't have a trailing zero*)
49.33 fun mk_sum [] = zero
49.34 | mk_sum [t,u] = mk_plus (t, u)
49.35 | mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
49.36 @@ -158,7 +158,7 @@
49.37 val bin_simps = [add_nat_number_of, nat_number_of_add_left,
49.38 diff_nat_number_of, le_nat_number_of_eq_not_less,
49.39 less_nat_number_of, mult_nat_number_of,
49.40 - Let_number_of, nat_number_of] @
49.41 + thm "Let_number_of", nat_number_of] @
49.42 bin_arith_simps @ bin_rel_simps;
49.43
49.44 fun prep_simproc (name, pats, proc) = Simplifier.mk_simproc name pats proc;
49.45 @@ -204,11 +204,11 @@
49.46 handle TERM _ => find_first_coeff (t::past) u terms;
49.47
49.48
49.49 -(*Simplify #1*n and n*#1 to n*)
49.50 +(*Simplify Numeral1*n and n*Numeral1 to n*)
49.51 val add_0s = map rename_numerals [add_0, add_0_right];
49.52 val mult_1s = map rename_numerals [mult_1, mult_1_right];
49.53
49.54 -(*Final simplification: cancel + and *; replace #0 by 0 and #1 by 1*)
49.55 +(*Final simplification: cancel + and *; replace Numeral0 by 0 and Numeral1 by 1*)
49.56 val simplify_meta_eq =
49.57 Int_Numeral_Simprocs.simplify_meta_eq
49.58 [numeral_0_eq_0, numeral_1_eq_1, add_0, add_0_right,
49.59 @@ -319,7 +319,7 @@
49.60 structure CombineNumeralsData =
49.61 struct
49.62 val add = op + : int*int -> int
49.63 - val mk_sum = long_mk_sum (*to work for e.g. #2*x + #3*x *)
49.64 + val mk_sum = long_mk_sum (*to work for e.g. # 2*x + # 3*x *)
49.65 val dest_sum = restricted_dest_Sucs_sum
49.66 val mk_coeff = mk_coeff
49.67 val dest_coeff = dest_coeff
49.68 @@ -504,62 +504,62 @@
49.69 fun test s = (Goal s; by (Simp_tac 1));
49.70
49.71 (*cancel_numerals*)
49.72 -test "l +( #2) + (#2) + #2 + (l + #2) + (oo + #2) = (uu::nat)";
49.73 -test "(#2*length xs < #2*length xs + j)";
49.74 -test "(#2*length xs < length xs * #2 + j)";
49.75 -test "#2*u = (u::nat)";
49.76 -test "#2*u = Suc (u)";
49.77 -test "(i + j + #12 + (k::nat)) - #15 = y";
49.78 -test "(i + j + #12 + (k::nat)) - #5 = y";
49.79 -test "Suc u - #2 = y";
49.80 -test "Suc (Suc (Suc u)) - #2 = y";
49.81 -test "(i + j + #2 + (k::nat)) - 1 = y";
49.82 -test "(i + j + #1 + (k::nat)) - 2 = y";
49.83 +test "l +( # 2) + (# 2) + # 2 + (l + # 2) + (oo + # 2) = (uu::nat)";
49.84 +test "(# 2*length xs < # 2*length xs + j)";
49.85 +test "(# 2*length xs < length xs * # 2 + j)";
49.86 +test "# 2*u = (u::nat)";
49.87 +test "# 2*u = Suc (u)";
49.88 +test "(i + j + # 12 + (k::nat)) - # 15 = y";
49.89 +test "(i + j + # 12 + (k::nat)) - # 5 = y";
49.90 +test "Suc u - # 2 = y";
49.91 +test "Suc (Suc (Suc u)) - # 2 = y";
49.92 +test "(i + j + # 2 + (k::nat)) - 1 = y";
49.93 +test "(i + j + Numeral1 + (k::nat)) - 2 = y";
49.94
49.95 -test "(#2*x + (u*v) + y) - v*#3*u = (w::nat)";
49.96 -test "(#2*x*u*v + #5 + (u*v)*#4 + y) - v*u*#4 = (w::nat)";
49.97 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u = (w::nat)";
49.98 -test "Suc (Suc (#2*x*u*v + u*#4 + y)) - u = w";
49.99 -test "Suc ((u*v)*#4) - v*#3*u = w";
49.100 -test "Suc (Suc ((u*v)*#3)) - v*#3*u = w";
49.101 +test "(# 2*x + (u*v) + y) - v*# 3*u = (w::nat)";
49.102 +test "(# 2*x*u*v + # 5 + (u*v)*# 4 + y) - v*u*# 4 = (w::nat)";
49.103 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u = (w::nat)";
49.104 +test "Suc (Suc (# 2*x*u*v + u*# 4 + y)) - u = w";
49.105 +test "Suc ((u*v)*# 4) - v*# 3*u = w";
49.106 +test "Suc (Suc ((u*v)*# 3)) - v*# 3*u = w";
49.107
49.108 -test "(i + j + #12 + (k::nat)) = u + #15 + y";
49.109 -test "(i + j + #32 + (k::nat)) - (u + #15 + y) = zz";
49.110 -test "(i + j + #12 + (k::nat)) = u + #5 + y";
49.111 +test "(i + j + # 12 + (k::nat)) = u + # 15 + y";
49.112 +test "(i + j + # 32 + (k::nat)) - (u + # 15 + y) = zz";
49.113 +test "(i + j + # 12 + (k::nat)) = u + # 5 + y";
49.114 (*Suc*)
49.115 -test "(i + j + #12 + k) = Suc (u + y)";
49.116 -test "Suc (Suc (Suc (Suc (Suc (u + y))))) <= ((i + j) + #41 + k)";
49.117 -test "(i + j + #5 + k) < Suc (Suc (Suc (Suc (Suc (u + y)))))";
49.118 -test "Suc (Suc (Suc (Suc (Suc (u + y))))) - #5 = v";
49.119 -test "(i + j + #5 + k) = Suc (Suc (Suc (Suc (Suc (Suc (Suc (u + y)))))))";
49.120 -test "#2*y + #3*z + #2*u = Suc (u)";
49.121 -test "#2*y + #3*z + #6*w + #2*y + #3*z + #2*u = Suc (u)";
49.122 -test "#2*y + #3*z + #6*w + #2*y + #3*z + #2*u = #2*y' + #3*z' + #6*w' + #2*y' + #3*z' + u + (vv::nat)";
49.123 -test "#6 + #2*y + #3*z + #4*u = Suc (vv + #2*u + z)";
49.124 -test "(#2*n*m) < (#3*(m*n)) + (u::nat)";
49.125 +test "(i + j + # 12 + k) = Suc (u + y)";
49.126 +test "Suc (Suc (Suc (Suc (Suc (u + y))))) <= ((i + j) + # 41 + k)";
49.127 +test "(i + j + # 5 + k) < Suc (Suc (Suc (Suc (Suc (u + y)))))";
49.128 +test "Suc (Suc (Suc (Suc (Suc (u + y))))) - # 5 = v";
49.129 +test "(i + j + # 5 + k) = Suc (Suc (Suc (Suc (Suc (Suc (Suc (u + y)))))))";
49.130 +test "# 2*y + # 3*z + # 2*u = Suc (u)";
49.131 +test "# 2*y + # 3*z + # 6*w + # 2*y + # 3*z + # 2*u = Suc (u)";
49.132 +test "# 2*y + # 3*z + # 6*w + # 2*y + # 3*z + # 2*u = # 2*y' + # 3*z' + # 6*w' + # 2*y' + # 3*z' + u + (vv::nat)";
49.133 +test "# 6 + # 2*y + # 3*z + # 4*u = Suc (vv + # 2*u + z)";
49.134 +test "(# 2*n*m) < (# 3*(m*n)) + (u::nat)";
49.135
49.136 (*negative numerals: FAIL*)
49.137 -test "(i + j + #-23 + (k::nat)) < u + #15 + y";
49.138 -test "(i + j + #3 + (k::nat)) < u + #-15 + y";
49.139 -test "(i + j + #-12 + (k::nat)) - #15 = y";
49.140 -test "(i + j + #12 + (k::nat)) - #-15 = y";
49.141 -test "(i + j + #-12 + (k::nat)) - #-15 = y";
49.142 +test "(i + j + # -23 + (k::nat)) < u + # 15 + y";
49.143 +test "(i + j + # 3 + (k::nat)) < u + # -15 + y";
49.144 +test "(i + j + # -12 + (k::nat)) - # 15 = y";
49.145 +test "(i + j + # 12 + (k::nat)) - # -15 = y";
49.146 +test "(i + j + # -12 + (k::nat)) - # -15 = y";
49.147
49.148 (*combine_numerals*)
49.149 -test "k + #3*k = (u::nat)";
49.150 -test "Suc (i + #3) = u";
49.151 -test "Suc (i + j + #3 + k) = u";
49.152 -test "k + j + #3*k + j = (u::nat)";
49.153 -test "Suc (j*i + i + k + #5 + #3*k + i*j*#4) = (u::nat)";
49.154 -test "(#2*n*m) + (#3*(m*n)) = (u::nat)";
49.155 +test "k + # 3*k = (u::nat)";
49.156 +test "Suc (i + # 3) = u";
49.157 +test "Suc (i + j + # 3 + k) = u";
49.158 +test "k + j + # 3*k + j = (u::nat)";
49.159 +test "Suc (j*i + i + k + # 5 + # 3*k + i*j*# 4) = (u::nat)";
49.160 +test "(# 2*n*m) + (# 3*(m*n)) = (u::nat)";
49.161 (*negative numerals: FAIL*)
49.162 -test "Suc (i + j + #-3 + k) = u";
49.163 +test "Suc (i + j + # -3 + k) = u";
49.164
49.165 (*cancel_numeral_factors*)
49.166 -test "#9*x = #12 * (y::nat)";
49.167 -test "(#9*x) div (#12 * (y::nat)) = z";
49.168 -test "#9*x < #12 * (y::nat)";
49.169 -test "#9*x <= #12 * (y::nat)";
49.170 +test "# 9*x = # 12 * (y::nat)";
49.171 +test "(# 9*x) div (# 12 * (y::nat)) = z";
49.172 +test "# 9*x < # 12 * (y::nat)";
49.173 +test "# 9*x <= # 12 * (y::nat)";
49.174
49.175 (*cancel_factor*)
49.176 test "x*k = k*(y::nat)";
49.177 @@ -597,7 +597,7 @@
49.178 Suc_eq_number_of,eq_number_of_Suc,
49.179 mult_0, mult_0_right, mult_Suc, mult_Suc_right,
49.180 eq_number_of_0, eq_0_number_of, less_0_number_of,
49.181 - nat_number_of, Let_number_of, if_True, if_False];
49.182 + nat_number_of, thm "Let_number_of", if_True, if_False];
49.183
49.184 val simprocs = [Nat_Times_Assoc.conv,
49.185 Nat_Numeral_Simprocs.combine_numerals]@
50.1 --- a/src/HOL/Isar_examples/Fibonacci.thy Fri Oct 05 21:50:37 2001 +0200
50.2 +++ b/src/HOL/Isar_examples/Fibonacci.thy Fri Oct 05 21:52:39 2001 +0200
50.3 @@ -29,7 +29,7 @@
50.4 consts fib :: "nat => nat"
50.5 recdef fib less_than
50.6 "fib 0 = 0"
50.7 - "fib 1' = 1"
50.8 + "fib (Suc 0) = 1"
50.9 "fib (Suc (Suc x)) = fib x + fib (Suc x)"
50.10
50.11 lemma [simp]: "0 < fib (Suc n)"
50.12 @@ -39,7 +39,7 @@
50.13 text {* Alternative induction rule. *}
50.14
50.15 theorem fib_induct:
50.16 - "P 0 ==> P 1 ==> (!!n. P (n + 1) ==> P n ==> P (n + 2)) ==> P n"
50.17 + "P 0 ==> P 1 ==> (!!n. P (n + 1) ==> P n ==> P (n + # 2)) ==> P (n::nat)"
50.18 by (induct rule: fib.induct, simp+)
50.19
50.20
50.21 @@ -56,7 +56,7 @@
50.22 show "?P 0" by simp
50.23 show "?P 1" by simp
50.24 fix n
50.25 - have "fib (n + 2 + k + 1)
50.26 + have "fib (n + # 2 + k + 1)
50.27 = fib (n + k + 1) + fib (n + 1 + k + 1)" by simp
50.28 also assume "fib (n + k + 1)
50.29 = fib (k + 1) * fib (n + 1) + fib k * fib n"
50.30 @@ -65,9 +65,9 @@
50.31 = fib (k + 1) * fib (n + 1 + 1) + fib k * fib (n + 1)"
50.32 (is " _ = ?R2")
50.33 also have "?R1 + ?R2
50.34 - = fib (k + 1) * fib (n + 2 + 1) + fib k * fib (n + 2)"
50.35 + = fib (k + 1) * fib (n + # 2 + 1) + fib k * fib (n + # 2)"
50.36 by (simp add: add_mult_distrib2)
50.37 - finally show "?P (n + 2)" .
50.38 + finally show "?P (n + # 2)" .
50.39 qed
50.40
50.41 lemma gcd_fib_Suc_eq_1: "gcd (fib n, fib (n + 1)) = 1" (is "?P n")
50.42 @@ -75,14 +75,14 @@
50.43 show "?P 0" by simp
50.44 show "?P 1" by simp
50.45 fix n
50.46 - have "fib (n + 2 + 1) = fib (n + 1) + fib (n + 2)"
50.47 + have "fib (n + # 2 + 1) = fib (n + 1) + fib (n + # 2)"
50.48 by simp
50.49 - also have "gcd (fib (n + 2), ...) = gcd (fib (n + 2), fib (n + 1))"
50.50 + also have "gcd (fib (n + # 2), ...) = gcd (fib (n + # 2), fib (n + 1))"
50.51 by (simp only: gcd_add2')
50.52 also have "... = gcd (fib (n + 1), fib (n + 1 + 1))"
50.53 by (simp add: gcd_commute)
50.54 also assume "... = 1"
50.55 - finally show "?P (n + 2)" .
50.56 + finally show "?P (n + # 2)" .
50.57 qed
50.58
50.59 lemma gcd_mult_add: "0 < n ==> gcd (n * k + m, n) = gcd (m, n)"
51.1 --- a/src/HOL/Isar_examples/HoareEx.thy Fri Oct 05 21:50:37 2001 +0200
51.2 +++ b/src/HOL/Isar_examples/HoareEx.thy Fri Oct 05 21:52:39 2001 +0200
51.3 @@ -39,7 +39,7 @@
51.4 *}
51.5
51.6 lemma
51.7 - "|- .{\<acute>(N_update (2 * \<acute>N)) : .{\<acute>N = #10}.}. \<acute>N := 2 * \<acute>N .{\<acute>N = #10}."
51.8 + "|- .{\<acute>(N_update (# 2 * \<acute>N)) : .{\<acute>N = # 10}.}. \<acute>N := # 2 * \<acute>N .{\<acute>N = # 10}."
51.9 by (rule assign)
51.10
51.11 text {*
51.12 @@ -49,13 +49,13 @@
51.13 ``obvious'' consequences as well.
51.14 *}
51.15
51.16 -lemma "|- .{True}. \<acute>N := #10 .{\<acute>N = #10}."
51.17 +lemma "|- .{True}. \<acute>N := # 10 .{\<acute>N = # 10}."
51.18 by hoare
51.19
51.20 -lemma "|- .{2 * \<acute>N = #10}. \<acute>N := 2 * \<acute>N .{\<acute>N = #10}."
51.21 +lemma "|- .{# 2 * \<acute>N = # 10}. \<acute>N := # 2 * \<acute>N .{\<acute>N = # 10}."
51.22 by hoare
51.23
51.24 -lemma "|- .{\<acute>N = #5}. \<acute>N := 2 * \<acute>N .{\<acute>N = #10}."
51.25 +lemma "|- .{\<acute>N = # 5}. \<acute>N := # 2 * \<acute>N .{\<acute>N = # 10}."
51.26 by hoare simp
51.27
51.28 lemma "|- .{\<acute>N + 1 = a + 1}. \<acute>N := \<acute>N + 1 .{\<acute>N = a + 1}."
51.29 @@ -112,7 +112,7 @@
51.30
51.31 lemma "|- .{\<acute>M = \<acute>N}. \<acute>M := \<acute>M + 1 .{\<acute>M ~= \<acute>N}."
51.32 proof -
51.33 - have "!!m n. m = n --> m + 1 ~= n"
51.34 + have "!!m n::nat. m = n --> m + 1 ~= n"
51.35 -- {* inclusion of assertions expressed in ``pure'' logic, *}
51.36 -- {* without mentioning the state space *}
51.37 by simp
52.1 --- a/src/HOL/Isar_examples/MutilatedCheckerboard.thy Fri Oct 05 21:50:37 2001 +0200
52.2 +++ b/src/HOL/Isar_examples/MutilatedCheckerboard.thy Fri Oct 05 21:52:39 2001 +0200
52.3 @@ -76,7 +76,7 @@
52.4 by (simp add: below_def less_Suc_eq) blast
52.5
52.6 lemma Sigma_Suc2:
52.7 - "m = n + 2 ==> A <*> below m =
52.8 + "m = n + # 2 ==> A <*> below m =
52.9 (A <*> {n}) Un (A <*> {n + 1}) Un (A <*> below n)"
52.10 by (auto simp add: below_def) arith
52.11
52.12 @@ -87,10 +87,10 @@
52.13
52.14 constdefs
52.15 evnodd :: "(nat * nat) set => nat => (nat * nat) set"
52.16 - "evnodd A b == A Int {(i, j). (i + j) mod #2 = b}"
52.17 + "evnodd A b == A Int {(i, j). (i + j) mod # 2 = b}"
52.18
52.19 lemma evnodd_iff:
52.20 - "(i, j): evnodd A b = ((i, j): A & (i + j) mod #2 = b)"
52.21 + "(i, j): evnodd A b = ((i, j): A & (i + j) mod # 2 = b)"
52.22 by (simp add: evnodd_def)
52.23
52.24 lemma evnodd_subset: "evnodd A b <= A"
52.25 @@ -112,7 +112,7 @@
52.26 by (simp add: evnodd_def)
52.27
52.28 lemma evnodd_insert: "evnodd (insert (i, j) C) b =
52.29 - (if (i + j) mod #2 = b
52.30 + (if (i + j) mod # 2 = b
52.31 then insert (i, j) (evnodd C b) else evnodd C b)"
52.32 by (simp add: evnodd_def) blast
52.33
52.34 @@ -128,21 +128,21 @@
52.35 vertl: "{(i, j), (i + 1, j)} : domino"
52.36
52.37 lemma dominoes_tile_row:
52.38 - "{i} <*> below (2 * n) : tiling domino"
52.39 + "{i} <*> below (# 2 * n) : tiling domino"
52.40 (is "?P n" is "?B n : ?T")
52.41 proof (induct n)
52.42 show "?P 0" by (simp add: below_0 tiling.empty)
52.43
52.44 fix n assume hyp: "?P n"
52.45 - let ?a = "{i} <*> {2 * n + 1} Un {i} <*> {2 * n}"
52.46 + let ?a = "{i} <*> {# 2 * n + 1} Un {i} <*> {# 2 * n}"
52.47
52.48 have "?B (Suc n) = ?a Un ?B n"
52.49 by (auto simp add: Sigma_Suc Un_assoc)
52.50 also have "... : ?T"
52.51 proof (rule tiling.Un)
52.52 - have "{(i, 2 * n), (i, 2 * n + 1)} : domino"
52.53 + have "{(i, # 2 * n), (i, # 2 * n + 1)} : domino"
52.54 by (rule domino.horiz)
52.55 - also have "{(i, 2 * n), (i, 2 * n + 1)} = ?a" by blast
52.56 + also have "{(i, # 2 * n), (i, # 2 * n + 1)} = ?a" by blast
52.57 finally show "... : domino" .
52.58 from hyp show "?B n : ?T" .
52.59 show "?a <= - ?B n" by blast
52.60 @@ -151,13 +151,13 @@
52.61 qed
52.62
52.63 lemma dominoes_tile_matrix:
52.64 - "below m <*> below (2 * n) : tiling domino"
52.65 + "below m <*> below (# 2 * n) : tiling domino"
52.66 (is "?P m" is "?B m : ?T")
52.67 proof (induct m)
52.68 show "?P 0" by (simp add: below_0 tiling.empty)
52.69
52.70 fix m assume hyp: "?P m"
52.71 - let ?t = "{m} <*> below (2 * n)"
52.72 + let ?t = "{m} <*> below (# 2 * n)"
52.73
52.74 have "?B (Suc m) = ?t Un ?B m" by (simp add: Sigma_Suc)
52.75 also have "... : ?T"
52.76 @@ -170,9 +170,9 @@
52.77 qed
52.78
52.79 lemma domino_singleton:
52.80 - "d : domino ==> b < 2 ==> EX i j. evnodd d b = {(i, j)}"
52.81 + "d : domino ==> b < # 2 ==> EX i j. evnodd d b = {(i, j)}"
52.82 proof -
52.83 - assume b: "b < 2"
52.84 + assume b: "b < # 2"
52.85 assume "d : domino"
52.86 thus ?thesis (is "?P d")
52.87 proof induct
52.88 @@ -227,9 +227,9 @@
52.89 and at: "a <= - t"
52.90
52.91 have card_suc:
52.92 - "!!b. b < 2 ==> card (?e (a Un t) b) = Suc (card (?e t b))"
52.93 + "!!b. b < # 2 ==> card (?e (a Un t) b) = Suc (card (?e t b))"
52.94 proof -
52.95 - fix b assume "b < 2"
52.96 + fix b :: nat assume "b < # 2"
52.97 have "?e (a Un t) b = ?e a b Un ?e t b" by (rule evnodd_Un)
52.98 also obtain i j where e: "?e a b = {(i, j)}"
52.99 proof -
52.100 @@ -260,15 +260,15 @@
52.101 constdefs
52.102 mutilated_board :: "nat => nat => (nat * nat) set"
52.103 "mutilated_board m n ==
52.104 - below (2 * (m + 1)) <*> below (2 * (n + 1))
52.105 - - {(0, 0)} - {(2 * m + 1, 2 * n + 1)}"
52.106 + below (# 2 * (m + 1)) <*> below (# 2 * (n + 1))
52.107 + - {(0, 0)} - {(# 2 * m + 1, # 2 * n + 1)}"
52.108
52.109 theorem mutil_not_tiling: "mutilated_board m n ~: tiling domino"
52.110 proof (unfold mutilated_board_def)
52.111 let ?T = "tiling domino"
52.112 - let ?t = "below (2 * (m + 1)) <*> below (2 * (n + 1))"
52.113 + let ?t = "below (# 2 * (m + 1)) <*> below (# 2 * (n + 1))"
52.114 let ?t' = "?t - {(0, 0)}"
52.115 - let ?t'' = "?t' - {(2 * m + 1, 2 * n + 1)}"
52.116 + let ?t'' = "?t' - {(# 2 * m + 1, # 2 * n + 1)}"
52.117
52.118 show "?t'' ~: ?T"
52.119 proof
52.120 @@ -282,12 +282,12 @@
52.121 note [simp] = evnodd_iff evnodd_empty evnodd_insert evnodd_Diff
52.122 have "card (?e ?t'' 0) < card (?e ?t' 0)"
52.123 proof -
52.124 - have "card (?e ?t' 0 - {(2 * m + 1, 2 * n + 1)})
52.125 + have "card (?e ?t' 0 - {(# 2 * m + 1, # 2 * n + 1)})
52.126 < card (?e ?t' 0)"
52.127 proof (rule card_Diff1_less)
52.128 from _ fin show "finite (?e ?t' 0)"
52.129 by (rule finite_subset) auto
52.130 - show "(2 * m + 1, 2 * n + 1) : ?e ?t' 0" by simp
52.131 + show "(# 2 * m + 1, # 2 * n + 1) : ?e ?t' 0" by simp
52.132 qed
52.133 thus ?thesis by simp
52.134 qed
53.1 --- a/src/HOL/Isar_examples/Summation.thy Fri Oct 05 21:50:37 2001 +0200
53.2 +++ b/src/HOL/Isar_examples/Summation.thy Fri Oct 05 21:52:39 2001 +0200
53.3 @@ -31,14 +31,14 @@
53.4 *}
53.5
53.6 theorem sum_of_naturals:
53.7 - "2 * (\<Sum>i < n + 1. i) = n * (n + 1)"
53.8 + "# 2 * (\<Sum>i < n + 1. i) = n * (n + 1)"
53.9 (is "?P n" is "?S n = _")
53.10 proof (induct n)
53.11 show "?P 0" by simp
53.12 next
53.13 - fix n have "?S (n + 1) = ?S n + 2 * (n + 1)" by simp
53.14 + fix n have "?S (n + 1) = ?S n + # 2 * (n + 1)" by simp
53.15 also assume "?S n = n * (n + 1)"
53.16 - also have "... + 2 * (n + 1) = (n + 1) * (n + 2)" by simp
53.17 + also have "... + # 2 * (n + 1) = (n + 1) * (n + # 2)" by simp
53.18 finally show "?P (Suc n)" by simp
53.19 qed
53.20
53.21 @@ -86,14 +86,14 @@
53.22 *}
53.23
53.24 theorem sum_of_odds:
53.25 - "(\<Sum>i < n. 2 * i + 1) = n^2"
53.26 + "(\<Sum>i < n. # 2 * i + 1) = n^Suc (Suc 0)"
53.27 (is "?P n" is "?S n = _")
53.28 proof (induct n)
53.29 show "?P 0" by simp
53.30 next
53.31 - fix n have "?S (n + 1) = ?S n + 2 * n + 1" by simp
53.32 - also assume "?S n = n^2"
53.33 - also have "... + 2 * n + 1 = (n + 1)^2" by simp
53.34 + fix n have "?S (n + 1) = ?S n + # 2 * n + 1" by simp
53.35 + also assume "?S n = n^Suc (Suc 0)"
53.36 + also have "... + # 2 * n + 1 = (n + 1)^Suc (Suc 0)" by simp
53.37 finally show "?P (Suc n)" by simp
53.38 qed
53.39
53.40 @@ -106,28 +106,28 @@
53.41 lemmas distrib = add_mult_distrib add_mult_distrib2
53.42
53.43 theorem sum_of_squares:
53.44 - "#6 * (\<Sum>i < n + 1. i^2) = n * (n + 1) * (2 * n + 1)"
53.45 + "# 6 * (\<Sum>i < n + 1. i^Suc (Suc 0)) = n * (n + 1) * (# 2 * n + 1)"
53.46 (is "?P n" is "?S n = _")
53.47 proof (induct n)
53.48 show "?P 0" by simp
53.49 next
53.50 - fix n have "?S (n + 1) = ?S n + #6 * (n + 1)^2" by (simp add: distrib)
53.51 - also assume "?S n = n * (n + 1) * (2 * n + 1)"
53.52 - also have "... + #6 * (n + 1)^2 =
53.53 - (n + 1) * (n + 2) * (2 * (n + 1) + 1)" by (simp add: distrib)
53.54 + fix n have "?S (n + 1) = ?S n + # 6 * (n + 1)^Suc (Suc 0)" by (simp add: distrib)
53.55 + also assume "?S n = n * (n + 1) * (# 2 * n + 1)"
53.56 + also have "... + # 6 * (n + 1)^Suc (Suc 0) =
53.57 + (n + 1) * (n + # 2) * (# 2 * (n + 1) + 1)" by (simp add: distrib)
53.58 finally show "?P (Suc n)" by simp
53.59 qed
53.60
53.61 theorem sum_of_cubes:
53.62 - "#4 * (\<Sum>i < n + 1. i^#3) = (n * (n + 1))^2"
53.63 + "# 4 * (\<Sum>i < n + 1. i^# 3) = (n * (n + 1))^Suc (Suc 0)"
53.64 (is "?P n" is "?S n = _")
53.65 proof (induct n)
53.66 show "?P 0" by (simp add: power_eq_if)
53.67 next
53.68 - fix n have "?S (n + 1) = ?S n + #4 * (n + 1)^#3"
53.69 + fix n have "?S (n + 1) = ?S n + # 4 * (n + 1)^# 3"
53.70 by (simp add: power_eq_if distrib)
53.71 - also assume "?S n = (n * (n + 1))^2"
53.72 - also have "... + #4 * (n + 1)^#3 = ((n + 1) * ((n + 1) + 1))^2"
53.73 + also assume "?S n = (n * (n + 1))^Suc (Suc 0)"
53.74 + also have "... + # 4 * (n + 1)^# 3 = ((n + 1) * ((n + 1) + 1))^Suc (Suc 0)"
53.75 by (simp add: power_eq_if distrib)
53.76 finally show "?P (Suc n)" by simp
53.77 qed
54.1 --- a/src/HOL/Lambda/Type.thy Fri Oct 05 21:50:37 2001 +0200
54.2 +++ b/src/HOL/Lambda/Type.thy Fri Oct 05 21:52:39 2001 +0200
54.3 @@ -59,11 +59,11 @@
54.4
54.5 subsection {* Some examples *}
54.6
54.7 -lemma "e |- Abs (Abs (Abs (Var 1 $ (Var 2 $ Var 1 $ Var 0)))) : ?T"
54.8 +lemma "e |- Abs (Abs (Abs (Var 1 $ (Var # 2 $ Var 1 $ Var 0)))) : ?T"
54.9 apply force
54.10 done
54.11
54.12 -lemma "e |- Abs (Abs (Abs (Var 2 $ Var 0 $ (Var 1 $ Var 0)))) : ?T"
54.13 +lemma "e |- Abs (Abs (Abs (Var # 2 $ Var 0 $ (Var 1 $ Var 0)))) : ?T"
54.14 apply force
54.15 done
54.16
54.17 @@ -219,7 +219,7 @@
54.18 "e |- t : T ==> \<forall>e' i U u.
54.19 e = (\<lambda>j. if j < i then e' j
54.20 else if j = i then U
54.21 - else e' (j-1)) -->
54.22 + else e' (j - 1)) -->
54.23 e' |- u : U --> e' |- t[u/i] : T"
54.24 apply (erule typing.induct)
54.25 apply (intro strip)
55.1 --- a/src/HOL/Library/Multiset.thy Fri Oct 05 21:50:37 2001 +0200
55.2 +++ b/src/HOL/Library/Multiset.thy Fri Oct 05 21:52:39 2001 +0200
55.3 @@ -28,7 +28,7 @@
55.4 "{#} == Abs_multiset (\<lambda>a. 0)"
55.5
55.6 single :: "'a => 'a multiset" ("{#_#}")
55.7 - "{#a#} == Abs_multiset (\<lambda>b. if b = a then 1' else 0)"
55.8 + "{#a#} == Abs_multiset (\<lambda>b. if b = a then 1 else 0)"
55.9
55.10 count :: "'a multiset => 'a => nat"
55.11 "count == Rep_multiset"
55.12 @@ -54,7 +54,7 @@
55.13 defs (overloaded)
55.14 union_def: "M + N == Abs_multiset (\<lambda>a. Rep_multiset M a + Rep_multiset N a)"
55.15 diff_def: "M - N == Abs_multiset (\<lambda>a. Rep_multiset M a - Rep_multiset N a)"
55.16 - Zero_def [simp]: "0 == {#}"
55.17 + Zero_multiset_def [simp]: "0 == {#}"
55.18 size_def: "size M == setsum (count M) (set_of M)"
55.19
55.20
55.21 @@ -66,7 +66,7 @@
55.22 apply (simp add: multiset_def)
55.23 done
55.24
55.25 -lemma only1_in_multiset [simp]: "(\<lambda>b. if b = a then 1' else 0) \<in> multiset"
55.26 +lemma only1_in_multiset [simp]: "(\<lambda>b. if b = a then 1 else 0) \<in> multiset"
55.27 apply (simp add: multiset_def)
55.28 done
55.29
55.30 @@ -139,7 +139,7 @@
55.31 apply (simp add: count_def Mempty_def)
55.32 done
55.33
55.34 -theorem count_single [simp]: "count {#b#} a = (if b = a then 1' else 0)"
55.35 +theorem count_single [simp]: "count {#b#} a = (if b = a then 1 else 0)"
55.36 apply (simp add: count_def single_def)
55.37 done
55.38
55.39 @@ -319,8 +319,8 @@
55.40 subsection {* Induction over multisets *}
55.41
55.42 lemma setsum_decr:
55.43 - "finite F ==> 0 < f a ==>
55.44 - setsum (f (a := f a - 1')) F = (if a \<in> F then setsum f F - 1 else setsum f F)"
55.45 + "finite F ==> (0::nat) < f a ==>
55.46 + setsum (f (a := f a - 1)) F = (if a \<in> F then setsum f F - 1 else setsum f F)"
55.47 apply (erule finite_induct)
55.48 apply auto
55.49 apply (drule_tac a = a in mk_disjoint_insert)
55.50 @@ -328,7 +328,7 @@
55.51 done
55.52
55.53 lemma rep_multiset_induct_aux:
55.54 - "P (\<lambda>a. 0) ==> (!!f b. f \<in> multiset ==> P f ==> P (f (b := f b + 1')))
55.55 + "P (\<lambda>a. (0::nat)) ==> (!!f b. f \<in> multiset ==> P f ==> P (f (b := f b + 1)))
55.56 ==> \<forall>f. f \<in> multiset --> setsum f {x. 0 < f x} = n --> P f"
55.57 proof -
55.58 case rule_context
55.59 @@ -347,14 +347,14 @@
55.60 apply (frule setsum_SucD)
55.61 apply clarify
55.62 apply (rename_tac a)
55.63 - apply (subgoal_tac "finite {x. 0 < (f (a := f a - 1')) x}")
55.64 + apply (subgoal_tac "finite {x. 0 < (f (a := f a - 1)) x}")
55.65 prefer 2
55.66 apply (rule finite_subset)
55.67 prefer 2
55.68 apply assumption
55.69 apply simp
55.70 apply blast
55.71 - apply (subgoal_tac "f = (f (a := f a - 1'))(a := (f (a := f a - 1')) a + 1')")
55.72 + apply (subgoal_tac "f = (f (a := f a - 1))(a := (f (a := f a - 1)) a + 1)")
55.73 prefer 2
55.74 apply (rule ext)
55.75 apply (simp (no_asm_simp))
55.76 @@ -362,7 +362,7 @@
55.77 apply blast
55.78 apply (erule allE, erule impE, erule_tac [2] mp)
55.79 apply blast
55.80 - apply (simp (no_asm_simp) add: setsum_decr del: fun_upd_apply)
55.81 + apply (simp (no_asm_simp) add: setsum_decr del: fun_upd_apply One_nat_def)
55.82 apply (subgoal_tac "{x. x \<noteq> a --> 0 < f x} = {x. 0 < f x}")
55.83 prefer 2
55.84 apply blast
55.85 @@ -375,7 +375,7 @@
55.86
55.87 theorem rep_multiset_induct:
55.88 "f \<in> multiset ==> P (\<lambda>a. 0) ==>
55.89 - (!!f b. f \<in> multiset ==> P f ==> P (f (b := f b + 1'))) ==> P f"
55.90 + (!!f b. f \<in> multiset ==> P f ==> P (f (b := f b + 1))) ==> P f"
55.91 apply (insert rep_multiset_induct_aux)
55.92 apply blast
55.93 done
55.94 @@ -390,7 +390,7 @@
55.95 apply (rule Rep_multiset_inverse [THEN subst])
55.96 apply (rule Rep_multiset [THEN rep_multiset_induct])
55.97 apply (rule prem1)
55.98 - apply (subgoal_tac "f (b := f b + 1') = (\<lambda>a. f a + (if a = b then 1' else 0))")
55.99 + apply (subgoal_tac "f (b := f b + 1) = (\<lambda>a. f a + (if a = b then 1 else 0))")
55.100 prefer 2
55.101 apply (simp add: expand_fun_eq)
55.102 apply (erule ssubst)
56.1 --- a/src/HOL/Library/Nat_Infinity.thy Fri Oct 05 21:50:37 2001 +0200
56.2 +++ b/src/HOL/Library/Nat_Infinity.thy Fri Oct 05 21:52:39 2001 +0200
56.3 @@ -31,14 +31,14 @@
56.4 Infty :: inat ("\<infinity>")
56.5
56.6 defs
56.7 - iZero_def: "0 == Fin 0"
56.8 + Zero_inat_def: "0 == Fin 0"
56.9 iSuc_def: "iSuc i == case i of Fin n => Fin (Suc n) | \<infinity> => \<infinity>"
56.10 iless_def: "m < n ==
56.11 case m of Fin m1 => (case n of Fin n1 => m1 < n1 | \<infinity> => True)
56.12 | \<infinity> => False"
56.13 ile_def: "(m::inat) \<le> n == \<not> (n < m)"
56.14
56.15 -lemmas inat_defs = iZero_def iSuc_def iless_def ile_def
56.16 +lemmas inat_defs = Zero_inat_def iSuc_def iless_def ile_def
56.17 lemmas inat_splits = inat.split inat.split_asm
56.18
56.19 text {*
57.1 --- a/src/HOL/Library/Primes.thy Fri Oct 05 21:50:37 2001 +0200
57.2 +++ b/src/HOL/Library/Primes.thy Fri Oct 05 21:52:39 2001 +0200
57.3 @@ -54,7 +54,7 @@
57.4
57.5 declare gcd.simps [simp del]
57.6
57.7 -lemma gcd_1 [simp]: "gcd (m, 1') = 1"
57.8 +lemma gcd_1 [simp]: "gcd (m, Suc 0) = 1"
57.9 apply (simp add: gcd_non_0)
57.10 done
57.11
57.12 @@ -140,8 +140,8 @@
57.13 apply (simp add: gcd_commute [of 0])
57.14 done
57.15
57.16 -lemma gcd_1_left [simp]: "gcd (1', m) = 1"
57.17 - apply (simp add: gcd_commute [of "1'"])
57.18 +lemma gcd_1_left [simp]: "gcd (Suc 0, m) = 1"
57.19 + apply (simp add: gcd_commute [of "Suc 0"])
57.20 done
57.21
57.22
57.23 @@ -194,7 +194,7 @@
57.24 apply (blast intro: relprime_dvd_mult prime_imp_relprime)
57.25 done
57.26
57.27 -lemma prime_dvd_square: "p \<in> prime ==> p dvd m^2 ==> p dvd m"
57.28 +lemma prime_dvd_square: "p \<in> prime ==> p dvd m^Suc (Suc 0) ==> p dvd m"
57.29 apply (auto dest: prime_dvd_mult)
57.30 done
57.31
58.1 --- a/src/HOL/Library/Rational_Numbers.thy Fri Oct 05 21:50:37 2001 +0200
58.2 +++ b/src/HOL/Library/Rational_Numbers.thy Fri Oct 05 21:52:39 2001 +0200
58.3 @@ -17,7 +17,7 @@
58.4
58.5 typedef fraction = "{(a, b) :: int \<times> int | a b. b \<noteq> 0}"
58.6 proof
58.7 - show "(0, #1) \<in> ?fraction" by simp
58.8 + show "(0, Numeral1) \<in> ?fraction" by simp
58.9 qed
58.10
58.11 constdefs
58.12 @@ -140,7 +140,7 @@
58.13 instance fraction :: ord ..
58.14
58.15 defs (overloaded)
58.16 - zero_fraction_def: "0 == fract 0 #1"
58.17 + zero_fraction_def: "0 == fract 0 Numeral1"
58.18 add_fraction_def: "Q + R ==
58.19 fract (num Q * den R + num R * den Q) (den Q * den R)"
58.20 minus_fraction_def: "-Q == fract (-(num Q)) (den Q)"
58.21 @@ -386,9 +386,9 @@
58.22 le_rat_def: "q \<le> r == fraction_of q \<le> fraction_of r"
58.23 less_rat_def: "q < r == q \<le> r \<and> q \<noteq> (r::rat)"
58.24 abs_rat_def: "\<bar>q\<bar> == if q < 0 then -q else (q::rat)"
58.25 - number_of_rat_def: "number_of b == Fract (number_of b) #1"
58.26 + number_of_rat_def: "number_of b == Fract (number_of b) Numeral1"
58.27
58.28 -theorem zero_rat: "0 = Fract 0 #1"
58.29 +theorem zero_rat: "0 = Fract 0 Numeral1"
58.30 by (simp add: zero_rat_def zero_fraction_def rat_of_def Fract_def)
58.31
58.32 theorem add_rat: "b \<noteq> 0 ==> d \<noteq> 0 ==>
58.33 @@ -497,17 +497,17 @@
58.34 by (induct q) (simp add: zero_rat minus_rat add_rat eq_rat)
58.35 show "q - r = q + (-r)"
58.36 by (induct q, induct r) (simp add: add_rat minus_rat diff_rat)
58.37 - show "(0::rat) = #0"
58.38 + show "(0::rat) = Numeral0"
58.39 by (simp add: zero_rat number_of_rat_def)
58.40 show "(q * r) * s = q * (r * s)"
58.41 by (induct q, induct r, induct s) (simp add: mult_rat zmult_ac)
58.42 show "q * r = r * q"
58.43 by (induct q, induct r) (simp add: mult_rat zmult_ac)
58.44 - show "#1 * q = q"
58.45 + show "Numeral1 * q = q"
58.46 by (induct q) (simp add: number_of_rat_def mult_rat)
58.47 show "(q + r) * s = q * s + r * s"
58.48 by (induct q, induct r, induct s) (simp add: add_rat mult_rat eq_rat int_distrib)
58.49 - show "q \<noteq> 0 ==> inverse q * q = #1"
58.50 + show "q \<noteq> 0 ==> inverse q * q = Numeral1"
58.51 by (induct q) (simp add: inverse_rat mult_rat number_of_rat_def zero_rat eq_rat)
58.52 show "r \<noteq> 0 ==> q / r = q * inverse r"
58.53 by (induct q, induct r) (simp add: mult_rat divide_rat inverse_rat zero_rat eq_rat)
58.54 @@ -630,15 +630,15 @@
58.55
58.56 constdefs
58.57 rat :: "int => rat" (* FIXME generalize int to any numeric subtype *)
58.58 - "rat z == Fract z #1"
58.59 + "rat z == Fract z Numeral1"
58.60 int_set :: "rat set" ("\<int>") (* FIXME generalize rat to any numeric supertype *)
58.61 "\<int> == range rat"
58.62
58.63 lemma rat_inject: "(rat z = rat w) = (z = w)"
58.64 proof
58.65 assume "rat z = rat w"
58.66 - hence "Fract z #1 = Fract w #1" by (unfold rat_def)
58.67 - hence "\<lfloor>fract z #1\<rfloor> = \<lfloor>fract w #1\<rfloor>" ..
58.68 + hence "Fract z Numeral1 = Fract w Numeral1" by (unfold rat_def)
58.69 + hence "\<lfloor>fract z Numeral1\<rfloor> = \<lfloor>fract w Numeral1\<rfloor>" ..
58.70 thus "z = w" by auto
58.71 next
58.72 assume "z = w"
59.1 --- a/src/HOL/Library/Ring_and_Field.thy Fri Oct 05 21:50:37 2001 +0200
59.2 +++ b/src/HOL/Library/Ring_and_Field.thy Fri Oct 05 21:52:39 2001 +0200
59.3 @@ -18,11 +18,11 @@
59.4 left_zero [simp]: "0 + a = a"
59.5 left_minus [simp]: "- a + a = 0"
59.6 diff_minus: "a - b = a + (-b)"
59.7 - zero_number: "0 = #0"
59.8 + zero_number: "0 = Numeral0"
59.9
59.10 mult_assoc: "(a * b) * c = a * (b * c)"
59.11 mult_commute: "a * b = b * a"
59.12 - left_one [simp]: "#1 * a = a"
59.13 + left_one [simp]: "Numeral1 * a = a"
59.14
59.15 left_distrib: "(a + b) * c = a * c + b * c"
59.16
59.17 @@ -32,7 +32,7 @@
59.18 abs_if: "\<bar>a\<bar> = (if a < 0 then -a else a)"
59.19
59.20 axclass field \<subseteq> ring, inverse
59.21 - left_inverse [simp]: "a \<noteq> 0 ==> inverse a * a = #1"
59.22 + left_inverse [simp]: "a \<noteq> 0 ==> inverse a * a = Numeral1"
59.23 divide_inverse: "b \<noteq> 0 ==> a / b = a * inverse b"
59.24
59.25 axclass ordered_field \<subseteq> ordered_ring, field
59.26 @@ -86,10 +86,10 @@
59.27
59.28 subsubsection {* Derived rules for multiplication *}
59.29
59.30 -lemma right_one [simp]: "a = a * (#1::'a::field)"
59.31 +lemma right_one [simp]: "a = a * (Numeral1::'a::field)"
59.32 proof -
59.33 - have "a = #1 * a" by simp
59.34 - also have "... = a * #1" by (simp add: mult_commute)
59.35 + have "a = Numeral1 * a" by simp
59.36 + also have "... = a * Numeral1" by (simp add: mult_commute)
59.37 finally show ?thesis .
59.38 qed
59.39
59.40 @@ -102,28 +102,28 @@
59.41
59.42 theorems ring_mult_ac = mult_assoc mult_commute mult_left_commute
59.43
59.44 -lemma right_inverse [simp]: "a \<noteq> 0 ==> a * inverse (a::'a::field) = #1"
59.45 +lemma right_inverse [simp]: "a \<noteq> 0 ==> a * inverse (a::'a::field) = Numeral1"
59.46 proof -
59.47 have "a * inverse a = inverse a * a" by (simp add: ring_mult_ac)
59.48 also assume "a \<noteq> 0"
59.49 - hence "inverse a * a = #1" by simp
59.50 + hence "inverse a * a = Numeral1" by simp
59.51 finally show ?thesis .
59.52 qed
59.53
59.54 -lemma right_inverse_eq: "b \<noteq> 0 ==> (a / b = #1) = (a = (b::'a::field))"
59.55 +lemma right_inverse_eq: "b \<noteq> 0 ==> (a / b = Numeral1) = (a = (b::'a::field))"
59.56 proof
59.57 assume neq: "b \<noteq> 0"
59.58 {
59.59 hence "a = (a / b) * b" by (simp add: divide_inverse ring_mult_ac)
59.60 - also assume "a / b = #1"
59.61 + also assume "a / b = Numeral1"
59.62 finally show "a = b" by simp
59.63 next
59.64 assume "a = b"
59.65 - with neq show "a / b = #1" by (simp add: divide_inverse)
59.66 + with neq show "a / b = Numeral1" by (simp add: divide_inverse)
59.67 }
59.68 qed
59.69
59.70 -lemma divide_self [simp]: "a \<noteq> 0 ==> a / (a::'a::field) = #1"
59.71 +lemma divide_self [simp]: "a \<noteq> 0 ==> a / (a::'a::field) = Numeral1"
59.72 by (simp add: divide_inverse)
59.73
59.74
60.1 --- a/src/HOL/Library/Ring_and_Field_Example.thy Fri Oct 05 21:50:37 2001 +0200
60.2 +++ b/src/HOL/Library/Ring_and_Field_Example.thy Fri Oct 05 21:52:39 2001 +0200
60.3 @@ -13,8 +13,8 @@
60.4 show "i - j = i + (-j)" by simp
60.5 show "(i * j) * k = i * (j * k)" by simp
60.6 show "i * j = j * i" by simp
60.7 - show "#1 * i = i" by simp
60.8 - show "0 = (#0::int)" by simp
60.9 + show "Numeral1 * i = i" by simp
60.10 + show "0 = (Numeral0::int)" by simp
60.11 show "(i + j) * k = i * k + j * k" by (simp add: int_distrib)
60.12 show "i \<le> j ==> k + i \<le> k + j" by simp
60.13 show "i < j ==> 0 < k ==> k * i < k * j" by (simp add: zmult_zless_mono2)
61.1 --- a/src/HOL/Library/While_Combinator.thy Fri Oct 05 21:50:37 2001 +0200
61.2 +++ b/src/HOL/Library/While_Combinator.thy Fri Oct 05 21:52:39 2001 +0200
61.3 @@ -22,9 +22,9 @@
61.4 recdef (permissive) while_aux
61.5 "same_fst (\<lambda>b. True) (\<lambda>b. same_fst (\<lambda>c. True) (\<lambda>c.
61.6 {(t, s). b s \<and> c s = t \<and>
61.7 - \<not> (\<exists>f. f 0 = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1)))}))"
61.8 + \<not> (\<exists>f. f (0::nat) = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1)))}))"
61.9 "while_aux (b, c, s) =
61.10 - (if (\<exists>f. f 0 = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1)))
61.11 + (if (\<exists>f. f (0::nat) = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1)))
61.12 then arbitrary
61.13 else if b s then while_aux (b, c, c s)
61.14 else s)"
61.15 @@ -42,11 +42,10 @@
61.16
61.17 lemma while_aux_unfold:
61.18 "while_aux (b, c, s) =
61.19 - (if \<exists>f. f 0 = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1))
61.20 + (if \<exists>f. f (0::nat) = s \<and> (\<forall>i. b (f i) \<and> c (f i) = f (i + 1))
61.21 then arbitrary
61.22 else if b s then while_aux (b, c, c s)
61.23 else s)"
61.24 -thm while_aux.simps
61.25 apply (rule while_aux_tc [THEN while_aux.simps [THEN trans]])
61.26 apply (rule refl)
61.27 done
61.28 @@ -136,14 +135,14 @@
61.29 theory.}
61.30 *}
61.31
61.32 -theorem "P (lfp (\<lambda>N::int set. {#0} \<union> {(n + #2) mod #6 | n. n \<in> N})) =
61.33 - P {#0, #4, #2}"
61.34 +theorem "P (lfp (\<lambda>N::int set. {Numeral0} \<union> {(n + # 2) mod # 6 | n. n \<in> N})) =
61.35 + P {Numeral0, # 4, # 2}"
61.36 proof -
61.37 have aux: "!!f A B. {f n | n. A n \<or> B n} = {f n | n. A n} \<union> {f n | n. B n}"
61.38 apply blast
61.39 done
61.40 show ?thesis
61.41 - apply (subst lfp_conv_while [where ?U = "{#0, #1, #2, #3, #4, #5}"])
61.42 + apply (subst lfp_conv_while [where ?U = "{Numeral0, Numeral1, # 2, # 3, # 4, # 5}"])
61.43 apply (rule monoI)
61.44 apply blast
61.45 apply simp
62.1 --- a/src/HOL/List.ML Fri Oct 05 21:50:37 2001 +0200
62.2 +++ b/src/HOL/List.ML Fri Oct 05 21:52:39 2001 +0200
62.3 @@ -1323,7 +1323,7 @@
62.4 qed_spec_mp "hd_replicate";
62.5 Addsimps [hd_replicate];
62.6
62.7 -Goal "n ~= 0 --> tl(replicate n x) = replicate (n-1) x";
62.8 +Goal "n ~= 0 --> tl(replicate n x) = replicate (n - 1) x";
62.9 by (induct_tac "n" 1);
62.10 by Auto_tac;
62.11 qed_spec_mp "tl_replicate";
62.12 @@ -1506,19 +1506,19 @@
62.13 AddIffs (map rename_numerals
62.14 [length_0_conv, length_greater_0_conv, sum_eq_0_conv]);
62.15
62.16 -Goal "take n (x#xs) = (if n = #0 then [] else x # take (n-#1) xs)";
62.17 +Goal "take n (x#xs) = (if n = Numeral0 then [] else x # take (n - Numeral1) xs)";
62.18 by (case_tac "n" 1);
62.19 by (ALLGOALS
62.20 (asm_simp_tac (simpset() addsimps [numeral_0_eq_0, numeral_1_eq_1])));
62.21 qed "take_Cons'";
62.22
62.23 -Goal "drop n (x#xs) = (if n = #0 then x#xs else drop (n-#1) xs)";
62.24 +Goal "drop n (x#xs) = (if n = Numeral0 then x#xs else drop (n - Numeral1) xs)";
62.25 by (case_tac "n" 1);
62.26 by (ALLGOALS
62.27 (asm_simp_tac (simpset() addsimps [numeral_0_eq_0, numeral_1_eq_1])));
62.28 qed "drop_Cons'";
62.29
62.30 -Goal "(x#xs)!n = (if n = #0 then x else xs!(n-#1))";
62.31 +Goal "(x#xs)!n = (if n = Numeral0 then x else xs!(n - Numeral1))";
62.32 by (case_tac "n" 1);
62.33 by (ALLGOALS
62.34 (asm_simp_tac (simpset() addsimps [numeral_0_eq_0, numeral_1_eq_1])));
63.1 --- a/src/HOL/MicroJava/BV/JVM.thy Fri Oct 05 21:50:37 2001 +0200
63.2 +++ b/src/HOL/MicroJava/BV/JVM.thy Fri Oct 05 21:52:39 2001 +0200
63.3 @@ -22,7 +22,7 @@
63.4 "wt_kil G C pTs rT mxs mxl ins ==
63.5 bounded (\<lambda>n. succs (ins!n) n) (size ins) \<and> 0 < size ins \<and>
63.6 (let first = Some ([],(OK (Class C))#((map OK pTs))@(replicate mxl Err));
63.7 - start = OK first#(replicate (size ins-1) (OK None));
63.8 + start = OK first#(replicate (size ins - 1) (OK None));
63.9 result = kiljvm G mxs (1+size pTs+mxl) rT ins start
63.10 in \<forall>n < size ins. result!n \<noteq> Err)"
63.11
63.12 @@ -149,7 +149,7 @@
63.13 ==> \<exists>phi. wt_method G C pTs rT maxs mxl bs phi"
63.14 proof -
63.15 let ?start = "OK (Some ([],(OK (Class C))#((map OK pTs))@(replicate mxl Err)))
63.16 - #(replicate (size bs-1) (OK None))"
63.17 + #(replicate (size bs - 1) (OK None))"
63.18
63.19 assume wf: "wf_prog wf_mb G"
63.20 assume isclass: "is_class G C"
63.21 @@ -318,7 +318,7 @@
63.22 by (rule is_bcv_kiljvm)
63.23
63.24 let ?start = "OK (Some ([],(OK (Class C))#((map OK pTs))@(replicate mxl Err)))
63.25 - #(replicate (size bs-1) (OK None))"
63.26 + #(replicate (size bs - 1) (OK None))"
63.27
63.28 { fix l x
63.29 have "set (replicate l x) \<subseteq> {x}"
64.1 --- a/src/HOL/MicroJava/BV/Step.thy Fri Oct 05 21:50:37 2001 +0200
64.2 +++ b/src/HOL/MicroJava/BV/Step.thy Fri Oct 05 21:52:39 2001 +0200
64.3 @@ -114,26 +114,26 @@
64.4 "succs (Invoke C mn fpTs) pc = [pc+1]"
64.5
64.6
64.7 -lemma 1: "2 < length a ==> (\<exists>l l' l'' ls. a = l#l'#l''#ls)"
64.8 +lemma 1: "Suc (Suc 0) < length a ==> (\<exists>l l' l'' ls. a = l#l'#l''#ls)"
64.9 proof (cases a)
64.10 - fix x xs assume "a = x#xs" "2 < length a"
64.11 + fix x xs assume "a = x#xs" "Suc (Suc 0) < length a"
64.12 thus ?thesis by - (cases xs, simp, cases "tl xs", auto)
64.13 qed auto
64.14
64.15 -lemma 2: "\<not>(2 < length a) ==> a = [] \<or> (\<exists> l. a = [l]) \<or> (\<exists> l l'. a = [l,l'])"
64.16 +lemma 2: "\<not>(Suc (Suc 0) < length a) ==> a = [] \<or> (\<exists> l. a = [l]) \<or> (\<exists> l l'. a = [l,l'])"
64.17 proof -;
64.18 - assume "\<not>(2 < length a)"
64.19 - hence "length a < (Suc 2)" by simp
64.20 - hence * : "length a = 0 \<or> length a = 1' \<or> length a = 2"
64.21 + assume "\<not>(Suc (Suc 0) < length a)"
64.22 + hence "length a < Suc (Suc (Suc 0))" by simp
64.23 + hence * : "length a = 0 \<or> length a = Suc 0 \<or> length a = Suc (Suc 0)"
64.24 by (auto simp add: less_Suc_eq)
64.25
64.26 {
64.27 fix x
64.28 - assume "length x = 1'"
64.29 + assume "length x = Suc 0"
64.30 hence "\<exists> l. x = [l]" by - (cases x, auto)
64.31 } note 0 = this
64.32
64.33 - have "length a = 2 ==> \<exists>l l'. a = [l,l']" by (cases a, auto dest: 0)
64.34 + have "length a = Suc (Suc 0) ==> \<exists>l l'. a = [l,l']" by (cases a, auto dest: 0)
64.35 with * show ?thesis by (auto dest: 0)
64.36 qed
64.37
64.38 @@ -152,7 +152,7 @@
64.39
64.40 lemma appStore[simp]:
64.41 "(app (Store idx) G maxs rT (Some s)) = (\<exists> ts ST LT. s = (ts#ST,LT) \<and> idx < length LT)"
64.42 - by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
64.43 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
64.44
64.45 lemma appLitPush[simp]:
64.46 "(app (LitPush v) G maxs rT (Some s)) = (maxs < length (fst s) \<and> typeof (\<lambda>v. None) v \<noteq> None)"
64.47 @@ -162,13 +162,13 @@
64.48 "(app (Getfield F C) G maxs rT (Some s)) =
64.49 (\<exists> oT vT ST LT. s = (oT#ST, LT) \<and> is_class G C \<and>
64.50 field (G,C) F = Some (C,vT) \<and> G \<turnstile> oT \<preceq> (Class C))"
64.51 - by (cases s, cases "2 < length (fst s)", auto dest!: 1 2 simp add: app_def)
64.52 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest!: 1 2 simp add: app_def)
64.53
64.54 lemma appPutField[simp]:
64.55 "(app (Putfield F C) G maxs rT (Some s)) =
64.56 (\<exists> vT vT' oT ST LT. s = (vT#oT#ST, LT) \<and> is_class G C \<and>
64.57 field (G,C) F = Some (C, vT') \<and> G \<turnstile> oT \<preceq> (Class C) \<and> G \<turnstile> vT \<preceq> vT')"
64.58 - by (cases s, cases "2 < length (fst s)", auto dest!: 1 2 simp add: app_def)
64.59 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest!: 1 2 simp add: app_def)
64.60
64.61 lemma appNew[simp]:
64.62 "(app (New C) G maxs rT (Some s)) = (is_class G C \<and> maxs < length (fst s))"
64.63 @@ -181,27 +181,27 @@
64.64
64.65 lemma appPop[simp]:
64.66 "(app Pop G maxs rT (Some s)) = (\<exists>ts ST LT. s = (ts#ST,LT))"
64.67 - by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
64.68 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
64.69
64.70
64.71 lemma appDup[simp]:
64.72 "(app Dup G maxs rT (Some s)) = (\<exists>ts ST LT. s = (ts#ST,LT) \<and> maxs < Suc (length ST))"
64.73 - by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
64.74 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
64.75
64.76
64.77 lemma appDup_x1[simp]:
64.78 "(app Dup_x1 G maxs rT (Some s)) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT) \<and> maxs < Suc (Suc (length ST)))"
64.79 - by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
64.80 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
64.81
64.82
64.83 lemma appDup_x2[simp]:
64.84 "(app Dup_x2 G maxs rT (Some s)) = (\<exists>ts1 ts2 ts3 ST LT. s = (ts1#ts2#ts3#ST,LT) \<and> maxs < Suc (Suc (Suc (length ST))))"
64.85 - by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
64.86 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
64.87
64.88
64.89 lemma appSwap[simp]:
64.90 "app Swap G maxs rT (Some s) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT))"
64.91 - by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
64.92 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
64.93
64.94
64.95 lemma appIAdd[simp]:
64.96 @@ -238,12 +238,12 @@
64.97 lemma appIfcmpeq[simp]:
64.98 "app (Ifcmpeq b) G maxs rT (Some s) = (\<exists>ts1 ts2 ST LT. s = (ts1#ts2#ST,LT) \<and>
64.99 ((\<exists> p. ts1 = PrimT p \<and> ts2 = PrimT p) \<or> (\<exists>r r'. ts1 = RefT r \<and> ts2 = RefT r')))"
64.100 - by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
64.101 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
64.102
64.103
64.104 lemma appReturn[simp]:
64.105 "app Return G maxs rT (Some s) = (\<exists>T ST LT. s = (T#ST,LT) \<and> (G \<turnstile> T \<preceq> rT))"
64.106 - by (cases s, cases "2 < length (fst s)", auto dest: 1 2 simp add: app_def)
64.107 + by (cases s, cases "Suc (Suc 0) < length (fst s)", auto dest: 1 2 simp add: app_def)
64.108
64.109 lemma appGoto[simp]:
64.110 "app (Goto branch) G maxs rT (Some s) = True"
65.1 --- a/src/HOL/MicroJava/J/Example.thy Fri Oct 05 21:50:37 2001 +0200
65.2 +++ b/src/HOL/MicroJava/J/Example.thy Fri Oct 05 21:52:39 2001 +0200
65.3 @@ -100,7 +100,7 @@
65.4 [(vee, PrimT Boolean)],
65.5 [((foo,[Class Base]),Class Base,foo_Base)]))"
65.6 foo_Ext_def:"foo_Ext == ([x],[],Expr( {Ext}Cast Ext
65.7 - (LAcc x)..vee:=Lit (Intg #1)),
65.8 + (LAcc x)..vee:=Lit (Intg Numeral1)),
65.9 Lit Null)"
65.10 ExtC_def: "ExtC == (Ext, (Base ,
65.11 [(vee, PrimT Integer)],
65.12 @@ -127,7 +127,7 @@
65.13 "NP" == "NullPointer"
65.14 "tprg" == "[ObjectC, BaseC, ExtC]"
65.15 "obj1" <= "(Ext, empty((vee, Base)\<mapsto>Bool False)
65.16 - ((vee, Ext )\<mapsto>Intg #0))"
65.17 + ((vee, Ext )\<mapsto>Intg Numeral0))"
65.18 "s0" == " Norm (empty, empty)"
65.19 "s1" == " Norm (empty(a\<mapsto>obj1),empty(e\<mapsto>Addr a))"
65.20 "s2" == " Norm (empty(a\<mapsto>obj1),empty(x\<mapsto>Null)(This\<mapsto>Addr a))"
66.1 --- a/src/HOL/MicroJava/J/Value.thy Fri Oct 05 21:50:37 2001 +0200
66.2 +++ b/src/HOL/MicroJava/J/Value.thy Fri Oct 05 21:52:39 2001 +0200
66.3 @@ -40,7 +40,7 @@
66.4 primrec
66.5 "defpval Void = Unit"
66.6 "defpval Boolean = Bool False"
66.7 - "defpval Integer = Intg (#0)"
66.8 + "defpval Integer = Intg (Numeral0)"
66.9
66.10 primrec
66.11 "default_val (PrimT pt) = defpval pt"
67.1 --- a/src/HOL/Nat.ML Fri Oct 05 21:50:37 2001 +0200
67.2 +++ b/src/HOL/Nat.ML Fri Oct 05 21:52:39 2001 +0200
67.3 @@ -68,7 +68,7 @@
67.4 by Auto_tac;
67.5 qed "less_Suc_eq_0_disj";
67.6
67.7 -val prems = Goal "[| P 0; P(1'); !!k. P k ==> P (Suc (Suc k)) |] ==> P n";
67.8 +val prems = Goal "[| P 0; P(Suc 0); !!k. P k ==> P (Suc (Suc k)) |] ==> P n";
67.9 by (rtac nat_less_induct 1);
67.10 by (case_tac "n" 1);
67.11 by (case_tac "nat" 2);
67.12 @@ -157,7 +157,7 @@
67.13 (* Could be (and is, below) generalized in various ways;
67.14 However, none of the generalizations are currently in the simpset,
67.15 and I dread to think what happens if I put them in *)
67.16 -Goal "0 < n ==> Suc(n-1') = n";
67.17 +Goal "0 < n ==> Suc(n - Suc 0) = n";
67.18 by (asm_simp_tac (simpset() addsplits [nat.split]) 1);
67.19 qed "Suc_pred";
67.20 Addsimps [Suc_pred];
67.21 @@ -238,12 +238,12 @@
67.22 qed "add_is_0";
67.23 AddIffs [add_is_0];
67.24
67.25 -Goal "(m+n=1') = (m=1' & n=0 | m=0 & n=1')";
67.26 +Goal "(m+n= Suc 0) = (m= Suc 0 & n=0 | m=0 & n= Suc 0)";
67.27 by (case_tac "m" 1);
67.28 by (Auto_tac);
67.29 qed "add_is_1";
67.30
67.31 -Goal "(1' = m+n) = (m=1' & n=0 | m=0 & n=1')";
67.32 +Goal "(Suc 0 = m+n) = (m=Suc 0 & n=0 | m=0 & n= Suc 0)";
67.33 by (case_tac "m" 1);
67.34 by (Auto_tac);
67.35 qed "one_is_add";
67.36 @@ -396,11 +396,11 @@
67.37
67.38 Addsimps [mult_0_right, mult_Suc_right];
67.39
67.40 -Goal "1 * n = n";
67.41 +Goal "(1::nat) * n = n";
67.42 by (Asm_simp_tac 1);
67.43 qed "mult_1";
67.44
67.45 -Goal "n * 1 = n";
67.46 +Goal "n * (1::nat) = n";
67.47 by (Asm_simp_tac 1);
67.48 qed "mult_1_right";
67.49
67.50 @@ -638,14 +638,14 @@
67.51 qed "zero_less_mult_iff";
67.52 Addsimps [zero_less_mult_iff];
67.53
67.54 -Goal "(1' <= m*n) = (1<=m & 1<=n)";
67.55 +Goal "(Suc 0 <= m*n) = (1<=m & 1<=n)";
67.56 by (induct_tac "m" 1);
67.57 by (case_tac "n" 2);
67.58 by (ALLGOALS Asm_simp_tac);
67.59 qed "one_le_mult_iff";
67.60 Addsimps [one_le_mult_iff];
67.61
67.62 -Goal "(m*n = 1') = (m=1 & n=1)";
67.63 +Goal "(m*n = Suc 0) = (m=1 & n=1)";
67.64 by (induct_tac "m" 1);
67.65 by (Simp_tac 1);
67.66 by (induct_tac "n" 1);
67.67 @@ -654,7 +654,7 @@
67.68 qed "mult_eq_1_iff";
67.69 Addsimps [mult_eq_1_iff];
67.70
67.71 -Goal "(1' = m*n) = (m=1 & n=1)";
67.72 +Goal "(Suc 0 = m*n) = (m=1 & n=1)";
67.73 by(rtac (mult_eq_1_iff RSN (2,trans)) 1);
67.74 by (fast_tac (claset() addss simpset()) 1);
67.75 qed "one_eq_mult_iff";
68.1 --- a/src/HOL/NatArith.ML Fri Oct 05 21:50:37 2001 +0200
68.2 +++ b/src/HOL/NatArith.ML Fri Oct 05 21:52:39 2001 +0200
68.3 @@ -96,17 +96,17 @@
68.4
68.5 (** Lemmas for ex/Factorization **)
68.6
68.7 -Goal "!!m::nat. [| 1' < n; 1' < m |] ==> 1' < m*n";
68.8 +Goal "!!m::nat. [| Suc 0 < n; Suc 0 < m |] ==> Suc 0 < m*n";
68.9 by (case_tac "m" 1);
68.10 by Auto_tac;
68.11 qed "one_less_mult";
68.12
68.13 -Goal "!!m::nat. [| 1' < n; 1' < m |] ==> n<m*n";
68.14 +Goal "!!m::nat. [| Suc 0 < n; Suc 0 < m |] ==> n<m*n";
68.15 by (case_tac "m" 1);
68.16 by Auto_tac;
68.17 qed "n_less_m_mult_n";
68.18
68.19 -Goal "!!m::nat. [| 1' < n; 1' < m |] ==> n<n*m";
68.20 +Goal "!!m::nat. [| Suc 0 < n; Suc 0 < m |] ==> n<n*m";
68.21 by (case_tac "m" 1);
68.22 by Auto_tac;
68.23 qed "n_less_n_mult_m";
69.1 --- a/src/HOL/NatDef.ML Fri Oct 05 21:50:37 2001 +0200
69.2 +++ b/src/HOL/NatDef.ML Fri Oct 05 21:52:39 2001 +0200
69.3 @@ -4,13 +4,13 @@
69.4 Copyright 1991 University of Cambridge
69.5 *)
69.6
69.7 -Addsimps [One_def];
69.8 +Addsimps [One_nat_def];
69.9
69.10 val rew = rewrite_rule [symmetric Nat_def];
69.11
69.12 (*** Induction ***)
69.13
69.14 -val prems = Goalw [Zero_def,Suc_def]
69.15 +val prems = Goalw [Zero_nat_def,Suc_def]
69.16 "[| P(0); \
69.17 \ !!n. P(n) ==> P(Suc(n)) |] ==> P(n)";
69.18 by (rtac (Rep_Nat_inverse RS subst) 1); (*types force good instantiation*)
69.19 @@ -53,7 +53,7 @@
69.20
69.21 (*** Distinctness of constructors ***)
69.22
69.23 -Goalw [Zero_def,Suc_def] "Suc(m) ~= 0";
69.24 +Goalw [Zero_nat_def,Suc_def] "Suc(m) ~= 0";
69.25 by (rtac (inj_on_Abs_Nat RS inj_on_contraD) 1);
69.26 by (rtac Suc_Rep_not_Zero_Rep 1);
69.27 by (REPEAT (resolve_tac [Rep_Nat, rew Nat'.Suc_RepI, rew Nat'.Zero_RepI] 1));
69.28 @@ -191,7 +191,7 @@
69.29 by (blast_tac (claset() addSEs [less_SucE] addIs [less_trans]) 1);
69.30 qed "less_Suc_eq";
69.31
69.32 -Goal "(n<1) = (n=0)";
69.33 +Goal "(n < (1::nat)) = (n = 0)";
69.34 by (simp_tac (simpset() addsimps [less_Suc_eq]) 1);
69.35 qed "less_one";
69.36 AddIffs [less_one];
69.37 @@ -462,12 +462,13 @@
69.38 qed "zero_reorient";
69.39 Addsimps [zero_reorient];
69.40
69.41 +(*Polymorphic, not just for "nat"*)
69.42 Goal "True ==> (1 = x) = (x = 1)";
69.43 by Auto_tac;
69.44 qed "one_reorient";
69.45 Addsimps [one_reorient];
69.46
69.47 -Goal "True ==> (2 = x) = (x = 2)";
69.48 -by Auto_tac;
69.49 +Goal "True ==> (Suc (Suc 0) = x) = (x = Suc (Suc 0))"; (* FIXME !? *)
69.50 +by Auto_tac;
69.51 qed "two_reorient";
69.52 Addsimps [two_reorient];
70.1 --- a/src/HOL/NatDef.thy Fri Oct 05 21:50:37 2001 +0200
70.2 +++ b/src/HOL/NatDef.thy Fri Oct 05 21:52:39 2001 +0200
70.3 @@ -47,7 +47,7 @@
70.4 nat = "Nat'" (Nat'.Zero_RepI)
70.5
70.6 instance
70.7 - nat :: {ord, zero}
70.8 + nat :: {ord, zero, one}
70.9
70.10
70.11 (* abstract constants and syntax *)
70.12 @@ -55,23 +55,13 @@
70.13 consts
70.14 Suc :: nat => nat
70.15 pred_nat :: "(nat * nat) set"
70.16 - "1" :: nat ("1")
70.17 -
70.18 -syntax
70.19 - "1'" :: nat ("1'")
70.20 - "2" :: nat ("2")
70.21 -
70.22 -translations
70.23 - "1'" == "Suc 0"
70.24 - "2" == "Suc 1'"
70.25 -
70.26
70.27 local
70.28
70.29 defs
70.30 - Zero_def "0 == Abs_Nat(Zero_Rep)"
70.31 + Zero_nat_def "0 == Abs_Nat(Zero_Rep)"
70.32 Suc_def "Suc == (%n. Abs_Nat(Suc_Rep(Rep_Nat(n))))"
70.33 - One_def "1 == 1'"
70.34 + One_nat_def "1 == Suc 0"
70.35
70.36 (*nat operations*)
70.37 pred_nat_def "pred_nat == {(m,n). n = Suc m}"
71.1 --- a/src/HOL/NumberTheory/Chinese.thy Fri Oct 05 21:50:37 2001 +0200
71.2 +++ b/src/HOL/NumberTheory/Chinese.thy Fri Oct 05 21:52:39 2001 +0200
71.3 @@ -45,26 +45,26 @@
71.4 defs
71.5 m_cond_def:
71.6 "m_cond n mf ==
71.7 - (\<forall>i. i \<le> n --> #0 < mf i) \<and>
71.8 - (\<forall>i j. i \<le> n \<and> j \<le> n \<and> i \<noteq> j --> zgcd (mf i, mf j) = #1)"
71.9 + (\<forall>i. i \<le> n --> Numeral0 < mf i) \<and>
71.10 + (\<forall>i j. i \<le> n \<and> j \<le> n \<and> i \<noteq> j --> zgcd (mf i, mf j) = Numeral1)"
71.11
71.12 km_cond_def:
71.13 - "km_cond n kf mf == \<forall>i. i \<le> n --> zgcd (kf i, mf i) = #1"
71.14 + "km_cond n kf mf == \<forall>i. i \<le> n --> zgcd (kf i, mf i) = Numeral1"
71.15
71.16 lincong_sol_def:
71.17 "lincong_sol n kf bf mf x == \<forall>i. i \<le> n --> zcong (kf i * x) (bf i) (mf i)"
71.18
71.19 mhf_def:
71.20 "mhf mf n i ==
71.21 - if i = 0 then funprod mf 1' (n - 1')
71.22 - else if i = n then funprod mf 0 (n - 1')
71.23 - else funprod mf 0 (i - 1') * funprod mf (Suc i) (n - 1' - i)"
71.24 + if i = 0 then funprod mf (Suc 0) (n - Suc 0)
71.25 + else if i = n then funprod mf 0 (n - Suc 0)
71.26 + else funprod mf 0 (i - Suc 0) * funprod mf (Suc i) (n - Suc 0 - i)"
71.27
71.28 xilin_sol_def:
71.29 "xilin_sol i n kf bf mf ==
71.30 if 0 < n \<and> i \<le> n \<and> m_cond n mf \<and> km_cond n kf mf then
71.31 - (SOME x. #0 \<le> x \<and> x < mf i \<and> zcong (kf i * mhf mf n i * x) (bf i) (mf i))
71.32 - else #0"
71.33 + (SOME x. Numeral0 \<le> x \<and> x < mf i \<and> zcong (kf i * mhf mf n i * x) (bf i) (mf i))
71.34 + else Numeral0"
71.35
71.36 x_sol_def:
71.37 "x_sol n kf bf mf == funsum (\<lambda>i. xilin_sol i n kf bf mf * mhf mf n i) 0 n"
71.38 @@ -72,15 +72,15 @@
71.39
71.40 text {* \medskip @{term funprod} and @{term funsum} *}
71.41
71.42 -lemma funprod_pos: "(\<forall>i. i \<le> n --> #0 < mf i) ==> #0 < funprod mf 0 n"
71.43 +lemma funprod_pos: "(\<forall>i. i \<le> n --> Numeral0 < mf i) ==> Numeral0 < funprod mf 0 n"
71.44 apply (induct n)
71.45 apply auto
71.46 apply (simp add: int_0_less_mult_iff)
71.47 done
71.48
71.49 lemma funprod_zgcd [rule_format (no_asm)]:
71.50 - "(\<forall>i. k \<le> i \<and> i \<le> k + l --> zgcd (mf i, mf m) = #1) -->
71.51 - zgcd (funprod mf k l, mf m) = #1"
71.52 + "(\<forall>i. k \<le> i \<and> i \<le> k + l --> zgcd (mf i, mf m) = Numeral1) -->
71.53 + zgcd (funprod mf k l, mf m) = Numeral1"
71.54 apply (induct l)
71.55 apply simp_all
71.56 apply (rule impI)+
71.57 @@ -110,14 +110,14 @@
71.58 done
71.59
71.60 lemma funsum_zero [rule_format (no_asm)]:
71.61 - "(\<forall>i. k \<le> i \<and> i \<le> k + l --> f i = #0) --> (funsum f k l) = #0"
71.62 + "(\<forall>i. k \<le> i \<and> i \<le> k + l --> f i = Numeral0) --> (funsum f k l) = Numeral0"
71.63 apply (induct l)
71.64 apply auto
71.65 done
71.66
71.67 lemma funsum_oneelem [rule_format (no_asm)]:
71.68 "k \<le> j --> j \<le> k + l -->
71.69 - (\<forall>i. k \<le> i \<and> i \<le> k + l \<and> i \<noteq> j --> f i = #0) -->
71.70 + (\<forall>i. k \<le> i \<and> i \<le> k + l \<and> i \<noteq> j --> f i = Numeral0) -->
71.71 funsum f k l = f j"
71.72 apply (induct l)
71.73 prefer 2
71.74 @@ -127,9 +127,9 @@
71.75 apply (subgoal_tac "k = j")
71.76 apply (simp_all (no_asm_simp))
71.77 apply (case_tac "Suc (k + n) = j")
71.78 - apply (subgoal_tac "funsum f k n = #0")
71.79 + apply (subgoal_tac "funsum f k n = Numeral0")
71.80 apply (rule_tac [2] funsum_zero)
71.81 - apply (subgoal_tac [3] "f (Suc (k + n)) = #0")
71.82 + apply (subgoal_tac [3] "f (Suc (k + n)) = Numeral0")
71.83 apply (subgoal_tac [3] "j \<le> k + n")
71.84 prefer 4
71.85 apply arith
71.86 @@ -175,7 +175,7 @@
71.87
71.88 lemma unique_xi_sol:
71.89 "0 < n ==> i \<le> n ==> m_cond n mf ==> km_cond n kf mf
71.90 - ==> \<exists>!x. #0 \<le> x \<and> x < mf i \<and> [kf i * mhf mf n i * x = bf i] (mod mf i)"
71.91 + ==> \<exists>!x. Numeral0 \<le> x \<and> x < mf i \<and> [kf i * mhf mf n i * x = bf i] (mod mf i)"
71.92 apply (rule zcong_lineq_unique)
71.93 apply (tactic {* stac (thm "zgcd_zmult_cancel") 2 *})
71.94 apply (unfold m_cond_def km_cond_def mhf_def)
71.95 @@ -227,7 +227,7 @@
71.96
71.97 lemma chinese_remainder:
71.98 "0 < n ==> m_cond n mf ==> km_cond n kf mf
71.99 - ==> \<exists>!x. #0 \<le> x \<and> x < funprod mf 0 n \<and> lincong_sol n kf bf mf x"
71.100 + ==> \<exists>!x. Numeral0 \<le> x \<and> x < funprod mf 0 n \<and> lincong_sol n kf bf mf x"
71.101 apply safe
71.102 apply (rule_tac [2] m = "funprod mf 0 n" in zcong_zless_imp_eq)
71.103 apply (rule_tac [6] zcong_funprod)
71.104 @@ -242,7 +242,7 @@
71.105 apply (tactic {* stac (thm "zmod_zmult_distrib" RS sym) 7 *})
71.106 apply (tactic {* stac (thm "zcong_zmod" RS sym) 7 *})
71.107 apply (subgoal_tac [7]
71.108 - "#0 \<le> xilin_sol i n kf bf mf \<and> xilin_sol i n kf bf mf < mf i
71.109 + "Numeral0 \<le> xilin_sol i n kf bf mf \<and> xilin_sol i n kf bf mf < mf i
71.110 \<and> [kf i * mhf mf n i * xilin_sol i n kf bf mf = bf i] (mod mf i)")
71.111 prefer 7
71.112 apply (simp add: zmult_ac)
72.1 --- a/src/HOL/NumberTheory/EulerFermat.thy Fri Oct 05 21:50:37 2001 +0200
72.2 +++ b/src/HOL/NumberTheory/EulerFermat.thy Fri Oct 05 21:52:39 2001 +0200
72.3 @@ -29,33 +29,33 @@
72.4 inductive "RsetR m"
72.5 intros
72.6 empty [simp]: "{} \<in> RsetR m"
72.7 - insert: "A \<in> RsetR m ==> zgcd (a, m) = #1 ==>
72.8 + insert: "A \<in> RsetR m ==> zgcd (a, m) = Numeral1 ==>
72.9 \<forall>a'. a' \<in> A --> \<not> zcong a a' m ==> insert a A \<in> RsetR m"
72.10
72.11 recdef BnorRset
72.12 "measure ((\<lambda>(a, m). nat a) :: int * int => nat)"
72.13 "BnorRset (a, m) =
72.14 - (if #0 < a then
72.15 - let na = BnorRset (a - #1, m)
72.16 - in (if zgcd (a, m) = #1 then insert a na else na)
72.17 + (if Numeral0 < a then
72.18 + let na = BnorRset (a - Numeral1, m)
72.19 + in (if zgcd (a, m) = Numeral1 then insert a na else na)
72.20 else {})"
72.21
72.22 defs
72.23 - norRRset_def: "norRRset m == BnorRset (m - #1, m)"
72.24 + norRRset_def: "norRRset m == BnorRset (m - Numeral1, m)"
72.25 noXRRset_def: "noXRRset m x == (\<lambda>a. a * x) ` norRRset m"
72.26 phi_def: "phi m == card (norRRset m)"
72.27 is_RRset_def: "is_RRset A m == A \<in> RsetR m \<and> card A = phi m"
72.28 RRset2norRR_def:
72.29 "RRset2norRR A m a ==
72.30 - (if #1 < m \<and> is_RRset A m \<and> a \<in> A then
72.31 + (if Numeral1 < m \<and> is_RRset A m \<and> a \<in> A then
72.32 SOME b. zcong a b m \<and> b \<in> norRRset m
72.33 - else #0)"
72.34 + else Numeral0)"
72.35
72.36 constdefs
72.37 zcongm :: "int => int => int => bool"
72.38 "zcongm m == \<lambda>a b. zcong a b m"
72.39
72.40 -lemma abs_eq_1_iff [iff]: "(abs z = (#1::int)) = (z = #1 \<or> z = #-1)"
72.41 +lemma abs_eq_1_iff [iff]: "(abs z = (Numeral1::int)) = (z = Numeral1 \<or> z = # -1)"
72.42 -- {* LCP: not sure why this lemma is needed now *}
72.43 apply (auto simp add: zabs_def)
72.44 done
72.45 @@ -67,7 +67,7 @@
72.46
72.47 lemma BnorRset_induct:
72.48 "(!!a m. P {} a m) ==>
72.49 - (!!a m. #0 < (a::int) ==> P (BnorRset (a - #1, m::int)) (a - #1) m
72.50 + (!!a m. Numeral0 < (a::int) ==> P (BnorRset (a - Numeral1, m::int)) (a - Numeral1) m
72.51 ==> P (BnorRset(a,m)) a m)
72.52 ==> P (BnorRset(u,v)) u v"
72.53 proof -
72.54 @@ -75,7 +75,7 @@
72.55 show ?thesis
72.56 apply (rule BnorRset.induct)
72.57 apply safe
72.58 - apply (case_tac [2] "#0 < a")
72.59 + apply (case_tac [2] "Numeral0 < a")
72.60 apply (rule_tac [2] rule_context)
72.61 apply simp_all
72.62 apply (simp_all add: BnorRset.simps rule_context)
72.63 @@ -94,7 +94,7 @@
72.64 apply (auto dest: Bnor_mem_zle)
72.65 done
72.66
72.67 -lemma Bnor_mem_zg [rule_format]: "b \<in> BnorRset (a, m) --> #0 < b"
72.68 +lemma Bnor_mem_zg [rule_format]: "b \<in> BnorRset (a, m) --> Numeral0 < b"
72.69 apply (induct a m rule: BnorRset_induct)
72.70 prefer 2
72.71 apply (subst BnorRset.simps)
72.72 @@ -103,7 +103,7 @@
72.73 done
72.74
72.75 lemma Bnor_mem_if [rule_format]:
72.76 - "zgcd (b, m) = #1 --> #0 < b --> b \<le> a --> b \<in> BnorRset (a, m)"
72.77 + "zgcd (b, m) = Numeral1 --> Numeral0 < b --> b \<le> a --> b \<in> BnorRset (a, m)"
72.78 apply (induct a m rule: BnorRset.induct)
72.79 apply auto
72.80 apply (case_tac "a = b")
72.81 @@ -128,7 +128,7 @@
72.82 apply (rule_tac [3] allI)
72.83 apply (rule_tac [3] impI)
72.84 apply (rule_tac [3] zcong_not)
72.85 - apply (subgoal_tac [6] "a' \<le> a - #1")
72.86 + apply (subgoal_tac [6] "a' \<le> a - Numeral1")
72.87 apply (rule_tac [7] Bnor_mem_zle)
72.88 apply (rule_tac [5] Bnor_mem_zg)
72.89 apply auto
72.90 @@ -142,13 +142,13 @@
72.91 apply auto
72.92 done
72.93
72.94 -lemma aux: "a \<le> b - #1 ==> a < (b::int)"
72.95 +lemma aux: "a \<le> b - Numeral1 ==> a < (b::int)"
72.96 apply auto
72.97 done
72.98
72.99 lemma norR_mem_unique:
72.100 - "#1 < m ==>
72.101 - zgcd (a, m) = #1 ==> \<exists>!b. [a = b] (mod m) \<and> b \<in> norRRset m"
72.102 + "Numeral1 < m ==>
72.103 + zgcd (a, m) = Numeral1 ==> \<exists>!b. [a = b] (mod m) \<and> b \<in> norRRset m"
72.104 apply (unfold norRRset_def)
72.105 apply (cut_tac a = a and m = m in zcong_zless_unique)
72.106 apply auto
72.107 @@ -158,7 +158,7 @@
72.108 apply (rule_tac "x" = "b" in exI)
72.109 apply safe
72.110 apply (rule Bnor_mem_if)
72.111 - apply (case_tac [2] "b = #0")
72.112 + apply (case_tac [2] "b = Numeral0")
72.113 apply (auto intro: order_less_le [THEN iffD2])
72.114 prefer 2
72.115 apply (simp only: zcong_def)
72.116 @@ -173,7 +173,7 @@
72.117 text {* \medskip @{term noXRRset} *}
72.118
72.119 lemma RRset_gcd [rule_format]:
72.120 - "is_RRset A m ==> a \<in> A --> zgcd (a, m) = #1"
72.121 + "is_RRset A m ==> a \<in> A --> zgcd (a, m) = Numeral1"
72.122 apply (unfold is_RRset_def)
72.123 apply (rule RsetR.induct)
72.124 apply auto
72.125 @@ -181,7 +181,7 @@
72.126
72.127 lemma RsetR_zmult_mono:
72.128 "A \<in> RsetR m ==>
72.129 - #0 < m ==> zgcd (x, m) = #1 ==> (\<lambda>a. a * x) ` A \<in> RsetR m"
72.130 + Numeral0 < m ==> zgcd (x, m) = Numeral1 ==> (\<lambda>a. a * x) ` A \<in> RsetR m"
72.131 apply (erule RsetR.induct)
72.132 apply simp_all
72.133 apply (rule RsetR.insert)
72.134 @@ -191,8 +191,8 @@
72.135 done
72.136
72.137 lemma card_nor_eq_noX:
72.138 - "#0 < m ==>
72.139 - zgcd (x, m) = #1 ==> card (noXRRset m x) = card (norRRset m)"
72.140 + "Numeral0 < m ==>
72.141 + zgcd (x, m) = Numeral1 ==> card (noXRRset m x) = card (norRRset m)"
72.142 apply (unfold norRRset_def noXRRset_def)
72.143 apply (rule card_image)
72.144 apply (auto simp add: inj_on_def Bnor_fin)
72.145 @@ -200,7 +200,7 @@
72.146 done
72.147
72.148 lemma noX_is_RRset:
72.149 - "#0 < m ==> zgcd (x, m) = #1 ==> is_RRset (noXRRset m x) m"
72.150 + "Numeral0 < m ==> zgcd (x, m) = Numeral1 ==> is_RRset (noXRRset m x) m"
72.151 apply (unfold is_RRset_def phi_def)
72.152 apply (auto simp add: card_nor_eq_noX)
72.153 apply (unfold noXRRset_def norRRset_def)
72.154 @@ -210,7 +210,7 @@
72.155 done
72.156
72.157 lemma aux_some:
72.158 - "#1 < m ==> is_RRset A m ==> a \<in> A
72.159 + "Numeral1 < m ==> is_RRset A m ==> a \<in> A
72.160 ==> zcong a (SOME b. [a = b] (mod m) \<and> b \<in> norRRset m) m \<and>
72.161 (SOME b. [a = b] (mod m) \<and> b \<in> norRRset m) \<in> norRRset m"
72.162 apply (rule norR_mem_unique [THEN ex1_implies_ex, THEN someI_ex])
72.163 @@ -219,7 +219,7 @@
72.164 done
72.165
72.166 lemma RRset2norRR_correct:
72.167 - "#1 < m ==> is_RRset A m ==> a \<in> A ==>
72.168 + "Numeral1 < m ==> is_RRset A m ==> a \<in> A ==>
72.169 [a = RRset2norRR A m a] (mod m) \<and> RRset2norRR A m a \<in> norRRset m"
72.170 apply (unfold RRset2norRR_def)
72.171 apply simp
72.172 @@ -238,7 +238,7 @@
72.173 done
72.174
72.175 lemma RRset_zcong_eq [rule_format]:
72.176 - "#1 < m ==>
72.177 + "Numeral1 < m ==>
72.178 is_RRset A m ==> [a = b] (mod m) ==> a \<in> A --> b \<in> A --> a = b"
72.179 apply (unfold is_RRset_def)
72.180 apply (rule RsetR.induct)
72.181 @@ -252,7 +252,7 @@
72.182 done
72.183
72.184 lemma RRset2norRR_inj:
72.185 - "#1 < m ==> is_RRset A m ==> inj_on (RRset2norRR A m) A"
72.186 + "Numeral1 < m ==> is_RRset A m ==> inj_on (RRset2norRR A m) A"
72.187 apply (unfold RRset2norRR_def inj_on_def)
72.188 apply auto
72.189 apply (subgoal_tac "\<exists>b. ([x = b] (mod m) \<and> b \<in> norRRset m) \<and>
72.190 @@ -267,7 +267,7 @@
72.191 done
72.192
72.193 lemma RRset2norRR_eq_norR:
72.194 - "#1 < m ==> is_RRset A m ==> RRset2norRR A m ` A = norRRset m"
72.195 + "Numeral1 < m ==> is_RRset A m ==> RRset2norRR A m ` A = norRRset m"
72.196 apply (rule card_seteq)
72.197 prefer 3
72.198 apply (subst card_image)
72.199 @@ -286,7 +286,7 @@
72.200 done
72.201
72.202 lemma Bnor_prod_power [rule_format]:
72.203 - "x \<noteq> #0 ==> a < m --> setprod ((\<lambda>a. a * x) ` BnorRset (a, m)) =
72.204 + "x \<noteq> Numeral0 ==> a < m --> setprod ((\<lambda>a. a * x) ` BnorRset (a, m)) =
72.205 setprod (BnorRset(a, m)) * x^card (BnorRset (a, m))"
72.206 apply (induct a m rule: BnorRset_induct)
72.207 prefer 2
72.208 @@ -313,7 +313,7 @@
72.209 done
72.210
72.211 lemma Bnor_prod_zgcd [rule_format]:
72.212 - "a < m --> zgcd (setprod (BnorRset (a, m)), m) = #1"
72.213 + "a < m --> zgcd (setprod (BnorRset (a, m)), m) = Numeral1"
72.214 apply (induct a m rule: BnorRset_induct)
72.215 prefer 2
72.216 apply (subst BnorRset.simps)
72.217 @@ -324,12 +324,12 @@
72.218 done
72.219
72.220 theorem Euler_Fermat:
72.221 - "#0 < m ==> zgcd (x, m) = #1 ==> [x^(phi m) = #1] (mod m)"
72.222 + "Numeral0 < m ==> zgcd (x, m) = Numeral1 ==> [x^(phi m) = Numeral1] (mod m)"
72.223 apply (unfold norRRset_def phi_def)
72.224 - apply (case_tac "x = #0")
72.225 - apply (case_tac [2] "m = #1")
72.226 + apply (case_tac "x = Numeral0")
72.227 + apply (case_tac [2] "m = Numeral1")
72.228 apply (rule_tac [3] iffD1)
72.229 - apply (rule_tac [3] k = "setprod (BnorRset (m - #1, m))"
72.230 + apply (rule_tac [3] k = "setprod (BnorRset (m - Numeral1, m))"
72.231 in zcong_cancel2)
72.232 prefer 5
72.233 apply (subst Bnor_prod_power [symmetric])
72.234 @@ -352,7 +352,7 @@
72.235
72.236 lemma Bnor_prime [rule_format (no_asm)]:
72.237 "p \<in> zprime ==>
72.238 - a < p --> (\<forall>b. #0 < b \<and> b \<le> a --> zgcd (b, p) = #1)
72.239 + a < p --> (\<forall>b. Numeral0 < b \<and> b \<le> a --> zgcd (b, p) = Numeral1)
72.240 --> card (BnorRset (a, p)) = nat a"
72.241 apply (unfold zprime_def)
72.242 apply (induct a p rule: BnorRset.induct)
72.243 @@ -361,7 +361,7 @@
72.244 apply auto
72.245 done
72.246
72.247 -lemma phi_prime: "p \<in> zprime ==> phi p = nat (p - #1)"
72.248 +lemma phi_prime: "p \<in> zprime ==> phi p = nat (p - Numeral1)"
72.249 apply (unfold phi_def norRRset_def)
72.250 apply (rule Bnor_prime)
72.251 apply auto
72.252 @@ -370,7 +370,7 @@
72.253 done
72.254
72.255 theorem Little_Fermat:
72.256 - "p \<in> zprime ==> \<not> p dvd x ==> [x^(nat (p - #1)) = #1] (mod p)"
72.257 + "p \<in> zprime ==> \<not> p dvd x ==> [x^(nat (p - Numeral1)) = Numeral1] (mod p)"
72.258 apply (subst phi_prime [symmetric])
72.259 apply (rule_tac [2] Euler_Fermat)
72.260 apply (erule_tac [3] zprime_imp_zrelprime)
73.1 --- a/src/HOL/NumberTheory/Factorization.thy Fri Oct 05 21:50:37 2001 +0200
73.2 +++ b/src/HOL/NumberTheory/Factorization.thy Fri Oct 05 21:52:39 2001 +0200
73.3 @@ -26,7 +26,7 @@
73.4 "nondec (x # xs) = (case xs of [] => True | y # ys => x \<le> y \<and> nondec xs)"
73.5
73.6 primrec
73.7 - "prod [] = 1'"
73.8 + "prod [] = Suc 0"
73.9 "prod (x # xs) = x * prod xs"
73.10
73.11 primrec
73.12 @@ -40,12 +40,12 @@
73.13
73.14 subsection {* Arithmetic *}
73.15
73.16 -lemma one_less_m: "(m::nat) \<noteq> m * k ==> m \<noteq> 1' ==> 1' < m"
73.17 +lemma one_less_m: "(m::nat) \<noteq> m * k ==> m \<noteq> Suc 0 ==> Suc 0 < m"
73.18 apply (case_tac m)
73.19 apply auto
73.20 done
73.21
73.22 -lemma one_less_k: "(m::nat) \<noteq> m * k ==> 1' < m * k ==> 1' < k"
73.23 +lemma one_less_k: "(m::nat) \<noteq> m * k ==> Suc 0 < m * k ==> Suc 0 < k"
73.24 apply (case_tac k)
73.25 apply auto
73.26 done
73.27 @@ -54,13 +54,13 @@
73.28 apply auto
73.29 done
73.30
73.31 -lemma mn_eq_m_one: "(0::nat) < m ==> m * n = m ==> n = 1'"
73.32 +lemma mn_eq_m_one: "(0::nat) < m ==> m * n = m ==> n = Suc 0"
73.33 apply (case_tac n)
73.34 apply auto
73.35 done
73.36
73.37 lemma prod_mn_less_k:
73.38 - "(0::nat) < n ==> 0 < k ==> 1' < m ==> m * n = k ==> n < k"
73.39 + "(0::nat) < n ==> 0 < k ==> Suc 0 < m ==> m * n = k ==> n < k"
73.40 apply (induct m)
73.41 apply auto
73.42 done
73.43 @@ -88,7 +88,7 @@
73.44 apply auto
73.45 done
73.46
73.47 -lemma prime_nd_one: "p \<in> prime ==> \<not> p dvd 1'"
73.48 +lemma prime_nd_one: "p \<in> prime ==> \<not> p dvd Suc 0"
73.49 apply (unfold prime_def dvd_def)
73.50 apply auto
73.51 done
73.52 @@ -115,13 +115,13 @@
73.53 apply auto
73.54 done
73.55
73.56 -lemma primel_one_empty: "primel xs ==> prod xs = 1' ==> xs = []"
73.57 +lemma primel_one_empty: "primel xs ==> prod xs = Suc 0 ==> xs = []"
73.58 apply (unfold primel_def prime_def)
73.59 apply (case_tac xs)
73.60 apply simp_all
73.61 done
73.62
73.63 -lemma prime_g_one: "p \<in> prime ==> 1' < p"
73.64 +lemma prime_g_one: "p \<in> prime ==> Suc 0 < p"
73.65 apply (unfold prime_def)
73.66 apply auto
73.67 done
73.68 @@ -132,7 +132,7 @@
73.69 done
73.70
73.71 lemma primel_nempty_g_one [rule_format]:
73.72 - "primel xs --> xs \<noteq> [] --> 1' < prod xs"
73.73 + "primel xs --> xs \<noteq> [] --> Suc 0 < prod xs"
73.74 apply (unfold primel_def prime_def)
73.75 apply (induct xs)
73.76 apply (auto elim: one_less_mult)
73.77 @@ -223,8 +223,8 @@
73.78 done
73.79
73.80 lemma not_prime_ex_mk:
73.81 - "1' < n \<and> n \<notin> prime ==>
73.82 - \<exists>m k. 1' < m \<and> 1' < k \<and> m < n \<and> k < n \<and> n = m * k"
73.83 + "Suc 0 < n \<and> n \<notin> prime ==>
73.84 + \<exists>m k. Suc 0 < m \<and> Suc 0 < k \<and> m < n \<and> k < n \<and> n = m * k"
73.85 apply (unfold prime_def dvd_def)
73.86 apply (auto intro: n_less_m_mult_n n_less_n_mult_m one_less_m one_less_k)
73.87 done
73.88 @@ -237,7 +237,7 @@
73.89 apply (simp add: primel_append)
73.90 done
73.91
73.92 -lemma factor_exists [rule_format]: "1' < n --> (\<exists>l. primel l \<and> prod l = n)"
73.93 +lemma factor_exists [rule_format]: "Suc 0 < n --> (\<exists>l. primel l \<and> prod l = n)"
73.94 apply (induct n rule: nat_less_induct)
73.95 apply (rule impI)
73.96 apply (case_tac "n \<in> prime")
73.97 @@ -247,7 +247,7 @@
73.98 apply (auto intro!: split_primel)
73.99 done
73.100
73.101 -lemma nondec_factor_exists: "1' < n ==> \<exists>l. primel l \<and> nondec l \<and> prod l = n"
73.102 +lemma nondec_factor_exists: "Suc 0 < n ==> \<exists>l. primel l \<and> nondec l \<and> prod l = n"
73.103 apply (erule factor_exists [THEN exE])
73.104 apply (blast intro!: ex_nondec_lemma)
73.105 done
73.106 @@ -349,7 +349,7 @@
73.107 done
73.108
73.109 lemma unique_prime_factorization [rule_format]:
73.110 - "\<forall>n. 1' < n --> (\<exists>!l. primel l \<and> nondec l \<and> prod l = n)"
73.111 + "\<forall>n. Suc 0 < n --> (\<exists>!l. primel l \<and> nondec l \<and> prod l = n)"
73.112 apply safe
73.113 apply (erule nondec_factor_exists)
73.114 apply (rule perm_nondec_unique)
74.1 --- a/src/HOL/NumberTheory/Fib.thy Fri Oct 05 21:50:37 2001 +0200
74.2 +++ b/src/HOL/NumberTheory/Fib.thy Fri Oct 05 21:52:39 2001 +0200
74.3 @@ -19,7 +19,7 @@
74.4 consts fib :: "nat => nat"
74.5 recdef fib less_than
74.6 zero: "fib 0 = 0"
74.7 - one: "fib 1' = 1'"
74.8 + one: "fib (Suc 0) = Suc 0"
74.9 Suc_Suc: "fib (Suc (Suc x)) = fib x + fib (Suc x)"
74.10
74.11 text {*
74.12 @@ -67,21 +67,21 @@
74.13 *}
74.14
74.15 lemma fib_Cassini: "int (fib (Suc (Suc n)) * fib n) =
74.16 - (if n mod #2 = 0 then int (fib (Suc n) * fib (Suc n)) - #1
74.17 - else int (fib (Suc n) * fib (Suc n)) + #1)"
74.18 + (if n mod # 2 = 0 then int (fib (Suc n) * fib (Suc n)) - Numeral1
74.19 + else int (fib (Suc n) * fib (Suc n)) + Numeral1)"
74.20 apply (induct n rule: fib.induct)
74.21 apply (simp add: fib.Suc_Suc)
74.22 apply (simp add: fib.Suc_Suc mod_Suc)
74.23 apply (simp add: fib.Suc_Suc
74.24 add_mult_distrib add_mult_distrib2 mod_Suc zmult_int [symmetric] zmult_ac)
74.25 - apply (subgoal_tac "x mod #2 < #2", arith)
74.26 + apply (subgoal_tac "x mod # 2 < # 2", arith)
74.27 apply simp
74.28 done
74.29
74.30
74.31 text {* \medskip Towards Law 6.111 of Concrete Mathematics *}
74.32
74.33 -lemma gcd_fib_Suc_eq_1: "gcd (fib n, fib (Suc n)) = 1'"
74.34 +lemma gcd_fib_Suc_eq_1: "gcd (fib n, fib (Suc n)) = Suc 0"
74.35 apply (induct n rule: fib.induct)
74.36 prefer 3
74.37 apply (simp add: gcd_commute fib_Suc3)
75.1 --- a/src/HOL/NumberTheory/IntFact.thy Fri Oct 05 21:50:37 2001 +0200
75.2 +++ b/src/HOL/NumberTheory/IntFact.thy Fri Oct 05 21:52:39 2001 +0200
75.3 @@ -10,7 +10,7 @@
75.4
75.5 text {*
75.6 Factorial on integers and recursively defined set including all
75.7 - Integers from @{term 2} up to @{term a}. Plus definition of product
75.8 + Integers from @{text 2} up to @{text a}. Plus definition of product
75.9 of finite set.
75.10
75.11 \bigskip
75.12 @@ -22,18 +22,18 @@
75.13 d22set :: "int => int set"
75.14
75.15 recdef zfact "measure ((\<lambda>n. nat n) :: int => nat)"
75.16 - "zfact n = (if n \<le> #0 then #1 else n * zfact (n - #1))"
75.17 + "zfact n = (if n \<le> Numeral0 then Numeral1 else n * zfact (n - Numeral1))"
75.18
75.19 defs
75.20 - setprod_def: "setprod A == (if finite A then fold (op *) #1 A else #1)"
75.21 + setprod_def: "setprod A == (if finite A then fold (op *) Numeral1 A else Numeral1)"
75.22
75.23 recdef d22set "measure ((\<lambda>a. nat a) :: int => nat)"
75.24 - "d22set a = (if #1 < a then insert a (d22set (a - #1)) else {})"
75.25 + "d22set a = (if Numeral1 < a then insert a (d22set (a - Numeral1)) else {})"
75.26
75.27
75.28 text {* \medskip @{term setprod} --- product of finite set *}
75.29
75.30 -lemma setprod_empty [simp]: "setprod {} = #1"
75.31 +lemma setprod_empty [simp]: "setprod {} = Numeral1"
75.32 apply (simp add: setprod_def)
75.33 done
75.34
75.35 @@ -46,7 +46,7 @@
75.36
75.37 text {*
75.38 \medskip @{term d22set} --- recursively defined set including all
75.39 - integers from @{term 2} up to @{term a}
75.40 + integers from @{text 2} up to @{text a}
75.41 *}
75.42
75.43 declare d22set.simps [simp del]
75.44 @@ -54,7 +54,7 @@
75.45
75.46 lemma d22set_induct:
75.47 "(!!a. P {} a) ==>
75.48 - (!!a. #1 < (a::int) ==> P (d22set (a - #1)) (a - #1)
75.49 + (!!a. Numeral1 < (a::int) ==> P (d22set (a - Numeral1)) (a - Numeral1)
75.50 ==> P (d22set a) a)
75.51 ==> P (d22set u) u"
75.52 proof -
75.53 @@ -62,14 +62,14 @@
75.54 show ?thesis
75.55 apply (rule d22set.induct)
75.56 apply safe
75.57 - apply (case_tac [2] "#1 < a")
75.58 + apply (case_tac [2] "Numeral1 < a")
75.59 apply (rule_tac [2] rule_context)
75.60 apply (simp_all (no_asm_simp))
75.61 apply (simp_all (no_asm_simp) add: d22set.simps rule_context)
75.62 done
75.63 qed
75.64
75.65 -lemma d22set_g_1 [rule_format]: "b \<in> d22set a --> #1 < b"
75.66 +lemma d22set_g_1 [rule_format]: "b \<in> d22set a --> Numeral1 < b"
75.67 apply (induct a rule: d22set_induct)
75.68 prefer 2
75.69 apply (subst d22set.simps)
75.70 @@ -87,7 +87,7 @@
75.71 apply (auto dest: d22set_le)
75.72 done
75.73
75.74 -lemma d22set_mem [rule_format]: "#1 < b --> b \<le> a --> b \<in> d22set a"
75.75 +lemma d22set_mem [rule_format]: "Numeral1 < b --> b \<le> a --> b \<in> d22set a"
75.76 apply (induct a rule: d22set.induct)
75.77 apply auto
75.78 apply (simp_all add: d22set.simps)
75.79 @@ -109,7 +109,7 @@
75.80 apply (simp add: d22set.simps zfact.simps)
75.81 apply (subst d22set.simps)
75.82 apply (subst zfact.simps)
75.83 - apply (case_tac "#1 < a")
75.84 + apply (case_tac "Numeral1 < a")
75.85 prefer 2
75.86 apply (simp add: d22set.simps zfact.simps)
75.87 apply (simp add: d22set_fin d22set_le_swap)
76.1 --- a/src/HOL/NumberTheory/IntPrimes.thy Fri Oct 05 21:50:37 2001 +0200
76.2 +++ b/src/HOL/NumberTheory/IntPrimes.thy Fri Oct 05 21:52:39 2001 +0200
76.3 @@ -29,7 +29,7 @@
76.4 "measure ((\<lambda>(m, n, r', r, s', s, t', t). nat r)
76.5 :: int * int * int * int *int * int * int * int => nat)"
76.6 "xzgcda (m, n, r', r, s', s, t', t) =
76.7 - (if r \<le> #0 then (r', s', t')
76.8 + (if r \<le> Numeral0 then (r', s', t')
76.9 else xzgcda (m, n, r, r' mod r, s, s' - (r' div r) * s, t, t' - (r' div r) * t))"
76.10 (hints simp: pos_mod_bound)
76.11
76.12 @@ -38,13 +38,13 @@
76.13 "zgcd == \<lambda>(x,y). int (gcd (nat (abs x), nat (abs y)))"
76.14
76.15 defs
76.16 - xzgcd_def: "xzgcd m n == xzgcda (m, n, m, n, #1, #0, #0, #1)"
76.17 - zprime_def: "zprime == {p. #1 < p \<and> (\<forall>m. m dvd p --> m = #1 \<or> m = p)}"
76.18 + xzgcd_def: "xzgcd m n == xzgcda (m, n, m, n, Numeral1, Numeral0, Numeral0, Numeral1)"
76.19 + zprime_def: "zprime == {p. Numeral1 < p \<and> (\<forall>m. m dvd p --> m = Numeral1 \<or> m = p)}"
76.20 zcong_def: "[a = b] (mod m) == m dvd (a - b)"
76.21
76.22
76.23 lemma zabs_eq_iff:
76.24 - "(abs (z::int) = w) = (z = w \<and> #0 <= z \<or> z = -w \<and> z < #0)"
76.25 + "(abs (z::int) = w) = (z = w \<and> Numeral0 <= z \<or> z = -w \<and> z < Numeral0)"
76.26 apply (auto simp add: zabs_def)
76.27 done
76.28
76.29 @@ -64,17 +64,17 @@
76.30
76.31 subsection {* Divides relation *}
76.32
76.33 -lemma zdvd_0_right [iff]: "(m::int) dvd #0"
76.34 +lemma zdvd_0_right [iff]: "(m::int) dvd Numeral0"
76.35 apply (unfold dvd_def)
76.36 apply (blast intro: zmult_0_right [symmetric])
76.37 done
76.38
76.39 -lemma zdvd_0_left [iff]: "(#0 dvd (m::int)) = (m = #0)"
76.40 +lemma zdvd_0_left [iff]: "(Numeral0 dvd (m::int)) = (m = Numeral0)"
76.41 apply (unfold dvd_def)
76.42 apply auto
76.43 done
76.44
76.45 -lemma zdvd_1_left [iff]: "#1 dvd (m::int)"
76.46 +lemma zdvd_1_left [iff]: "Numeral1 dvd (m::int)"
76.47 apply (unfold dvd_def)
76.48 apply simp
76.49 done
76.50 @@ -104,7 +104,7 @@
76.51 done
76.52
76.53 lemma zdvd_anti_sym:
76.54 - "#0 < m ==> #0 < n ==> m dvd n ==> n dvd m ==> m = (n::int)"
76.55 + "Numeral0 < m ==> Numeral0 < n ==> m dvd n ==> n dvd m ==> m = (n::int)"
76.56 apply (unfold dvd_def)
76.57 apply auto
76.58 apply (simp add: zmult_assoc zmult_eq_self_iff int_0_less_mult_iff zmult_eq_1_iff)
76.59 @@ -186,19 +186,19 @@
76.60 apply (simp add: zdvd_zadd zdvd_zmult2)
76.61 done
76.62
76.63 -lemma zdvd_iff_zmod_eq_0: "(k dvd n) = (n mod (k::int) = #0)"
76.64 +lemma zdvd_iff_zmod_eq_0: "(k dvd n) = (n mod (k::int) = Numeral0)"
76.65 apply (unfold dvd_def)
76.66 apply auto
76.67 done
76.68
76.69 -lemma zdvd_not_zless: "#0 < m ==> m < n ==> \<not> n dvd (m::int)"
76.70 +lemma zdvd_not_zless: "Numeral0 < m ==> m < n ==> \<not> n dvd (m::int)"
76.71 apply (unfold dvd_def)
76.72 apply auto
76.73 - apply (subgoal_tac "#0 < n")
76.74 + apply (subgoal_tac "Numeral0 < n")
76.75 prefer 2
76.76 apply (blast intro: zless_trans)
76.77 apply (simp add: int_0_less_mult_iff)
76.78 - apply (subgoal_tac "n * k < n * #1")
76.79 + apply (subgoal_tac "n * k < n * Numeral1")
76.80 apply (drule zmult_zless_cancel1 [THEN iffD1])
76.81 apply auto
76.82 done
76.83 @@ -221,7 +221,7 @@
76.84 nat_mult_distrib [symmetric] nat_eq_iff2)
76.85 done
76.86
76.87 -lemma nat_dvd_iff: "(nat z dvd m) = (if #0 \<le> z then (z dvd int m) else m = 0)"
76.88 +lemma nat_dvd_iff: "(nat z dvd m) = (if Numeral0 \<le> z then (z dvd int m) else m = 0)"
76.89 apply (auto simp add: dvd_def zmult_int [symmetric])
76.90 apply (rule_tac x = "nat k" in exI)
76.91 apply (cut_tac k = m in int_less_0_conv)
76.92 @@ -245,11 +245,11 @@
76.93
76.94 subsection {* Euclid's Algorithm and GCD *}
76.95
76.96 -lemma zgcd_0 [simp]: "zgcd (m, #0) = abs m"
76.97 +lemma zgcd_0 [simp]: "zgcd (m, Numeral0) = abs m"
76.98 apply (simp add: zgcd_def zabs_def)
76.99 done
76.100
76.101 -lemma zgcd_0_left [simp]: "zgcd (#0, m) = abs m"
76.102 +lemma zgcd_0_left [simp]: "zgcd (Numeral0, m) = abs m"
76.103 apply (simp add: zgcd_def zabs_def)
76.104 done
76.105
76.106 @@ -261,7 +261,7 @@
76.107 apply (simp add: zgcd_def)
76.108 done
76.109
76.110 -lemma zgcd_non_0: "#0 < n ==> zgcd (m, n) = zgcd (n, m mod n)"
76.111 +lemma zgcd_non_0: "Numeral0 < n ==> zgcd (m, n) = zgcd (n, m mod n)"
76.112 apply (frule_tac b = n and a = m in pos_mod_sign)
76.113 apply (simp add: zgcd_def zabs_def nat_mod_distrib)
76.114 apply (cut_tac a = "-m" and b = n in zmod_zminus1_eq_if)
76.115 @@ -273,17 +273,17 @@
76.116 done
76.117
76.118 lemma zgcd_eq: "zgcd (m, n) = zgcd (n, m mod n)"
76.119 - apply (tactic {* zdiv_undefined_case_tac "n = #0" 1 *})
76.120 + apply (tactic {* zdiv_undefined_case_tac "n = Numeral0" 1 *})
76.121 apply (auto simp add: linorder_neq_iff zgcd_non_0)
76.122 apply (cut_tac m = "-m" and n = "-n" in zgcd_non_0)
76.123 apply auto
76.124 done
76.125
76.126 -lemma zgcd_1 [simp]: "zgcd (m, #1) = #1"
76.127 +lemma zgcd_1 [simp]: "zgcd (m, Numeral1) = Numeral1"
76.128 apply (simp add: zgcd_def zabs_def)
76.129 done
76.130
76.131 -lemma zgcd_0_1_iff [simp]: "(zgcd (#0, m) = #1) = (abs m = #1)"
76.132 +lemma zgcd_0_1_iff [simp]: "(zgcd (Numeral0, m) = Numeral1) = (abs m = Numeral1)"
76.133 apply (simp add: zgcd_def zabs_def)
76.134 done
76.135
76.136 @@ -303,7 +303,7 @@
76.137 apply (simp add: zgcd_def gcd_commute)
76.138 done
76.139
76.140 -lemma zgcd_1_left [simp]: "zgcd (#1, m) = #1"
76.141 +lemma zgcd_1_left [simp]: "zgcd (Numeral1, m) = Numeral1"
76.142 apply (simp add: zgcd_def gcd_1_left)
76.143 done
76.144
76.145 @@ -320,7 +320,7 @@
76.146 lemmas zgcd_ac = zgcd_assoc zgcd_commute zgcd_left_commute
76.147 -- {* addition is an AC-operator *}
76.148
76.149 -lemma zgcd_zmult_distrib2: "#0 \<le> k ==> k * zgcd (m, n) = zgcd (k * m, k * n)"
76.150 +lemma zgcd_zmult_distrib2: "Numeral0 \<le> k ==> k * zgcd (m, n) = zgcd (k * m, k * n)"
76.151 apply (simp del: zmult_zminus_right
76.152 add: zmult_zminus_right [symmetric] nat_mult_distrib zgcd_def zabs_def
76.153 zmult_less_0_iff gcd_mult_distrib2 [symmetric] zmult_int [symmetric])
76.154 @@ -330,29 +330,29 @@
76.155 apply (simp add: zabs_def zgcd_zmult_distrib2)
76.156 done
76.157
76.158 -lemma zgcd_self [simp]: "#0 \<le> m ==> zgcd (m, m) = m"
76.159 - apply (cut_tac k = m and m = "#1" and n = "#1" in zgcd_zmult_distrib2)
76.160 +lemma zgcd_self [simp]: "Numeral0 \<le> m ==> zgcd (m, m) = m"
76.161 + apply (cut_tac k = m and m = "Numeral1" and n = "Numeral1" in zgcd_zmult_distrib2)
76.162 apply simp_all
76.163 done
76.164
76.165 -lemma zgcd_zmult_eq_self [simp]: "#0 \<le> k ==> zgcd (k, k * n) = k"
76.166 - apply (cut_tac k = k and m = "#1" and n = n in zgcd_zmult_distrib2)
76.167 +lemma zgcd_zmult_eq_self [simp]: "Numeral0 \<le> k ==> zgcd (k, k * n) = k"
76.168 + apply (cut_tac k = k and m = "Numeral1" and n = n in zgcd_zmult_distrib2)
76.169 apply simp_all
76.170 done
76.171
76.172 -lemma zgcd_zmult_eq_self2 [simp]: "#0 \<le> k ==> zgcd (k * n, k) = k"
76.173 - apply (cut_tac k = k and m = n and n = "#1" in zgcd_zmult_distrib2)
76.174 +lemma zgcd_zmult_eq_self2 [simp]: "Numeral0 \<le> k ==> zgcd (k * n, k) = k"
76.175 + apply (cut_tac k = k and m = n and n = "Numeral1" in zgcd_zmult_distrib2)
76.176 apply simp_all
76.177 done
76.178
76.179 -lemma aux: "zgcd (n, k) = #1 ==> k dvd m * n ==> #0 \<le> m ==> k dvd m"
76.180 +lemma aux: "zgcd (n, k) = Numeral1 ==> k dvd m * n ==> Numeral0 \<le> m ==> k dvd m"
76.181 apply (subgoal_tac "m = zgcd (m * n, m * k)")
76.182 apply (erule ssubst, rule zgcd_greatest_iff [THEN iffD2])
76.183 apply (simp_all add: zgcd_zmult_distrib2 [symmetric] int_0_le_mult_iff)
76.184 done
76.185
76.186 -lemma zrelprime_zdvd_zmult: "zgcd (n, k) = #1 ==> k dvd m * n ==> k dvd m"
76.187 - apply (case_tac "#0 \<le> m")
76.188 +lemma zrelprime_zdvd_zmult: "zgcd (n, k) = Numeral1 ==> k dvd m * n ==> k dvd m"
76.189 + apply (case_tac "Numeral0 \<le> m")
76.190 apply (blast intro: aux)
76.191 apply (subgoal_tac "k dvd -m")
76.192 apply (rule_tac [2] aux)
76.193 @@ -360,20 +360,20 @@
76.194 done
76.195
76.196 lemma zprime_imp_zrelprime:
76.197 - "p \<in> zprime ==> \<not> p dvd n ==> zgcd (n, p) = #1"
76.198 + "p \<in> zprime ==> \<not> p dvd n ==> zgcd (n, p) = Numeral1"
76.199 apply (unfold zprime_def)
76.200 apply auto
76.201 done
76.202
76.203 lemma zless_zprime_imp_zrelprime:
76.204 - "p \<in> zprime ==> #0 < n ==> n < p ==> zgcd (n, p) = #1"
76.205 + "p \<in> zprime ==> Numeral0 < n ==> n < p ==> zgcd (n, p) = Numeral1"
76.206 apply (erule zprime_imp_zrelprime)
76.207 apply (erule zdvd_not_zless)
76.208 apply assumption
76.209 done
76.210
76.211 lemma zprime_zdvd_zmult:
76.212 - "#0 \<le> (m::int) ==> p \<in> zprime ==> p dvd m * n ==> p dvd m \<or> p dvd n"
76.213 + "Numeral0 \<le> (m::int) ==> p \<in> zprime ==> p dvd m * n ==> p dvd m \<or> p dvd n"
76.214 apply safe
76.215 apply (rule zrelprime_zdvd_zmult)
76.216 apply (rule zprime_imp_zrelprime)
76.217 @@ -392,7 +392,7 @@
76.218 done
76.219
76.220 lemma zgcd_zmult_zdvd_zgcd:
76.221 - "zgcd (k, n) = #1 ==> zgcd (k * m, n) dvd zgcd (m, n)"
76.222 + "zgcd (k, n) = Numeral1 ==> zgcd (k * m, n) dvd zgcd (m, n)"
76.223 apply (simp add: zgcd_greatest_iff)
76.224 apply (rule_tac n = k in zrelprime_zdvd_zmult)
76.225 prefer 2
76.226 @@ -402,16 +402,16 @@
76.227 apply (simp (no_asm) add: zgcd_ac)
76.228 done
76.229
76.230 -lemma zgcd_zmult_cancel: "zgcd (k, n) = #1 ==> zgcd (k * m, n) = zgcd (m, n)"
76.231 +lemma zgcd_zmult_cancel: "zgcd (k, n) = Numeral1 ==> zgcd (k * m, n) = zgcd (m, n)"
76.232 apply (simp add: zgcd_def nat_abs_mult_distrib gcd_mult_cancel)
76.233 done
76.234
76.235 lemma zgcd_zgcd_zmult:
76.236 - "zgcd (k, m) = #1 ==> zgcd (n, m) = #1 ==> zgcd (k * n, m) = #1"
76.237 + "zgcd (k, m) = Numeral1 ==> zgcd (n, m) = Numeral1 ==> zgcd (k * n, m) = Numeral1"
76.238 apply (simp (no_asm_simp) add: zgcd_zmult_cancel)
76.239 done
76.240
76.241 -lemma zdvd_iff_zgcd: "#0 < m ==> (m dvd n) = (zgcd (n, m) = m)"
76.242 +lemma zdvd_iff_zgcd: "Numeral0 < m ==> (m dvd n) = (zgcd (n, m) = m)"
76.243 apply safe
76.244 apply (rule_tac [2] n = "zgcd (n, m)" in zdvd_trans)
76.245 apply (rule_tac [3] zgcd_zdvd1)
76.246 @@ -423,7 +423,7 @@
76.247
76.248 subsection {* Congruences *}
76.249
76.250 -lemma zcong_1 [simp]: "[a = b] (mod #1)"
76.251 +lemma zcong_1 [simp]: "[a = b] (mod Numeral1)"
76.252 apply (unfold zcong_def)
76.253 apply auto
76.254 done
76.255 @@ -494,19 +494,19 @@
76.256 done
76.257
76.258 lemma zcong_square:
76.259 - "p \<in> zprime ==> #0 < a ==> [a * a = #1] (mod p)
76.260 - ==> [a = #1] (mod p) \<or> [a = p - #1] (mod p)"
76.261 + "p \<in> zprime ==> Numeral0 < a ==> [a * a = Numeral1] (mod p)
76.262 + ==> [a = Numeral1] (mod p) \<or> [a = p - Numeral1] (mod p)"
76.263 apply (unfold zcong_def)
76.264 apply (rule zprime_zdvd_zmult)
76.265 - apply (rule_tac [3] s = "a * a - #1 + p * (#1 - a)" in subst)
76.266 + apply (rule_tac [3] s = "a * a - Numeral1 + p * (Numeral1 - a)" in subst)
76.267 prefer 4
76.268 apply (simp add: zdvd_reduce)
76.269 apply (simp_all add: zdiff_zmult_distrib zmult_commute zdiff_zmult_distrib2)
76.270 done
76.271
76.272 lemma zcong_cancel:
76.273 - "#0 \<le> m ==>
76.274 - zgcd (k, m) = #1 ==> [a * k = b * k] (mod m) = [a = b] (mod m)"
76.275 + "Numeral0 \<le> m ==>
76.276 + zgcd (k, m) = Numeral1 ==> [a * k = b * k] (mod m) = [a = b] (mod m)"
76.277 apply safe
76.278 prefer 2
76.279 apply (blast intro: zcong_scalar)
76.280 @@ -523,19 +523,19 @@
76.281 done
76.282
76.283 lemma zcong_cancel2:
76.284 - "#0 \<le> m ==>
76.285 - zgcd (k, m) = #1 ==> [k * a = k * b] (mod m) = [a = b] (mod m)"
76.286 + "Numeral0 \<le> m ==>
76.287 + zgcd (k, m) = Numeral1 ==> [k * a = k * b] (mod m) = [a = b] (mod m)"
76.288 apply (simp add: zmult_commute zcong_cancel)
76.289 done
76.290
76.291 lemma zcong_zgcd_zmult_zmod:
76.292 - "[a = b] (mod m) ==> [a = b] (mod n) ==> zgcd (m, n) = #1
76.293 + "[a = b] (mod m) ==> [a = b] (mod n) ==> zgcd (m, n) = Numeral1
76.294 ==> [a = b] (mod m * n)"
76.295 apply (unfold zcong_def dvd_def)
76.296 apply auto
76.297 apply (subgoal_tac "m dvd n * ka")
76.298 apply (subgoal_tac "m dvd ka")
76.299 - apply (case_tac [2] "#0 \<le> ka")
76.300 + apply (case_tac [2] "Numeral0 \<le> ka")
76.301 prefer 3
76.302 apply (subst zdvd_zminus_iff [symmetric])
76.303 apply (rule_tac n = n in zrelprime_zdvd_zmult)
76.304 @@ -550,8 +550,8 @@
76.305 done
76.306
76.307 lemma zcong_zless_imp_eq:
76.308 - "#0 \<le> a ==>
76.309 - a < m ==> #0 \<le> b ==> b < m ==> [a = b] (mod m) ==> a = b"
76.310 + "Numeral0 \<le> a ==>
76.311 + a < m ==> Numeral0 \<le> b ==> b < m ==> [a = b] (mod m) ==> a = b"
76.312 apply (unfold zcong_def dvd_def)
76.313 apply auto
76.314 apply (drule_tac f = "\<lambda>z. z mod m" in arg_cong)
76.315 @@ -566,38 +566,38 @@
76.316 done
76.317
76.318 lemma zcong_square_zless:
76.319 - "p \<in> zprime ==> #0 < a ==> a < p ==>
76.320 - [a * a = #1] (mod p) ==> a = #1 \<or> a = p - #1"
76.321 + "p \<in> zprime ==> Numeral0 < a ==> a < p ==>
76.322 + [a * a = Numeral1] (mod p) ==> a = Numeral1 \<or> a = p - Numeral1"
76.323 apply (cut_tac p = p and a = a in zcong_square)
76.324 apply (simp add: zprime_def)
76.325 apply (auto intro: zcong_zless_imp_eq)
76.326 done
76.327
76.328 lemma zcong_not:
76.329 - "#0 < a ==> a < m ==> #0 < b ==> b < a ==> \<not> [a = b] (mod m)"
76.330 + "Numeral0 < a ==> a < m ==> Numeral0 < b ==> b < a ==> \<not> [a = b] (mod m)"
76.331 apply (unfold zcong_def)
76.332 apply (rule zdvd_not_zless)
76.333 apply auto
76.334 done
76.335
76.336 lemma zcong_zless_0:
76.337 - "#0 \<le> a ==> a < m ==> [a = #0] (mod m) ==> a = #0"
76.338 + "Numeral0 \<le> a ==> a < m ==> [a = Numeral0] (mod m) ==> a = Numeral0"
76.339 apply (unfold zcong_def dvd_def)
76.340 apply auto
76.341 - apply (subgoal_tac "#0 < m")
76.342 + apply (subgoal_tac "Numeral0 < m")
76.343 apply (rotate_tac -1)
76.344 apply (simp add: int_0_le_mult_iff)
76.345 - apply (subgoal_tac "m * k < m * #1")
76.346 + apply (subgoal_tac "m * k < m * Numeral1")
76.347 apply (drule zmult_zless_cancel1 [THEN iffD1])
76.348 apply (auto simp add: linorder_neq_iff)
76.349 done
76.350
76.351 lemma zcong_zless_unique:
76.352 - "#0 < m ==> (\<exists>!b. #0 \<le> b \<and> b < m \<and> [a = b] (mod m))"
76.353 + "Numeral0 < m ==> (\<exists>!b. Numeral0 \<le> b \<and> b < m \<and> [a = b] (mod m))"
76.354 apply auto
76.355 apply (subgoal_tac [2] "[b = y] (mod m)")
76.356 - apply (case_tac [2] "b = #0")
76.357 - apply (case_tac [3] "y = #0")
76.358 + apply (case_tac [2] "b = Numeral0")
76.359 + apply (case_tac [3] "y = Numeral0")
76.360 apply (auto intro: zcong_trans zcong_zless_0 zcong_zless_imp_eq order_less_le
76.361 simp add: zcong_sym)
76.362 apply (unfold zcong_def dvd_def)
76.363 @@ -616,8 +616,8 @@
76.364 done
76.365
76.366 lemma zgcd_zcong_zgcd:
76.367 - "#0 < m ==>
76.368 - zgcd (a, m) = #1 ==> [a = b] (mod m) ==> zgcd (b, m) = #1"
76.369 + "Numeral0 < m ==>
76.370 + zgcd (a, m) = Numeral1 ==> [a = b] (mod m) ==> zgcd (b, m) = Numeral1"
76.371 apply (auto simp add: zcong_iff_lin)
76.372 done
76.373
76.374 @@ -643,7 +643,7 @@
76.375 apply (simp add: zadd_commute)
76.376 done
76.377
76.378 -lemma zcong_zmod_eq: "#0 < m ==> [a = b] (mod m) = (a mod m = b mod m)"
76.379 +lemma zcong_zmod_eq: "Numeral0 < m ==> [a = b] (mod m) = (a mod m = b mod m)"
76.380 apply auto
76.381 apply (rule_tac m = m in zcong_zless_imp_eq)
76.382 prefer 5
76.383 @@ -659,13 +659,13 @@
76.384 apply (auto simp add: zcong_def)
76.385 done
76.386
76.387 -lemma zcong_zero [iff]: "[a = b] (mod #0) = (a = b)"
76.388 +lemma zcong_zero [iff]: "[a = b] (mod Numeral0) = (a = b)"
76.389 apply (auto simp add: zcong_def)
76.390 done
76.391
76.392 lemma "[a = b] (mod m) = (a mod m = b mod m)"
76.393 - apply (tactic {* zdiv_undefined_case_tac "m = #0" 1 *})
76.394 - apply (case_tac "#0 < m")
76.395 + apply (tactic {* zdiv_undefined_case_tac "m = Numeral0" 1 *})
76.396 + apply (case_tac "Numeral0 < m")
76.397 apply (simp add: zcong_zmod_eq)
76.398 apply (rule_tac t = m in zminus_zminus [THEN subst])
76.399 apply (subst zcong_zminus)
76.400 @@ -677,7 +677,7 @@
76.401 subsection {* Modulo *}
76.402
76.403 lemma zmod_zdvd_zmod:
76.404 - "#0 < (m::int) ==> m dvd b ==> (a mod b mod m) = (a mod m)"
76.405 + "Numeral0 < (m::int) ==> m dvd b ==> (a mod b mod m) = (a mod m)"
76.406 apply (unfold dvd_def)
76.407 apply auto
76.408 apply (subst zcong_zmod_eq [symmetric])
76.409 @@ -696,14 +696,14 @@
76.410 declare xzgcda.simps [simp del]
76.411
76.412 lemma aux1:
76.413 - "zgcd (r', r) = k --> #0 < r -->
76.414 + "zgcd (r', r) = k --> Numeral0 < r -->
76.415 (\<exists>sn tn. xzgcda (m, n, r', r, s', s, t', t) = (k, sn, tn))"
76.416 apply (rule_tac u = m and v = n and w = r' and x = r and y = s' and
76.417 z = s and aa = t' and ab = t in xzgcda.induct)
76.418 apply (subst zgcd_eq)
76.419 apply (subst xzgcda.simps)
76.420 apply auto
76.421 - apply (case_tac "r' mod r = #0")
76.422 + apply (case_tac "r' mod r = Numeral0")
76.423 prefer 2
76.424 apply (frule_tac a = "r'" in pos_mod_sign)
76.425 apply auto
76.426 @@ -716,14 +716,14 @@
76.427 done
76.428
76.429 lemma aux2:
76.430 - "(\<exists>sn tn. xzgcda (m, n, r', r, s', s, t', t) = (k, sn, tn)) --> #0 < r -->
76.431 + "(\<exists>sn tn. xzgcda (m, n, r', r, s', s, t', t) = (k, sn, tn)) --> Numeral0 < r -->
76.432 zgcd (r', r) = k"
76.433 apply (rule_tac u = m and v = n and w = r' and x = r and y = s' and
76.434 z = s and aa = t' and ab = t in xzgcda.induct)
76.435 apply (subst zgcd_eq)
76.436 apply (subst xzgcda.simps)
76.437 apply (auto simp add: linorder_not_le)
76.438 - apply (case_tac "r' mod r = #0")
76.439 + apply (case_tac "r' mod r = Numeral0")
76.440 prefer 2
76.441 apply (frule_tac a = "r'" in pos_mod_sign)
76.442 apply auto
76.443 @@ -735,7 +735,7 @@
76.444 done
76.445
76.446 lemma xzgcd_correct:
76.447 - "#0 < n ==> (zgcd (m, n) = k) = (\<exists>s t. xzgcd m n = (k, s, t))"
76.448 + "Numeral0 < n ==> (zgcd (m, n) = k) = (\<exists>s t. xzgcd m n = (k, s, t))"
76.449 apply (unfold xzgcd_def)
76.450 apply (rule iffI)
76.451 apply (rule_tac [2] aux2 [THEN mp, THEN mp])
76.452 @@ -768,17 +768,17 @@
76.453 by (rule iffD2 [OF order_less_le conjI])
76.454
76.455 lemma xzgcda_linear [rule_format]:
76.456 - "#0 < r --> xzgcda (m, n, r', r, s', s, t', t) = (rn, sn, tn) -->
76.457 + "Numeral0 < r --> xzgcda (m, n, r', r, s', s, t', t) = (rn, sn, tn) -->
76.458 r' = s' * m + t' * n --> r = s * m + t * n --> rn = sn * m + tn * n"
76.459 apply (rule_tac u = m and v = n and w = r' and x = r and y = s' and
76.460 z = s and aa = t' and ab = t in xzgcda.induct)
76.461 apply (subst xzgcda.simps)
76.462 apply (simp (no_asm))
76.463 apply (rule impI)+
76.464 - apply (case_tac "r' mod r = #0")
76.465 + apply (case_tac "r' mod r = Numeral0")
76.466 apply (simp add: xzgcda.simps)
76.467 apply clarify
76.468 - apply (subgoal_tac "#0 < r' mod r")
76.469 + apply (subgoal_tac "Numeral0 < r' mod r")
76.470 apply (rule_tac [2] order_le_neq_implies_less)
76.471 apply (rule_tac [2] pos_mod_sign)
76.472 apply (cut_tac m = m and n = n and r' = r' and r = r and s' = s' and
76.473 @@ -787,7 +787,7 @@
76.474 done
76.475
76.476 lemma xzgcd_linear:
76.477 - "#0 < n ==> xzgcd m n = (r, s, t) ==> r = s * m + t * n"
76.478 + "Numeral0 < n ==> xzgcd m n = (r, s, t) ==> r = s * m + t * n"
76.479 apply (unfold xzgcd_def)
76.480 apply (erule xzgcda_linear)
76.481 apply assumption
76.482 @@ -795,7 +795,7 @@
76.483 done
76.484
76.485 lemma zgcd_ex_linear:
76.486 - "#0 < n ==> zgcd (m, n) = k ==> (\<exists>s t. k = s * m + t * n)"
76.487 + "Numeral0 < n ==> zgcd (m, n) = k ==> (\<exists>s t. k = s * m + t * n)"
76.488 apply (simp add: xzgcd_correct)
76.489 apply safe
76.490 apply (rule exI)+
76.491 @@ -804,8 +804,8 @@
76.492 done
76.493
76.494 lemma zcong_lineq_ex:
76.495 - "#0 < n ==> zgcd (a, n) = #1 ==> \<exists>x. [a * x = #1] (mod n)"
76.496 - apply (cut_tac m = a and n = n and k = "#1" in zgcd_ex_linear)
76.497 + "Numeral0 < n ==> zgcd (a, n) = Numeral1 ==> \<exists>x. [a * x = Numeral1] (mod n)"
76.498 + apply (cut_tac m = a and n = n and k = "Numeral1" in zgcd_ex_linear)
76.499 apply safe
76.500 apply (rule_tac x = s in exI)
76.501 apply (rule_tac b = "s * a + t * n" in zcong_trans)
76.502 @@ -816,8 +816,8 @@
76.503 done
76.504
76.505 lemma zcong_lineq_unique:
76.506 - "#0 < n ==>
76.507 - zgcd (a, n) = #1 ==> \<exists>!x. #0 \<le> x \<and> x < n \<and> [a * x = b] (mod n)"
76.508 + "Numeral0 < n ==>
76.509 + zgcd (a, n) = Numeral1 ==> \<exists>!x. Numeral0 \<le> x \<and> x < n \<and> [a * x = b] (mod n)"
76.510 apply auto
76.511 apply (rule_tac [2] zcong_zless_imp_eq)
76.512 apply (tactic {* stac (thm "zcong_cancel2" RS sym) 6 *})
76.513 @@ -833,7 +833,7 @@
76.514 apply (subst zcong_zmod)
76.515 apply (subst zmod_zmult1_eq [symmetric])
76.516 apply (subst zcong_zmod [symmetric])
76.517 - apply (subgoal_tac "[a * x * b = #1 * b] (mod n)")
76.518 + apply (subgoal_tac "[a * x * b = Numeral1 * b] (mod n)")
76.519 apply (rule_tac [2] zcong_zmult)
76.520 apply (simp_all add: zmult_assoc)
76.521 done
77.1 --- a/src/HOL/NumberTheory/WilsonBij.thy Fri Oct 05 21:50:37 2001 +0200
77.2 +++ b/src/HOL/NumberTheory/WilsonBij.thy Fri Oct 05 21:52:39 2001 +0200
77.3 @@ -20,19 +20,19 @@
77.4 constdefs
77.5 reciR :: "int => int => int => bool"
77.6 "reciR p ==
77.7 - \<lambda>a b. zcong (a * b) #1 p \<and> #1 < a \<and> a < p - #1 \<and> #1 < b \<and> b < p - #1"
77.8 + \<lambda>a b. zcong (a * b) Numeral1 p \<and> Numeral1 < a \<and> a < p - Numeral1 \<and> Numeral1 < b \<and> b < p - Numeral1"
77.9 inv :: "int => int => int"
77.10 "inv p a ==
77.11 - if p \<in> zprime \<and> #0 < a \<and> a < p then
77.12 - (SOME x. #0 \<le> x \<and> x < p \<and> zcong (a * x) #1 p)
77.13 - else #0"
77.14 + if p \<in> zprime \<and> Numeral0 < a \<and> a < p then
77.15 + (SOME x. Numeral0 \<le> x \<and> x < p \<and> zcong (a * x) Numeral1 p)
77.16 + else Numeral0"
77.17
77.18
77.19 text {* \medskip Inverse *}
77.20
77.21 lemma inv_correct:
77.22 - "p \<in> zprime ==> #0 < a ==> a < p
77.23 - ==> #0 \<le> inv p a \<and> inv p a < p \<and> [a * inv p a = #1] (mod p)"
77.24 + "p \<in> zprime ==> Numeral0 < a ==> a < p
77.25 + ==> Numeral0 \<le> inv p a \<and> inv p a < p \<and> [a * inv p a = Numeral1] (mod p)"
77.26 apply (unfold inv_def)
77.27 apply (simp (no_asm_simp))
77.28 apply (rule zcong_lineq_unique [THEN ex1_implies_ex, THEN someI_ex])
77.29 @@ -46,53 +46,53 @@
77.30 lemmas inv_is_inv = inv_correct [THEN conjunct2, THEN conjunct2, standard]
77.31
77.32 lemma inv_not_0:
77.33 - "p \<in> zprime ==> #1 < a ==> a < p - #1 ==> inv p a \<noteq> #0"
77.34 + "p \<in> zprime ==> Numeral1 < a ==> a < p - Numeral1 ==> inv p a \<noteq> Numeral0"
77.35 -- {* same as @{text WilsonRuss} *}
77.36 apply safe
77.37 apply (cut_tac a = a and p = p in inv_is_inv)
77.38 apply (unfold zcong_def)
77.39 apply auto
77.40 - apply (subgoal_tac "\<not> p dvd #1")
77.41 + apply (subgoal_tac "\<not> p dvd Numeral1")
77.42 apply (rule_tac [2] zdvd_not_zless)
77.43 - apply (subgoal_tac "p dvd #1")
77.44 + apply (subgoal_tac "p dvd Numeral1")
77.45 prefer 2
77.46 apply (subst zdvd_zminus_iff [symmetric])
77.47 apply auto
77.48 done
77.49
77.50 lemma inv_not_1:
77.51 - "p \<in> zprime ==> #1 < a ==> a < p - #1 ==> inv p a \<noteq> #1"
77.52 + "p \<in> zprime ==> Numeral1 < a ==> a < p - Numeral1 ==> inv p a \<noteq> Numeral1"
77.53 -- {* same as @{text WilsonRuss} *}
77.54 apply safe
77.55 apply (cut_tac a = a and p = p in inv_is_inv)
77.56 prefer 4
77.57 apply simp
77.58 - apply (subgoal_tac "a = #1")
77.59 + apply (subgoal_tac "a = Numeral1")
77.60 apply (rule_tac [2] zcong_zless_imp_eq)
77.61 apply auto
77.62 done
77.63
77.64 -lemma aux: "[a * (p - #1) = #1] (mod p) = [a = p - #1] (mod p)"
77.65 +lemma aux: "[a * (p - Numeral1) = Numeral1] (mod p) = [a = p - Numeral1] (mod p)"
77.66 -- {* same as @{text WilsonRuss} *}
77.67 apply (unfold zcong_def)
77.68 apply (simp add: zdiff_zdiff_eq zdiff_zdiff_eq2 zdiff_zmult_distrib2)
77.69 - apply (rule_tac s = "p dvd -((a + #1) + (p * -a))" in trans)
77.70 + apply (rule_tac s = "p dvd -((a + Numeral1) + (p * -a))" in trans)
77.71 apply (simp add: zmult_commute zminus_zdiff_eq)
77.72 apply (subst zdvd_zminus_iff)
77.73 apply (subst zdvd_reduce)
77.74 - apply (rule_tac s = "p dvd (a + #1) + (p * -#1)" in trans)
77.75 + apply (rule_tac s = "p dvd (a + Numeral1) + (p * -Numeral1)" in trans)
77.76 apply (subst zdvd_reduce)
77.77 apply auto
77.78 done
77.79
77.80 lemma inv_not_p_minus_1:
77.81 - "p \<in> zprime ==> #1 < a ==> a < p - #1 ==> inv p a \<noteq> p - #1"
77.82 + "p \<in> zprime ==> Numeral1 < a ==> a < p - Numeral1 ==> inv p a \<noteq> p - Numeral1"
77.83 -- {* same as @{text WilsonRuss} *}
77.84 apply safe
77.85 apply (cut_tac a = a and p = p in inv_is_inv)
77.86 apply auto
77.87 apply (simp add: aux)
77.88 - apply (subgoal_tac "a = p - #1")
77.89 + apply (subgoal_tac "a = p - Numeral1")
77.90 apply (rule_tac [2] zcong_zless_imp_eq)
77.91 apply auto
77.92 done
77.93 @@ -102,9 +102,9 @@
77.94 but use ``@{text correct}'' theorems.
77.95 *}
77.96
77.97 -lemma inv_g_1: "p \<in> zprime ==> #1 < a ==> a < p - #1 ==> #1 < inv p a"
77.98 - apply (subgoal_tac "inv p a \<noteq> #1")
77.99 - apply (subgoal_tac "inv p a \<noteq> #0")
77.100 +lemma inv_g_1: "p \<in> zprime ==> Numeral1 < a ==> a < p - Numeral1 ==> Numeral1 < inv p a"
77.101 + apply (subgoal_tac "inv p a \<noteq> Numeral1")
77.102 + apply (subgoal_tac "inv p a \<noteq> Numeral0")
77.103 apply (subst order_less_le)
77.104 apply (subst zle_add1_eq_le [symmetric])
77.105 apply (subst order_less_le)
77.106 @@ -116,7 +116,7 @@
77.107 done
77.108
77.109 lemma inv_less_p_minus_1:
77.110 - "p \<in> zprime ==> #1 < a ==> a < p - #1 ==> inv p a < p - #1"
77.111 + "p \<in> zprime ==> Numeral1 < a ==> a < p - Numeral1 ==> inv p a < p - Numeral1"
77.112 -- {* ditto *}
77.113 apply (subst order_less_le)
77.114 apply (simp add: inv_not_p_minus_1 inv_less)
77.115 @@ -125,23 +125,23 @@
77.116
77.117 text {* \medskip Bijection *}
77.118
77.119 -lemma aux1: "#1 < x ==> #0 \<le> (x::int)"
77.120 +lemma aux1: "Numeral1 < x ==> Numeral0 \<le> (x::int)"
77.121 apply auto
77.122 done
77.123
77.124 -lemma aux2: "#1 < x ==> #0 < (x::int)"
77.125 +lemma aux2: "Numeral1 < x ==> Numeral0 < (x::int)"
77.126 apply auto
77.127 done
77.128
77.129 -lemma aux3: "x \<le> p - #2 ==> x < (p::int)"
77.130 +lemma aux3: "x \<le> p - # 2 ==> x < (p::int)"
77.131 apply auto
77.132 done
77.133
77.134 -lemma aux4: "x \<le> p - #2 ==> x < (p::int)-#1"
77.135 +lemma aux4: "x \<le> p - # 2 ==> x < (p::int)-Numeral1"
77.136 apply auto
77.137 done
77.138
77.139 -lemma inv_inj: "p \<in> zprime ==> inj_on (inv p) (d22set (p - #2))"
77.140 +lemma inv_inj: "p \<in> zprime ==> inj_on (inv p) (d22set (p - # 2))"
77.141 apply (unfold inj_on_def)
77.142 apply auto
77.143 apply (rule zcong_zless_imp_eq)
77.144 @@ -160,22 +160,22 @@
77.145 done
77.146
77.147 lemma inv_d22set_d22set:
77.148 - "p \<in> zprime ==> inv p ` d22set (p - #2) = d22set (p - #2)"
77.149 + "p \<in> zprime ==> inv p ` d22set (p - # 2) = d22set (p - # 2)"
77.150 apply (rule endo_inj_surj)
77.151 apply (rule d22set_fin)
77.152 apply (erule_tac [2] inv_inj)
77.153 apply auto
77.154 apply (rule d22set_mem)
77.155 apply (erule inv_g_1)
77.156 - apply (subgoal_tac [3] "inv p xa < p - #1")
77.157 + apply (subgoal_tac [3] "inv p xa < p - Numeral1")
77.158 apply (erule_tac [4] inv_less_p_minus_1)
77.159 apply (auto intro: d22set_g_1 d22set_le aux4)
77.160 done
77.161
77.162 lemma d22set_d22set_bij:
77.163 - "p \<in> zprime ==> (d22set (p - #2), d22set (p - #2)) \<in> bijR (reciR p)"
77.164 + "p \<in> zprime ==> (d22set (p - # 2), d22set (p - # 2)) \<in> bijR (reciR p)"
77.165 apply (unfold reciR_def)
77.166 - apply (rule_tac s = "(d22set (p - #2), inv p ` d22set (p - #2))" in subst)
77.167 + apply (rule_tac s = "(d22set (p - # 2), inv p ` d22set (p - # 2))" in subst)
77.168 apply (simp add: inv_d22set_d22set)
77.169 apply (rule inj_func_bijR)
77.170 apply (rule_tac [3] d22set_fin)
77.171 @@ -187,7 +187,7 @@
77.172 apply (auto intro: d22set_g_1 d22set_le aux2 aux3 aux4)
77.173 done
77.174
77.175 -lemma reciP_bijP: "p \<in> zprime ==> bijP (reciR p) (d22set (p - #2))"
77.176 +lemma reciP_bijP: "p \<in> zprime ==> bijP (reciR p) (d22set (p - # 2))"
77.177 apply (unfold reciR_def bijP_def)
77.178 apply auto
77.179 apply (rule d22set_mem)
77.180 @@ -217,7 +217,7 @@
77.181 apply auto
77.182 done
77.183
77.184 -lemma bijER_d22set: "p \<in> zprime ==> d22set (p - #2) \<in> bijER (reciR p)"
77.185 +lemma bijER_d22set: "p \<in> zprime ==> d22set (p - # 2) \<in> bijER (reciR p)"
77.186 apply (rule bijR_bijER)
77.187 apply (erule d22set_d22set_bij)
77.188 apply (erule reciP_bijP)
77.189 @@ -229,28 +229,28 @@
77.190 subsection {* Wilson *}
77.191
77.192 lemma bijER_zcong_prod_1:
77.193 - "p \<in> zprime ==> A \<in> bijER (reciR p) ==> [setprod A = #1] (mod p)"
77.194 + "p \<in> zprime ==> A \<in> bijER (reciR p) ==> [setprod A = Numeral1] (mod p)"
77.195 apply (unfold reciR_def)
77.196 apply (erule bijER.induct)
77.197 - apply (subgoal_tac [2] "a = #1 \<or> a = p - #1")
77.198 + apply (subgoal_tac [2] "a = Numeral1 \<or> a = p - Numeral1")
77.199 apply (rule_tac [3] zcong_square_zless)
77.200 apply auto
77.201 apply (subst setprod_insert)
77.202 prefer 3
77.203 apply (subst setprod_insert)
77.204 apply (auto simp add: fin_bijER)
77.205 - apply (subgoal_tac "zcong ((a * b) * setprod A) (#1 * #1) p")
77.206 + apply (subgoal_tac "zcong ((a * b) * setprod A) (Numeral1 * Numeral1) p")
77.207 apply (simp add: zmult_assoc)
77.208 apply (rule zcong_zmult)
77.209 apply auto
77.210 done
77.211
77.212 -theorem Wilson_Bij: "p \<in> zprime ==> [zfact (p - #1) = #-1] (mod p)"
77.213 - apply (subgoal_tac "zcong ((p - #1) * zfact (p - #2)) (#-1 * #1) p")
77.214 +theorem Wilson_Bij: "p \<in> zprime ==> [zfact (p - Numeral1) = # -1] (mod p)"
77.215 + apply (subgoal_tac "zcong ((p - Numeral1) * zfact (p - # 2)) (# -1 * Numeral1) p")
77.216 apply (rule_tac [2] zcong_zmult)
77.217 apply (simp add: zprime_def)
77.218 apply (subst zfact.simps)
77.219 - apply (rule_tac t = "p - #1 - #1" and s = "p - #2" in subst)
77.220 + apply (rule_tac t = "p - Numeral1 - Numeral1" and s = "p - # 2" in subst)
77.221 apply auto
77.222 apply (simp add: zcong_def)
77.223 apply (subst d22set_prod_zfact [symmetric])
78.1 --- a/src/HOL/NumberTheory/WilsonRuss.thy Fri Oct 05 21:50:37 2001 +0200
78.2 +++ b/src/HOL/NumberTheory/WilsonRuss.thy Fri Oct 05 21:52:39 2001 +0200
78.3 @@ -20,25 +20,25 @@
78.4 wset :: "int * int => int set"
78.5
78.6 defs
78.7 - inv_def: "inv p a == (a^(nat (p - #2))) mod p"
78.8 + inv_def: "inv p a == (a^(nat (p - # 2))) mod p"
78.9
78.10 recdef wset
78.11 "measure ((\<lambda>(a, p). nat a) :: int * int => nat)"
78.12 "wset (a, p) =
78.13 - (if #1 < a then
78.14 - let ws = wset (a - #1, p)
78.15 + (if Numeral1 < a then
78.16 + let ws = wset (a - Numeral1, p)
78.17 in (if a \<in> ws then ws else insert a (insert (inv p a) ws)) else {})"
78.18
78.19
78.20 text {* \medskip @{term [source] inv} *}
78.21
78.22 -lemma aux: "#1 < m ==> Suc (nat (m - #2)) = nat (m - #1)"
78.23 +lemma aux: "Numeral1 < m ==> Suc (nat (m - # 2)) = nat (m - Numeral1)"
78.24 apply (subst int_int_eq [symmetric])
78.25 apply auto
78.26 done
78.27
78.28 lemma inv_is_inv:
78.29 - "p \<in> zprime \<Longrightarrow> #0 < a \<Longrightarrow> a < p ==> [a * inv p a = #1] (mod p)"
78.30 + "p \<in> zprime \<Longrightarrow> Numeral0 < a \<Longrightarrow> a < p ==> [a * inv p a = Numeral1] (mod p)"
78.31 apply (unfold inv_def)
78.32 apply (subst zcong_zmod)
78.33 apply (subst zmod_zmult1_eq [symmetric])
78.34 @@ -52,71 +52,71 @@
78.35 done
78.36
78.37 lemma inv_distinct:
78.38 - "p \<in> zprime \<Longrightarrow> #1 < a \<Longrightarrow> a < p - #1 ==> a \<noteq> inv p a"
78.39 + "p \<in> zprime \<Longrightarrow> Numeral1 < a \<Longrightarrow> a < p - Numeral1 ==> a \<noteq> inv p a"
78.40 apply safe
78.41 apply (cut_tac a = a and p = p in zcong_square)
78.42 apply (cut_tac [3] a = a and p = p in inv_is_inv)
78.43 apply auto
78.44 - apply (subgoal_tac "a = #1")
78.45 + apply (subgoal_tac "a = Numeral1")
78.46 apply (rule_tac [2] m = p in zcong_zless_imp_eq)
78.47 - apply (subgoal_tac [7] "a = p - #1")
78.48 + apply (subgoal_tac [7] "a = p - Numeral1")
78.49 apply (rule_tac [8] m = p in zcong_zless_imp_eq)
78.50 apply auto
78.51 done
78.52
78.53 lemma inv_not_0:
78.54 - "p \<in> zprime \<Longrightarrow> #1 < a \<Longrightarrow> a < p - #1 ==> inv p a \<noteq> #0"
78.55 + "p \<in> zprime \<Longrightarrow> Numeral1 < a \<Longrightarrow> a < p - Numeral1 ==> inv p a \<noteq> Numeral0"
78.56 apply safe
78.57 apply (cut_tac a = a and p = p in inv_is_inv)
78.58 apply (unfold zcong_def)
78.59 apply auto
78.60 - apply (subgoal_tac "\<not> p dvd #1")
78.61 + apply (subgoal_tac "\<not> p dvd Numeral1")
78.62 apply (rule_tac [2] zdvd_not_zless)
78.63 - apply (subgoal_tac "p dvd #1")
78.64 + apply (subgoal_tac "p dvd Numeral1")
78.65 prefer 2
78.66 apply (subst zdvd_zminus_iff [symmetric])
78.67 apply auto
78.68 done
78.69
78.70 lemma inv_not_1:
78.71 - "p \<in> zprime \<Longrightarrow> #1 < a \<Longrightarrow> a < p - #1 ==> inv p a \<noteq> #1"
78.72 + "p \<in> zprime \<Longrightarrow> Numeral1 < a \<Longrightarrow> a < p - Numeral1 ==> inv p a \<noteq> Numeral1"
78.73 apply safe
78.74 apply (cut_tac a = a and p = p in inv_is_inv)
78.75 prefer 4
78.76 apply simp
78.77 - apply (subgoal_tac "a = #1")
78.78 + apply (subgoal_tac "a = Numeral1")
78.79 apply (rule_tac [2] zcong_zless_imp_eq)
78.80 apply auto
78.81 done
78.82
78.83 -lemma aux: "[a * (p - #1) = #1] (mod p) = [a = p - #1] (mod p)"
78.84 +lemma aux: "[a * (p - Numeral1) = Numeral1] (mod p) = [a = p - Numeral1] (mod p)"
78.85 apply (unfold zcong_def)
78.86 apply (simp add: zdiff_zdiff_eq zdiff_zdiff_eq2 zdiff_zmult_distrib2)
78.87 - apply (rule_tac s = "p dvd -((a + #1) + (p * -a))" in trans)
78.88 + apply (rule_tac s = "p dvd -((a + Numeral1) + (p * -a))" in trans)
78.89 apply (simp add: zmult_commute zminus_zdiff_eq)
78.90 apply (subst zdvd_zminus_iff)
78.91 apply (subst zdvd_reduce)
78.92 - apply (rule_tac s = "p dvd (a + #1) + (p * -#1)" in trans)
78.93 + apply (rule_tac s = "p dvd (a + Numeral1) + (p * -Numeral1)" in trans)
78.94 apply (subst zdvd_reduce)
78.95 apply auto
78.96 done
78.97
78.98 lemma inv_not_p_minus_1:
78.99 - "p \<in> zprime \<Longrightarrow> #1 < a \<Longrightarrow> a < p - #1 ==> inv p a \<noteq> p - #1"
78.100 + "p \<in> zprime \<Longrightarrow> Numeral1 < a \<Longrightarrow> a < p - Numeral1 ==> inv p a \<noteq> p - Numeral1"
78.101 apply safe
78.102 apply (cut_tac a = a and p = p in inv_is_inv)
78.103 apply auto
78.104 apply (simp add: aux)
78.105 - apply (subgoal_tac "a = p - #1")
78.106 + apply (subgoal_tac "a = p - Numeral1")
78.107 apply (rule_tac [2] zcong_zless_imp_eq)
78.108 apply auto
78.109 done
78.110
78.111 lemma inv_g_1:
78.112 - "p \<in> zprime \<Longrightarrow> #1 < a \<Longrightarrow> a < p - #1 ==> #1 < inv p a"
78.113 - apply (case_tac "#0\<le> inv p a")
78.114 - apply (subgoal_tac "inv p a \<noteq> #1")
78.115 - apply (subgoal_tac "inv p a \<noteq> #0")
78.116 + "p \<in> zprime \<Longrightarrow> Numeral1 < a \<Longrightarrow> a < p - Numeral1 ==> Numeral1 < inv p a"
78.117 + apply (case_tac "Numeral0\<le> inv p a")
78.118 + apply (subgoal_tac "inv p a \<noteq> Numeral1")
78.119 + apply (subgoal_tac "inv p a \<noteq> Numeral0")
78.120 apply (subst order_less_le)
78.121 apply (subst zle_add1_eq_le [symmetric])
78.122 apply (subst order_less_le)
78.123 @@ -128,7 +128,7 @@
78.124 done
78.125
78.126 lemma inv_less_p_minus_1:
78.127 - "p \<in> zprime \<Longrightarrow> #1 < a \<Longrightarrow> a < p - #1 ==> inv p a < p - #1"
78.128 + "p \<in> zprime \<Longrightarrow> Numeral1 < a \<Longrightarrow> a < p - Numeral1 ==> inv p a < p - Numeral1"
78.129 apply (case_tac "inv p a < p")
78.130 apply (subst order_less_le)
78.131 apply (simp add: inv_not_p_minus_1)
78.132 @@ -137,24 +137,24 @@
78.133 apply (simp add: pos_mod_bound)
78.134 done
78.135
78.136 -lemma aux: "#5 \<le> p ==>
78.137 - nat (p - #2) * nat (p - #2) = Suc (nat (p - #1) * nat (p - #3))"
78.138 +lemma aux: "# 5 \<le> p ==>
78.139 + nat (p - # 2) * nat (p - # 2) = Suc (nat (p - Numeral1) * nat (p - # 3))"
78.140 apply (subst int_int_eq [symmetric])
78.141 apply (simp add: zmult_int [symmetric])
78.142 apply (simp add: zdiff_zmult_distrib zdiff_zmult_distrib2)
78.143 done
78.144
78.145 lemma zcong_zpower_zmult:
78.146 - "[x^y = #1] (mod p) \<Longrightarrow> [x^(y * z) = #1] (mod p)"
78.147 + "[x^y = Numeral1] (mod p) \<Longrightarrow> [x^(y * z) = Numeral1] (mod p)"
78.148 apply (induct z)
78.149 apply (auto simp add: zpower_zadd_distrib)
78.150 - apply (subgoal_tac "zcong (x^y * x^(y * n)) (#1 * #1) p")
78.151 + apply (subgoal_tac "zcong (x^y * x^(y * n)) (Numeral1 * Numeral1) p")
78.152 apply (rule_tac [2] zcong_zmult)
78.153 apply simp_all
78.154 done
78.155
78.156 lemma inv_inv: "p \<in> zprime \<Longrightarrow>
78.157 - #5 \<le> p \<Longrightarrow> #0 < a \<Longrightarrow> a < p ==> inv p (inv p a) = a"
78.158 + # 5 \<le> p \<Longrightarrow> Numeral0 < a \<Longrightarrow> a < p ==> inv p (inv p a) = a"
78.159 apply (unfold inv_def)
78.160 apply (subst zpower_zmod)
78.161 apply (subst zpower_zpower)
78.162 @@ -165,7 +165,7 @@
78.163 apply (subst zcong_zmod [symmetric])
78.164 apply (subst aux)
78.165 apply (subgoal_tac [2]
78.166 - "zcong (a * a^(nat (p - #1) * nat (p - #3))) (a * #1) p")
78.167 + "zcong (a * a^(nat (p - Numeral1) * nat (p - # 3))) (a * Numeral1) p")
78.168 apply (rule_tac [3] zcong_zmult)
78.169 apply (rule_tac [4] zcong_zpower_zmult)
78.170 apply (erule_tac [4] Little_Fermat)
78.171 @@ -180,7 +180,7 @@
78.172
78.173 lemma wset_induct:
78.174 "(!!a p. P {} a p) \<Longrightarrow>
78.175 - (!!a p. #1 < (a::int) \<Longrightarrow> P (wset (a - #1, p)) (a - #1) p
78.176 + (!!a p. Numeral1 < (a::int) \<Longrightarrow> P (wset (a - Numeral1, p)) (a - Numeral1) p
78.177 ==> P (wset (a, p)) a p)
78.178 ==> P (wset (u, v)) u v"
78.179 proof -
78.180 @@ -188,7 +188,7 @@
78.181 show ?thesis
78.182 apply (rule wset.induct)
78.183 apply safe
78.184 - apply (case_tac [2] "#1 < a")
78.185 + apply (case_tac [2] "Numeral1 < a")
78.186 apply (rule_tac [2] rule_context)
78.187 apply simp_all
78.188 apply (simp_all add: wset.simps rule_context)
78.189 @@ -196,27 +196,27 @@
78.190 qed
78.191
78.192 lemma wset_mem_imp_or [rule_format]:
78.193 - "#1 < a \<Longrightarrow> b \<notin> wset (a - #1, p)
78.194 + "Numeral1 < a \<Longrightarrow> b \<notin> wset (a - Numeral1, p)
78.195 ==> b \<in> wset (a, p) --> b = a \<or> b = inv p a"
78.196 apply (subst wset.simps)
78.197 apply (unfold Let_def)
78.198 apply simp
78.199 done
78.200
78.201 -lemma wset_mem_mem [simp]: "#1 < a ==> a \<in> wset (a, p)"
78.202 +lemma wset_mem_mem [simp]: "Numeral1 < a ==> a \<in> wset (a, p)"
78.203 apply (subst wset.simps)
78.204 apply (unfold Let_def)
78.205 apply simp
78.206 done
78.207
78.208 -lemma wset_subset: "#1 < a \<Longrightarrow> b \<in> wset (a - #1, p) ==> b \<in> wset (a, p)"
78.209 +lemma wset_subset: "Numeral1 < a \<Longrightarrow> b \<in> wset (a - Numeral1, p) ==> b \<in> wset (a, p)"
78.210 apply (subst wset.simps)
78.211 apply (unfold Let_def)
78.212 apply auto
78.213 done
78.214
78.215 lemma wset_g_1 [rule_format]:
78.216 - "p \<in> zprime --> a < p - #1 --> b \<in> wset (a, p) --> #1 < b"
78.217 + "p \<in> zprime --> a < p - Numeral1 --> b \<in> wset (a, p) --> Numeral1 < b"
78.218 apply (induct a p rule: wset_induct)
78.219 apply auto
78.220 apply (case_tac "b = a")
78.221 @@ -230,7 +230,7 @@
78.222 done
78.223
78.224 lemma wset_less [rule_format]:
78.225 - "p \<in> zprime --> a < p - #1 --> b \<in> wset (a, p) --> b < p - #1"
78.226 + "p \<in> zprime --> a < p - Numeral1 --> b \<in> wset (a, p) --> b < p - Numeral1"
78.227 apply (induct a p rule: wset_induct)
78.228 apply auto
78.229 apply (case_tac "b = a")
78.230 @@ -245,7 +245,7 @@
78.231
78.232 lemma wset_mem [rule_format]:
78.233 "p \<in> zprime -->
78.234 - a < p - #1 --> #1 < b --> b \<le> a --> b \<in> wset (a, p)"
78.235 + a < p - Numeral1 --> Numeral1 < b --> b \<le> a --> b \<in> wset (a, p)"
78.236 apply (induct a p rule: wset.induct)
78.237 apply auto
78.238 apply (subgoal_tac "b = a")
78.239 @@ -256,7 +256,7 @@
78.240 done
78.241
78.242 lemma wset_mem_inv_mem [rule_format]:
78.243 - "p \<in> zprime --> #5 \<le> p --> a < p - #1 --> b \<in> wset (a, p)
78.244 + "p \<in> zprime --> # 5 \<le> p --> a < p - Numeral1 --> b \<in> wset (a, p)
78.245 --> inv p b \<in> wset (a, p)"
78.246 apply (induct a p rule: wset_induct)
78.247 apply auto
78.248 @@ -274,7 +274,7 @@
78.249 done
78.250
78.251 lemma wset_inv_mem_mem:
78.252 - "p \<in> zprime \<Longrightarrow> #5 \<le> p \<Longrightarrow> a < p - #1 \<Longrightarrow> #1 < b \<Longrightarrow> b < p - #1
78.253 + "p \<in> zprime \<Longrightarrow> # 5 \<le> p \<Longrightarrow> a < p - Numeral1 \<Longrightarrow> Numeral1 < b \<Longrightarrow> b < p - Numeral1
78.254 \<Longrightarrow> inv p b \<in> wset (a, p) \<Longrightarrow> b \<in> wset (a, p)"
78.255 apply (rule_tac s = "inv p (inv p b)" and t = b in subst)
78.256 apply (rule_tac [2] wset_mem_inv_mem)
78.257 @@ -292,7 +292,7 @@
78.258
78.259 lemma wset_zcong_prod_1 [rule_format]:
78.260 "p \<in> zprime -->
78.261 - #5 \<le> p --> a < p - #1 --> [setprod (wset (a, p)) = #1] (mod p)"
78.262 + # 5 \<le> p --> a < p - Numeral1 --> [setprod (wset (a, p)) = Numeral1] (mod p)"
78.263 apply (induct a p rule: wset_induct)
78.264 prefer 2
78.265 apply (subst wset.simps)
78.266 @@ -301,20 +301,20 @@
78.267 apply (subst setprod_insert)
78.268 apply (tactic {* stac (thm "setprod_insert") 3 *})
78.269 apply (subgoal_tac [5]
78.270 - "zcong (a * inv p a * setprod (wset (a - #1, p))) (#1 * #1) p")
78.271 + "zcong (a * inv p a * setprod (wset (a - Numeral1, p))) (Numeral1 * Numeral1) p")
78.272 prefer 5
78.273 apply (simp add: zmult_assoc)
78.274 apply (rule_tac [5] zcong_zmult)
78.275 apply (rule_tac [5] inv_is_inv)
78.276 apply (tactic "Clarify_tac 4")
78.277 - apply (subgoal_tac [4] "a \<in> wset (a - #1, p)")
78.278 + apply (subgoal_tac [4] "a \<in> wset (a - Numeral1, p)")
78.279 apply (rule_tac [5] wset_inv_mem_mem)
78.280 apply (simp_all add: wset_fin)
78.281 apply (rule inv_distinct)
78.282 apply auto
78.283 done
78.284
78.285 -lemma d22set_eq_wset: "p \<in> zprime ==> d22set (p - #2) = wset (p - #2, p)"
78.286 +lemma d22set_eq_wset: "p \<in> zprime ==> d22set (p - # 2) = wset (p - # 2, p)"
78.287 apply safe
78.288 apply (erule wset_mem)
78.289 apply (rule_tac [2] d22set_g_1)
78.290 @@ -323,7 +323,7 @@
78.291 apply (erule_tac [4] wset_g_1)
78.292 prefer 6
78.293 apply (subst zle_add1_eq_le [symmetric])
78.294 - apply (subgoal_tac "p - #2 + #1 = p - #1")
78.295 + apply (subgoal_tac "p - # 2 + Numeral1 = p - Numeral1")
78.296 apply (simp (no_asm_simp))
78.297 apply (erule wset_less)
78.298 apply auto
78.299 @@ -332,36 +332,36 @@
78.300
78.301 subsection {* Wilson *}
78.302
78.303 -lemma prime_g_5: "p \<in> zprime \<Longrightarrow> p \<noteq> #2 \<Longrightarrow> p \<noteq> #3 ==> #5 \<le> p"
78.304 +lemma prime_g_5: "p \<in> zprime \<Longrightarrow> p \<noteq> # 2 \<Longrightarrow> p \<noteq> # 3 ==> # 5 \<le> p"
78.305 apply (unfold zprime_def dvd_def)
78.306 - apply (case_tac "p = #4")
78.307 + apply (case_tac "p = # 4")
78.308 apply auto
78.309 apply (rule notE)
78.310 prefer 2
78.311 apply assumption
78.312 apply (simp (no_asm))
78.313 - apply (rule_tac x = "#2" in exI)
78.314 + apply (rule_tac x = "# 2" in exI)
78.315 apply safe
78.316 - apply (rule_tac x = "#2" in exI)
78.317 + apply (rule_tac x = "# 2" in exI)
78.318 apply auto
78.319 apply arith
78.320 done
78.321
78.322 theorem Wilson_Russ:
78.323 - "p \<in> zprime ==> [zfact (p - #1) = #-1] (mod p)"
78.324 - apply (subgoal_tac "[(p - #1) * zfact (p - #2) = #-1 * #1] (mod p)")
78.325 + "p \<in> zprime ==> [zfact (p - Numeral1) = # -1] (mod p)"
78.326 + apply (subgoal_tac "[(p - Numeral1) * zfact (p - # 2) = # -1 * Numeral1] (mod p)")
78.327 apply (rule_tac [2] zcong_zmult)
78.328 apply (simp only: zprime_def)
78.329 apply (subst zfact.simps)
78.330 - apply (rule_tac t = "p - #1 - #1" and s = "p - #2" in subst)
78.331 + apply (rule_tac t = "p - Numeral1 - Numeral1" and s = "p - # 2" in subst)
78.332 apply auto
78.333 apply (simp only: zcong_def)
78.334 apply (simp (no_asm_simp))
78.335 - apply (case_tac "p = #2")
78.336 + apply (case_tac "p = # 2")
78.337 apply (simp add: zfact.simps)
78.338 - apply (case_tac "p = #3")
78.339 + apply (case_tac "p = # 3")
78.340 apply (simp add: zfact.simps)
78.341 - apply (subgoal_tac "#5 \<le> p")
78.342 + apply (subgoal_tac "# 5 \<le> p")
78.343 apply (erule_tac [2] prime_g_5)
78.344 apply (subst d22set_prod_zfact [symmetric])
78.345 apply (subst d22set_eq_wset)
79.1 --- a/src/HOL/Power.ML Fri Oct 05 21:50:37 2001 +0200
79.2 +++ b/src/HOL/Power.ML Fri Oct 05 21:52:39 2001 +0200
79.3 @@ -30,7 +30,7 @@
79.4 by Auto_tac;
79.5 qed "power_eq_0D";
79.6
79.7 -Goal "!!i::nat. 1 <= i ==> 1' <= i^n";
79.8 +Goal "!!i::nat. 1 <= i ==> Suc 0 <= i^n";
79.9 by (induct_tac "n" 1);
79.10 by Auto_tac;
79.11 qed "one_le_power";
79.12 @@ -49,12 +49,12 @@
79.13 by (asm_simp_tac (simpset() addsimps [power_add]) 1);
79.14 qed "le_imp_power_dvd";
79.15
79.16 -Goal "1 < i ==> \\<forall>n. i ^ m <= i ^ n --> m <= n";
79.17 +Goal "(1::nat) < i ==> \\<forall>n. i ^ m <= i ^ n --> m <= n";
79.18 by (induct_tac "m" 1);
79.19 by Auto_tac;
79.20 by (case_tac "na" 1);
79.21 by Auto_tac;
79.22 -by (subgoal_tac "2 * 1 <= i * i^n" 1);
79.23 +by (subgoal_tac "Suc 1 * 1 <= i * i^n" 1);
79.24 by (Asm_full_simp_tac 1);
79.25 by (rtac mult_le_mono 1);
79.26 by Auto_tac;
79.27 @@ -73,7 +73,7 @@
79.28 by (blast_tac (claset() addSDs [dvd_mult_right]) 1);
79.29 qed_spec_mp "power_le_dvd";
79.30
79.31 -Goal "[|i^m dvd i^n; 1 < i|] ==> m <= n";
79.32 +Goal "[|i^m dvd i^n; (1::nat) < i|] ==> m <= n";
79.33 by (rtac power_le_imp_le 1);
79.34 by (assume_tac 1);
79.35 by (etac dvd_imp_le 1);
79.36 @@ -120,7 +120,7 @@
79.37 qed "binomial_Suc_n";
79.38 Addsimps [binomial_Suc_n];
79.39
79.40 -Goal "(n choose 1') = n";
79.41 +Goal "(n choose Suc 0) = n";
79.42 by (induct_tac "n" 1);
79.43 by (ALLGOALS Asm_simp_tac);
79.44 qed "binomial_1";
79.45 @@ -162,8 +162,8 @@
79.46 qed "binomial_Suc_Suc_eq_times";
79.47
79.48 (*Another version, with -1 instead of Suc.*)
79.49 -Goal "[|k <= n; 0<k|] ==> (n choose k) * k = n * ((n-1) choose (k-1))";
79.50 -by (cut_inst_tac [("n","n-1"),("k","k-1")] Suc_times_binomial_eq 1);
79.51 +Goal "[|k <= n; 0<k|] ==> (n choose k) * k = n * ((n - 1) choose (k - 1))";
79.52 +by (cut_inst_tac [("n","n - 1"),("k","k - 1")] Suc_times_binomial_eq 1);
79.53 by (asm_full_simp_tac (simpset() addsplits [nat_diff_split]) 1);
79.54 by Auto_tac;
79.55 qed "times_binomial_minus1_eq";
80.1 --- a/src/HOL/Prolog/Type.ML Fri Oct 05 21:50:37 2001 +0200
80.2 +++ b/src/HOL/Prolog/Type.ML Fri Oct 05 21:52:39 2001 +0200
80.3 @@ -6,7 +6,7 @@
80.4
80.5 pgoal "typeof (fix (%x. x)) ?T";
80.6
80.7 -pgoal "typeof (fix (%fact. abs(%n. (app fact (n-0))))) ?T";
80.8 +pgoal "typeof (fix (%fact. abs(%n. (app fact (n - 0))))) ?T";
80.9
80.10 pgoal "typeof (fix (%fact. abs(%n. cond (n eq 0) (S 0) \
80.11 \(n * (app fact (n - (S 0))))))) ?T";
81.1 --- a/src/HOL/Real/HahnBanach/Aux.thy Fri Oct 05 21:50:37 2001 +0200
81.2 +++ b/src/HOL/Real/HahnBanach/Aux.thy Fri Oct 05 21:52:39 2001 +0200
81.3 @@ -40,20 +40,20 @@
81.4
81.5 text {* \medskip Some lemmas for the reals. *}
81.6
81.7 -lemma real_add_minus_eq: "x - y = (#0::real) \<Longrightarrow> x = y"
81.8 +lemma real_add_minus_eq: "x - y = (Numeral0::real) \<Longrightarrow> x = y"
81.9 by simp
81.10
81.11 -lemma abs_minus_one: "abs (- (#1::real)) = #1"
81.12 +lemma abs_minus_one: "abs (- (Numeral1::real)) = Numeral1"
81.13 by simp
81.14
81.15 lemma real_mult_le_le_mono1a:
81.16 - "(#0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x \<le> z * y"
81.17 + "(Numeral0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x \<le> z * y"
81.18 by (simp add: real_mult_le_mono2)
81.19
81.20 lemma real_mult_le_le_mono2:
81.21 - "(#0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> x * z \<le> y * z"
81.22 + "(Numeral0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> x * z \<le> y * z"
81.23 proof -
81.24 - assume "(#0::real) \<le> z" "x \<le> y"
81.25 + assume "(Numeral0::real) \<le> z" "x \<le> y"
81.26 hence "x < y \<or> x = y" by (auto simp add: order_le_less)
81.27 thus ?thesis
81.28 proof
81.29 @@ -66,11 +66,11 @@
81.30 qed
81.31
81.32 lemma real_mult_less_le_anti:
81.33 - "z < (#0::real) \<Longrightarrow> x \<le> y \<Longrightarrow> z * y \<le> z * x"
81.34 + "z < (Numeral0::real) \<Longrightarrow> x \<le> y \<Longrightarrow> z * y \<le> z * x"
81.35 proof -
81.36 - assume "z < #0" "x \<le> y"
81.37 - hence "#0 < - z" by simp
81.38 - hence "#0 \<le> - z" by (rule order_less_imp_le)
81.39 + assume "z < Numeral0" "x \<le> y"
81.40 + hence "Numeral0 < - z" by simp
81.41 + hence "Numeral0 \<le> - z" by (rule order_less_imp_le)
81.42 hence "x * (- z) \<le> y * (- z)"
81.43 by (rule real_mult_le_le_mono2)
81.44 hence "- (x * z) \<le> - (y * z)"
81.45 @@ -79,31 +79,31 @@
81.46 qed
81.47
81.48 lemma real_mult_less_le_mono:
81.49 - "(#0::real) < z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x \<le> z * y"
81.50 + "(Numeral0::real) < z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x \<le> z * y"
81.51 proof -
81.52 - assume "#0 < z" "x \<le> y"
81.53 - have "#0 \<le> z" by (rule order_less_imp_le)
81.54 + assume "Numeral0 < z" "x \<le> y"
81.55 + have "Numeral0 \<le> z" by (rule order_less_imp_le)
81.56 hence "x * z \<le> y * z"
81.57 by (rule real_mult_le_le_mono2)
81.58 thus ?thesis by (simp only: real_mult_commute)
81.59 qed
81.60
81.61 -lemma real_inverse_gt_zero1: "#0 < (x::real) \<Longrightarrow> #0 < inverse x"
81.62 +lemma real_inverse_gt_zero1: "Numeral0 < (x::real) \<Longrightarrow> Numeral0 < inverse x"
81.63 proof -
81.64 - assume "#0 < x"
81.65 + assume "Numeral0 < x"
81.66 have "0 < x" by simp
81.67 hence "0 < inverse x" by (rule real_inverse_gt_zero)
81.68 thus ?thesis by simp
81.69 qed
81.70
81.71 -lemma real_mult_inv_right1: "(x::real) \<noteq> #0 \<Longrightarrow> x * inverse x = #1"
81.72 +lemma real_mult_inv_right1: "(x::real) \<noteq> Numeral0 \<Longrightarrow> x * inverse x = Numeral1"
81.73 by simp
81.74
81.75 -lemma real_mult_inv_left1: "(x::real) \<noteq> #0 \<Longrightarrow> inverse x * x = #1"
81.76 +lemma real_mult_inv_left1: "(x::real) \<noteq> Numeral0 \<Longrightarrow> inverse x * x = Numeral1"
81.77 by simp
81.78
81.79 lemma real_le_mult_order1a:
81.80 - "(#0::real) \<le> x \<Longrightarrow> #0 \<le> y \<Longrightarrow> #0 \<le> x * y"
81.81 + "(Numeral0::real) \<le> x \<Longrightarrow> Numeral0 \<le> y \<Longrightarrow> Numeral0 \<le> x * y"
81.82 by (simp add: real_0_le_mult_iff)
81.83
81.84 lemma real_mult_diff_distrib:
82.1 --- a/src/HOL/Real/HahnBanach/FunctionNorm.thy Fri Oct 05 21:50:37 2001 +0200
82.2 +++ b/src/HOL/Real/HahnBanach/FunctionNorm.thy Fri Oct 05 21:52:39 2001 +0200
82.3 @@ -73,7 +73,7 @@
82.4 constdefs
82.5 B :: "'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> ('a::{plus, minus, zero} \<Rightarrow> real) \<Rightarrow> real set"
82.6 "B V norm f \<equiv>
82.7 - {#0} \<union> {\<bar>f x\<bar> * inverse (norm x) | x. x \<noteq> 0 \<and> x \<in> V}"
82.8 + {Numeral0} \<union> {\<bar>f x\<bar> * inverse (norm x) | x. x \<noteq> 0 \<and> x \<in> V}"
82.9
82.10 text {*
82.11 @{text n} is the function norm of @{text f}, iff @{text n} is the
82.12 @@ -97,7 +97,7 @@
82.13 syntax
82.14 function_norm :: "('a \<Rightarrow> real) \<Rightarrow> 'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> real" ("\<parallel>_\<parallel>_,_")
82.15
82.16 -lemma B_not_empty: "#0 \<in> B V norm f"
82.17 +lemma B_not_empty: "Numeral0 \<in> B V norm f"
82.18 by (unfold B_def) blast
82.19
82.20 text {*
82.21 @@ -125,7 +125,7 @@
82.22
82.23 show "\<exists>X. X \<in> B V norm f"
82.24 proof
82.25 - show "#0 \<in> (B V norm f)" by (unfold B_def) blast
82.26 + show "Numeral0 \<in> (B V norm f)" by (unfold B_def) blast
82.27 qed
82.28
82.29 txt {* Then we have to show that @{text B} is bounded: *}
82.30 @@ -136,7 +136,7 @@
82.31 txt {* We know that @{text f} is bounded by some value @{text c}. *}
82.32
82.33 fix c assume a: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x"
82.34 - def b \<equiv> "max c #0"
82.35 + def b \<equiv> "max c Numeral0"
82.36
82.37 show "?thesis"
82.38 proof (intro exI isUbI setleI ballI, unfold B_def,
82.39 @@ -148,7 +148,7 @@
82.40 two cases for @{text "y \<in> B"}. If @{text "y = 0"} then
82.41 @{text "y \<le> max c 0"}: *}
82.42
82.43 - fix y assume "y = (#0::real)"
82.44 + fix y assume "y = (Numeral0::real)"
82.45 show "y \<le> b" by (simp! add: le_maxI2)
82.46
82.47 txt {* The second case is @{text "y = \<bar>f x\<bar> / \<parallel>x\<parallel>"} for some
82.48 @@ -164,16 +164,16 @@
82.49 assume "y = \<bar>f x\<bar> * inverse (norm x)"
82.50 also have "... \<le> c * norm x * inverse (norm x)"
82.51 proof (rule real_mult_le_le_mono2)
82.52 - show "#0 \<le> inverse (norm x)"
82.53 + show "Numeral0 \<le> inverse (norm x)"
82.54 by (rule order_less_imp_le, rule real_inverse_gt_zero1,
82.55 rule normed_vs_norm_gt_zero)
82.56 from a show "\<bar>f x\<bar> \<le> c * norm x" ..
82.57 qed
82.58 also have "... = c * (norm x * inverse (norm x))"
82.59 by (rule real_mult_assoc)
82.60 - also have "(norm x * inverse (norm x)) = (#1::real)"
82.61 + also have "(norm x * inverse (norm x)) = (Numeral1::real)"
82.62 proof (rule real_mult_inv_right1)
82.63 - show nz: "norm x \<noteq> #0"
82.64 + show nz: "norm x \<noteq> Numeral0"
82.65 by (rule not_sym, rule lt_imp_not_eq,
82.66 rule normed_vs_norm_gt_zero)
82.67 qed
82.68 @@ -188,7 +188,7 @@
82.69
82.70 lemma fnorm_ge_zero [intro?]:
82.71 "is_continuous V norm f \<Longrightarrow> is_normed_vectorspace V norm
82.72 - \<Longrightarrow> #0 \<le> \<parallel>f\<parallel>V,norm"
82.73 + \<Longrightarrow> Numeral0 \<le> \<parallel>f\<parallel>V,norm"
82.74 proof -
82.75 assume c: "is_continuous V norm f"
82.76 and n: "is_normed_vectorspace V norm"
82.77 @@ -200,23 +200,23 @@
82.78
82.79 show ?thesis
82.80 proof (unfold function_norm_def, rule sup_ub1)
82.81 - show "\<forall>x \<in> (B V norm f). #0 \<le> x"
82.82 + show "\<forall>x \<in> (B V norm f). Numeral0 \<le> x"
82.83 proof (intro ballI, unfold B_def,
82.84 elim UnE singletonE CollectE exE conjE)
82.85 fix x r
82.86 assume "x \<in> V" "x \<noteq> 0"
82.87 and r: "r = \<bar>f x\<bar> * inverse (norm x)"
82.88
82.89 - have ge: "#0 \<le> \<bar>f x\<bar>" by (simp! only: abs_ge_zero)
82.90 - have "#0 \<le> inverse (norm x)"
82.91 + have ge: "Numeral0 \<le> \<bar>f x\<bar>" by (simp! only: abs_ge_zero)
82.92 + have "Numeral0 \<le> inverse (norm x)"
82.93 by (rule order_less_imp_le, rule real_inverse_gt_zero1, rule)(***
82.94 proof (rule order_less_imp_le);
82.95 - show "#0 < inverse (norm x)";
82.96 + show "Numeral0 < inverse (norm x)";
82.97 proof (rule real_inverse_gt_zero);
82.98 - show "#0 < norm x"; ..;
82.99 + show "Numeral0 < norm x"; ..;
82.100 qed;
82.101 qed; ***)
82.102 - with ge show "#0 \<le> r"
82.103 + with ge show "Numeral0 \<le> r"
82.104 by (simp only: r, rule real_le_mult_order1a)
82.105 qed (simp!)
82.106
82.107 @@ -228,7 +228,7 @@
82.108
82.109 txt {* @{text B} is non-empty by construction: *}
82.110
82.111 - show "#0 \<in> B V norm f" by (rule B_not_empty)
82.112 + show "Numeral0 \<in> B V norm f" by (rule B_not_empty)
82.113 qed
82.114 qed
82.115
82.116 @@ -258,20 +258,20 @@
82.117
82.118 assume "x = 0"
82.119 have "\<bar>f x\<bar> = \<bar>f 0\<bar>" by (simp!)
82.120 - also from v continuous_linearform have "f 0 = #0" ..
82.121 + also from v continuous_linearform have "f 0 = Numeral0" ..
82.122 also note abs_zero
82.123 - also have "#0 \<le> \<parallel>f\<parallel>V,norm * norm x"
82.124 + also have "Numeral0 \<le> \<parallel>f\<parallel>V,norm * norm x"
82.125 proof (rule real_le_mult_order1a)
82.126 - show "#0 \<le> \<parallel>f\<parallel>V,norm" ..
82.127 - show "#0 \<le> norm x" ..
82.128 + show "Numeral0 \<le> \<parallel>f\<parallel>V,norm" ..
82.129 + show "Numeral0 \<le> norm x" ..
82.130 qed
82.131 finally
82.132 show "\<bar>f x\<bar> \<le> \<parallel>f\<parallel>V,norm * norm x" .
82.133
82.134 next
82.135 assume "x \<noteq> 0"
82.136 - have n: "#0 < norm x" ..
82.137 - hence nz: "norm x \<noteq> #0"
82.138 + have n: "Numeral0 < norm x" ..
82.139 + hence nz: "norm x \<noteq> Numeral0"
82.140 by (simp only: lt_imp_not_eq)
82.141
82.142 txt {* For the case @{text "x \<noteq> 0"} we derive the following fact
82.143 @@ -289,8 +289,8 @@
82.144
82.145 txt {* The thesis now follows by a short calculation: *}
82.146
82.147 - have "\<bar>f x\<bar> = \<bar>f x\<bar> * #1" by (simp!)
82.148 - also from nz have "#1 = inverse (norm x) * norm x"
82.149 + have "\<bar>f x\<bar> = \<bar>f x\<bar> * Numeral1" by (simp!)
82.150 + also from nz have "Numeral1 = inverse (norm x) * norm x"
82.151 by (simp add: real_mult_inv_left1)
82.152 also have "\<bar>f x\<bar> * ... = \<bar>f x\<bar> * inverse (norm x) * norm x"
82.153 by (simp! add: real_mult_assoc)
82.154 @@ -310,13 +310,13 @@
82.155
82.156 lemma fnorm_le_ub:
82.157 "is_continuous V norm f \<Longrightarrow> is_normed_vectorspace V norm \<Longrightarrow>
82.158 - \<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x \<Longrightarrow> #0 \<le> c
82.159 + \<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x \<Longrightarrow> Numeral0 \<le> c
82.160 \<Longrightarrow> \<parallel>f\<parallel>V,norm \<le> c"
82.161 proof (unfold function_norm_def)
82.162 assume "is_normed_vectorspace V norm"
82.163 assume c: "is_continuous V norm f"
82.164 assume fb: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x"
82.165 - and "#0 \<le> c"
82.166 + and "Numeral0 \<le> c"
82.167
82.168 txt {* Suppose the inequation holds for some @{text "c \<ge> 0"}. If
82.169 @{text c} is an upper bound of @{text B}, then @{text c} is greater
82.170 @@ -340,7 +340,7 @@
82.171
82.172 txt {* The first case for @{text "y \<in> B"} is @{text "y = 0"}. *}
82.173
82.174 - assume "y = #0"
82.175 + assume "y = Numeral0"
82.176 show "y \<le> c" by (blast!)
82.177
82.178 txt{* The second case is @{text "y = \<bar>f x\<bar> / \<parallel>x\<parallel>"} for some
82.179 @@ -350,18 +350,18 @@
82.180 fix x
82.181 assume "x \<in> V" "x \<noteq> 0"
82.182
82.183 - have lz: "#0 < norm x"
82.184 + have lz: "Numeral0 < norm x"
82.185 by (simp! add: normed_vs_norm_gt_zero)
82.186
82.187 - have nz: "norm x \<noteq> #0"
82.188 + have nz: "norm x \<noteq> Numeral0"
82.189 proof (rule not_sym)
82.190 - from lz show "#0 \<noteq> norm x"
82.191 + from lz show "Numeral0 \<noteq> norm x"
82.192 by (simp! add: order_less_imp_not_eq)
82.193 qed
82.194
82.195 - from lz have "#0 < inverse (norm x)"
82.196 + from lz have "Numeral0 < inverse (norm x)"
82.197 by (simp! add: real_inverse_gt_zero1)
82.198 - hence inverse_gez: "#0 \<le> inverse (norm x)"
82.199 + hence inverse_gez: "Numeral0 \<le> inverse (norm x)"
82.200 by (rule order_less_imp_le)
82.201
82.202 assume "y = \<bar>f x\<bar> * inverse (norm x)"
83.1 --- a/src/HOL/Real/HahnBanach/HahnBanach.thy Fri Oct 05 21:50:37 2001 +0200
83.2 +++ b/src/HOL/Real/HahnBanach/HahnBanach.thy Fri Oct 05 21:52:39 2001 +0200
83.3 @@ -201,7 +201,7 @@
83.4 proof (rule graph_extI)
83.5 fix t assume "t \<in> H"
83.6 have "(SOME (y, a). t = y + a \<cdot> x' \<and> y \<in> H)
83.7 - = (t, #0)"
83.8 + = (t, Numeral0)"
83.9 by (rule decomp_H'_H) (assumption+, rule x')
83.10 thus "h t = h' t" by (simp! add: Let_def)
83.11 next
83.12 @@ -255,12 +255,12 @@
83.13 proof (rule graph_extI)
83.14 fix x assume "x \<in> F"
83.15 have "f x = h x" ..
83.16 - also have " ... = h x + #0 * xi" by simp
83.17 + also have " ... = h x + Numeral0 * xi" by simp
83.18 also
83.19 - have "... = (let (y, a) = (x, #0) in h y + a * xi)"
83.20 + have "... = (let (y, a) = (x, Numeral0) in h y + a * xi)"
83.21 by (simp add: Let_def)
83.22 also have
83.23 - "(x, #0) = (SOME (y, a). x = y + a \<cdot> x' \<and> y \<in> H)"
83.24 + "(x, Numeral0) = (SOME (y, a). x = y + a \<cdot> x' \<and> y \<in> H)"
83.25 by (rule decomp_H'_H [symmetric]) (simp! add: x')+
83.26 also have
83.27 "(let (y, a) = (SOME (y, a). x = y + a \<cdot> x' \<and> y \<in> H)
83.28 @@ -372,10 +372,10 @@
83.29
83.30 txt {* @{text p} is positive definite: *}
83.31
83.32 -show "#0 \<le> p x"
83.33 +show "Numeral0 \<le> p x"
83.34 proof (unfold p_def, rule real_le_mult_order1a)
83.35 - from f_cont f_norm show "#0 \<le> \<parallel>f\<parallel>F,norm" ..
83.36 - show "#0 \<le> norm x" ..
83.37 + from f_cont f_norm show "Numeral0 \<le> \<parallel>f\<parallel>F,norm" ..
83.38 + show "Numeral0 \<le> norm x" ..
83.39 qed
83.40
83.41 txt {* @{text p} is absolutely homogenous: *}
83.42 @@ -402,7 +402,7 @@
83.43 also
83.44 have "... \<le> \<parallel>f\<parallel>F,norm * (norm x + norm y)"
83.45 proof (rule real_mult_le_le_mono1a)
83.46 - from f_cont f_norm show "#0 \<le> \<parallel>f\<parallel>F,norm" ..
83.47 + from f_cont f_norm show "Numeral0 \<le> \<parallel>f\<parallel>F,norm" ..
83.48 show "norm (x + y) \<le> norm x + norm y" ..
83.49 qed
83.50 also have "... = \<parallel>f\<parallel>F,norm * norm x
83.51 @@ -489,7 +489,7 @@
83.52
83.53 with g_cont e_norm show "?L \<le> ?R"
83.54 proof (rule fnorm_le_ub)
83.55 - from f_cont f_norm show "#0 \<le> \<parallel>f\<parallel>F,norm" ..
83.56 + from f_cont f_norm show "Numeral0 \<le> \<parallel>f\<parallel>F,norm" ..
83.57 qed
83.58
83.59 txt{* The other direction is achieved by a similar
83.60 @@ -509,7 +509,7 @@
83.61 qed
83.62 thus "?R \<le> ?L"
83.63 proof (rule fnorm_le_ub [OF f_cont f_norm])
83.64 - from g_cont show "#0 \<le> \<parallel>g\<parallel>E,norm" ..
83.65 + from g_cont show "Numeral0 \<le> \<parallel>g\<parallel>E,norm" ..
83.66 qed
83.67 qed
83.68 qed
84.1 --- a/src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy Fri Oct 05 21:50:37 2001 +0200
84.2 +++ b/src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy Fri Oct 05 21:52:39 2001 +0200
84.3 @@ -279,14 +279,14 @@
84.4 also have "... \<le> p (y + a \<cdot> x0)"
84.5 proof (rule linorder_cases)
84.6
84.7 - assume z: "a = #0"
84.8 + assume z: "a = Numeral0"
84.9 with vs y a show ?thesis by simp
84.10
84.11 txt {* In the case @{text "a < 0"}, we use @{text "a\<^sub>1"}
84.12 with @{text ya} taken as @{text "y / a"}: *}
84.13
84.14 next
84.15 - assume lz: "a < #0" hence nz: "a \<noteq> #0" by simp
84.16 + assume lz: "a < Numeral0" hence nz: "a \<noteq> Numeral0" by simp
84.17 from a1
84.18 have "- p (inverse a \<cdot> y + x0) - h (inverse a \<cdot> y) \<le> xi"
84.19 by (rule bspec) (simp!)
84.20 @@ -315,7 +315,7 @@
84.21 with @{text ya} taken as @{text "y / a"}: *}
84.22
84.23 next
84.24 - assume gz: "#0 < a" hence nz: "a \<noteq> #0" by simp
84.25 + assume gz: "Numeral0 < a" hence nz: "a \<noteq> Numeral0" by simp
84.26 from a2 have "xi \<le> p (inverse a \<cdot> y + x0) - h (inverse a \<cdot> y)"
84.27 by (rule bspec) (simp!)
84.28
85.1 --- a/src/HOL/Real/HahnBanach/Linearform.thy Fri Oct 05 21:50:37 2001 +0200
85.2 +++ b/src/HOL/Real/HahnBanach/Linearform.thy Fri Oct 05 21:52:39 2001 +0200
85.3 @@ -37,8 +37,8 @@
85.4 \<Longrightarrow> f (- x) = - f x"
85.5 proof -
85.6 assume "is_linearform V f" "is_vectorspace V" "x \<in> V"
85.7 - have "f (- x) = f ((- #1) \<cdot> x)" by (simp! add: negate_eq1)
85.8 - also have "... = (- #1) * (f x)" by (rule linearform_mult)
85.9 + have "f (- x) = f ((- Numeral1) \<cdot> x)" by (simp! add: negate_eq1)
85.10 + also have "... = (- Numeral1) * (f x)" by (rule linearform_mult)
85.11 also have "... = - (f x)" by (simp!)
85.12 finally show ?thesis .
85.13 qed
85.14 @@ -58,14 +58,14 @@
85.15 text {* Every linear form yields @{text 0} for the @{text 0} vector. *}
85.16
85.17 lemma linearform_zero [intro?, simp]:
85.18 - "is_vectorspace V \<Longrightarrow> is_linearform V f \<Longrightarrow> f 0 = #0"
85.19 + "is_vectorspace V \<Longrightarrow> is_linearform V f \<Longrightarrow> f 0 = Numeral0"
85.20 proof -
85.21 assume "is_vectorspace V" "is_linearform V f"
85.22 have "f 0 = f (0 - 0)" by (simp!)
85.23 also have "... = f 0 - f 0"
85.24 by (rule linearform_diff) (simp!)+
85.25 - also have "... = #0" by simp
85.26 - finally show "f 0 = #0" .
85.27 + also have "... = Numeral0" by simp
85.28 + finally show "f 0 = Numeral0" .
85.29 qed
85.30
85.31 end
86.1 --- a/src/HOL/Real/HahnBanach/NormedSpace.thy Fri Oct 05 21:50:37 2001 +0200
86.2 +++ b/src/HOL/Real/HahnBanach/NormedSpace.thy Fri Oct 05 21:52:39 2001 +0200
86.3 @@ -18,19 +18,19 @@
86.4 constdefs
86.5 is_seminorm :: "'a::{plus, minus, zero} set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> bool"
86.6 "is_seminorm V norm \<equiv> \<forall>x \<in> V. \<forall>y \<in> V. \<forall>a.
86.7 - #0 \<le> norm x
86.8 + Numeral0 \<le> norm x
86.9 \<and> norm (a \<cdot> x) = \<bar>a\<bar> * norm x
86.10 \<and> norm (x + y) \<le> norm x + norm y"
86.11
86.12 lemma is_seminormI [intro]:
86.13 - "(\<And>x y a. x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> #0 \<le> norm x) \<Longrightarrow>
86.14 + "(\<And>x y a. x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> Numeral0 \<le> norm x) \<Longrightarrow>
86.15 (\<And>x a. x \<in> V \<Longrightarrow> norm (a \<cdot> x) = \<bar>a\<bar> * norm x) \<Longrightarrow>
86.16 (\<And>x y. x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> norm (x + y) \<le> norm x + norm y)
86.17 \<Longrightarrow> is_seminorm V norm"
86.18 by (unfold is_seminorm_def) auto
86.19
86.20 lemma seminorm_ge_zero [intro?]:
86.21 - "is_seminorm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> #0 \<le> norm x"
86.22 + "is_seminorm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral0 \<le> norm x"
86.23 by (unfold is_seminorm_def) blast
86.24
86.25 lemma seminorm_abs_homogenous:
86.26 @@ -48,13 +48,13 @@
86.27 \<Longrightarrow> norm (x - y) \<le> norm x + norm y"
86.28 proof -
86.29 assume "is_seminorm V norm" "x \<in> V" "y \<in> V" "is_vectorspace V"
86.30 - have "norm (x - y) = norm (x + - #1 \<cdot> y)"
86.31 + have "norm (x - y) = norm (x + - Numeral1 \<cdot> y)"
86.32 by (simp! add: diff_eq2 negate_eq2a)
86.33 - also have "... \<le> norm x + norm (- #1 \<cdot> y)"
86.34 + also have "... \<le> norm x + norm (- Numeral1 \<cdot> y)"
86.35 by (simp! add: seminorm_subadditive)
86.36 - also have "norm (- #1 \<cdot> y) = \<bar>- #1\<bar> * norm y"
86.37 + also have "norm (- Numeral1 \<cdot> y) = \<bar>- Numeral1\<bar> * norm y"
86.38 by (rule seminorm_abs_homogenous)
86.39 - also have "\<bar>- #1\<bar> = (#1::real)" by (rule abs_minus_one)
86.40 + also have "\<bar>- Numeral1\<bar> = (Numeral1::real)" by (rule abs_minus_one)
86.41 finally show "norm (x - y) \<le> norm x + norm y" by simp
86.42 qed
86.43
86.44 @@ -63,10 +63,10 @@
86.45 \<Longrightarrow> norm (- x) = norm x"
86.46 proof -
86.47 assume "is_seminorm V norm" "x \<in> V" "is_vectorspace V"
86.48 - have "norm (- x) = norm (- #1 \<cdot> x)" by (simp! only: negate_eq1)
86.49 - also have "... = \<bar>- #1\<bar> * norm x"
86.50 + have "norm (- x) = norm (- Numeral1 \<cdot> x)" by (simp! only: negate_eq1)
86.51 + also have "... = \<bar>- Numeral1\<bar> * norm x"
86.52 by (rule seminorm_abs_homogenous)
86.53 - also have "\<bar>- #1\<bar> = (#1::real)" by (rule abs_minus_one)
86.54 + also have "\<bar>- Numeral1\<bar> = (Numeral1::real)" by (rule abs_minus_one)
86.55 finally show "norm (- x) = norm x" by simp
86.56 qed
86.57
86.58 @@ -81,10 +81,10 @@
86.59 constdefs
86.60 is_norm :: "'a::{plus, minus, zero} set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> bool"
86.61 "is_norm V norm \<equiv> \<forall>x \<in> V. is_seminorm V norm
86.62 - \<and> (norm x = #0) = (x = 0)"
86.63 + \<and> (norm x = Numeral0) = (x = 0)"
86.64
86.65 lemma is_normI [intro]:
86.66 - "\<forall>x \<in> V. is_seminorm V norm \<and> (norm x = #0) = (x = 0)
86.67 + "\<forall>x \<in> V. is_seminorm V norm \<and> (norm x = Numeral0) = (x = 0)
86.68 \<Longrightarrow> is_norm V norm" by (simp only: is_norm_def)
86.69
86.70 lemma norm_is_seminorm [intro?]:
86.71 @@ -92,11 +92,11 @@
86.72 by (unfold is_norm_def) blast
86.73
86.74 lemma norm_zero_iff:
86.75 - "is_norm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> (norm x = #0) = (x = 0)"
86.76 + "is_norm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> (norm x = Numeral0) = (x = 0)"
86.77 by (unfold is_norm_def) blast
86.78
86.79 lemma norm_ge_zero [intro?]:
86.80 - "is_norm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> #0 \<le> norm x"
86.81 + "is_norm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral0 \<le> norm x"
86.82 by (unfold is_norm_def is_seminorm_def) blast
86.83
86.84
86.85 @@ -125,22 +125,22 @@
86.86 by (unfold is_normed_vectorspace_def) blast
86.87
86.88 lemma normed_vs_norm_ge_zero [intro?]:
86.89 - "is_normed_vectorspace V norm \<Longrightarrow> x \<in> V \<Longrightarrow> #0 \<le> norm x"
86.90 + "is_normed_vectorspace V norm \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral0 \<le> norm x"
86.91 by (unfold is_normed_vectorspace_def) (fast elim: norm_ge_zero)
86.92
86.93 lemma normed_vs_norm_gt_zero [intro?]:
86.94 - "is_normed_vectorspace V norm \<Longrightarrow> x \<in> V \<Longrightarrow> x \<noteq> 0 \<Longrightarrow> #0 < norm x"
86.95 + "is_normed_vectorspace V norm \<Longrightarrow> x \<in> V \<Longrightarrow> x \<noteq> 0 \<Longrightarrow> Numeral0 < norm x"
86.96 proof (unfold is_normed_vectorspace_def, elim conjE)
86.97 assume "x \<in> V" "x \<noteq> 0" "is_vectorspace V" "is_norm V norm"
86.98 - have "#0 \<le> norm x" ..
86.99 - also have "#0 \<noteq> norm x"
86.100 + have "Numeral0 \<le> norm x" ..
86.101 + also have "Numeral0 \<noteq> norm x"
86.102 proof
86.103 - presume "norm x = #0"
86.104 + presume "norm x = Numeral0"
86.105 also have "?this = (x = 0)" by (rule norm_zero_iff)
86.106 finally have "x = 0" .
86.107 thus "False" by contradiction
86.108 qed (rule sym)
86.109 - finally show "#0 < norm x" .
86.110 + finally show "Numeral0 < norm x" .
86.111 qed
86.112
86.113 lemma normed_vs_norm_abs_homogenous [intro?]:
86.114 @@ -170,14 +170,14 @@
86.115 show "is_seminorm F norm"
86.116 proof
86.117 fix x y a presume "x \<in> E"
86.118 - show "#0 \<le> norm x" ..
86.119 + show "Numeral0 \<le> norm x" ..
86.120 show "norm (a \<cdot> x) = \<bar>a\<bar> * norm x" ..
86.121 presume "y \<in> E"
86.122 show "norm (x + y) \<le> norm x + norm y" ..
86.123 qed (simp!)+
86.124
86.125 fix x assume "x \<in> F"
86.126 - show "(norm x = #0) = (x = 0)"
86.127 + show "(norm x = Numeral0) = (x = 0)"
86.128 proof (rule norm_zero_iff)
86.129 show "is_norm E norm" ..
86.130 qed (simp!)
87.1 --- a/src/HOL/Real/HahnBanach/Subspace.thy Fri Oct 05 21:50:37 2001 +0200
87.2 +++ b/src/HOL/Real/HahnBanach/Subspace.thy Fri Oct 05 21:52:39 2001 +0200
87.3 @@ -87,7 +87,7 @@
87.4 show "0 \<in> U" ..
87.5 show "\<forall>x \<in> U. \<forall>a. a \<cdot> x \<in> U" by (simp!)
87.6 show "\<forall>x \<in> U. \<forall>y \<in> U. x + y \<in> U" by (simp!)
87.7 - show "\<forall>x \<in> U. - x = -#1 \<cdot> x" by (simp! add: negate_eq1)
87.8 + show "\<forall>x \<in> U. - x = -Numeral1 \<cdot> x" by (simp! add: negate_eq1)
87.9 show "\<forall>x \<in> U. \<forall>y \<in> U. x - y = x + - y"
87.10 by (simp! add: diff_eq1)
87.11 qed (simp! add: vs_add_mult_distrib1 vs_add_mult_distrib2)+
87.12 @@ -154,7 +154,7 @@
87.13 lemma x_lin_x: "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> x \<in> lin x"
87.14 proof (unfold lin_def, intro CollectI exI conjI)
87.15 assume "is_vectorspace V" "x \<in> V"
87.16 - show "x = #1 \<cdot> x" by (simp!)
87.17 + show "x = Numeral1 \<cdot> x" by (simp!)
87.18 qed simp
87.19
87.20 text {* Any linear closure is a subspace. *}
87.21 @@ -165,7 +165,7 @@
87.22 assume "is_vectorspace V" "x \<in> V"
87.23 show "0 \<in> lin x"
87.24 proof (unfold lin_def, intro CollectI exI conjI)
87.25 - show "0 = (#0::real) \<cdot> x" by (simp!)
87.26 + show "0 = (Numeral0::real) \<cdot> x" by (simp!)
87.27 qed simp
87.28
87.29 show "lin x \<subseteq> V"
87.30 @@ -383,9 +383,9 @@
87.31 fix a assume "x = a \<cdot> x'"
87.32 show ?thesis
87.33 proof cases
87.34 - assume "a = (#0::real)" show ?thesis by (simp!)
87.35 + assume "a = (Numeral0::real)" show ?thesis by (simp!)
87.36 next
87.37 - assume "a \<noteq> (#0::real)"
87.38 + assume "a \<noteq> (Numeral0::real)"
87.39 from h have "inverse a \<cdot> a \<cdot> x' \<in> H"
87.40 by (rule subspace_mult_closed) (simp!)
87.41 also have "inverse a \<cdot> a \<cdot> x' = x'" by (simp!)
87.42 @@ -425,15 +425,15 @@
87.43 lemma decomp_H'_H:
87.44 "is_vectorspace E \<Longrightarrow> is_subspace H E \<Longrightarrow> t \<in> H \<Longrightarrow> x' \<notin> H \<Longrightarrow> x' \<in> E
87.45 \<Longrightarrow> x' \<noteq> 0
87.46 - \<Longrightarrow> (SOME (y, a). t = y + a \<cdot> x' \<and> y \<in> H) = (t, (#0::real))"
87.47 + \<Longrightarrow> (SOME (y, a). t = y + a \<cdot> x' \<and> y \<in> H) = (t, (Numeral0::real))"
87.48 proof (rule, unfold split_tupled_all)
87.49 assume "is_vectorspace E" "is_subspace H E" "t \<in> H" "x' \<notin> H" "x' \<in> E"
87.50 "x' \<noteq> 0"
87.51 have h: "is_vectorspace H" ..
87.52 fix y a presume t1: "t = y + a \<cdot> x'" and "y \<in> H"
87.53 - have "y = t \<and> a = (#0::real)"
87.54 + have "y = t \<and> a = (Numeral0::real)"
87.55 by (rule decomp_H') (auto!)
87.56 - thus "(y, a) = (t, (#0::real))" by (simp!)
87.57 + thus "(y, a) = (t, (Numeral0::real))" by (simp!)
87.58 qed (simp_all!)
87.59
87.60 text {*
88.1 --- a/src/HOL/Real/HahnBanach/VectorSpace.thy Fri Oct 05 21:50:37 2001 +0200
88.2 +++ b/src/HOL/Real/HahnBanach/VectorSpace.thy Fri Oct 05 21:52:39 2001 +0200
88.3 @@ -31,7 +31,7 @@
88.4 associative and commutative; @{text "- x"} is the inverse of @{text
88.5 x} w.~r.~t.~addition and @{text 0} is the neutral element of
88.6 addition. Addition and multiplication are distributive; scalar
88.7 - multiplication is associative and the real number @{text "#1"} is
88.8 + multiplication is associative and the real number @{text "Numeral1"} is
88.9 the neutral element of scalar multiplication.
88.10 *}
88.11
88.12 @@ -48,8 +48,8 @@
88.13 \<and> a \<cdot> (x + y) = a \<cdot> x + a \<cdot> y
88.14 \<and> (a + b) \<cdot> x = a \<cdot> x + b \<cdot> x
88.15 \<and> (a * b) \<cdot> x = a \<cdot> b \<cdot> x
88.16 - \<and> #1 \<cdot> x = x
88.17 - \<and> - x = (- #1) \<cdot> x
88.18 + \<and> Numeral1 \<cdot> x = x
88.19 + \<and> - x = (- Numeral1) \<cdot> x
88.20 \<and> x - y = x + - y)"
88.21
88.22
88.23 @@ -66,15 +66,15 @@
88.24 \<forall>x \<in> V. \<forall>y \<in> V. \<forall>a. a \<cdot> (x + y) = a \<cdot> x + a \<cdot> y \<Longrightarrow>
88.25 \<forall>x \<in> V. \<forall>a b. (a + b) \<cdot> x = a \<cdot> x + b \<cdot> x \<Longrightarrow>
88.26 \<forall>x \<in> V. \<forall>a b. (a * b) \<cdot> x = a \<cdot> b \<cdot> x \<Longrightarrow>
88.27 - \<forall>x \<in> V. #1 \<cdot> x = x \<Longrightarrow>
88.28 - \<forall>x \<in> V. - x = (- #1) \<cdot> x \<Longrightarrow>
88.29 + \<forall>x \<in> V. Numeral1 \<cdot> x = x \<Longrightarrow>
88.30 + \<forall>x \<in> V. - x = (- Numeral1) \<cdot> x \<Longrightarrow>
88.31 \<forall>x \<in> V. \<forall>y \<in> V. x - y = x + - y \<Longrightarrow> is_vectorspace V"
88.32 by (unfold is_vectorspace_def) auto
88.33
88.34 text {* \medskip The corresponding destruction rules are: *}
88.35
88.36 lemma negate_eq1:
88.37 - "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> - x = (- #1) \<cdot> x"
88.38 + "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> - x = (- Numeral1) \<cdot> x"
88.39 by (unfold is_vectorspace_def) simp
88.40
88.41 lemma diff_eq1:
88.42 @@ -82,11 +82,11 @@
88.43 by (unfold is_vectorspace_def) simp
88.44
88.45 lemma negate_eq2:
88.46 - "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> (- #1) \<cdot> x = - x"
88.47 + "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> (- Numeral1) \<cdot> x = - x"
88.48 by (unfold is_vectorspace_def) simp
88.49
88.50 lemma negate_eq2a:
88.51 - "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> #-1 \<cdot> x = - x"
88.52 + "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> # -1 \<cdot> x = - x"
88.53 by (unfold is_vectorspace_def) simp
88.54
88.55 lemma diff_eq2:
88.56 @@ -184,7 +184,7 @@
88.57 by (simp only: vs_mult_assoc)
88.58
88.59 lemma vs_mult_1 [simp]:
88.60 - "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> #1 \<cdot> x = x"
88.61 + "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral1 \<cdot> x = x"
88.62 by (unfold is_vectorspace_def) simp
88.63
88.64 lemma vs_diff_mult_distrib1:
88.65 @@ -212,14 +212,14 @@
88.66 text {* \medskip Further derived laws: *}
88.67
88.68 lemma vs_mult_zero_left [simp]:
88.69 - "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> #0 \<cdot> x = 0"
88.70 + "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral0 \<cdot> x = 0"
88.71 proof -
88.72 assume "is_vectorspace V" "x \<in> V"
88.73 - have "#0 \<cdot> x = (#1 - #1) \<cdot> x" by simp
88.74 - also have "... = (#1 + - #1) \<cdot> x" by simp
88.75 - also have "... = #1 \<cdot> x + (- #1) \<cdot> x"
88.76 + have "Numeral0 \<cdot> x = (Numeral1 - Numeral1) \<cdot> x" by simp
88.77 + also have "... = (Numeral1 + - Numeral1) \<cdot> x" by simp
88.78 + also have "... = Numeral1 \<cdot> x + (- Numeral1) \<cdot> x"
88.79 by (rule vs_add_mult_distrib2)
88.80 - also have "... = x + (- #1) \<cdot> x" by (simp!)
88.81 + also have "... = x + (- Numeral1) \<cdot> x" by (simp!)
88.82 also have "... = x + - x" by (simp! add: negate_eq2a)
88.83 also have "... = x - x" by (simp! add: diff_eq2)
88.84 also have "... = 0" by (simp!)
88.85 @@ -349,12 +349,12 @@
88.86 qed
88.87
88.88 lemma vs_mult_left_cancel:
88.89 - "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> a \<noteq> #0 \<Longrightarrow>
88.90 + "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> a \<noteq> Numeral0 \<Longrightarrow>
88.91 (a \<cdot> x = a \<cdot> y) = (x = y)"
88.92 (concl is "?L = ?R")
88.93 proof
88.94 - assume "is_vectorspace V" "x \<in> V" "y \<in> V" "a \<noteq> #0"
88.95 - have "x = #1 \<cdot> x" by (simp!)
88.96 + assume "is_vectorspace V" "x \<in> V" "y \<in> V" "a \<noteq> Numeral0"
88.97 + have "x = Numeral1 \<cdot> x" by (simp!)
88.98 also have "... = (inverse a * a) \<cdot> x" by (simp!)
88.99 also have "... = inverse a \<cdot> (a \<cdot> x)"
88.100 by (simp! only: vs_mult_assoc)
89.1 --- a/src/HOL/Real/PNat.ML Fri Oct 05 21:50:37 2001 +0200
89.2 +++ b/src/HOL/Real/PNat.ML Fri Oct 05 21:52:39 2001 +0200
89.3 @@ -6,13 +6,13 @@
89.4 The positive naturals -- proofs mainly as in theory Nat.
89.5 *)
89.6
89.7 -Goal "mono(%X. {1'} Un Suc`X)";
89.8 +Goal "mono(%X. {Suc 0} Un Suc`X)";
89.9 by (REPEAT (ares_tac [monoI, subset_refl, image_mono, Un_mono] 1));
89.10 qed "pnat_fun_mono";
89.11
89.12 bind_thm ("pnat_unfold", pnat_fun_mono RS (pnat_def RS def_lfp_unfold));
89.13
89.14 -Goal "1' : pnat";
89.15 +Goal "Suc 0 : pnat";
89.16 by (stac pnat_unfold 1);
89.17 by (rtac (singletonI RS UnI1) 1);
89.18 qed "one_RepI";
89.19 @@ -24,14 +24,14 @@
89.20 by (etac (imageI RS UnI2) 1);
89.21 qed "pnat_Suc_RepI";
89.22
89.23 -Goal "2 : pnat";
89.24 +Goal "Suc (Suc 0) : pnat";
89.25 by (rtac (one_RepI RS pnat_Suc_RepI) 1);
89.26 qed "two_RepI";
89.27
89.28 (*** Induction ***)
89.29
89.30 val major::prems = Goal
89.31 - "[| i: pnat; P(1'); \
89.32 + "[| i: pnat; P(Suc 0); \
89.33 \ !!j. [| j: pnat; P(j) |] ==> P(Suc(j)) |] ==> P(i)";
89.34 by (rtac ([pnat_def, pnat_fun_mono, major] MRS def_lfp_induct) 1);
89.35 by (blast_tac (claset() addIs prems) 1);
89.36 @@ -250,7 +250,7 @@
89.37 (*** Rep_pnat < 0 ==> P ***)
89.38 bind_thm ("Rep_pnat_less_zeroE",Rep_pnat_not_less0 RS notE);
89.39
89.40 -Goal "~ Rep_pnat y < 1'";
89.41 +Goal "~ Rep_pnat y < Suc 0";
89.42 by (auto_tac (claset(),simpset() addsimps [less_Suc_eq,
89.43 Rep_pnat_gt_zero,less_not_refl2]));
89.44 qed "Rep_pnat_not_less_one";
89.45 @@ -259,7 +259,7 @@
89.46 bind_thm ("Rep_pnat_less_oneE",Rep_pnat_not_less_one RS notE);
89.47
89.48 Goalw [pnat_less_def]
89.49 - "x < (y::pnat) ==> Rep_pnat y ~= 1'";
89.50 + "x < (y::pnat) ==> Rep_pnat y ~= Suc 0";
89.51 by (auto_tac (claset(),simpset()
89.52 addsimps [Rep_pnat_not_less_one] delsimps [less_one]));
89.53 qed "Rep_pnat_gt_implies_not0";
89.54 @@ -270,7 +270,7 @@
89.55 by (fast_tac (claset() addIs [inj_Rep_pnat RS injD]) 1);
89.56 qed "pnat_less_linear";
89.57
89.58 -Goalw [le_def] "1' <= Rep_pnat x";
89.59 +Goalw [le_def] "Suc 0 <= Rep_pnat x";
89.60 by (rtac Rep_pnat_not_less_one 1);
89.61 qed "Rep_pnat_le_one";
89.62
89.63 @@ -416,12 +416,12 @@
89.64 Abs_pnat_inverse,mult_left_commute]) 1);
89.65 qed "pnat_mult_left_commute";
89.66
89.67 -Goalw [pnat_mult_def] "x * (Abs_pnat 1') = x";
89.68 +Goalw [pnat_mult_def] "x * (Abs_pnat (Suc 0)) = x";
89.69 by (full_simp_tac (simpset() addsimps [one_RepI RS Abs_pnat_inverse,
89.70 Rep_pnat_inverse]) 1);
89.71 qed "pnat_mult_1";
89.72
89.73 -Goal "Abs_pnat 1' * x = x";
89.74 +Goal "Abs_pnat (Suc 0) * x = x";
89.75 by (full_simp_tac (simpset() addsimps [pnat_mult_1,
89.76 pnat_mult_commute]) 1);
89.77 qed "pnat_mult_1_left";
89.78 @@ -503,11 +503,11 @@
89.79 by (auto_tac (claset() addSIs [gt_0_mem_pnat],simpset()));
89.80 qed "inj_pnat_of_nat";
89.81
89.82 -Goal "0 < n + 1";
89.83 +Goal "0 < n + (1::nat)";
89.84 by Auto_tac;
89.85 qed "nat_add_one_less";
89.86
89.87 -Goal "0 < n1 + n2 + 1";
89.88 +Goal "0 < n1 + n2 + (1::nat)";
89.89 by Auto_tac;
89.90 qed "nat_add_one_less1";
89.91
90.1 --- a/src/HOL/Real/PNat.thy Fri Oct 05 21:50:37 2001 +0200
90.2 +++ b/src/HOL/Real/PNat.thy Fri Oct 05 21:52:39 2001 +0200
90.3 @@ -9,7 +9,7 @@
90.4 PNat = Main +
90.5
90.6 typedef
90.7 - pnat = "lfp(%X. {1'} Un Suc`X)" (lfp_def)
90.8 + pnat = "lfp(%X. {Suc 0} Un Suc`X)" (lfp_def)
90.9
90.10 instance
90.11 pnat :: {ord, plus, times}
90.12 @@ -27,7 +27,7 @@
90.13 defs
90.14
90.15 pnat_one_def
90.16 - "1p == Abs_pnat(1')"
90.17 + "1p == Abs_pnat(Suc 0)"
90.18 pnat_Suc_def
90.19 "pSuc == (%n. Abs_pnat(Suc(Rep_pnat(n))))"
90.20
91.1 --- a/src/HOL/Real/PRat.ML Fri Oct 05 21:50:37 2001 +0200
91.2 +++ b/src/HOL/Real/PRat.ML Fri Oct 05 21:52:39 2001 +0200
91.3 @@ -128,7 +128,7 @@
91.4 qed "inj_qinv";
91.5
91.6 Goalw [prat_of_pnat_def]
91.7 - "qinv(prat_of_pnat (Abs_pnat 1')) = prat_of_pnat (Abs_pnat 1')";
91.8 + "qinv(prat_of_pnat (Abs_pnat (Suc 0))) = prat_of_pnat (Abs_pnat (Suc 0))";
91.9 by (simp_tac (simpset() addsimps [qinv]) 1);
91.10 qed "qinv_1";
91.11
91.12 @@ -232,13 +232,13 @@
91.13 prat_mult_commute,prat_mult_left_commute]);
91.14
91.15 Goalw [prat_of_pnat_def]
91.16 - "(prat_of_pnat (Abs_pnat 1')) * z = z";
91.17 + "(prat_of_pnat (Abs_pnat (Suc 0))) * z = z";
91.18 by (res_inst_tac [("z","z")] eq_Abs_prat 1);
91.19 by (asm_full_simp_tac (simpset() addsimps [prat_mult] @ pnat_mult_ac) 1);
91.20 qed "prat_mult_1";
91.21
91.22 Goalw [prat_of_pnat_def]
91.23 - "z * (prat_of_pnat (Abs_pnat 1')) = z";
91.24 + "z * (prat_of_pnat (Abs_pnat (Suc 0))) = z";
91.25 by (res_inst_tac [("z","z")] eq_Abs_prat 1);
91.26 by (asm_full_simp_tac (simpset() addsimps [prat_mult] @ pnat_mult_ac) 1);
91.27 qed "prat_mult_1_right";
91.28 @@ -259,22 +259,22 @@
91.29 (*** prat_mult and qinv ***)
91.30
91.31 Goalw [prat_def,prat_of_pnat_def]
91.32 - "qinv (q) * q = prat_of_pnat (Abs_pnat 1')";
91.33 + "qinv (q) * q = prat_of_pnat (Abs_pnat (Suc 0))";
91.34 by (res_inst_tac [("z","q")] eq_Abs_prat 1);
91.35 by (asm_full_simp_tac (simpset() addsimps [qinv,
91.36 prat_mult,pnat_mult_1,pnat_mult_1_left, pnat_mult_commute]) 1);
91.37 qed "prat_mult_qinv";
91.38
91.39 -Goal "q * qinv (q) = prat_of_pnat (Abs_pnat 1')";
91.40 +Goal "q * qinv (q) = prat_of_pnat (Abs_pnat (Suc 0))";
91.41 by (rtac (prat_mult_commute RS subst) 1);
91.42 by (simp_tac (simpset() addsimps [prat_mult_qinv]) 1);
91.43 qed "prat_mult_qinv_right";
91.44
91.45 -Goal "EX y. (x::prat) * y = prat_of_pnat (Abs_pnat 1')";
91.46 +Goal "EX y. (x::prat) * y = prat_of_pnat (Abs_pnat (Suc 0))";
91.47 by (fast_tac (claset() addIs [prat_mult_qinv_right]) 1);
91.48 qed "prat_qinv_ex";
91.49
91.50 -Goal "EX! y. (x::prat) * y = prat_of_pnat (Abs_pnat 1')";
91.51 +Goal "EX! y. (x::prat) * y = prat_of_pnat (Abs_pnat (Suc 0))";
91.52 by (auto_tac (claset() addIs [prat_mult_qinv_right],simpset()));
91.53 by (dres_inst_tac [("f","%x. ya*x")] arg_cong 1);
91.54 by (asm_full_simp_tac (simpset() addsimps [prat_mult_assoc RS sym]) 1);
91.55 @@ -282,7 +282,7 @@
91.56 prat_mult_1,prat_mult_1_right]) 1);
91.57 qed "prat_qinv_ex1";
91.58
91.59 -Goal "EX! y. y * (x::prat) = prat_of_pnat (Abs_pnat 1')";
91.60 +Goal "EX! y. y * (x::prat) = prat_of_pnat (Abs_pnat (Suc 0))";
91.61 by (auto_tac (claset() addIs [prat_mult_qinv],simpset()));
91.62 by (dres_inst_tac [("f","%x. x*ya")] arg_cong 1);
91.63 by (asm_full_simp_tac (simpset() addsimps [prat_mult_assoc]) 1);
91.64 @@ -290,7 +290,7 @@
91.65 prat_mult_1,prat_mult_1_right]) 1);
91.66 qed "prat_qinv_left_ex1";
91.67
91.68 -Goal "x * y = prat_of_pnat (Abs_pnat 1') ==> x = qinv y";
91.69 +Goal "x * y = prat_of_pnat (Abs_pnat (Suc 0)) ==> x = qinv y";
91.70 by (cut_inst_tac [("q","y")] prat_mult_qinv 1);
91.71 by (res_inst_tac [("x1","y")] (prat_qinv_left_ex1 RS ex1E) 1);
91.72 by (Blast_tac 1);
91.73 @@ -506,7 +506,7 @@
91.74 by (cut_inst_tac [("x","q1"),("q1.0","qinv (q1)"), ("q2.0","qinv (q2)")]
91.75 prat_mult_left_less2_mono1 1);
91.76 by Auto_tac;
91.77 -by (dres_inst_tac [("q2.0","prat_of_pnat (Abs_pnat 1')")] prat_less_trans 1);
91.78 +by (dres_inst_tac [("q2.0","prat_of_pnat (Abs_pnat (Suc 0))")] prat_less_trans 1);
91.79 by (auto_tac (claset(),simpset() addsimps
91.80 [prat_less_not_refl]));
91.81 qed "lemma2_qinv_prat_less";
91.82 @@ -517,8 +517,8 @@
91.83 lemma2_qinv_prat_less],simpset()));
91.84 qed "qinv_prat_less";
91.85
91.86 -Goal "q1 < prat_of_pnat (Abs_pnat 1') \
91.87 -\ ==> prat_of_pnat (Abs_pnat 1') < qinv(q1)";
91.88 +Goal "q1 < prat_of_pnat (Abs_pnat (Suc 0)) \
91.89 +\ ==> prat_of_pnat (Abs_pnat (Suc 0)) < qinv(q1)";
91.90 by (dtac qinv_prat_less 1);
91.91 by (full_simp_tac (simpset() addsimps [qinv_1]) 1);
91.92 qed "prat_qinv_gt_1";
91.93 @@ -529,18 +529,18 @@
91.94 qed "prat_qinv_is_gt_1";
91.95
91.96 Goalw [prat_less_def]
91.97 - "prat_of_pnat (Abs_pnat 1') < prat_of_pnat (Abs_pnat 1') \
91.98 -\ + prat_of_pnat (Abs_pnat 1')";
91.99 + "prat_of_pnat (Abs_pnat (Suc 0)) < prat_of_pnat (Abs_pnat (Suc 0)) \
91.100 +\ + prat_of_pnat (Abs_pnat (Suc 0))";
91.101 by (Fast_tac 1);
91.102 qed "prat_less_1_2";
91.103
91.104 -Goal "qinv(prat_of_pnat (Abs_pnat 1') + \
91.105 -\ prat_of_pnat (Abs_pnat 1')) < prat_of_pnat (Abs_pnat 1')";
91.106 +Goal "qinv(prat_of_pnat (Abs_pnat (Suc 0)) + \
91.107 +\ prat_of_pnat (Abs_pnat (Suc 0))) < prat_of_pnat (Abs_pnat (Suc 0))";
91.108 by (cut_facts_tac [prat_less_1_2 RS qinv_prat_less] 1);
91.109 by (asm_full_simp_tac (simpset() addsimps [qinv_1]) 1);
91.110 qed "prat_less_qinv_2_1";
91.111
91.112 -Goal "!!(x::prat). x < y ==> x*qinv(y) < prat_of_pnat (Abs_pnat 1')";
91.113 +Goal "!!(x::prat). x < y ==> x*qinv(y) < prat_of_pnat (Abs_pnat (Suc 0))";
91.114 by (dres_inst_tac [("x","qinv(y)")] prat_mult_less2_mono1 1);
91.115 by (Asm_full_simp_tac 1);
91.116 qed "prat_mult_qinv_less_1";
91.117 @@ -701,19 +701,19 @@
91.118 pnat_mult_1]));
91.119 qed "Abs_prat_mult_qinv";
91.120
91.121 -Goal "Abs_prat(ratrel``{(x,y)}) <= Abs_prat(ratrel``{(x,Abs_pnat 1')})";
91.122 +Goal "Abs_prat(ratrel``{(x,y)}) <= Abs_prat(ratrel``{(x,Abs_pnat (Suc 0))})";
91.123 by (simp_tac (simpset() addsimps [Abs_prat_mult_qinv]) 1);
91.124 by (rtac prat_mult_left_le2_mono1 1);
91.125 by (rtac qinv_prat_le 1);
91.126 by (pnat_ind_tac "y" 1);
91.127 -by (dres_inst_tac [("x","prat_of_pnat (Abs_pnat 1')")] prat_add_le2_mono1 2);
91.128 +by (dres_inst_tac [("x","prat_of_pnat (Abs_pnat (Suc 0))")] prat_add_le2_mono1 2);
91.129 by (cut_facts_tac [prat_less_1_2 RS prat_less_imp_le] 2);
91.130 by (auto_tac (claset() addIs [prat_le_trans],
91.131 simpset() addsimps [prat_le_refl,
91.132 pSuc_is_plus_one,pnat_one_def,prat_of_pnat_add]));
91.133 qed "lemma_Abs_prat_le1";
91.134
91.135 -Goal "Abs_prat(ratrel``{(x,Abs_pnat 1')}) <= Abs_prat(ratrel``{(x*y,Abs_pnat 1')})";
91.136 +Goal "Abs_prat(ratrel``{(x,Abs_pnat (Suc 0))}) <= Abs_prat(ratrel``{(x*y,Abs_pnat (Suc 0))})";
91.137 by (simp_tac (simpset() addsimps [Abs_prat_mult_qinv]) 1);
91.138 by (rtac prat_mult_le2_mono1 1);
91.139 by (pnat_ind_tac "y" 1);
91.140 @@ -726,19 +726,19 @@
91.141 prat_of_pnat_add,prat_of_pnat_mult]));
91.142 qed "lemma_Abs_prat_le2";
91.143
91.144 -Goal "Abs_prat(ratrel``{(x,z)}) <= Abs_prat(ratrel``{(x*y,Abs_pnat 1')})";
91.145 +Goal "Abs_prat(ratrel``{(x,z)}) <= Abs_prat(ratrel``{(x*y,Abs_pnat (Suc 0))})";
91.146 by (fast_tac (claset() addIs [prat_le_trans,
91.147 lemma_Abs_prat_le1,lemma_Abs_prat_le2]) 1);
91.148 qed "lemma_Abs_prat_le3";
91.149
91.150 -Goal "Abs_prat(ratrel``{(x*y,Abs_pnat 1')}) * Abs_prat(ratrel``{(w,x)}) = \
91.151 -\ Abs_prat(ratrel``{(w*y,Abs_pnat 1')})";
91.152 +Goal "Abs_prat(ratrel``{(x*y,Abs_pnat (Suc 0))}) * Abs_prat(ratrel``{(w,x)}) = \
91.153 +\ Abs_prat(ratrel``{(w*y,Abs_pnat (Suc 0))})";
91.154 by (full_simp_tac (simpset() addsimps [prat_mult,
91.155 pnat_mult_1,pnat_mult_1_left] @ pnat_mult_ac) 1);
91.156 qed "pre_lemma_gleason9_34";
91.157
91.158 -Goal "Abs_prat(ratrel``{(y*x,Abs_pnat 1'*y)}) = \
91.159 -\ Abs_prat(ratrel``{(x,Abs_pnat 1')})";
91.160 +Goal "Abs_prat(ratrel``{(y*x,Abs_pnat (Suc 0)*y)}) = \
91.161 +\ Abs_prat(ratrel``{(x,Abs_pnat (Suc 0))})";
91.162 by (auto_tac (claset(),
91.163 simpset() addsimps [pnat_mult_1,pnat_mult_1_left] @ pnat_mult_ac));
91.164 qed "pre_lemma_gleason9_34b";
91.165 @@ -760,42 +760,42 @@
91.166 (*** of preal type as defined using Dedekind Sections in PReal ***)
91.167 (*** Show that exists positive real `one' ***)
91.168
91.169 -Goal "EX q. q: {x::prat. x < prat_of_pnat (Abs_pnat 1')}";
91.170 +Goal "EX q. q: {x::prat. x < prat_of_pnat (Abs_pnat (Suc 0))}";
91.171 by (fast_tac (claset() addIs [prat_less_qinv_2_1]) 1);
91.172 qed "lemma_prat_less_1_memEx";
91.173
91.174 -Goal "{x::prat. x < prat_of_pnat (Abs_pnat 1')} ~= {}";
91.175 +Goal "{x::prat. x < prat_of_pnat (Abs_pnat (Suc 0))} ~= {}";
91.176 by (rtac notI 1);
91.177 by (cut_facts_tac [lemma_prat_less_1_memEx] 1);
91.178 by (Asm_full_simp_tac 1);
91.179 qed "lemma_prat_less_1_set_non_empty";
91.180
91.181 -Goalw [psubset_def] "{} < {x::prat. x < prat_of_pnat (Abs_pnat 1')}";
91.182 +Goalw [psubset_def] "{} < {x::prat. x < prat_of_pnat (Abs_pnat (Suc 0))}";
91.183 by (asm_full_simp_tac (simpset() addsimps
91.184 [lemma_prat_less_1_set_non_empty RS not_sym]) 1);
91.185 qed "empty_set_psubset_lemma_prat_less_1_set";
91.186
91.187 (*** exists rational not in set --- prat_of_pnat (Abs_pnat 1) itself ***)
91.188 -Goal "EX q. q ~: {x::prat. x < prat_of_pnat (Abs_pnat 1')}";
91.189 -by (res_inst_tac [("x","prat_of_pnat (Abs_pnat 1')")] exI 1);
91.190 +Goal "EX q. q ~: {x::prat. x < prat_of_pnat (Abs_pnat (Suc 0))}";
91.191 +by (res_inst_tac [("x","prat_of_pnat (Abs_pnat (Suc 0))")] exI 1);
91.192 by (auto_tac (claset(),simpset() addsimps [prat_less_not_refl]));
91.193 qed "lemma_prat_less_1_not_memEx";
91.194
91.195 -Goal "{x::prat. x < prat_of_pnat (Abs_pnat 1')} ~= UNIV";
91.196 +Goal "{x::prat. x < prat_of_pnat (Abs_pnat (Suc 0))} ~= UNIV";
91.197 by (rtac notI 1);
91.198 by (cut_facts_tac [lemma_prat_less_1_not_memEx] 1);
91.199 by (Asm_full_simp_tac 1);
91.200 qed "lemma_prat_less_1_set_not_rat_set";
91.201
91.202 Goalw [psubset_def,subset_def]
91.203 - "{x::prat. x < prat_of_pnat (Abs_pnat 1')} < UNIV";
91.204 + "{x::prat. x < prat_of_pnat (Abs_pnat (Suc 0))} < UNIV";
91.205 by (asm_full_simp_tac
91.206 (simpset() addsimps [lemma_prat_less_1_set_not_rat_set,
91.207 lemma_prat_less_1_not_memEx]) 1);
91.208 qed "lemma_prat_less_1_set_psubset_rat_set";
91.209
91.210 (*** prove non_emptiness of type ***)
91.211 -Goal "{x::prat. x < prat_of_pnat (Abs_pnat 1')} : {A. {} < A & \
91.212 +Goal "{x::prat. x < prat_of_pnat (Abs_pnat (Suc 0))} : {A. {} < A & \
91.213 \ A < UNIV & \
91.214 \ (!y: A. ((!z. z < y --> z: A) & \
91.215 \ (EX u: A. y < u)))}";
92.1 --- a/src/HOL/Real/PReal.ML Fri Oct 05 21:50:37 2001 +0200
92.2 +++ b/src/HOL/Real/PReal.ML Fri Oct 05 21:52:39 2001 +0200
92.3 @@ -30,7 +30,7 @@
92.4
92.5 Addsimps [empty_not_mem_preal];
92.6
92.7 -Goalw [preal_def] "{x::prat. x < prat_of_pnat (Abs_pnat 1')} : preal";
92.8 +Goalw [preal_def] "{x::prat. x < prat_of_pnat (Abs_pnat (Suc 0))} : preal";
92.9 by (rtac preal_1 1);
92.10 qed "one_set_mem_preal";
92.11
92.12 @@ -234,9 +234,9 @@
92.13 \ ALL z. z < y --> z : {w. EX x:Rep_preal R. EX y:Rep_preal S. w = x + y}";
92.14 by Auto_tac;
92.15 by (ftac prat_mult_qinv_less_1 1);
92.16 -by (forw_inst_tac [("x","x"),("q2.0","prat_of_pnat (Abs_pnat 1')")]
92.17 +by (forw_inst_tac [("x","x"),("q2.0","prat_of_pnat (Abs_pnat (Suc 0))")]
92.18 prat_mult_less2_mono1 1);
92.19 -by (forw_inst_tac [("x","ya"),("q2.0","prat_of_pnat (Abs_pnat 1')")]
92.20 +by (forw_inst_tac [("x","ya"),("q2.0","prat_of_pnat (Abs_pnat (Suc 0))")]
92.21 prat_mult_less2_mono1 1);
92.22 by (Asm_full_simp_tac 1);
92.23 by (REPEAT(dtac (Rep_preal RS prealE_lemma3a) 1));
92.24 @@ -367,7 +367,7 @@
92.25 (* Positive Real 1 is the multiplicative identity element *)
92.26 (* long *)
92.27 Goalw [preal_of_prat_def,preal_mult_def]
92.28 - "(preal_of_prat (prat_of_pnat (Abs_pnat 1'))) * z = z";
92.29 + "(preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0)))) * z = z";
92.30 by (rtac (Rep_preal_inverse RS subst) 1);
92.31 by (res_inst_tac [("f","Abs_preal")] arg_cong 1);
92.32 by (rtac (one_set_mem_preal RS Abs_preal_inverse RS ssubst) 1);
92.33 @@ -382,7 +382,7 @@
92.34 by (auto_tac (claset(),simpset() addsimps [prat_mult_assoc]));
92.35 qed "preal_mult_1";
92.36
92.37 -Goal "z * (preal_of_prat (prat_of_pnat (Abs_pnat 1'))) = z";
92.38 +Goal "z * (preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0)))) = z";
92.39 by (rtac (preal_mult_commute RS subst) 1);
92.40 by (rtac preal_mult_1 1);
92.41 qed "preal_mult_1_right";
92.42 @@ -563,7 +563,7 @@
92.43
92.44 (*more lemmas for inverse *)
92.45 Goal "x: Rep_preal(pinv(A)*A) ==> \
92.46 -\ x: Rep_preal(preal_of_prat (prat_of_pnat (Abs_pnat 1')))";
92.47 +\ x: Rep_preal(preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0))))";
92.48 by (auto_tac (claset() addSDs [mem_Rep_preal_multD],
92.49 simpset() addsimps [pinv_def,preal_of_prat_def] ));
92.50 by (dtac (preal_mem_inv_set RS Abs_preal_inverse RS subst) 1);
92.51 @@ -583,8 +583,8 @@
92.52 qed "lemma1_gleason9_34";
92.53
92.54 Goal "Abs_prat (ratrel `` {(y, z)}) < xb + \
92.55 -\ Abs_prat (ratrel `` {(x*y, Abs_pnat 1')})*Abs_prat (ratrel `` {(w, x)})";
92.56 -by (res_inst_tac [("j","Abs_prat (ratrel `` {(x * y, Abs_pnat 1')}) *\
92.57 +\ Abs_prat (ratrel `` {(x*y, Abs_pnat (Suc 0))})*Abs_prat (ratrel `` {(w, x)})";
92.58 +by (res_inst_tac [("j","Abs_prat (ratrel `` {(x * y, Abs_pnat (Suc 0))}) *\
92.59 \ Abs_prat (ratrel `` {(w, x)})")] prat_le_less_trans 1);
92.60 by (rtac prat_self_less_add_right 2);
92.61 by (auto_tac (claset() addIs [lemma_Abs_prat_le3],
92.62 @@ -650,14 +650,14 @@
92.63 by Auto_tac;
92.64 qed "lemma_gleason9_36";
92.65
92.66 -Goal "prat_of_pnat (Abs_pnat 1') < x ==> \
92.67 +Goal "prat_of_pnat (Abs_pnat (Suc 0)) < x ==> \
92.68 \ EX r: Rep_preal(A). r*x ~: Rep_preal(A)";
92.69 by (rtac lemma_gleason9_36 1);
92.70 by (asm_simp_tac (simpset() addsimps [pnat_one_def]) 1);
92.71 qed "lemma_gleason9_36a";
92.72
92.73 (*** Part 2 of existence of inverse ***)
92.74 -Goal "x: Rep_preal(preal_of_prat (prat_of_pnat (Abs_pnat 1'))) \
92.75 +Goal "x: Rep_preal(preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0)))) \
92.76 \ ==> x: Rep_preal(pinv(A)*A)";
92.77 by (auto_tac (claset() addSIs [mem_Rep_preal_multI],
92.78 simpset() addsimps [pinv_def,preal_of_prat_def] ));
92.79 @@ -677,12 +677,12 @@
92.80 prat_mult_left_commute]));
92.81 qed "preal_mem_mult_invI";
92.82
92.83 -Goal "pinv(A)*A = (preal_of_prat (prat_of_pnat (Abs_pnat 1')))";
92.84 +Goal "pinv(A)*A = (preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0))))";
92.85 by (rtac (inj_Rep_preal RS injD) 1);
92.86 by (fast_tac (claset() addDs [preal_mem_mult_invD,preal_mem_mult_invI]) 1);
92.87 qed "preal_mult_inv";
92.88
92.89 -Goal "A*pinv(A) = (preal_of_prat (prat_of_pnat (Abs_pnat 1')))";
92.90 +Goal "A*pinv(A) = (preal_of_prat (prat_of_pnat (Abs_pnat (Suc 0))))";
92.91 by (rtac (preal_mult_commute RS subst) 1);
92.92 by (rtac preal_mult_inv 1);
92.93 qed "preal_mult_inv_right";
93.1 --- a/src/HOL/Real/RComplete.ML Fri Oct 05 21:50:37 2001 +0200
93.2 +++ b/src/HOL/Real/RComplete.ML Fri Oct 05 21:52:39 2001 +0200
93.3 @@ -8,7 +8,7 @@
93.4
93.5 claset_ref() := claset() delWrapper "bspec";
93.6
93.7 -Goal "x/#2 + x/#2 = (x::real)";
93.8 +Goal "x/# 2 + x/# 2 = (x::real)";
93.9 by (Simp_tac 1);
93.10 qed "real_sum_of_halves";
93.11
93.12 @@ -18,14 +18,14 @@
93.13 previously in Real.ML.
93.14 ---------------------------------------------------------*)
93.15 (*a few lemmas*)
93.16 -Goal "ALL x:P. #0 < x ==> \
93.17 +Goal "ALL x:P. Numeral0 < x ==> \
93.18 \ ((EX x:P. y < x) = (EX X. real_of_preal X : P & \
93.19 \ y < real_of_preal X))";
93.20 by (blast_tac (claset() addSDs [bspec,
93.21 rename_numerals real_gt_zero_preal_Ex RS iffD1]) 1);
93.22 qed "real_sup_lemma1";
93.23
93.24 -Goal "[| ALL x:P. #0 < x; EX x. x: P; EX y. ALL x: P. x < y |] \
93.25 +Goal "[| ALL x:P. Numeral0 < x; EX x. x: P; EX y. ALL x: P. x < y |] \
93.26 \ ==> (EX X. X: {w. real_of_preal w : P}) & \
93.27 \ (EX Y. ALL X: {w. real_of_preal w : P}. X < Y)";
93.28 by (rtac conjI 1);
93.29 @@ -53,13 +53,13 @@
93.30 only have one case split
93.31 **)
93.32
93.33 -Goal "[| ALL x:P. (#0::real) < x; EX x. x: P; EX y. ALL x: P. x < y |] \
93.34 +Goal "[| ALL x:P. (Numeral0::real) < x; EX x. x: P; EX y. ALL x: P. x < y |] \
93.35 \ ==> (EX S. ALL y. (EX x: P. y < x) = (y < S))";
93.36 by (res_inst_tac
93.37 [("x","real_of_preal (psup({w. real_of_preal w : P}))")] exI 1);
93.38 by Auto_tac;
93.39 by (ftac real_sup_lemma2 1 THEN Auto_tac);
93.40 -by (case_tac "#0 < ya" 1);
93.41 +by (case_tac "Numeral0 < ya" 1);
93.42 by (dtac ((rename_numerals real_gt_zero_preal_Ex) RS iffD1) 1);
93.43 by (dtac (rename_numerals real_less_all_real2) 2);
93.44 by Auto_tac;
93.45 @@ -69,7 +69,7 @@
93.46 by Auto_tac;
93.47 (* second part *)
93.48 by (rtac (real_sup_lemma1 RS iffD2) 1 THEN assume_tac 1);
93.49 -by (case_tac "#0 < ya" 1);
93.50 +by (case_tac "Numeral0 < ya" 1);
93.51 by (auto_tac (claset() addSDs (map rename_numerals
93.52 [real_less_all_real2,
93.53 real_gt_zero_preal_Ex RS iffD1]),
93.54 @@ -100,7 +100,7 @@
93.55 Completeness theorem for the positive reals(again)
93.56 ----------------------------------------------------------------*)
93.57
93.58 -Goal "[| ALL x: S. #0 < x; \
93.59 +Goal "[| ALL x: S. Numeral0 < x; \
93.60 \ EX x. x: S; \
93.61 \ EX u. isUb (UNIV::real set) S u \
93.62 \ |] ==> EX t. isLub (UNIV::real set) S t";
93.63 @@ -133,7 +133,7 @@
93.64 (*-------------------------------
93.65 Lemmas
93.66 -------------------------------*)
93.67 -Goal "ALL y : {z. EX x: P. z = x + (-xa) + #1} Int {x. #0 < x}. #0 < y";
93.68 +Goal "ALL y : {z. EX x: P. z = x + (-xa) + Numeral1} Int {x. Numeral0 < x}. Numeral0 < y";
93.69 by Auto_tac;
93.70 qed "real_sup_lemma3";
93.71
93.72 @@ -141,7 +141,7 @@
93.73 by (Auto_tac);
93.74 qed "lemma_le_swap2";
93.75
93.76 -Goal "[| (x::real) + (-X) + #1 <= S; xa <= x |] ==> xa <= S + X + (-#1)";
93.77 +Goal "[| (x::real) + (-X) + Numeral1 <= S; xa <= x |] ==> xa <= S + X + (-Numeral1)";
93.78 by (Auto_tac);
93.79 qed "lemma_real_complete2b";
93.80
93.81 @@ -151,19 +151,19 @@
93.82 Goal "[| EX X. X: S; EX Y. isUb (UNIV::real set) S Y |] \
93.83 \ ==> EX t. isLub (UNIV :: real set) S t";
93.84 by (Step_tac 1);
93.85 -by (subgoal_tac "EX u. u: {z. EX x: S. z = x + (-X) + #1} \
93.86 -\ Int {x. #0 < x}" 1);
93.87 -by (subgoal_tac "isUb (UNIV::real set) ({z. EX x: S. z = x + (-X) + #1} \
93.88 -\ Int {x. #0 < x}) (Y + (-X) + #1)" 1);
93.89 +by (subgoal_tac "EX u. u: {z. EX x: S. z = x + (-X) + Numeral1} \
93.90 +\ Int {x. Numeral0 < x}" 1);
93.91 +by (subgoal_tac "isUb (UNIV::real set) ({z. EX x: S. z = x + (-X) + Numeral1} \
93.92 +\ Int {x. Numeral0 < x}) (Y + (-X) + Numeral1)" 1);
93.93 by (cut_inst_tac [("P","S"),("xa","X")] real_sup_lemma3 1);
93.94 by (EVERY1[forward_tac [exI RSN (3,posreals_complete)], Blast_tac, Blast_tac,
93.95 Step_tac]);
93.96 -by (res_inst_tac [("x","t + X + (-#1)")] exI 1);
93.97 +by (res_inst_tac [("x","t + X + (-Numeral1)")] exI 1);
93.98 by (rtac isLubI2 1);
93.99 by (rtac setgeI 2 THEN Step_tac 2);
93.100 -by (subgoal_tac "isUb (UNIV:: real set) ({z. EX x: S. z = x + (-X) + #1} \
93.101 -\ Int {x. #0 < x}) (y + (-X) + #1)" 2);
93.102 -by (dres_inst_tac [("y","(y + (- X) + #1)")] isLub_le_isUb 2
93.103 +by (subgoal_tac "isUb (UNIV:: real set) ({z. EX x: S. z = x + (-X) + Numeral1} \
93.104 +\ Int {x. Numeral0 < x}) (y + (-X) + Numeral1)" 2);
93.105 +by (dres_inst_tac [("y","(y + (- X) + Numeral1)")] isLub_le_isUb 2
93.106 THEN assume_tac 2);
93.107 by (full_simp_tac
93.108 (simpset() addsimps [real_diff_def, real_diff_le_eq RS sym] @
93.109 @@ -194,15 +194,15 @@
93.110 Related: Archimedean property of reals
93.111 ----------------------------------------------------------------*)
93.112
93.113 -Goal "#0 < real (Suc n)";
93.114 +Goal "Numeral0 < real (Suc n)";
93.115 by (res_inst_tac [("y","real n")] order_le_less_trans 1);
93.116 by (rtac (rename_numerals real_of_nat_ge_zero) 1);
93.117 by (simp_tac (simpset() addsimps [real_of_nat_Suc]) 1);
93.118 qed "real_of_nat_Suc_gt_zero";
93.119
93.120 -Goal "#0 < x ==> EX n. inverse (real(Suc n)) < x";
93.121 +Goal "Numeral0 < x ==> EX n. inverse (real(Suc n)) < x";
93.122 by (rtac ccontr 1);
93.123 -by (subgoal_tac "ALL n. x * real (Suc n) <= #1" 1);
93.124 +by (subgoal_tac "ALL n. x * real (Suc n) <= Numeral1" 1);
93.125 by (asm_full_simp_tac
93.126 (simpset() addsimps [linorder_not_less, real_inverse_eq_divide]) 2);
93.127 by (Clarify_tac 2);
93.128 @@ -213,7 +213,7 @@
93.129 addsimps [real_of_nat_Suc_gt_zero RS real_not_refl2 RS not_sym,
93.130 real_mult_commute]) 2);
93.131 by (subgoal_tac "isUb (UNIV::real set) \
93.132 -\ {z. EX n. z = x*(real (Suc n))} #1" 1);
93.133 +\ {z. EX n. z = x*(real (Suc n))} Numeral1" 1);
93.134 by (subgoal_tac "EX X. X : {z. EX n. z = x*(real (Suc n))}" 1);
93.135 by (dtac reals_complete 1);
93.136 by (auto_tac (claset() addIs [isUbI,setleI],simpset()));
93.137 @@ -234,7 +234,7 @@
93.138 (*There must be other proofs, e.g. Suc of the largest integer in the
93.139 cut representing x*)
93.140 Goal "EX n. (x::real) < real (n::nat)";
93.141 -by (res_inst_tac [("R1.0","x"),("R2.0","#0")] real_linear_less2 1);
93.142 +by (res_inst_tac [("R1.0","x"),("R2.0","Numeral0")] real_linear_less2 1);
93.143 by (res_inst_tac [("x","0")] exI 1);
93.144 by (res_inst_tac [("x","1")] exI 2);
93.145 by (auto_tac (claset() addEs [order_less_trans],
93.146 @@ -244,7 +244,7 @@
93.147 by (forw_inst_tac [("y","inverse x")]
93.148 (rename_numerals real_mult_less_mono1) 1);
93.149 by Auto_tac;
93.150 -by (dres_inst_tac [("y","#1"),("z","real (Suc n)")]
93.151 +by (dres_inst_tac [("y","Numeral1"),("z","real (Suc n)")]
93.152 (rotate_prems 1 real_mult_less_mono2) 1);
93.153 by (auto_tac (claset(),
93.154 simpset() addsimps [real_of_nat_Suc_gt_zero,
94.1 --- a/src/HOL/Real/RealAbs.ML Fri Oct 05 21:50:37 2001 +0200
94.2 +++ b/src/HOL/Real/RealAbs.ML Fri Oct 05 21:52:39 2001 +0200
94.3 @@ -22,7 +22,7 @@
94.4 Addsimps [abs_nat_number_of];
94.5
94.6 Goalw [real_abs_def]
94.7 - "P(abs (x::real)) = ((#0 <= x --> P x) & (x < #0 --> P(-x)))";
94.8 + "P(abs (x::real)) = ((Numeral0 <= x --> P x) & (x < Numeral0 --> P(-x)))";
94.9 by(auto_tac (claset(), simpset() addsimps [zero_eq_numeral_0]));
94.10 qed "abs_split";
94.11
94.12 @@ -32,36 +32,36 @@
94.13 (adapted version of previously proved theorems about abs)
94.14 ----------------------------------------------------------------------------*)
94.15
94.16 -Goalw [real_abs_def] "abs (r::real) = (if #0<=r then r else -r)";
94.17 +Goalw [real_abs_def] "abs (r::real) = (if Numeral0<=r then r else -r)";
94.18 by Auto_tac;
94.19 qed "abs_iff";
94.20
94.21 -Goalw [real_abs_def] "abs #0 = (#0::real)";
94.22 +Goalw [real_abs_def] "abs Numeral0 = (Numeral0::real)";
94.23 by Auto_tac;
94.24 qed "abs_zero";
94.25 Addsimps [abs_zero];
94.26
94.27 -Goalw [real_abs_def] "abs (#0::real) = -#0";
94.28 +Goalw [real_abs_def] "abs (Numeral0::real) = -Numeral0";
94.29 by (Simp_tac 1);
94.30 qed "abs_minus_zero";
94.31
94.32 -Goalw [real_abs_def] "(#0::real)<=x ==> abs x = x";
94.33 +Goalw [real_abs_def] "(Numeral0::real)<=x ==> abs x = x";
94.34 by (Asm_simp_tac 1);
94.35 qed "abs_eqI1";
94.36
94.37 -Goalw [real_abs_def] "(#0::real) < x ==> abs x = x";
94.38 +Goalw [real_abs_def] "(Numeral0::real) < x ==> abs x = x";
94.39 by (Asm_simp_tac 1);
94.40 qed "abs_eqI2";
94.41
94.42 -Goalw [real_abs_def,real_le_def] "x < (#0::real) ==> abs x = -x";
94.43 +Goalw [real_abs_def,real_le_def] "x < (Numeral0::real) ==> abs x = -x";
94.44 by (Asm_simp_tac 1);
94.45 qed "abs_minus_eqI2";
94.46
94.47 -Goalw [real_abs_def] "x<=(#0::real) ==> abs x = -x";
94.48 +Goalw [real_abs_def] "x<=(Numeral0::real) ==> abs x = -x";
94.49 by (Asm_simp_tac 1);
94.50 qed "abs_minus_eqI1";
94.51
94.52 -Goalw [real_abs_def] "(#0::real)<= abs x";
94.53 +Goalw [real_abs_def] "(Numeral0::real)<= abs x";
94.54 by (Simp_tac 1);
94.55 qed "abs_ge_zero";
94.56
94.57 @@ -70,7 +70,7 @@
94.58 qed "abs_idempotent";
94.59 Addsimps [abs_idempotent];
94.60
94.61 -Goalw [real_abs_def] "(abs x = #0) = (x=(#0::real))";
94.62 +Goalw [real_abs_def] "(abs x = Numeral0) = (x=(Numeral0::real))";
94.63 by (Full_simp_tac 1);
94.64 qed "abs_zero_iff";
94.65 AddIffs [abs_zero_iff];
94.66 @@ -130,16 +130,16 @@
94.67 qed "abs_add_minus_less";
94.68
94.69 (* lemmas manipulating terms *)
94.70 -Goal "((#0::real)*x < r)=(#0 < r)";
94.71 +Goal "((Numeral0::real)*x < r)=(Numeral0 < r)";
94.72 by (Simp_tac 1);
94.73 qed "real_mult_0_less";
94.74
94.75 -Goal "[| (#0::real) < y; x < r; y*r < t*s |] ==> y*x < t*s";
94.76 +Goal "[| (Numeral0::real) < y; x < r; y*r < t*s |] ==> y*x < t*s";
94.77 by (blast_tac (claset() addSIs [rename_numerals real_mult_less_mono2]
94.78 addIs [order_less_trans]) 1);
94.79 qed "real_mult_less_trans";
94.80
94.81 -Goal "[| (#0::real)<=y; x < r; y*r < t*s; #0 < t*s|] ==> y*x < t*s";
94.82 +Goal "[| (Numeral0::real)<=y; x < r; y*r < t*s; Numeral0 < t*s|] ==> y*x < t*s";
94.83 by (dtac order_le_imp_less_or_eq 1);
94.84 by (fast_tac (HOL_cs addEs [real_mult_0_less RS iffD2,
94.85 real_mult_less_trans]) 1);
94.86 @@ -161,11 +161,11 @@
94.87 simpset() addsimps [abs_mult RS sym]));
94.88 qed "abs_mult_less2";
94.89
94.90 -Goal "abs(x) < r ==> (#0::real) < r";
94.91 +Goal "abs(x) < r ==> (Numeral0::real) < r";
94.92 by (blast_tac (claset() addSIs [order_le_less_trans,abs_ge_zero]) 1);
94.93 qed "abs_less_gt_zero";
94.94
94.95 -Goalw [real_abs_def] "abs (-#1) = (#1::real)";
94.96 +Goalw [real_abs_def] "abs (-Numeral1) = (Numeral1::real)";
94.97 by (Simp_tac 1);
94.98 qed "abs_minus_one";
94.99 Addsimps [abs_minus_one];
94.100 @@ -182,17 +182,17 @@
94.101 by Auto_tac;
94.102 qed "abs_le_interval_iff";
94.103
94.104 -Goalw [real_abs_def] "(#0::real) < k ==> #0 < k + abs(x)";
94.105 +Goalw [real_abs_def] "(Numeral0::real) < k ==> Numeral0 < k + abs(x)";
94.106 by Auto_tac;
94.107 qed "abs_add_pos_gt_zero";
94.108
94.109 -Goalw [real_abs_def] "(#0::real) < #1 + abs(x)";
94.110 +Goalw [real_abs_def] "(Numeral0::real) < Numeral1 + abs(x)";
94.111 by Auto_tac;
94.112 qed "abs_add_one_gt_zero";
94.113 Addsimps [abs_add_one_gt_zero];
94.114
94.115 (* 05/2000 *)
94.116 -Goalw [real_abs_def] "~ abs x < (#0::real)";
94.117 +Goalw [real_abs_def] "~ abs x < (Numeral0::real)";
94.118 by Auto_tac;
94.119 qed "abs_not_less_zero";
94.120 Addsimps [abs_not_less_zero];
94.121 @@ -202,12 +202,12 @@
94.122 simpset()));
94.123 qed "abs_circle";
94.124
94.125 -Goalw [real_abs_def] "(abs x <= (#0::real)) = (x = #0)";
94.126 +Goalw [real_abs_def] "(abs x <= (Numeral0::real)) = (x = Numeral0)";
94.127 by Auto_tac;
94.128 qed "abs_le_zero_iff";
94.129 Addsimps [abs_le_zero_iff];
94.130
94.131 -Goal "((#0::real) < abs x) = (x ~= 0)";
94.132 +Goal "((Numeral0::real) < abs x) = (x ~= 0)";
94.133 by (simp_tac (simpset() addsimps [real_abs_def]) 1);
94.134 by (arith_tac 1);
94.135 qed "real_0_less_abs_iff";
94.136 @@ -219,7 +219,7 @@
94.137 qed "abs_real_of_nat_cancel";
94.138 Addsimps [abs_real_of_nat_cancel];
94.139
94.140 -Goal "~ abs(x) + (#1::real) < x";
94.141 +Goal "~ abs(x) + (Numeral1::real) < x";
94.142 by (rtac real_leD 1);
94.143 by (auto_tac (claset() addIs [abs_ge_self RS order_trans], simpset()));
94.144 qed "abs_add_one_not_less_self";
94.145 @@ -232,21 +232,21 @@
94.146 simpset() addsimps [real_add_assoc]));
94.147 qed "abs_triangle_ineq_three";
94.148
94.149 -Goalw [real_abs_def] "abs(x - y) < y ==> (#0::real) < y";
94.150 -by (case_tac "#0 <= x - y" 1);
94.151 +Goalw [real_abs_def] "abs(x - y) < y ==> (Numeral0::real) < y";
94.152 +by (case_tac "Numeral0 <= x - y" 1);
94.153 by Auto_tac;
94.154 qed "abs_diff_less_imp_gt_zero";
94.155
94.156 -Goalw [real_abs_def] "abs(x - y) < x ==> (#0::real) < x";
94.157 -by (case_tac "#0 <= x - y" 1);
94.158 +Goalw [real_abs_def] "abs(x - y) < x ==> (Numeral0::real) < x";
94.159 +by (case_tac "Numeral0 <= x - y" 1);
94.160 by Auto_tac;
94.161 qed "abs_diff_less_imp_gt_zero2";
94.162
94.163 -Goal "abs(x - y) < y ==> (#0::real) < x";
94.164 +Goal "abs(x - y) < y ==> (Numeral0::real) < x";
94.165 by (auto_tac (claset(),simpset() addsimps [abs_interval_iff]));
94.166 qed "abs_diff_less_imp_gt_zero3";
94.167
94.168 -Goal "abs(x - y) < -y ==> x < (#0::real)";
94.169 +Goal "abs(x - y) < -y ==> x < (Numeral0::real)";
94.170 by (auto_tac (claset(),simpset() addsimps [abs_interval_iff]));
94.171 qed "abs_diff_less_imp_gt_zero4";
94.172
95.1 --- a/src/HOL/Real/RealAbs.thy Fri Oct 05 21:50:37 2001 +0200
95.2 +++ b/src/HOL/Real/RealAbs.thy Fri Oct 05 21:52:39 2001 +0200
95.3 @@ -9,6 +9,6 @@
95.4
95.5
95.6 defs
95.7 - real_abs_def "abs r == (if (#0::real) <= r then r else -r)"
95.8 + real_abs_def "abs r == (if (Numeral0::real) <= r then r else -r)"
95.9
95.10 end
96.1 --- a/src/HOL/Real/RealArith0.ML Fri Oct 05 21:50:37 2001 +0200
96.2 +++ b/src/HOL/Real/RealArith0.ML Fri Oct 05 21:52:39 2001 +0200
96.3 @@ -10,13 +10,13 @@
96.4
96.5 (** Division and inverse **)
96.6
96.7 -Goal "#0/x = (#0::real)";
96.8 +Goal "Numeral0/x = (Numeral0::real)";
96.9 by (simp_tac (simpset() addsimps [real_divide_def]) 1);
96.10 qed "real_0_divide";
96.11 Addsimps [real_0_divide];
96.12
96.13 -Goal "((#0::real) < inverse x) = (#0 < x)";
96.14 -by (case_tac "x=#0" 1);
96.15 +Goal "((Numeral0::real) < inverse x) = (Numeral0 < x)";
96.16 +by (case_tac "x=Numeral0" 1);
96.17 by (asm_simp_tac (HOL_ss addsimps [rename_numerals INVERSE_ZERO]) 1);
96.18 by (auto_tac (claset() addDs [rename_numerals real_inverse_less_zero],
96.19 simpset() addsimps [linorder_neq_iff,
96.20 @@ -24,8 +24,8 @@
96.21 qed "real_0_less_inverse_iff";
96.22 Addsimps [real_0_less_inverse_iff];
96.23
96.24 -Goal "(inverse x < (#0::real)) = (x < #0)";
96.25 -by (case_tac "x=#0" 1);
96.26 +Goal "(inverse x < (Numeral0::real)) = (x < Numeral0)";
96.27 +by (case_tac "x=Numeral0" 1);
96.28 by (asm_simp_tac (HOL_ss addsimps [rename_numerals INVERSE_ZERO]) 1);
96.29 by (auto_tac (claset() addDs [rename_numerals real_inverse_less_zero],
96.30 simpset() addsimps [linorder_neq_iff,
96.31 @@ -33,60 +33,60 @@
96.32 qed "real_inverse_less_0_iff";
96.33 Addsimps [real_inverse_less_0_iff];
96.34
96.35 -Goal "((#0::real) <= inverse x) = (#0 <= x)";
96.36 +Goal "((Numeral0::real) <= inverse x) = (Numeral0 <= x)";
96.37 by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1);
96.38 qed "real_0_le_inverse_iff";
96.39 Addsimps [real_0_le_inverse_iff];
96.40
96.41 -Goal "(inverse x <= (#0::real)) = (x <= #0)";
96.42 +Goal "(inverse x <= (Numeral0::real)) = (x <= Numeral0)";
96.43 by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1);
96.44 qed "real_inverse_le_0_iff";
96.45 Addsimps [real_inverse_le_0_iff];
96.46
96.47 -Goalw [real_divide_def] "x/(#0::real) = #0";
96.48 +Goalw [real_divide_def] "x/(Numeral0::real) = Numeral0";
96.49 by (stac (rename_numerals INVERSE_ZERO) 1);
96.50 by (Simp_tac 1);
96.51 qed "REAL_DIVIDE_ZERO";
96.52
96.53 -Goal "inverse (x::real) = #1/x";
96.54 +Goal "inverse (x::real) = Numeral1/x";
96.55 by (simp_tac (simpset() addsimps [real_divide_def]) 1);
96.56 qed "real_inverse_eq_divide";
96.57
96.58 -Goal "((#0::real) < x/y) = (#0 < x & #0 < y | x < #0 & y < #0)";
96.59 +Goal "((Numeral0::real) < x/y) = (Numeral0 < x & Numeral0 < y | x < Numeral0 & y < Numeral0)";
96.60 by (simp_tac (simpset() addsimps [real_divide_def, real_0_less_mult_iff]) 1);
96.61 qed "real_0_less_divide_iff";
96.62 Addsimps [inst "x" "number_of ?w" real_0_less_divide_iff];
96.63
96.64 -Goal "(x/y < (#0::real)) = (#0 < x & y < #0 | x < #0 & #0 < y)";
96.65 +Goal "(x/y < (Numeral0::real)) = (Numeral0 < x & y < Numeral0 | x < Numeral0 & Numeral0 < y)";
96.66 by (simp_tac (simpset() addsimps [real_divide_def, real_mult_less_0_iff]) 1);
96.67 qed "real_divide_less_0_iff";
96.68 Addsimps [inst "x" "number_of ?w" real_divide_less_0_iff];
96.69
96.70 -Goal "((#0::real) <= x/y) = ((x <= #0 | #0 <= y) & (#0 <= x | y <= #0))";
96.71 +Goal "((Numeral0::real) <= x/y) = ((x <= Numeral0 | Numeral0 <= y) & (Numeral0 <= x | y <= Numeral0))";
96.72 by (simp_tac (simpset() addsimps [real_divide_def, real_0_le_mult_iff]) 1);
96.73 by Auto_tac;
96.74 qed "real_0_le_divide_iff";
96.75 Addsimps [inst "x" "number_of ?w" real_0_le_divide_iff];
96.76
96.77 -Goal "(x/y <= (#0::real)) = ((x <= #0 | y <= #0) & (#0 <= x | #0 <= y))";
96.78 +Goal "(x/y <= (Numeral0::real)) = ((x <= Numeral0 | y <= Numeral0) & (Numeral0 <= x | Numeral0 <= y))";
96.79 by (simp_tac (simpset() addsimps [real_divide_def, real_mult_le_0_iff]) 1);
96.80 by Auto_tac;
96.81 qed "real_divide_le_0_iff";
96.82 Addsimps [inst "x" "number_of ?w" real_divide_le_0_iff];
96.83
96.84 -Goal "(inverse(x::real) = #0) = (x = #0)";
96.85 +Goal "(inverse(x::real) = Numeral0) = (x = Numeral0)";
96.86 by (auto_tac (claset(), simpset() addsimps [rename_numerals INVERSE_ZERO]));
96.87 by (rtac ccontr 1);
96.88 by (blast_tac (claset() addDs [rename_numerals real_inverse_not_zero]) 1);
96.89 qed "real_inverse_zero_iff";
96.90 Addsimps [real_inverse_zero_iff];
96.91
96.92 -Goal "(x/y = #0) = (x=#0 | y=(#0::real))";
96.93 +Goal "(x/y = Numeral0) = (x=Numeral0 | y=(Numeral0::real))";
96.94 by (auto_tac (claset(), simpset() addsimps [real_divide_def]));
96.95 qed "real_divide_eq_0_iff";
96.96 Addsimps [real_divide_eq_0_iff];
96.97
96.98 -Goal "h ~= (#0::real) ==> h/h = #1";
96.99 +Goal "h ~= (Numeral0::real) ==> h/h = Numeral1";
96.100 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_inv_left]) 1);
96.101 qed "real_divide_self_eq";
96.102 Addsimps [real_divide_self_eq];
96.103 @@ -128,7 +128,7 @@
96.104 by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [real_mult_commute])));
96.105 qed "real_mult_le_mono2_neg";
96.106
96.107 -Goal "(m*k < n*k) = (((#0::real) < k & m<n) | (k < #0 & n<m))";
96.108 +Goal "(m*k < n*k) = (((Numeral0::real) < k & m<n) | (k < Numeral0 & n<m))";
96.109 by (case_tac "k = (0::real)" 1);
96.110 by (auto_tac (claset(),
96.111 simpset() addsimps [linorder_neq_iff,
96.112 @@ -143,32 +143,32 @@
96.113 real_mult_le_mono1_neg]));
96.114 qed "real_mult_less_cancel2";
96.115
96.116 -Goal "(m*k <= n*k) = (((#0::real) < k --> m<=n) & (k < #0 --> n<=m))";
96.117 +Goal "(m*k <= n*k) = (((Numeral0::real) < k --> m<=n) & (k < Numeral0 --> n<=m))";
96.118 by (simp_tac (simpset() addsimps [linorder_not_less RS sym,
96.119 real_mult_less_cancel2]) 1);
96.120 qed "real_mult_le_cancel2";
96.121
96.122 -Goal "(k*m < k*n) = (((#0::real) < k & m<n) | (k < #0 & n<m))";
96.123 +Goal "(k*m < k*n) = (((Numeral0::real) < k & m<n) | (k < Numeral0 & n<m))";
96.124 by (simp_tac (simpset() addsimps [inst "z" "k" real_mult_commute,
96.125 real_mult_less_cancel2]) 1);
96.126 qed "real_mult_less_cancel1";
96.127
96.128 -Goal "!!k::real. (k*m <= k*n) = ((#0 < k --> m<=n) & (k < #0 --> n<=m))";
96.129 +Goal "!!k::real. (k*m <= k*n) = ((Numeral0 < k --> m<=n) & (k < Numeral0 --> n<=m))";
96.130 by (simp_tac (simpset() addsimps [linorder_not_less RS sym,
96.131 real_mult_less_cancel1]) 1);
96.132 qed "real_mult_le_cancel1";
96.133
96.134 -Goal "!!k::real. (k*m = k*n) = (k = #0 | m=n)";
96.135 +Goal "!!k::real. (k*m = k*n) = (k = Numeral0 | m=n)";
96.136 by (case_tac "k=0" 1);
96.137 by (auto_tac (claset(), simpset() addsimps [real_mult_left_cancel]));
96.138 qed "real_mult_eq_cancel1";
96.139
96.140 -Goal "!!k::real. (m*k = n*k) = (k = #0 | m=n)";
96.141 +Goal "!!k::real. (m*k = n*k) = (k = Numeral0 | m=n)";
96.142 by (case_tac "k=0" 1);
96.143 by (auto_tac (claset(), simpset() addsimps [real_mult_right_cancel]));
96.144 qed "real_mult_eq_cancel2";
96.145
96.146 -Goal "!!k::real. k~=#0 ==> (k*m) / (k*n) = (m/n)";
96.147 +Goal "!!k::real. k~=Numeral0 ==> (k*m) / (k*n) = (m/n)";
96.148 by (asm_simp_tac
96.149 (simpset() addsimps [real_divide_def, real_inverse_distrib]) 1);
96.150 by (subgoal_tac "k * m * (inverse k * inverse n) = \
96.151 @@ -178,7 +178,7 @@
96.152 qed "real_mult_div_cancel1";
96.153
96.154 (*For ExtractCommonTerm*)
96.155 -Goal "(k*m) / (k*n) = (if k = (#0::real) then #0 else m/n)";
96.156 +Goal "(k*m) / (k*n) = (if k = (Numeral0::real) then Numeral0 else m/n)";
96.157 by (simp_tac (simpset() addsimps [real_mult_div_cancel1]) 1);
96.158 qed "real_mult_div_cancel_disj";
96.159
96.160 @@ -276,34 +276,34 @@
96.161 set trace_simp;
96.162 fun test s = (Goal s; by (Simp_tac 1));
96.163
96.164 -test "#0 <= (y::real) * #-2";
96.165 -test "#9*x = #12 * (y::real)";
96.166 -test "(#9*x) / (#12 * (y::real)) = z";
96.167 -test "#9*x < #12 * (y::real)";
96.168 -test "#9*x <= #12 * (y::real)";
96.169 +test "Numeral0 <= (y::real) * # -2";
96.170 +test "# 9*x = # 12 * (y::real)";
96.171 +test "(# 9*x) / (# 12 * (y::real)) = z";
96.172 +test "# 9*x < # 12 * (y::real)";
96.173 +test "# 9*x <= # 12 * (y::real)";
96.174
96.175 -test "#-99*x = #132 * (y::real)";
96.176 -test "(#-99*x) / (#132 * (y::real)) = z";
96.177 -test "#-99*x < #132 * (y::real)";
96.178 -test "#-99*x <= #132 * (y::real)";
96.179 +test "# -99*x = # 132 * (y::real)";
96.180 +test "(# -99*x) / (# 132 * (y::real)) = z";
96.181 +test "# -99*x < # 132 * (y::real)";
96.182 +test "# -99*x <= # 132 * (y::real)";
96.183
96.184 -test "#999*x = #-396 * (y::real)";
96.185 -test "(#999*x) / (#-396 * (y::real)) = z";
96.186 -test "#999*x < #-396 * (y::real)";
96.187 -test "#999*x <= #-396 * (y::real)";
96.188 +test "# 999*x = # -396 * (y::real)";
96.189 +test "(# 999*x) / (# -396 * (y::real)) = z";
96.190 +test "# 999*x < # -396 * (y::real)";
96.191 +test "# 999*x <= # -396 * (y::real)";
96.192
96.193 -test "#-99*x = #-81 * (y::real)";
96.194 -test "(#-99*x) / (#-81 * (y::real)) = z";
96.195 -test "#-99*x <= #-81 * (y::real)";
96.196 -test "#-99*x < #-81 * (y::real)";
96.197 +test "# -99*x = # -81 * (y::real)";
96.198 +test "(# -99*x) / (# -81 * (y::real)) = z";
96.199 +test "# -99*x <= # -81 * (y::real)";
96.200 +test "# -99*x < # -81 * (y::real)";
96.201
96.202 -test "#-2 * x = #-1 * (y::real)";
96.203 -test "#-2 * x = -(y::real)";
96.204 -test "(#-2 * x) / (#-1 * (y::real)) = z";
96.205 -test "#-2 * x < -(y::real)";
96.206 -test "#-2 * x <= #-1 * (y::real)";
96.207 -test "-x < #-23 * (y::real)";
96.208 -test "-x <= #-23 * (y::real)";
96.209 +test "# -2 * x = # -1 * (y::real)";
96.210 +test "# -2 * x = -(y::real)";
96.211 +test "(# -2 * x) / (# -1 * (y::real)) = z";
96.212 +test "# -2 * x < -(y::real)";
96.213 +test "# -2 * x <= # -1 * (y::real)";
96.214 +test "-x < # -23 * (y::real)";
96.215 +test "-x <= # -23 * (y::real)";
96.216 *)
96.217
96.218
96.219 @@ -379,7 +379,7 @@
96.220
96.221 (*** Simplification of inequalities involving literal divisors ***)
96.222
96.223 -Goal "#0<z ==> ((x::real) <= y/z) = (x*z <= y)";
96.224 +Goal "Numeral0<z ==> ((x::real) <= y/z) = (x*z <= y)";
96.225 by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
96.226 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.227 by (etac ssubst 1);
96.228 @@ -388,7 +388,7 @@
96.229 qed "pos_real_le_divide_eq";
96.230 Addsimps [inst "z" "number_of ?w" pos_real_le_divide_eq];
96.231
96.232 -Goal "z<#0 ==> ((x::real) <= y/z) = (y <= x*z)";
96.233 +Goal "z<Numeral0 ==> ((x::real) <= y/z) = (y <= x*z)";
96.234 by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
96.235 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.236 by (etac ssubst 1);
96.237 @@ -397,7 +397,7 @@
96.238 qed "neg_real_le_divide_eq";
96.239 Addsimps [inst "z" "number_of ?w" neg_real_le_divide_eq];
96.240
96.241 -Goal "#0<z ==> (y/z <= (x::real)) = (y <= x*z)";
96.242 +Goal "Numeral0<z ==> (y/z <= (x::real)) = (y <= x*z)";
96.243 by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
96.244 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.245 by (etac ssubst 1);
96.246 @@ -406,7 +406,7 @@
96.247 qed "pos_real_divide_le_eq";
96.248 Addsimps [inst "z" "number_of ?w" pos_real_divide_le_eq];
96.249
96.250 -Goal "z<#0 ==> (y/z <= (x::real)) = (x*z <= y)";
96.251 +Goal "z<Numeral0 ==> (y/z <= (x::real)) = (x*z <= y)";
96.252 by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
96.253 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.254 by (etac ssubst 1);
96.255 @@ -415,7 +415,7 @@
96.256 qed "neg_real_divide_le_eq";
96.257 Addsimps [inst "z" "number_of ?w" neg_real_divide_le_eq];
96.258
96.259 -Goal "#0<z ==> ((x::real) < y/z) = (x*z < y)";
96.260 +Goal "Numeral0<z ==> ((x::real) < y/z) = (x*z < y)";
96.261 by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
96.262 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.263 by (etac ssubst 1);
96.264 @@ -424,7 +424,7 @@
96.265 qed "pos_real_less_divide_eq";
96.266 Addsimps [inst "z" "number_of ?w" pos_real_less_divide_eq];
96.267
96.268 -Goal "z<#0 ==> ((x::real) < y/z) = (y < x*z)";
96.269 +Goal "z<Numeral0 ==> ((x::real) < y/z) = (y < x*z)";
96.270 by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
96.271 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.272 by (etac ssubst 1);
96.273 @@ -433,7 +433,7 @@
96.274 qed "neg_real_less_divide_eq";
96.275 Addsimps [inst "z" "number_of ?w" neg_real_less_divide_eq];
96.276
96.277 -Goal "#0<z ==> (y/z < (x::real)) = (y < x*z)";
96.278 +Goal "Numeral0<z ==> (y/z < (x::real)) = (y < x*z)";
96.279 by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
96.280 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.281 by (etac ssubst 1);
96.282 @@ -442,7 +442,7 @@
96.283 qed "pos_real_divide_less_eq";
96.284 Addsimps [inst "z" "number_of ?w" pos_real_divide_less_eq];
96.285
96.286 -Goal "z<#0 ==> (y/z < (x::real)) = (x*z < y)";
96.287 +Goal "z<Numeral0 ==> (y/z < (x::real)) = (x*z < y)";
96.288 by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
96.289 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.290 by (etac ssubst 1);
96.291 @@ -451,7 +451,7 @@
96.292 qed "neg_real_divide_less_eq";
96.293 Addsimps [inst "z" "number_of ?w" neg_real_divide_less_eq];
96.294
96.295 -Goal "z~=#0 ==> ((x::real) = y/z) = (x*z = y)";
96.296 +Goal "z~=Numeral0 ==> ((x::real) = y/z) = (x*z = y)";
96.297 by (subgoal_tac "(x*z = y) = (x*z = (y/z)*z)" 1);
96.298 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.299 by (etac ssubst 1);
96.300 @@ -460,7 +460,7 @@
96.301 qed "real_eq_divide_eq";
96.302 Addsimps [inst "z" "number_of ?w" real_eq_divide_eq];
96.303
96.304 -Goal "z~=#0 ==> (y/z = (x::real)) = (y = x*z)";
96.305 +Goal "z~=Numeral0 ==> (y/z = (x::real)) = (y = x*z)";
96.306 by (subgoal_tac "(y = x*z) = ((y/z)*z = x*z)" 1);
96.307 by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2);
96.308 by (etac ssubst 1);
96.309 @@ -469,22 +469,22 @@
96.310 qed "real_divide_eq_eq";
96.311 Addsimps [inst "z" "number_of ?w" real_divide_eq_eq];
96.312
96.313 -Goal "(m/k = n/k) = (k = #0 | m = (n::real))";
96.314 -by (case_tac "k=#0" 1);
96.315 +Goal "(m/k = n/k) = (k = Numeral0 | m = (n::real))";
96.316 +by (case_tac "k=Numeral0" 1);
96.317 by (asm_simp_tac (simpset() addsimps [REAL_DIVIDE_ZERO]) 1);
96.318 by (asm_simp_tac (simpset() addsimps [real_divide_eq_eq, real_eq_divide_eq,
96.319 real_mult_eq_cancel2]) 1);
96.320 qed "real_divide_eq_cancel2";
96.321
96.322 -Goal "(k/m = k/n) = (k = #0 | m = (n::real))";
96.323 -by (case_tac "m=#0 | n = #0" 1);
96.324 +Goal "(k/m = k/n) = (k = Numeral0 | m = (n::real))";
96.325 +by (case_tac "m=Numeral0 | n = Numeral0" 1);
96.326 by (auto_tac (claset(),
96.327 simpset() addsimps [REAL_DIVIDE_ZERO, real_divide_eq_eq,
96.328 real_eq_divide_eq, real_mult_eq_cancel1]));
96.329 qed "real_divide_eq_cancel1";
96.330
96.331 -(*Moved from RealOrd.ML to use #0 *)
96.332 -Goal "[| #0 < r; #0 < x|] ==> (inverse x < inverse (r::real)) = (r < x)";
96.333 +(*Moved from RealOrd.ML to use Numeral0 *)
96.334 +Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x < inverse (r::real)) = (r < x)";
96.335 by (auto_tac (claset() addIs [real_inverse_less_swap], simpset()));
96.336 by (res_inst_tac [("t","r")] (real_inverse_inverse RS subst) 1);
96.337 by (res_inst_tac [("t","x")] (real_inverse_inverse RS subst) 1);
96.338 @@ -493,35 +493,35 @@
96.339 addsimps [real_inverse_gt_zero]));
96.340 qed "real_inverse_less_iff";
96.341
96.342 -Goal "[| #0 < r; #0 < x|] ==> (inverse x <= inverse r) = (r <= (x::real))";
96.343 +Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x <= inverse r) = (r <= (x::real))";
96.344 by (asm_simp_tac (simpset() addsimps [linorder_not_less RS sym,
96.345 real_inverse_less_iff]) 1);
96.346 qed "real_inverse_le_iff";
96.347
96.348 (** Division by 1, -1 **)
96.349
96.350 -Goal "(x::real)/#1 = x";
96.351 +Goal "(x::real)/Numeral1 = x";
96.352 by (simp_tac (simpset() addsimps [real_divide_def]) 1);
96.353 qed "real_divide_1";
96.354 Addsimps [real_divide_1];
96.355
96.356 -Goal "x/#-1 = -(x::real)";
96.357 +Goal "x/# -1 = -(x::real)";
96.358 by (Simp_tac 1);
96.359 qed "real_divide_minus1";
96.360 Addsimps [real_divide_minus1];
96.361
96.362 -Goal "#-1/(x::real) = - (#1/x)";
96.363 +Goal "# -1/(x::real) = - (Numeral1/x)";
96.364 by (simp_tac (simpset() addsimps [real_divide_def, real_minus_inverse]) 1);
96.365 qed "real_minus1_divide";
96.366 Addsimps [real_minus1_divide];
96.367
96.368 -Goal "[| (#0::real) < d1; #0 < d2 |] ==> EX e. #0 < e & e < d1 & e < d2";
96.369 -by (res_inst_tac [("x","(min d1 d2)/#2")] exI 1);
96.370 +Goal "[| (Numeral0::real) < d1; Numeral0 < d2 |] ==> EX e. Numeral0 < e & e < d1 & e < d2";
96.371 +by (res_inst_tac [("x","(min d1 d2)/# 2")] exI 1);
96.372 by (asm_simp_tac (simpset() addsimps [min_def]) 1);
96.373 qed "real_lbound_gt_zero";
96.374
96.375 Goal "(inverse x = inverse y) = (x = (y::real))";
96.376 -by (case_tac "x=#0 | y=#0" 1);
96.377 +by (case_tac "x=Numeral0 | y=Numeral0" 1);
96.378 by (auto_tac (claset(),
96.379 simpset() addsimps [real_inverse_eq_divide,
96.380 rename_numerals DIVISION_BY_ZERO]));
96.381 @@ -530,8 +530,8 @@
96.382 qed "real_inverse_eq_iff";
96.383 Addsimps [real_inverse_eq_iff];
96.384
96.385 -Goal "(z/x = z/y) = (z = #0 | x = (y::real))";
96.386 -by (case_tac "x=#0 | y=#0" 1);
96.387 +Goal "(z/x = z/y) = (z = Numeral0 | x = (y::real))";
96.388 +by (case_tac "x=Numeral0 | y=Numeral0" 1);
96.389 by (auto_tac (claset(),
96.390 simpset() addsimps [rename_numerals DIVISION_BY_ZERO]));
96.391 by (dres_inst_tac [("f","%u. x*y*u")] arg_cong 1);
96.392 @@ -569,7 +569,7 @@
96.393 qed "real_minus_equation";
96.394
96.395
96.396 -Goal "(x + - a = (#0::real)) = (x=a)";
96.397 +Goal "(x + - a = (Numeral0::real)) = (x=a)";
96.398 by (arith_tac 1);
96.399 qed "real_add_minus_iff";
96.400 Addsimps [real_add_minus_iff];
96.401 @@ -591,44 +591,44 @@
96.402 [real_minus_less, real_minus_le, real_minus_equation]);
96.403
96.404
96.405 -(*** Simprules combining x+y and #0 ***)
96.406 +(*** Simprules combining x+y and Numeral0 ***)
96.407
96.408 -Goal "(x+y = (#0::real)) = (y = -x)";
96.409 +Goal "(x+y = (Numeral0::real)) = (y = -x)";
96.410 by Auto_tac;
96.411 qed "real_add_eq_0_iff";
96.412 AddIffs [real_add_eq_0_iff];
96.413
96.414 -Goal "(x+y < (#0::real)) = (y < -x)";
96.415 +Goal "(x+y < (Numeral0::real)) = (y < -x)";
96.416 by Auto_tac;
96.417 qed "real_add_less_0_iff";
96.418 AddIffs [real_add_less_0_iff];
96.419
96.420 -Goal "((#0::real) < x+y) = (-x < y)";
96.421 +Goal "((Numeral0::real) < x+y) = (-x < y)";
96.422 by Auto_tac;
96.423 qed "real_0_less_add_iff";
96.424 AddIffs [real_0_less_add_iff];
96.425
96.426 -Goal "(x+y <= (#0::real)) = (y <= -x)";
96.427 +Goal "(x+y <= (Numeral0::real)) = (y <= -x)";
96.428 by Auto_tac;
96.429 qed "real_add_le_0_iff";
96.430 AddIffs [real_add_le_0_iff];
96.431
96.432 -Goal "((#0::real) <= x+y) = (-x <= y)";
96.433 +Goal "((Numeral0::real) <= x+y) = (-x <= y)";
96.434 by Auto_tac;
96.435 qed "real_0_le_add_iff";
96.436 AddIffs [real_0_le_add_iff];
96.437
96.438
96.439 -(** Simprules combining x-y and #0; see also real_less_iff_diff_less_0, etc.,
96.440 +(** Simprules combining x-y and Numeral0; see also real_less_iff_diff_less_0, etc.,
96.441 in RealBin
96.442 **)
96.443
96.444 -Goal "((#0::real) < x-y) = (y < x)";
96.445 +Goal "((Numeral0::real) < x-y) = (y < x)";
96.446 by Auto_tac;
96.447 qed "real_0_less_diff_iff";
96.448 AddIffs [real_0_less_diff_iff];
96.449
96.450 -Goal "((#0::real) <= x-y) = (y <= x)";
96.451 +Goal "((Numeral0::real) <= x-y) = (y <= x)";
96.452 by Auto_tac;
96.453 qed "real_0_le_diff_iff";
96.454 AddIffs [real_0_le_diff_iff];
96.455 @@ -647,11 +647,11 @@
96.456
96.457 (*** Density of the Reals ***)
96.458
96.459 -Goal "x < y ==> x < (x+y) / (#2::real)";
96.460 +Goal "x < y ==> x < (x+y) / (# 2::real)";
96.461 by Auto_tac;
96.462 qed "real_less_half_sum";
96.463
96.464 -Goal "x < y ==> (x+y)/(#2::real) < y";
96.465 +Goal "x < y ==> (x+y)/(# 2::real) < y";
96.466 by Auto_tac;
96.467 qed "real_gt_half_sum";
96.468
96.469 @@ -660,7 +660,7 @@
96.470 qed "real_dense";
96.471
96.472
96.473 -(*Replaces "inverse #nn" by #1/#nn *)
96.474 +(*Replaces "inverse #nn" by Numeral1/#nn *)
96.475 Addsimps [inst "x" "number_of ?w" real_inverse_eq_divide];
96.476
96.477
97.1 --- a/src/HOL/Real/RealBin.ML Fri Oct 05 21:50:37 2001 +0200
97.2 +++ b/src/HOL/Real/RealBin.ML Fri Oct 05 21:52:39 2001 +0200
97.3 @@ -13,11 +13,11 @@
97.4 qed "real_number_of";
97.5 Addsimps [real_number_of];
97.6
97.7 -Goalw [real_number_of_def] "(0::real) = #0";
97.8 +Goalw [real_number_of_def] "(0::real) = Numeral0";
97.9 by (simp_tac (simpset() addsimps [real_of_int_zero RS sym]) 1);
97.10 qed "zero_eq_numeral_0";
97.11
97.12 -Goalw [real_number_of_def] "1r = #1";
97.13 +Goalw [real_number_of_def] "1r = Numeral1";
97.14 by (simp_tac (simpset() addsimps [real_of_int_one RS sym]) 1);
97.15 qed "one_eq_numeral_1";
97.16
97.17 @@ -58,18 +58,18 @@
97.18
97.19 Addsimps [mult_real_number_of];
97.20
97.21 -Goal "(#2::real) = #1 + #1";
97.22 +Goal "(# 2::real) = Numeral1 + Numeral1";
97.23 by (Simp_tac 1);
97.24 val lemma = result();
97.25
97.26 (*For specialist use: NOT as default simprules*)
97.27 -Goal "#2 * z = (z+z::real)";
97.28 +Goal "# 2 * z = (z+z::real)";
97.29 by (simp_tac (simpset ()
97.30 addsimps [lemma, real_add_mult_distrib,
97.31 one_eq_numeral_1 RS sym]) 1);
97.32 qed "real_mult_2";
97.33
97.34 -Goal "z * #2 = (z+z::real)";
97.35 +Goal "z * # 2 = (z+z::real)";
97.36 by (stac real_mult_commute 1 THEN rtac real_mult_2 1);
97.37 qed "real_mult_2_right";
97.38
97.39 @@ -111,12 +111,12 @@
97.40
97.41 (*** New versions of existing theorems involving 0, 1r ***)
97.42
97.43 -Goal "- #1 = (#-1::real)";
97.44 +Goal "- Numeral1 = (# -1::real)";
97.45 by (Simp_tac 1);
97.46 qed "minus_numeral_one";
97.47
97.48
97.49 -(*Maps 0 to #0 and 1r to #1 and -1r to #-1*)
97.50 +(*Maps 0 to Numeral0 and 1r to Numeral1 and -1r to # -1*)
97.51 val real_numeral_ss =
97.52 HOL_ss addsimps [zero_eq_numeral_0, one_eq_numeral_1,
97.53 minus_numeral_one];
97.54 @@ -158,13 +158,13 @@
97.55
97.56 (** real from type "nat" **)
97.57
97.58 -Goal "(#0 < real (n::nat)) = (0<n)";
97.59 +Goal "(Numeral0 < real (n::nat)) = (0<n)";
97.60 by (simp_tac (HOL_ss addsimps [real_of_nat_less_iff,
97.61 rename_numerals real_of_nat_zero RS sym]) 1);
97.62 qed "zero_less_real_of_nat_iff";
97.63 AddIffs [zero_less_real_of_nat_iff];
97.64
97.65 -Goal "(#0 <= real (n::nat)) = (0<=n)";
97.66 +Goal "(Numeral0 <= real (n::nat)) = (0<=n)";
97.67 by (simp_tac (HOL_ss addsimps [real_of_nat_le_iff,
97.68 rename_numerals real_of_nat_zero RS sym]) 1);
97.69 qed "zero_le_real_of_nat_iff";
97.70 @@ -198,7 +198,7 @@
97.71
97.72 (*"neg" is used in rewrite rules for binary comparisons*)
97.73 Goal "real (number_of v :: nat) = \
97.74 -\ (if neg (number_of v) then #0 \
97.75 +\ (if neg (number_of v) then Numeral0 \
97.76 \ else (number_of v :: real))";
97.77 by (simp_tac
97.78 (HOL_ss addsimps [nat_number_of_def, real_of_nat_real_of_int,
97.79 @@ -212,15 +212,15 @@
97.80
97.81 (** Combining of literal coefficients in sums of products **)
97.82
97.83 -Goal "(x < y) = (x-y < (#0::real))";
97.84 +Goal "(x < y) = (x-y < (Numeral0::real))";
97.85 by (simp_tac (simpset() addsimps [real_diff_less_eq]) 1);
97.86 qed "real_less_iff_diff_less_0";
97.87
97.88 -Goal "(x = y) = (x-y = (#0::real))";
97.89 +Goal "(x = y) = (x-y = (Numeral0::real))";
97.90 by (simp_tac (simpset() addsimps [real_diff_eq_eq]) 1);
97.91 qed "real_eq_iff_diff_eq_0";
97.92
97.93 -Goal "(x <= y) = (x-y <= (#0::real))";
97.94 +Goal "(x <= y) = (x-y <= (Numeral0::real))";
97.95 by (simp_tac (simpset() addsimps [real_diff_le_eq]) 1);
97.96 qed "real_le_iff_diff_le_0";
97.97
97.98 @@ -295,7 +295,7 @@
97.99
97.100 val uminus_const = Const ("uminus", HOLogic.realT --> HOLogic.realT);
97.101
97.102 -(*Thus mk_sum[t] yields t+#0; longer sums don't have a trailing zero*)
97.103 +(*Thus mk_sum[t] yields t+Numeral0; longer sums don't have a trailing zero*)
97.104 fun mk_sum [] = zero
97.105 | mk_sum [t,u] = mk_plus (t, u)
97.106 | mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
97.107 @@ -355,7 +355,7 @@
97.108 handle TERM _ => find_first_coeff (t::past) u terms;
97.109
97.110
97.111 -(*Simplify #1*n and n*#1 to n*)
97.112 +(*Simplify Numeral1*n and n*Numeral1 to n*)
97.113 val add_0s = map rename_numerals
97.114 [real_add_zero_left, real_add_zero_right];
97.115 val mult_plus_1s = map rename_numerals
97.116 @@ -488,7 +488,7 @@
97.117 structure CombineNumeralsData =
97.118 struct
97.119 val add = op + : int*int -> int
97.120 - val mk_sum = long_mk_sum (*to work for e.g. #2*x + #3*x *)
97.121 + val mk_sum = long_mk_sum (*to work for e.g. # 2*x + # 3*x *)
97.122 val dest_sum = dest_sum
97.123 val mk_coeff = mk_coeff
97.124 val dest_coeff = dest_coeff 1
97.125 @@ -548,35 +548,35 @@
97.126 set trace_simp;
97.127 fun test s = (Goal s; by (Simp_tac 1));
97.128
97.129 -test "l + #2 + #2 + #2 + (l + #2) + (oo + #2) = (uu::real)";
97.130 +test "l + # 2 + # 2 + # 2 + (l + # 2) + (oo + # 2) = (uu::real)";
97.131
97.132 -test "#2*u = (u::real)";
97.133 -test "(i + j + #12 + (k::real)) - #15 = y";
97.134 -test "(i + j + #12 + (k::real)) - #5 = y";
97.135 +test "# 2*u = (u::real)";
97.136 +test "(i + j + # 12 + (k::real)) - # 15 = y";
97.137 +test "(i + j + # 12 + (k::real)) - # 5 = y";
97.138
97.139 test "y - b < (b::real)";
97.140 -test "y - (#3*b + c) < (b::real) - #2*c";
97.141 +test "y - (# 3*b + c) < (b::real) - # 2*c";
97.142
97.143 -test "(#2*x - (u*v) + y) - v*#3*u = (w::real)";
97.144 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u*#4 = (w::real)";
97.145 -test "(#2*x*u*v + (u*v)*#4 + y) - v*u = (w::real)";
97.146 -test "u*v - (x*u*v + (u*v)*#4 + y) = (w::real)";
97.147 +test "(# 2*x - (u*v) + y) - v*# 3*u = (w::real)";
97.148 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u*# 4 = (w::real)";
97.149 +test "(# 2*x*u*v + (u*v)*# 4 + y) - v*u = (w::real)";
97.150 +test "u*v - (x*u*v + (u*v)*# 4 + y) = (w::real)";
97.151
97.152 -test "(i + j + #12 + (k::real)) = u + #15 + y";
97.153 -test "(i + j*#2 + #12 + (k::real)) = j + #5 + y";
97.154 +test "(i + j + # 12 + (k::real)) = u + # 15 + y";
97.155 +test "(i + j*# 2 + # 12 + (k::real)) = j + # 5 + y";
97.156
97.157 -test "#2*y + #3*z + #6*w + #2*y + #3*z + #2*u = #2*y' + #3*z' + #6*w' + #2*y' + #3*z' + u + (vv::real)";
97.158 +test "# 2*y + # 3*z + # 6*w + # 2*y + # 3*z + # 2*u = # 2*y' + # 3*z' + # 6*w' + # 2*y' + # 3*z' + u + (vv::real)";
97.159
97.160 test "a + -(b+c) + b = (d::real)";
97.161 test "a + -(b+c) - b = (d::real)";
97.162
97.163 (*negative numerals*)
97.164 -test "(i + j + #-2 + (k::real)) - (u + #5 + y) = zz";
97.165 -test "(i + j + #-3 + (k::real)) < u + #5 + y";
97.166 -test "(i + j + #3 + (k::real)) < u + #-6 + y";
97.167 -test "(i + j + #-12 + (k::real)) - #15 = y";
97.168 -test "(i + j + #12 + (k::real)) - #-15 = y";
97.169 -test "(i + j + #-12 + (k::real)) - #-15 = y";
97.170 +test "(i + j + # -2 + (k::real)) - (u + # 5 + y) = zz";
97.171 +test "(i + j + # -3 + (k::real)) < u + # 5 + y";
97.172 +test "(i + j + # 3 + (k::real)) < u + # -6 + y";
97.173 +test "(i + j + # -12 + (k::real)) - # 15 = y";
97.174 +test "(i + j + # 12 + (k::real)) - # -15 = y";
97.175 +test "(i + j + # -12 + (k::real)) - # -15 = y";
97.176 *)
97.177
97.178
98.1 --- a/src/HOL/Real/RealDef.ML Fri Oct 05 21:50:37 2001 +0200
98.2 +++ b/src/HOL/Real/RealDef.ML Fri Oct 05 21:52:39 2001 +0200
98.3 @@ -130,7 +130,7 @@
98.4 by (asm_full_simp_tac (simpset() addsimps [real_minus_minus]) 1);
98.5 qed "inj_real_minus";
98.6
98.7 -Goalw [real_zero_def] "-0 = (0::real)";
98.8 +Goalw [real_zero_def] "- 0 = (0::real)";
98.9 by (simp_tac (simpset() addsimps [real_minus]) 1);
98.10 qed "real_minus_zero";
98.11
99.1 --- a/src/HOL/Real/RealDef.thy Fri Oct 05 21:50:37 2001 +0200
99.2 +++ b/src/HOL/Real/RealDef.thy Fri Oct 05 21:52:39 2001 +0200
99.3 @@ -69,7 +69,7 @@
99.4 defs
99.5
99.6 (*overloaded*)
99.7 - real_of_nat_def "real n == real_of_posnat n + (-1r)"
99.8 + real_of_nat_def "real n == real_of_posnat n + (- 1r)"
99.9
99.10 real_add_def
99.11 "P+Q == Abs_REAL(UN p1:Rep_REAL(P). UN p2:Rep_REAL(Q).
100.1 --- a/src/HOL/Real/RealOrd.ML Fri Oct 05 21:50:37 2001 +0200
100.2 +++ b/src/HOL/Real/RealOrd.ML Fri Oct 05 21:52:39 2001 +0200
100.3 @@ -230,7 +230,7 @@
100.4
100.5 Goal "EX (x::real). x < y";
100.6 by (rtac (real_add_zero_right RS subst) 1);
100.7 -by (res_inst_tac [("x","y + (-1r)")] exI 1);
100.8 +by (res_inst_tac [("x","y + (- 1r)")] exI 1);
100.9 by (auto_tac (claset() addSIs [real_add_less_mono2],
100.10 simpset() addsimps [real_minus_zero_less_iff2, real_zero_less_one]));
100.11 qed "real_less_Ex";
100.12 @@ -269,7 +269,7 @@
100.13 symmetric real_one_def]) 1);
100.14 qed "real_of_posnat_one";
100.15
100.16 -Goalw [real_of_posnat_def] "real_of_posnat 1' = 1r + 1r";
100.17 +Goalw [real_of_posnat_def] "real_of_posnat (Suc 0) = 1r + 1r";
100.18 by (simp_tac (simpset() addsimps [real_of_preal_def,real_one_def,
100.19 pnat_two_eq,real_add,prat_of_pnat_add RS sym,
100.20 preal_of_prat_add RS sym] @ pnat_add_ac) 1);
100.21 @@ -306,7 +306,7 @@
100.22 by (simp_tac (simpset() addsimps [real_of_posnat_one]) 1);
100.23 qed "real_of_nat_zero";
100.24
100.25 -Goalw [real_of_nat_def] "real (1') = 1r";
100.26 +Goalw [real_of_nat_def] "real (Suc 0) = 1r";
100.27 by (simp_tac (simpset() addsimps [real_of_posnat_two, real_add_assoc]) 1);
100.28 qed "real_of_nat_one";
100.29 Addsimps [real_of_nat_zero, real_of_nat_one];
101.1 --- a/src/HOL/Real/RealPow.ML Fri Oct 05 21:50:37 2001 +0200
101.2 +++ b/src/HOL/Real/RealPow.ML Fri Oct 05 21:52:39 2001 +0200
101.3 @@ -7,17 +7,17 @@
101.4
101.5 bind_thm ("realpow_Suc", thm "realpow_Suc");
101.6
101.7 -Goal "(#0::real) ^ (Suc n) = #0";
101.8 +Goal "(Numeral0::real) ^ (Suc n) = Numeral0";
101.9 by Auto_tac;
101.10 qed "realpow_zero";
101.11 Addsimps [realpow_zero];
101.12
101.13 -Goal "r ~= (#0::real) --> r ^ n ~= #0";
101.14 +Goal "r ~= (Numeral0::real) --> r ^ n ~= Numeral0";
101.15 by (induct_tac "n" 1);
101.16 by Auto_tac;
101.17 qed_spec_mp "realpow_not_zero";
101.18
101.19 -Goal "r ^ n = (#0::real) ==> r = #0";
101.20 +Goal "r ^ n = (Numeral0::real) ==> r = Numeral0";
101.21 by (rtac ccontr 1);
101.22 by (auto_tac (claset() addDs [realpow_not_zero], simpset()));
101.23 qed "realpow_zero_zero";
101.24 @@ -42,41 +42,41 @@
101.25 qed "realpow_one";
101.26 Addsimps [realpow_one];
101.27
101.28 -Goal "(r::real)^2 = r * r";
101.29 +Goal "(r::real)^ (Suc (Suc 0)) = r * r";
101.30 by (Simp_tac 1);
101.31 qed "realpow_two";
101.32
101.33 -Goal "(#0::real) < r --> #0 < r ^ n";
101.34 +Goal "(Numeral0::real) < r --> Numeral0 < r ^ n";
101.35 by (induct_tac "n" 1);
101.36 by (auto_tac (claset() addIs [rename_numerals real_mult_order],
101.37 simpset() addsimps [real_zero_less_one]));
101.38 qed_spec_mp "realpow_gt_zero";
101.39
101.40 -Goal "(#0::real) <= r --> #0 <= r ^ n";
101.41 +Goal "(Numeral0::real) <= r --> Numeral0 <= r ^ n";
101.42 by (induct_tac "n" 1);
101.43 by (auto_tac (claset(), simpset() addsimps [real_0_le_mult_iff]));
101.44 qed_spec_mp "realpow_ge_zero";
101.45
101.46 -Goal "(#0::real) <= x & x <= y --> x ^ n <= y ^ n";
101.47 +Goal "(Numeral0::real) <= x & x <= y --> x ^ n <= y ^ n";
101.48 by (induct_tac "n" 1);
101.49 by (auto_tac (claset() addSIs [real_mult_le_mono], simpset()));
101.50 by (asm_simp_tac (simpset() addsimps [realpow_ge_zero]) 1);
101.51 qed_spec_mp "realpow_le";
101.52
101.53 -Goal "(#0::real) < x & x < y & 0 < n --> x ^ n < y ^ n";
101.54 +Goal "(Numeral0::real) < x & x < y & 0 < n --> x ^ n < y ^ n";
101.55 by (induct_tac "n" 1);
101.56 by (auto_tac (claset() addIs [rename_numerals real_mult_less_mono, gr0I]
101.57 addDs [realpow_gt_zero],
101.58 simpset()));
101.59 qed_spec_mp "realpow_less";
101.60
101.61 -Goal "#1 ^ n = (#1::real)";
101.62 +Goal "Numeral1 ^ n = (Numeral1::real)";
101.63 by (induct_tac "n" 1);
101.64 by Auto_tac;
101.65 qed "realpow_eq_one";
101.66 Addsimps [realpow_eq_one];
101.67
101.68 -Goal "abs((#-1) ^ n) = (#1::real)";
101.69 +Goal "abs((# -1) ^ n) = (Numeral1::real)";
101.70 by (induct_tac "n" 1);
101.71 by (auto_tac (claset(), simpset() addsimps [abs_mult]));
101.72 qed "abs_realpow_minus_one";
101.73 @@ -87,53 +87,53 @@
101.74 by (auto_tac (claset(),simpset() addsimps real_mult_ac));
101.75 qed "realpow_mult";
101.76
101.77 -Goal "(#0::real) <= r^2";
101.78 +Goal "(Numeral0::real) <= r^ Suc (Suc 0)";
101.79 by (simp_tac (simpset() addsimps [rename_numerals real_le_square]) 1);
101.80 qed "realpow_two_le";
101.81 Addsimps [realpow_two_le];
101.82
101.83 -Goal "abs((x::real)^2) = x^2";
101.84 +Goal "abs((x::real)^Suc (Suc 0)) = x^Suc (Suc 0)";
101.85 by (simp_tac (simpset() addsimps [abs_eqI1,
101.86 rename_numerals real_le_square]) 1);
101.87 qed "abs_realpow_two";
101.88 Addsimps [abs_realpow_two];
101.89
101.90 -Goal "abs(x::real) ^ 2 = x^2";
101.91 +Goal "abs(x::real)^Suc (Suc 0) = x^Suc (Suc 0)";
101.92 by (simp_tac (simpset() addsimps [realpow_abs,abs_eqI1]
101.93 delsimps [realpow_Suc]) 1);
101.94 qed "realpow_two_abs";
101.95 Addsimps [realpow_two_abs];
101.96
101.97 -Goal "(#1::real) < r ==> #1 < r^2";
101.98 +Goal "(Numeral1::real) < r ==> Numeral1 < r^ (Suc (Suc 0))";
101.99 by Auto_tac;
101.100 by (cut_facts_tac [rename_numerals real_zero_less_one] 1);
101.101 -by (forw_inst_tac [("x","#0")] order_less_trans 1);
101.102 +by (forw_inst_tac [("x","Numeral0")] order_less_trans 1);
101.103 by (assume_tac 1);
101.104 -by (dres_inst_tac [("z","r"),("x","#1")]
101.105 +by (dres_inst_tac [("z","r"),("x","Numeral1")]
101.106 (rename_numerals real_mult_less_mono1) 1);
101.107 by (auto_tac (claset() addIs [order_less_trans], simpset()));
101.108 qed "realpow_two_gt_one";
101.109
101.110 -Goal "(#1::real) < r --> #1 <= r ^ n";
101.111 +Goal "(Numeral1::real) < r --> Numeral1 <= r ^ n";
101.112 by (induct_tac "n" 1);
101.113 by Auto_tac;
101.114 -by (subgoal_tac "#1*#1 <= r * r^n" 1);
101.115 +by (subgoal_tac "Numeral1*Numeral1 <= r * r^n" 1);
101.116 by (rtac real_mult_le_mono 2);
101.117 by Auto_tac;
101.118 qed_spec_mp "realpow_ge_one";
101.119
101.120 -Goal "(#1::real) <= r ==> #1 <= r ^ n";
101.121 +Goal "(Numeral1::real) <= r ==> Numeral1 <= r ^ n";
101.122 by (dtac order_le_imp_less_or_eq 1);
101.123 by (auto_tac (claset() addDs [realpow_ge_one], simpset()));
101.124 qed "realpow_ge_one2";
101.125
101.126 -Goal "(#1::real) <= #2 ^ n";
101.127 -by (res_inst_tac [("y","#1 ^ n")] order_trans 1);
101.128 +Goal "(Numeral1::real) <= # 2 ^ n";
101.129 +by (res_inst_tac [("y","Numeral1 ^ n")] order_trans 1);
101.130 by (rtac realpow_le 2);
101.131 by (auto_tac (claset() addIs [order_less_imp_le], simpset()));
101.132 qed "two_realpow_ge_one";
101.133
101.134 -Goal "real (n::nat) < #2 ^ n";
101.135 +Goal "real (n::nat) < # 2 ^ n";
101.136 by (induct_tac "n" 1);
101.137 by (auto_tac (claset(), simpset() addsimps [real_of_nat_Suc]));
101.138 by (stac real_mult_2 1);
101.139 @@ -142,92 +142,92 @@
101.140 qed "two_realpow_gt";
101.141 Addsimps [two_realpow_gt,two_realpow_ge_one];
101.142
101.143 -Goal "(#-1) ^ (#2*n) = (#1::real)";
101.144 +Goal "(# -1) ^ (# 2*n) = (Numeral1::real)";
101.145 by (induct_tac "n" 1);
101.146 by Auto_tac;
101.147 qed "realpow_minus_one";
101.148 Addsimps [realpow_minus_one];
101.149
101.150 -Goal "(#-1) ^ Suc (#2*n) = -(#1::real)";
101.151 +Goal "(# -1) ^ Suc (# 2*n) = -(Numeral1::real)";
101.152 by Auto_tac;
101.153 qed "realpow_minus_one_odd";
101.154 Addsimps [realpow_minus_one_odd];
101.155
101.156 -Goal "(#-1) ^ Suc (Suc (#2*n)) = (#1::real)";
101.157 +Goal "(# -1) ^ Suc (Suc (# 2*n)) = (Numeral1::real)";
101.158 by Auto_tac;
101.159 qed "realpow_minus_one_even";
101.160 Addsimps [realpow_minus_one_even];
101.161
101.162 -Goal "(#0::real) < r & r < (#1::real) --> r ^ Suc n < r ^ n";
101.163 +Goal "(Numeral0::real) < r & r < (Numeral1::real) --> r ^ Suc n < r ^ n";
101.164 by (induct_tac "n" 1);
101.165 by Auto_tac;
101.166 qed_spec_mp "realpow_Suc_less";
101.167
101.168 -Goal "#0 <= r & r < (#1::real) --> r ^ Suc n <= r ^ n";
101.169 +Goal "Numeral0 <= r & r < (Numeral1::real) --> r ^ Suc n <= r ^ n";
101.170 by (induct_tac "n" 1);
101.171 by (auto_tac (claset() addIs [order_less_imp_le]
101.172 addSDs [order_le_imp_less_or_eq],
101.173 simpset()));
101.174 qed_spec_mp "realpow_Suc_le";
101.175
101.176 -Goal "(#0::real) <= #0 ^ n";
101.177 +Goal "(Numeral0::real) <= Numeral0 ^ n";
101.178 by (case_tac "n" 1);
101.179 by Auto_tac;
101.180 qed "realpow_zero_le";
101.181 Addsimps [realpow_zero_le];
101.182
101.183 -Goal "#0 < r & r < (#1::real) --> r ^ Suc n <= r ^ n";
101.184 +Goal "Numeral0 < r & r < (Numeral1::real) --> r ^ Suc n <= r ^ n";
101.185 by (blast_tac (claset() addSIs [order_less_imp_le,
101.186 realpow_Suc_less]) 1);
101.187 qed_spec_mp "realpow_Suc_le2";
101.188
101.189 -Goal "[| #0 <= r; r < (#1::real) |] ==> r ^ Suc n <= r ^ n";
101.190 +Goal "[| Numeral0 <= r; r < (Numeral1::real) |] ==> r ^ Suc n <= r ^ n";
101.191 by (etac (order_le_imp_less_or_eq RS disjE) 1);
101.192 by (rtac realpow_Suc_le2 1);
101.193 by Auto_tac;
101.194 qed "realpow_Suc_le3";
101.195
101.196 -Goal "#0 <= r & r < (#1::real) & n < N --> r ^ N <= r ^ n";
101.197 +Goal "Numeral0 <= r & r < (Numeral1::real) & n < N --> r ^ N <= r ^ n";
101.198 by (induct_tac "N" 1);
101.199 by (ALLGOALS Asm_simp_tac);
101.200 by (Clarify_tac 1);
101.201 -by (subgoal_tac "r * r ^ na <= #1 * r ^ n" 1);
101.202 +by (subgoal_tac "r * r ^ na <= Numeral1 * r ^ n" 1);
101.203 by (Asm_full_simp_tac 1);
101.204 by (rtac real_mult_le_mono 1);
101.205 by (auto_tac (claset(), simpset() addsimps [realpow_ge_zero, less_Suc_eq]));
101.206 qed_spec_mp "realpow_less_le";
101.207
101.208 -Goal "[| #0 <= r; r < (#1::real); n <= N |] ==> r ^ N <= r ^ n";
101.209 +Goal "[| Numeral0 <= r; r < (Numeral1::real); n <= N |] ==> r ^ N <= r ^ n";
101.210 by (dres_inst_tac [("n","N")] le_imp_less_or_eq 1);
101.211 by (auto_tac (claset() addIs [realpow_less_le],
101.212 simpset()));
101.213 qed "realpow_le_le";
101.214
101.215 -Goal "[| #0 < r; r < (#1::real) |] ==> r ^ Suc n <= r";
101.216 +Goal "[| Numeral0 < r; r < (Numeral1::real) |] ==> r ^ Suc n <= r";
101.217 by (dres_inst_tac [("n","1"),("N","Suc n")]
101.218 (order_less_imp_le RS realpow_le_le) 1);
101.219 by Auto_tac;
101.220 qed "realpow_Suc_le_self";
101.221
101.222 -Goal "[| #0 < r; r < (#1::real) |] ==> r ^ Suc n < #1";
101.223 +Goal "[| Numeral0 < r; r < (Numeral1::real) |] ==> r ^ Suc n < Numeral1";
101.224 by (blast_tac (claset() addIs [realpow_Suc_le_self, order_le_less_trans]) 1);
101.225 qed "realpow_Suc_less_one";
101.226
101.227 -Goal "(#1::real) <= r --> r ^ n <= r ^ Suc n";
101.228 +Goal "(Numeral1::real) <= r --> r ^ n <= r ^ Suc n";
101.229 by (induct_tac "n" 1);
101.230 by Auto_tac;
101.231 qed_spec_mp "realpow_le_Suc";
101.232
101.233 -Goal "(#1::real) < r --> r ^ n < r ^ Suc n";
101.234 +Goal "(Numeral1::real) < r --> r ^ n < r ^ Suc n";
101.235 by (induct_tac "n" 1);
101.236 by Auto_tac;
101.237 qed_spec_mp "realpow_less_Suc";
101.238
101.239 -Goal "(#1::real) < r --> r ^ n <= r ^ Suc n";
101.240 +Goal "(Numeral1::real) < r --> r ^ n <= r ^ Suc n";
101.241 by (blast_tac (claset() addSIs [order_less_imp_le, realpow_less_Suc]) 1);
101.242 qed_spec_mp "realpow_le_Suc2";
101.243
101.244 -Goal "(#1::real) < r & n < N --> r ^ n <= r ^ N";
101.245 +Goal "(Numeral1::real) < r & n < N --> r ^ n <= r ^ N";
101.246 by (induct_tac "N" 1);
101.247 by Auto_tac;
101.248 by (ALLGOALS(forw_inst_tac [("n","na")] realpow_ge_one));
101.249 @@ -238,7 +238,7 @@
101.250 simpset() addsimps [less_Suc_eq]));
101.251 qed_spec_mp "realpow_gt_ge";
101.252
101.253 -Goal "(#1::real) <= r & n < N --> r ^ n <= r ^ N";
101.254 +Goal "(Numeral1::real) <= r & n < N --> r ^ n <= r ^ N";
101.255 by (induct_tac "N" 1);
101.256 by Auto_tac;
101.257 by (ALLGOALS(forw_inst_tac [("n","na")] realpow_ge_one2));
101.258 @@ -249,35 +249,35 @@
101.259 simpset() addsimps [less_Suc_eq]));
101.260 qed_spec_mp "realpow_gt_ge2";
101.261
101.262 -Goal "[| (#1::real) < r; n <= N |] ==> r ^ n <= r ^ N";
101.263 +Goal "[| (Numeral1::real) < r; n <= N |] ==> r ^ n <= r ^ N";
101.264 by (dres_inst_tac [("n","N")] le_imp_less_or_eq 1);
101.265 by (auto_tac (claset() addIs [realpow_gt_ge], simpset()));
101.266 qed "realpow_ge_ge";
101.267
101.268 -Goal "[| (#1::real) <= r; n <= N |] ==> r ^ n <= r ^ N";
101.269 +Goal "[| (Numeral1::real) <= r; n <= N |] ==> r ^ n <= r ^ N";
101.270 by (dres_inst_tac [("n","N")] le_imp_less_or_eq 1);
101.271 by (auto_tac (claset() addIs [realpow_gt_ge2], simpset()));
101.272 qed "realpow_ge_ge2";
101.273
101.274 -Goal "(#1::real) < r ==> r <= r ^ Suc n";
101.275 +Goal "(Numeral1::real) < r ==> r <= r ^ Suc n";
101.276 by (dres_inst_tac [("n","1"),("N","Suc n")]
101.277 realpow_ge_ge 1);
101.278 by Auto_tac;
101.279 qed_spec_mp "realpow_Suc_ge_self";
101.280
101.281 -Goal "(#1::real) <= r ==> r <= r ^ Suc n";
101.282 +Goal "(Numeral1::real) <= r ==> r <= r ^ Suc n";
101.283 by (dres_inst_tac [("n","1"),("N","Suc n")]
101.284 realpow_ge_ge2 1);
101.285 by Auto_tac;
101.286 qed_spec_mp "realpow_Suc_ge_self2";
101.287
101.288 -Goal "[| (#1::real) < r; 0 < n |] ==> r <= r ^ n";
101.289 +Goal "[| (Numeral1::real) < r; 0 < n |] ==> r <= r ^ n";
101.290 by (dtac (less_not_refl2 RS not0_implies_Suc) 1);
101.291 by (auto_tac (claset() addSIs
101.292 [realpow_Suc_ge_self],simpset()));
101.293 qed "realpow_ge_self";
101.294
101.295 -Goal "[| (#1::real) <= r; 0 < n |] ==> r <= r ^ n";
101.296 +Goal "[| (Numeral1::real) <= r; 0 < n |] ==> r <= r ^ n";
101.297 by (dtac (less_not_refl2 RS not0_implies_Suc) 1);
101.298 by (auto_tac (claset() addSIs [realpow_Suc_ge_self2],simpset()));
101.299 qed "realpow_ge_self2";
101.300 @@ -289,31 +289,31 @@
101.301 qed_spec_mp "realpow_minus_mult";
101.302 Addsimps [realpow_minus_mult];
101.303
101.304 -Goal "r ~= #0 ==> r * inverse r ^ 2 = inverse (r::real)";
101.305 +Goal "r ~= Numeral0 ==> r * inverse r ^Suc (Suc 0) = inverse (r::real)";
101.306 by (asm_simp_tac (simpset() addsimps [realpow_two,
101.307 real_mult_assoc RS sym]) 1);
101.308 qed "realpow_two_mult_inverse";
101.309 Addsimps [realpow_two_mult_inverse];
101.310
101.311 (* 05/00 *)
101.312 -Goal "(-x)^2 = (x::real) ^ 2";
101.313 +Goal "(-x)^Suc (Suc 0) = (x::real)^Suc (Suc 0)";
101.314 by (Simp_tac 1);
101.315 qed "realpow_two_minus";
101.316 Addsimps [realpow_two_minus];
101.317
101.318 -Goalw [real_diff_def] "(x::real)^2 - y^2 = (x - y) * (x + y)";
101.319 +Goalw [real_diff_def] "(x::real)^Suc (Suc 0) - y^Suc (Suc 0) = (x - y) * (x + y)";
101.320 by (simp_tac (simpset() addsimps
101.321 [real_add_mult_distrib2, real_add_mult_distrib,
101.322 real_minus_mult_eq2 RS sym] @ real_mult_ac) 1);
101.323 qed "realpow_two_diff";
101.324
101.325 -Goalw [real_diff_def] "((x::real)^2 = y^2) = (x = y | x = -y)";
101.326 +Goalw [real_diff_def] "((x::real)^Suc (Suc 0) = y^Suc (Suc 0)) = (x = y | x = -y)";
101.327 by (cut_inst_tac [("x","x"),("y","y")] realpow_two_diff 1);
101.328 by (auto_tac (claset(), simpset() delsimps [realpow_Suc]));
101.329 qed "realpow_two_disj";
101.330
101.331 (* used in Transc *)
101.332 -Goal "[|(x::real) ~= #0; m <= n |] ==> x ^ (n - m) = x ^ n * inverse (x ^ m)";
101.333 +Goal "[|(x::real) ~= Numeral0; m <= n |] ==> x ^ (n - m) = x ^ n * inverse (x ^ m)";
101.334 by (auto_tac (claset(),
101.335 simpset() addsimps [le_eq_less_or_eq, less_iff_Suc_add, realpow_add,
101.336 realpow_not_zero] @ real_mult_ac));
101.337 @@ -325,7 +325,7 @@
101.338 simpset() addsimps [real_of_nat_one, real_of_nat_mult]));
101.339 qed "realpow_real_of_nat";
101.340
101.341 -Goal "#0 < real (2 ^ n)";
101.342 +Goal "Numeral0 < real (Suc (Suc 0) ^ n)";
101.343 by (induct_tac "n" 1);
101.344 by (auto_tac (claset(),
101.345 simpset() addsimps [real_of_nat_mult, real_zero_less_mult_iff]));
101.346 @@ -333,7 +333,7 @@
101.347 Addsimps [realpow_real_of_nat_two_pos];
101.348
101.349
101.350 -Goal "(#0::real) <= x --> #0 <= y --> x ^ Suc n <= y ^ Suc n --> x <= y";
101.351 +Goal "(Numeral0::real) <= x --> Numeral0 <= y --> x ^ Suc n <= y ^ Suc n --> x <= y";
101.352 by (induct_tac "n" 1);
101.353 by Auto_tac;
101.354 by (asm_full_simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1);
101.355 @@ -345,7 +345,7 @@
101.356 by Auto_tac;
101.357 qed_spec_mp "realpow_increasing";
101.358
101.359 -Goal "[| (#0::real) <= x; #0 <= y; x ^ Suc n = y ^ Suc n |] ==> x = y";
101.360 +Goal "[| (Numeral0::real) <= x; Numeral0 <= y; x ^ Suc n = y ^ Suc n |] ==> x = y";
101.361 by (blast_tac (claset() addIs [realpow_increasing, order_antisym,
101.362 order_eq_refl, sym]) 1);
101.363 qed_spec_mp "realpow_Suc_cancel_eq";
102.1 --- a/src/HOL/Real/RealPow.thy Fri Oct 05 21:50:37 2001 +0200
102.2 +++ b/src/HOL/Real/RealPow.thy Fri Oct 05 21:52:39 2001 +0200
102.3 @@ -15,7 +15,7 @@
102.4 instance real :: power ..
102.5
102.6 primrec (realpow)
102.7 - realpow_0: "r ^ 0 = #1"
102.8 + realpow_0: "r ^ 0 = Numeral1"
102.9 realpow_Suc: "r ^ (Suc n) = (r::real) * (r ^ n)"
102.10
102.11 end
103.1 --- a/src/HOL/Real/ex/BinEx.thy Fri Oct 05 21:50:37 2001 +0200
103.2 +++ b/src/HOL/Real/ex/BinEx.thy Fri Oct 05 21:52:39 2001 +0200
103.3 @@ -15,67 +15,67 @@
103.4
103.5 text {* \medskip Addition *}
103.6
103.7 -lemma "(#1359::real) + #-2468 = #-1109"
103.8 +lemma "(# 1359::real) + # -2468 = # -1109"
103.9 by simp
103.10
103.11 -lemma "(#93746::real) + #-46375 = #47371"
103.12 +lemma "(# 93746::real) + # -46375 = # 47371"
103.13 by simp
103.14
103.15
103.16 text {* \medskip Negation *}
103.17
103.18 -lemma "- (#65745::real) = #-65745"
103.19 +lemma "- (# 65745::real) = # -65745"
103.20 by simp
103.21
103.22 -lemma "- (#-54321::real) = #54321"
103.23 +lemma "- (# -54321::real) = # 54321"
103.24 by simp
103.25
103.26
103.27 text {* \medskip Multiplication *}
103.28
103.29 -lemma "(#-84::real) * #51 = #-4284"
103.30 +lemma "(# -84::real) * # 51 = # -4284"
103.31 by simp
103.32
103.33 -lemma "(#255::real) * #255 = #65025"
103.34 +lemma "(# 255::real) * # 255 = # 65025"
103.35 by simp
103.36
103.37 -lemma "(#1359::real) * #-2468 = #-3354012"
103.38 +lemma "(# 1359::real) * # -2468 = # -3354012"
103.39 by simp
103.40
103.41
103.42 text {* \medskip Inequalities *}
103.43
103.44 -lemma "(#89::real) * #10 \<noteq> #889"
103.45 +lemma "(# 89::real) * # 10 \<noteq> # 889"
103.46 by simp
103.47
103.48 -lemma "(#13::real) < #18 - #4"
103.49 +lemma "(# 13::real) < # 18 - # 4"
103.50 by simp
103.51
103.52 -lemma "(#-345::real) < #-242 + #-100"
103.53 +lemma "(# -345::real) < # -242 + # -100"
103.54 by simp
103.55
103.56 -lemma "(#13557456::real) < #18678654"
103.57 +lemma "(# 13557456::real) < # 18678654"
103.58 by simp
103.59
103.60 -lemma "(#999999::real) \<le> (#1000001 + #1)-#2"
103.61 +lemma "(# 999999::real) \<le> (# 1000001 + Numeral1)-# 2"
103.62 by simp
103.63
103.64 -lemma "(#1234567::real) \<le> #1234567"
103.65 +lemma "(# 1234567::real) \<le> # 1234567"
103.66 by simp
103.67
103.68
103.69 text {* \medskip Tests *}
103.70
103.71 -lemma "(x + y = x) = (y = (#0::real))"
103.72 +lemma "(x + y = x) = (y = (Numeral0::real))"
103.73 by arith
103.74
103.75 -lemma "(x + y = y) = (x = (#0::real))"
103.76 +lemma "(x + y = y) = (x = (Numeral0::real))"
103.77 by arith
103.78
103.79 -lemma "(x + y = (#0::real)) = (x = -y)"
103.80 +lemma "(x + y = (Numeral0::real)) = (x = -y)"
103.81 by arith
103.82
103.83 -lemma "(x + y = (#0::real)) = (y = -x)"
103.84 +lemma "(x + y = (Numeral0::real)) = (y = -x)"
103.85 by arith
103.86
103.87 lemma "((x + y) < (x + z)) = (y < (z::real))"
103.88 @@ -123,25 +123,25 @@
103.89 lemma "\<not>(x \<le> y \<and> y < (x::real))"
103.90 by arith
103.91
103.92 -lemma "(-x < (#0::real)) = (#0 < x)"
103.93 +lemma "(-x < (Numeral0::real)) = (Numeral0 < x)"
103.94 by arith
103.95
103.96 -lemma "((#0::real) < -x) = (x < #0)"
103.97 +lemma "((Numeral0::real) < -x) = (x < Numeral0)"
103.98 by arith
103.99
103.100 -lemma "(-x \<le> (#0::real)) = (#0 \<le> x)"
103.101 +lemma "(-x \<le> (Numeral0::real)) = (Numeral0 \<le> x)"
103.102 by arith
103.103
103.104 -lemma "((#0::real) \<le> -x) = (x \<le> #0)"
103.105 +lemma "((Numeral0::real) \<le> -x) = (x \<le> Numeral0)"
103.106 by arith
103.107
103.108 lemma "(x::real) = y \<or> x < y \<or> y < x"
103.109 by arith
103.110
103.111 -lemma "(x::real) = #0 \<or> #0 < x \<or> #0 < -x"
103.112 +lemma "(x::real) = Numeral0 \<or> Numeral0 < x \<or> Numeral0 < -x"
103.113 by arith
103.114
103.115 -lemma "(#0::real) \<le> x \<or> #0 \<le> -x"
103.116 +lemma "(Numeral0::real) \<le> x \<or> Numeral0 \<le> -x"
103.117 by arith
103.118
103.119 lemma "((x::real) + y \<le> x + z) = (y \<le> z)"
103.120 @@ -156,16 +156,16 @@
103.121 lemma "(w::real) \<le> x \<and> y \<le> z ==> w + y \<le> x + z"
103.122 by arith
103.123
103.124 -lemma "(#0::real) \<le> x \<and> #0 \<le> y ==> #0 \<le> x + y"
103.125 +lemma "(Numeral0::real) \<le> x \<and> Numeral0 \<le> y ==> Numeral0 \<le> x + y"
103.126 by arith
103.127
103.128 -lemma "(#0::real) < x \<and> #0 < y ==> #0 < x + y"
103.129 +lemma "(Numeral0::real) < x \<and> Numeral0 < y ==> Numeral0 < x + y"
103.130 by arith
103.131
103.132 -lemma "(-x < y) = (#0 < x + (y::real))"
103.133 +lemma "(-x < y) = (Numeral0 < x + (y::real))"
103.134 by arith
103.135
103.136 -lemma "(x < -y) = (x + y < (#0::real))"
103.137 +lemma "(x < -y) = (x + y < (Numeral0::real))"
103.138 by arith
103.139
103.140 lemma "(y < x + -z) = (y + z < (x::real))"
103.141 @@ -174,7 +174,7 @@
103.142 lemma "(x + -y < z) = (x < z + (y::real))"
103.143 by arith
103.144
103.145 -lemma "x \<le> y ==> x < y + (#1::real)"
103.146 +lemma "x \<le> y ==> x < y + (Numeral1::real)"
103.147 by arith
103.148
103.149 lemma "(x - y) + y = (x::real)"
103.150 @@ -183,31 +183,31 @@
103.151 lemma "y + (x - y) = (x::real)"
103.152 by arith
103.153
103.154 -lemma "x - x = (#0::real)"
103.155 +lemma "x - x = (Numeral0::real)"
103.156 by arith
103.157
103.158 -lemma "(x - y = #0) = (x = (y::real))"
103.159 +lemma "(x - y = Numeral0) = (x = (y::real))"
103.160 by arith
103.161
103.162 -lemma "((#0::real) \<le> x + x) = (#0 \<le> x)"
103.163 +lemma "((Numeral0::real) \<le> x + x) = (Numeral0 \<le> x)"
103.164 by arith
103.165
103.166 -lemma "(-x \<le> x) = ((#0::real) \<le> x)"
103.167 +lemma "(-x \<le> x) = ((Numeral0::real) \<le> x)"
103.168 by arith
103.169
103.170 -lemma "(x \<le> -x) = (x \<le> (#0::real))"
103.171 +lemma "(x \<le> -x) = (x \<le> (Numeral0::real))"
103.172 by arith
103.173
103.174 -lemma "(-x = (#0::real)) = (x = #0)"
103.175 +lemma "(-x = (Numeral0::real)) = (x = Numeral0)"
103.176 by arith
103.177
103.178 lemma "-(x - y) = y - (x::real)"
103.179 by arith
103.180
103.181 -lemma "((#0::real) < x - y) = (y < x)"
103.182 +lemma "((Numeral0::real) < x - y) = (y < x)"
103.183 by arith
103.184
103.185 -lemma "((#0::real) \<le> x - y) = (y \<le> x)"
103.186 +lemma "((Numeral0::real) \<le> x - y) = (y \<le> x)"
103.187 by arith
103.188
103.189 lemma "(x + y) - x = (y::real)"
103.190 @@ -219,16 +219,16 @@
103.191 lemma "x < (y::real) ==> \<not>(x = y)"
103.192 by arith
103.193
103.194 -lemma "(x \<le> x + y) = ((#0::real) \<le> y)"
103.195 +lemma "(x \<le> x + y) = ((Numeral0::real) \<le> y)"
103.196 by arith
103.197
103.198 -lemma "(y \<le> x + y) = ((#0::real) \<le> x)"
103.199 +lemma "(y \<le> x + y) = ((Numeral0::real) \<le> x)"
103.200 by arith
103.201
103.202 -lemma "(x < x + y) = ((#0::real) < y)"
103.203 +lemma "(x < x + y) = ((Numeral0::real) < y)"
103.204 by arith
103.205
103.206 -lemma "(y < x + y) = ((#0::real) < x)"
103.207 +lemma "(y < x + y) = ((Numeral0::real) < x)"
103.208 by arith
103.209
103.210 lemma "(x - y) - x = (-y::real)"
103.211 @@ -258,10 +258,10 @@
103.212 lemma "(a + b) - (c + d) = (a - c) + (b - (d::real))"
103.213 by arith
103.214
103.215 -lemma "(#0::real) - x = -x"
103.216 +lemma "(Numeral0::real) - x = -x"
103.217 by arith
103.218
103.219 -lemma "x - (#0::real) = x"
103.220 +lemma "x - (Numeral0::real) = x"
103.221 by arith
103.222
103.223 lemma "w \<le> x \<and> y < z ==> w + y < x + (z::real)"
103.224 @@ -270,10 +270,10 @@
103.225 lemma "w < x \<and> y \<le> z ==> w + y < x + (z::real)"
103.226 by arith
103.227
103.228 -lemma "(#0::real) \<le> x \<and> #0 < y ==> #0 < x + (y::real)"
103.229 +lemma "(Numeral0::real) \<le> x \<and> Numeral0 < y ==> Numeral0 < x + (y::real)"
103.230 by arith
103.231
103.232 -lemma "(#0::real) < x \<and> #0 \<le> y ==> #0 < x + y"
103.233 +lemma "(Numeral0::real) < x \<and> Numeral0 \<le> y ==> Numeral0 < x + y"
103.234 by arith
103.235
103.236 lemma "-x - y = -(x + (y::real))"
103.237 @@ -303,7 +303,7 @@
103.238 lemma "x = y ==> x \<le> (y::real)"
103.239 by arith
103.240
103.241 -lemma "(#0::real) < x ==> \<not>(x = #0)"
103.242 +lemma "(Numeral0::real) < x ==> \<not>(x = Numeral0)"
103.243 by arith
103.244
103.245 lemma "(x + y) * (x - y) = (x * x) - (y * y)"
104.1 --- a/src/HOL/Real/ex/Sqrt_Irrational.thy Fri Oct 05 21:50:37 2001 +0200
104.2 +++ b/src/HOL/Real/ex/Sqrt_Irrational.thy Fri Oct 05 21:52:39 2001 +0200
104.3 @@ -15,7 +15,7 @@
104.4 syntax (output)
104.5 "_square" :: "'a => 'a" ("(_^2)" [1000] 999)
104.6 translations
104.7 - "x\<twosuperior>" == "x^2"
104.8 + "x\<twosuperior>" == "x^Suc (Suc 0)"
104.9
104.10
104.11 subsection {* The set of rational numbers *}
104.12 @@ -114,15 +114,15 @@
104.13 this formally :-).
104.14 *}
104.15
104.16 -theorem "x\<twosuperior> = real 2 ==> x \<notin> \<rat>"
104.17 +theorem "x\<twosuperior> = real (# 2::nat) ==> x \<notin> \<rat>"
104.18 proof (rule sqrt_prime_irrational)
104.19 {
104.20 - fix m assume dvd: "m dvd 2"
104.21 - hence "m \<le> 2" by (simp add: dvd_imp_le)
104.22 + fix m :: nat assume dvd: "m dvd # 2"
104.23 + hence "m \<le> # 2" by (simp add: dvd_imp_le)
104.24 moreover from dvd have "m \<noteq> 0" by (auto dest: dvd_0_left iff del: neq0_conv)
104.25 - ultimately have "m = 1 \<or> m = 2" by arith
104.26 + ultimately have "m = 1 \<or> m = # 2" by arith
104.27 }
104.28 - thus "2 \<in> prime" by (simp add: prime_def)
104.29 + thus "# 2 \<in> prime" by (simp add: prime_def)
104.30 qed
104.31
104.32 text {*
105.1 --- a/src/HOL/Real/real_arith0.ML Fri Oct 05 21:50:37 2001 +0200
105.2 +++ b/src/HOL/Real/real_arith0.ML Fri Oct 05 21:52:39 2001 +0200
105.3 @@ -118,7 +118,7 @@
105.4 qed "";
105.5
105.6 Goal "!!a::real. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |] \
105.7 -\ ==> #6*a <= #5*l+i";
105.8 +\ ==> # 6*a <= # 5*l+i";
105.9 by (fast_arith_tac 1);
105.10 qed "";
105.11 *)
106.1 --- a/src/HOL/Tools/numeral_syntax.ML Fri Oct 05 21:50:37 2001 +0200
106.2 +++ b/src/HOL/Tools/numeral_syntax.ML Fri Oct 05 21:52:39 2001 +0200
106.3 @@ -50,8 +50,12 @@
106.4 (case rev rev_digs of
106.5 ~1 :: bs => ("-", prefix_len (equal 1) bs)
106.6 | bs => ("", prefix_len (equal 0) bs));
106.7 - val num = string_of_int (abs (HOLogic.int_of rev_digs));
106.8 - in "#" ^ sign ^ implode (replicate zs "0") ^ num end;
106.9 + val i = HOLogic.int_of rev_digs;
106.10 + val num = string_of_int (abs i);
106.11 + in
106.12 + if i = 0 orelse i = 1 then raise Match
106.13 + else sign ^ implode (replicate zs "0") ^ num
106.14 + end;
106.15
106.16
106.17 (* translation of integer numeral tokens to and from bitstrings *)
107.1 --- a/src/HOL/UNITY/Comp/Counter.ML Fri Oct 05 21:50:37 2001 +0200
107.2 +++ b/src/HOL/UNITY/Comp/Counter.ML Fri Oct 05 21:52:39 2001 +0200
107.3 @@ -100,7 +100,7 @@
107.4
107.5 (* Compositional Proof *)
107.6
107.7 -Goal "(ALL i. i < I --> s (c i) = #0) --> sum I s = #0";
107.8 +Goal "(ALL i. i < I --> s (c i) = Numeral0) --> sum I s = Numeral0";
107.9 by (induct_tac "I" 1);
107.10 by Auto_tac;
107.11 qed "sum_0'";
108.1 --- a/src/HOL/UNITY/Comp/Counter.thy Fri Oct 05 21:50:37 2001 +0200
108.2 +++ b/src/HOL/UNITY/Comp/Counter.thy Fri Oct 05 21:52:39 2001 +0200
108.3 @@ -21,21 +21,21 @@
108.4 sumj :: "[nat, nat, state]=>int"
108.5
108.6 primrec (* sum I s = sigma_{i<I}. s (c i) *)
108.7 - "sum 0 s = #0"
108.8 + "sum 0 s = Numeral0"
108.9 "sum (Suc i) s = s (c i) + sum i s"
108.10
108.11 primrec
108.12 - "sumj 0 i s = #0"
108.13 + "sumj 0 i s = Numeral0"
108.14 "sumj (Suc n) i s = (if n=i then sum n s else s (c n) + sumj n i s)"
108.15
108.16 types command = "(state*state)set"
108.17
108.18 constdefs
108.19 a :: "nat=>command"
108.20 - "a i == {(s, s'). s'=s(c i:= s (c i) + #1, C:= s C + #1)}"
108.21 + "a i == {(s, s'). s'=s(c i:= s (c i) + Numeral1, C:= s C + Numeral1)}"
108.22
108.23 Component :: "nat => state program"
108.24 "Component i ==
108.25 - mk_program({s. s C = #0 & s (c i) = #0}, {a i},
108.26 + mk_program({s. s C = Numeral0 & s (c i) = Numeral0}, {a i},
108.27 UN G: preserves (%s. s (c i)). Acts G)"
108.28 end
109.1 --- a/src/HOL/UNITY/Comp/Counterc.ML Fri Oct 05 21:50:37 2001 +0200
109.2 +++ b/src/HOL/UNITY/Comp/Counterc.ML Fri Oct 05 21:52:39 2001 +0200
109.3 @@ -38,7 +38,7 @@
109.4 qed_spec_mp "sumj_ext";
109.5
109.6
109.7 -Goal "(ALL i. i<I --> c s i = #0) --> sum I s = #0";
109.8 +Goal "(ALL i. i<I --> c s i = Numeral0) --> sum I s = Numeral0";
109.9 by (induct_tac "I" 1);
109.10 by Auto_tac;
109.11 qed "sum0";
110.1 --- a/src/HOL/UNITY/Comp/Counterc.thy Fri Oct 05 21:50:37 2001 +0200
110.2 +++ b/src/HOL/UNITY/Comp/Counterc.thy Fri Oct 05 21:52:39 2001 +0200
110.3 @@ -24,20 +24,20 @@
110.4 sumj :: "[nat, nat, state]=>int"
110.5
110.6 primrec (* sum I s = sigma_{i<I}. c s i *)
110.7 - "sum 0 s = #0"
110.8 + "sum 0 s = Numeral0"
110.9 "sum (Suc i) s = (c s) i + sum i s"
110.10
110.11 primrec
110.12 - "sumj 0 i s = #0"
110.13 + "sumj 0 i s = Numeral0"
110.14 "sumj (Suc n) i s = (if n=i then sum n s else (c s) n + sumj n i s)"
110.15
110.16 types command = "(state*state)set"
110.17
110.18 constdefs
110.19 a :: "nat=>command"
110.20 - "a i == {(s, s'). (c s') i = (c s) i + #1 & (C s') = (C s) + #1}"
110.21 + "a i == {(s, s'). (c s') i = (c s) i + Numeral1 & (C s') = (C s) + Numeral1}"
110.22
110.23 Component :: "nat => state program"
110.24 - "Component i == mk_program({s. C s = #0 & (c s) i = #0}, {a i},
110.25 + "Component i == mk_program({s. C s = Numeral0 & (c s) i = Numeral0}, {a i},
110.26 UN G: preserves (%s. (c s) i). Acts G)"
110.27 end
111.1 --- a/src/HOL/UNITY/Comp/Priority.ML Fri Oct 05 21:50:37 2001 +0200
111.2 +++ b/src/HOL/UNITY/Comp/Priority.ML Fri Oct 05 21:52:39 2001 +0200
111.3 @@ -221,7 +221,7 @@
111.4
111.5 Goal "system: Acyclic leadsTo Highest i";
111.6 by (res_inst_tac [("f", "%s. above i s")] finite_psubset_induct 1);
111.7 -by (asm_simp_tac (simpset() delsimps [Highest_def, above_def]
111.8 +by (asm_simp_tac (simpset() delsimps [Highest_def, thm "above_def"]
111.9 addsimps [Highest_iff_above0,
111.10 vimage_def, finite_psubset_def]) 1);
111.11 by (Clarify_tac 1);
112.1 --- a/src/HOL/UNITY/Lift_prog.ML Fri Oct 05 21:50:37 2001 +0200
112.2 +++ b/src/HOL/UNITY/Lift_prog.ML Fri Oct 05 21:52:39 2001 +0200
112.3 @@ -309,7 +309,7 @@
112.4 Goal "(insert_map j t f)(i := s) = \
112.5 \ (if i=j then insert_map i s f \
112.6 \ else if i<j then insert_map j t (f(i:=s)) \
112.7 -\ else insert_map j t (f(i-1' := s)))";
112.8 +\ else insert_map j t (f(i - Suc 0 := s)))";
112.9 by (rtac ext 1);
112.10 by (auto_tac (claset(), simpset() addsplits [nat_diff_split]));
112.11 by (ALLGOALS arith_tac);
113.1 --- a/src/HOL/UNITY/Lift_prog.thy Fri Oct 05 21:50:37 2001 +0200
113.2 +++ b/src/HOL/UNITY/Lift_prog.thy Fri Oct 05 21:52:39 2001 +0200
113.3 @@ -13,7 +13,7 @@
113.4 insert_map :: "[nat, 'b, nat=>'b] => (nat=>'b)"
113.5 "insert_map i z f k == if k<i then f k
113.6 else if k=i then z
113.7 - else f(k-1)"
113.8 + else f(k - 1)"
113.9
113.10 delete_map :: "[nat, nat=>'b] => (nat=>'b)"
113.11 "delete_map i g k == if k<i then g k else g (Suc k)"
114.1 --- a/src/HOL/UNITY/Simple/Lift.ML Fri Oct 05 21:50:37 2001 +0200
114.2 +++ b/src/HOL/UNITY/Simple/Lift.ML Fri Oct 05 21:52:39 2001 +0200
114.3 @@ -142,7 +142,7 @@
114.4
114.5
114.6 (*lem_lift_4_1 *)
114.7 -Goal "#0 < N ==> \
114.8 +Goal "Numeral0 < N ==> \
114.9 \ Lift : (moving Int Req n Int {s. metric n s = N} Int \
114.10 \ {s. floor s ~: req s} Int {s. up s}) \
114.11 \ LeadsTo \
114.12 @@ -157,7 +157,7 @@
114.13
114.14
114.15 (*lem_lift_4_3 *)
114.16 -Goal "#0 < N ==> \
114.17 +Goal "Numeral0 < N ==> \
114.18 \ Lift : (moving Int Req n Int {s. metric n s = N} Int \
114.19 \ {s. floor s ~: req s} - {s. up s}) \
114.20 \ LeadsTo (moving Int Req n Int {s. metric n s < N})";
114.21 @@ -170,7 +170,7 @@
114.22 qed "E_thm12b";
114.23
114.24 (*lift_4*)
114.25 -Goal "#0<N ==> Lift : (moving Int Req n Int {s. metric n s = N} Int \
114.26 +Goal "Numeral0<N ==> Lift : (moving Int Req n Int {s. metric n s = N} Int \
114.27 \ {s. floor s ~: req s}) LeadsTo \
114.28 \ (moving Int Req n Int {s. metric n s < N})";
114.29 by (rtac ([subset_imp_LeadsTo, [E_thm12a, E_thm12b] MRS LeadsTo_Un]
114.30 @@ -182,7 +182,7 @@
114.31 (** towards lift_5 **)
114.32
114.33 (*lem_lift_5_3*)
114.34 -Goal "#0<N \
114.35 +Goal "Numeral0<N \
114.36 \ ==> Lift : (closed Int Req n Int {s. metric n s = N} Int goingup) LeadsTo \
114.37 \ (moving Int Req n Int {s. metric n s < N})";
114.38 by (cut_facts_tac [bounded] 1);
114.39 @@ -192,7 +192,7 @@
114.40
114.41
114.42 (*lem_lift_5_1 has ~goingup instead of goingdown*)
114.43 -Goal "#0<N ==> \
114.44 +Goal "Numeral0<N ==> \
114.45 \ Lift : (closed Int Req n Int {s. metric n s = N} Int goingdown) LeadsTo \
114.46 \ (moving Int Req n Int {s. metric n s < N})";
114.47 by (cut_facts_tac [bounded] 1);
114.48 @@ -203,14 +203,14 @@
114.49
114.50 (*lem_lift_5_0 proves an intersection involving ~goingup and goingup,
114.51 i.e. the trivial disjunction, leading to an asymmetrical proof.*)
114.52 -Goal "#0<N ==> Req n Int {s. metric n s = N} <= goingup Un goingdown";
114.53 +Goal "Numeral0<N ==> Req n Int {s. metric n s = N} <= goingup Un goingdown";
114.54 by (Clarify_tac 1);
114.55 by (auto_tac (claset(), metric_ss));
114.56 qed "E_thm16c";
114.57
114.58
114.59 (*lift_5*)
114.60 -Goal "#0<N ==> Lift : (closed Int Req n Int {s. metric n s = N}) LeadsTo \
114.61 +Goal "Numeral0<N ==> Lift : (closed Int Req n Int {s. metric n s = N}) LeadsTo \
114.62 \ (moving Int Req n Int {s. metric n s < N})";
114.63 by (rtac ([subset_imp_LeadsTo, [E_thm16a, E_thm16b] MRS LeadsTo_Un]
114.64 MRS LeadsTo_Trans) 1);
114.65 @@ -222,7 +222,7 @@
114.66 (** towards lift_3 **)
114.67
114.68 (*lemma used to prove lem_lift_3_1*)
114.69 -Goal "[| metric n s = #0; Min <= floor s; floor s <= Max |] ==> floor s = n";
114.70 +Goal "[| metric n s = Numeral0; Min <= floor s; floor s <= Max |] ==> floor s = n";
114.71 by (auto_tac (claset(), metric_ss));
114.72 qed "metric_eq_0D";
114.73
114.74 @@ -230,7 +230,7 @@
114.75
114.76
114.77 (*lem_lift_3_1*)
114.78 -Goal "Lift : (moving Int Req n Int {s. metric n s = #0}) LeadsTo \
114.79 +Goal "Lift : (moving Int Req n Int {s. metric n s = Numeral0}) LeadsTo \
114.80 \ (stopped Int atFloor n)";
114.81 by (cut_facts_tac [bounded] 1);
114.82 by (ensures_tac "request_act" 1);
114.83 @@ -246,7 +246,7 @@
114.84 qed "E_thm13";
114.85
114.86 (*lem_lift_3_6*)
114.87 -Goal "#0 < N ==> \
114.88 +Goal "Numeral0 < N ==> \
114.89 \ Lift : \
114.90 \ (stopped Int Req n Int {s. metric n s = N} Int {s. floor s : req s}) \
114.91 \ LeadsTo (opened Int Req n Int {s. metric n s = N})";
114.92 @@ -264,7 +264,7 @@
114.93
114.94 (** the final steps **)
114.95
114.96 -Goal "#0 < N ==> \
114.97 +Goal "Numeral0 < N ==> \
114.98 \ Lift : \
114.99 \ (moving Int Req n Int {s. metric n s = N} Int {s. floor s : req s}) \
114.100 \ LeadsTo (moving Int Req n Int {s. metric n s < N})";
114.101 @@ -274,7 +274,7 @@
114.102
114.103
114.104 (*Now we observe that our integer metric is really a natural number*)
114.105 -Goal "Lift : Always {s. #0 <= metric n s}";
114.106 +Goal "Lift : Always {s. Numeral0 <= metric n s}";
114.107 by (rtac (bounded RS Always_weaken) 1);
114.108 by (auto_tac (claset(), metric_ss));
114.109 qed "Always_nonneg";
114.110 @@ -283,8 +283,8 @@
114.111
114.112 Goal "Lift : (moving Int Req n) LeadsTo (stopped Int atFloor n)";
114.113 by (rtac (Always_nonneg RS integ_0_le_induct) 1);
114.114 -by (case_tac "#0 < z" 1);
114.115 -(*If z <= #0 then actually z = #0*)
114.116 +by (case_tac "Numeral0 < z" 1);
114.117 +(*If z <= Numeral0 then actually z = Numeral0*)
114.118 by (force_tac (claset() addIs [R_thm11, order_antisym],
114.119 simpset() addsimps [linorder_not_less]) 2);
114.120 by (rtac ([asm_rl, Un_upper1] MRS LeadsTo_weaken_R) 1);
115.1 --- a/src/HOL/UNITY/Simple/Lift.thy Fri Oct 05 21:50:37 2001 +0200
115.2 +++ b/src/HOL/UNITY/Simple/Lift.thy Fri Oct 05 21:52:39 2001 +0200
115.3 @@ -87,25 +87,25 @@
115.4 req_up :: "(state*state) set"
115.5 "req_up ==
115.6 {(s,s'). s' = s (|stop :=False,
115.7 - floor := floor s + #1,
115.8 + floor := floor s + Numeral1,
115.9 up := True|)
115.10 & s : (ready Int goingup)}"
115.11
115.12 req_down :: "(state*state) set"
115.13 "req_down ==
115.14 {(s,s'). s' = s (|stop :=False,
115.15 - floor := floor s - #1,
115.16 + floor := floor s - Numeral1,
115.17 up := False|)
115.18 & s : (ready Int goingdown)}"
115.19
115.20 move_up :: "(state*state) set"
115.21 "move_up ==
115.22 - {(s,s'). s' = s (|floor := floor s + #1|)
115.23 + {(s,s'). s' = s (|floor := floor s + Numeral1|)
115.24 & ~ stop s & up s & floor s ~: req s}"
115.25
115.26 move_down :: "(state*state) set"
115.27 "move_down ==
115.28 - {(s,s'). s' = s (|floor := floor s - #1|)
115.29 + {(s,s'). s' = s (|floor := floor s - Numeral1|)
115.30 & ~ stop s & ~ up s & floor s ~: req s}"
115.31
115.32 (*This action is omitted from prior treatments, which therefore are
115.33 @@ -156,7 +156,7 @@
115.34 else
115.35 if n < floor s then (if up s then (Max - floor s) + (Max-n)
115.36 else floor s - n)
115.37 - else #0"
115.38 + else Numeral0"
115.39
115.40 locale floor =
115.41 fixes
116.1 --- a/src/HOL/UNITY/Simple/Mutex.ML Fri Oct 05 21:50:37 2001 +0200
116.2 +++ b/src/HOL/UNITY/Simple/Mutex.ML Fri Oct 05 21:52:39 2001 +0200
116.3 @@ -25,7 +25,7 @@
116.4 qed "IV";
116.5
116.6 (*The safety property: mutual exclusion*)
116.7 -Goal "Mutex : Always {s. ~ (m s = #3 & n s = #3)}";
116.8 +Goal "Mutex : Always {s. ~ (m s = # 3 & n s = # 3)}";
116.9 by (rtac ([IU, IV] MRS Always_Int_I RS Always_weaken) 1);
116.10 by Auto_tac;
116.11 qed "mutual_exclusion";
116.12 @@ -42,45 +42,45 @@
116.13 getgoal 1;
116.14
116.15
116.16 -Goal "((#1::int) <= i & i <= #3) = (i = #1 | i = #2 | i = #3)";
116.17 +Goal "((Numeral1::int) <= i & i <= # 3) = (i = Numeral1 | i = # 2 | i = # 3)";
116.18 by (arith_tac 1);
116.19 qed "eq_123";
116.20
116.21
116.22 (*** Progress for U ***)
116.23
116.24 -Goalw [Unless_def] "Mutex : {s. m s=#2} Unless {s. m s=#3}";
116.25 +Goalw [Unless_def] "Mutex : {s. m s=# 2} Unless {s. m s=# 3}";
116.26 by (constrains_tac 1);
116.27 qed "U_F0";
116.28
116.29 -Goal "Mutex : {s. m s=#1} LeadsTo {s. p s = v s & m s = #2}";
116.30 +Goal "Mutex : {s. m s=Numeral1} LeadsTo {s. p s = v s & m s = # 2}";
116.31 by (ensures_tac "U1" 1);
116.32 qed "U_F1";
116.33
116.34 -Goal "Mutex : {s. ~ p s & m s = #2} LeadsTo {s. m s = #3}";
116.35 +Goal "Mutex : {s. ~ p s & m s = # 2} LeadsTo {s. m s = # 3}";
116.36 by (cut_facts_tac [IU] 1);
116.37 by (ensures_tac "U2" 1);
116.38 qed "U_F2";
116.39
116.40 -Goal "Mutex : {s. m s = #3} LeadsTo {s. p s}";
116.41 -by (res_inst_tac [("B", "{s. m s = #4}")] LeadsTo_Trans 1);
116.42 +Goal "Mutex : {s. m s = # 3} LeadsTo {s. p s}";
116.43 +by (res_inst_tac [("B", "{s. m s = # 4}")] LeadsTo_Trans 1);
116.44 by (ensures_tac "U4" 2);
116.45 by (ensures_tac "U3" 1);
116.46 qed "U_F3";
116.47
116.48 -Goal "Mutex : {s. m s = #2} LeadsTo {s. p s}";
116.49 +Goal "Mutex : {s. m s = # 2} LeadsTo {s. p s}";
116.50 by (rtac ([LeadsTo_weaken_L, Int_lower2 RS subset_imp_LeadsTo]
116.51 MRS LeadsTo_Diff) 1);
116.52 by (rtac ([U_F2, U_F3] MRS LeadsTo_Trans) 1);
116.53 by (auto_tac (claset() addSEs [less_SucE], simpset()));
116.54 val U_lemma2 = result();
116.55
116.56 -Goal "Mutex : {s. m s = #1} LeadsTo {s. p s}";
116.57 +Goal "Mutex : {s. m s = Numeral1} LeadsTo {s. p s}";
116.58 by (rtac ([U_F1 RS LeadsTo_weaken_R, U_lemma2] MRS LeadsTo_Trans) 1);
116.59 by (Blast_tac 1);
116.60 val U_lemma1 = result();
116.61
116.62 -Goal "Mutex : {s. #1 <= m s & m s <= #3} LeadsTo {s. p s}";
116.63 +Goal "Mutex : {s. Numeral1 <= m s & m s <= # 3} LeadsTo {s. p s}";
116.64 by (simp_tac (simpset() addsimps [eq_123, Collect_disj_eq, LeadsTo_Un_distrib,
116.65 U_lemma1, U_lemma2, U_F3] ) 1);
116.66 val U_lemma123 = result();
116.67 @@ -95,38 +95,38 @@
116.68 (*** Progress for V ***)
116.69
116.70
116.71 -Goalw [Unless_def] "Mutex : {s. n s=#2} Unless {s. n s=#3}";
116.72 +Goalw [Unless_def] "Mutex : {s. n s=# 2} Unless {s. n s=# 3}";
116.73 by (constrains_tac 1);
116.74 qed "V_F0";
116.75
116.76 -Goal "Mutex : {s. n s=#1} LeadsTo {s. p s = (~ u s) & n s = #2}";
116.77 +Goal "Mutex : {s. n s=Numeral1} LeadsTo {s. p s = (~ u s) & n s = # 2}";
116.78 by (ensures_tac "V1" 1);
116.79 qed "V_F1";
116.80
116.81 -Goal "Mutex : {s. p s & n s = #2} LeadsTo {s. n s = #3}";
116.82 +Goal "Mutex : {s. p s & n s = # 2} LeadsTo {s. n s = # 3}";
116.83 by (cut_facts_tac [IV] 1);
116.84 by (ensures_tac "V2" 1);
116.85 qed "V_F2";
116.86
116.87 -Goal "Mutex : {s. n s = #3} LeadsTo {s. ~ p s}";
116.88 -by (res_inst_tac [("B", "{s. n s = #4}")] LeadsTo_Trans 1);
116.89 +Goal "Mutex : {s. n s = # 3} LeadsTo {s. ~ p s}";
116.90 +by (res_inst_tac [("B", "{s. n s = # 4}")] LeadsTo_Trans 1);
116.91 by (ensures_tac "V4" 2);
116.92 by (ensures_tac "V3" 1);
116.93 qed "V_F3";
116.94
116.95 -Goal "Mutex : {s. n s = #2} LeadsTo {s. ~ p s}";
116.96 +Goal "Mutex : {s. n s = # 2} LeadsTo {s. ~ p s}";
116.97 by (rtac ([LeadsTo_weaken_L, Int_lower2 RS subset_imp_LeadsTo]
116.98 MRS LeadsTo_Diff) 1);
116.99 by (rtac ([V_F2, V_F3] MRS LeadsTo_Trans) 1);
116.100 by (auto_tac (claset() addSEs [less_SucE], simpset()));
116.101 val V_lemma2 = result();
116.102
116.103 -Goal "Mutex : {s. n s = #1} LeadsTo {s. ~ p s}";
116.104 +Goal "Mutex : {s. n s = Numeral1} LeadsTo {s. ~ p s}";
116.105 by (rtac ([V_F1 RS LeadsTo_weaken_R, V_lemma2] MRS LeadsTo_Trans) 1);
116.106 by (Blast_tac 1);
116.107 val V_lemma1 = result();
116.108
116.109 -Goal "Mutex : {s. #1 <= n s & n s <= #3} LeadsTo {s. ~ p s}";
116.110 +Goal "Mutex : {s. Numeral1 <= n s & n s <= # 3} LeadsTo {s. ~ p s}";
116.111 by (simp_tac (simpset() addsimps [eq_123, Collect_disj_eq, LeadsTo_Un_distrib,
116.112 V_lemma1, V_lemma2, V_F3] ) 1);
116.113 val V_lemma123 = result();
116.114 @@ -142,7 +142,7 @@
116.115 (** Absence of starvation **)
116.116
116.117 (*Misra's F6*)
116.118 -Goal "Mutex : {s. m s = #1} LeadsTo {s. m s = #3}";
116.119 +Goal "Mutex : {s. m s = Numeral1} LeadsTo {s. m s = # 3}";
116.120 by (rtac (LeadsTo_cancel2 RS LeadsTo_Un_duplicate) 1);
116.121 by (rtac U_F2 2);
116.122 by (simp_tac (simpset() addsimps [Collect_conj_eq] ) 1);
116.123 @@ -154,7 +154,7 @@
116.124 qed "m1_Leadsto_3";
116.125
116.126 (*The same for V*)
116.127 -Goal "Mutex : {s. n s = #1} LeadsTo {s. n s = #3}";
116.128 +Goal "Mutex : {s. n s = Numeral1} LeadsTo {s. n s = # 3}";
116.129 by (rtac (LeadsTo_cancel2 RS LeadsTo_Un_duplicate) 1);
116.130 by (rtac V_F2 2);
116.131 by (simp_tac (simpset() addsimps [Collect_conj_eq] ) 1);
117.1 --- a/src/HOL/UNITY/Simple/Mutex.thy Fri Oct 05 21:50:37 2001 +0200
117.2 +++ b/src/HOL/UNITY/Simple/Mutex.thy Fri Oct 05 21:52:39 2001 +0200
117.3 @@ -22,39 +22,39 @@
117.4 (** The program for process U **)
117.5
117.6 U0 :: command
117.7 - "U0 == {(s,s'). s' = s (|u:=True, m:=#1|) & m s = #0}"
117.8 + "U0 == {(s,s'). s' = s (|u:=True, m:=Numeral1|) & m s = Numeral0}"
117.9
117.10 U1 :: command
117.11 - "U1 == {(s,s'). s' = s (|p:= v s, m:=#2|) & m s = #1}"
117.12 + "U1 == {(s,s'). s' = s (|p:= v s, m:=# 2|) & m s = Numeral1}"
117.13
117.14 U2 :: command
117.15 - "U2 == {(s,s'). s' = s (|m:=#3|) & ~ p s & m s = #2}"
117.16 + "U2 == {(s,s'). s' = s (|m:=# 3|) & ~ p s & m s = # 2}"
117.17
117.18 U3 :: command
117.19 - "U3 == {(s,s'). s' = s (|u:=False, m:=#4|) & m s = #3}"
117.20 + "U3 == {(s,s'). s' = s (|u:=False, m:=# 4|) & m s = # 3}"
117.21
117.22 U4 :: command
117.23 - "U4 == {(s,s'). s' = s (|p:=True, m:=#0|) & m s = #4}"
117.24 + "U4 == {(s,s'). s' = s (|p:=True, m:=Numeral0|) & m s = # 4}"
117.25
117.26 (** The program for process V **)
117.27
117.28 V0 :: command
117.29 - "V0 == {(s,s'). s' = s (|v:=True, n:=#1|) & n s = #0}"
117.30 + "V0 == {(s,s'). s' = s (|v:=True, n:=Numeral1|) & n s = Numeral0}"
117.31
117.32 V1 :: command
117.33 - "V1 == {(s,s'). s' = s (|p:= ~ u s, n:=#2|) & n s = #1}"
117.34 + "V1 == {(s,s'). s' = s (|p:= ~ u s, n:=# 2|) & n s = Numeral1}"
117.35
117.36 V2 :: command
117.37 - "V2 == {(s,s'). s' = s (|n:=#3|) & p s & n s = #2}"
117.38 + "V2 == {(s,s'). s' = s (|n:=# 3|) & p s & n s = # 2}"
117.39
117.40 V3 :: command
117.41 - "V3 == {(s,s'). s' = s (|v:=False, n:=#4|) & n s = #3}"
117.42 + "V3 == {(s,s'). s' = s (|v:=False, n:=# 4|) & n s = # 3}"
117.43
117.44 V4 :: command
117.45 - "V4 == {(s,s'). s' = s (|p:=False, n:=#0|) & n s = #4}"
117.46 + "V4 == {(s,s'). s' = s (|p:=False, n:=Numeral0|) & n s = # 4}"
117.47
117.48 Mutex :: state program
117.49 - "Mutex == mk_program ({s. ~ u s & ~ v s & m s = #0 & n s = #0},
117.50 + "Mutex == mk_program ({s. ~ u s & ~ v s & m s = Numeral0 & n s = Numeral0},
117.51 {U0, U1, U2, U3, U4, V0, V1, V2, V3, V4},
117.52 UNIV)"
117.53
117.54 @@ -62,15 +62,15 @@
117.55 (** The correct invariants **)
117.56
117.57 IU :: state set
117.58 - "IU == {s. (u s = (#1 <= m s & m s <= #3)) & (m s = #3 --> ~ p s)}"
117.59 + "IU == {s. (u s = (Numeral1 <= m s & m s <= # 3)) & (m s = # 3 --> ~ p s)}"
117.60
117.61 IV :: state set
117.62 - "IV == {s. (v s = (#1 <= n s & n s <= #3)) & (n s = #3 --> p s)}"
117.63 + "IV == {s. (v s = (Numeral1 <= n s & n s <= # 3)) & (n s = # 3 --> p s)}"
117.64
117.65 (** The faulty invariant (for U alone) **)
117.66
117.67 bad_IU :: state set
117.68 - "bad_IU == {s. (u s = (#1 <= m s & m s <= #3)) &
117.69 - (#3 <= m s & m s <= #4 --> ~ p s)}"
117.70 + "bad_IU == {s. (u s = (Numeral1 <= m s & m s <= # 3)) &
117.71 + (# 3 <= m s & m s <= # 4 --> ~ p s)}"
117.72
117.73 end
118.1 --- a/src/HOL/UNITY/Simple/Network.ML Fri Oct 05 21:50:37 2001 +0200
118.2 +++ b/src/HOL/UNITY/Simple/Network.ML Fri Oct 05 21:52:39 2001 +0200
118.3 @@ -14,11 +14,11 @@
118.4 \ !! m. F : stable {s. s(Aproc,Rcvd) <= s(Bproc,Sent)}; \
118.5 \ !! m proc. F : stable {s. m <= s(proc,Sent)}; \
118.6 \ !! n proc. F : stable {s. n <= s(proc,Rcvd)}; \
118.7 -\ !! m proc. F : {s. s(proc,Idle) = 1' & s(proc,Rcvd) = m} co \
118.8 -\ {s. s(proc,Rcvd) = m --> s(proc,Idle) = 1'}; \
118.9 -\ !! n proc. F : {s. s(proc,Idle) = 1' & s(proc,Sent) = n} co \
118.10 +\ !! m proc. F : {s. s(proc,Idle) = Suc 0 & s(proc,Rcvd) = m} co \
118.11 +\ {s. s(proc,Rcvd) = m --> s(proc,Idle) = Suc 0}; \
118.12 +\ !! n proc. F : {s. s(proc,Idle) = Suc 0 & s(proc,Sent) = n} co \
118.13 \ {s. s(proc,Sent) = n} \
118.14 -\ |] ==> F : stable {s. s(Aproc,Idle) = 1' & s(Bproc,Idle) = 1' & \
118.15 +\ |] ==> F : stable {s. s(Aproc,Idle) = Suc 0 & s(Bproc,Idle) = Suc 0 & \
118.16 \ s(Aproc,Sent) = s(Bproc,Rcvd) & \
118.17 \ s(Bproc,Sent) = s(Aproc,Rcvd) & \
118.18 \ s(Aproc,Rcvd) = m & s(Bproc,Rcvd) = n}";
119.1 --- a/src/HOL/UNITY/Simple/Reachability.ML Fri Oct 05 21:50:37 2001 +0200
119.2 +++ b/src/HOL/UNITY/Simple/Reachability.ML Fri Oct 05 21:52:39 2001 +0200
119.3 @@ -162,7 +162,7 @@
119.4
119.5
119.6 Goalw [nmsg_gte_def, nmsg_lte_def,nmsg_gt_def, nmsg_eq_def]
119.7 - "((nmsg_gte 0 (v,w) Int nmsg_lte 1' (v,w)) Int (- nmsg_gt 0 (v,w) Un A)) \
119.8 + "((nmsg_gte 0 (v,w) Int nmsg_lte (Suc 0) (v,w)) Int (- nmsg_gt 0 (v,w) Un A)) \
119.9 \ <= A Un nmsg_eq 0 (v,w)";
119.10 by Auto_tac;
119.11 qed "lemma4";
119.12 @@ -170,7 +170,7 @@
119.13
119.14 Goalw [nmsg_gte_def,nmsg_lte_def,nmsg_gt_def, nmsg_eq_def]
119.15 "reachable v Int nmsg_eq 0 (v,w) = \
119.16 -\ ((nmsg_gte 0 (v,w) Int nmsg_lte 1' (v,w)) Int \
119.17 +\ ((nmsg_gte 0 (v,w) Int nmsg_lte (Suc 0) (v,w)) Int \
119.18 \ (reachable v Int nmsg_lte 0 (v,w)))";
119.19 by Auto_tac;
119.20 qed "lemma5";
120.1 --- a/src/HOL/UNITY/Simple/Reachability.thy Fri Oct 05 21:50:37 2001 +0200
120.2 +++ b/src/HOL/UNITY/Simple/Reachability.thy Fri Oct 05 21:52:39 2001 +0200
120.3 @@ -60,7 +60,7 @@
120.4
120.5 MA4 "[|(v,w) : E|] ==> F : Always (-(reachable v) Un (nmsg_gt 0 (v,w)) Un (reachable w))"
120.6
120.7 - MA5 "[|v:V;w:V|] ==> F : Always (nmsg_gte 0 (v,w) Int nmsg_lte 1' (v,w))"
120.8 + MA5 "[|v:V;w:V|] ==> F : Always (nmsg_gte 0 (v,w) Int nmsg_lte (Suc 0) (v,w))"
120.9
120.10 MA6 "[|v:V|] ==> F : Stable (reachable v)"
120.11
121.1 --- a/src/HOL/UNITY/SubstAx.ML Fri Oct 05 21:50:37 2001 +0200
121.2 +++ b/src/HOL/UNITY/SubstAx.ML Fri Oct 05 21:52:39 2001 +0200
121.3 @@ -341,9 +341,9 @@
121.4 by (auto_tac (claset() addIs prems, simpset()));
121.5 qed "LessThan_induct";
121.6
121.7 -(*Integer version. Could generalize from #0 to any lower bound*)
121.8 +(*Integer version. Could generalize from Numeral0 to any lower bound*)
121.9 val [reach, prem] =
121.10 -Goal "[| F : Always {s. (#0::int) <= f s}; \
121.11 +Goal "[| F : Always {s. (Numeral0::int) <= f s}; \
121.12 \ !! z. F : (A Int {s. f s = z}) LeadsTo \
121.13 \ ((A Int {s. f s < z}) Un B) |] \
121.14 \ ==> F : A LeadsTo B";
122.1 --- a/src/HOL/UNITY/Union.ML Fri Oct 05 21:50:37 2001 +0200
122.2 +++ b/src/HOL/UNITY/Union.ML Fri Oct 05 21:52:39 2001 +0200
122.3 @@ -352,7 +352,7 @@
122.4
122.5 bind_thm ("ok_sym", ok_commute RS iffD1);
122.6
122.7 -Goal "OK {(#0::int,F),(#1,G),(#2,H)} snd = (F ok G & (F Join G) ok H)";
122.8 +Goal "OK {(Numeral0::int,F),(Numeral1,G),(# 2,H)} snd = (F ok G & (F Join G) ok H)";
122.9 by (asm_full_simp_tac
122.10 (simpset() addsimps [Ball_def, conj_disj_distribR, ok_def, Join_def,
122.11 OK_def, insert_absorb, all_conj_distrib, eq_commute]) 1);
123.1 --- a/src/HOL/arith_data.ML Fri Oct 05 21:50:37 2001 +0200
123.2 +++ b/src/HOL/arith_data.ML Fri Oct 05 21:52:39 2001 +0200
123.3 @@ -364,7 +364,7 @@
123.4 (* reduce contradictory <= to False.
123.5 Most of the work is done by the cancel tactics.
123.6 *)
123.7 -val add_rules = [add_0,add_0_right,Zero_not_Suc,Suc_not_Zero,le_0_eq,One_def];
123.8 +val add_rules = [add_0,add_0_right,Zero_not_Suc,Suc_not_Zero,le_0_eq,One_nat_def];
123.9
123.10 val add_mono_thms_nat = map (fn s => prove_goal (the_context ()) s
123.11 (fn prems => [cut_facts_tac prems 1,
123.12 @@ -438,7 +438,7 @@
123.13 [Simplifier.change_simpset_of (op addSolver)
123.14 (mk_solver "lin. arith." Fast_Arith.cut_lin_arith_tac),
123.15 Simplifier.change_simpset_of (op addsimprocs) [fast_nat_arith_simproc],
123.16 - Method.add_methods [("arith", (arith_method o #2) oo Method.syntax Args.bang_facts,
123.17 + Method.add_methods [("arith", (arith_method o # 2) oo Method.syntax Args.bang_facts,
123.18 "decide linear arithmethic")],
123.19 Attrib.add_attributes [("arith_split",
123.20 (Attrib.no_args arith_split_add, Attrib.no_args Attrib.undef_local_attribute),
124.1 --- a/src/HOL/ex/AVL.thy Fri Oct 05 21:50:37 2001 +0200
124.2 +++ b/src/HOL/ex/AVL.thy Fri Oct 05 21:52:39 2001 +0200
124.3 @@ -6,7 +6,7 @@
124.4 AVL trees: at the moment only insertion.
124.5 This version works exclusively with nat.
124.6 Balance check could be simplified by working with int:
124.7 -"isbal (MKT n l r) = (abs(int(height l) - int(height r)) <= #1 &
124.8 +"isbal (MKT n l r) = (abs(int(height l) - int(height r)) <= Numeral1 &
124.9 isbal l & isbal r)"
124.10 *)
124.11
125.1 --- a/src/HOL/ex/BinEx.thy Fri Oct 05 21:50:37 2001 +0200
125.2 +++ b/src/HOL/ex/BinEx.thy Fri Oct 05 21:52:39 2001 +0200
125.3 @@ -12,75 +12,75 @@
125.4
125.5 text {* Addition *}
125.6
125.7 -lemma "(#13::int) + #19 = #32"
125.8 +lemma "(# 13::int) + # 19 = # 32"
125.9 by simp
125.10
125.11 -lemma "(#1234::int) + #5678 = #6912"
125.12 +lemma "(# 1234::int) + # 5678 = # 6912"
125.13 by simp
125.14
125.15 -lemma "(#1359::int) + #-2468 = #-1109"
125.16 +lemma "(# 1359::int) + # -2468 = # -1109"
125.17 by simp
125.18
125.19 -lemma "(#93746::int) + #-46375 = #47371"
125.20 +lemma "(# 93746::int) + # -46375 = # 47371"
125.21 by simp
125.22
125.23
125.24 text {* \medskip Negation *}
125.25
125.26 -lemma "- (#65745::int) = #-65745"
125.27 +lemma "- (# 65745::int) = # -65745"
125.28 by simp
125.29
125.30 -lemma "- (#-54321::int) = #54321"
125.31 +lemma "- (# -54321::int) = # 54321"
125.32 by simp
125.33
125.34
125.35 text {* \medskip Multiplication *}
125.36
125.37 -lemma "(#13::int) * #19 = #247"
125.38 +lemma "(# 13::int) * # 19 = # 247"
125.39 by simp
125.40
125.41 -lemma "(#-84::int) * #51 = #-4284"
125.42 +lemma "(# -84::int) * # 51 = # -4284"
125.43 by simp
125.44
125.45 -lemma "(#255::int) * #255 = #65025"
125.46 +lemma "(# 255::int) * # 255 = # 65025"
125.47 by simp
125.48
125.49 -lemma "(#1359::int) * #-2468 = #-3354012"
125.50 +lemma "(# 1359::int) * # -2468 = # -3354012"
125.51 by simp
125.52
125.53 -lemma "(#89::int) * #10 \<noteq> #889"
125.54 +lemma "(# 89::int) * # 10 \<noteq> # 889"
125.55 by simp
125.56
125.57 -lemma "(#13::int) < #18 - #4"
125.58 +lemma "(# 13::int) < # 18 - # 4"
125.59 by simp
125.60
125.61 -lemma "(#-345::int) < #-242 + #-100"
125.62 +lemma "(# -345::int) < # -242 + # -100"
125.63 by simp
125.64
125.65 -lemma "(#13557456::int) < #18678654"
125.66 +lemma "(# 13557456::int) < # 18678654"
125.67 by simp
125.68
125.69 -lemma "(#999999::int) \<le> (#1000001 + #1) - #2"
125.70 +lemma "(# 999999::int) \<le> (# 1000001 + Numeral1) - # 2"
125.71 by simp
125.72
125.73 -lemma "(#1234567::int) \<le> #1234567"
125.74 +lemma "(# 1234567::int) \<le> # 1234567"
125.75 by simp
125.76
125.77
125.78 text {* \medskip Quotient and Remainder *}
125.79
125.80 -lemma "(#10::int) div #3 = #3"
125.81 +lemma "(# 10::int) div # 3 = # 3"
125.82 by simp
125.83
125.84 -lemma "(#10::int) mod #3 = #1"
125.85 +lemma "(# 10::int) mod # 3 = Numeral1"
125.86 by simp
125.87
125.88 text {* A negative divisor *}
125.89
125.90 -lemma "(#10::int) div #-3 = #-4"
125.91 +lemma "(# 10::int) div # -3 = # -4"
125.92 by simp
125.93
125.94 -lemma "(#10::int) mod #-3 = #-2"
125.95 +lemma "(# 10::int) mod # -3 = # -2"
125.96 by simp
125.97
125.98 text {*
125.99 @@ -88,50 +88,50 @@
125.100 convention but not with the hardware of most computers}
125.101 *}
125.102
125.103 -lemma "(#-10::int) div #3 = #-4"
125.104 +lemma "(# -10::int) div # 3 = # -4"
125.105 by simp
125.106
125.107 -lemma "(#-10::int) mod #3 = #2"
125.108 +lemma "(# -10::int) mod # 3 = # 2"
125.109 by simp
125.110
125.111 text {* A negative dividend \emph{and} divisor *}
125.112
125.113 -lemma "(#-10::int) div #-3 = #3"
125.114 +lemma "(# -10::int) div # -3 = # 3"
125.115 by simp
125.116
125.117 -lemma "(#-10::int) mod #-3 = #-1"
125.118 +lemma "(# -10::int) mod # -3 = # -1"
125.119 by simp
125.120
125.121 text {* A few bigger examples *}
125.122
125.123 -lemma "(#8452::int) mod #3 = #1"
125.124 +lemma "(# 8452::int) mod # 3 = Numeral1"
125.125 by simp
125.126
125.127 -lemma "(#59485::int) div #434 = #137"
125.128 +lemma "(# 59485::int) div # 434 = # 137"
125.129 by simp
125.130
125.131 -lemma "(#1000006::int) mod #10 = #6"
125.132 +lemma "(# 1000006::int) mod # 10 = # 6"
125.133 by simp
125.134
125.135
125.136 text {* \medskip Division by shifting *}
125.137
125.138 -lemma "#10000000 div #2 = (#5000000::int)"
125.139 +lemma "# 10000000 div # 2 = (# 5000000::int)"
125.140 by simp
125.141
125.142 -lemma "#10000001 mod #2 = (#1::int)"
125.143 +lemma "# 10000001 mod # 2 = (Numeral1::int)"
125.144 by simp
125.145
125.146 -lemma "#10000055 div #32 = (#312501::int)"
125.147 +lemma "# 10000055 div # 32 = (# 312501::int)"
125.148 by simp
125.149
125.150 -lemma "#10000055 mod #32 = (#23::int)"
125.151 +lemma "# 10000055 mod # 32 = (# 23::int)"
125.152 by simp
125.153
125.154 -lemma "#100094 div #144 = (#695::int)"
125.155 +lemma "# 100094 div # 144 = (# 695::int)"
125.156 by simp
125.157
125.158 -lemma "#100094 mod #144 = (#14::int)"
125.159 +lemma "# 100094 mod # 144 = (# 14::int)"
125.160 by simp
125.161
125.162
125.163 @@ -139,95 +139,95 @@
125.164
125.165 text {* Successor *}
125.166
125.167 -lemma "Suc #99999 = #100000"
125.168 +lemma "Suc # 99999 = # 100000"
125.169 by (simp add: Suc_nat_number_of)
125.170 -- {* not a default rewrite since sometimes we want to have @{text "Suc #nnn"} *}
125.171
125.172
125.173 text {* \medskip Addition *}
125.174
125.175 -lemma "(#13::nat) + #19 = #32"
125.176 +lemma "(# 13::nat) + # 19 = # 32"
125.177 by simp
125.178
125.179 -lemma "(#1234::nat) + #5678 = #6912"
125.180 +lemma "(# 1234::nat) + # 5678 = # 6912"
125.181 by simp
125.182
125.183 -lemma "(#973646::nat) + #6475 = #980121"
125.184 +lemma "(# 973646::nat) + # 6475 = # 980121"
125.185 by simp
125.186
125.187
125.188 text {* \medskip Subtraction *}
125.189
125.190 -lemma "(#32::nat) - #14 = #18"
125.191 +lemma "(# 32::nat) - # 14 = # 18"
125.192 by simp
125.193
125.194 -lemma "(#14::nat) - #15 = #0"
125.195 +lemma "(# 14::nat) - # 15 = Numeral0"
125.196 by simp
125.197
125.198 -lemma "(#14::nat) - #1576644 = #0"
125.199 +lemma "(# 14::nat) - # 1576644 = Numeral0"
125.200 by simp
125.201
125.202 -lemma "(#48273776::nat) - #3873737 = #44400039"
125.203 +lemma "(# 48273776::nat) - # 3873737 = # 44400039"
125.204 by simp
125.205
125.206
125.207 text {* \medskip Multiplication *}
125.208
125.209 -lemma "(#12::nat) * #11 = #132"
125.210 +lemma "(# 12::nat) * # 11 = # 132"
125.211 by simp
125.212
125.213 -lemma "(#647::nat) * #3643 = #2357021"
125.214 +lemma "(# 647::nat) * # 3643 = # 2357021"
125.215 by simp
125.216
125.217
125.218 text {* \medskip Quotient and Remainder *}
125.219
125.220 -lemma "(#10::nat) div #3 = #3"
125.221 +lemma "(# 10::nat) div # 3 = # 3"
125.222 by simp
125.223
125.224 -lemma "(#10::nat) mod #3 = #1"
125.225 +lemma "(# 10::nat) mod # 3 = Numeral1"
125.226 by simp
125.227
125.228 -lemma "(#10000::nat) div #9 = #1111"
125.229 +lemma "(# 10000::nat) div # 9 = # 1111"
125.230 by simp
125.231
125.232 -lemma "(#10000::nat) mod #9 = #1"
125.233 +lemma "(# 10000::nat) mod # 9 = Numeral1"
125.234 by simp
125.235
125.236 -lemma "(#10000::nat) div #16 = #625"
125.237 +lemma "(# 10000::nat) div # 16 = # 625"
125.238 by simp
125.239
125.240 -lemma "(#10000::nat) mod #16 = #0"
125.241 +lemma "(# 10000::nat) mod # 16 = Numeral0"
125.242 by simp
125.243
125.244
125.245 text {* \medskip Testing the cancellation of complementary terms *}
125.246
125.247 -lemma "y + (x + -x) = (#0::int) + y"
125.248 +lemma "y + (x + -x) = (Numeral0::int) + y"
125.249 by simp
125.250
125.251 -lemma "y + (-x + (- y + x)) = (#0::int)"
125.252 +lemma "y + (-x + (- y + x)) = (Numeral0::int)"
125.253 by simp
125.254
125.255 -lemma "-x + (y + (- y + x)) = (#0::int)"
125.256 +lemma "-x + (y + (- y + x)) = (Numeral0::int)"
125.257 by simp
125.258
125.259 -lemma "x + (x + (- x + (- x + (- y + - z)))) = (#0::int) - y - z"
125.260 +lemma "x + (x + (- x + (- x + (- y + - z)))) = (Numeral0::int) - y - z"
125.261 by simp
125.262
125.263 -lemma "x + x - x - x - y - z = (#0::int) - y - z"
125.264 +lemma "x + x - x - x - y - z = (Numeral0::int) - y - z"
125.265 by simp
125.266
125.267 -lemma "x + y + z - (x + z) = y - (#0::int)"
125.268 +lemma "x + y + z - (x + z) = y - (Numeral0::int)"
125.269 by simp
125.270
125.271 -lemma "x + (y + (y + (y + (-x + -x)))) = (#0::int) + y - x + y + y"
125.272 +lemma "x + (y + (y + (y + (-x + -x)))) = (Numeral0::int) + y - x + y + y"
125.273 by simp
125.274
125.275 -lemma "x + (y + (y + (y + (-y + -x)))) = y + (#0::int) + y"
125.276 +lemma "x + (y + (y + (y + (-y + -x)))) = y + (Numeral0::int) + y"
125.277 by simp
125.278
125.279 -lemma "x + y - x + z - x - y - z + x < (#1::int)"
125.280 +lemma "x + y - x + z - x - y - z + x < (Numeral1::int)"
125.281 by simp
125.282
125.283
125.284 @@ -302,7 +302,7 @@
125.285 apply simp_all
125.286 done
125.287
125.288 -lemma normal_Pls_eq_0: "w \<in> normal ==> (w = Pls) = (number_of w = (#0::int))"
125.289 +lemma normal_Pls_eq_0: "w \<in> normal ==> (w = Pls) = (number_of w = (Numeral0::int))"
125.290 apply (erule normal.induct)
125.291 apply auto
125.292 done
126.1 --- a/src/HOL/ex/Group.ML Fri Oct 05 21:50:37 2001 +0200
126.2 +++ b/src/HOL/ex/Group.ML Fri Oct 05 21:52:39 2001 +0200
126.3 @@ -10,21 +10,21 @@
126.4 based on the unary inverse 0-x.
126.5 *)
126.6
126.7 -Goal "!!x::'a::add_group. (0-x)+(x+y) = y";
126.8 +Goal "!!x::'a::add_group. (0 - x) + (x + y) = y";
126.9 by (rtac trans 1);
126.10 by (rtac (plus_assoc RS sym) 1);
126.11 by (stac left_inv 1);
126.12 by (rtac zeroL 1);
126.13 qed "left_inv2";
126.14
126.15 -Goal "!!x::'a::add_group. (0-(0-x)) = x";
126.16 +Goal "!!x::'a::add_group. (0 - (0 - x)) = x";
126.17 by (rtac trans 1);
126.18 -by (res_inst_tac [("x","0-x")] left_inv2 2);
126.19 +by (res_inst_tac [("x","0 - x")] left_inv2 2);
126.20 by (stac left_inv 1);
126.21 by (rtac (zeroR RS sym) 1);
126.22 qed "inv_inv";
126.23
126.24 -Goal "0-0 = (0::'a::add_group)";
126.25 +Goal "0 - 0 = (0::'a::add_group)";
126.26 by (rtac trans 1);
126.27 by (rtac (zeroR RS sym) 1);
126.28 by (rtac trans 1);
126.29 @@ -32,23 +32,23 @@
126.30 by (simp_tac (simpset() addsimps [zeroR]) 1);
126.31 qed "inv_zero";
126.32
126.33 -Goal "!!x::'a::add_group. x+(0-x) = 0";
126.34 +Goal "!!x::'a::add_group. x + (0 - x) = 0";
126.35 by (rtac trans 1);
126.36 by (res_inst_tac [("x","0-x")] left_inv 2);
126.37 by (stac inv_inv 1);
126.38 by (rtac refl 1);
126.39 qed "right_inv";
126.40
126.41 -Goal "!!x::'a::add_group. x+((0-x)+y) = y";
126.42 +Goal "!!x::'a::add_group. x + ((0 - x) + y) = y";
126.43 by (rtac trans 1);
126.44 -by (res_inst_tac [("x","0-x")] left_inv2 2);
126.45 +by (res_inst_tac [("x","0 - x")] left_inv2 2);
126.46 by (stac inv_inv 1);
126.47 by (rtac refl 1);
126.48 qed "right_inv2";
126.49
126.50 val plus_cong = read_instantiate [("f1","op +")] (arg_cong RS cong);
126.51
126.52 -Goal "!!x::'a::add_group. 0-(x+y) = (0-y)+(0-x)";
126.53 +Goal "!!x::'a::add_group. 0 - (x + y) = (0 - y) + (0 - x)";
126.54 by (rtac trans 1);
126.55 by (rtac zeroR 2);
126.56 by (rtac trans 1);
126.57 @@ -65,7 +65,7 @@
126.58 by (rtac (zeroL RS sym) 1);
126.59 qed "inv_plus";
126.60
126.61 -(*** convergent TRS for groups with unary inverse 0-x ***)
126.62 +(*** convergent TRS for groups with unary inverse 0 - x ***)
126.63 val group1_simps =
126.64 [zeroL,zeroR,plus_assoc,left_inv,left_inv2,right_inv,right_inv2,inv_inv,
126.65 inv_zero,inv_plus];
126.66 @@ -75,10 +75,10 @@
126.67 in simp_tac ss end;
126.68
126.69 (* I believe there is no convergent TRS for groups with binary `-',
126.70 - unless you have an extra unary `-' and simply define x-y = x+(-y).
126.71 - This does not work with only a binary `-' because x-y = x+(0-y) does
126.72 + unless you have an extra unary `-' and simply define x - y = x + (-y).
126.73 + This does not work with only a binary `-' because x - y = x + (0 - y) does
126.74 not terminate. Hence we have a special tactic for converting all
126.75 - occurrences of x-y into x+(0-y):
126.76 + occurrences of x - y into x + (0 - y):
126.77 *)
126.78
126.79 local
126.80 @@ -102,12 +102,12 @@
126.81 (* The following two equations are not used in any of the decision procedures,
126.82 but are still very useful. They also demonstrate mk_group1_tac.
126.83 *)
126.84 -Goal "x-x = (0::'a::add_group)";
126.85 +Goal "x - x = (0::'a::add_group)";
126.86 by (mk_group1_tac 1);
126.87 by (group1_tac 1);
126.88 qed "minus_self_zero";
126.89
126.90 -Goal "x-0 = (x::'a::add_group)";
126.91 +Goal "x - 0 = (x::'a::add_group)";
126.92 by (mk_group1_tac 1);
126.93 by (group1_tac 1);
126.94 qed "minus_zero";
126.95 @@ -122,7 +122,7 @@
126.96 by (simp_tac (simpset() addsimps [plus_commute]) 1);
126.97 qed "plus_commuteL";
126.98
126.99 -(* Convergent TRS for Abelian groups with unary inverse 0-x.
126.100 +(* Convergent TRS for Abelian groups with unary inverse 0 - x.
126.101 Requires ordered rewriting
126.102 *)
126.103
127.1 --- a/src/HOL/ex/IntRing.thy Fri Oct 05 21:50:37 2001 +0200
127.2 +++ b/src/HOL/ex/IntRing.thy Fri Oct 05 21:52:39 2001 +0200
127.3 @@ -10,7 +10,7 @@
127.4 IntRing = Ring + Lagrange +
127.5
127.6 instance int :: add_semigroup (zadd_assoc)
127.7 -instance int :: add_monoid (IntDef.Zero_def,zadd_int0,zadd_int0_right)
127.8 +instance int :: add_monoid (Zero_int_def,zadd_int0,zadd_int0_right)
127.9 instance int :: add_group {|Auto_tac|}
127.10 instance int :: add_agroup (zadd_commute)
127.11 instance int :: ring (zmult_assoc,zadd_zmult_distrib2,zadd_zmult_distrib)
128.1 --- a/src/HOL/ex/NatSum.thy Fri Oct 05 21:50:37 2001 +0200
128.2 +++ b/src/HOL/ex/NatSum.thy Fri Oct 05 21:52:39 2001 +0200
128.3 @@ -36,10 +36,10 @@
128.4 *}
128.5
128.6 lemma sum_of_odd_squares:
128.7 - "#3 * setsum (\<lambda>i. Suc (i + i) * Suc (i + i)) (lessThan n) =
128.8 - n * (#4 * n * n - #1)"
128.9 + "# 3 * setsum (\<lambda>i. Suc (i + i) * Suc (i + i)) (lessThan n) =
128.10 + n * (# 4 * n * n - Numeral1)"
128.11 apply (induct n)
128.12 - txt {* This removes the @{term "-#1"} from the inductive step *}
128.13 + txt {* This removes the @{term "-Numeral1"} from the inductive step *}
128.14 apply (case_tac [2] n)
128.15 apply auto
128.16 done
128.17 @@ -51,9 +51,9 @@
128.18
128.19 lemma sum_of_odd_cubes:
128.20 "setsum (\<lambda>i. Suc (i + i) * Suc (i + i) * Suc (i + i)) (lessThan n) =
128.21 - n * n * (#2 * n * n - #1)"
128.22 + n * n * (# 2 * n * n - Numeral1)"
128.23 apply (induct "n")
128.24 - txt {* This removes the @{term "-#1"} from the inductive step *}
128.25 + txt {* This removes the @{term "-Numeral1"} from the inductive step *}
128.26 apply (case_tac [2] "n")
128.27 apply auto
128.28 done
128.29 @@ -63,19 +63,19 @@
128.30 @{text "n (n + 1) / 2"}.*}
128.31
128.32 lemma sum_of_naturals:
128.33 - "#2 * setsum id (atMost n) = n * Suc n"
128.34 + "# 2 * setsum id (atMost n) = n * Suc n"
128.35 apply (induct n)
128.36 apply auto
128.37 done
128.38
128.39 lemma sum_of_squares:
128.40 - "#6 * setsum (\<lambda>i. i * i) (atMost n) = n * Suc n * Suc (#2 * n)"
128.41 + "# 6 * setsum (\<lambda>i. i * i) (atMost n) = n * Suc n * Suc (# 2 * n)"
128.42 apply (induct n)
128.43 apply auto
128.44 done
128.45
128.46 lemma sum_of_cubes:
128.47 - "#4 * setsum (\<lambda>i. i * i * i) (atMost n) = n * n * Suc n * Suc n"
128.48 + "# 4 * setsum (\<lambda>i. i * i * i) (atMost n) = n * n * Suc n * Suc n"
128.49 apply (induct n)
128.50 apply auto
128.51 done
128.52 @@ -86,8 +86,8 @@
128.53 *}
128.54
128.55 lemma sum_of_fourth_powers:
128.56 - "#30 * setsum (\<lambda>i. i * i * i * i) (atMost n) =
128.57 - n * Suc n * Suc (#2 * n) * (#3 * n * n + #3 * n - #1)"
128.58 + "# 30 * setsum (\<lambda>i. i * i * i * i) (atMost n) =
128.59 + n * Suc n * Suc (# 2 * n) * (# 3 * n * n + # 3 * n - Numeral1)"
128.60 apply (induct n)
128.61 apply auto
128.62 txt {* Eliminates the subtraction *}
128.63 @@ -107,9 +107,9 @@
128.64 zdiff_zmult_distrib2 [simp]
128.65
128.66 lemma int_sum_of_fourth_powers:
128.67 - "#30 * int (setsum (\<lambda>i. i * i * i * i) (lessThan m)) =
128.68 - int m * (int m - #1) * (int (#2 * m) - #1) *
128.69 - (int (#3 * m * m) - int (#3 * m) - #1)"
128.70 + "# 30 * int (setsum (\<lambda>i. i * i * i * i) (lessThan m)) =
128.71 + int m * (int m - Numeral1) * (int (# 2 * m) - Numeral1) *
128.72 + (int (# 3 * m * m) - int (# 3 * m) - Numeral1)"
128.73 apply (induct m)
128.74 apply simp_all
128.75 done
128.76 @@ -118,17 +118,17 @@
128.77 text {*
128.78 \medskip Sums of geometric series: 2, 3 and the general case *}
128.79
128.80 -lemma sum_of_2_powers: "setsum (\<lambda>i. #2^i) (lessThan n) = #2^n - 1"
128.81 +lemma sum_of_2_powers: "setsum (\<lambda>i. # 2^i) (lessThan n) = # 2^n - (1::nat)"
128.82 apply (induct n)
128.83 apply (auto split: nat_diff_split)
128.84 done
128.85
128.86 -lemma sum_of_3_powers: "#2 * setsum (\<lambda>i. #3^i) (lessThan n) = #3^n - 1"
128.87 +lemma sum_of_3_powers: "# 2 * setsum (\<lambda>i. # 3^i) (lessThan n) = # 3^n - (1::nat)"
128.88 apply (induct n)
128.89 apply auto
128.90 done
128.91
128.92 -lemma sum_of_powers: "0 < k ==> (k - 1) * setsum (\<lambda>i. k^i) (lessThan n) = k^n - 1"
128.93 +lemma sum_of_powers: "0 < k ==> (k - 1) * setsum (\<lambda>i. k^i) (lessThan n) = k^n - (1::nat)"
128.94 apply (induct n)
128.95 apply auto
128.96 done
129.1 --- a/src/HOL/ex/Primrec.thy Fri Oct 05 21:50:37 2001 +0200
129.2 +++ b/src/HOL/ex/Primrec.thy Fri Oct 05 21:52:39 2001 +0200
129.3 @@ -159,16 +159,16 @@
129.4
129.5 text {* PROPERTY A 8 *}
129.6
129.7 -lemma ack_1 [simp]: "ack (1', j) = j + #2"
129.8 +lemma ack_1 [simp]: "ack (Suc 0, j) = j + # 2"
129.9 apply (induct j)
129.10 apply simp_all
129.11 done
129.12
129.13
129.14 -text {* PROPERTY A 9. The unary @{term 1} and @{term 2} in @{term
129.15 +text {* PROPERTY A 9. The unary @{text 1} and @{text 2} in @{term
129.16 ack} is essential for the rewriting. *}
129.17
129.18 -lemma ack_2 [simp]: "ack (2, j) = #2 * j + #3"
129.19 +lemma ack_2 [simp]: "ack (Suc (Suc 0), j) = # 2 * j + # 3"
129.20 apply (induct j)
129.21 apply simp_all
129.22 done
129.23 @@ -203,7 +203,7 @@
129.24
129.25 text {* PROPERTY A 10 *}
129.26
129.27 -lemma ack_nest_bound: "ack(i1, ack (i2, j)) < ack (#2 + (i1 + i2), j)"
129.28 +lemma ack_nest_bound: "ack(i1, ack (i2, j)) < ack (# 2 + (i1 + i2), j)"
129.29 apply (simp add: numerals)
129.30 apply (rule ack2_le_ack1 [THEN [2] less_le_trans])
129.31 apply simp
129.32 @@ -215,8 +215,8 @@
129.33
129.34 text {* PROPERTY A 11 *}
129.35
129.36 -lemma ack_add_bound: "ack (i1, j) + ack (i2, j) < ack (#4 + (i1 + i2), j)"
129.37 - apply (rule_tac j = "ack (2, ack (i1 + i2, j))" in less_trans)
129.38 +lemma ack_add_bound: "ack (i1, j) + ack (i2, j) < ack (# 4 + (i1 + i2), j)"
129.39 + apply (rule_tac j = "ack (Suc (Suc 0), ack (i1 + i2, j))" in less_trans)
129.40 prefer 2
129.41 apply (rule ack_nest_bound [THEN less_le_trans])
129.42 apply (simp add: Suc3_eq_add_3)
129.43 @@ -231,7 +231,7 @@
129.44 used @{text "k + 4"}. Quantified version must be nested @{text
129.45 "\<exists>k'. \<forall>i j. ..."} *}
129.46
129.47 -lemma ack_add_bound2: "i < ack (k, j) ==> i + j < ack (#4 + k, j)"
129.48 +lemma ack_add_bound2: "i < ack (k, j) ==> i + j < ack (# 4 + k, j)"
129.49 apply (rule_tac j = "ack (k, j) + ack (0, j)" in less_trans)
129.50 prefer 2
129.51 apply (rule ack_add_bound [THEN less_le_trans])
130.1 --- a/src/HOL/ex/Recdefs.thy Fri Oct 05 21:50:37 2001 +0200
130.2 +++ b/src/HOL/ex/Recdefs.thy Fri Oct 05 21:52:39 2001 +0200
130.3 @@ -80,11 +80,12 @@
130.4 *}
130.5
130.6 consts k :: "nat => nat"
130.7 +
130.8 recdef (permissive) k less_than
130.9 "k 0 = 0"
130.10 "k (Suc n) =
130.11 (let x = k 1
130.12 - in if 0 = 1 then k (Suc 1) else n)"
130.13 + in if False then k (Suc 1) else n)"
130.14
130.15 consts part :: "('a => bool) * 'a list * 'a list * 'a list => 'a list * 'a list"
130.16 recdef part "measure (\<lambda>(P, l, l1, l2). size l)"
131.1 --- a/src/HOL/ex/Records.thy Fri Oct 05 21:50:37 2001 +0200
131.2 +++ b/src/HOL/ex/Records.thy Fri Oct 05 21:52:39 2001 +0200
131.3 @@ -182,7 +182,7 @@
131.4
131.5 constdefs
131.6 foo10 :: nat
131.7 - "foo10 == getX (| x = 2, y = 0, colour = Blue |)"
131.8 + "foo10 == getX (| x = # 2, y = 0, colour = Blue |)"
131.9
131.10
131.11 subsubsection {* Non-coercive structural subtyping *}
131.12 @@ -194,7 +194,7 @@
131.13
131.14 constdefs
131.15 foo11 :: cpoint
131.16 - "foo11 == setX (| x = 2, y = 0, colour = Blue |) 0"
131.17 + "foo11 == setX (| x = # 2, y = 0, colour = Blue |) 0"
131.18
131.19
131.20 subsection {* Other features *}
131.21 @@ -207,7 +207,7 @@
131.22
131.23 text {*
131.24 \noindent May not apply @{term getX} to
131.25 - @{term [source] "(| x' = 2, y' = 0 |)"}.
131.26 + @{term [source] "(| x' = # 2, y' = 0 |)"}.
131.27 *}
131.28
131.29 text {* \medskip Polymorphic records. *}
132.1 --- a/src/HOL/ex/svc_test.ML Fri Oct 05 21:50:37 2001 +0200
132.2 +++ b/src/HOL/ex/svc_test.ML Fri Oct 05 21:52:39 2001 +0200
132.3 @@ -231,24 +231,24 @@
132.4
132.5 (** Linear arithmetic **)
132.6
132.7 -Goal "x ~= #14 & x ~= #13 & x ~= #12 & x ~= #11 & x ~= #10 & x ~= #9 & \
132.8 -\ x ~= #8 & x ~= #7 & x ~= #6 & x ~= #5 & x ~= #4 & x ~= #3 & \
132.9 -\ x ~= #2 & x ~= #1 & #0 < x & x < #16 --> #15 = (x::int)";
132.10 +Goal "x ~= # 14 & x ~= # 13 & x ~= # 12 & x ~= # 11 & x ~= # 10 & x ~= # 9 & \
132.11 +\ x ~= # 8 & x ~= # 7 & x ~= # 6 & x ~= # 5 & x ~= # 4 & x ~= # 3 & \
132.12 +\ x ~= # 2 & x ~= Numeral1 & Numeral0 < x & x < # 16 --> # 15 = (x::int)";
132.13 by (svc_tac 1);
132.14 qed "";
132.15
132.16 (*merely to test polarity handling in the presence of biconditionals*)
132.17 -Goal "(x < (y::int)) = (x+#1 <= y)";
132.18 +Goal "(x < (y::int)) = (x+Numeral1 <= y)";
132.19 by (svc_tac 1);
132.20 qed "";
132.21
132.22 (** Natural number examples requiring implicit "non-negative" assumptions*)
132.23
132.24 -Goal "(#3::nat)*a <= #2 + #4*b + #6*c & #11 <= #2*a + b + #2*c & \
132.25 -\ a + #3*b <= #5 + #2*c --> #2 + #3*b <= #2*a + #6*c";
132.26 +Goal "(# 3::nat)*a <= # 2 + # 4*b + # 6*c & # 11 <= # 2*a + b + # 2*c & \
132.27 +\ a + # 3*b <= # 5 + # 2*c --> # 2 + # 3*b <= # 2*a + # 6*c";
132.28 by (svc_tac 1);
132.29 qed "";
132.30
132.31 -Goal "(n::nat) < #2 ==> (n = #0) | (n = #1)";
132.32 +Goal "(n::nat) < # 2 ==> (n = Numeral0) | (n = Numeral1)";
132.33 by (svc_tac 1);
132.34 qed "";
133.1 --- a/src/HOLCF/FOCUS/Buffer_adm.ML Fri Oct 05 21:50:37 2001 +0200
133.2 +++ b/src/HOLCF/FOCUS/Buffer_adm.ML Fri Oct 05 21:52:39 2001 +0200
133.3 @@ -41,7 +41,7 @@
133.4
133.5 Goalw [BufAC_Asm_F_def, stream_monoP_def] "stream_monoP BufAC_Asm_F";
133.6 by (res_inst_tac [("x","{x. (? d. x = Md d\\<leadsto>\\<bullet>\\<leadsto><>)}")] exI 1);
133.7 -by (res_inst_tac [("x","2")] exI 1);
133.8 +by (res_inst_tac [("x","Suc (Suc 0)")] exI 1);
133.9 by (Clarsimp_tac 1);
133.10 qed "BufAC_Asm_F_stream_monoP";
133.11
133.12 @@ -54,7 +54,7 @@
133.13 Goalw [stream_antiP_def, BufAC_Asm_F_def] "stream_antiP BufAC_Asm_F";
133.14 b y strip_tac 1;
133.15 b y res_inst_tac [("x","{x. (? d. x = Md d\\<leadsto>\\<bullet>\\<leadsto><>)}")] exI 1;
133.16 -b y res_inst_tac [("x","2")] exI 1;
133.17 +b y res_inst_tac [("x","Suc (Suc 0)")] exI 1;
133.18 b y rtac conjI 1;
133.19 b y strip_tac 2;
133.20 b y dtac slen_mono 2;
133.21 @@ -110,7 +110,7 @@
133.22 Goal "f:BufEq ==> ? l. !i x s. s:BufAC_Asm --> x << s --> Fin (l i) < #x --> \
133.23 \ (x,f\\<cdot>x):down_iterate BufAC_Cmt_F i --> \
133.24 \ (s,f\\<cdot>s):down_iterate BufAC_Cmt_F i";
133.25 -by (res_inst_tac [("x","%i. #2*i")] exI 1);
133.26 +by (res_inst_tac [("x","%i. # 2*i")] exI 1);
133.27 by (rtac allI 1);
133.28 by (nat_ind_tac "i" 1);
133.29 by ( Simp_tac 1);
133.30 @@ -129,10 +129,10 @@
133.31 \\<lbrakk>f \\<in> BufEq;
133.32 \\<forall>x s. s \\<in> BufAC_Asm \\<longrightarrow>
133.33 x \\<sqsubseteq> s \\<longrightarrow>
133.34 - Fin (#2 * i) < #x \\<longrightarrow>
133.35 + Fin (# 2 * i) < #x \\<longrightarrow>
133.36 (x, f\\<cdot>x) \\<in> down_iterate BufAC_Cmt_F i \\<longrightarrow>
133.37 (s, f\\<cdot>s) \\<in> down_iterate BufAC_Cmt_F i;
133.38 - Md d\\<leadsto>\\<bullet>\\<leadsto>xa \\<in> BufAC_Asm; Fin (#2 * i) < #ya; f\\<cdot>(Md d\\<leadsto>\\<bullet>\\<leadsto>ya) = d\\<leadsto>t;
133.39 + Md d\\<leadsto>\\<bullet>\\<leadsto>xa \\<in> BufAC_Asm; Fin (# 2 * i) < #ya; f\\<cdot>(Md d\\<leadsto>\\<bullet>\\<leadsto>ya) = d\\<leadsto>t;
133.40 (ya, t) \\<in> down_iterate BufAC_Cmt_F i; ya \\<sqsubseteq> xa\\<rbrakk>
133.41 \\<Longrightarrow> (xa, rt\\<cdot>(f\\<cdot>(Md d\\<leadsto>\\<bullet>\\<leadsto>xa))) \\<in> down_iterate BufAC_Cmt_F i
133.42 *)
133.43 @@ -147,11 +147,11 @@
133.44 by (hyp_subst_tac 1);
133.45 (*
133.46 1. \\<And>i d xa ya t ff ffa.
133.47 - \\<lbrakk>f\\<cdot>(Md d\\<leadsto>\\<bullet>\\<leadsto>ya) = d\\<leadsto>ffa\\<cdot>ya; Fin (#2 * i) < #ya;
133.48 + \\<lbrakk>f\\<cdot>(Md d\\<leadsto>\\<bullet>\\<leadsto>ya) = d\\<leadsto>ffa\\<cdot>ya; Fin (# 2 * i) < #ya;
133.49 (ya, ffa\\<cdot>ya) \\<in> down_iterate BufAC_Cmt_F i; ya \\<sqsubseteq> xa; f \\<in> BufEq;
133.50 \\<forall>x s. s \\<in> BufAC_Asm \\<longrightarrow>
133.51 x \\<sqsubseteq> s \\<longrightarrow>
133.52 - Fin (#2 * i) < #x \\<longrightarrow>
133.53 + Fin (# 2 * i) < #x \\<longrightarrow>
133.54 (x, f\\<cdot>x) \\<in> down_iterate BufAC_Cmt_F i \\<longrightarrow>
133.55 (s, f\\<cdot>s) \\<in> down_iterate BufAC_Cmt_F i;
133.56 xa \\<in> BufAC_Asm; ff \\<in> BufEq; ffa \\<in> BufEq\\<rbrakk>
134.1 --- a/src/HOLCF/IOA/NTP/Lemmas.ML Fri Oct 05 21:50:37 2001 +0200
134.2 +++ b/src/HOLCF/IOA/NTP/Lemmas.ML Fri Oct 05 21:52:39 2001 +0200
134.3 @@ -35,7 +35,7 @@
134.4
134.5 (* Arithmetic *)
134.6
134.7 -goal NatArith.thy "!!x. 0<x ==> (x-1 = y) = (x = Suc(y))";
134.8 +goal NatArith.thy "!!x. 0<x ==> (x - 1 = y) = (x = Suc(y))";
134.9 by (asm_simp_tac (simpset() addsimps [diff_Suc] addsplits [nat.split]) 1);
134.10 qed "pred_suc";
134.11
135.1 --- a/src/HOLCF/ex/Stream.ML Fri Oct 05 21:50:37 2001 +0200
135.2 +++ b/src/HOLCF/ex/Stream.ML Fri Oct 05 21:52:39 2001 +0200
135.3 @@ -407,7 +407,7 @@
135.4
135.5 Addsimps [slen_empty, slen_scons];
135.6
135.7 -Goal "(#x < Fin 1') = (x = UU)";
135.8 +Goal "(#x < Fin (Suc 0)) = (x = UU)";
135.9 by (stream_case_tac "x" 1);
135.10 by (auto_tac (claset(), simpset() delsimps [thm "iSuc_Fin"] addsimps
135.11 [thm "Fin_0", thm "iSuc_Fin" RS sym, thm "i0_iless_iSuc", thm "iSuc_mono"]));