Numerals and simprocs for types real and hypreal. The abstract
authorpaulson
Fri Nov 02 17:55:24 2001 +0100 (2001-11-02)
changeset 12018ec054019c910
parent 12017 78b8f9e13300
child 12019 abe9b7c6016e
Numerals and simprocs for types real and hypreal. The abstract
constants 0, 1 and binary numerals work harmoniously.
src/HOL/Hyperreal/HRealAbs.ML
src/HOL/Hyperreal/HSeries.ML
src/HOL/Hyperreal/HyperArith0.ML
src/HOL/Hyperreal/HyperBin.ML
src/HOL/Hyperreal/HyperDef.ML
src/HOL/Hyperreal/HyperDef.thy
src/HOL/Hyperreal/HyperNat.ML
src/HOL/Hyperreal/HyperOrd.ML
src/HOL/Hyperreal/HyperPow.ML
src/HOL/Hyperreal/Lim.ML
src/HOL/Hyperreal/Lim.thy
src/HOL/Hyperreal/NSA.ML
src/HOL/Hyperreal/NatStar.ML
src/HOL/Hyperreal/SEQ.ML
src/HOL/Hyperreal/SEQ.thy
src/HOL/Hyperreal/Series.ML
src/HOL/Hyperreal/Series.thy
src/HOL/Hyperreal/Star.ML
src/HOL/Hyperreal/hypreal_arith0.ML
src/HOL/Integ/Bin.ML
src/HOL/Integ/IntArith.ML
src/HOL/Integ/int_arith1.ML
src/HOL/Integ/int_factor_simprocs.ML
src/HOL/Real/HahnBanach/Aux.thy
src/HOL/Real/HahnBanach/FunctionNorm.thy
src/HOL/Real/HahnBanach/HahnBanach.thy
src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy
src/HOL/Real/HahnBanach/Linearform.thy
src/HOL/Real/HahnBanach/NormedSpace.thy
src/HOL/Real/HahnBanach/Subspace.thy
src/HOL/Real/HahnBanach/VectorSpace.thy
src/HOL/Real/PNat.ML
src/HOL/Real/PNat.thy
src/HOL/Real/PRat.ML
src/HOL/Real/PReal.ML
src/HOL/Real/PReal.thy
src/HOL/Real/RComplete.ML
src/HOL/Real/RealAbs.ML
src/HOL/Real/RealAbs.thy
src/HOL/Real/RealArith0.ML
src/HOL/Real/RealBin.ML
src/HOL/Real/RealDef.ML
src/HOL/Real/RealDef.thy
src/HOL/Real/RealOrd.ML
src/HOL/Real/RealPow.ML
src/HOL/Real/RealPow.thy
src/HOL/Real/ex/BinEx.thy
src/HOL/Real/real_arith0.ML
     1.1 --- a/src/HOL/Hyperreal/HRealAbs.ML	Thu Nov 01 21:12:13 2001 +0100
     1.2 +++ b/src/HOL/Hyperreal/HRealAbs.ML	Fri Nov 02 17:55:24 2001 +0100
     1.3 @@ -32,56 +32,55 @@
     1.4     (adapted version of previously proved theorems about abs)
     1.5   ------------------------------------------------------------*)
     1.6  
     1.7 -Goal "abs (Numeral0::hypreal) = Numeral0";
     1.8 +Goal "abs (0::hypreal) = 0";
     1.9  by (simp_tac (simpset() addsimps [hrabs_def]) 1); 
    1.10  qed "hrabs_zero";
    1.11  Addsimps [hrabs_zero];
    1.12  
    1.13 -Goal "(Numeral0::hypreal)<=x ==> abs x = x";
    1.14 +Goal "abs (1::hypreal) = 1";
    1.15 +by (simp_tac (simpset() addsimps [hrabs_def]) 1); 
    1.16 +qed "hrabs_one";
    1.17 +Addsimps [hrabs_one];
    1.18 +
    1.19 +Goal "(0::hypreal)<=x ==> abs x = x";
    1.20  by (asm_simp_tac (simpset() addsimps [hrabs_def]) 1); 
    1.21  qed "hrabs_eqI1";
    1.22  
    1.23 -Goal "(Numeral0::hypreal)<x ==> abs x = x";
    1.24 +Goal "(0::hypreal)<x ==> abs x = x";
    1.25  by (asm_simp_tac (simpset() addsimps [order_less_imp_le, hrabs_eqI1]) 1);
    1.26  qed "hrabs_eqI2";
    1.27  
    1.28 -Goal "x<(Numeral0::hypreal) ==> abs x = -x";
    1.29 +Goal "x<(0::hypreal) ==> abs x = -x";
    1.30  by (asm_simp_tac (simpset() addsimps [hypreal_le_def, hrabs_def]) 1); 
    1.31  qed "hrabs_minus_eqI2";
    1.32  
    1.33 -Goal "x<=(Numeral0::hypreal) ==> abs x = -x";
    1.34 -by (auto_tac (claset() addDs [order_antisym], simpset() addsimps [hrabs_def])); 
    1.35 -qed "hrabs_minus_eqI1";
    1.36 +Goal "x<=(0::hypreal) ==> abs x = -x";
    1.37 +by (auto_tac (claset() addDs [order_antisym], simpset() addsimps [hrabs_def]));qed "hrabs_minus_eqI1";
    1.38  
    1.39 -Goal "(Numeral0::hypreal)<= abs x";
    1.40 -by (auto_tac (claset() addDs [hypreal_minus_zero_less_iff RS iffD2, 
    1.41 -                              hypreal_less_asym], 
    1.42 -              simpset() addsimps [hypreal_le_def, hrabs_def]));
    1.43 +Goal "(0::hypreal)<= abs x";
    1.44 +by (simp_tac (simpset() addsimps [hrabs_def]) 1); 
    1.45  qed "hrabs_ge_zero";
    1.46  
    1.47  Goal "abs(abs x) = abs (x::hypreal)";
    1.48 -by (auto_tac (claset() addDs [hypreal_minus_zero_less_iff RS iffD2, 
    1.49 -                              hypreal_less_asym], 
    1.50 -              simpset() addsimps [hypreal_le_def, hrabs_def]));
    1.51 +by (simp_tac (simpset() addsimps [hrabs_def]) 1); 
    1.52  qed "hrabs_idempotent";
    1.53  Addsimps [hrabs_idempotent];
    1.54  
    1.55 -Goalw [hrabs_def] "(abs x = (Numeral0::hypreal)) = (x=Numeral0)";
    1.56 +Goalw [hrabs_def] "(abs x = (0::hypreal)) = (x=0)";
    1.57  by (Simp_tac 1);
    1.58  qed "hrabs_zero_iff";
    1.59  AddIffs [hrabs_zero_iff];
    1.60  
    1.61  Goalw [hrabs_def] "(x::hypreal) <= abs x";
    1.62 -by (auto_tac (claset() addDs [not_hypreal_leE, order_less_imp_le],
    1.63 -              simpset() addsimps [hypreal_le_zero_iff RS sym]));
    1.64 +by (Simp_tac 1); 
    1.65  qed "hrabs_ge_self";
    1.66  
    1.67  Goalw [hrabs_def] "-(x::hypreal) <= abs x";
    1.68 -by (simp_tac (simpset() addsimps [hypreal_ge_zero_iff]) 1);
    1.69 +by (Simp_tac 1);
    1.70  qed "hrabs_ge_minus_self";
    1.71  
    1.72 -(* very short proof by "transfer" *)
    1.73 -Goal "abs(x*(y::hypreal)) = (abs x)*(abs y)";
    1.74 +(* proof by "transfer" *)
    1.75 +Goal "abs(x*(y::hypreal)) = (abs x)*(abs y)";  
    1.76  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
    1.77  by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
    1.78  by (auto_tac (claset(), 
    1.79 @@ -90,48 +89,31 @@
    1.80  Addsimps [hrabs_mult];
    1.81  
    1.82  Goal "abs(inverse(x)) = inverse(abs(x::hypreal))";
    1.83 -by (hypreal_div_undefined_case_tac "x=Numeral0" 1);
    1.84 -by (simp_tac (simpset() addsimps [HYPREAL_DIVIDE_ZERO]) 1); 
    1.85 -by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
    1.86 -by (auto_tac (claset(),
    1.87 -       simpset() addsimps [hypreal_hrabs,
    1.88 -                           hypreal_inverse,hypreal_zero_def]));
    1.89 -by (ultra_tac (claset(), simpset() addsimps [abs_inverse]) 1);
    1.90 +by (simp_tac (simpset() addsimps [hypreal_minus_inverse, hrabs_def]) 1);  
    1.91  qed "hrabs_inverse";
    1.92  
    1.93 -Goal "abs(x+(y::hypreal)) <= abs x + abs y";
    1.94 -by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
    1.95 -by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
    1.96 -by (auto_tac (claset(), 
    1.97 -      simpset() addsimps [hypreal_hrabs, hypreal_add,hypreal_le,
    1.98 -                        abs_triangle_ineq]));
    1.99 +Goalw [hrabs_def] "abs(x+(y::hypreal)) <= abs x + abs y"; 
   1.100 +by (Simp_tac 1);
   1.101  qed "hrabs_triangle_ineq";
   1.102  
   1.103  Goal "abs((w::hypreal) + x + y) <= abs(w) + abs(x) + abs(y)";
   1.104 -by (auto_tac (claset() addSIs [hrabs_triangle_ineq RS order_trans,
   1.105 -                               hypreal_add_left_le_mono1],
   1.106 -              simpset() addsimps [hypreal_add_assoc]));
   1.107 +by (simp_tac (simpset() addsimps [hrabs_triangle_ineq RS order_trans]) 1);
   1.108  qed "hrabs_triangle_ineq_three";
   1.109  
   1.110 -Goalw [hrabs_def] "abs(-x)=abs((x::hypreal))";
   1.111 -by (auto_tac (claset() addSDs [not_hypreal_leE, hypreal_less_asym] 
   1.112 -                       addIs [hypreal_le_anti_sym],
   1.113 -              simpset() addsimps [hypreal_ge_zero_iff]));
   1.114 +Goalw [hrabs_def] "abs(-x) = abs((x::hypreal))";
   1.115 +by (Simp_tac 1);
   1.116  qed "hrabs_minus_cancel";
   1.117  Addsimps [hrabs_minus_cancel];
   1.118  
   1.119 -val prem1::prem2::rest = goal thy 
   1.120 -    "[| abs x < r; abs y < s |] ==> abs(x+y) < r + (s::hypreal)";
   1.121 -by (rtac order_le_less_trans 1);
   1.122 -by (rtac hrabs_triangle_ineq 1);
   1.123 -by (rtac ([prem1,prem2] MRS hypreal_add_less_mono) 1);
   1.124 +Goalw [hrabs_def] "[| abs x < r; abs y < s |] ==> abs(x+y) < r + (s::hypreal)";
   1.125 +by (asm_full_simp_tac (simpset() addsplits [split_if_asm]) 1); 
   1.126  qed "hrabs_add_less";
   1.127  
   1.128  Goal "[| abs x<r;  abs y<s |] ==> abs x * abs y < r * (s::hypreal)";
   1.129 -by (subgoal_tac "Numeral0 < r" 1);
   1.130 +by (subgoal_tac "0 < r" 1);
   1.131  by (asm_full_simp_tac (simpset() addsimps [hrabs_def] 
   1.132                                   addsplits [split_if_asm]) 2); 
   1.133 -by (case_tac "y = Numeral0" 1);
   1.134 +by (case_tac "y = 0" 1);
   1.135  by (asm_full_simp_tac (simpset() addsimps [hypreal_0_less_mult_iff]) 1); 
   1.136  by (rtac hypreal_mult_less_mono 1); 
   1.137  by (auto_tac (claset(), 
   1.138 @@ -139,40 +121,27 @@
   1.139                          addsplits [split_if_asm])); 
   1.140  qed "hrabs_mult_less";
   1.141  
   1.142 -Goal "((Numeral0::hypreal) < abs x) = (x ~= 0)";
   1.143 +Goal "((0::hypreal) < abs x) = (x ~= 0)";
   1.144  by (simp_tac (simpset() addsimps [hrabs_def]) 1);
   1.145  by (arith_tac 1);
   1.146  qed "hypreal_0_less_abs_iff";
   1.147  Addsimps [hypreal_0_less_abs_iff];
   1.148  
   1.149 -Goal "abs x < r ==> (Numeral0::hypreal) < r";
   1.150 +Goal "abs x < r ==> (0::hypreal) < r";
   1.151  by (blast_tac (claset() addSIs [order_le_less_trans, hrabs_ge_zero]) 1);
   1.152  qed "hrabs_less_gt_zero";
   1.153  
   1.154  Goal "abs x = (x::hypreal) | abs x = -x";
   1.155 -by (cut_inst_tac [("x","Numeral0"),("y","x")] hypreal_linear 1);
   1.156 -by (fast_tac (claset() addIs [hrabs_eqI2,hrabs_minus_eqI2,
   1.157 -                            hrabs_zero]) 1);
   1.158 +by (simp_tac (simpset() addsimps [hrabs_def]) 1); 
   1.159  qed "hrabs_disj";
   1.160  
   1.161  Goal "abs x = (y::hypreal) ==> x = y | -x = y";
   1.162 -by (dtac sym 1);
   1.163 -by (hyp_subst_tac 1);
   1.164 -by (res_inst_tac [("x1","x")] (hrabs_disj RS disjE) 1);
   1.165 -by (REPEAT(Asm_simp_tac 1));
   1.166 +by (asm_full_simp_tac (simpset() addsimps [hrabs_def] 
   1.167 +                                 addsplits [split_if_asm]) 1); 
   1.168  qed "hrabs_eq_disj";
   1.169  
   1.170 -Goal "(abs x < (r::hypreal)) = (-r < x & x < r)";
   1.171 -by (Step_tac 1);
   1.172 -by (rtac (hypreal_less_swap_iff RS iffD2) 1);
   1.173 -by (asm_simp_tac (simpset() addsimps [(hrabs_ge_minus_self 
   1.174 -    RS order_le_less_trans)]) 1);
   1.175 -by (asm_simp_tac (simpset() addsimps [(hrabs_ge_self 
   1.176 -    RS order_le_less_trans)]) 1);
   1.177 -by (EVERY1 [dtac (hypreal_less_swap_iff RS iffD1), rotate_tac 1, 
   1.178 -            dtac (hypreal_minus_minus RS subst), 
   1.179 -            cut_inst_tac [("x","x")] hrabs_disj, dtac disjE ]);
   1.180 -by (assume_tac 3 THEN Auto_tac);
   1.181 +Goalw [hrabs_def] "(abs x < (r::hypreal)) = (-r < x & x < r)";
   1.182 +by Auto_tac; 
   1.183  qed "hrabs_interval_iff";
   1.184  
   1.185  Goal "(abs x < (r::hypreal)) = (- x < r & x < r)";
   1.186 @@ -247,14 +216,19 @@
   1.187  
   1.188  (*"neg" is used in rewrite rules for binary comparisons*)
   1.189  Goal "hypreal_of_nat (number_of v :: nat) = \
   1.190 -\        (if neg (number_of v) then Numeral0 \
   1.191 +\        (if neg (number_of v) then 0 \
   1.192  \         else (number_of v :: hypreal))";
   1.193  by (simp_tac (simpset() addsimps [hypreal_of_nat_def]) 1);
   1.194  qed "hypreal_of_nat_number_of";
   1.195  Addsimps [hypreal_of_nat_number_of];
   1.196  
   1.197 -Goal "hypreal_of_nat 0 = Numeral0";
   1.198 +Goal "hypreal_of_nat 0 = 0";
   1.199  by (simp_tac (simpset() delsimps [numeral_0_eq_0]
   1.200 -			addsimps [numeral_0_eq_0 RS sym]) 1);
   1.201 +                        addsimps [numeral_0_eq_0 RS sym]) 1);
   1.202  qed "hypreal_of_nat_zero";
   1.203  Addsimps [hypreal_of_nat_zero];
   1.204 +
   1.205 +Goal "hypreal_of_nat 1 = 1";
   1.206 +by (simp_tac (simpset() addsimps [hypreal_of_nat_Suc]) 1); 
   1.207 +qed "hypreal_of_nat_one";
   1.208 +Addsimps [hypreal_of_nat_one];
     2.1 --- a/src/HOL/Hyperreal/HSeries.ML	Thu Nov 01 21:12:13 2001 +0100
     2.2 +++ b/src/HOL/Hyperreal/HSeries.ML	Fri Nov 02 17:55:24 2001 +0100
     2.3 @@ -35,7 +35,7 @@
     2.4  
     2.5  (* Theorem corresponding to base case in def of sumr *)
     2.6  Goalw [hypnat_zero_def]
     2.7 -     "sumhr (m,0,f) = Numeral0";
     2.8 +     "sumhr (m,0,f) = 0";
     2.9  by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
    2.10  by (auto_tac (claset(), 
    2.11                simpset() addsimps [sumhr, symmetric hypreal_zero_def]));
    2.12 @@ -44,31 +44,26 @@
    2.13  
    2.14  (* Theorem corresponding to recursive case in def of sumr *)
    2.15  Goalw [hypnat_one_def]
    2.16 -     "sumhr(m,n+(1::hypnat),f) = (if n + (1::hypnat) <= m then Numeral0 \
    2.17 +     "sumhr(m,n+(1::hypnat),f) = (if n + (1::hypnat) <= m then 0 \
    2.18  \                         else sumhr(m,n,f) + (*fNat* f) n)";
    2.19 -by (simp_tac (HOL_ss addsimps
    2.20 -             [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
    2.21  by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
    2.22  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
    2.23  by (auto_tac (claset(),
    2.24 -     simpset() addsimps [sumhr, hypnat_add,hypnat_le,starfunNat,hypreal_add]));
    2.25 +     simpset() addsimps [sumhr, hypnat_add,hypnat_le,starfunNat,hypreal_add, 
    2.26 +                         hypreal_zero_def]));
    2.27  by (ALLGOALS(Ultra_tac));
    2.28  qed "sumhr_if";
    2.29  
    2.30 -Goalw [hypnat_one_def] "sumhr (n + (1::hypnat), n, f) = Numeral0";
    2.31 -by (simp_tac (HOL_ss addsimps
    2.32 -             [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
    2.33 +Goalw [hypnat_one_def] "sumhr (n + (1::hypnat), n, f) = 0";
    2.34  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
    2.35  by (auto_tac (claset(),
    2.36 -              simpset() addsimps [sumhr, hypnat_add]));
    2.37 +              simpset() addsimps [sumhr, hypnat_add, hypreal_zero_def]));
    2.38  qed "sumhr_Suc_zero";
    2.39  Addsimps [sumhr_Suc_zero];
    2.40  
    2.41 -Goal "sumhr (n,n,f) = Numeral0";
    2.42 -by (simp_tac (HOL_ss addsimps
    2.43 -             [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
    2.44 +Goal "sumhr (n,n,f) = 0";
    2.45  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
    2.46 -by (auto_tac (claset(), simpset() addsimps [sumhr]));
    2.47 +by (auto_tac (claset(), simpset() addsimps [sumhr, hypreal_zero_def]));
    2.48  qed "sumhr_eq_bounds";
    2.49  Addsimps [sumhr_eq_bounds];
    2.50  
    2.51 @@ -80,13 +75,11 @@
    2.52  qed "sumhr_Suc";
    2.53  Addsimps [sumhr_Suc];
    2.54  
    2.55 -Goal "sumhr(m+k,k,f) = Numeral0";
    2.56 -by (simp_tac (HOL_ss addsimps
    2.57 -             [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
    2.58 +Goal "sumhr(m+k,k,f) = 0";
    2.59  by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
    2.60  by (res_inst_tac [("z","k")] eq_Abs_hypnat 1);
    2.61  by (auto_tac (claset(),
    2.62 -              simpset() addsimps [sumhr, hypnat_add]));
    2.63 +              simpset() addsimps [sumhr, hypnat_add, hypreal_zero_def]));
    2.64  qed "sumhr_add_lbound_zero";
    2.65  Addsimps [sumhr_add_lbound_zero];
    2.66  
    2.67 @@ -156,13 +149,11 @@
    2.68  		    hypreal_minus,sumr_add RS sym]) 1);
    2.69  qed "sumhr_add_mult_const";
    2.70  
    2.71 -Goal "n < m ==> sumhr (m,n,f) = Numeral0";
    2.72 -by (simp_tac (HOL_ss addsimps
    2.73 -             [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
    2.74 +Goal "n < m ==> sumhr (m,n,f) = 0";
    2.75  by (res_inst_tac [("z","m")] eq_Abs_hypnat 1);
    2.76  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
    2.77  by (auto_tac (claset() addEs [FreeUltrafilterNat_subset],
    2.78 -              simpset() addsimps [sumhr,hypnat_less]));
    2.79 +              simpset() addsimps [sumhr,hypnat_less, hypreal_zero_def]));
    2.80  qed "sumhr_less_bounds_zero";
    2.81  Addsimps [sumhr_less_bounds_zero];
    2.82  
    2.83 @@ -185,25 +176,23 @@
    2.84        by summing to some infinite hypernatural (such as whn)
    2.85   -----------------------------------------------------------------*)
    2.86  Goalw [hypnat_omega_def,hypnat_zero_def] 
    2.87 -      "sumhr(0,whn,%i. Numeral1) = hypreal_of_hypnat whn";
    2.88 +      "sumhr(0,whn,%i. 1) = hypreal_of_hypnat whn";
    2.89  by (auto_tac (claset(),
    2.90                simpset() addsimps [sumhr, hypreal_of_hypnat]));
    2.91  qed "sumhr_hypreal_of_hypnat_omega";
    2.92  
    2.93  Goalw [hypnat_omega_def,hypnat_zero_def,omega_def]  
    2.94 -     "sumhr(0, whn, %i. Numeral1) = omega - Numeral1";
    2.95 +     "sumhr(0, whn, %i. 1) = omega - 1";
    2.96  by (simp_tac (HOL_ss addsimps
    2.97 -             [one_eq_numeral_1 RS sym, hypreal_one_def]) 1); 
    2.98 +             [hypreal_numeral_1_eq_1, hypreal_one_def]) 1); 
    2.99  by (auto_tac (claset(),
   2.100                simpset() addsimps [sumhr, hypreal_diff, real_of_nat_Suc]));
   2.101  qed "sumhr_hypreal_omega_minus_one";
   2.102  
   2.103  Goalw [hypnat_zero_def, hypnat_omega_def]
   2.104 -     "sumhr(0, whn + whn, %i. (-Numeral1) ^ (i+1)) = Numeral0";
   2.105 -by (simp_tac (HOL_ss addsimps
   2.106 -             [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
   2.107 -by (simp_tac (simpset() addsimps [sumhr,hypnat_add,double_lemma] 
   2.108 -                        delsimps [realpow_Suc]) 1);
   2.109 +     "sumhr(0, whn + whn, %i. (-1) ^ (i+1)) = 0";
   2.110 +by (simp_tac (simpset() delsimps [realpow_Suc]
   2.111 +               addsimps [sumhr,hypnat_add,double_lemma, hypreal_zero_def]) 1);
   2.112  qed "sumhr_minus_one_realpow_zero";
   2.113  Addsimps [sumhr_minus_one_realpow_zero];
   2.114  
   2.115 @@ -223,7 +212,7 @@
   2.116  qed "starfunNat_sumr";
   2.117  
   2.118  Goal "sumhr (0, M, f) @= sumhr (0, N, f) \
   2.119 -\     ==> abs (sumhr (M, N, f)) @= Numeral0";
   2.120 +\     ==> abs (sumhr (M, N, f)) @= 0";
   2.121  by (cut_inst_tac [("x","M"),("y","N")] hypnat_linear 1);
   2.122  by (auto_tac (claset(), simpset() addsimps [approx_refl]));
   2.123  by (dtac (approx_sym RS (approx_minus_iff RS iffD1)) 1);
   2.124 @@ -265,12 +254,12 @@
   2.125                           sums_unique]) 1);
   2.126  qed "NSsums_unique";
   2.127  
   2.128 -Goal "ALL m. n <= Suc m --> f(m) = Numeral0 ==> f NSsums (sumr 0 n f)";
   2.129 +Goal "ALL m. n <= Suc m --> f(m) = 0 ==> f NSsums (sumr 0 n f)";
   2.130  by (asm_simp_tac (simpset() addsimps [sums_NSsums_iff RS sym, series_zero]) 1);
   2.131  qed "NSseries_zero";
   2.132  
   2.133  Goal "NSsummable f = \
   2.134 -\     (ALL M: HNatInfinite. ALL N: HNatInfinite. abs (sumhr(M,N,f)) @= Numeral0)";
   2.135 +\     (ALL M: HNatInfinite. ALL N: HNatInfinite. abs (sumhr(M,N,f)) @= 0)";
   2.136  by (auto_tac (claset(),
   2.137                simpset() addsimps [summable_NSsummable_iff RS sym,
   2.138                   summable_convergent_sumr_iff, convergent_NSconvergent_iff,
   2.139 @@ -287,17 +276,16 @@
   2.140  (*-------------------------------------------------------------------
   2.141           Terms of a convergent series tend to zero
   2.142   -------------------------------------------------------------------*)
   2.143 -Goalw [NSLIMSEQ_def] "NSsummable f ==> f ----NS> Numeral0";
   2.144 +Goalw [NSLIMSEQ_def] "NSsummable f ==> f ----NS> 0";
   2.145  by (auto_tac (claset(), simpset() addsimps [NSsummable_NSCauchy]));
   2.146  by (dtac bspec 1 THEN Auto_tac);
   2.147  by (dres_inst_tac [("x","N + (1::hypnat)")] bspec 1);
   2.148 -by (auto_tac (claset() addIs [HNatInfinite_add_one,
   2.149 -                              approx_hrabs_zero_cancel],
   2.150 -              simpset() addsimps [rename_numerals hypreal_of_real_zero]));
   2.151 +by (auto_tac (claset() addIs [HNatInfinite_add_one, approx_hrabs_zero_cancel],
   2.152 +              simpset()));
   2.153  qed "NSsummable_NSLIMSEQ_zero";
   2.154  
   2.155  (* Easy to prove stsandard case now *)
   2.156 -Goal "summable f ==> f ----> Numeral0";
   2.157 +Goal "summable f ==> f ----> 0";
   2.158  by (auto_tac (claset(),
   2.159          simpset() addsimps [summable_NSsummable_iff,
   2.160                              LIMSEQ_NSLIMSEQ_iff, NSsummable_NSLIMSEQ_zero]));
     3.1 --- a/src/HOL/Hyperreal/HyperArith0.ML	Thu Nov 01 21:12:13 2001 +0100
     3.2 +++ b/src/HOL/Hyperreal/HyperArith0.ML	Fri Nov 02 17:55:24 2001 +0100
     3.3 @@ -8,7 +8,12 @@
     3.4  Also, common factor cancellation
     3.5  *)
     3.6  
     3.7 -Goal "((x * y = Numeral0) = (x = Numeral0 | y = (Numeral0::hypreal)))";
     3.8 +Goal "x - - y = x + (y::hypreal)";
     3.9 +by (Simp_tac 1); 
    3.10 +qed "hypreal_diff_minus_eq";
    3.11 +Addsimps [hypreal_diff_minus_eq];
    3.12 +
    3.13 +Goal "((x * y = 0) = (x = 0 | y = (0::hypreal)))";
    3.14  by Auto_tac;  
    3.15  by (cut_inst_tac [("x","x"),("y","y")] hypreal_mult_zero_disj 1);
    3.16  by Auto_tac;  
    3.17 @@ -17,85 +22,85 @@
    3.18  
    3.19  (** Division and inverse **)
    3.20  
    3.21 -Goal "Numeral0/x = (Numeral0::hypreal)";
    3.22 +Goal "0/x = (0::hypreal)";
    3.23  by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1); 
    3.24  qed "hypreal_0_divide";
    3.25  Addsimps [hypreal_0_divide];
    3.26  
    3.27 -Goal "((Numeral0::hypreal) < inverse x) = (Numeral0 < x)";
    3.28 -by (case_tac "x=Numeral0" 1);
    3.29 -by (asm_simp_tac (HOL_ss addsimps [rename_numerals HYPREAL_INVERSE_ZERO]) 1); 
    3.30 +Goal "((0::hypreal) < inverse x) = (0 < x)";
    3.31 +by (case_tac "x=0" 1);
    3.32 +by (asm_simp_tac (HOL_ss addsimps [HYPREAL_INVERSE_ZERO]) 1); 
    3.33  by (auto_tac (claset() addDs [hypreal_inverse_less_0], 
    3.34                simpset() addsimps [linorder_neq_iff, 
    3.35                                    hypreal_inverse_gt_0]));  
    3.36  qed "hypreal_0_less_inverse_iff";
    3.37  Addsimps [hypreal_0_less_inverse_iff];
    3.38  
    3.39 -Goal "(inverse x < (Numeral0::hypreal)) = (x < Numeral0)";
    3.40 -by (case_tac "x=Numeral0" 1);
    3.41 -by (asm_simp_tac (HOL_ss addsimps [rename_numerals HYPREAL_INVERSE_ZERO]) 1); 
    3.42 +Goal "(inverse x < (0::hypreal)) = (x < 0)";
    3.43 +by (case_tac "x=0" 1);
    3.44 +by (asm_simp_tac (HOL_ss addsimps [HYPREAL_INVERSE_ZERO]) 1); 
    3.45  by (auto_tac (claset() addDs [hypreal_inverse_less_0], 
    3.46                simpset() addsimps [linorder_neq_iff, 
    3.47                                    hypreal_inverse_gt_0]));  
    3.48  qed "hypreal_inverse_less_0_iff";
    3.49  Addsimps [hypreal_inverse_less_0_iff];
    3.50  
    3.51 -Goal "((Numeral0::hypreal) <= inverse x) = (Numeral0 <= x)";
    3.52 +Goal "((0::hypreal) <= inverse x) = (0 <= x)";
    3.53  by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); 
    3.54  qed "hypreal_0_le_inverse_iff";
    3.55  Addsimps [hypreal_0_le_inverse_iff];
    3.56  
    3.57 -Goal "(inverse x <= (Numeral0::hypreal)) = (x <= Numeral0)";
    3.58 +Goal "(inverse x <= (0::hypreal)) = (x <= 0)";
    3.59  by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); 
    3.60  qed "hypreal_inverse_le_0_iff";
    3.61  Addsimps [hypreal_inverse_le_0_iff];
    3.62  
    3.63 -Goalw [hypreal_divide_def] "x/(Numeral0::hypreal) = Numeral0";
    3.64 -by (stac (rename_numerals HYPREAL_INVERSE_ZERO) 1); 
    3.65 +Goalw [hypreal_divide_def] "x/(0::hypreal) = 0";
    3.66 +by (stac (HYPREAL_INVERSE_ZERO) 1); 
    3.67  by (Simp_tac 1); 
    3.68  qed "HYPREAL_DIVIDE_ZERO";
    3.69  
    3.70 -Goal "inverse (x::hypreal) = Numeral1/x";
    3.71 +Goal "inverse (x::hypreal) = 1/x";
    3.72  by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1); 
    3.73  qed "hypreal_inverse_eq_divide";
    3.74  
    3.75 -Goal "((Numeral0::hypreal) < x/y) = (Numeral0 < x & Numeral0 < y | x < Numeral0 & y < Numeral0)";
    3.76 +Goal "((0::hypreal) < x/y) = (0 < x & 0 < y | x < 0 & y < 0)";
    3.77  by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_0_less_mult_iff]) 1);
    3.78  qed "hypreal_0_less_divide_iff";
    3.79  Addsimps [inst "x" "number_of ?w" hypreal_0_less_divide_iff];
    3.80  
    3.81 -Goal "(x/y < (Numeral0::hypreal)) = (Numeral0 < x & y < Numeral0 | x < Numeral0 & Numeral0 < y)";
    3.82 +Goal "(x/y < (0::hypreal)) = (0 < x & y < 0 | x < 0 & 0 < y)";
    3.83  by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_less_0_iff]) 1);
    3.84  qed "hypreal_divide_less_0_iff";
    3.85  Addsimps [inst "x" "number_of ?w" hypreal_divide_less_0_iff];
    3.86  
    3.87 -Goal "((Numeral0::hypreal) <= x/y) = ((x <= Numeral0 | Numeral0 <= y) & (Numeral0 <= x | y <= Numeral0))";
    3.88 +Goal "((0::hypreal) <= x/y) = ((x <= 0 | 0 <= y) & (0 <= x | y <= 0))";
    3.89  by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_0_le_mult_iff]) 1);
    3.90  by Auto_tac;  
    3.91  qed "hypreal_0_le_divide_iff";
    3.92  Addsimps [inst "x" "number_of ?w" hypreal_0_le_divide_iff];
    3.93  
    3.94 -Goal "(x/y <= (Numeral0::hypreal)) = ((x <= Numeral0 | y <= Numeral0) & (Numeral0 <= x | Numeral0 <= y))";
    3.95 +Goal "(x/y <= (0::hypreal)) = ((x <= 0 | y <= 0) & (0 <= x | 0 <= y))";
    3.96  by (simp_tac (simpset() addsimps [hypreal_divide_def, 
    3.97                                    hypreal_mult_le_0_iff]) 1);
    3.98  by Auto_tac;  
    3.99  qed "hypreal_divide_le_0_iff";
   3.100  Addsimps [inst "x" "number_of ?w" hypreal_divide_le_0_iff];
   3.101  
   3.102 -Goal "(inverse(x::hypreal) = Numeral0) = (x = Numeral0)";
   3.103 +Goal "(inverse(x::hypreal) = 0) = (x = 0)";
   3.104  by (auto_tac (claset(), 
   3.105 -              simpset() addsimps [rename_numerals HYPREAL_INVERSE_ZERO]));  
   3.106 +              simpset() addsimps [HYPREAL_INVERSE_ZERO]));  
   3.107  by (rtac ccontr 1); 
   3.108 -by (blast_tac (claset() addDs [rename_numerals hypreal_inverse_not_zero]) 1); 
   3.109 +by (blast_tac (claset() addDs [hypreal_inverse_not_zero]) 1); 
   3.110  qed "hypreal_inverse_zero_iff";
   3.111  Addsimps [hypreal_inverse_zero_iff];
   3.112  
   3.113 -Goal "(x/y = Numeral0) = (x=Numeral0 | y=(Numeral0::hypreal))";
   3.114 +Goal "(x/y = 0) = (x=0 | y=(0::hypreal))";
   3.115  by (auto_tac (claset(), simpset() addsimps [hypreal_divide_def]));  
   3.116  qed "hypreal_divide_eq_0_iff";
   3.117  Addsimps [hypreal_divide_eq_0_iff];
   3.118  
   3.119 -Goal "h ~= (Numeral0::hypreal) ==> h/h = Numeral1";
   3.120 +Goal "h ~= (0::hypreal) ==> h/h = 1";
   3.121  by (asm_simp_tac 
   3.122      (simpset() addsimps [hypreal_divide_def, hypreal_mult_inverse_left]) 1);
   3.123  qed "hypreal_divide_self_eq"; 
   3.124 @@ -140,7 +145,7 @@
   3.125  by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [hypreal_mult_commute])));
   3.126  qed "hypreal_mult_le_mono2_neg";
   3.127  
   3.128 -Goal "(m*k < n*k) = (((Numeral0::hypreal) < k & m<n) | (k < Numeral0 & n<m))";
   3.129 +Goal "(m*k < n*k) = (((0::hypreal) < k & m<n) | (k < 0 & n<m))";
   3.130  by (case_tac "k = (0::hypreal)" 1);
   3.131  by (auto_tac (claset(), 
   3.132            simpset() addsimps [linorder_neq_iff, 
   3.133 @@ -155,32 +160,32 @@
   3.134                                    hypreal_mult_le_mono1_neg]));  
   3.135  qed "hypreal_mult_less_cancel2";
   3.136  
   3.137 -Goal "(m*k <= n*k) = (((Numeral0::hypreal) < k --> m<=n) & (k < Numeral0 --> n<=m))";
   3.138 +Goal "(m*k <= n*k) = (((0::hypreal) < k --> m<=n) & (k < 0 --> n<=m))";
   3.139  by (simp_tac (simpset() addsimps [linorder_not_less RS sym, 
   3.140                                    hypreal_mult_less_cancel2]) 1);
   3.141  qed "hypreal_mult_le_cancel2";
   3.142  
   3.143 -Goal "(k*m < k*n) = (((Numeral0::hypreal) < k & m<n) | (k < Numeral0 & n<m))";
   3.144 +Goal "(k*m < k*n) = (((0::hypreal) < k & m<n) | (k < 0 & n<m))";
   3.145  by (simp_tac (simpset() addsimps [inst "z" "k" hypreal_mult_commute, 
   3.146                                    hypreal_mult_less_cancel2]) 1);
   3.147  qed "hypreal_mult_less_cancel1";
   3.148  
   3.149 -Goal "!!k::hypreal. (k*m <= k*n) = ((Numeral0 < k --> m<=n) & (k < Numeral0 --> n<=m))";
   3.150 +Goal "!!k::hypreal. (k*m <= k*n) = ((0 < k --> m<=n) & (k < 0 --> n<=m))";
   3.151  by (simp_tac (simpset() addsimps [linorder_not_less RS sym, 
   3.152                                    hypreal_mult_less_cancel1]) 1);
   3.153  qed "hypreal_mult_le_cancel1";
   3.154  
   3.155 -Goal "!!k::hypreal. (k*m = k*n) = (k = Numeral0 | m=n)";
   3.156 +Goal "!!k::hypreal. (k*m = k*n) = (k = 0 | m=n)";
   3.157  by (case_tac "k=0" 1);
   3.158  by (auto_tac (claset(), simpset() addsimps [hypreal_mult_left_cancel]));  
   3.159  qed "hypreal_mult_eq_cancel1";
   3.160  
   3.161 -Goal "!!k::hypreal. (m*k = n*k) = (k = Numeral0 | m=n)";
   3.162 +Goal "!!k::hypreal. (m*k = n*k) = (k = 0 | m=n)";
   3.163  by (case_tac "k=0" 1);
   3.164  by (auto_tac (claset(), simpset() addsimps [hypreal_mult_right_cancel]));  
   3.165  qed "hypreal_mult_eq_cancel2";
   3.166  
   3.167 -Goal "!!k::hypreal. k~=Numeral0 ==> (k*m) / (k*n) = (m/n)";
   3.168 +Goal "!!k::hypreal. k~=0 ==> (k*m) / (k*n) = (m/n)";
   3.169  by (asm_simp_tac
   3.170      (simpset() addsimps [hypreal_divide_def, hypreal_inverse_distrib]) 1); 
   3.171  by (subgoal_tac "k * m * (inverse k * inverse n) = \
   3.172 @@ -190,7 +195,7 @@
   3.173  qed "hypreal_mult_div_cancel1";
   3.174  
   3.175  (*For ExtractCommonTerm*)
   3.176 -Goal "(k*m) / (k*n) = (if k = (Numeral0::hypreal) then Numeral0 else m/n)";
   3.177 +Goal "(k*m) / (k*n) = (if k = (0::hypreal) then 0 else m/n)";
   3.178  by (simp_tac (simpset() addsimps [hypreal_mult_div_cancel1]) 1); 
   3.179  qed "hypreal_mult_div_cancel_disj";
   3.180  
   3.181 @@ -206,14 +211,11 @@
   3.182    struct
   3.183    val mk_coeff		= mk_coeff
   3.184    val dest_coeff	= dest_coeff 1
   3.185 -  val trans_tac         = trans_tac
   3.186 -  val norm_tac = ALLGOALS (simp_tac (HOL_ss addsimps mult_plus_1s))
   3.187 +  val trans_tac         = Real_Numeral_Simprocs.trans_tac
   3.188 +  val norm_tac = 
   3.189 +     ALLGOALS (simp_tac (HOL_ss addsimps hypreal_minus_from_mult_simps @ mult_1s))
   3.190       THEN ALLGOALS (simp_tac (HOL_ss addsimps bin_simps@hypreal_mult_minus_simps))
   3.191 -     THEN ALLGOALS
   3.192 -	  (simp_tac 
   3.193 -	   (HOL_ss addsimps [eq_hypreal_number_of, mult_hypreal_number_of, 
   3.194 -                             hypreal_mult_number_of_left]@
   3.195 -           hypreal_minus_from_mult_simps @ hypreal_mult_ac))
   3.196 +     THEN ALLGOALS (simp_tac (HOL_ss addsimps hypreal_mult_ac))
   3.197    val numeral_simp_tac	= 
   3.198           ALLGOALS (simp_tac (HOL_ss addsimps rel_hypreal_number_of@bin_simps))
   3.199    val simplify_meta_eq  = simplify_meta_eq
   3.200 @@ -221,7 +223,8 @@
   3.201  
   3.202  structure DivCancelNumeralFactor = CancelNumeralFactorFun
   3.203   (open CancelNumeralFactorCommon
   3.204 -  val prove_conv = prove_conv "hyprealdiv_cancel_numeral_factor"
   3.205 +  val prove_conv = Real_Numeral_Simprocs.prove_conv
   3.206 +                     "hyprealdiv_cancel_numeral_factor"
   3.207    val mk_bal   = HOLogic.mk_binop "HOL.divide"
   3.208    val dest_bal = HOLogic.dest_bin "HOL.divide" hyprealT
   3.209    val cancel = hypreal_mult_div_cancel1 RS trans
   3.210 @@ -230,7 +233,8 @@
   3.211  
   3.212  structure EqCancelNumeralFactor = CancelNumeralFactorFun
   3.213   (open CancelNumeralFactorCommon
   3.214 -  val prove_conv = prove_conv "hyprealeq_cancel_numeral_factor"
   3.215 +  val prove_conv = Real_Numeral_Simprocs.prove_conv
   3.216 +                     "hyprealeq_cancel_numeral_factor"
   3.217    val mk_bal   = HOLogic.mk_eq
   3.218    val dest_bal = HOLogic.dest_bin "op =" hyprealT
   3.219    val cancel = hypreal_mult_eq_cancel1 RS trans
   3.220 @@ -239,7 +243,8 @@
   3.221  
   3.222  structure LessCancelNumeralFactor = CancelNumeralFactorFun
   3.223   (open CancelNumeralFactorCommon
   3.224 -  val prove_conv = prove_conv "hyprealless_cancel_numeral_factor"
   3.225 +  val prove_conv = Real_Numeral_Simprocs.prove_conv
   3.226 +                     "hyprealless_cancel_numeral_factor"
   3.227    val mk_bal   = HOLogic.mk_binrel "op <"
   3.228    val dest_bal = HOLogic.dest_bin "op <" hyprealT
   3.229    val cancel = hypreal_mult_less_cancel1 RS trans
   3.230 @@ -248,7 +253,8 @@
   3.231  
   3.232  structure LeCancelNumeralFactor = CancelNumeralFactorFun
   3.233   (open CancelNumeralFactorCommon
   3.234 -  val prove_conv = prove_conv "hyprealle_cancel_numeral_factor"
   3.235 +  val prove_conv = Real_Numeral_Simprocs.prove_conv
   3.236 +                     "hyprealle_cancel_numeral_factor"
   3.237    val mk_bal   = HOLogic.mk_binrel "op <="
   3.238    val dest_bal = HOLogic.dest_bin "op <=" hyprealT
   3.239    val cancel = hypreal_mult_le_cancel1 RS trans
   3.240 @@ -288,7 +294,7 @@
   3.241  set trace_simp;
   3.242  fun test s = (Goal s; by (Simp_tac 1)); 
   3.243  
   3.244 -test "Numeral0 <= (y::hypreal) * -2";
   3.245 +test "0 <= (y::hypreal) * -2";
   3.246  test "9*x = 12 * (y::hypreal)";
   3.247  test "(9*x) / (12 * (y::hypreal)) = z";
   3.248  test "9*x < 12 * (y::hypreal)";
   3.249 @@ -332,13 +338,14 @@
   3.250    val mk_coeff		= mk_coeff
   3.251    val dest_coeff	= dest_coeff
   3.252    val find_first	= find_first []
   3.253 -  val trans_tac         = trans_tac
   3.254 +  val trans_tac         = Real_Numeral_Simprocs.trans_tac
   3.255    val norm_tac = ALLGOALS (simp_tac (HOL_ss addsimps mult_1s@hypreal_mult_ac))
   3.256    end;
   3.257  
   3.258  structure EqCancelFactor = ExtractCommonTermFun
   3.259   (open CancelFactorCommon
   3.260 -  val prove_conv = prove_conv "hypreal_eq_cancel_factor"
   3.261 +  val prove_conv = Real_Numeral_Simprocs.prove_conv
   3.262 +                     "hypreal_eq_cancel_factor"
   3.263    val mk_bal   = HOLogic.mk_eq
   3.264    val dest_bal = HOLogic.dest_bin "op =" hyprealT
   3.265    val simplify_meta_eq  = cancel_simplify_meta_eq hypreal_mult_eq_cancel1
   3.266 @@ -347,7 +354,8 @@
   3.267  
   3.268  structure DivideCancelFactor = ExtractCommonTermFun
   3.269   (open CancelFactorCommon
   3.270 -  val prove_conv = prove_conv "hypreal_divide_cancel_factor"
   3.271 +  val prove_conv = Real_Numeral_Simprocs.prove_conv
   3.272 +                     "hypreal_divide_cancel_factor"
   3.273    val mk_bal   = HOLogic.mk_binop "HOL.divide"
   3.274    val dest_bal = HOLogic.dest_bin "HOL.divide" hyprealT
   3.275    val simplify_meta_eq  = cancel_simplify_meta_eq hypreal_mult_div_cancel_disj
   3.276 @@ -391,7 +399,7 @@
   3.277  
   3.278  (*** Simplification of inequalities involving literal divisors ***)
   3.279  
   3.280 -Goal "Numeral0<z ==> ((x::hypreal) <= y/z) = (x*z <= y)";
   3.281 +Goal "0<z ==> ((x::hypreal) <= y/z) = (x*z <= y)";
   3.282  by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
   3.283  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.284  by (etac ssubst 1);
   3.285 @@ -400,7 +408,7 @@
   3.286  qed "pos_hypreal_le_divide_eq";
   3.287  Addsimps [inst "z" "number_of ?w" pos_hypreal_le_divide_eq];
   3.288  
   3.289 -Goal "z<Numeral0 ==> ((x::hypreal) <= y/z) = (y <= x*z)";
   3.290 +Goal "z<0 ==> ((x::hypreal) <= y/z) = (y <= x*z)";
   3.291  by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
   3.292  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.293  by (etac ssubst 1);
   3.294 @@ -409,7 +417,7 @@
   3.295  qed "neg_hypreal_le_divide_eq";
   3.296  Addsimps [inst "z" "number_of ?w" neg_hypreal_le_divide_eq];
   3.297  
   3.298 -Goal "Numeral0<z ==> (y/z <= (x::hypreal)) = (y <= x*z)";
   3.299 +Goal "0<z ==> (y/z <= (x::hypreal)) = (y <= x*z)";
   3.300  by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
   3.301  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.302  by (etac ssubst 1);
   3.303 @@ -418,7 +426,7 @@
   3.304  qed "pos_hypreal_divide_le_eq";
   3.305  Addsimps [inst "z" "number_of ?w" pos_hypreal_divide_le_eq];
   3.306  
   3.307 -Goal "z<Numeral0 ==> (y/z <= (x::hypreal)) = (x*z <= y)";
   3.308 +Goal "z<0 ==> (y/z <= (x::hypreal)) = (x*z <= y)";
   3.309  by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
   3.310  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.311  by (etac ssubst 1);
   3.312 @@ -427,7 +435,7 @@
   3.313  qed "neg_hypreal_divide_le_eq";
   3.314  Addsimps [inst "z" "number_of ?w" neg_hypreal_divide_le_eq];
   3.315  
   3.316 -Goal "Numeral0<z ==> ((x::hypreal) < y/z) = (x*z < y)";
   3.317 +Goal "0<z ==> ((x::hypreal) < y/z) = (x*z < y)";
   3.318  by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
   3.319  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.320  by (etac ssubst 1);
   3.321 @@ -436,7 +444,7 @@
   3.322  qed "pos_hypreal_less_divide_eq";
   3.323  Addsimps [inst "z" "number_of ?w" pos_hypreal_less_divide_eq];
   3.324  
   3.325 -Goal "z<Numeral0 ==> ((x::hypreal) < y/z) = (y < x*z)";
   3.326 +Goal "z<0 ==> ((x::hypreal) < y/z) = (y < x*z)";
   3.327  by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
   3.328  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.329  by (etac ssubst 1);
   3.330 @@ -445,7 +453,7 @@
   3.331  qed "neg_hypreal_less_divide_eq";
   3.332  Addsimps [inst "z" "number_of ?w" neg_hypreal_less_divide_eq];
   3.333  
   3.334 -Goal "Numeral0<z ==> (y/z < (x::hypreal)) = (y < x*z)";
   3.335 +Goal "0<z ==> (y/z < (x::hypreal)) = (y < x*z)";
   3.336  by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
   3.337  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.338  by (etac ssubst 1);
   3.339 @@ -454,7 +462,7 @@
   3.340  qed "pos_hypreal_divide_less_eq";
   3.341  Addsimps [inst "z" "number_of ?w" pos_hypreal_divide_less_eq];
   3.342  
   3.343 -Goal "z<Numeral0 ==> (y/z < (x::hypreal)) = (x*z < y)";
   3.344 +Goal "z<0 ==> (y/z < (x::hypreal)) = (x*z < y)";
   3.345  by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
   3.346  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.347  by (etac ssubst 1);
   3.348 @@ -463,7 +471,7 @@
   3.349  qed "neg_hypreal_divide_less_eq";
   3.350  Addsimps [inst "z" "number_of ?w" neg_hypreal_divide_less_eq];
   3.351  
   3.352 -Goal "z~=Numeral0 ==> ((x::hypreal) = y/z) = (x*z = y)";
   3.353 +Goal "z~=0 ==> ((x::hypreal) = y/z) = (x*z = y)";
   3.354  by (subgoal_tac "(x*z = y) = (x*z = (y/z)*z)" 1);
   3.355  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.356  by (etac ssubst 1);
   3.357 @@ -472,7 +480,7 @@
   3.358  qed "hypreal_eq_divide_eq";
   3.359  Addsimps [inst "z" "number_of ?w" hypreal_eq_divide_eq];
   3.360  
   3.361 -Goal "z~=Numeral0 ==> (y/z = (x::hypreal)) = (y = x*z)";
   3.362 +Goal "z~=0 ==> (y/z = (x::hypreal)) = (y = x*z)";
   3.363  by (subgoal_tac "(y = x*z) = ((y/z)*z = x*z)" 1);
   3.364  by (asm_simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_mult_assoc]) 2); 
   3.365  by (etac ssubst 1);
   3.366 @@ -481,37 +489,37 @@
   3.367  qed "hypreal_divide_eq_eq";
   3.368  Addsimps [inst "z" "number_of ?w" hypreal_divide_eq_eq];
   3.369  
   3.370 -Goal "(m/k = n/k) = (k = Numeral0 | m = (n::hypreal))";
   3.371 -by (case_tac "k=Numeral0" 1);
   3.372 +Goal "(m/k = n/k) = (k = 0 | m = (n::hypreal))";
   3.373 +by (case_tac "k=0" 1);
   3.374  by (asm_simp_tac (simpset() addsimps [HYPREAL_DIVIDE_ZERO]) 1); 
   3.375  by (asm_simp_tac (simpset() addsimps [hypreal_divide_eq_eq, hypreal_eq_divide_eq, 
   3.376                                        hypreal_mult_eq_cancel2]) 1); 
   3.377  qed "hypreal_divide_eq_cancel2";
   3.378  
   3.379 -Goal "(k/m = k/n) = (k = Numeral0 | m = (n::hypreal))";
   3.380 -by (case_tac "m=Numeral0 | n = Numeral0" 1);
   3.381 +Goal "(k/m = k/n) = (k = 0 | m = (n::hypreal))";
   3.382 +by (case_tac "m=0 | n = 0" 1);
   3.383  by (auto_tac (claset(), 
   3.384                simpset() addsimps [HYPREAL_DIVIDE_ZERO, hypreal_divide_eq_eq, 
   3.385                                    hypreal_eq_divide_eq, hypreal_mult_eq_cancel1]));  
   3.386  qed "hypreal_divide_eq_cancel1";
   3.387  
   3.388 -Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x < inverse (r::hypreal)) = (r < x)";
   3.389 +Goal "[| 0 < r; 0 < x|] ==> (inverse x < inverse (r::hypreal)) = (r < x)";
   3.390  by (auto_tac (claset() addIs [hypreal_inverse_less_swap], simpset()));
   3.391  by (res_inst_tac [("t","r")] (hypreal_inverse_inverse RS subst) 1);
   3.392  by (res_inst_tac [("t","x")] (hypreal_inverse_inverse RS subst) 1);
   3.393  by (auto_tac (claset() addIs [hypreal_inverse_less_swap],
   3.394  	      simpset() delsimps [hypreal_inverse_inverse]
   3.395 -			addsimps [hypreal_inverse_gt_zero]));
   3.396 +			addsimps [hypreal_inverse_gt_0]));
   3.397  qed "hypreal_inverse_less_iff";
   3.398  
   3.399 -Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x <= inverse r) = (r <= (x::hypreal))";
   3.400 +Goal "[| 0 < r; 0 < x|] ==> (inverse x <= inverse r) = (r <= (x::hypreal))";
   3.401  by (asm_simp_tac (simpset() addsimps [linorder_not_less RS sym, 
   3.402                                        hypreal_inverse_less_iff]) 1); 
   3.403  qed "hypreal_inverse_le_iff";
   3.404  
   3.405  (** Division by 1, -1 **)
   3.406  
   3.407 -Goal "(x::hypreal)/Numeral1 = x";
   3.408 +Goal "(x::hypreal)/1 = x";
   3.409  by (simp_tac (simpset() addsimps [hypreal_divide_def]) 1); 
   3.410  qed "hypreal_divide_1";
   3.411  Addsimps [hypreal_divide_1];
   3.412 @@ -521,12 +529,12 @@
   3.413  qed "hypreal_divide_minus1";
   3.414  Addsimps [hypreal_divide_minus1];
   3.415  
   3.416 -Goal "-1/(x::hypreal) = - (Numeral1/x)";
   3.417 +Goal "-1/(x::hypreal) = - (1/x)";
   3.418  by (simp_tac (simpset() addsimps [hypreal_divide_def, hypreal_minus_inverse]) 1); 
   3.419  qed "hypreal_minus1_divide";
   3.420  Addsimps [hypreal_minus1_divide];
   3.421  
   3.422 -Goal "[| (Numeral0::hypreal) < d1; Numeral0 < d2 |] ==> EX e. Numeral0 < e & e < d1 & e < d2";
   3.423 +Goal "[| (0::hypreal) < d1; 0 < d2 |] ==> EX e. 0 < e & e < d1 & e < d2";
   3.424  by (res_inst_tac [("x","(min d1 d2)/2")] exI 1); 
   3.425  by (asm_simp_tac (simpset() addsimps [min_def]) 1); 
   3.426  qed "hypreal_lbound_gt_zero";
   3.427 @@ -560,7 +568,7 @@
   3.428  by Auto_tac;
   3.429  qed "hypreal_minus_equation";
   3.430  
   3.431 -Goal "(x + - a = (Numeral0::hypreal)) = (x=a)";
   3.432 +Goal "(x + - a = (0::hypreal)) = (x=a)";
   3.433  by (arith_tac 1);
   3.434  qed "hypreal_add_minus_iff";
   3.435  Addsimps [hypreal_add_minus_iff];
   3.436 @@ -587,45 +595,49 @@
   3.437  Addsimps (map (inst "y" "number_of ?v") 
   3.438  	  [hypreal_minus_less, hypreal_minus_le, hypreal_minus_equation]);
   3.439  
   3.440 +Addsimps (map (simplify (simpset()) o inst "x" "1") 
   3.441 +	  [hypreal_less_minus, hypreal_le_minus, hypreal_equation_minus]);
   3.442 +Addsimps (map (simplify (simpset()) o inst "y" "1") 
   3.443 +	  [hypreal_minus_less, hypreal_minus_le, hypreal_minus_equation]);
   3.444  
   3.445 -(*** Simprules combining x+y and Numeral0 ***)
   3.446 +(*** Simprules combining x+y and 0 ***)
   3.447  
   3.448 -Goal "(x+y = (Numeral0::hypreal)) = (y = -x)";
   3.449 +Goal "(x+y = (0::hypreal)) = (y = -x)";
   3.450  by Auto_tac;  
   3.451  qed "hypreal_add_eq_0_iff";
   3.452  AddIffs [hypreal_add_eq_0_iff];
   3.453  
   3.454 -Goal "(x+y < (Numeral0::hypreal)) = (y < -x)";
   3.455 +Goal "(x+y < (0::hypreal)) = (y < -x)";
   3.456  by Auto_tac;  
   3.457  qed "hypreal_add_less_0_iff";
   3.458  AddIffs [hypreal_add_less_0_iff];
   3.459  
   3.460 -Goal "((Numeral0::hypreal) < x+y) = (-x < y)";
   3.461 +Goal "((0::hypreal) < x+y) = (-x < y)";
   3.462  by Auto_tac;  
   3.463  qed "hypreal_0_less_add_iff";
   3.464  AddIffs [hypreal_0_less_add_iff];
   3.465  
   3.466 -Goal "(x+y <= (Numeral0::hypreal)) = (y <= -x)";
   3.467 +Goal "(x+y <= (0::hypreal)) = (y <= -x)";
   3.468  by Auto_tac;  
   3.469  qed "hypreal_add_le_0_iff";
   3.470  AddIffs [hypreal_add_le_0_iff];
   3.471  
   3.472 -Goal "((Numeral0::hypreal) <= x+y) = (-x <= y)";
   3.473 +Goal "((0::hypreal) <= x+y) = (-x <= y)";
   3.474  by Auto_tac;  
   3.475  qed "hypreal_0_le_add_iff";
   3.476  AddIffs [hypreal_0_le_add_iff];
   3.477  
   3.478  
   3.479 -(** Simprules combining x-y and Numeral0; see also hypreal_less_iff_diff_less_0 etc
   3.480 +(** Simprules combining x-y and 0; see also hypreal_less_iff_diff_less_0 etc
   3.481      in HyperBin
   3.482  **)
   3.483  
   3.484 -Goal "((Numeral0::hypreal) < x-y) = (y < x)";
   3.485 +Goal "((0::hypreal) < x-y) = (y < x)";
   3.486  by Auto_tac;  
   3.487  qed "hypreal_0_less_diff_iff";
   3.488  AddIffs [hypreal_0_less_diff_iff];
   3.489  
   3.490 -Goal "((Numeral0::hypreal) <= x-y) = (y <= x)";
   3.491 +Goal "((0::hypreal) <= x-y) = (y <= x)";
   3.492  by Auto_tac;  
   3.493  qed "hypreal_0_le_diff_iff";
   3.494  AddIffs [hypreal_0_le_diff_iff];
   3.495 @@ -657,7 +669,7 @@
   3.496  qed "hypreal_dense";
   3.497  
   3.498  
   3.499 -(*Replaces "inverse #nn" by Numeral1/#nn *)
   3.500 +(*Replaces "inverse #nn" by 1/#nn *)
   3.501  Addsimps [inst "x" "number_of ?w" hypreal_inverse_eq_divide];
   3.502  
   3.503  
     4.1 --- a/src/HOL/Hyperreal/HyperBin.ML	Thu Nov 01 21:12:13 2001 +0100
     4.2 +++ b/src/HOL/Hyperreal/HyperBin.ML	Fri Nov 02 17:55:24 2001 +0100
     4.3 @@ -13,13 +13,13 @@
     4.4  qed "hypreal_number_of";
     4.5  Addsimps [hypreal_number_of];
     4.6  
     4.7 -Goalw [hypreal_number_of_def] "(0::hypreal) = Numeral0";
     4.8 -by (simp_tac (simpset() addsimps [hypreal_of_real_zero RS sym]) 1);
     4.9 -qed "zero_eq_numeral_0";
    4.10 +Goalw [hypreal_number_of_def] "Numeral0 = (0::hypreal)"; 
    4.11 +by (Simp_tac 1);
    4.12 +qed "hypreal_numeral_0_eq_0";
    4.13  
    4.14 -Goalw [hypreal_number_of_def] "(1::hypreal) = Numeral1";
    4.15 -by (simp_tac (simpset() addsimps [hypreal_of_real_one RS sym]) 1);
    4.16 -qed "one_eq_numeral_1";
    4.17 +Goalw [hypreal_number_of_def] "Numeral1 = (1::hypreal)";
    4.18 +by (Simp_tac 1);
    4.19 +qed "hypreal_numeral_1_eq_1";
    4.20  
    4.21  (** Addition **)
    4.22  
    4.23 @@ -57,15 +57,15 @@
    4.24  qed "mult_hypreal_number_of";
    4.25  Addsimps [mult_hypreal_number_of];
    4.26  
    4.27 -Goal "(2::hypreal) = Numeral1 + Numeral1";
    4.28 -by (Simp_tac 1);
    4.29 +Goal "(2::hypreal) = 1 + 1";
    4.30 +by (simp_tac (simpset() addsimps [hypreal_numeral_1_eq_1 RS sym]) 1);
    4.31  val lemma = result();
    4.32  
    4.33  (*For specialist use: NOT as default simprules*)
    4.34  Goal "2 * z = (z+z::hypreal)";
    4.35  by (simp_tac (simpset ()
    4.36  	      addsimps [lemma, hypreal_add_mult_distrib,
    4.37 -			one_eq_numeral_1 RS sym]) 1);
    4.38 +			hypreal_numeral_1_eq_1]) 1);
    4.39  qed "hypreal_mult_2";
    4.40  
    4.41  Goal "z * 2 = (z+z::hypreal)";
    4.42 @@ -107,46 +107,20 @@
    4.43  
    4.44  (*** New versions of existing theorems involving 0, 1 ***)
    4.45  
    4.46 -Goal "- Numeral1 = (-1::hypreal)";
    4.47 -by (Simp_tac 1);
    4.48 -qed "minus_numeral_one";
    4.49 +Goal "- 1 = (-1::hypreal)";
    4.50 +by (simp_tac (simpset() addsimps [hypreal_numeral_1_eq_1 RS sym]) 1);
    4.51 +qed "hypreal_minus_1_eq_m1";
    4.52  
    4.53 -(*Maps 0 to Numeral0 and (1::hypreal) to Numeral1 and -(Numeral1) to -1*)
    4.54 +(*Maps 0 to Numeral0 and 1 to Numeral1 and -(Numeral1) to -1*)
    4.55  val hypreal_numeral_ss = 
    4.56 -    real_numeral_ss addsimps [zero_eq_numeral_0, one_eq_numeral_1, 
    4.57 -		              minus_numeral_one];
    4.58 +    real_numeral_ss addsimps [hypreal_numeral_0_eq_0 RS sym, 
    4.59 +                              hypreal_numeral_1_eq_1 RS sym, 
    4.60 +		              hypreal_minus_1_eq_m1];
    4.61  
    4.62  fun rename_numerals th = 
    4.63      asm_full_simplify hypreal_numeral_ss (Thm.transfer (the_context ()) th);
    4.64  
    4.65  
    4.66 -(*Now insert some identities previously stated for 0 and 1*)
    4.67 -
    4.68 -(** HyperDef **)
    4.69 -
    4.70 -Addsimps (map rename_numerals
    4.71 -	  [hypreal_minus_zero, hypreal_minus_zero_iff,
    4.72 -	   hypreal_add_zero_left, hypreal_add_zero_right, 
    4.73 -	   hypreal_diff_zero, hypreal_diff_zero_right,
    4.74 -	   hypreal_mult_0_right, hypreal_mult_0, 
    4.75 -           hypreal_mult_1_right, hypreal_mult_1,
    4.76 -	   hypreal_inverse_1, hypreal_minus_zero_less_iff]);
    4.77 -
    4.78 -bind_thm ("hypreal_0_less_mult_iff", 
    4.79 -	  rename_numerals hypreal_zero_less_mult_iff);
    4.80 -bind_thm ("hypreal_0_le_mult_iff", 
    4.81 -	  rename_numerals hypreal_zero_le_mult_iff);
    4.82 -bind_thm ("hypreal_mult_less_0_iff", 
    4.83 -	  rename_numerals hypreal_mult_less_zero_iff);
    4.84 -bind_thm ("hypreal_mult_le_0_iff", 
    4.85 -	  rename_numerals hypreal_mult_le_zero_iff);
    4.86 -
    4.87 -bind_thm ("hypreal_inverse_less_0", rename_numerals hypreal_inverse_less_zero);
    4.88 -bind_thm ("hypreal_inverse_gt_0", rename_numerals hypreal_inverse_gt_zero);
    4.89 -
    4.90 -Addsimps [zero_eq_numeral_0,one_eq_numeral_1];
    4.91 -
    4.92 -
    4.93  (** Simplification of arithmetic when nested to the right **)
    4.94  
    4.95  Goal "number_of v + (number_of w + z) = (number_of(bin_add v w) + z::hypreal)";
    4.96 @@ -176,15 +150,15 @@
    4.97  
    4.98  (** Combining of literal coefficients in sums of products **)
    4.99  
   4.100 -Goal "(x < y) = (x-y < (Numeral0::hypreal))";
   4.101 +Goal "(x < y) = (x-y < (0::hypreal))";
   4.102  by (simp_tac (simpset() addsimps [hypreal_diff_less_eq]) 1);   
   4.103  qed "hypreal_less_iff_diff_less_0";
   4.104  
   4.105 -Goal "(x = y) = (x-y = (Numeral0::hypreal))";
   4.106 +Goal "(x = y) = (x-y = (0::hypreal))";
   4.107  by (simp_tac (simpset() addsimps [hypreal_diff_eq_eq]) 1);   
   4.108  qed "hypreal_eq_iff_diff_eq_0";
   4.109  
   4.110 -Goal "(x <= y) = (x-y <= (Numeral0::hypreal))";
   4.111 +Goal "(x <= y) = (x-y <= (0::hypreal))";
   4.112  by (simp_tac (simpset() addsimps [hypreal_diff_le_eq]) 1);   
   4.113  qed "hypreal_le_iff_diff_le_0";
   4.114  
   4.115 @@ -209,7 +183,7 @@
   4.116  Goal "!!i::hypreal. (i*u + m = j*u + n) = ((i-j)*u + m = n)";
   4.117  by (asm_simp_tac
   4.118      (simpset() addsimps [hypreal_diff_def, hypreal_add_mult_distrib]@
   4.119 -	                 hypreal_add_ac@rel_iff_rel_0_rls) 1);
   4.120 +                         hypreal_add_ac@rel_iff_rel_0_rls) 1);
   4.121  qed "hypreal_eq_add_iff1";
   4.122  
   4.123  Goal "!!i::hypreal. (i*u + m = j*u + n) = (m = (j-i)*u + n)";
   4.124 @@ -242,26 +216,31 @@
   4.125                          hypreal_add_ac@rel_iff_rel_0_rls) 1);
   4.126  qed "hypreal_le_add_iff2";
   4.127  
   4.128 +Goal "-1 * (z::hypreal) = -z";
   4.129 +by (simp_tac (simpset() addsimps [hypreal_minus_1_eq_m1 RS sym, 
   4.130 +                                  hypreal_mult_minus_1]) 1);
   4.131 +qed "hypreal_mult_minus1";
   4.132 +Addsimps [hypreal_mult_minus1];
   4.133 +
   4.134  Goal "(z::hypreal) * -1 = -z";
   4.135 -by (stac (minus_numeral_one RS sym) 1);
   4.136 -by (stac (hypreal_minus_mult_eq2 RS sym) 1); 
   4.137 -by Auto_tac;  
   4.138 -qed "hypreal_mult_minus_1_right";
   4.139 -Addsimps [hypreal_mult_minus_1_right];
   4.140 +by (stac hypreal_mult_commute 1 THEN rtac hypreal_mult_minus1 1);
   4.141 +qed "hypreal_mult_minus1_right";
   4.142 +Addsimps [hypreal_mult_minus1_right];
   4.143  
   4.144 -Goal "-1 * (z::hypreal) = -z";
   4.145 -by (simp_tac (simpset() addsimps [hypreal_mult_commute]) 1); 
   4.146 -qed "hypreal_mult_minus_1";
   4.147 -Addsimps [hypreal_mult_minus_1];
   4.148  
   4.149 +Addsimps [hypreal_numeral_0_eq_0, hypreal_numeral_1_eq_1];
   4.150  
   4.151  
   4.152  structure Hyperreal_Numeral_Simprocs =
   4.153  struct
   4.154  
   4.155 +(*Maps 0 to Numeral0 and 1 to Numeral1 so that arithmetic in simprocs
   4.156 +  isn't complicated by the abstract 0 and 1.*)
   4.157 +val numeral_syms = [hypreal_numeral_0_eq_0 RS sym, 
   4.158 +                    hypreal_numeral_1_eq_1 RS sym];
   4.159 +
   4.160  (*Utilities*)
   4.161  
   4.162 -
   4.163  val hyprealT = Type("HyperDef.hypreal",[]);
   4.164  
   4.165  fun mk_numeral n = HOLogic.number_of_const hyprealT $ HOLogic.mk_bin n;
   4.166 @@ -271,11 +250,11 @@
   4.167  val find_first_numeral = Real_Numeral_Simprocs.find_first_numeral;
   4.168  
   4.169  val zero = mk_numeral 0;
   4.170 -val mk_plus = HOLogic.mk_binop "op +";
   4.171 +val mk_plus = Real_Numeral_Simprocs.mk_plus;
   4.172  
   4.173  val uminus_const = Const ("uminus", hyprealT --> hyprealT);
   4.174  
   4.175 -(*Thus mk_sum[t] yields t+Numeral0; longer sums don't have a trailing zero*)
   4.176 +(*Thus mk_sum[t] yields t+0; longer sums don't have a trailing zero*)
   4.177  fun mk_sum []        = zero
   4.178    | mk_sum [t,u]     = mk_plus (t, u)
   4.179    | mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
   4.180 @@ -335,24 +314,23 @@
   4.181  	handle TERM _ => find_first_coeff (t::past) u terms;
   4.182  
   4.183  
   4.184 -(*Simplify Numeral1*n and n*Numeral1 to n*)
   4.185 +(*Simplify Numeral0+n, n+Numeral0, Numeral1*n, n*Numeral1*)
   4.186  val add_0s = map rename_numerals
   4.187                   [hypreal_add_zero_left, hypreal_add_zero_right];
   4.188 -val mult_plus_1s = map rename_numerals
   4.189 -                      [hypreal_mult_1, hypreal_mult_1_right];
   4.190 -val mult_minus_1s = map rename_numerals
   4.191 -                      [hypreal_mult_minus_1, hypreal_mult_minus_1_right];
   4.192 -val mult_1s = mult_plus_1s @ mult_minus_1s;
   4.193 +val mult_1s = map rename_numerals [hypreal_mult_1, hypreal_mult_1_right] @
   4.194 +              [hypreal_mult_minus1, hypreal_mult_minus1_right];
   4.195  
   4.196  (*To perform binary arithmetic*)
   4.197  val bin_simps =
   4.198 -    [add_hypreal_number_of, hypreal_add_number_of_left, 
   4.199 -     minus_hypreal_number_of, diff_hypreal_number_of, mult_hypreal_number_of, 
   4.200 +    [hypreal_numeral_0_eq_0 RS sym, hypreal_numeral_1_eq_1 RS sym,
   4.201 +     add_hypreal_number_of, hypreal_add_number_of_left, 
   4.202 +     minus_hypreal_number_of, 
   4.203 +     diff_hypreal_number_of, mult_hypreal_number_of, 
   4.204       hypreal_mult_number_of_left] @ bin_arith_simps @ bin_rel_simps;
   4.205  
   4.206  (*To evaluate binary negations of coefficients*)
   4.207  val hypreal_minus_simps = NCons_simps @
   4.208 -                   [minus_hypreal_number_of, 
   4.209 +                   [hypreal_minus_1_eq_m1, minus_hypreal_number_of, 
   4.210  		    bin_minus_1, bin_minus_0, bin_minus_Pls, bin_minus_Min,
   4.211  		    bin_pred_1, bin_pred_0, bin_pred_Pls, bin_pred_Min];
   4.212  
   4.213 @@ -374,24 +352,6 @@
   4.214  val hypreal_mult_minus_simps =
   4.215      [hypreal_mult_assoc, hypreal_minus_mult_eq1, hypreal_minus_mult_eq_1_to_2];
   4.216  
   4.217 -(*Apply the given rewrite (if present) just once*)
   4.218 -fun trans_tac None      = all_tac
   4.219 -  | trans_tac (Some th) = ALLGOALS (rtac (th RS trans));
   4.220 -
   4.221 -fun prove_conv name tacs sg (hyps: thm list) (t,u) =
   4.222 -  if t aconv u then None
   4.223 -  else
   4.224 -  let val ct = cterm_of sg (HOLogic.mk_Trueprop (HOLogic.mk_eq (t, u)))
   4.225 -  in Some
   4.226 -     (prove_goalw_cterm [] ct (K tacs)
   4.227 -      handle ERROR => error 
   4.228 -	  ("The error(s) above occurred while trying to prove " ^
   4.229 -	   string_of_cterm ct ^ "\nInternal failure of simproc " ^ name))
   4.230 -  end;
   4.231 -
   4.232 -(*version without the hyps argument*)
   4.233 -fun prove_conv_nohyps name tacs sg = prove_conv name tacs sg [];
   4.234 -
   4.235  (*Final simplification: cancel + and *  *)
   4.236  val simplify_meta_eq = 
   4.237      Int_Numeral_Simprocs.simplify_meta_eq
   4.238 @@ -409,7 +369,7 @@
   4.239    val mk_coeff		= mk_coeff
   4.240    val dest_coeff	= dest_coeff 1
   4.241    val find_first_coeff	= find_first_coeff []
   4.242 -  val trans_tac         = trans_tac
   4.243 +  val trans_tac         = Real_Numeral_Simprocs.trans_tac
   4.244    val norm_tac = 
   4.245       ALLGOALS (simp_tac (HOL_ss addsimps add_0s@mult_1s@diff_simps@
   4.246                                           hypreal_minus_simps@hypreal_add_ac))
   4.247 @@ -424,7 +384,7 @@
   4.248  
   4.249  structure EqCancelNumerals = CancelNumeralsFun
   4.250   (open CancelNumeralsCommon
   4.251 -  val prove_conv = prove_conv "hyprealeq_cancel_numerals"
   4.252 +  val prove_conv = Real_Numeral_Simprocs.prove_conv "hyprealeq_cancel_numerals"
   4.253    val mk_bal   = HOLogic.mk_eq
   4.254    val dest_bal = HOLogic.dest_bin "op =" hyprealT
   4.255    val bal_add1 = hypreal_eq_add_iff1 RS trans
   4.256 @@ -433,7 +393,7 @@
   4.257  
   4.258  structure LessCancelNumerals = CancelNumeralsFun
   4.259   (open CancelNumeralsCommon
   4.260 -  val prove_conv = prove_conv "hyprealless_cancel_numerals"
   4.261 +  val prove_conv = Real_Numeral_Simprocs.prove_conv "hyprealless_cancel_numerals"
   4.262    val mk_bal   = HOLogic.mk_binrel "op <"
   4.263    val dest_bal = HOLogic.dest_bin "op <" hyprealT
   4.264    val bal_add1 = hypreal_less_add_iff1 RS trans
   4.265 @@ -442,7 +402,7 @@
   4.266  
   4.267  structure LeCancelNumerals = CancelNumeralsFun
   4.268   (open CancelNumeralsCommon
   4.269 -  val prove_conv = prove_conv "hyprealle_cancel_numerals"
   4.270 +  val prove_conv = Real_Numeral_Simprocs.prove_conv "hyprealle_cancel_numerals"
   4.271    val mk_bal   = HOLogic.mk_binrel "op <="
   4.272    val dest_bal = HOLogic.dest_bin "op <=" hyprealT
   4.273    val bal_add1 = hypreal_le_add_iff1 RS trans
   4.274 @@ -476,8 +436,9 @@
   4.275    val mk_coeff		= mk_coeff
   4.276    val dest_coeff	= dest_coeff 1
   4.277    val left_distrib	= left_hypreal_add_mult_distrib RS trans
   4.278 -  val prove_conv	= prove_conv_nohyps "hypreal_combine_numerals"
   4.279 -  val trans_tac          = trans_tac
   4.280 +  val prove_conv        = Real_Numeral_Simprocs.prove_conv_nohyps
   4.281 +                                                "hypreal_combine_numerals"
   4.282 +  val trans_tac         = Real_Numeral_Simprocs.trans_tac
   4.283    val norm_tac = 
   4.284       ALLGOALS (simp_tac (HOL_ss addsimps add_0s@mult_1s@diff_simps@
   4.285                                           hypreal_minus_simps@hypreal_add_ac))
   4.286 @@ -516,8 +477,52 @@
   4.287          [hypreal_mult_1, hypreal_mult_1_right] 
   4.288          (([th, cancel_th]) MRS trans);
   4.289  
   4.290 +(*** Making constant folding work for 0 and 1 too ***)
   4.291 +
   4.292 +structure HyperrealAbstractNumeralsData =
   4.293 +  struct
   4.294 +  val dest_eq         = HOLogic.dest_eq o HOLogic.dest_Trueprop o concl_of
   4.295 +  val is_numeral      = Bin_Simprocs.is_numeral
   4.296 +  val numeral_0_eq_0  = hypreal_numeral_0_eq_0
   4.297 +  val numeral_1_eq_1  = hypreal_numeral_1_eq_1
   4.298 +  val prove_conv      = Real_Numeral_Simprocs.prove_conv_nohyps
   4.299 +                          "hypreal_abstract_numerals"
   4.300 +  fun norm_tac simps  = ALLGOALS (simp_tac (HOL_ss addsimps simps))
   4.301 +  val simplify_meta_eq = Bin_Simprocs.simplify_meta_eq 
   4.302 +  end
   4.303 +
   4.304 +structure HyperrealAbstractNumerals = 
   4.305 +  AbstractNumeralsFun (HyperrealAbstractNumeralsData)
   4.306 +
   4.307 +(*For addition, we already have rules for the operand 0.
   4.308 +  Multiplication is omitted because there are already special rules for 
   4.309 +  both 0 and 1 as operands.  Unary minus is trivial, just have - 1 = -1.
   4.310 +  For the others, having three patterns is a compromise between just having
   4.311 +  one (many spurious calls) and having nine (just too many!) *)
   4.312 +val eval_numerals = 
   4.313 +  map prep_simproc
   4.314 +   [("hypreal_add_eval_numerals",
   4.315 +     prep_pats ["(m::hypreal) + 1", "(m::hypreal) + number_of v"], 
   4.316 +     HyperrealAbstractNumerals.proc add_hypreal_number_of),
   4.317 +    ("hypreal_diff_eval_numerals",
   4.318 +     prep_pats ["(m::hypreal) - 1", "(m::hypreal) - number_of v"], 
   4.319 +     HyperrealAbstractNumerals.proc diff_hypreal_number_of),
   4.320 +    ("hypreal_eq_eval_numerals",
   4.321 +     prep_pats ["(m::hypreal) = 0", "(m::hypreal) = 1",
   4.322 +                "(m::hypreal) = number_of v"], 
   4.323 +     HyperrealAbstractNumerals.proc eq_hypreal_number_of),
   4.324 +    ("hypreal_less_eval_numerals",
   4.325 +     prep_pats ["(m::hypreal) < 0", "(m::hypreal) < 1", 
   4.326 +                "(m::hypreal) < number_of v"], 
   4.327 +     HyperrealAbstractNumerals.proc less_hypreal_number_of),
   4.328 +    ("hypreal_le_eval_numerals",
   4.329 +     prep_pats ["(m::hypreal) <= 0", "(m::hypreal) <= 1", 
   4.330 +                "(m::hypreal) <= number_of v"],
   4.331 +     HyperrealAbstractNumerals.proc le_hypreal_number_of_eq_not_less)]
   4.332 +
   4.333  end;
   4.334  
   4.335 +Addsimprocs Hyperreal_Numeral_Simprocs.eval_numerals;
   4.336  Addsimprocs Hyperreal_Numeral_Simprocs.cancel_numerals;
   4.337  Addsimprocs [Hyperreal_Numeral_Simprocs.combine_numerals];
   4.338  
   4.339 @@ -581,8 +586,6 @@
   4.340  
   4.341  Addsimprocs [Hyperreal_Times_Assoc.conv];
   4.342  
   4.343 -Addsimps [rename_numerals hypreal_of_real_zero_iff];
   4.344 -
   4.345  (*Simplification of  x-y < 0, etc.*)
   4.346  AddIffs [hypreal_less_iff_diff_less_0 RS sym];
   4.347  AddIffs [hypreal_eq_iff_diff_eq_0 RS sym];
   4.348 @@ -603,6 +606,12 @@
   4.349  qed "number_of_le_hypreal_of_real_iff";
   4.350  Addsimps [number_of_le_hypreal_of_real_iff];
   4.351  
   4.352 +Goal "(hypreal_of_real z = number_of w) = (z = number_of w)";
   4.353 +by (stac (hypreal_of_real_eq_iff RS sym) 1); 
   4.354 +by (Simp_tac 1); 
   4.355 +qed "hypreal_of_real_eq_number_of_iff";
   4.356 +Addsimps [hypreal_of_real_eq_number_of_iff];
   4.357 +
   4.358  Goal "(hypreal_of_real z < number_of w) = (z < number_of w)";
   4.359  by (stac (hypreal_of_real_less_iff RS sym) 1); 
   4.360  by (Simp_tac 1); 
   4.361 @@ -615,6 +624,20 @@
   4.362  qed "hypreal_of_real_le_number_of_iff";
   4.363  Addsimps [hypreal_of_real_le_number_of_iff];
   4.364  
   4.365 +(*As above, for the special case of zero*)
   4.366 +Addsimps
   4.367 +  (map (simplify (simpset()) o inst "w" "Pls")
   4.368 +   [hypreal_of_real_eq_number_of_iff,
   4.369 +    hypreal_of_real_le_number_of_iff, hypreal_of_real_less_number_of_iff,
   4.370 +    number_of_le_hypreal_of_real_iff, number_of_less_hypreal_of_real_iff]);
   4.371 +
   4.372 +(*As above, for the special case of one*)
   4.373 +Addsimps
   4.374 +  (map (simplify (simpset()) o inst "w" "Pls BIT True")
   4.375 +   [hypreal_of_real_eq_number_of_iff,
   4.376 +    hypreal_of_real_le_number_of_iff, hypreal_of_real_less_number_of_iff,
   4.377 +    number_of_le_hypreal_of_real_iff, number_of_less_hypreal_of_real_iff]);
   4.378 +
   4.379  (** <= monotonicity results: needed for arithmetic **)
   4.380  
   4.381  Goal "[| i <= j;  (0::hypreal) <= k |] ==> i*k <= j*k";
   4.382 @@ -634,3 +657,4 @@
   4.383  by (assume_tac 1);
   4.384  qed "hypreal_mult_le_mono";
   4.385  
   4.386 +Addsimps [hypreal_minus_1_eq_m1];
     5.1 --- a/src/HOL/Hyperreal/HyperDef.ML	Thu Nov 01 21:12:13 2001 +0100
     5.2 +++ b/src/HOL/Hyperreal/HyperDef.ML	Fri Nov 02 17:55:24 2001 +0100
     5.3 @@ -311,11 +311,8 @@
     5.4  
     5.5  Goal "(-x = 0) = (x = (0::hypreal))"; 
     5.6  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
     5.7 -by (auto_tac (claset(),
     5.8 -       simpset() addsimps [hypreal_zero_def, hypreal_minus, eq_commute] @ 
     5.9 -                          real_add_ac));
    5.10 +by (auto_tac (claset(), simpset() addsimps [hypreal_zero_def, hypreal_minus]));
    5.11  qed "hypreal_minus_zero_iff";
    5.12 -
    5.13  Addsimps [hypreal_minus_zero_iff];
    5.14  
    5.15  
    5.16 @@ -430,59 +427,17 @@
    5.17  by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
    5.18  qed "hypreal_minus_distrib1";
    5.19  
    5.20 -Goal "(x + - (y::hypreal)) + (y + - z) = x + -z";
    5.21 -by (res_inst_tac [("w1","y")] (hypreal_add_commute RS subst) 1);
    5.22 -by (simp_tac (simpset() addsimps [hypreal_add_left_commute,
    5.23 -                                  hypreal_add_assoc]) 1);
    5.24 -by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
    5.25 -qed "hypreal_add_minus_cancel1";
    5.26 -
    5.27  Goal "((x::hypreal) + y = x + z) = (y = z)";
    5.28  by (Step_tac 1);
    5.29  by (dres_inst_tac [("f","%t.-x + t")] arg_cong 1);
    5.30  by (asm_full_simp_tac (simpset() addsimps [hypreal_add_assoc RS sym]) 1);
    5.31  qed "hypreal_add_left_cancel";
    5.32  
    5.33 -Goal "z + (x + (y + -z)) = x + (y::hypreal)";
    5.34 -by (simp_tac (simpset() addsimps hypreal_add_ac) 1);
    5.35 -qed "hypreal_add_minus_cancel2";
    5.36 -Addsimps [hypreal_add_minus_cancel2];
    5.37 -
    5.38 -Goal "y + -(x + y) = -(x::hypreal)";
    5.39 -by (Full_simp_tac 1);
    5.40 -by (rtac (hypreal_add_left_commute RS subst) 1);
    5.41 -by (Full_simp_tac 1);
    5.42 -qed "hypreal_add_minus_cancel";
    5.43 -Addsimps [hypreal_add_minus_cancel];
    5.44 -
    5.45 -Goal "y + -(y + x) = -(x::hypreal)";
    5.46 -by (simp_tac (simpset() addsimps [hypreal_add_assoc RS sym]) 1);
    5.47 -qed "hypreal_add_minus_cancelc";
    5.48 -Addsimps [hypreal_add_minus_cancelc];
    5.49 -
    5.50 -Goal "(z + -x) + (y + -z) = (y + -(x::hypreal))";
    5.51 -by (full_simp_tac
    5.52 -    (simpset() addsimps [hypreal_minus_add_distrib RS sym, 
    5.53 -                         hypreal_add_left_cancel] @ hypreal_add_ac 
    5.54 -               delsimps [hypreal_minus_add_distrib]) 1); 
    5.55 -qed "hypreal_add_minus_cancel3";
    5.56 -Addsimps [hypreal_add_minus_cancel3];
    5.57 -
    5.58  Goal "(y + (x::hypreal)= z + x) = (y = z)";
    5.59  by (simp_tac (simpset() addsimps [hypreal_add_commute,
    5.60                                    hypreal_add_left_cancel]) 1);
    5.61  qed "hypreal_add_right_cancel";
    5.62  
    5.63 -Goal "z + (y + -z) = (y::hypreal)";
    5.64 -by (simp_tac (simpset() addsimps hypreal_add_ac) 1);
    5.65 -qed "hypreal_add_minus_cancel4";
    5.66 -Addsimps [hypreal_add_minus_cancel4];
    5.67 -
    5.68 -Goal "z + (w + (x + (-z + y))) = w + x + (y::hypreal)";
    5.69 -by (simp_tac (simpset() addsimps hypreal_add_ac) 1);
    5.70 -qed "hypreal_add_minus_cancel5";
    5.71 -Addsimps [hypreal_add_minus_cancel5];
    5.72 -
    5.73  Goal "z + ((- z) + w) = (w::hypreal)";
    5.74  by (simp_tac (simpset() addsimps [hypreal_add_assoc RS sym]) 1);
    5.75  qed "hypreal_add_minus_cancelA";
    5.76 @@ -535,22 +490,24 @@
    5.77  by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
    5.78  by (asm_full_simp_tac (simpset() addsimps [hypreal_mult]) 1);
    5.79  qed "hypreal_mult_1";
    5.80 +Addsimps [hypreal_mult_1];
    5.81  
    5.82  Goal "z * (1::hypreal) = z";
    5.83  by (simp_tac (simpset() addsimps [hypreal_mult_commute,
    5.84      hypreal_mult_1]) 1);
    5.85  qed "hypreal_mult_1_right";
    5.86 +Addsimps [hypreal_mult_1_right];
    5.87  
    5.88  Goalw [hypreal_zero_def] "0 * z = (0::hypreal)";
    5.89  by (res_inst_tac [("z","z")] eq_Abs_hypreal 1);
    5.90 -by (asm_full_simp_tac (simpset() addsimps [hypreal_mult,real_mult_0]) 1);
    5.91 +by (asm_full_simp_tac (simpset() addsimps [hypreal_mult]) 1);
    5.92  qed "hypreal_mult_0";
    5.93 +Addsimps [hypreal_mult_0];
    5.94  
    5.95  Goal "z * 0 = (0::hypreal)";
    5.96 -by (simp_tac (simpset() addsimps [hypreal_mult_commute, hypreal_mult_0]) 1);
    5.97 +by (simp_tac (simpset() addsimps [hypreal_mult_commute]) 1);
    5.98  qed "hypreal_mult_0_right";
    5.99 -
   5.100 -Addsimps [hypreal_mult_0,hypreal_mult_0_right];
   5.101 +Addsimps [hypreal_mult_0_right];
   5.102  
   5.103  Goal "-(x * y) = -x * (y::hypreal)";
   5.104  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
   5.105 @@ -570,7 +527,18 @@
   5.106  (*Pull negations out*)
   5.107  Addsimps [hypreal_minus_mult_eq2 RS sym, hypreal_minus_mult_eq1 RS sym];
   5.108  
   5.109 -Goal "-x*y = (x::hypreal)*-y";
   5.110 +Goal "(- (1::hypreal)) * z = -z";
   5.111 +by (Simp_tac 1);
   5.112 +qed "hypreal_mult_minus_1";
   5.113 +Addsimps [hypreal_mult_minus_1];
   5.114 +
   5.115 +Goal "z * (- (1::hypreal)) = -z";
   5.116 +by (stac hypreal_mult_commute 1);
   5.117 +by (Simp_tac 1);
   5.118 +qed "hypreal_mult_minus_1_right";
   5.119 +Addsimps [hypreal_mult_minus_1_right];
   5.120 +
   5.121 +Goal "(-x) * y = (x::hypreal) * -y";
   5.122  by Auto_tac;
   5.123  qed "hypreal_minus_mult_commute";
   5.124  
   5.125 @@ -599,10 +567,6 @@
   5.126  by (simp_tac (simpset() addsimps [hypreal_mult_commute',hypreal_add_mult_distrib]) 1);
   5.127  qed "hypreal_add_mult_distrib2";
   5.128  
   5.129 -bind_thms ("hypreal_mult_simps", [hypreal_mult_1, hypreal_mult_1_right]);
   5.130 -Addsimps hypreal_mult_simps;
   5.131 -
   5.132 -(* 07/00 *)
   5.133  
   5.134  Goalw [hypreal_diff_def] "((z1::hypreal) - z2) * w = (z1 * w) - (z2 * w)";
   5.135  by (simp_tac (simpset() addsimps [hypreal_add_mult_distrib]) 1);
   5.136 @@ -622,13 +586,13 @@
   5.137  (**** multiplicative inverse on hypreal ****)
   5.138  
   5.139  Goalw [congruent_def]
   5.140 -  "congruent hyprel (%X. hyprel``{%n. if X n = Numeral0 then Numeral0 else inverse(X n)})";
   5.141 +  "congruent hyprel (%X. hyprel``{%n. if X n = 0 then 0 else inverse(X n)})";
   5.142  by (Auto_tac THEN Ultra_tac 1);
   5.143  qed "hypreal_inverse_congruent";
   5.144  
   5.145  Goalw [hypreal_inverse_def]
   5.146        "inverse (Abs_hypreal(hyprel``{%n. X n})) = \
   5.147 -\      Abs_hypreal(hyprel `` {%n. if X n = Numeral0 then Numeral0 else inverse(X n)})";
   5.148 +\      Abs_hypreal(hyprel `` {%n. if X n = 0 then 0 else inverse(X n)})";
   5.149  by (res_inst_tac [("f","Abs_hypreal")] arg_cong 1);
   5.150  by (simp_tac (simpset() addsimps 
   5.151     [hyprel_in_hypreal RS Abs_hypreal_inverse,
   5.152 @@ -807,41 +771,12 @@
   5.153  by (Ultra_tac 1);
   5.154  qed "hypreal_less";
   5.155  
   5.156 -(*---------------------------------------------------------------------------------
   5.157 -             Hyperreals as a linearly ordered field
   5.158 - ---------------------------------------------------------------------------------*)
   5.159 -(*** sum order 
   5.160 -Goalw [hypreal_zero_def] 
   5.161 -      "[| 0 < x; 0 < y |] ==> (0::hypreal) < x + y";
   5.162 -by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
   5.163 -by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
   5.164 -by (auto_tac (claset(),simpset() addsimps
   5.165 -    [hypreal_less_def,hypreal_add]));
   5.166 -by (auto_tac (claset() addSIs [exI],simpset() addsimps
   5.167 -    [hypreal_less_def,hypreal_add]));
   5.168 -by (ultra_tac (claset() addIs [real_add_order],simpset()) 1);
   5.169 -qed "hypreal_add_order";
   5.170 -***)
   5.171 +(*----------------------------------------------------------------------------
   5.172 +		 Trichotomy: the hyperreals are linearly ordered
   5.173 +  ---------------------------------------------------------------------------*)
   5.174  
   5.175 -(*** mult order 
   5.176 -Goalw [hypreal_zero_def] 
   5.177 -          "[| 0 < x; 0 < y |] ==> (0::hypreal) < x * y";
   5.178 -by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
   5.179 -by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
   5.180 -by (auto_tac (claset() addSIs [exI],simpset() addsimps
   5.181 -    [hypreal_less_def,hypreal_mult]));
   5.182 -by (ultra_tac (claset() addIs [rename_numerals real_mult_order],
   5.183 -	       simpset()) 1);
   5.184 -qed "hypreal_mult_order";
   5.185 -****)
   5.186 -
   5.187 -
   5.188 -(*---------------------------------------------------------------------------------
   5.189 -                         Trichotomy of the hyperreals
   5.190 -  --------------------------------------------------------------------------------*)
   5.191 -
   5.192 -Goalw [hyprel_def] "EX x. x: hyprel `` {%n. Numeral0}";
   5.193 -by (res_inst_tac [("x","%n. Numeral0")] exI 1);
   5.194 +Goalw [hyprel_def] "EX x. x: hyprel `` {%n. 0}";
   5.195 +by (res_inst_tac [("x","%n. 0")] exI 1);
   5.196  by (Step_tac 1);
   5.197  by (auto_tac (claset() addSIs [FreeUltrafilterNat_Nat_set], simpset()));
   5.198  qed "lemma_hyprel_0_mem";
   5.199 @@ -924,12 +859,6 @@
   5.200                simpset())); 
   5.201  qed "hypreal_not_eq_minus_iff";
   5.202  
   5.203 -Goal "(x+y = (0::hypreal)) = (x = -y)";
   5.204 -by (stac hypreal_eq_minus_iff 1);
   5.205 -by Auto_tac;
   5.206 -qed "hypreal_add_eq_0_iff";
   5.207 -AddIffs [hypreal_add_eq_0_iff];
   5.208 -
   5.209  
   5.210  (*** linearity ***)
   5.211  
   5.212 @@ -1048,12 +977,18 @@
   5.213           simpset() addsimps [hypreal_zero_def, hypreal_less,hypreal_minus]));
   5.214  by (ALLGOALS(Ultra_tac));
   5.215  qed "hypreal_minus_zero_less_iff2";
   5.216 +Addsimps [hypreal_minus_zero_less_iff2];
   5.217  
   5.218 -Goalw [hypreal_le_def] "((0::hypreal) <= -r) = (r <= (0::hypreal))";
   5.219 +Goalw [hypreal_le_def] "((0::hypreal) <= -r) = (r <= 0)";
   5.220  by (simp_tac (simpset() addsimps [hypreal_minus_zero_less_iff2]) 1);
   5.221  qed "hypreal_minus_zero_le_iff";
   5.222  Addsimps [hypreal_minus_zero_le_iff];
   5.223  
   5.224 +Goalw [hypreal_le_def] "(-r <= (0::hypreal)) = (0 <= r)";
   5.225 +by (simp_tac (simpset() addsimps [hypreal_minus_zero_less_iff2]) 1);
   5.226 +qed "hypreal_minus_zero_le_iff2";
   5.227 +Addsimps [hypreal_minus_zero_le_iff2];
   5.228 +
   5.229  (*----------------------------------------------------------
   5.230    hypreal_of_real preserves field and order properties
   5.231   -----------------------------------------------------------*)
   5.232 @@ -1098,32 +1033,30 @@
   5.233  qed "hypreal_of_real_minus";
   5.234  Addsimps [hypreal_of_real_minus];
   5.235  
   5.236 -(*DON'T insert this or the next one as default simprules.
   5.237 -  They are used in both orientations and anyway aren't the ones we finally
   5.238 -  need, which would use binary literals.*)
   5.239 -Goalw [hypreal_of_real_def,hypreal_one_def] "hypreal_of_real  Numeral1 = (1::hypreal)";
   5.240 -by (Step_tac 1);
   5.241 +Goalw [hypreal_of_real_def,hypreal_one_def] "hypreal_of_real 1 = (1::hypreal)";
   5.242 +by (Simp_tac 1); 
   5.243  qed "hypreal_of_real_one";
   5.244 +Addsimps [hypreal_of_real_one];
   5.245  
   5.246 -Goalw [hypreal_of_real_def,hypreal_zero_def] "hypreal_of_real Numeral0 = 0";
   5.247 -by (Step_tac 1);
   5.248 +Goalw [hypreal_of_real_def,hypreal_zero_def] "hypreal_of_real 0 = 0";
   5.249 +by (Simp_tac 1); 
   5.250  qed "hypreal_of_real_zero";
   5.251 +Addsimps [hypreal_of_real_zero];
   5.252  
   5.253 -Goal "(hypreal_of_real r = 0) = (r = Numeral0)";
   5.254 +Goal "(hypreal_of_real r = 0) = (r = 0)";
   5.255  by (auto_tac (claset() addIs [FreeUltrafilterNat_P],
   5.256      simpset() addsimps [hypreal_of_real_def,
   5.257                          hypreal_zero_def,FreeUltrafilterNat_Nat_set]));
   5.258  qed "hypreal_of_real_zero_iff";
   5.259  
   5.260  Goal "hypreal_of_real (inverse r) = inverse (hypreal_of_real r)";
   5.261 -by (case_tac "r=Numeral0" 1);
   5.262 +by (case_tac "r=0" 1);
   5.263  by (asm_simp_tac (simpset() addsimps [REAL_DIVIDE_ZERO, INVERSE_ZERO, 
   5.264 -                              HYPREAL_INVERSE_ZERO, hypreal_of_real_zero]) 1);
   5.265 +                              HYPREAL_INVERSE_ZERO]) 1);
   5.266  by (res_inst_tac [("c1","hypreal_of_real r")] 
   5.267      (hypreal_mult_left_cancel RS iffD1) 1);
   5.268  by (stac (hypreal_of_real_mult RS sym) 2); 
   5.269 -by (auto_tac (claset(), 
   5.270 -         simpset() addsimps [hypreal_of_real_one, hypreal_of_real_zero_iff]));
   5.271 +by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero_iff]));
   5.272  qed "hypreal_of_real_inverse";
   5.273  Addsimps [hypreal_of_real_inverse];
   5.274  
     6.1 --- a/src/HOL/Hyperreal/HyperDef.thy	Thu Nov 01 21:12:13 2001 +0100
     6.2 +++ b/src/HOL/Hyperreal/HyperDef.thy	Fri Nov 02 17:55:24 2001 +0100
     6.3 @@ -30,10 +30,10 @@
     6.4  defs
     6.5  
     6.6    hypreal_zero_def
     6.7 -  "0 == Abs_hypreal(hyprel``{%n::nat. (Numeral0::real)})"
     6.8 +  "0 == Abs_hypreal(hyprel``{%n::nat. (0::real)})"
     6.9  
    6.10    hypreal_one_def
    6.11 -  "1 == Abs_hypreal(hyprel``{%n::nat. (Numeral1::real)})"
    6.12 +  "1 == Abs_hypreal(hyprel``{%n::nat. (1::real)})"
    6.13  
    6.14    hypreal_minus_def
    6.15    "- P == Abs_hypreal(UN X: Rep_hypreal(P). hyprel``{%n::nat. - (X n)})"
    6.16 @@ -43,7 +43,7 @@
    6.17  
    6.18    hypreal_inverse_def
    6.19    "inverse P == Abs_hypreal(UN X: Rep_hypreal(P). 
    6.20 -                    hyprel``{%n. if X n = Numeral0 then Numeral0 else inverse (X n)})"
    6.21 +                    hyprel``{%n. if X n = 0 then 0 else inverse (X n)})"
    6.22  
    6.23    hypreal_divide_def
    6.24    "P / Q::hypreal == P * inverse Q"
     7.1 --- a/src/HOL/Hyperreal/HyperNat.ML	Thu Nov 01 21:12:13 2001 +0100
     7.2 +++ b/src/HOL/Hyperreal/HyperNat.ML	Fri Nov 02 17:55:24 2001 +0100
     7.3 @@ -1246,17 +1246,13 @@
     7.4  Addsimps [hypnat_of_nat_eq_cancel];
     7.5  
     7.6  Goalw [hypnat_zero_def] 
     7.7 -     "hypreal_of_hypnat 0 = Numeral0";
     7.8 -by (simp_tac (HOL_ss addsimps
     7.9 -             [zero_eq_numeral_0 RS sym, hypreal_zero_def]) 1); 
    7.10 -by (simp_tac (simpset() addsimps [hypreal_of_hypnat, real_of_nat_zero]) 1);
    7.11 +     "hypreal_of_hypnat 0 = 0";
    7.12 +by (simp_tac (simpset() addsimps [hypreal_zero_def, hypreal_of_hypnat]) 1);
    7.13  qed "hypreal_of_hypnat_zero";
    7.14  
    7.15  Goalw [hypnat_one_def] 
    7.16 -     "hypreal_of_hypnat (1::hypnat) = Numeral1";
    7.17 -by (simp_tac (HOL_ss addsimps
    7.18 -             [one_eq_numeral_1 RS sym, hypreal_one_def]) 1); 
    7.19 -by (simp_tac (simpset() addsimps [hypreal_of_hypnat, real_of_nat_one]) 1);
    7.20 +     "hypreal_of_hypnat (1::hypnat) = 1";
    7.21 +by (simp_tac (simpset() addsimps [hypreal_one_def, hypreal_of_hypnat]) 1);
    7.22  qed "hypreal_of_hypnat_one";
    7.23  
    7.24  Goal "hypreal_of_hypnat (m + n) = hypreal_of_hypnat m + hypreal_of_hypnat n";
    7.25 @@ -1283,7 +1279,7 @@
    7.26  qed "hypreal_of_hypnat_less_iff";
    7.27  Addsimps [hypreal_of_hypnat_less_iff];
    7.28  
    7.29 -Goal "(hypreal_of_hypnat N = Numeral0) = (N = 0)";
    7.30 +Goal "(hypreal_of_hypnat N = 0) = (N = 0)";
    7.31  by (simp_tac (simpset() addsimps [hypreal_of_hypnat_zero RS sym]) 1);
    7.32  qed "hypreal_of_hypnat_eq_zero_iff";
    7.33  Addsimps [hypreal_of_hypnat_eq_zero_iff];
     8.1 --- a/src/HOL/Hyperreal/HyperOrd.ML	Thu Nov 01 21:12:13 2001 +0100
     8.2 +++ b/src/HOL/Hyperreal/HyperOrd.ML	Fri Nov 02 17:55:24 2001 +0100
     8.3 @@ -101,16 +101,7 @@
     8.4  by (Full_simp_tac 1);
     8.5  qed "hypreal_lt_zero_iff";
     8.6  
     8.7 -Goalw [hypreal_le_def] "((0::hypreal) <= x) = (-x <= x)";
     8.8 -by (auto_tac (claset(), simpset() addsimps [hypreal_lt_zero_iff RS sym]));
     8.9 -qed "hypreal_ge_zero_iff";
    8.10 -
    8.11 -Goalw [hypreal_le_def] "(x <= (0::hypreal)) = (x <= -x)";
    8.12 -by (auto_tac (claset(), simpset() addsimps [hypreal_gt_zero_iff RS sym]));
    8.13 -qed "hypreal_le_zero_iff";
    8.14 -
    8.15 -Goalw [hypreal_zero_def] 
    8.16 -      "[| 0 < x; 0 < y |] ==> (0::hypreal) < x + y";
    8.17 +Goalw [hypreal_zero_def] "[| 0 < x; 0 < y |] ==> (0::hypreal) < x + y";
    8.18  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
    8.19  by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
    8.20  by (auto_tac (claset(),
    8.21 @@ -126,14 +117,12 @@
    8.22                simpset()));
    8.23  qed "hypreal_add_order_le";            
    8.24  
    8.25 -Goalw [hypreal_zero_def] 
    8.26 -          "[| 0 < x; 0 < y |] ==> (0::hypreal) < x * y";
    8.27 +Goalw [hypreal_zero_def] "[| 0 < x; 0 < y |] ==> (0::hypreal) < x * y";
    8.28  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
    8.29  by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
    8.30  by (auto_tac (claset() addSIs [exI],
    8.31                simpset() addsimps [hypreal_less_def,hypreal_mult]));
    8.32 -by (ultra_tac (claset() addIs [rename_numerals real_mult_order],
    8.33 -	       simpset()) 1);
    8.34 +by (ultra_tac (claset() addIs [real_mult_order], simpset()) 1);
    8.35  qed "hypreal_mult_order";
    8.36  
    8.37  Goal "[| x < 0; y < 0 |] ==> (0::hypreal) < x * y";
    8.38 @@ -150,8 +139,8 @@
    8.39  qed "hypreal_mult_less_zero";
    8.40  
    8.41  Goalw [hypreal_one_def,hypreal_zero_def,hypreal_less_def] "0 < (1::hypreal)";
    8.42 -by (res_inst_tac [("x","%n. Numeral0")] exI 1);
    8.43 -by (res_inst_tac [("x","%n. Numeral1")] exI 1);
    8.44 +by (res_inst_tac [("x","%n. 0")] exI 1);
    8.45 +by (res_inst_tac [("x","%n. 1")] exI 1);
    8.46  by (auto_tac (claset(),
    8.47          simpset() addsimps [real_zero_less_one, FreeUltrafilterNat_Nat_set]));
    8.48  qed "hypreal_zero_less_one";
    8.49 @@ -332,29 +321,15 @@
    8.50  by (dtac hypreal_mult_less_zero1 1 THEN assume_tac 1);
    8.51  by (auto_tac (claset() addIs [hypreal_zero_less_one RS hypreal_less_asym],
    8.52                   simpset() addsimps [hypreal_minus_zero_less_iff]));
    8.53 -qed "hypreal_inverse_gt_zero";
    8.54 +qed "hypreal_inverse_gt_0";
    8.55  
    8.56  Goal "x < 0 ==> inverse (x::hypreal) < 0";
    8.57  by (ftac hypreal_not_refl2 1);
    8.58  by (dtac (hypreal_minus_zero_less_iff RS iffD2) 1);
    8.59  by (rtac (hypreal_minus_zero_less_iff RS iffD1) 1);
    8.60  by (stac (hypreal_minus_inverse RS sym) 1);
    8.61 -by (auto_tac (claset() addIs [hypreal_inverse_gt_zero],  simpset()));
    8.62 -qed "hypreal_inverse_less_zero";
    8.63 -
    8.64 -Goal "[| 0 <= x; 0 <= y |] ==> (x+y = 0) = (x = 0 & y = (0::hypreal))";
    8.65 -by (auto_tac (claset() addIs [order_antisym], simpset()));
    8.66 -qed "hypreal_add_nonneg_eq_0_iff";
    8.67 -
    8.68 -Goal "(x*y = 0) = (x = 0 | y = (0::hypreal))";
    8.69 -by Auto_tac;
    8.70 -by (blast_tac (claset() addDs [hypreal_mult_zero_disj]) 1);
    8.71 -qed "hypreal_mult_is_0";
    8.72 -
    8.73 -Goal "(x*x + y*y + z*z = 0) = (x = 0 & y = 0 & z = (0::hypreal))";
    8.74 -by (simp_tac (HOL_ss addsimps [hypreal_le_square, hypreal_le_add_order, 
    8.75 -                         hypreal_add_nonneg_eq_0_iff, hypreal_mult_is_0]) 1);
    8.76 -qed "hypreal_three_squares_add_zero_iff";
    8.77 +by (auto_tac (claset() addIs [hypreal_inverse_gt_0],  simpset()));
    8.78 +qed "hypreal_inverse_less_0";
    8.79  
    8.80  Goal "(x::hypreal)*x <= x*x + y*y";
    8.81  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
    8.82 @@ -471,17 +446,17 @@
    8.83  by (res_inst_tac [("t","r")] (hypreal_inverse_inverse RS subst) 1);
    8.84  by (res_inst_tac [("t","x")] (hypreal_inverse_inverse RS subst) 1);
    8.85  by (rtac hypreal_inverse_less_swap 1);
    8.86 -by (auto_tac (claset(), simpset() addsimps [hypreal_inverse_gt_zero]));
    8.87 +by (auto_tac (claset(), simpset() addsimps [hypreal_inverse_gt_0]));
    8.88  qed "hypreal_inverse_less_iff";
    8.89  
    8.90  Goal "[| 0 < z; x < y |] ==> x * inverse z < y * inverse (z::hypreal)";
    8.91  by (blast_tac (claset() addSIs [hypreal_mult_less_mono1,
    8.92 -                                hypreal_inverse_gt_zero]) 1);
    8.93 +                                hypreal_inverse_gt_0]) 1);
    8.94  qed "hypreal_mult_inverse_less_mono1";
    8.95  
    8.96  Goal "[| 0 < z; x < y |] ==> inverse z * x < inverse (z::hypreal) * y";
    8.97  by (blast_tac (claset() addSIs [hypreal_mult_less_mono2,
    8.98 -                                hypreal_inverse_gt_zero]) 1);
    8.99 +                                hypreal_inverse_gt_0]) 1);
   8.100  qed "hypreal_mult_inverse_less_mono2";
   8.101  
   8.102  Goal "[| (0::hypreal) < z; x*z < y*z |] ==> x < y";
   8.103 @@ -526,25 +501,25 @@
   8.104  by (ALLGOALS (dtac hypreal_mult_less_zero THEN' assume_tac));
   8.105  by (auto_tac (claset() addDs [order_less_not_sym], 
   8.106                simpset() addsimps [hypreal_mult_commute]));  
   8.107 -qed "hypreal_zero_less_mult_iff";
   8.108 +qed "hypreal_0_less_mult_iff";
   8.109  
   8.110  Goal "((0::hypreal) <= x*y) = (0 <= x & 0 <= y | x <= 0 & y <= 0)";
   8.111  by (auto_tac (claset() addDs [hypreal_mult_zero_disj],
   8.112                simpset() addsimps [order_le_less, linorder_not_less,
   8.113 -                                  hypreal_zero_less_mult_iff]));
   8.114 -qed "hypreal_zero_le_mult_iff";
   8.115 +                                  hypreal_0_less_mult_iff]));
   8.116 +qed "hypreal_0_le_mult_iff";
   8.117  
   8.118  Goal "(x*y < (0::hypreal)) = (0 < x & y < 0 | x < 0 & 0 < y)";
   8.119  by (auto_tac (claset(), 
   8.120 -              simpset() addsimps [hypreal_zero_le_mult_iff, 
   8.121 +              simpset() addsimps [hypreal_0_le_mult_iff, 
   8.122                                    linorder_not_le RS sym]));
   8.123  by (auto_tac (claset() addDs [order_less_not_sym],  
   8.124                simpset() addsimps [linorder_not_le]));
   8.125 -qed "hypreal_mult_less_zero_iff";
   8.126 +qed "hypreal_mult_less_0_iff";
   8.127  
   8.128  Goal "(x*y <= (0::hypreal)) = (0 <= x & y <= 0 | x <= 0 & 0 <= y)";
   8.129  by (auto_tac (claset() addDs [order_less_not_sym], 
   8.130 -              simpset() addsimps [hypreal_zero_less_mult_iff, 
   8.131 +              simpset() addsimps [hypreal_0_less_mult_iff, 
   8.132                                    linorder_not_less RS sym]));
   8.133 -qed "hypreal_mult_le_zero_iff";
   8.134 +qed "hypreal_mult_le_0_iff";
   8.135  
     9.1 --- a/src/HOL/Hyperreal/HyperPow.ML	Thu Nov 01 21:12:13 2001 +0100
     9.2 +++ b/src/HOL/Hyperreal/HyperPow.ML	Fri Nov 02 17:55:24 2001 +0100
     9.3 @@ -6,19 +6,19 @@
     9.4  Exponentials on the hyperreals
     9.5  *)
     9.6  
     9.7 -Goal "(Numeral0::hypreal) ^ (Suc n) = 0";
     9.8 -by (Auto_tac);
     9.9 +Goal "(0::hypreal) ^ (Suc n) = 0";
    9.10 +by Auto_tac;
    9.11  qed "hrealpow_zero";
    9.12  Addsimps [hrealpow_zero];
    9.13  
    9.14 -Goal "r ~= (Numeral0::hypreal) --> r ^ n ~= 0";
    9.15 +Goal "r ~= (0::hypreal) --> r ^ n ~= 0";
    9.16  by (induct_tac "n" 1);
    9.17  by Auto_tac;
    9.18  qed_spec_mp "hrealpow_not_zero";
    9.19  
    9.20 -Goal "r ~= (Numeral0::hypreal) --> inverse(r ^ n) = (inverse r) ^ n";
    9.21 +Goal "r ~= (0::hypreal) --> inverse(r ^ n) = (inverse r) ^ n";
    9.22  by (induct_tac "n" 1);
    9.23 -by (Auto_tac);
    9.24 +by Auto_tac;
    9.25  by (forw_inst_tac [("n","n")] hrealpow_not_zero 1);
    9.26  by (auto_tac (claset(), simpset() addsimps [hypreal_inverse_distrib]));
    9.27  qed_spec_mp "hrealpow_inverse";
    9.28 @@ -42,40 +42,40 @@
    9.29  by (Simp_tac 1);
    9.30  qed "hrealpow_two";
    9.31  
    9.32 -Goal "(Numeral0::hypreal) <= r --> Numeral0 <= r ^ n";
    9.33 +Goal "(0::hypreal) <= r --> 0 <= r ^ n";
    9.34  by (induct_tac "n" 1);
    9.35  by (auto_tac (claset(), simpset() addsimps [hypreal_0_le_mult_iff]));
    9.36  qed_spec_mp "hrealpow_ge_zero";
    9.37  
    9.38 -Goal "(Numeral0::hypreal) < r --> Numeral0 < r ^ n";
    9.39 +Goal "(0::hypreal) < r --> 0 < r ^ n";
    9.40  by (induct_tac "n" 1);
    9.41  by (auto_tac (claset(), simpset() addsimps [hypreal_0_less_mult_iff]));
    9.42  qed_spec_mp "hrealpow_gt_zero";
    9.43  
    9.44 -Goal "x <= y & (Numeral0::hypreal) < x --> x ^ n <= y ^ n";
    9.45 +Goal "x <= y & (0::hypreal) < x --> x ^ n <= y ^ n";
    9.46  by (induct_tac "n" 1);
    9.47  by (auto_tac (claset() addSIs [hypreal_mult_le_mono], simpset()));
    9.48  by (asm_simp_tac (simpset() addsimps [hrealpow_ge_zero]) 1);
    9.49  qed_spec_mp "hrealpow_le";
    9.50  
    9.51 -Goal "x < y & (Numeral0::hypreal) < x & 0 < n --> x ^ n < y ^ n";
    9.52 +Goal "x < y & (0::hypreal) < x & 0 < n --> x ^ n < y ^ n";
    9.53  by (induct_tac "n" 1);
    9.54  by (auto_tac (claset() addIs [hypreal_mult_less_mono,gr0I],
    9.55                simpset() addsimps [hrealpow_gt_zero]));
    9.56  qed "hrealpow_less";
    9.57  
    9.58 -Goal "Numeral1 ^ n = (Numeral1::hypreal)";
    9.59 +Goal "1 ^ n = (1::hypreal)";
    9.60  by (induct_tac "n" 1);
    9.61 -by (Auto_tac);
    9.62 +by Auto_tac;
    9.63  qed "hrealpow_eq_one";
    9.64  Addsimps [hrealpow_eq_one];
    9.65  
    9.66 -Goal "abs(-(Numeral1 ^ n)) = (Numeral1::hypreal)";
    9.67 +Goal "abs(-(1 ^ n)) = (1::hypreal)";
    9.68  by Auto_tac;  
    9.69  qed "hrabs_minus_hrealpow_one";
    9.70  Addsimps [hrabs_minus_hrealpow_one];
    9.71  
    9.72 -Goal "abs(-1 ^ n) = (Numeral1::hypreal)";
    9.73 +Goal "abs(-1 ^ n) = (1::hypreal)";
    9.74  by (induct_tac "n" 1);
    9.75  by Auto_tac;  
    9.76  qed "hrabs_hrealpow_minus_one";
    9.77 @@ -86,32 +86,43 @@
    9.78  by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac));
    9.79  qed "hrealpow_mult";
    9.80  
    9.81 -Goal "(Numeral0::hypreal) <= r ^Suc (Suc 0)";
    9.82 +Goal "(0::hypreal) <= r ^ Suc (Suc 0)";
    9.83  by (auto_tac (claset(), simpset() addsimps [hypreal_0_le_mult_iff]));
    9.84  qed "hrealpow_two_le";
    9.85  Addsimps [hrealpow_two_le];
    9.86  
    9.87 -Goal "(Numeral0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0)";
    9.88 -by (simp_tac (HOL_ss addsimps [hrealpow_two_le, 
    9.89 -                    rename_numerals hypreal_le_add_order]) 1); 
    9.90 +Goal "(0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0)";
    9.91 +by (simp_tac (HOL_ss addsimps [hrealpow_two_le, hypreal_le_add_order]) 1); 
    9.92  qed "hrealpow_two_le_add_order";
    9.93  Addsimps [hrealpow_two_le_add_order];
    9.94  
    9.95 -Goal "(Numeral0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0) + w ^ Suc (Suc 0)";
    9.96 -by (simp_tac (HOL_ss addsimps [hrealpow_two_le, 
    9.97 -                    rename_numerals hypreal_le_add_order]) 1); 
    9.98 +Goal "(0::hypreal) <= u ^ Suc (Suc 0) + v ^ Suc (Suc 0) + w ^ Suc (Suc 0)";
    9.99 +by (simp_tac (HOL_ss addsimps [hrealpow_two_le, hypreal_le_add_order]) 1); 
   9.100  qed "hrealpow_two_le_add_order2";
   9.101  Addsimps [hrealpow_two_le_add_order2];
   9.102  
   9.103 -Goal "(x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + z ^ Suc (Suc 0) = (Numeral0::hypreal)) = (x = Numeral0 & y = Numeral0 & z = Numeral0)";
   9.104 +Goal "[| 0 <= x; 0 <= y |] ==> (x+y = 0) = (x = 0 & y = (0::hypreal))";
   9.105 +by (auto_tac (claset() addIs [order_antisym], simpset()));
   9.106 +qed "hypreal_add_nonneg_eq_0_iff";
   9.107 +
   9.108 +Goal "(x*y = 0) = (x = 0 | y = (0::hypreal))";
   9.109 +by Auto_tac;
   9.110 +qed "hypreal_mult_is_0";
   9.111 +
   9.112 +Goal "(x*x + y*y + z*z = 0) = (x = 0 & y = 0 & z = (0::hypreal))";
   9.113 +by (simp_tac (HOL_ss addsimps [hypreal_le_square, hypreal_le_add_order, 
   9.114 +                         hypreal_add_nonneg_eq_0_iff, hypreal_mult_is_0]) 1);
   9.115 +qed "hypreal_three_squares_add_zero_iff";
   9.116 +
   9.117 +Goal "(x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + z ^ Suc (Suc 0) = (0::hypreal)) = (x = 0 & y = 0 & z = 0)";
   9.118  by (simp_tac (HOL_ss addsimps
   9.119 -      [rename_numerals hypreal_three_squares_add_zero_iff, hrealpow_two]) 1);
   9.120 +               [hypreal_three_squares_add_zero_iff, hrealpow_two]) 1);
   9.121  qed "hrealpow_three_squares_add_zero_iff";
   9.122  Addsimps [hrealpow_three_squares_add_zero_iff];
   9.123  
   9.124  Goal "abs(x ^ Suc (Suc 0)) = (x::hypreal) ^ Suc (Suc 0)";
   9.125  by (auto_tac (claset(), 
   9.126 -     simpset() addsimps [hrabs_def, hypreal_0_le_mult_iff])); 
   9.127 +              simpset() addsimps [hrabs_def, hypreal_0_le_mult_iff])); 
   9.128  qed "hrabs_hrealpow_two";
   9.129  Addsimps [hrabs_hrealpow_two];
   9.130  
   9.131 @@ -121,21 +132,21 @@
   9.132  qed "hrealpow_two_hrabs";
   9.133  Addsimps [hrealpow_two_hrabs];
   9.134  
   9.135 -Goal "(Numeral1::hypreal) < r ==> Numeral1 < r ^ Suc (Suc 0)";
   9.136 +Goal "(1::hypreal) < r ==> 1 < r ^ Suc (Suc 0)";
   9.137  by (auto_tac (claset(), simpset() addsimps [hrealpow_two]));
   9.138 -by (res_inst_tac [("y","Numeral1*Numeral1")] order_le_less_trans 1); 
   9.139 +by (res_inst_tac [("y","1*1")] order_le_less_trans 1); 
   9.140  by (rtac hypreal_mult_less_mono 2); 
   9.141  by Auto_tac;  
   9.142  qed "hrealpow_two_gt_one";
   9.143  
   9.144 -Goal "(Numeral1::hypreal) <= r ==> Numeral1 <= r ^ Suc (Suc 0)";
   9.145 +Goal "(1::hypreal) <= r ==> 1 <= r ^ Suc (Suc 0)";
   9.146  by (etac (order_le_imp_less_or_eq RS disjE) 1);
   9.147  by (etac (hrealpow_two_gt_one RS order_less_imp_le) 1);
   9.148  by Auto_tac;  
   9.149  qed "hrealpow_two_ge_one";
   9.150  
   9.151 -Goal "(Numeral1::hypreal) <= 2 ^ n";
   9.152 -by (res_inst_tac [("y","Numeral1 ^ n")] order_trans 1);
   9.153 +Goal "(1::hypreal) <= 2 ^ n";
   9.154 +by (res_inst_tac [("y","1 ^ n")] order_trans 1);
   9.155  by (rtac hrealpow_le 2);
   9.156  by Auto_tac;
   9.157  qed "two_hrealpow_ge_one";
   9.158 @@ -149,9 +160,9 @@
   9.159  qed "two_hrealpow_gt";
   9.160  Addsimps [two_hrealpow_gt,two_hrealpow_ge_one];
   9.161  
   9.162 -Goal "-1 ^ (2*n) = (Numeral1::hypreal)";
   9.163 +Goal "-1 ^ (2*n) = (1::hypreal)";
   9.164  by (induct_tac "n" 1);
   9.165 -by (Auto_tac);
   9.166 +by Auto_tac;
   9.167  qed "hrealpow_minus_one";
   9.168  
   9.169  Goal "n+n = (2*n::nat)";
   9.170 @@ -159,24 +170,24 @@
   9.171  qed "double_lemma";
   9.172  
   9.173  (*ugh: need to get rid fo the n+n*)
   9.174 -Goal "-1 ^ (n + n) = (Numeral1::hypreal)";
   9.175 +Goal "-1 ^ (n + n) = (1::hypreal)";
   9.176  by (auto_tac (claset(), 
   9.177                simpset() addsimps [double_lemma, hrealpow_minus_one]));
   9.178  qed "hrealpow_minus_one2";
   9.179  Addsimps [hrealpow_minus_one2];
   9.180  
   9.181  Goal "(-(x::hypreal)) ^ Suc (Suc 0) = x ^ Suc (Suc 0)";
   9.182 -by (Auto_tac);
   9.183 +by Auto_tac;
   9.184  qed "hrealpow_minus_two";
   9.185  Addsimps [hrealpow_minus_two];
   9.186  
   9.187 -Goal "(Numeral0::hypreal) < r & r < Numeral1 --> r ^ Suc n < r ^ n";
   9.188 +Goal "(0::hypreal) < r & r < 1 --> r ^ Suc n < r ^ n";
   9.189  by (induct_tac "n" 1);
   9.190  by (auto_tac (claset(),
   9.191                simpset() addsimps [hypreal_mult_less_mono2]));
   9.192  qed_spec_mp "hrealpow_Suc_less";
   9.193  
   9.194 -Goal "(Numeral0::hypreal) <= r & r < Numeral1 --> r ^ Suc n <= r ^ n";
   9.195 +Goal "(0::hypreal) <= r & r < 1 --> r ^ Suc n <= r ^ n";
   9.196  by (induct_tac "n" 1);
   9.197  by (auto_tac (claset() addIs [order_less_imp_le]
   9.198                         addSDs [order_le_imp_less_or_eq,hrealpow_Suc_less],
   9.199 @@ -186,9 +197,7 @@
   9.200  Goal "Abs_hypreal(hyprel``{%n. X n}) ^ m = Abs_hypreal(hyprel``{%n. (X n) ^ m})";
   9.201  by (induct_tac "m" 1);
   9.202  by (auto_tac (claset(),
   9.203 -              simpset() delsimps [one_eq_numeral_1]
   9.204 -			addsimps [hypreal_one_def, hypreal_mult,
   9.205 -                                  one_eq_numeral_1 RS sym]));
   9.206 +              simpset() addsimps [hypreal_one_def, hypreal_mult]));
   9.207  qed "hrealpow";
   9.208  
   9.209  Goal "(x + (y::hypreal)) ^ Suc (Suc 0) = \
   9.210 @@ -204,8 +213,8 @@
   9.211     property for the real rather than prove it directly 
   9.212     using induction: proof is much simpler this way!
   9.213   ---------------------------------------------------------------*)
   9.214 -Goal "[|(Numeral0::hypreal) <= x; Numeral0 <= y;x ^ Suc n <= y ^ Suc n |] ==> x <= y";
   9.215 -by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
   9.216 +Goal "[|(0::hypreal) <= x; 0 <= y;x ^ Suc n <= y ^ Suc n |] ==> x <= y";
   9.217 +by (full_simp_tac (simpset() addsimps [hypreal_zero_def]) 1);
   9.218  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
   9.219  by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
   9.220  by (auto_tac (claset(),
   9.221 @@ -241,15 +250,15 @@
   9.222  by (Fuf_tac 1);
   9.223  qed "hyperpow";
   9.224  
   9.225 -Goalw [hypnat_one_def] "(Numeral0::hypreal) pow (n + (1::hypnat)) = Numeral0";
   9.226 -by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
   9.227 +Goalw [hypnat_one_def] "(0::hypreal) pow (n + (1::hypnat)) = 0";
   9.228 +by (simp_tac (simpset() addsimps [hypreal_zero_def]) 1);
   9.229  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.230  by (auto_tac (claset(), simpset() addsimps [hyperpow,hypnat_add]));
   9.231  qed "hyperpow_zero";
   9.232  Addsimps [hyperpow_zero];
   9.233  
   9.234 -Goal "r ~= (Numeral0::hypreal) --> r pow n ~= Numeral0";
   9.235 -by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
   9.236 +Goal "r ~= (0::hypreal) --> r pow n ~= 0";
   9.237 +by (simp_tac (simpset() addsimps [hypreal_zero_def]) 1);
   9.238  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.239  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
   9.240  by (auto_tac (claset(), simpset() addsimps [hyperpow]));
   9.241 @@ -258,8 +267,8 @@
   9.242      simpset()) 1);
   9.243  qed_spec_mp "hyperpow_not_zero";
   9.244  
   9.245 -Goal "r ~= (Numeral0::hypreal) --> inverse(r pow n) = (inverse r) pow n";
   9.246 -by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
   9.247 +Goal "r ~= (0::hypreal) --> inverse(r pow n) = (inverse r) pow n";
   9.248 +by (simp_tac (simpset() addsimps [hypreal_zero_def]) 1);
   9.249  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.250  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
   9.251  by (auto_tac (claset() addSDs [FreeUltrafilterNat_Compl_mem],
   9.252 @@ -298,24 +307,24 @@
   9.253                simpset() addsimps [hyperpow,hypnat_add, hypreal_mult]));
   9.254  qed "hyperpow_two";
   9.255  
   9.256 -Goal "(Numeral0::hypreal) < r --> Numeral0 < r pow n";
   9.257 -by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
   9.258 +Goal "(0::hypreal) < r --> 0 < r pow n";
   9.259 +by (simp_tac (simpset() addsimps [hypreal_zero_def]) 1);
   9.260  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.261  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
   9.262  by (auto_tac (claset() addSEs [FreeUltrafilterNat_subset, realpow_gt_zero],
   9.263                simpset() addsimps [hyperpow,hypreal_less, hypreal_le]));
   9.264  qed_spec_mp "hyperpow_gt_zero";
   9.265  
   9.266 -Goal "(Numeral0::hypreal) <= r --> Numeral0 <= r pow n";
   9.267 -by (simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
   9.268 +Goal "(0::hypreal) <= r --> 0 <= r pow n";
   9.269 +by (simp_tac (simpset() addsimps [hypreal_zero_def]) 1);
   9.270  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.271  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
   9.272  by (auto_tac (claset() addSEs [FreeUltrafilterNat_subset, realpow_ge_zero],
   9.273                simpset() addsimps [hyperpow,hypreal_le]));
   9.274  qed "hyperpow_ge_zero";
   9.275  
   9.276 -Goal "(Numeral0::hypreal) < x & x <= y --> x pow n <= y pow n";
   9.277 -by (full_simp_tac (simpset() addsimps [rename_numerals hypreal_zero_def]) 1);
   9.278 +Goal "(0::hypreal) < x & x <= y --> x pow n <= y pow n";
   9.279 +by (full_simp_tac (simpset() addsimps [hypreal_zero_def]) 1);
   9.280  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.281  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
   9.282  by (res_inst_tac [("z","y")] eq_Abs_hypreal 1);
   9.283 @@ -326,27 +335,26 @@
   9.284  by (auto_tac (claset() addIs [realpow_le], simpset()));
   9.285  qed_spec_mp "hyperpow_le";
   9.286  
   9.287 -Goal "Numeral1 pow n = (Numeral1::hypreal)";
   9.288 -by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
   9.289 +Goal "1 pow n = (1::hypreal)";
   9.290  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.291 -by (auto_tac (claset(), simpset() addsimps [hyperpow]));
   9.292 +by (auto_tac (claset(), simpset() addsimps [hypreal_one_def, hyperpow]));
   9.293  qed "hyperpow_eq_one";
   9.294  Addsimps [hyperpow_eq_one];
   9.295  
   9.296 -Goal "abs(-(Numeral1 pow n)) = (Numeral1::hypreal)";
   9.297 -by (simp_tac (HOL_ss addsimps [one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
   9.298 +Goal "abs(-(1 pow n)) = (1::hypreal)";
   9.299  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.300 -by (auto_tac (claset(), simpset() addsimps [hyperpow,hypreal_hrabs]));
   9.301 +by (auto_tac (claset(), 
   9.302 +              simpset() addsimps [hyperpow, hypreal_hrabs, hypreal_one_def]));
   9.303  qed "hrabs_minus_hyperpow_one";
   9.304  Addsimps [hrabs_minus_hyperpow_one];
   9.305  
   9.306 -Goal "abs(-1 pow n) = (Numeral1::hypreal)";
   9.307 +Goal "abs(-1 pow n) = (1::hypreal)";
   9.308  by (subgoal_tac "abs((- (1::hypreal)) pow n) = (1::hypreal)" 1);
   9.309  by (Asm_full_simp_tac 1); 
   9.310 -by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1);
   9.311  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.312  by (auto_tac (claset(),
   9.313 -       simpset() addsimps [hyperpow,hypreal_minus,hypreal_hrabs]));
   9.314 +              simpset() addsimps [hypreal_one_def, hyperpow,hypreal_minus,
   9.315 +                                  hypreal_hrabs]));
   9.316  qed "hrabs_hyperpow_minus_one";
   9.317  Addsimps [hrabs_hyperpow_minus_one];
   9.318  
   9.319 @@ -358,7 +366,7 @@
   9.320         simpset() addsimps [hyperpow, hypreal_mult,realpow_mult]));
   9.321  qed "hyperpow_mult";
   9.322  
   9.323 -Goal "(Numeral0::hypreal) <= r pow ((1::hypnat) + (1::hypnat))";
   9.324 +Goal "(0::hypreal) <= r pow ((1::hypnat) + (1::hypnat))";
   9.325  by (auto_tac (claset(), 
   9.326                simpset() addsimps [hyperpow_two, hypreal_0_le_mult_iff]));
   9.327  qed "hyperpow_two_le";
   9.328 @@ -375,21 +383,21 @@
   9.329  Addsimps [hyperpow_two_hrabs];
   9.330  
   9.331  (*? very similar to hrealpow_two_gt_one *)
   9.332 -Goal "(Numeral1::hypreal) < r ==> Numeral1 < r pow ((1::hypnat) + (1::hypnat))";
   9.333 +Goal "(1::hypreal) < r ==> 1 < r pow ((1::hypnat) + (1::hypnat))";
   9.334  by (auto_tac (claset(), simpset() addsimps [hyperpow_two]));
   9.335 -by (res_inst_tac [("y","Numeral1*Numeral1")] order_le_less_trans 1); 
   9.336 +by (res_inst_tac [("y","1*1")] order_le_less_trans 1); 
   9.337  by (rtac hypreal_mult_less_mono 2); 
   9.338  by Auto_tac;  
   9.339  qed "hyperpow_two_gt_one";
   9.340  
   9.341 -Goal "(Numeral1::hypreal) <= r ==> Numeral1 <= r pow ((1::hypnat) + (1::hypnat))";
   9.342 +Goal "(1::hypreal) <= r ==> 1 <= r pow ((1::hypnat) + (1::hypnat))";
   9.343  by (auto_tac (claset() addSDs [order_le_imp_less_or_eq] 
   9.344                         addIs [hyperpow_two_gt_one,order_less_imp_le],
   9.345                simpset()));
   9.346  qed "hyperpow_two_ge_one";
   9.347  
   9.348 -Goal "(Numeral1::hypreal) <= 2 pow n";
   9.349 -by (res_inst_tac [("y","Numeral1 pow n")] order_trans 1);
   9.350 +Goal "(1::hypreal) <= 2 pow n";
   9.351 +by (res_inst_tac [("y","1 pow n")] order_trans 1);
   9.352  by (rtac hyperpow_le 2);
   9.353  by Auto_tac;
   9.354  qed "two_hyperpow_ge_one";
   9.355 @@ -397,7 +405,7 @@
   9.356  
   9.357  Addsimps [simplify (simpset()) realpow_minus_one];
   9.358  
   9.359 -Goal "-1 pow (((1::hypnat) + (1::hypnat))*n) = (Numeral1::hypreal)";
   9.360 +Goal "-1 pow (((1::hypnat) + (1::hypnat))*n) = (1::hypreal)";
   9.361  by (subgoal_tac "(-((1::hypreal))) pow (((1::hypnat) + (1::hypnat))*n) = (1::hypreal)" 1);
   9.362  by (Asm_full_simp_tac 1); 
   9.363  by (simp_tac (HOL_ss addsimps [hypreal_one_def]) 1);
   9.364 @@ -409,52 +417,44 @@
   9.365  Addsimps [hyperpow_minus_one2];
   9.366  
   9.367  Goalw [hypnat_one_def]
   9.368 -     "(Numeral0::hypreal) < r & r < Numeral1 --> r pow (n + (1::hypnat)) < r pow n";
   9.369 -by (full_simp_tac
   9.370 -    (HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,
   9.371 -                      one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
   9.372 +     "(0::hypreal) < r & r < 1 --> r pow (n + (1::hypnat)) < r pow n";
   9.373  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.374  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
   9.375  by (auto_tac (claset() addSDs [conjI RS realpow_Suc_less] 
   9.376                    addEs [FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset],
   9.377 -              simpset() addsimps [hyperpow,hypreal_less,hypnat_add]));
   9.378 +              simpset() addsimps [hypreal_zero_def, hypreal_one_def, 
   9.379 +                                  hyperpow, hypreal_less, hypnat_add]));
   9.380  qed_spec_mp "hyperpow_Suc_less";
   9.381  
   9.382  Goalw [hypnat_one_def]
   9.383 -     "Numeral0 <= r & r < (Numeral1::hypreal) --> r pow (n + (1::hypnat)) <= r pow n";
   9.384 -by (full_simp_tac
   9.385 -    (HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,
   9.386 -                      one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
   9.387 +     "0 <= r & r < (1::hypreal) --> r pow (n + (1::hypnat)) <= r pow n";
   9.388  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.389  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
   9.390 -by (auto_tac (claset() addSDs [conjI RS realpow_Suc_le] addEs
   9.391 -    [FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset ],
   9.392 -    simpset() addsimps [hyperpow,hypreal_le,hypnat_add,
   9.393 -    hypreal_less]));
   9.394 +by (auto_tac (claset() addSDs [conjI RS realpow_Suc_le] 
   9.395 +                 addEs [FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset],
   9.396 +              simpset() addsimps [hypreal_zero_def, hypreal_one_def, hyperpow,
   9.397 +                                  hypreal_le,hypnat_add, hypreal_less]));
   9.398  qed_spec_mp "hyperpow_Suc_le";
   9.399  
   9.400  Goalw [hypnat_one_def]
   9.401 -     "(Numeral0::hypreal) <= r & r < Numeral1 & n < N --> r pow N <= r pow n";
   9.402 -by (full_simp_tac
   9.403 -    (HOL_ss addsimps [zero_eq_numeral_0 RS sym, hypreal_zero_def,
   9.404 -                      one_eq_numeral_1 RS sym, hypreal_one_def]) 1);
   9.405 +     "(0::hypreal) <= r & r < 1 & n < N --> r pow N <= r pow n";
   9.406  by (res_inst_tac [("z","n")] eq_Abs_hypnat 1);
   9.407  by (res_inst_tac [("z","N")] eq_Abs_hypnat 1);
   9.408  by (res_inst_tac [("z","r")] eq_Abs_hypreal 1);
   9.409  by (auto_tac (claset(),
   9.410 -        simpset() addsimps [hyperpow, hypreal_le,hypreal_less,hypnat_less]));
   9.411 +              simpset() addsimps [hyperpow, hypreal_le,hypreal_less,
   9.412 +                           hypnat_less, hypreal_zero_def, hypreal_one_def]));
   9.413  by (etac (FreeUltrafilterNat_Int RS FreeUltrafilterNat_subset) 1);
   9.414  by (etac FreeUltrafilterNat_Int 1);
   9.415 -by (auto_tac (claset() addSDs [conjI RS realpow_less_le],
   9.416 -    simpset()));
   9.417 +by (auto_tac (claset() addSDs [conjI RS realpow_less_le], simpset()));
   9.418  qed_spec_mp "hyperpow_less_le";
   9.419  
   9.420 -Goal "[| (Numeral0::hypreal) <= r; r < Numeral1 |]  \
   9.421 +Goal "[| (0::hypreal) <= r;  r < 1 |]  \
   9.422  \     ==> ALL N n. n < N --> r pow N <= r pow n";
   9.423  by (blast_tac (claset() addSIs [hyperpow_less_le]) 1);
   9.424  qed "hyperpow_less_le2";
   9.425  
   9.426 -Goal "[| Numeral0 <= r;  r < (Numeral1::hypreal);  N : HNatInfinite |]  \
   9.427 +Goal "[| 0 <= r;  r < (1::hypreal);  N : HNatInfinite |]  \
   9.428  \     ==> ALL n: Nats. r pow N <= r pow n";
   9.429  by (auto_tac (claset() addSIs [hyperpow_less_le],
   9.430                simpset() addsimps [HNatInfinite_iff]));
   9.431 @@ -471,25 +471,25 @@
   9.432  qed "hyperpow_SReal";
   9.433  Addsimps [hyperpow_SReal];
   9.434  
   9.435 -Goal "N : HNatInfinite ==> (Numeral0::hypreal) pow N = 0";
   9.436 +Goal "N : HNatInfinite ==> (0::hypreal) pow N = 0";
   9.437  by (dtac HNatInfinite_is_Suc 1);
   9.438 -by (Auto_tac);
   9.439 +by Auto_tac;
   9.440  qed "hyperpow_zero_HNatInfinite";
   9.441  Addsimps [hyperpow_zero_HNatInfinite];
   9.442  
   9.443 -Goal "[| (Numeral0::hypreal) <= r; r < Numeral1; n <= N |] ==> r pow N <= r pow n";
   9.444 +Goal "[| (0::hypreal) <= r; r < 1; n <= N |] ==> r pow N <= r pow n";
   9.445  by (dres_inst_tac [("y","N")] hypnat_le_imp_less_or_eq 1);
   9.446  by (auto_tac (claset() addIs [hyperpow_less_le], simpset()));
   9.447  qed "hyperpow_le_le";
   9.448  
   9.449 -Goal "[| (Numeral0::hypreal) < r; r < Numeral1 |] ==> r pow (n + (1::hypnat)) <= r";
   9.450 +Goal "[| (0::hypreal) < r; r < 1 |] ==> r pow (n + (1::hypnat)) <= r";
   9.451  by (dres_inst_tac [("n","(1::hypnat)")] (order_less_imp_le RS hyperpow_le_le) 1);
   9.452 -by (Auto_tac);
   9.453 +by Auto_tac;
   9.454  qed "hyperpow_Suc_le_self";
   9.455  
   9.456 -Goal "[| (Numeral0::hypreal) <= r; r < Numeral1 |] ==> r pow (n + (1::hypnat)) <= r";
   9.457 +Goal "[| (0::hypreal) <= r; r < 1 |] ==> r pow (n + (1::hypnat)) <= r";
   9.458  by (dres_inst_tac [("n","(1::hypnat)")] hyperpow_le_le 1);
   9.459 -by (Auto_tac);
   9.460 +by Auto_tac;
   9.461  qed "hyperpow_Suc_le_self2";
   9.462  
   9.463  Goalw [Infinitesimal_def]
    10.1 --- a/src/HOL/Hyperreal/Lim.ML	Thu Nov 01 21:12:13 2001 +0100
    10.2 +++ b/src/HOL/Hyperreal/Lim.ML	Fri Nov 02 17:55:24 2001 +0100
    10.3 @@ -65,16 +65,16 @@
    10.4  (*----------------------------------------------
    10.5       LIM_zero
    10.6   ----------------------------------------------*)
    10.7 -Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> Numeral0";
    10.8 -by (res_inst_tac [("z1","l")] (rename_numerals (real_add_minus RS subst)) 1);
    10.9 +Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> 0";
   10.10 +by (res_inst_tac [("z1","l")] ((real_add_minus RS subst)) 1);
   10.11  by (rtac LIM_add_minus 1 THEN Auto_tac);
   10.12  qed "LIM_zero";
   10.13  
   10.14  (*--------------------------
   10.15     Limit not zero
   10.16   --------------------------*)
   10.17 -Goalw [LIM_def] "k \\<noteq> Numeral0 ==> ~ ((%x. k) -- x --> Numeral0)";
   10.18 -by (res_inst_tac [("R1.0","k"),("R2.0","Numeral0")] real_linear_less2 1);
   10.19 +Goalw [LIM_def] "k \\<noteq> 0 ==> ~ ((%x. k) -- x --> 0)";
   10.20 +by (res_inst_tac [("R1.0","k"),("R2.0","0")] real_linear_less2 1);
   10.21  by (auto_tac (claset(), simpset() addsimps [real_abs_def]));
   10.22  by (res_inst_tac [("x","-k")] exI 1);
   10.23  by (res_inst_tac [("x","k")] exI 2);
   10.24 @@ -85,7 +85,7 @@
   10.25  by Auto_tac;  
   10.26  qed "LIM_not_zero";
   10.27  
   10.28 -(* [| k \\<noteq> Numeral0; (%x. k) -- x --> Numeral0 |] ==> R *)
   10.29 +(* [| k \\<noteq> 0; (%x. k) -- x --> 0 |] ==> R *)
   10.30  bind_thm("LIM_not_zeroE", LIM_not_zero RS notE);
   10.31  
   10.32  Goal "(%x. k) -- x --> L ==> k = L";
   10.33 @@ -108,9 +108,9 @@
   10.34      LIM_mult_zero
   10.35   -------------*)
   10.36  Goalw [LIM_def]
   10.37 -     "[| f -- x --> Numeral0; g -- x --> Numeral0 |] ==> (%x. f(x)*g(x)) -- x --> Numeral0";
   10.38 +     "[| f -- x --> 0; g -- x --> 0 |] ==> (%x. f(x)*g(x)) -- x --> 0";
   10.39  by Safe_tac;
   10.40 -by (dres_inst_tac [("x","Numeral1")] spec 1);
   10.41 +by (dres_inst_tac [("x","1")] spec 1);
   10.42  by (dres_inst_tac [("x","r")] spec 1);
   10.43  by (cut_facts_tac [real_zero_less_one] 1);
   10.44  by (asm_full_simp_tac (simpset() addsimps 
   10.45 @@ -146,7 +146,7 @@
   10.46  by (auto_tac (claset(), simpset() addsimps [real_add_minus_iff]));
   10.47  qed "LIM_equal";
   10.48  
   10.49 -Goal "[| (%x. f(x) + -g(x)) -- a --> Numeral0;  g -- a --> l |] \
   10.50 +Goal "[| (%x. f(x) + -g(x)) -- a --> 0;  g -- a --> l |] \
   10.51  \     ==> f -- a --> l";
   10.52  by (dtac LIM_add 1 THEN assume_tac 1);
   10.53  by (auto_tac (claset(), simpset() addsimps [real_add_assoc]));
   10.54 @@ -181,17 +181,17 @@
   10.55      Limit: NS definition ==> standard definition
   10.56   ---------------------------------------------------------------------*)
   10.57  
   10.58 -Goal "\\<forall>s. Numeral0 < s --> (\\<exists>xa.  xa \\<noteq> x & \
   10.59 +Goal "\\<forall>s. 0 < s --> (\\<exists>xa.  xa \\<noteq> x & \
   10.60  \        abs (xa + - x) < s  & r \\<le> abs (f xa + -L)) \
   10.61  \     ==> \\<forall>n::nat. \\<exists>xa.  xa \\<noteq> x & \
   10.62  \             abs(xa + -x) < inverse(real(Suc n)) & r \\<le> abs(f xa + -L)";
   10.63  by (Clarify_tac 1); 
   10.64  by (cut_inst_tac [("n1","n")]
   10.65 -    (real_of_nat_Suc_gt_zero RS rename_numerals real_inverse_gt_zero) 1);
   10.66 +    (real_of_nat_Suc_gt_zero RS real_inverse_gt_0) 1);
   10.67  by Auto_tac;
   10.68  val lemma_LIM = result();
   10.69  
   10.70 -Goal "\\<forall>s. Numeral0 < s --> (\\<exists>xa.  xa \\<noteq> x & \
   10.71 +Goal "\\<forall>s. 0 < s --> (\\<exists>xa.  xa \\<noteq> x & \
   10.72  \        abs (xa + - x) < s  & r \\<le> abs (f xa + -L)) \
   10.73  \     ==> \\<exists>X. \\<forall>n::nat. X n \\<noteq> x & \
   10.74  \               abs(X n + -x) < inverse(real(Suc n)) & r \\<le> abs(f (X n) + -L)";
   10.75 @@ -320,7 +320,7 @@
   10.76      NSLIM_inverse
   10.77   -----------------------------*)
   10.78  Goalw [NSLIM_def] 
   10.79 -     "[| f -- a --NS> L;  L \\<noteq> Numeral0 |] \
   10.80 +     "[| f -- a --NS> L;  L \\<noteq> 0 |] \
   10.81  \     ==> (%x. inverse(f(x))) -- a --NS> (inverse L)";
   10.82  by (Clarify_tac 1);
   10.83  by (dtac spec 1);
   10.84 @@ -329,28 +329,28 @@
   10.85  qed "NSLIM_inverse";
   10.86  
   10.87  Goal "[| f -- a --> L; \
   10.88 -\        L \\<noteq> Numeral0 |] ==> (%x. inverse(f(x))) -- a --> (inverse L)";
   10.89 +\        L \\<noteq> 0 |] ==> (%x. inverse(f(x))) -- a --> (inverse L)";
   10.90  by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_inverse]) 1);
   10.91  qed "LIM_inverse";
   10.92  
   10.93  (*------------------------------
   10.94      NSLIM_zero
   10.95   ------------------------------*)
   10.96 -Goal "f -- a --NS> l ==> (%x. f(x) + -l) -- a --NS> Numeral0";
   10.97 -by (res_inst_tac [("z1","l")] (rename_numerals (real_add_minus RS subst)) 1);
   10.98 +Goal "f -- a --NS> l ==> (%x. f(x) + -l) -- a --NS> 0";
   10.99 +by (res_inst_tac [("z1","l")] ((real_add_minus RS subst)) 1);
  10.100  by (rtac NSLIM_add_minus 1 THEN Auto_tac);
  10.101  qed "NSLIM_zero";
  10.102  
  10.103 -Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> Numeral0";
  10.104 +Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> 0";
  10.105  by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_zero]) 1);
  10.106  qed "LIM_zero2";
  10.107  
  10.108 -Goal "(%x. f(x) - l) -- x --NS> Numeral0 ==> f -- x --NS> l";
  10.109 +Goal "(%x. f(x) - l) -- x --NS> 0 ==> f -- x --NS> l";
  10.110  by (dres_inst_tac [("g","%x. l"),("m","l")] NSLIM_add 1);
  10.111  by (auto_tac (claset(),simpset() addsimps [real_diff_def, real_add_assoc]));
  10.112  qed "NSLIM_zero_cancel";
  10.113  
  10.114 -Goal "(%x. f(x) - l) -- x --> Numeral0 ==> f -- x --> l";
  10.115 +Goal "(%x. f(x) - l) -- x --> 0 ==> f -- x --> l";
  10.116  by (dres_inst_tac [("g","%x. l"),("m","l")] LIM_add 1);
  10.117  by (auto_tac (claset(),simpset() addsimps [real_diff_def, real_add_assoc]));
  10.118  qed "LIM_zero_cancel";
  10.119 @@ -359,17 +359,17 @@
  10.120  (*--------------------------
  10.121     NSLIM_not_zero
  10.122   --------------------------*)
  10.123 -Goalw [NSLIM_def] "k \\<noteq> Numeral0 ==> ~ ((%x. k) -- x --NS> Numeral0)";
  10.124 +Goalw [NSLIM_def] "k \\<noteq> 0 ==> ~ ((%x. k) -- x --NS> 0)";
  10.125  by Auto_tac;
  10.126  by (res_inst_tac [("x","hypreal_of_real x + epsilon")] exI 1);
  10.127  by (auto_tac (claset() addIs [Infinitesimal_add_approx_self RS approx_sym],
  10.128 -              simpset() addsimps [rename_numerals hypreal_epsilon_not_zero]));
  10.129 +              simpset() addsimps [hypreal_epsilon_not_zero]));
  10.130  qed "NSLIM_not_zero";
  10.131  
  10.132 -(* [| k \\<noteq> Numeral0; (%x. k) -- x --NS> Numeral0 |] ==> R *)
  10.133 +(* [| k \\<noteq> 0; (%x. k) -- x --NS> 0 |] ==> R *)
  10.134  bind_thm("NSLIM_not_zeroE", NSLIM_not_zero RS notE);
  10.135  
  10.136 -Goal "k \\<noteq> Numeral0 ==> ~ ((%x. k) -- x --> Numeral0)";
  10.137 +Goal "k \\<noteq> 0 ==> ~ ((%x. k) -- x --> 0)";
  10.138  by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_not_zero]) 1);
  10.139  qed "LIM_not_zero2";
  10.140  
  10.141 @@ -405,16 +405,16 @@
  10.142  (*--------------------
  10.143      NSLIM_mult_zero
  10.144   --------------------*)
  10.145 -Goal "[| f -- x --NS> Numeral0; g -- x --NS> Numeral0 |] \
  10.146 -\         ==> (%x. f(x)*g(x)) -- x --NS> Numeral0";
  10.147 +Goal "[| f -- x --NS> 0; g -- x --NS> 0 |] \
  10.148 +\         ==> (%x. f(x)*g(x)) -- x --NS> 0";
  10.149  by (dtac NSLIM_mult 1 THEN Auto_tac);
  10.150  qed "NSLIM_mult_zero";
  10.151  
  10.152  (* we can use the corresponding thm LIM_mult2 *)
  10.153  (* for standard definition of limit           *)
  10.154  
  10.155 -Goal "[| f -- x --> Numeral0; g -- x --> Numeral0 |] \
  10.156 -\     ==> (%x. f(x)*g(x)) -- x --> Numeral0";
  10.157 +Goal "[| f -- x --> 0; g -- x --> 0 |] \
  10.158 +\     ==> (%x. f(x)*g(x)) -- x --> 0";
  10.159  by (dtac LIM_mult2 1 THEN Auto_tac);
  10.160  qed "LIM_mult_zero2";
  10.161  
  10.162 @@ -499,8 +499,8 @@
  10.163   --------------------------------------------------------------------------*)
  10.164  (* Prove equivalence between NS limits - *)
  10.165  (* seems easier than using standard def  *)
  10.166 -Goalw [NSLIM_def] "(f -- a --NS> L) = ((%h. f(a + h)) -- Numeral0 --NS> L)";
  10.167 -by (auto_tac (claset(),simpset() addsimps [hypreal_of_real_zero]));
  10.168 +Goalw [NSLIM_def] "(f -- a --NS> L) = ((%h. f(a + h)) -- 0 --NS> L)";
  10.169 +by Auto_tac;
  10.170  by (dres_inst_tac [("x","hypreal_of_real a + x")] spec 1);
  10.171  by (dres_inst_tac [("x","-hypreal_of_real a + x")] spec 2);
  10.172  by Safe_tac;
  10.173 @@ -516,15 +516,15 @@
  10.174                hypreal_add, real_add_assoc, approx_refl, hypreal_zero_def]));
  10.175  qed "NSLIM_h_iff";
  10.176  
  10.177 -Goal "(f -- a --NS> f a) = ((%h. f(a + h)) -- Numeral0 --NS> f a)";
  10.178 +Goal "(f -- a --NS> f a) = ((%h. f(a + h)) -- 0 --NS> f a)";
  10.179  by (rtac NSLIM_h_iff 1);
  10.180  qed "NSLIM_isCont_iff";
  10.181  
  10.182 -Goal "(f -- a --> f a) = ((%h. f(a + h)) -- Numeral0 --> f(a))";
  10.183 +Goal "(f -- a --> f a) = ((%h. f(a + h)) -- 0 --> f(a))";
  10.184  by (simp_tac (simpset() addsimps [LIM_NSLIM_iff, NSLIM_isCont_iff]) 1);
  10.185  qed "LIM_isCont_iff";
  10.186  
  10.187 -Goalw [isCont_def] "(isCont f x) = ((%h. f(x + h)) -- Numeral0 --> f(x))";
  10.188 +Goalw [isCont_def] "(isCont f x) = ((%h. f(x + h)) -- 0 --> f(x))";
  10.189  by (simp_tac (simpset() addsimps [LIM_isCont_iff]) 1);
  10.190  qed "isCont_iff";
  10.191  
  10.192 @@ -574,11 +574,11 @@
  10.193  qed "isCont_minus";
  10.194  
  10.195  Goalw [isCont_def]  
  10.196 -      "[| isCont f x; f x \\<noteq> Numeral0 |] ==> isCont (%x. inverse (f x)) x";
  10.197 +      "[| isCont f x; f x \\<noteq> 0 |] ==> isCont (%x. inverse (f x)) x";
  10.198  by (blast_tac (claset() addIs [LIM_inverse]) 1);
  10.199  qed "isCont_inverse";
  10.200  
  10.201 -Goal "[| isNSCont f x; f x \\<noteq> Numeral0 |] ==> isNSCont (%x. inverse (f x)) x";
  10.202 +Goal "[| isNSCont f x; f x \\<noteq> 0 |] ==> isNSCont (%x. inverse (f x)) x";
  10.203  by (auto_tac (claset() addIs [isCont_inverse],simpset() addsimps 
  10.204      [isNSCont_isCont_iff]));
  10.205  qed "isNSCont_inverse";
  10.206 @@ -667,8 +667,10 @@
  10.207  qed "isNSUContD";
  10.208  
  10.209  Goalw [isUCont_def,isCont_def,LIM_def]
  10.210 -     "isUCont f ==> \\<exists>x. isCont f x";
  10.211 -by (Force_tac 1);
  10.212 +     "isUCont f ==> isCont f x";
  10.213 +by (Clarify_tac 1);
  10.214 +by (dtac spec 1); 
  10.215 +by (Blast_tac 1); 
  10.216  qed "isUCont_isCont";
  10.217  
  10.218  Goalw [isNSUCont_def,isUCont_def,approx_def] 
  10.219 @@ -690,17 +692,17 @@
  10.220  by (Ultra_tac 1);
  10.221  qed "isUCont_isNSUCont";
  10.222  
  10.223 -Goal "\\<forall>s. Numeral0 < s --> (\\<exists>z y. abs (z + - y) < s & r \\<le> abs (f z + -f y)) \
  10.224 +Goal "\\<forall>s. 0 < s --> (\\<exists>z y. abs (z + - y) < s & r \\<le> abs (f z + -f y)) \
  10.225  \     ==> \\<forall>n::nat. \\<exists>z y.  \
  10.226  \              abs(z + -y) < inverse(real(Suc n)) & \
  10.227  \              r \\<le> abs(f z + -f y)";
  10.228  by (Clarify_tac 1); 
  10.229  by (cut_inst_tac [("n1","n")]
  10.230 -    (real_of_nat_Suc_gt_zero RS rename_numerals real_inverse_gt_zero) 1);
  10.231 +    (real_of_nat_Suc_gt_zero RS real_inverse_gt_0) 1);
  10.232  by Auto_tac;
  10.233  val lemma_LIMu = result();
  10.234  
  10.235 -Goal "\\<forall>s. Numeral0 < s --> (\\<exists>z y. abs (z + - y) < s  & r \\<le> abs (f z + -f y)) \
  10.236 +Goal "\\<forall>s. 0 < s --> (\\<exists>z y. abs (z + - y) < s  & r \\<le> abs (f z + -f y)) \
  10.237  \     ==> \\<exists>X Y. \\<forall>n::nat. \
  10.238  \              abs(X n + -(Y n)) < inverse(real(Suc n)) & \
  10.239  \              r \\<le> abs(f (X n) + -f (Y n))";
  10.240 @@ -745,23 +747,23 @@
  10.241                           Derivatives
  10.242   ------------------------------------------------------------------*)
  10.243  Goalw [deriv_def] 
  10.244 -      "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- Numeral0 --> D)";
  10.245 +      "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- 0 --> D)";
  10.246  by (Blast_tac 1);        
  10.247  qed "DERIV_iff";
  10.248  
  10.249  Goalw [deriv_def] 
  10.250 -      "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- Numeral0 --NS> D)";
  10.251 +      "(DERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- 0 --NS> D)";
  10.252  by (simp_tac (simpset() addsimps [LIM_NSLIM_iff]) 1);
  10.253  qed "DERIV_NS_iff";
  10.254  
  10.255  Goalw [deriv_def] 
  10.256        "DERIV f x :> D \
  10.257 -\      ==> (%h. (f(x + h) + - f(x))/h) -- Numeral0 --> D";
  10.258 +\      ==> (%h. (f(x + h) + - f(x))/h) -- 0 --> D";
  10.259  by (Blast_tac 1);        
  10.260  qed "DERIVD";
  10.261  
  10.262  Goalw [deriv_def] "DERIV f x :> D ==> \
  10.263 -\          (%h. (f(x + h) + - f(x))/h) -- Numeral0 --NS> D";
  10.264 +\          (%h. (f(x + h) + - f(x))/h) -- 0 --NS> D";
  10.265  by (asm_full_simp_tac (simpset() addsimps [LIM_NSLIM_iff]) 1);
  10.266  qed "NS_DERIVD";
  10.267  
  10.268 @@ -809,7 +811,7 @@
  10.269   -------------------------------------------------------*)
  10.270  
  10.271  Goalw [LIM_def] 
  10.272 - "((%h. (f(a + h) + - f(a))/h) -- Numeral0 --> D) = \
  10.273 + "((%h. (f(a + h) + - f(a))/h) -- 0 --> D) = \
  10.274  \ ((%x. (f(x) + -f(a)) / (x + -a)) -- a --> D)";
  10.275  by Safe_tac;
  10.276  by (ALLGOALS(dtac spec));
  10.277 @@ -836,8 +838,8 @@
  10.278  
  10.279  (*--- first equivalence ---*)
  10.280  Goalw [nsderiv_def,NSLIM_def] 
  10.281 -      "(NSDERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- Numeral0 --NS> D)";
  10.282 -by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero]));
  10.283 +      "(NSDERIV f x :> D) = ((%h. (f(x + h) + - f(x))/h) -- 0 --NS> D)";
  10.284 +by Auto_tac;
  10.285  by (dres_inst_tac [("x","xa")] bspec 1);
  10.286  by (rtac ccontr 3);
  10.287  by (dres_inst_tac [("x","h")] spec 3);
  10.288 @@ -868,8 +870,7 @@
  10.289  \       (*f* (%z. f z - f x)) u \\<approx> hypreal_of_real D * (u - hypreal_of_real x))";
  10.290  by (auto_tac (claset(), simpset() addsimps [NSDERIV_iff2]));
  10.291  by (case_tac "u = hypreal_of_real x" 1);
  10.292 -by (auto_tac (claset(), 
  10.293 -              simpset() addsimps [hypreal_diff_def, hypreal_of_real_zero]));
  10.294 +by (auto_tac (claset(), simpset() addsimps [hypreal_diff_def]));
  10.295  by (dres_inst_tac [("x","u")] spec 1);
  10.296  by Auto_tac;
  10.297  by (dres_inst_tac [("c","u - hypreal_of_real x"),("b","hypreal_of_real D")]
  10.298 @@ -956,12 +957,12 @@
  10.299   ------------------------*)
  10.300  
  10.301  (* use simple constant nslimit theorem *)
  10.302 -Goal "(NSDERIV (%x. k) x :> Numeral0)";
  10.303 +Goal "(NSDERIV (%x. k) x :> 0)";
  10.304  by (simp_tac (simpset() addsimps [NSDERIV_NSLIM_iff]) 1);
  10.305  qed "NSDERIV_const";
  10.306  Addsimps [NSDERIV_const];
  10.307  
  10.308 -Goal "(DERIV (%x. k) x :> Numeral0)";
  10.309 +Goal "(DERIV (%x. k) x :> 0)";
  10.310  by (simp_tac (simpset() addsimps [NSDERIV_DERIV_iff RS sym]) 1);
  10.311  qed "DERIV_const";
  10.312  Addsimps [DERIV_const];
  10.313 @@ -1000,7 +1001,7 @@
  10.314  
  10.315  Goal "[| (x + y) / z = hypreal_of_real D + yb; z \\<noteq> 0; \
  10.316  \        z \\<in> Infinitesimal; yb \\<in> Infinitesimal |] \
  10.317 -\     ==> x + y \\<approx> Numeral0";
  10.318 +\     ==> x + y \\<approx> 0";
  10.319  by (forw_inst_tac [("c1","z")] (hypreal_mult_right_cancel RS iffD2) 1 
  10.320      THEN assume_tac 1);
  10.321  by (thin_tac "(x + y) / z = hypreal_of_real D + yb" 1);
  10.322 @@ -1015,8 +1016,7 @@
  10.323  by (asm_full_simp_tac (simpset() addsimps [NSDERIV_NSLIM_iff, NSLIM_def]) 1);
  10.324  by (REPEAT (Step_tac 1));
  10.325  by (auto_tac (claset(),
  10.326 -       simpset() addsimps [starfun_lambda_cancel, hypreal_of_real_zero,
  10.327 -              lemma_nsderiv1]));
  10.328 +       simpset() addsimps [starfun_lambda_cancel, lemma_nsderiv1]));
  10.329  by (simp_tac (simpset() addsimps [hypreal_add_divide_distrib]) 1); 
  10.330  by (REPEAT(dtac (bex_Infinitesimal_iff2 RS iffD2) 1));
  10.331  by (auto_tac (claset(),
  10.332 @@ -1127,13 +1127,13 @@
  10.333  qed "incrementI2";
  10.334  
  10.335  (* The Increment theorem -- Keisler p. 65 *)
  10.336 -Goal "[| NSDERIV f x :> D; h \\<in> Infinitesimal; h \\<noteq> Numeral0 |] \
  10.337 +Goal "[| NSDERIV f x :> D; h \\<in> Infinitesimal; h \\<noteq> 0 |] \
  10.338  \     ==> \\<exists>e \\<in> Infinitesimal. increment f x h = hypreal_of_real(D)*h + e*h";
  10.339  by (forw_inst_tac [("h","h")] incrementI2 1 THEN rewtac nsderiv_def);
  10.340  by (dtac bspec 1 THEN Auto_tac);
  10.341  by (dtac (bex_Infinitesimal_iff2 RS iffD2) 1 THEN Step_tac 1);
  10.342  by (forw_inst_tac [("b1","hypreal_of_real(D) + y")] 
  10.343 -    (rename_numerals (hypreal_mult_right_cancel RS iffD2)) 1);
  10.344 +    ((hypreal_mult_right_cancel RS iffD2)) 1);
  10.345  by (thin_tac "((*f* f) (hypreal_of_real(x) + h) + \
  10.346  \   - hypreal_of_real (f x)) / h = hypreal_of_real(D) + y" 2);
  10.347  by (assume_tac 1);
  10.348 @@ -1143,15 +1143,15 @@
  10.349                simpset() addsimps [hypreal_add_mult_distrib]));
  10.350  qed "increment_thm";
  10.351  
  10.352 -Goal "[| NSDERIV f x :> D; h \\<approx> Numeral0; h \\<noteq> Numeral0 |] \
  10.353 +Goal "[| NSDERIV f x :> D; h \\<approx> 0; h \\<noteq> 0 |] \
  10.354  \     ==> \\<exists>e \\<in> Infinitesimal. increment f x h = \
  10.355  \             hypreal_of_real(D)*h + e*h";
  10.356  by (blast_tac (claset() addSDs [mem_infmal_iff RS iffD2] 
  10.357                          addSIs [increment_thm]) 1);
  10.358  qed "increment_thm2";
  10.359  
  10.360 -Goal "[| NSDERIV f x :> D; h \\<approx> Numeral0; h \\<noteq> Numeral0 |] \
  10.361 -\     ==> increment f x h \\<approx> Numeral0";
  10.362 +Goal "[| NSDERIV f x :> D; h \\<approx> 0; h \\<noteq> 0 |] \
  10.363 +\     ==> increment f x h \\<approx> 0";
  10.364  by (dtac increment_thm2 1 THEN auto_tac (claset() addSIs 
  10.365      [Infinitesimal_HFinite_mult2,HFinite_add],simpset() addsimps 
  10.366      [hypreal_add_mult_distrib RS sym,mem_infmal_iff RS sym]));
  10.367 @@ -1172,16 +1172,16 @@
  10.368        "[| NSDERIV g x :> D; \
  10.369  \              (*f* g) (hypreal_of_real(x) + xa) = hypreal_of_real(g x);\
  10.370  \              xa \\<in> Infinitesimal;\
  10.371 -\              xa \\<noteq> Numeral0 \
  10.372 -\           |] ==> D = Numeral0";
  10.373 +\              xa \\<noteq> 0 \
  10.374 +\           |] ==> D = 0";
  10.375  by (dtac bspec 1);
  10.376  by Auto_tac;
  10.377  qed "NSDERIV_zero";
  10.378  
  10.379  (* can be proved differently using NSLIM_isCont_iff *)
  10.380  Goalw [nsderiv_def] 
  10.381 -     "[| NSDERIV f x :> D;  h \\<in> Infinitesimal;  h \\<noteq> Numeral0 |]  \
  10.382 -\     ==> (*f* f) (hypreal_of_real(x) + h) + -hypreal_of_real(f x) \\<approx> Numeral0";    
  10.383 +     "[| NSDERIV f x :> D;  h \\<in> Infinitesimal;  h \\<noteq> 0 |]  \
  10.384 +\     ==> (*f* f) (hypreal_of_real(x) + h) + -hypreal_of_real(f x) \\<approx> 0";    
  10.385  by (asm_full_simp_tac (simpset() addsimps 
  10.386      [mem_infmal_iff RS sym]) 1);
  10.387  by (rtac Infinitesimal_ratio 1);
  10.388 @@ -1214,12 +1214,12 @@
  10.389                 ----------------- \\<approx> Db
  10.390                         h
  10.391   --------------------------------------------------------------*)
  10.392 -Goal "[| NSDERIV g x :> Db; xa \\<in> Infinitesimal; xa \\<noteq> Numeral0 |] \
  10.393 +Goal "[| NSDERIV g x :> Db; xa \\<in> Infinitesimal; xa \\<noteq> 0 |] \
  10.394  \     ==> ((*f* g) (hypreal_of_real(x) + xa) + - hypreal_of_real(g x)) / xa \
  10.395  \         \\<approx> hypreal_of_real(Db)";
  10.396  by (auto_tac (claset(),
  10.397      simpset() addsimps [NSDERIV_NSLIM_iff, NSLIM_def, 
  10.398 -		hypreal_of_real_zero, mem_infmal_iff, starfun_lambda_cancel]));
  10.399 +		        mem_infmal_iff, starfun_lambda_cancel]));
  10.400  qed "NSDERIVD2";
  10.401  
  10.402  Goal "(z::hypreal) \\<noteq> 0 ==> x*y = (x*inverse(z))*(z*y)";
  10.403 @@ -1232,14 +1232,13 @@
  10.404  Goal "[| NSDERIV f (g x) :> Da; NSDERIV g x :> Db |] \
  10.405  \     ==> NSDERIV (f o g) x :> Da * Db";
  10.406  by (asm_simp_tac (simpset() addsimps [NSDERIV_NSLIM_iff,
  10.407 -    NSLIM_def,hypreal_of_real_zero,mem_infmal_iff RS sym]) 1 THEN Step_tac 1);
  10.408 +    NSLIM_def,mem_infmal_iff RS sym]) 1 THEN Step_tac 1);
  10.409  by (forw_inst_tac [("f","g")] NSDERIV_approx 1);
  10.410  by (auto_tac (claset(),
  10.411                simpset() addsimps [starfun_lambda_cancel2, starfun_o RS sym]));
  10.412  by (case_tac "(*f* g) (hypreal_of_real(x) + xa) = hypreal_of_real (g x)" 1);
  10.413  by (dres_inst_tac [("g","g")] NSDERIV_zero 1);
  10.414 -by (auto_tac (claset(),
  10.415 -    simpset() addsimps [hypreal_divide_def, hypreal_of_real_zero]));
  10.416 +by (auto_tac (claset(), simpset() addsimps [hypreal_divide_def]));
  10.417  by (res_inst_tac [("z1","(*f* g) (hypreal_of_real(x) + xa) + -hypreal_of_real (g x)"),
  10.418      ("y1","inverse xa")] (lemma_chain RS ssubst) 1);
  10.419  by (etac (hypreal_not_eq_minus_iff RS iffD1) 1);
  10.420 @@ -1266,16 +1265,14 @@
  10.421  (*------------------------------------------------------------------
  10.422             Differentiation of natural number powers
  10.423   ------------------------------------------------------------------*)
  10.424 -Goal "NSDERIV (%x. x) x :> Numeral1";
  10.425 +Goal "NSDERIV (%x. x) x :> 1";
  10.426  by (auto_tac (claset(),
  10.427 -     simpset() addsimps [NSDERIV_NSLIM_iff,
  10.428 -          NSLIM_def ,starfun_Id, hypreal_of_real_zero,
  10.429 -           hypreal_of_real_one]));
  10.430 +     simpset() addsimps [NSDERIV_NSLIM_iff, NSLIM_def ,starfun_Id]));
  10.431  qed "NSDERIV_Id";
  10.432  Addsimps [NSDERIV_Id];
  10.433  
  10.434  (*derivative of the identity function*)
  10.435 -Goal "DERIV (%x. x) x :> Numeral1";
  10.436 +Goal "DERIV (%x. x) x :> 1";
  10.437  by (simp_tac (simpset() addsimps [NSDERIV_DERIV_iff RS sym]) 1);
  10.438  qed "DERIV_Id";
  10.439  Addsimps [DERIV_Id];
  10.440 @@ -1314,9 +1311,9 @@
  10.441                      Power of -1 
  10.442   ---------------------------------------------------------------*)
  10.443  
  10.444 -(*Can't get rid of x \\<noteq> Numeral0 because it isn't continuous at zero*)
  10.445 +(*Can't get rid of x \\<noteq> 0 because it isn't continuous at zero*)
  10.446  Goalw [nsderiv_def]
  10.447 -     "x \\<noteq> Numeral0 ==> NSDERIV (%x. inverse(x)) x :> (- (inverse x ^ Suc (Suc 0)))";
  10.448 +     "x \\<noteq> 0 ==> NSDERIV (%x. inverse(x)) x :> (- (inverse x ^ Suc (Suc 0)))";
  10.449  by (rtac ballI 1 THEN Asm_full_simp_tac 1 THEN Step_tac 1);
  10.450  by (forward_tac [Infinitesimal_add_not_zero] 1);
  10.451  by (asm_full_simp_tac (simpset() addsimps [hypreal_add_commute]) 2); 
  10.452 @@ -1345,7 +1342,7 @@
  10.453  qed "NSDERIV_inverse";
  10.454  
  10.455  
  10.456 -Goal "x \\<noteq> Numeral0 ==> DERIV (%x. inverse(x)) x :> (-(inverse x ^ Suc (Suc 0)))";
  10.457 +Goal "x \\<noteq> 0 ==> DERIV (%x. inverse(x)) x :> (-(inverse x ^ Suc (Suc 0)))";
  10.458  by (asm_simp_tac (simpset() addsimps [NSDERIV_inverse,
  10.459           NSDERIV_DERIV_iff RS sym] delsimps [realpow_Suc]) 1);
  10.460  qed "DERIV_inverse";
  10.461 @@ -1353,7 +1350,7 @@
  10.462  (*--------------------------------------------------------------
  10.463          Derivative of inverse 
  10.464   -------------------------------------------------------------*)
  10.465 -Goal "[| DERIV f x :> d; f(x) \\<noteq> Numeral0 |] \
  10.466 +Goal "[| DERIV f x :> d; f(x) \\<noteq> 0 |] \
  10.467  \     ==> DERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ Suc (Suc 0))))";
  10.468  by (rtac (real_mult_commute RS subst) 1);
  10.469  by (asm_simp_tac (simpset() addsimps [real_minus_mult_eq1,
  10.470 @@ -1363,7 +1360,7 @@
  10.471  by (blast_tac (claset() addSIs [DERIV_chain,DERIV_inverse]) 1);
  10.472  qed "DERIV_inverse_fun";
  10.473  
  10.474 -Goal "[| NSDERIV f x :> d; f(x) \\<noteq> Numeral0 |] \
  10.475 +Goal "[| NSDERIV f x :> d; f(x) \\<noteq> 0 |] \
  10.476  \     ==> NSDERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ Suc (Suc 0))))";
  10.477  by (asm_full_simp_tac (simpset() addsimps [NSDERIV_DERIV_iff,
  10.478              DERIV_inverse_fun] delsimps [realpow_Suc]) 1);
  10.479 @@ -1372,7 +1369,7 @@
  10.480  (*--------------------------------------------------------------
  10.481          Derivative of quotient 
  10.482   -------------------------------------------------------------*)
  10.483 -Goal "[| DERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> Numeral0 |] \
  10.484 +Goal "[| DERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> 0 |] \
  10.485  \      ==> DERIV (%y. f(y) / (g y)) x :> (d*g(x) + -(e*f(x))) / (g(x) ^ Suc (Suc 0))";
  10.486  by (dres_inst_tac [("f","g")] DERIV_inverse_fun 1);
  10.487  by (dtac DERIV_mult 2);
  10.488 @@ -1384,7 +1381,7 @@
  10.489                   real_minus_mult_eq2 RS sym]) 1);
  10.490  qed "DERIV_quotient";
  10.491  
  10.492 -Goal "[| NSDERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> Numeral0 |] \
  10.493 +Goal "[| NSDERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> 0 |] \
  10.494  \      ==> NSDERIV (%y. f(y) / (g y)) x :> (d*g(x) \
  10.495  \                           + -(e*f(x))) / (g(x) ^ Suc (Suc 0))";
  10.496  by (asm_full_simp_tac (simpset() addsimps [NSDERIV_DERIV_iff,
  10.497 @@ -1401,7 +1398,7 @@
  10.498  by (res_inst_tac 
  10.499      [("x","%z. if  z = x then l else (f(z) - f(x)) / (z - x)")] exI 1);
  10.500  by (auto_tac (claset(),simpset() addsimps [real_mult_assoc,
  10.501 -    ARITH_PROVE "z \\<noteq> x ==> z - x \\<noteq> (Numeral0::real)"]));
  10.502 +    ARITH_PROVE "z \\<noteq> x ==> z - x \\<noteq> (0::real)"]));
  10.503  by (auto_tac (claset(),simpset() addsimps [isCont_iff,DERIV_iff]));
  10.504  by (ALLGOALS(rtac (LIM_equal RS iffD1)));
  10.505  by (auto_tac (claset(),simpset() addsimps [real_diff_def,real_mult_assoc]));
  10.506 @@ -1466,7 +1463,7 @@
  10.507  by (dtac real_less_sum_gt_zero 1);
  10.508  by (dres_inst_tac [("x","f n + - lim f")] spec 1);
  10.509  by Safe_tac;
  10.510 -by (dres_inst_tac [("P","%na. no\\<le>na --> ?Q na"),("x","no + n")] spec 2);
  10.511 +by (dres_inst_tac [("P","%na. no\\<le>na --> ?Q na"),("x","no + n")] spec 1);
  10.512  by Auto_tac;
  10.513  by (subgoal_tac "lim f \\<le> f(no + n)" 1);
  10.514  by (induct_tac "no" 2);
  10.515 @@ -1511,7 +1508,7 @@
  10.516  Goal "[| \\<forall>n. f(n) \\<le> f(Suc n); \
  10.517  \        \\<forall>n. g(Suc n) \\<le> g(n); \
  10.518  \        \\<forall>n. f(n) \\<le> g(n); \
  10.519 -\        (%n. f(n) - g(n)) ----> Numeral0 |] \
  10.520 +\        (%n. f(n) - g(n)) ----> 0 |] \
  10.521  \     ==> \\<exists>l. ((\\<forall>n. f(n) \\<le> l) & f ----> l) & \
  10.522  \               ((\\<forall>n. l \\<le> g(n)) & g ----> l)";
  10.523  by (dtac lemma_nest 1 THEN Auto_tac);
  10.524 @@ -1546,7 +1543,7 @@
  10.525  
  10.526  Goal "((x::real) = y / (2 * z)) = (2 * x = y/z)";
  10.527  by Auto_tac;  
  10.528 -by (dres_inst_tac [("f","%u. (Numeral1/2)*u")] arg_cong 1); 
  10.529 +by (dres_inst_tac [("f","%u. (1/2)*u")] arg_cong 1); 
  10.530  by Auto_tac;  
  10.531  qed "eq_divide_2_times_iff";
  10.532  
  10.533 @@ -1589,7 +1586,7 @@
  10.534  
  10.535  
  10.536  Goal "[| \\<forall>a b c. P(a,b) & P(b,c) & a \\<le> b & b \\<le> c --> P(a,c); \
  10.537 -\        \\<forall>x. \\<exists>d::real. Numeral0 < d & \
  10.538 +\        \\<forall>x. \\<exists>d::real. 0 < d & \
  10.539  \               (\\<forall>a b. a \\<le> x & x \\<le> b & (b - a) < d --> P(a,b)); \
  10.540  \        a \\<le> b |]  \
  10.541  \     ==> P(a,b)";
  10.542 @@ -1604,8 +1601,8 @@
  10.543  by (rename_tac "l" 1);
  10.544  by (dres_inst_tac [("x","l")] spec 1 THEN Clarify_tac 1);
  10.545  by (rewtac LIMSEQ_def);
  10.546 -by (dres_inst_tac [("P", "%r. Numeral0<r --> ?Q r"), ("x","d/2")] spec 1);
  10.547 -by (dres_inst_tac [("P", "%r. Numeral0<r --> ?Q r"), ("x","d/2")] spec 1);
  10.548 +by (dres_inst_tac [("P", "%r. 0<r --> ?Q r"), ("x","d/2")] spec 1);
  10.549 +by (dres_inst_tac [("P", "%r. 0<r --> ?Q r"), ("x","d/2")] spec 1);
  10.550  by (dtac real_less_half_sum 1);
  10.551  by Safe_tac;
  10.552  (*linear arithmetic bug if we just use Asm_simp_tac*)
  10.553 @@ -1626,7 +1623,7 @@
  10.554  
  10.555  
  10.556  Goal "((\\<forall>a b c. (a \\<le> b & b \\<le> c & P(a,b) & P(b,c)) --> P(a,c)) & \
  10.557 -\      (\\<forall>x. \\<exists>d::real. Numeral0 < d & \
  10.558 +\      (\\<forall>x. \\<exists>d::real. 0 < d & \
  10.559  \               (\\<forall>a b. a \\<le> x & x \\<le> b & (b - a) < d --> P(a,b)))) \
  10.560  \     --> (\\<forall>a b. a \\<le> b --> P(a,b))";
  10.561  by (Clarify_tac 1);
  10.562 @@ -1654,14 +1651,14 @@
  10.563  by (rtac ccontr 1);
  10.564  by (subgoal_tac "a \\<le> x & x \\<le> b" 1);
  10.565  by (Asm_full_simp_tac 2);
  10.566 -by (dres_inst_tac [("P", "%d. Numeral0<d --> ?P d"),("x","Numeral1")] spec 2);
  10.567 +by (dres_inst_tac [("P", "%d. 0<d --> ?P d"),("x","1")] spec 2);
  10.568  by (Step_tac 2);
  10.569  by (Asm_full_simp_tac 2);
  10.570  by (Asm_full_simp_tac 2);
  10.571  by (REPEAT(blast_tac (claset() addIs [order_trans]) 2));
  10.572  by (REPEAT(dres_inst_tac [("x","x")] spec 1));
  10.573  by (Asm_full_simp_tac 1);
  10.574 -by (dres_inst_tac [("P", "%r. ?P r --> (\\<exists>s. Numeral0<s & ?Q r s)"),
  10.575 +by (dres_inst_tac [("P", "%r. ?P r --> (\\<exists>s. 0<s & ?Q r s)"),
  10.576                     ("x","abs(y - f x)")] spec 1);
  10.577  by Safe_tac;
  10.578  by (asm_full_simp_tac (simpset() addsimps []) 1);
  10.579 @@ -1738,15 +1735,15 @@
  10.580  by (cut_inst_tac [("x","xb"),("y","xa")] linorder_linear 1);
  10.581  by (Force_tac 1); 
  10.582  by (case_tac "a \\<le> x & x \\<le> b" 1);
  10.583 -by (res_inst_tac [("x","Numeral1")] exI 2);
  10.584 +by (res_inst_tac [("x","1")] exI 2);
  10.585  by (Force_tac 2); 
  10.586  by (asm_full_simp_tac (simpset() addsimps [LIM_def,isCont_iff]) 1);
  10.587  by (dres_inst_tac [("x","x")] spec 1 THEN Auto_tac);
  10.588  by (thin_tac "\\<forall>M. \\<exists>x. a \\<le> x & x \\<le> b & ~ f x \\<le> M" 1);
  10.589 -by (dres_inst_tac [("x","Numeral1")] spec 1);
  10.590 +by (dres_inst_tac [("x","1")] spec 1);
  10.591  by Auto_tac;  
  10.592  by (res_inst_tac [("x","s")] exI 1 THEN Clarify_tac 1);
  10.593 -by (res_inst_tac [("x","abs(f x) + Numeral1")] exI 1 THEN Clarify_tac 1);
  10.594 +by (res_inst_tac [("x","abs(f x) + 1")] exI 1 THEN Clarify_tac 1);
  10.595  by (dres_inst_tac [("x","xa - x")] spec 1 THEN Safe_tac);
  10.596  by (arith_tac 1);
  10.597  by (arith_tac 1);
  10.598 @@ -1803,23 +1800,23 @@
  10.599      "\\<exists>k. \\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x \\<le> k" 1);
  10.600  by (rtac isCont_bounded 2);
  10.601  by Safe_tac;
  10.602 -by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> Numeral0 < inverse(M - f(x))" 1);
  10.603 +by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> 0 < inverse(M - f(x))" 1);
  10.604  by (Asm_full_simp_tac 1); 
  10.605  by Safe_tac;
  10.606  by (asm_full_simp_tac (simpset() addsimps [real_less_diff_eq]) 2);
  10.607  by (subgoal_tac 
  10.608 -    "\\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x < (k + Numeral1)" 1);
  10.609 +    "\\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x < (k + 1)" 1);
  10.610  by Safe_tac;
  10.611  by (res_inst_tac [("y","k")] order_le_less_trans 2);
  10.612  by (asm_full_simp_tac (simpset() addsimps [real_zero_less_one]) 3);
  10.613  by (Asm_full_simp_tac 2); 
  10.614  by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> \
  10.615 -\                inverse(k + Numeral1) < inverse((%x. inverse(M - (f x))) x)" 1);
  10.616 +\                inverse(k + 1) < inverse((%x. inverse(M - (f x))) x)" 1);
  10.617  by Safe_tac;
  10.618  by (rtac real_inverse_less_swap 2);
  10.619  by (ALLGOALS Asm_full_simp_tac);
  10.620  by (dres_inst_tac [("P", "%N. N<M --> ?Q N"),
  10.621 -                   ("x","M - inverse(k + Numeral1)")] spec 1);
  10.622 +                   ("x","M - inverse(k + 1)")] spec 1);
  10.623  by (Step_tac 1 THEN dtac real_leI 1);
  10.624  by (dtac (real_le_diff_eq RS iffD1) 1);
  10.625  by (REPEAT(dres_inst_tac [("x","a")] spec 1));
  10.626 @@ -1879,11 +1876,11 @@
  10.627  (*----------------------------------------------------------------------------*)
  10.628  
  10.629  Goalw [deriv_def,LIM_def] 
  10.630 -    "[| DERIV f x :> l;  Numeral0 < l |] ==> \
  10.631 -\      \\<exists>d. Numeral0 < d & (\\<forall>h. Numeral0 < h & h < d --> f(x) < f(x + h))";
  10.632 +    "[| DERIV f x :> l;  0 < l |] \
  10.633 +\    ==> \\<exists>d. 0 < d & (\\<forall>h. 0 < h & h < d --> f(x) < f(x + h))";
  10.634  by (dtac spec 1 THEN Auto_tac);
  10.635  by (res_inst_tac [("x","s")] exI 1 THEN Auto_tac);
  10.636 -by (subgoal_tac "Numeral0 < l*h" 1);
  10.637 +by (subgoal_tac "0 < l*h" 1);
  10.638  by (asm_full_simp_tac (simpset() addsimps [real_0_less_mult_iff]) 2); 
  10.639  by (dres_inst_tac [("x","h")] spec 1);
  10.640  by (asm_full_simp_tac
  10.641 @@ -1893,11 +1890,11 @@
  10.642  qed "DERIV_left_inc";
  10.643  
  10.644  Goalw [deriv_def,LIM_def] 
  10.645 -    "[| DERIV f x :> l;  l < Numeral0 |] ==> \
  10.646 -\      \\<exists>d. Numeral0 < d & (\\<forall>h. Numeral0 < h & h < d --> f(x) < f(x - h))";
  10.647 +    "[| DERIV f x :> l;  l < 0 |] ==> \
  10.648 +\      \\<exists>d. 0 < d & (\\<forall>h. 0 < h & h < d --> f(x) < f(x - h))";
  10.649  by (dres_inst_tac [("x","-l")] spec 1 THEN Auto_tac);
  10.650  by (res_inst_tac [("x","s")] exI 1 THEN Auto_tac);
  10.651 -by (subgoal_tac "l*h < Numeral0" 1);
  10.652 +by (subgoal_tac "l*h < 0" 1);
  10.653  by (asm_full_simp_tac (simpset() addsimps [real_mult_less_0_iff]) 2); 
  10.654  by (dres_inst_tac [("x","-h")] spec 1);
  10.655  by (asm_full_simp_tac
  10.656 @@ -1905,7 +1902,7 @@
  10.657                           pos_real_less_divide_eq,
  10.658                           symmetric real_diff_def]
  10.659                 addsplits [split_if_asm]) 1);
  10.660 -by (subgoal_tac "Numeral0 < (f (x - h) - f x)/h" 1);
  10.661 +by (subgoal_tac "0 < (f (x - h) - f x)/h" 1);
  10.662  by (arith_tac 2);
  10.663  by (asm_full_simp_tac
  10.664      (simpset() addsimps [pos_real_less_divide_eq]) 1); 
  10.665 @@ -1913,9 +1910,9 @@
  10.666  
  10.667  
  10.668  Goal "[| DERIV f x :> l; \
  10.669 -\        \\<exists>d. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)) |] \
  10.670 -\     ==> l = Numeral0";
  10.671 -by (res_inst_tac [("R1.0","l"),("R2.0","Numeral0")] real_linear_less2 1);
  10.672 +\        \\<exists>d. 0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)) |] \
  10.673 +\     ==> l = 0";
  10.674 +by (res_inst_tac [("R1.0","l"),("R2.0","0")] real_linear_less2 1);
  10.675  by Safe_tac;
  10.676  by (dtac DERIV_left_dec 1);
  10.677  by (dtac DERIV_left_inc 3);
  10.678 @@ -1933,8 +1930,8 @@
  10.679  (*----------------------------------------------------------------------------*)
  10.680  
  10.681  Goal "[| DERIV f x :> l; \
  10.682 -\        \\<exists>d::real. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(x) \\<le> f(y)) |] \
  10.683 -\     ==> l = Numeral0";
  10.684 +\        \\<exists>d::real. 0 < d & (\\<forall>y. abs(x - y) < d --> f(x) \\<le> f(y)) |] \
  10.685 +\     ==> l = 0";
  10.686  by (dtac (DERIV_minus RS DERIV_local_max) 1); 
  10.687  by Auto_tac;  
  10.688  qed "DERIV_local_min";
  10.689 @@ -1944,8 +1941,8 @@
  10.690  (*----------------------------------------------------------------------------*)
  10.691  
  10.692  Goal "[| DERIV f x :> l; \
  10.693 -\        \\<exists>d. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(x) = f(y)) |] \
  10.694 -\     ==> l = Numeral0";
  10.695 +\        \\<exists>d. 0 < d & (\\<forall>y. abs(x - y) < d --> f(x) = f(y)) |] \
  10.696 +\     ==> l = 0";
  10.697  by (auto_tac (claset() addSDs [DERIV_local_max],simpset()));
  10.698  qed "DERIV_local_const";
  10.699  
  10.700 @@ -1954,7 +1951,7 @@
  10.701  (*----------------------------------------------------------------------------*)
  10.702  
  10.703  Goal "[| a < x;  x < b |] ==> \
  10.704 -\       \\<exists>d::real. Numeral0 < d &  (\\<forall>y. abs(x - y) < d --> a < y & y < b)";
  10.705 +\       \\<exists>d::real. 0 < d &  (\\<forall>y. abs(x - y) < d --> a < y & y < b)";
  10.706  by (simp_tac (simpset() addsimps [abs_interval_iff]) 1);
  10.707  by (cut_inst_tac [("x","x - a"),("y","b - x")] linorder_linear 1);
  10.708  by Safe_tac;
  10.709 @@ -1965,7 +1962,7 @@
  10.710  qed "lemma_interval_lt";
  10.711  
  10.712  Goal "[| a < x;  x < b |] ==> \
  10.713 -\       \\<exists>d::real. Numeral0 < d &  (\\<forall>y. abs(x - y) < d --> a \\<le> y & y \\<le> b)";
  10.714 +\       \\<exists>d::real. 0 < d &  (\\<forall>y. abs(x - y) < d --> a \\<le> y & y \\<le> b)";
  10.715  by (dtac lemma_interval_lt 1);
  10.716  by Auto_tac;
  10.717  by (auto_tac (claset() addSIs [exI] ,simpset()));
  10.718 @@ -1975,13 +1972,13 @@
  10.719              Rolle's Theorem
  10.720     If f is defined and continuous on the finite closed interval [a,b]
  10.721     and differentiable a least on the open interval (a,b), and f(a) = f(b),
  10.722 -   then x0 \\<in> (a,b) such that f'(x0) = Numeral0
  10.723 +   then x0 \\<in> (a,b) such that f'(x0) = 0
  10.724   ----------------------------------------------------------------------*)
  10.725  
  10.726  Goal "[| a < b; f(a) = f(b); \
  10.727  \        \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
  10.728  \        \\<forall>x. a < x & x < b --> f differentiable x \
  10.729 -\     |] ==> \\<exists>z. a < z & z < b & DERIV f z :> Numeral0";
  10.730 +\     |] ==> \\<exists>z. a < z & z < b & DERIV f z :> 0";
  10.731  by (ftac (order_less_imp_le RS isCont_eq_Ub) 1);
  10.732  by (EVERY1[assume_tac,Step_tac]);
  10.733  by (ftac (order_less_imp_le RS isCont_eq_Lb) 1);
  10.734 @@ -1992,7 +1989,7 @@
  10.735  by (EVERY1[assume_tac,etac exE]);
  10.736  by (res_inst_tac [("x","x")] exI 1 THEN Asm_full_simp_tac 1);
  10.737  by (subgoal_tac "(\\<exists>l. DERIV f x :> l) & \
  10.738 -\        (\\<exists>d. Numeral0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)))" 1);
  10.739 +\        (\\<exists>d. 0 < d & (\\<forall>y. abs(x - y) < d --> f(y) \\<le> f(x)))" 1);
  10.740  by (Clarify_tac 1 THEN rtac conjI 2);
  10.741  by (blast_tac (claset() addIs [differentiableD]) 2);
  10.742  by (Blast_tac 2);
  10.743 @@ -2004,7 +2001,7 @@
  10.744  by (EVERY1[assume_tac,etac exE]);
  10.745  by (res_inst_tac [("x","xa")] exI 1 THEN Asm_full_simp_tac 1);
  10.746  by (subgoal_tac "(\\<exists>l. DERIV f xa :> l) & \
  10.747 -\        (\\<exists>d. Numeral0 < d & (\\<forall>y. abs(xa - y) < d --> f(xa) \\<le> f(y)))" 1);
  10.748 +\        (\\<exists>d. 0 < d & (\\<forall>y. abs(xa - y) < d --> f(xa) \\<le> f(y)))" 1);
  10.749  by (Clarify_tac 1 THEN rtac conjI 2);
  10.750  by (blast_tac (claset() addIs [differentiableD]) 2);
  10.751  by (Blast_tac 2);
  10.752 @@ -2030,7 +2027,7 @@
  10.753  by (forw_inst_tac [("a","a"),("x","r")] lemma_interval 1);
  10.754  by (EVERY1[assume_tac, etac exE]);
  10.755  by (subgoal_tac "(\\<exists>l. DERIV f r :> l) & \
  10.756 -\        (\\<exists>d. Numeral0 < d & (\\<forall>y. abs(r - y) < d --> f(r) = f(y)))" 1);
  10.757 +\        (\\<exists>d. 0 < d & (\\<forall>y. abs(r - y) < d --> f(r) = f(y)))" 1);
  10.758  by (Clarify_tac 1 THEN rtac conjI 2);
  10.759  by (blast_tac (claset() addIs [differentiableD]) 2);
  10.760  by (EVERY1[ftac DERIV_local_const, Blast_tac, Blast_tac]);
  10.761 @@ -2098,7 +2095,7 @@
  10.762  
  10.763  Goal "[| a < b; \
  10.764  \        \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
  10.765 -\        \\<forall>x. a < x & x < b --> DERIV f x :> Numeral0 |] \
  10.766 +\        \\<forall>x. a < x & x < b --> DERIV f x :> 0 |] \
  10.767  \       ==> (f b = f a)";
  10.768  by (dtac MVT 1 THEN assume_tac 1);
  10.769  by (blast_tac (claset() addIs [differentiableI]) 1);
  10.770 @@ -2108,7 +2105,7 @@
  10.771  
  10.772  Goal "[| a < b; \
  10.773  \        \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
  10.774 -\        \\<forall>x. a < x & x < b --> DERIV f x :> Numeral0 |] \
  10.775 +\        \\<forall>x. a < x & x < b --> DERIV f x :> 0 |] \
  10.776  \       ==> \\<forall>x. a \\<le> x & x \\<le> b --> f x = f a";
  10.777  by Safe_tac;
  10.778  by (dres_inst_tac [("x","a")] order_le_imp_less_or_eq 1);
  10.779 @@ -2119,13 +2116,13 @@
  10.780  
  10.781  Goal "[| a < b; \
  10.782  \        \\<forall>x. a \\<le> x & x \\<le> b --> isCont f x; \
  10.783 -\        \\<forall>x. a < x & x < b --> DERIV f x :> Numeral0; \
  10.784 +\        \\<forall>x. a < x & x < b --> DERIV f x :> 0; \
  10.785  \        a \\<le> x; x \\<le> b |] \
  10.786  \       ==> f x = f a";
  10.787  by (blast_tac (claset() addDs [DERIV_isconst1]) 1);
  10.788  qed "DERIV_isconst2";
  10.789  
  10.790 -Goal "\\<forall>x. DERIV f x :> Numeral0 ==> f(x) = f(y)";
  10.791 +Goal "\\<forall>x. DERIV f x :> 0 ==> f(x) = f(y)";
  10.792  by (res_inst_tac [("R1.0","x"),("R2.0","y")] real_linear_less2 1);
  10.793  by (rtac sym 1);
  10.794  by (auto_tac (claset() addIs [DERIV_isCont,DERIV_isconst_end],simpset()));
  10.795 @@ -2182,7 +2179,7 @@
  10.796  (* maximum at an end point, not in the middle.                              *)
  10.797  (* ------------------------------------------------------------------------ *)
  10.798  
  10.799 -Goal "[|Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  10.800 +Goal "[|0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  10.801  \       \\<forall>z. abs(z - x) \\<le> d --> isCont f z |]  \
  10.802  \     ==> ~(\\<forall>z. abs(z - x) \\<le> d --> f(z) \\<le> f(x))";
  10.803  by (rtac notI 1);
  10.804 @@ -2221,7 +2218,7 @@
  10.805  (* Similar version for lower bound                                          *)
  10.806  (* ------------------------------------------------------------------------ *)
  10.807  
  10.808 -Goal "[|Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  10.809 +Goal "[|0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  10.810  \       \\<forall>z. abs(z - x) \\<le> d --> isCont f z |]  \
  10.811  \     ==> ~(\\<forall>z. abs(z - x) \\<le> d --> f(x) \\<le> f(z))";
  10.812  by (auto_tac (claset() addSDs [(asm_full_simplify (simpset()) 
  10.813 @@ -2234,14 +2231,12 @@
  10.814  (* Also from John's theory                                                  *)
  10.815  (* ------------------------------------------------------------------------ *)
  10.816  
  10.817 -Addsimps [zero_eq_numeral_0,one_eq_numeral_1];
  10.818 -
  10.819 -val lemma_le = ARITH_PROVE "Numeral0 \\<le> (d::real) ==> -d \\<le> d";
  10.820 +val lemma_le = ARITH_PROVE "0 \\<le> (d::real) ==> -d \\<le> d";
  10.821  
  10.822  (* FIXME: awful proof - needs improvement *)
  10.823 -Goal "[| Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  10.824 +Goal "[| 0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f z) = z; \
  10.825  \        \\<forall>z. abs(z - x) \\<le> d --> isCont f z |] \
  10.826 -\      ==> \\<exists>e. Numeral0 < e & \
  10.827 +\      ==> \\<exists>e. 0 < e & \
  10.828  \                 (\\<forall>y. \
  10.829  \                     abs(y - f(x)) \\<le> e --> \
  10.830  \                     (\\<exists>z. abs(z - x) \\<le> d & (f z = y)))";
  10.831 @@ -2255,10 +2250,10 @@
  10.832  by (Asm_full_simp_tac 2);
  10.833  by (subgoal_tac "L < f x & f x < M" 1);
  10.834  by Safe_tac;
  10.835 -by (dres_inst_tac [("x","L")] (ARITH_PROVE "x < y ==> Numeral0 < y - (x::real)") 1);
  10.836 -by (dres_inst_tac [("x","f x")] (ARITH_PROVE "x < y ==> Numeral0 < y - (x::real)") 1);
  10.837 +by (dres_inst_tac [("x","L")] (ARITH_PROVE "x < y ==> 0 < y - (x::real)") 1);
  10.838 +by (dres_inst_tac [("x","f x")] (ARITH_PROVE "x < y ==> 0 < y - (x::real)") 1);
  10.839  by (dres_inst_tac [("d1.0","f x - L"),("d2.0","M - f x")] 
  10.840 -    (rename_numerals real_lbound_gt_zero) 1);
  10.841 +    (real_lbound_gt_zero) 1);
  10.842  by Safe_tac;
  10.843  by (res_inst_tac [("x","e")] exI 1);
  10.844  by Safe_tac;
  10.845 @@ -2284,12 +2279,12 @@
  10.846  (* Continuity of inverse function                                           *)
  10.847  (* ------------------------------------------------------------------------ *)
  10.848  
  10.849 -Goal "[| Numeral0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f(z)) = z; \
  10.850 +Goal "[| 0 < d; \\<forall>z. abs(z - x) \\<le> d --> g(f(z)) = z; \
  10.851  \        \\<forall>z. abs(z - x) \\<le> d --> isCont f z |] \
  10.852  \     ==> isCont g (f x)";
  10.853  by (simp_tac (simpset() addsimps [isCont_iff,LIM_def]) 1);
  10.854  by Safe_tac;
  10.855 -by (dres_inst_tac [("d1.0","r")] (rename_numerals real_lbound_gt_zero) 1);
  10.856 +by (dres_inst_tac [("d1.0","r")] (real_lbound_gt_zero) 1);
  10.857  by (assume_tac 1 THEN Step_tac 1);
  10.858  by (subgoal_tac "\\<forall>z. abs(z - x) \\<le> e --> (g(f z) = z)" 1);
  10.859  by (Force_tac 2);
    11.1 --- a/src/HOL/Hyperreal/Lim.thy	Thu Nov 01 21:12:13 2001 +0100
    11.2 +++ b/src/HOL/Hyperreal/Lim.thy	Fri Nov 02 17:55:24 2001 +0100
    11.3 @@ -15,8 +15,8 @@
    11.4    LIM :: [real=>real,real,real] => bool
    11.5  				("((_)/ -- (_)/ --> (_))" [60, 0, 60] 60)
    11.6    "f -- a --> L ==
    11.7 -     ALL r. Numeral0 < r --> 
    11.8 -	     (EX s. Numeral0 < s & (ALL x. (x ~= a & (abs(x + -a) < s)
    11.9 +     ALL r. 0 < r --> 
   11.10 +	     (EX s. 0 < s & (ALL x. (x ~= a & (abs(x + -a) < s)
   11.11  			  --> abs(f x + -L) < r)))"
   11.12  
   11.13    NSLIM :: [real=>real,real,real] => bool
   11.14 @@ -36,7 +36,7 @@
   11.15    (* differentiation: D is derivative of function f at x *)
   11.16    deriv:: [real=>real,real,real] => bool
   11.17  			    ("(DERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
   11.18 -  "DERIV f x :> D == ((%h. (f(x + h) + -f(x))/h) -- Numeral0 --> D)"
   11.19 +  "DERIV f x :> D == ((%h. (f(x + h) + -f(x))/h) -- 0 --> D)"
   11.20  
   11.21    nsderiv :: [real=>real,real,real] => bool
   11.22  			    ("(NSDERIV (_)/ (_)/ :> (_))" [60, 0, 60] 60)
   11.23 @@ -55,8 +55,8 @@
   11.24  		       inc = (*f* f)(hypreal_of_real x + h) + -hypreal_of_real (f x))"
   11.25  
   11.26    isUCont :: (real=>real) => bool
   11.27 -  "isUCont f ==  (ALL r. Numeral0 < r --> 
   11.28 -		      (EX s. Numeral0 < s & (ALL x y. abs(x + -y) < s
   11.29 +  "isUCont f ==  (ALL r. 0 < r --> 
   11.30 +		      (EX s. 0 < s & (ALL x y. abs(x + -y) < s
   11.31  			    --> abs(f x + -f y) < r)))"
   11.32  
   11.33    isNSUCont :: (real=>real) => bool
    12.1 --- a/src/HOL/Hyperreal/NSA.ML	Thu Nov 01 21:12:13 2001 +0100
    12.2 +++ b/src/HOL/Hyperreal/NSA.ML	Fri Nov 02 17:55:24 2001 +0100
    12.3 @@ -69,6 +69,20 @@
    12.4  qed "SReal_number_of";
    12.5  Addsimps [SReal_number_of];
    12.6  
    12.7 +(** As always with numerals, 0 and 1 are special cases **)
    12.8 +
    12.9 +Goal "(0::hypreal) : Reals";
   12.10 +by (stac (hypreal_numeral_0_eq_0 RS sym) 1);
   12.11 +by (rtac SReal_number_of 1); 
   12.12 +qed "Reals_0";
   12.13 +Addsimps [Reals_0];
   12.14 +
   12.15 +Goal "(1::hypreal) : Reals";
   12.16 +by (stac (hypreal_numeral_1_eq_1 RS sym) 1);
   12.17 +by (rtac SReal_number_of 1); 
   12.18 +qed "Reals_1";
   12.19 +Addsimps [Reals_1];
   12.20 +
   12.21  Goalw [hypreal_divide_def] "r : Reals ==> r/(number_of w::hypreal) : Reals";
   12.22  by (blast_tac (claset() addSIs [SReal_number_of, SReal_mult, 
   12.23                                  SReal_inverse]) 1);
   12.24 @@ -211,9 +225,9 @@
   12.25  
   12.26  Goalw [SReal_def,HFinite_def] "Reals <= HFinite";
   12.27  by Auto_tac;
   12.28 -by (res_inst_tac [("x","Numeral1 + abs(hypreal_of_real r)")] exI 1);
   12.29 +by (res_inst_tac [("x","1 + abs(hypreal_of_real r)")] exI 1);
   12.30  by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_hrabs]));
   12.31 -by (res_inst_tac [("x","Numeral1 + abs r")] exI 1);
   12.32 +by (res_inst_tac [("x","1 + abs r")] exI 1);
   12.33  by (Simp_tac 1);
   12.34  qed "SReal_subset_HFinite";
   12.35  
   12.36 @@ -238,8 +252,22 @@
   12.37  qed "HFinite_number_of";
   12.38  Addsimps [HFinite_number_of];
   12.39  
   12.40 -Goal "[|x : HFinite; y <= x; Numeral0 <= y |] ==> y: HFinite";
   12.41 -by (case_tac "x <= Numeral0" 1);
   12.42 +(** As always with numerals, 0 and 1 are special cases **)
   12.43 +
   12.44 +Goal "0 : HFinite";
   12.45 +by (stac (hypreal_numeral_0_eq_0 RS sym) 1);
   12.46 +by (rtac HFinite_number_of 1); 
   12.47 +qed "HFinite_0";
   12.48 +Addsimps [HFinite_0];
   12.49 +
   12.50 +Goal "1 : HFinite";
   12.51 +by (stac (hypreal_numeral_1_eq_1 RS sym) 1);
   12.52 +by (rtac HFinite_number_of 1); 
   12.53 +qed "HFinite_1";
   12.54 +Addsimps [HFinite_1];
   12.55 +
   12.56 +Goal "[|x : HFinite; y <= x; 0 <= y |] ==> y: HFinite";
   12.57 +by (case_tac "x <= 0" 1);
   12.58  by (dres_inst_tac [("y","x")] order_trans 1);
   12.59  by (dtac hypreal_le_anti_sym 2);
   12.60  by (auto_tac (claset() addSDs [not_hypreal_leE], simpset()));
   12.61 @@ -251,11 +279,11 @@
   12.62         Set of infinitesimals is a subring of the hyperreals   
   12.63   ------------------------------------------------------------------*)
   12.64  Goalw [Infinitesimal_def]
   12.65 -      "x : Infinitesimal ==> ALL r: Reals. Numeral0 < r --> abs x < r";
   12.66 +      "x : Infinitesimal ==> ALL r: Reals. 0 < r --> abs x < r";
   12.67  by Auto_tac;
   12.68  qed "InfinitesimalD";
   12.69  
   12.70 -Goalw [Infinitesimal_def] "Numeral0 : Infinitesimal";
   12.71 +Goalw [Infinitesimal_def] "0 : Infinitesimal";
   12.72  by (simp_tac (simpset() addsimps [hrabs_zero]) 1);
   12.73  qed "Infinitesimal_zero";
   12.74  AddIffs [Infinitesimal_zero];
   12.75 @@ -264,7 +292,7 @@
   12.76  by Auto_tac;  
   12.77  qed "hypreal_sum_of_halves";
   12.78  
   12.79 -Goal "Numeral0 < r ==> Numeral0 < r/(2::hypreal)";
   12.80 +Goal "0 < r ==> 0 < r/(2::hypreal)";
   12.81  by Auto_tac;  
   12.82  qed "hypreal_half_gt_zero";
   12.83  
   12.84 @@ -290,10 +318,10 @@
   12.85  Goalw [Infinitesimal_def] 
   12.86       "[| x : Infinitesimal; y : Infinitesimal |] ==> (x * y) : Infinitesimal";
   12.87  by Auto_tac;
   12.88 -by (case_tac "y=Numeral0" 1);
   12.89 -by (cut_inst_tac [("u","abs x"),("v","Numeral1"),("x","abs y"),("y","r")] 
   12.90 +by (case_tac "y=0" 1);
   12.91 +by (cut_inst_tac [("u","abs x"),("v","1"),("x","abs y"),("y","r")] 
   12.92      hypreal_mult_less_mono 2);
   12.93 -by Auto_tac;  
   12.94 +by Auto_tac;
   12.95  qed "Infinitesimal_mult";
   12.96  
   12.97  Goal "[| x : Infinitesimal; y : HFinite |] ==> (x * y) : Infinitesimal";
   12.98 @@ -332,27 +360,27 @@
   12.99  
  12.100  Goalw [HInfinite_def] "[|x: HInfinite;y: HInfinite|] ==> (x*y): HInfinite";
  12.101  by Auto_tac;
  12.102 -by (eres_inst_tac [("x","Numeral1")] ballE 1);
  12.103 +by (eres_inst_tac [("x","1")] ballE 1);
  12.104  by (eres_inst_tac [("x","r")] ballE 1);
  12.105  by (case_tac "y=0" 1); 
  12.106 -by (cut_inst_tac [("x","Numeral1"),("y","abs x"),
  12.107 +by (cut_inst_tac [("x","1"),("y","abs x"),
  12.108                    ("u","r"),("v","abs y")] hypreal_mult_less_mono 2);
  12.109  by (auto_tac (claset(), simpset() addsimps hypreal_mult_ac));  
  12.110  qed "HInfinite_mult";
  12.111  
  12.112  Goalw [HInfinite_def] 
  12.113 -      "[|x: HInfinite; Numeral0 <= y; Numeral0 <= x|] ==> (x + y): HInfinite";
  12.114 +      "[|x: HInfinite; 0 <= y; 0 <= x|] ==> (x + y): HInfinite";
  12.115  by (auto_tac (claset() addSIs [hypreal_add_zero_less_le_mono],
  12.116                simpset() addsimps [hrabs_eqI1, hypreal_add_commute,
  12.117                                    hypreal_le_add_order]));
  12.118  qed "HInfinite_add_ge_zero";
  12.119  
  12.120 -Goal "[|x: HInfinite; Numeral0 <= y; Numeral0 <= x|] ==> (y + x): HInfinite";
  12.121 +Goal "[|x: HInfinite; 0 <= y; 0 <= x|] ==> (y + x): HInfinite";
  12.122  by (auto_tac (claset() addSIs [HInfinite_add_ge_zero],
  12.123                simpset() addsimps [hypreal_add_commute]));
  12.124  qed "HInfinite_add_ge_zero2";
  12.125  
  12.126 -Goal "[|x: HInfinite; Numeral0 < y; Numeral0 < x|] ==> (x + y): HInfinite";
  12.127 +Goal "[|x: HInfinite; 0 < y; 0 < x|] ==> (x + y): HInfinite";
  12.128  by (blast_tac (claset() addIs [HInfinite_add_ge_zero,
  12.129                      order_less_imp_le]) 1);
  12.130  qed "HInfinite_add_gt_zero";
  12.131 @@ -361,14 +389,14 @@
  12.132  by Auto_tac;
  12.133  qed "HInfinite_minus_iff";
  12.134  
  12.135 -Goal "[|x: HInfinite; y <= Numeral0; x <= Numeral0|] ==> (x + y): HInfinite";
  12.136 +Goal "[|x: HInfinite; y <= 0; x <= 0|] ==> (x + y): HInfinite";
  12.137  by (dtac (HInfinite_minus_iff RS iffD2) 1);
  12.138  by (rtac (HInfinite_minus_iff RS iffD1) 1);
  12.139  by (auto_tac (claset() addIs [HInfinite_add_ge_zero],
  12.140                simpset() addsimps [hypreal_minus_zero_le_iff]));
  12.141  qed "HInfinite_add_le_zero";
  12.142  
  12.143 -Goal "[|x: HInfinite; y < Numeral0; x < Numeral0|] ==> (x + y): HInfinite";
  12.144 +Goal "[|x: HInfinite; y < 0; x < 0|] ==> (x + y): HInfinite";
  12.145  by (blast_tac (claset() addIs [HInfinite_add_le_zero,
  12.146                                 order_less_imp_le]) 1);
  12.147  qed "HInfinite_add_lt_zero";
  12.148 @@ -378,11 +406,11 @@
  12.149  by (auto_tac (claset() addIs [HFinite_mult,HFinite_add], simpset()));
  12.150  qed "HFinite_sum_squares";
  12.151  
  12.152 -Goal "x ~: Infinitesimal ==> x ~= Numeral0";
  12.153 +Goal "x ~: Infinitesimal ==> x ~= 0";
  12.154  by Auto_tac;
  12.155  qed "not_Infinitesimal_not_zero";
  12.156  
  12.157 -Goal "x: HFinite - Infinitesimal ==> x ~= Numeral0";
  12.158 +Goal "x: HFinite - Infinitesimal ==> x ~= 0";
  12.159  by Auto_tac;
  12.160  qed "not_Infinitesimal_not_zero2";
  12.161  
  12.162 @@ -441,7 +469,7 @@
  12.163  by (fast_tac (claset() addDs [not_Infinitesimal_mult]) 1);
  12.164  qed "Infinitesimal_mult_disj";
  12.165  
  12.166 -Goal "x: HFinite-Infinitesimal ==> x ~= Numeral0";
  12.167 +Goal "x: HFinite-Infinitesimal ==> x ~= 0";
  12.168  by (Blast_tac 1);
  12.169  qed "HFinite_Infinitesimal_not_zero";
  12.170  
  12.171 @@ -455,7 +483,7 @@
  12.172  Goalw [Infinitesimal_def,HFinite_def]  
  12.173        "Infinitesimal <= HFinite";
  12.174  by Auto_tac;  
  12.175 -by (res_inst_tac [("x","Numeral1")] bexI 1); 
  12.176 +by (res_inst_tac [("x","1")] bexI 1); 
  12.177  by Auto_tac;  
  12.178  qed "Infinitesimal_subset_HFinite";
  12.179  
  12.180 @@ -474,15 +502,15 @@
  12.181   ----------------------------------------------------------------------*)
  12.182  
  12.183  Goalw [Infinitesimal_def,approx_def] 
  12.184 -        "(x:Infinitesimal) = (x @= Numeral0)";
  12.185 +        "(x:Infinitesimal) = (x @= 0)";
  12.186  by (Simp_tac 1);
  12.187  qed "mem_infmal_iff";
  12.188  
  12.189 -Goalw [approx_def]" (x @= y) = (x + -y @= Numeral0)";
  12.190 +Goalw [approx_def]" (x @= y) = (x + -y @= 0)";
  12.191  by (Simp_tac 1);
  12.192  qed "approx_minus_iff";
  12.193  
  12.194 -Goalw [approx_def]" (x @= y) = (-y + x @= Numeral0)";
  12.195 +Goalw [approx_def]" (x @= y) = (-y + x @= 0)";
  12.196  by (simp_tac (simpset() addsimps [hypreal_add_commute]) 1);
  12.197  qed "approx_minus_iff2";
  12.198  
  12.199 @@ -510,10 +538,48 @@
  12.200  by (blast_tac (claset() addIs [approx_sym, approx_trans]) 1); 
  12.201  qed "approx_trans3";
  12.202  
  12.203 -Goal "(number_of w @= x) = (x @= number_of w)";
  12.204 +Goal "(number_of w @= x) = (x @= number_of w)"; 
  12.205  by (blast_tac (claset() addIs [approx_sym]) 1); 
  12.206  qed "number_of_approx_reorient";
  12.207 -Addsimps [number_of_approx_reorient];
  12.208 +
  12.209 +Goal "(0 @= x) = (x @= 0)"; 
  12.210 +by (blast_tac (claset() addIs [approx_sym]) 1); 
  12.211 +qed "zero_approx_reorient";
  12.212 +
  12.213 +Goal "(1 @= x) = (x @= 1)"; 
  12.214 +by (blast_tac (claset() addIs [approx_sym]) 1); 
  12.215 +qed "one_approx_reorient";
  12.216 +
  12.217 +
  12.218 +(*** re-orientation, following HOL/Integ/Bin.ML 
  12.219 +     We re-orient x @=y where x is 0, 1 or a numeral, unless y is as well!
  12.220 + ***)
  12.221 +
  12.222 +(*reorientation simprules using ==, for the following simproc*)
  12.223 +val meta_zero_approx_reorient = zero_approx_reorient RS eq_reflection;
  12.224 +val meta_one_approx_reorient = one_approx_reorient RS eq_reflection;
  12.225 +val meta_number_of_approx_reorient = number_of_approx_reorient RS eq_reflection;
  12.226 +
  12.227 +(*reorientation simplification procedure: reorients (polymorphic) 
  12.228 +  0 = x, 1 = x, nnn = x provided x isn't 0, 1 or a numeral.*)
  12.229 +fun reorient_proc sg _ (_ $ t $ u) =
  12.230 +  case u of
  12.231 +      Const("0", _) => None
  12.232 +    | Const("1", _) => None
  12.233 +    | Const("Numeral.number_of", _) $ _ => None
  12.234 +    | _ => Some (case t of
  12.235 +		Const("0", _) => meta_zero_approx_reorient
  12.236 +	      | Const("1", _) => meta_one_approx_reorient
  12.237 +	      | Const("Numeral.number_of", _) $ _ => 
  12.238 +                                 meta_number_of_approx_reorient);
  12.239 +
  12.240 +val approx_reorient_simproc = 
  12.241 +    Bin_Simprocs.prep_simproc ("reorient_simproc",
  12.242 +		  Bin_Simprocs.prep_pats ["0@=x", "1@=x", "number_of w @= x"], 
  12.243 +		  reorient_proc);
  12.244 +
  12.245 +Addsimprocs [approx_reorient_simproc];
  12.246 +
  12.247  
  12.248  Goal "(x-y : Infinitesimal) = (x @= y)";
  12.249  by (auto_tac (claset(),
  12.250 @@ -704,36 +770,36 @@
  12.251              approx_hypreal_of_real_HFinite,HFinite_hypreal_of_real]) 1);
  12.252  qed "approx_mult_hypreal_of_real";
  12.253  
  12.254 -Goal "[| a: Reals; a ~= Numeral0; a*x @= Numeral0 |] ==> x @= Numeral0";
  12.255 +Goal "[| a: Reals; a ~= 0; a*x @= 0 |] ==> x @= 0";
  12.256  by (dtac (SReal_inverse RS (SReal_subset_HFinite RS subsetD)) 1);
  12.257  by (auto_tac (claset() addDs [approx_mult2],
  12.258      simpset() addsimps [hypreal_mult_assoc RS sym]));
  12.259  qed "approx_SReal_mult_cancel_zero";
  12.260  
  12.261  (* REM comments: newly added *)
  12.262 -Goal "[| a: Reals; x @= Numeral0 |] ==> x*a @= Numeral0";
  12.263 +Goal "[| a: Reals; x @= 0 |] ==> x*a @= 0";
  12.264  by (auto_tac (claset() addDs [(SReal_subset_HFinite RS subsetD),
  12.265                approx_mult1], simpset()));
  12.266  qed "approx_mult_SReal1";
  12.267  
  12.268 -Goal "[| a: Reals; x @= Numeral0 |] ==> a*x @= Numeral0";
  12.269 +Goal "[| a: Reals; x @= 0 |] ==> a*x @= 0";
  12.270  by (auto_tac (claset() addDs [(SReal_subset_HFinite RS subsetD),
  12.271                approx_mult2], simpset()));
  12.272  qed "approx_mult_SReal2";
  12.273  
  12.274 -Goal "[|a : Reals; a ~= Numeral0 |] ==> (a*x @= Numeral0) = (x @= Numeral0)";
  12.275 +Goal "[|a : Reals; a ~= 0 |] ==> (a*x @= 0) = (x @= 0)";
  12.276  by (blast_tac (claset() addIs [approx_SReal_mult_cancel_zero,
  12.277      approx_mult_SReal2]) 1);
  12.278  qed "approx_mult_SReal_zero_cancel_iff";
  12.279  Addsimps [approx_mult_SReal_zero_cancel_iff];
  12.280  
  12.281 -Goal "[| a: Reals; a ~= Numeral0; a* w @= a*z |] ==> w @= z";
  12.282 +Goal "[| a: Reals; a ~= 0; a* w @= a*z |] ==> w @= z";
  12.283  by (dtac (SReal_inverse RS (SReal_subset_HFinite RS subsetD)) 1);
  12.284  by (auto_tac (claset() addDs [approx_mult2],
  12.285      simpset() addsimps [hypreal_mult_assoc RS sym]));
  12.286  qed "approx_SReal_mult_cancel";
  12.287  
  12.288 -Goal "[| a: Reals; a ~= Numeral0|] ==> (a* w @= a*z) = (w @= z)";
  12.289 +Goal "[| a: Reals; a ~= 0|] ==> (a* w @= a*z) = (w @= z)";
  12.290  by (auto_tac (claset() addSIs [approx_mult2,SReal_subset_HFinite RS subsetD] 
  12.291      addIs [approx_SReal_mult_cancel], simpset()));
  12.292  qed "approx_SReal_mult_cancel_iff1";
  12.293 @@ -754,63 +820,71 @@
  12.294   -----------------------------------------------------------------*)
  12.295  
  12.296  Goalw [Infinitesimal_def] 
  12.297 -     "[| x: Reals; y: Infinitesimal; Numeral0 < x |] ==> y < x";
  12.298 +     "[| x: Reals; y: Infinitesimal; 0 < x |] ==> y < x";
  12.299  by (rtac (hrabs_ge_self RS order_le_less_trans) 1);
  12.300  by Auto_tac;  
  12.301  qed "Infinitesimal_less_SReal";
  12.302  
  12.303 -Goal "y: Infinitesimal ==> ALL r: Reals. Numeral0 < r --> y < r";
  12.304 +Goal "y: Infinitesimal ==> ALL r: Reals. 0 < r --> y < r";
  12.305  by (blast_tac (claset() addIs [Infinitesimal_less_SReal]) 1);
  12.306  qed "Infinitesimal_less_SReal2";
  12.307  
  12.308  Goalw [Infinitesimal_def] 
  12.309 -     "[| Numeral0 < y;  y: Reals|] ==> y ~: Infinitesimal";
  12.310 +     "[| 0 < y;  y: Reals|] ==> y ~: Infinitesimal";
  12.311  by (auto_tac (claset(), simpset() addsimps [hrabs_def]));
  12.312  qed "SReal_not_Infinitesimal";
  12.313  
  12.314 -Goal "[| y < Numeral0;  y : Reals |] ==> y ~: Infinitesimal";
  12.315 +Goal "[| y < 0;  y : Reals |] ==> y ~: Infinitesimal";
  12.316  by (stac (Infinitesimal_minus_iff RS sym) 1); 
  12.317  by (rtac SReal_not_Infinitesimal 1); 
  12.318  by Auto_tac;  
  12.319  qed "SReal_minus_not_Infinitesimal";
  12.320  
  12.321 -Goal "Reals Int Infinitesimal = {Numeral0}";
  12.322 +Goal "Reals Int Infinitesimal = {0}";
  12.323  by Auto_tac;
  12.324 -by (cut_inst_tac [("x","x"),("y","Numeral0")] hypreal_linear 1);
  12.325 +by (cut_inst_tac [("x","x"),("y","0")] hypreal_linear 1);
  12.326  by (blast_tac (claset() addDs [SReal_not_Infinitesimal,
  12.327                                 SReal_minus_not_Infinitesimal]) 1);
  12.328  qed "SReal_Int_Infinitesimal_zero";
  12.329  
  12.330 -Goal "[| x: Reals; x: Infinitesimal|] ==> x = Numeral0";
  12.331 +Goal "[| x: Reals; x: Infinitesimal|] ==> x = 0";
  12.332  by (cut_facts_tac [SReal_Int_Infinitesimal_zero] 1);
  12.333  by (Blast_tac 1);
  12.334  qed "SReal_Infinitesimal_zero";
  12.335  
  12.336 -Goal "[| x : Reals; x ~= Numeral0 |] ==> x : HFinite - Infinitesimal";
  12.337 +Goal "[| x : Reals; x ~= 0 |] ==> x : HFinite - Infinitesimal";
  12.338  by (auto_tac (claset() addDs [SReal_Infinitesimal_zero,
  12.339                                SReal_subset_HFinite RS subsetD], 
  12.340                simpset()));
  12.341  qed "SReal_HFinite_diff_Infinitesimal";
  12.342  
  12.343 -Goal "hypreal_of_real x ~= Numeral0 ==> hypreal_of_real x : HFinite - Infinitesimal";
  12.344 +Goal "hypreal_of_real x ~= 0 ==> hypreal_of_real x : HFinite - Infinitesimal";
  12.345  by (rtac SReal_HFinite_diff_Infinitesimal 1);
  12.346  by Auto_tac;
  12.347  qed "hypreal_of_real_HFinite_diff_Infinitesimal";
  12.348  
  12.349 -Goal "(hypreal_of_real x : Infinitesimal) = (x=Numeral0)";
  12.350 -by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero]));  
  12.351 +Goal "(hypreal_of_real x : Infinitesimal) = (x=0)";
  12.352 +by Auto_tac;  
  12.353  by (rtac ccontr 1); 
  12.354  by (rtac (hypreal_of_real_HFinite_diff_Infinitesimal RS DiffD2) 1); 
  12.355 -by Auto_tac;  
  12.356 +by Auto_tac;
  12.357  qed "hypreal_of_real_Infinitesimal_iff_0";
  12.358  AddIffs [hypreal_of_real_Infinitesimal_iff_0];
  12.359  
  12.360 -Goal "number_of w ~= (Numeral0::hypreal) ==> number_of w ~: Infinitesimal";
  12.361 +Goal "number_of w ~= (0::hypreal) ==> number_of w ~: Infinitesimal";
  12.362  by (fast_tac (claset() addDs [SReal_number_of RS SReal_Infinitesimal_zero]) 1);
  12.363  qed "number_of_not_Infinitesimal";
  12.364  Addsimps [number_of_not_Infinitesimal];
  12.365  
  12.366 -Goal "[| y: Reals; x @= y; y~= Numeral0 |] ==> x ~= Numeral0";
  12.367 +(*again: 1 is a special case, but not 0 this time*)
  12.368 +Goal "1 ~: Infinitesimal";
  12.369 +by (stac (hypreal_numeral_1_eq_1 RS sym) 1);
  12.370 +by (rtac number_of_not_Infinitesimal 1); 
  12.371 +by (Simp_tac 1); 
  12.372 +qed "one_not_Infinitesimal";
  12.373 +Addsimps [one_not_Infinitesimal];
  12.374 +
  12.375 +Goal "[| y: Reals; x @= y; y~= 0 |] ==> x ~= 0";
  12.376  by (cut_inst_tac [("x","y")] hypreal_trichotomy 1);
  12.377  by (Asm_full_simp_tac 1); 
  12.378  by (blast_tac (claset() addDs 
  12.379 @@ -828,7 +902,7 @@
  12.380  
  12.381  (*The premise y~=0 is essential; otherwise x/y =0 and we lose the 
  12.382    HFinite premise.*)
  12.383 -Goal "[| y ~= Numeral0;  y: Infinitesimal;  x/y : HFinite |] ==> x : Infinitesimal";
  12.384 +Goal "[| y ~= 0;  y: Infinitesimal;  x/y : HFinite |] ==> x : Infinitesimal";
  12.385  by (dtac Infinitesimal_HFinite_mult2 1);
  12.386  by (assume_tac 1);
  12.387  by (asm_full_simp_tac 
  12.388 @@ -859,6 +933,27 @@
  12.389  qed "number_of_approx_iff";
  12.390  Addsimps [number_of_approx_iff];
  12.391  
  12.392 +(*And also for 0 @= #nn and 1 @= #nn, #nn @= 0 and #nn @= 1.*)
  12.393 +Addsimps
  12.394 + (map (simplify (simpset()))
  12.395 +      [inst "v" "Pls" number_of_approx_iff, 
  12.396 +       inst "v" "Pls BIT True" number_of_approx_iff,
  12.397 +       inst "w" "Pls" number_of_approx_iff, 
  12.398 +       inst "w" "Pls BIT True" number_of_approx_iff]);
  12.399 +
  12.400 +
  12.401 +Goal "~ (0 @= 1)";
  12.402 +by (stac SReal_approx_iff 1); 
  12.403 +by Auto_tac;  
  12.404 +qed "not_0_approx_1";
  12.405 +Addsimps [not_0_approx_1];
  12.406 +
  12.407 +Goal "~ (1 @= 0)";
  12.408 +by (stac SReal_approx_iff 1); 
  12.409 +by Auto_tac;  
  12.410 +qed "not_1_approx_0";
  12.411 +Addsimps [not_1_approx_0];
  12.412 +
  12.413  Goal "(hypreal_of_real k @= hypreal_of_real m) = (k = m)";
  12.414  by Auto_tac;  
  12.415  by (rtac (inj_hypreal_of_real RS injD) 1); 
  12.416 @@ -873,6 +968,12 @@
  12.417  qed "hypreal_of_real_approx_number_of_iff";
  12.418  Addsimps [hypreal_of_real_approx_number_of_iff];
  12.419  
  12.420 +(*And also for 0 and 1.*)
  12.421 +Addsimps
  12.422 + (map (simplify (simpset()))
  12.423 +      [inst "w" "Pls" hypreal_of_real_approx_number_of_iff, 
  12.424 +       inst "w" "Pls BIT True" hypreal_of_real_approx_number_of_iff]);
  12.425 +
  12.426  Goal "[| r: Reals; s: Reals; r @= x; s @= x|] ==> r = s";
  12.427  by (blast_tac (claset() addIs [(SReal_approx_iff RS iffD1),
  12.428                 approx_trans2]) 1);
  12.429 @@ -912,7 +1013,7 @@
  12.430      lemma_st_part_nonempty, lemma_st_part_subset]) 1);
  12.431  qed "lemma_st_part_lub";
  12.432  
  12.433 -Goal "((t::hypreal) + r <= t) = (r <= Numeral0)";
  12.434 +Goal "((t::hypreal) + r <= t) = (r <= 0)";
  12.435  by (Step_tac 1);
  12.436  by (dres_inst_tac [("x","-t")] hypreal_add_left_le_mono1 1);
  12.437  by (dres_inst_tac [("x","t")] hypreal_add_left_le_mono1 2);
  12.438 @@ -920,7 +1021,7 @@
  12.439  qed "lemma_hypreal_le_left_cancel";
  12.440  
  12.441  Goal "[| x: HFinite;  isLub Reals {s. s: Reals & s < x} t; \
  12.442 -\        r: Reals;  Numeral0 < r |] ==> x <= t + r";
  12.443 +\        r: Reals;  0 < r |] ==> x <= t + r";
  12.444  by (forward_tac [isLubD1a] 1);
  12.445  by (rtac ccontr 1 THEN dtac (linorder_not_le RS iffD2) 1);
  12.446  by (dres_inst_tac [("x","t")] SReal_add 1 THEN assume_tac 1);
  12.447 @@ -945,14 +1046,14 @@
  12.448      addIs [order_less_imp_le] addSIs [isUbI,setleI], simpset()));
  12.449  qed "lemma_st_part_gt_ub";
  12.450  
  12.451 -Goal "t <= t + -r ==> r <= (Numeral0::hypreal)";
  12.452 +Goal "t <= t + -r ==> r <= (0::hypreal)";
  12.453  by (dres_inst_tac [("x","-t")] hypreal_add_left_le_mono1 1);
  12.454  by (auto_tac (claset(), simpset() addsimps [hypreal_add_assoc RS sym]));
  12.455  qed "lemma_minus_le_zero";
  12.456  
  12.457  Goal "[| x: HFinite; \
  12.458  \        isLub Reals {s. s: Reals & s < x} t; \
  12.459 -\        r: Reals; Numeral0 < r |] \
  12.460 +\        r: Reals; 0 < r |] \
  12.461  \     ==> t + -r <= x";
  12.462  by (forward_tac [isLubD1a] 1);
  12.463  by (rtac ccontr 1 THEN dtac not_hypreal_leE 1);
  12.464 @@ -970,7 +1071,7 @@
  12.465  
  12.466  Goal "[| x: HFinite; \
  12.467  \        isLub Reals {s. s: Reals & s < x} t; \
  12.468 -\        r: Reals; Numeral0 < r |] \
  12.469 +\        r: Reals; 0 < r |] \
  12.470  \     ==> x + -t <= r";
  12.471  by (blast_tac (claset() addSIs [lemma_hypreal_le_swap RS iffD1,
  12.472                                  lemma_st_part_le1]) 1);
  12.473 @@ -982,7 +1083,7 @@
  12.474  
  12.475  Goal "[| x: HFinite; \
  12.476  \        isLub Reals {s. s: Reals & s < x} t; \
  12.477 -\        r: Reals;  Numeral0 < r |] \
  12.478 +\        r: Reals;  0 < r |] \
  12.479  \     ==> -(x + -t) <= r";
  12.480  by (blast_tac (claset() addSIs [lemma_hypreal_le_swap2 RS iffD1,
  12.481                                  lemma_st_part_le2]) 1);
  12.482 @@ -1004,7 +1105,7 @@
  12.483  
  12.484  Goal "[| x: HFinite; \
  12.485  \        isLub Reals {s. s: Reals & s < x} t; \
  12.486 -\        r: Reals; Numeral0 < r |] \
  12.487 +\        r: Reals; 0 < r |] \
  12.488  \     ==> x + -t ~= r";
  12.489  by Auto_tac;
  12.490  by (forward_tac [isLubD1a RS SReal_minus] 1);
  12.491 @@ -1016,7 +1117,7 @@
  12.492  
  12.493  Goal "[| x: HFinite; \
  12.494  \        isLub Reals {s. s: Reals & s < x} t; \
  12.495 -\        r: Reals; Numeral0 < r |] \
  12.496 +\        r: Reals; 0 < r |] \
  12.497  \     ==> -(x + -t) ~= r";
  12.498  by (auto_tac (claset(), simpset() addsimps [hypreal_minus_add_distrib]));
  12.499  by (forward_tac [isLubD1a] 1);
  12.500 @@ -1030,7 +1131,7 @@
  12.501  
  12.502  Goal "[| x: HFinite; \
  12.503  \        isLub Reals {s. s: Reals & s < x} t; \
  12.504 -\        r: Reals; Numeral0 < r |] \
  12.505 +\        r: Reals; 0 < r |] \
  12.506  \     ==> abs (x + -t) < r";
  12.507  by (forward_tac [lemma_st_part1a] 1);
  12.508  by (forward_tac [lemma_st_part2a] 4);
  12.509 @@ -1042,7 +1143,7 @@
  12.510  
  12.511  Goal "[| x: HFinite; \
  12.512  \        isLub Reals {s. s: Reals & s < x} t |] \
  12.513 -\     ==> ALL r: Reals. Numeral0 < r --> abs (x + -t) < r";
  12.514 +\     ==> ALL r: Reals. 0 < r --> abs (x + -t) < r";
  12.515  by (blast_tac (claset() addSDs [lemma_st_part_major]) 1);
  12.516  qed "lemma_st_part_major2";
  12.517  
  12.518 @@ -1050,7 +1151,7 @@
  12.519    Existence of real and Standard Part Theorem
  12.520   ----------------------------------------------*)
  12.521  Goal "x: HFinite ==> \
  12.522 -\     EX t: Reals. ALL r: Reals. Numeral0 < r --> abs (x + -t) < r";
  12.523 +\     EX t: Reals. ALL r: Reals. 0 < r --> abs (x + -t) < r";
  12.524  by (forward_tac [lemma_st_part_lub] 1 THEN Step_tac 1);
  12.525  by (forward_tac [isLubD1a] 1);
  12.526  by (blast_tac (claset() addDs [lemma_st_part_major2]) 1);
  12.527 @@ -1089,7 +1190,7 @@
  12.528  
  12.529  Goalw [HInfinite_def, HFinite_def] "x~: HFinite ==> x: HInfinite";
  12.530  by Auto_tac;  
  12.531 -by (dres_inst_tac [("x","r + Numeral1")] bspec 1);
  12.532 +by (dres_inst_tac [("x","r + 1")] bspec 1);
  12.533  by (auto_tac (claset(), simpset() addsimps [SReal_add]));   
  12.534  qed "not_HFinite_HInfinite";
  12.535  
  12.536 @@ -1241,16 +1342,16 @@
  12.537  by Auto_tac;
  12.538  qed "mem_monad_iff";
  12.539  
  12.540 -Goalw [monad_def] "(x:Infinitesimal) = (x:monad Numeral0)";
  12.541 +Goalw [monad_def] "(x:Infinitesimal) = (x:monad 0)";
  12.542  by (auto_tac (claset() addIs [approx_sym],
  12.543      simpset() addsimps [mem_infmal_iff]));
  12.544  qed "Infinitesimal_monad_zero_iff";
  12.545  
  12.546 -Goal "(x:monad Numeral0) = (-x:monad Numeral0)";
  12.547 +Goal "(x:monad 0) = (-x:monad 0)";
  12.548  by (simp_tac (simpset() addsimps [Infinitesimal_monad_zero_iff RS sym]) 1);
  12.549  qed "monad_zero_minus_iff";
  12.550  
  12.551 -Goal "(x:monad Numeral0) = (abs x:monad Numeral0)";
  12.552 +Goal "(x:monad 0) = (abs x:monad 0)";
  12.553  by (res_inst_tac [("x1","x")] (hrabs_disj RS disjE) 1);
  12.554  by (auto_tac (claset(), simpset() addsimps [monad_zero_minus_iff RS sym]));
  12.555  qed "monad_zero_hrabs_iff";
  12.556 @@ -1286,7 +1387,7 @@
  12.557  by (blast_tac (claset() addSIs [approx_sym]) 1);
  12.558  qed "approx_mem_monad2";
  12.559  
  12.560 -Goal "[| x @= y;x:monad Numeral0 |] ==> y:monad Numeral0";
  12.561 +Goal "[| x @= y;x:monad 0 |] ==> y:monad 0";
  12.562  by (dtac mem_monad_approx 1);
  12.563  by (fast_tac (claset() addIs [approx_mem_monad,approx_trans]) 1);
  12.564  qed "approx_mem_monad_zero";
  12.565 @@ -1297,7 +1398,7 @@
  12.566       monad_zero_hrabs_iff RS iffD1, mem_monad_approx, approx_trans3]) 1);
  12.567  qed "Infinitesimal_approx_hrabs";
  12.568  
  12.569 -Goal "[| Numeral0 < x;  x ~:Infinitesimal;  e :Infinitesimal |] ==> e < x";
  12.570 +Goal "[| 0 < x;  x ~:Infinitesimal;  e :Infinitesimal |] ==> e < x";
  12.571  by (rtac ccontr 1);
  12.572  by (auto_tac (claset()
  12.573                 addIs [Infinitesimal_zero RSN (2, Infinitesimal_interval)] 
  12.574 @@ -1305,38 +1406,38 @@
  12.575                simpset()));
  12.576  qed "less_Infinitesimal_less";
  12.577  
  12.578 -Goal "[| Numeral0 < x;  x ~: Infinitesimal; u: monad x |] ==> Numeral0 < u";
  12.579 +Goal "[| 0 < x;  x ~: Infinitesimal; u: monad x |] ==> 0 < u";
  12.580  by (dtac (mem_monad_approx RS approx_sym) 1);
  12.581  by (etac (bex_Infinitesimal_iff2 RS iffD2 RS bexE) 1);
  12.582  by (dres_inst_tac [("e","-xa")] less_Infinitesimal_less 1);
  12.583  by Auto_tac;  
  12.584  qed "Ball_mem_monad_gt_zero";
  12.585  
  12.586 -Goal "[| x < Numeral0; x ~: Infinitesimal; u: monad x |] ==> u < Numeral0";
  12.587 +Goal "[| x < 0; x ~: Infinitesimal; u: monad x |] ==> u < 0";
  12.588  by (dtac (mem_monad_approx RS approx_sym) 1);
  12.589  by (etac (bex_Infinitesimal_iff RS iffD2 RS bexE) 1);
  12.590  by (cut_inst_tac [("x","-x"),("e","xa")] less_Infinitesimal_less 1);
  12.591  by Auto_tac;  
  12.592  qed "Ball_mem_monad_less_zero";
  12.593  
  12.594 -Goal "[|Numeral0 < x; x ~: Infinitesimal; x @= y|] ==> Numeral0 < y";
  12.595 +Goal "[|0 < x; x ~: Infinitesimal; x @= y|] ==> 0 < y";
  12.596  by (blast_tac (claset() addDs [Ball_mem_monad_gt_zero,
  12.597                                 approx_subset_monad]) 1);
  12.598  qed "lemma_approx_gt_zero";
  12.599  
  12.600 -Goal "[|x < Numeral0; x ~: Infinitesimal; x @= y|] ==> y < Numeral0";
  12.601 +Goal "[|x < 0; x ~: Infinitesimal; x @= y|] ==> y < 0";
  12.602  by (blast_tac (claset() addDs [Ball_mem_monad_less_zero,
  12.603      approx_subset_monad]) 1);
  12.604  qed "lemma_approx_less_zero";
  12.605  
  12.606 -Goal "[| x @= y; x < Numeral0; x ~: Infinitesimal |] ==> abs x @= abs y";
  12.607 +Goal "[| x @= y; x < 0; x ~: Infinitesimal |] ==> abs x @= abs y";
  12.608  by (forward_tac [lemma_approx_less_zero] 1);
  12.609  by (REPEAT(assume_tac 1));
  12.610  by (REPEAT(dtac hrabs_minus_eqI2 1));
  12.611  by Auto_tac;
  12.612  qed "approx_hrabs1";
  12.613  
  12.614 -Goal "[| x @= y; Numeral0 < x; x ~: Infinitesimal |] ==> abs x @= abs y";
  12.615 +Goal "[| x @= y; 0 < x; x ~: Infinitesimal |] ==> abs x @= abs y";
  12.616  by (forward_tac [lemma_approx_gt_zero] 1);
  12.617  by (REPEAT(assume_tac 1));
  12.618  by (REPEAT(dtac hrabs_eqI2 1));
  12.619 @@ -1345,12 +1446,12 @@
  12.620  
  12.621  Goal "x @= y ==> abs x @= abs y";
  12.622  by (res_inst_tac [("Q","x:Infinitesimal")] (excluded_middle RS disjE) 1);
  12.623 -by (res_inst_tac [("x1","x"),("y1","Numeral0")] (hypreal_linear RS disjE) 1);
  12.624 +by (res_inst_tac [("x1","x"),("y1","0")] (hypreal_linear RS disjE) 1);
  12.625  by (auto_tac (claset() addIs [approx_hrabs1,approx_hrabs2,
  12.626      Infinitesimal_approx_hrabs], simpset()));
  12.627  qed "approx_hrabs";
  12.628  
  12.629 -Goal "abs(x) @= Numeral0 ==> x @= Numeral0";
  12.630 +Goal "abs(x) @= 0 ==> x @= 0";
  12.631  by (cut_inst_tac [("x","x")] hrabs_disj 1);
  12.632  by (auto_tac (claset() addDs [approx_minus], simpset()));
  12.633  qed "approx_hrabs_zero_cancel";
  12.634 @@ -1445,15 +1546,15 @@
  12.635                            hypreal_of_real_le_add_Infininitesimal_cancel]) 1);
  12.636  qed "hypreal_of_real_le_add_Infininitesimal_cancel2";
  12.637  
  12.638 -Goal "[| hypreal_of_real x < e; e: Infinitesimal |] ==> hypreal_of_real x <= Numeral0";
  12.639 +Goal "[| hypreal_of_real x < e; e: Infinitesimal |] ==> hypreal_of_real x <= 0";
  12.640  by (rtac hypreal_leI 1 THEN Step_tac 1);
  12.641  by (dtac Infinitesimal_interval 1);
  12.642  by (dtac (SReal_hypreal_of_real RS SReal_Infinitesimal_zero) 4);
  12.643 -by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero]));
  12.644 +by Auto_tac;
  12.645  qed "hypreal_of_real_less_Infinitesimal_le_zero";
  12.646  
  12.647  (*used once, in NSDERIV_inverse*)
  12.648 -Goal "[| h: Infinitesimal; x ~= Numeral0 |] ==> hypreal_of_real x + h ~= Numeral0";
  12.649 +Goal "[| h: Infinitesimal; x ~= 0 |] ==> hypreal_of_real x + h ~= 0";
  12.650  by Auto_tac;  
  12.651  qed "Infinitesimal_add_not_zero";
  12.652  
  12.653 @@ -1468,7 +1569,7 @@
  12.654  Goal "x*x + y*y : HFinite ==> x*x : HFinite";
  12.655  by (rtac HFinite_bounded 1); 
  12.656  by (rtac hypreal_self_le_add_pos 2); 
  12.657 -by (rtac (rename_numerals hypreal_le_square) 2); 
  12.658 +by (rtac (hypreal_le_square) 2); 
  12.659  by (assume_tac 1); 
  12.660  qed "HFinite_square_cancel";
  12.661  Addsimps [HFinite_square_cancel];
  12.662 @@ -1489,13 +1590,13 @@
  12.663  
  12.664  Goal "x*x + y*y + z*z : Infinitesimal ==> x*x : Infinitesimal";
  12.665  by (blast_tac (claset() addIs [hypreal_self_le_add_pos2,
  12.666 -    Infinitesimal_interval2, rename_numerals hypreal_le_square]) 1);
  12.667 +    Infinitesimal_interval2, hypreal_le_square]) 1);
  12.668  qed "Infinitesimal_sum_square_cancel";
  12.669  Addsimps [Infinitesimal_sum_square_cancel];
  12.670  
  12.671  Goal "x*x + y*y + z*z : HFinite ==> x*x : HFinite";
  12.672  by (blast_tac (claset() addIs [hypreal_self_le_add_pos2, HFinite_bounded, 
  12.673 -                               rename_numerals hypreal_le_square,
  12.674 +                               hypreal_le_square,
  12.675  		               HFinite_number_of]) 1);
  12.676  qed "HFinite_sum_square_cancel";
  12.677  Addsimps [HFinite_sum_square_cancel];
  12.678 @@ -1524,7 +1625,7 @@
  12.679  qed "HFinite_sum_square_cancel3";
  12.680  Addsimps [HFinite_sum_square_cancel3];
  12.681  
  12.682 -Goal "[| y: monad x; Numeral0 < hypreal_of_real e |] \
  12.683 +Goal "[| y: monad x; 0 < hypreal_of_real e |] \
  12.684  \     ==> abs (y + -x) < hypreal_of_real e";
  12.685  by (dtac (mem_monad_approx RS approx_sym) 1);
  12.686  by (dtac (bex_Infinitesimal_iff RS iffD2) 1);
  12.687 @@ -1614,8 +1715,7 @@
  12.688      approx_sym),bex_Infinitesimal_iff2 RS iffD2]) 1);
  12.689  qed "HFinite_st_Infinitesimal_add";
  12.690  
  12.691 -Goal "[| x: HFinite; y: HFinite |] \
  12.692 -\     ==> st (x + y) = st(x) + st(y)";
  12.693 +Goal "[| x: HFinite; y: HFinite |] ==> st (x + y) = st(x) + st(y)";
  12.694  by (forward_tac [HFinite_st_Infinitesimal_add] 1);
  12.695  by (forw_inst_tac [("x","y")] HFinite_st_Infinitesimal_add 1);
  12.696  by (Step_tac 1);
  12.697 @@ -1635,6 +1735,11 @@
  12.698  qed "st_number_of";
  12.699  Addsimps [st_number_of];
  12.700  
  12.701 +(*the theorem above for the special cases of zero and one*)
  12.702 +Addsimps
  12.703 +  (map (simplify (simpset()))
  12.704 +   [inst "w" "Pls" st_number_of, inst "w" "Pls BIT True" st_number_of]);
  12.705 +
  12.706  Goal "y: HFinite ==> st(-y) = -st(y)";
  12.707  by (forward_tac [HFinite_minus_iff RS iffD2] 1);
  12.708  by (rtac hypreal_add_minus_eq_minus 1);
  12.709 @@ -1682,18 +1787,19 @@
  12.710  by (blast_tac (claset() addSIs [lemma_st_mult]) 1);
  12.711  qed "st_mult";
  12.712  
  12.713 -Goal "x: Infinitesimal ==> st x = Numeral0";
  12.714 +Goal "x: Infinitesimal ==> st x = 0";
  12.715 +by (stac (hypreal_numeral_0_eq_0 RS sym) 1); 
  12.716  by (rtac (st_number_of RS subst) 1);
  12.717  by (rtac approx_st_eq 1);
  12.718  by (auto_tac (claset() addIs [Infinitesimal_subset_HFinite RS subsetD],
  12.719                simpset() addsimps [mem_infmal_iff RS sym]));
  12.720  qed "st_Infinitesimal";
  12.721  
  12.722 -Goal "st(x) ~= Numeral0 ==> x ~: Infinitesimal";
  12.723 +Goal "st(x) ~= 0 ==> x ~: Infinitesimal";
  12.724  by (fast_tac (claset() addIs [st_Infinitesimal]) 1);
  12.725  qed "st_not_Infinitesimal";
  12.726  
  12.727 -Goal "[| x: HFinite; st x ~= Numeral0 |] \
  12.728 +Goal "[| x: HFinite; st x ~= 0 |] \
  12.729  \     ==> st(inverse x) = inverse (st x)";
  12.730  by (res_inst_tac [("c1","st x")] (hypreal_mult_left_cancel RS iffD1) 1);
  12.731  by (auto_tac (claset(),
  12.732 @@ -1703,7 +1809,7 @@
  12.733  by Auto_tac;  
  12.734  qed "st_inverse";
  12.735  
  12.736 -Goal "[| x: HFinite; y: HFinite; st y ~= Numeral0 |] \
  12.737 +Goal "[| x: HFinite; y: HFinite; st y ~= 0 |] \
  12.738  \     ==> st(x/y) = (st x) / (st y)";
  12.739  by (auto_tac (claset(),
  12.740        simpset() addsimps [hypreal_divide_def, st_mult, st_not_Infinitesimal, 
  12.741 @@ -1734,8 +1840,7 @@
  12.742                simpset()));
  12.743  qed "Infinitesimal_add_st_le_cancel";
  12.744  
  12.745 -Goal "[| x: HFinite; y: HFinite; x <= y |] \
  12.746 -\     ==> st(x) <= st(y)";
  12.747 +Goal "[| x: HFinite; y: HFinite; x <= y |] ==> st(x) <= st(y)";
  12.748  by (forward_tac [HFinite_st_Infinitesimal_add] 1);
  12.749  by (rotate_tac 1 1);
  12.750  by (forward_tac [HFinite_st_Infinitesimal_add] 1);
  12.751 @@ -1743,24 +1848,25 @@
  12.752  by (rtac Infinitesimal_add_st_le_cancel 1);
  12.753  by (res_inst_tac [("x","ea"),("y","e")] 
  12.754               Infinitesimal_diff 3);
  12.755 -by (auto_tac (claset(),
  12.756 -         simpset() addsimps [hypreal_add_assoc RS sym]));
  12.757 +by (auto_tac (claset(), simpset() addsimps [hypreal_add_assoc RS sym]));
  12.758  qed "st_le";
  12.759  
  12.760 -Goal "[| Numeral0 <= x;  x: HFinite |] ==> Numeral0 <= st x";
  12.761 +Goal "[| 0 <= x;  x: HFinite |] ==> 0 <= st x";
  12.762 +by (stac (hypreal_numeral_0_eq_0 RS sym) 1); 
  12.763  by (rtac (st_number_of RS subst) 1);
  12.764 -by (auto_tac (claset() addIs [st_le],
  12.765 -              simpset() delsimps [st_number_of]));
  12.766 +by (rtac st_le 1); 
  12.767 +by Auto_tac; 
  12.768  qed "st_zero_le";
  12.769  
  12.770 -Goal "[| x <= Numeral0;  x: HFinite |] ==> st x <= Numeral0";
  12.771 +Goal "[| x <= 0;  x: HFinite |] ==> st x <= 0";
  12.772 +by (stac (hypreal_numeral_0_eq_0 RS sym) 1); 
  12.773  by (rtac (st_number_of RS subst) 1);
  12.774 -by (auto_tac (claset() addIs [st_le],
  12.775 -              simpset() delsimps [st_number_of]));
  12.776 +by (rtac st_le 1); 
  12.777 +by Auto_tac; 
  12.778  qed "st_zero_ge";
  12.779  
  12.780  Goal "x: HFinite ==> abs(st x) = st(abs x)";
  12.781 -by (case_tac "Numeral0 <= x" 1);
  12.782 +by (case_tac "0 <= x" 1);
  12.783  by (auto_tac (claset() addSDs [not_hypreal_leE, order_less_imp_le],
  12.784                simpset() addsimps [st_zero_le,hrabs_eqI1, hrabs_minus_eqI1,
  12.785                                    st_zero_ge,st_minus]));
  12.786 @@ -1834,7 +1940,7 @@
  12.787  by Auto_tac;
  12.788  qed "lemma_Int_eq1";
  12.789  
  12.790 -Goal "{n. abs (xa n) = u} <= {n. abs (xa n) < u + (Numeral1::real)}";
  12.791 +Goal "{n. abs (xa n) = u} <= {n. abs (xa n) < u + (1::real)}";
  12.792  by Auto_tac;
  12.793  qed "lemma_FreeUltrafilterNat_one";
  12.794  
  12.795 @@ -1847,7 +1953,7 @@
  12.796  \              |] ==> x: HFinite";
  12.797  by (rtac FreeUltrafilterNat_HFinite 1);
  12.798  by (res_inst_tac [("x","xa")] bexI 1);
  12.799 -by (res_inst_tac [("x","u + Numeral1")] exI 1);
  12.800 +by (res_inst_tac [("x","u + 1")] exI 1);
  12.801  by (Ultra_tac 1 THEN assume_tac 1);
  12.802  qed "FreeUltrafilterNat_const_Finite";
  12.803  
  12.804 @@ -1915,22 +2021,22 @@
  12.805  
  12.806  Goalw [Infinitesimal_def] 
  12.807            "x : Infinitesimal ==> EX X: Rep_hypreal x. \
  12.808 -\          ALL u. Numeral0 < u --> {n. abs (X n) < u}:  FreeUltrafilterNat";
  12.809 +\          ALL u. 0 < u --> {n. abs (X n) < u}:  FreeUltrafilterNat";
  12.810  by (auto_tac (claset(), simpset() addsimps [hrabs_interval_iff]));
  12.811  by (res_inst_tac [("z","x")] eq_Abs_hypreal 1);
  12.812  by (EVERY[Auto_tac, rtac bexI 1, rtac lemma_hyprel_refl 2, Step_tac 1]);
  12.813  by (dtac (hypreal_of_real_less_iff RS iffD2) 1);
  12.814  by (dres_inst_tac [("x","hypreal_of_real u")] bspec 1);
  12.815 -by (auto_tac (claset(), simpset() addsimps [hypreal_of_real_zero]));
  12.816 +by Auto_tac;
  12.817  by (auto_tac (claset(), 
  12.818                simpset() addsimps [hypreal_less_def, hypreal_minus,
  12.819 -                                  hypreal_of_real_def,hypreal_of_real_zero]));
  12.820 +                                  hypreal_of_real_def]));
  12.821  by (Ultra_tac 1 THEN arith_tac 1);
  12.822  qed "Infinitesimal_FreeUltrafilterNat";
  12.823  
  12.824  Goalw [Infinitesimal_def] 
  12.825       "EX X: Rep_hypreal x. \
  12.826 -\           ALL u. Numeral0 < u --> {n. abs (X n) < u} : FreeUltrafilterNat \
  12.827 +\           ALL u. 0 < u --> {n. abs (X n) < u} : FreeUltrafilterNat \
  12.828  \     ==> x : Infinitesimal";
  12.829  by (auto_tac (claset(),
  12.830                simpset() addsimps [hrabs_interval_iff,abs_interval_iff]));
  12.831 @@ -1942,7 +2048,7 @@
  12.832  qed "FreeUltrafilterNat_Infinitesimal";
  12.833  
  12.834  Goal "(x : Infinitesimal) = (EX X: Rep_hypreal x. \
  12.835 -\          ALL u. Numeral0 < u --> {n. abs (X n) < u}:  FreeUltrafilterNat)";
  12.836 +\          ALL u. 0 < u --> {n. abs (X n) < u}:  FreeUltrafilterNat)";
  12.837  by (blast_tac (claset() addSIs [Infinitesimal_FreeUltrafilterNat,
  12.838                 FreeUltrafilterNat_Infinitesimal]) 1);
  12.839  qed "Infinitesimal_FreeUltrafilterNat_iff";
  12.840 @@ -1951,25 +2057,25 @@
  12.841           Infinitesimals as smaller than 1/n for all n::nat (> 0)
  12.842   ------------------------------------------------------------------------*)
  12.843  
  12.844 -Goal "(ALL r. Numeral0 < r --> x < r) = (ALL n. x < inverse(real (Suc n)))";
  12.845 +Goal "(ALL r. 0 < r --> x < r) = (ALL n. x < inverse(real (Suc n)))";
  12.846  by (auto_tac (claset(), simpset() addsimps [real_of_nat_Suc_gt_zero]));
  12.847  by (blast_tac (claset() addSDs [reals_Archimedean] 
  12.848                          addIs [order_less_trans]) 1);
  12.849  qed "lemma_Infinitesimal";
  12.850  
  12.851 -Goal "(ALL r: Reals. Numeral0 < r --> x < r) = \
  12.852 +Goal "(ALL r: Reals. 0 < r --> x < r) = \
  12.853  \     (ALL n. x < inverse(hypreal_of_nat (Suc n)))";
  12.854  by (Step_tac 1);
  12.855  by (dres_inst_tac [("x","inverse (hypreal_of_real(real (Suc n)))")] 
  12.856      bspec 1);
  12.857  by (full_simp_tac (simpset() addsimps [SReal_inverse]) 1); 
  12.858 -by (rtac (real_of_nat_Suc_gt_zero RS rename_numerals real_inverse_gt_zero RS 
  12.859 +by (rtac (real_of_nat_Suc_gt_zero RS real_inverse_gt_0 RS 
  12.860            (hypreal_of_real_less_iff RS iffD2) RSN(2,impE)) 1);
  12.861  by (assume_tac 2);
  12.862  by (asm_full_simp_tac (simpset() addsimps 
  12.863 -       [real_of_nat_Suc_gt_zero, hypreal_of_real_zero, hypreal_of_nat_def]) 1);
  12.864 +       [real_of_nat_Suc_gt_zero, hypreal_of_nat_def]) 1);
  12.865  by (auto_tac (claset() addSDs [reals_Archimedean],
  12.866 -              simpset() addsimps [SReal_iff,hypreal_of_real_zero RS sym]));
  12.867 +              simpset() addsimps [SReal_iff]));
  12.868  by (dtac (hypreal_of_real_less_iff RS iffD2) 1);
  12.869  by (asm_full_simp_tac (simpset() addsimps 
  12.870           [real_of_nat_Suc_gt_zero, hypreal_of_nat_def])1);
  12.871 @@ -2089,7 +2195,7 @@
  12.872  qed "HFinite_epsilon";
  12.873  Addsimps [HFinite_epsilon];
  12.874  
  12.875 -Goal "epsilon @= Numeral0";
  12.876 +Goal "epsilon @= 0";
  12.877  by (simp_tac (simpset() addsimps [mem_infmal_iff RS sym]) 1);
  12.878  qed "epsilon_approx_zero";
  12.879  Addsimps [epsilon_approx_zero];
  12.880 @@ -2109,7 +2215,7 @@
  12.881  by (simp_tac (simpset() addsimps [real_of_nat_Suc_gt_zero]) 1); 
  12.882  qed "real_of_nat_less_inverse_iff";
  12.883  
  12.884 -Goal "Numeral0 < u ==> finite {n. u < inverse(real(Suc n))}";
  12.885 +Goal "0 < u ==> finite {n. u < inverse(real(Suc n))}";
  12.886  by (asm_simp_tac (simpset() addsimps [real_of_nat_less_inverse_iff]) 1);
  12.887  by (asm_simp_tac (simpset() addsimps [real_of_nat_Suc, 
  12.888                           real_less_diff_eq RS sym]) 1); 
  12.889 @@ -2122,7 +2228,7 @@
  12.890                simpset() addsimps [order_less_imp_le]));
  12.891  qed "lemma_real_le_Un_eq2";
  12.892  
  12.893 -Goal "(inverse (real(Suc n)) <= r) = (Numeral1 <= r * real(Suc n))";
  12.894 +Goal "(inverse (real(Suc n)) <= r) = (1 <= r * real(Suc n))";
  12.895  by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); 
  12.896  by (simp_tac (simpset() addsimps [real_inverse_eq_divide]) 1);
  12.897  by (stac pos_real_less_divide_eq 1); 
  12.898 @@ -2138,18 +2244,18 @@
  12.899  
  12.900  Goal "finite {n::nat. u = inverse(real(Suc n))}";
  12.901  by (asm_simp_tac (simpset() addsimps [real_of_nat_inverse_eq_iff]) 1);
  12.902 -by (cut_inst_tac [("x","inverse u - Numeral1")] lemma_finite_omega_set 1);
  12.903 +by (cut_inst_tac [("x","inverse u - 1")] lemma_finite_omega_set 1);
  12.904  by (asm_full_simp_tac (simpset() addsimps [real_of_nat_Suc, 
  12.905                           real_diff_eq_eq RS sym, eq_commute]) 1); 
  12.906  qed "lemma_finite_omega_set2";
  12.907  
  12.908 -Goal "Numeral0 < u ==> finite {n. u <= inverse(real(Suc n))}";
  12.909 +Goal "0 < u ==> finite {n. u <= inverse(real(Suc n))}";
  12.910  by (auto_tac (claset(), 
  12.911        simpset() addsimps [lemma_real_le_Un_eq2,lemma_finite_omega_set2,
  12.912                            finite_inverse_real_of_posnat_gt_real]));
  12.913  qed "finite_inverse_real_of_posnat_ge_real";
  12.914  
  12.915 -Goal "Numeral0 < u ==> \
  12.916 +Goal "0 < u ==> \
  12.917  \      {n. u <= inverse(real(Suc n))} ~: FreeUltrafilterNat";
  12.918  by (blast_tac (claset() addSIs [FreeUltrafilterNat_finite,
  12.919                                  finite_inverse_real_of_posnat_ge_real]) 1);
  12.920 @@ -2166,7 +2272,7 @@
  12.921                simpset() addsimps [not_real_leE]));
  12.922  val lemma = result();
  12.923  
  12.924 -Goal "Numeral0 < u ==> \
  12.925 +Goal "0 < u ==> \
  12.926  \     {n. inverse(real(Suc n)) < u} : FreeUltrafilterNat";
  12.927  by (cut_inst_tac [("u","u")]  inverse_real_of_posnat_ge_real_FreeUltrafilterNat 1);
  12.928  by (auto_tac (claset() addDs [FreeUltrafilterNat_Compl_mem],
  12.929 @@ -2187,7 +2293,7 @@
  12.930  Goal "ALL n. abs(X n + -x) < inverse(real(Suc n)) \ 
  12.931  \    ==> Abs_hypreal(hyprel``{X}) + -hypreal_of_real x : Infinitesimal";
  12.932  by (auto_tac (claset() addSIs [bexI] 
  12.933 -           addDs [rename_numerals FreeUltrafilterNat_inverse_real_of_posnat,
  12.934 +           addDs [FreeUltrafilterNat_inverse_real_of_posnat,
  12.935                    FreeUltrafilterNat_all,FreeUltrafilterNat_Int] 
  12.936             addIs [order_less_trans, FreeUltrafilterNat_subset],
  12.937        simpset() addsimps [hypreal_minus, 
  12.938 @@ -2212,8 +2318,7 @@
  12.939  \     ==> Abs_hypreal(hyprel``{X}) + \
  12.940  \         -Abs_hypreal(hyprel``{Y}) : Infinitesimal";
  12.941  by (auto_tac (claset() addSIs [bexI] 
  12.942 -                  addDs [rename_numerals 
  12.943 -                         FreeUltrafilterNat_inverse_real_of_posnat,
  12.944 +                  addDs [FreeUltrafilterNat_inverse_real_of_posnat,
  12.945                           FreeUltrafilterNat_all,FreeUltrafilterNat_Int] 
  12.946          addIs [order_less_trans, FreeUltrafilterNat_subset],
  12.947       simpset() addsimps 
    13.1 --- a/src/HOL/Hyperreal/NatStar.ML	Thu Nov 01 21:12:13 2001 +0100
    13.2 +++ b/src/HOL/Hyperreal/NatStar.ML	Fri Nov 02 17:55:24 2001 +0100
    13.3 @@ -404,7 +404,7 @@
    13.4  Goal "N : HNatInfinite \
    13.5  \  ==> (*fNat* (%x::nat. inverse(real x))) N = inverse(hypreal_of_hypnat N)";
    13.6  by (res_inst_tac [("f1","inverse")]  (starfun_stafunNat_o2 RS subst) 1);
    13.7 -by (subgoal_tac "hypreal_of_hypnat N ~= Numeral0" 1);
    13.8 +by (subgoal_tac "hypreal_of_hypnat N ~= 0" 1);
    13.9  by (auto_tac (claset(), 
   13.10         simpset() addsimps [starfunNat_real_of_nat, starfun_inverse_inverse]));
   13.11  qed "starfunNat_inverse_real_of_nat_eq";
    14.1 --- a/src/HOL/Hyperreal/SEQ.ML	Thu Nov 01 21:12:13 2001 +0100
    14.2 +++ b/src/HOL/Hyperreal/SEQ.ML	Fri Nov 02 17:55:24 2001 +0100
    14.3 @@ -26,7 +26,7 @@
    14.4  
    14.5  Goalw [LIMSEQ_def] 
    14.6        "(X ----> L) = \
    14.7 -\      (ALL r. Numeral0 <r --> (EX no. ALL n. no <= n --> abs(X n + -L) < r))";
    14.8 +\      (ALL r. 0 <r --> (EX no. ALL n. no <= n --> abs(X n + -L) < r))";
    14.9  by (Simp_tac 1);
   14.10  qed "LIMSEQ_iff";
   14.11  
   14.12 @@ -120,7 +120,7 @@
   14.13  by Auto_tac;  
   14.14  val lemmaLIM2 = result();
   14.15  
   14.16 -Goal "[| Numeral0 < r; ALL n. r <= abs (X (f n) + - L); \
   14.17 +Goal "[| 0 < r; ALL n. r <= abs (X (f n) + - L); \
   14.18  \          (*fNat* X) (Abs_hypnat (hypnatrel `` {f})) + \
   14.19  \          - hypreal_of_real  L @= 0 |] ==> False";
   14.20  by (auto_tac (claset(),simpset() addsimps [starfunNat,
   14.21 @@ -147,7 +147,7 @@
   14.22  by (dtac (approx_minus_iff RS iffD1) 2);
   14.23  by (fold_tac [real_le_def]);
   14.24  by (blast_tac (claset() addIs [HNatInfinite_NSLIMSEQ]) 1);
   14.25 -by (blast_tac (claset() addIs [rename_numerals lemmaLIM3]) 1);
   14.26 +by (blast_tac (claset() addIs [lemmaLIM3]) 1);
   14.27  qed "NSLIMSEQ_LIMSEQ";
   14.28  
   14.29  (* Now the all important result is trivially proved! *)
   14.30 @@ -234,7 +234,7 @@
   14.31      Proof is like that of NSLIM_inverse.
   14.32   --------------------------------------------------------------*)
   14.33  Goalw [NSLIMSEQ_def] 
   14.34 -     "[| X ----NS> a;  a ~= Numeral0 |] ==> (%n. inverse(X n)) ----NS> inverse(a)";
   14.35 +     "[| X ----NS> a;  a ~= 0 |] ==> (%n. inverse(X n)) ----NS> inverse(a)";
   14.36  by (Clarify_tac 1);
   14.37  by (dtac bspec 1);
   14.38  by (auto_tac (claset(), 
   14.39 @@ -244,18 +244,18 @@
   14.40  
   14.41  
   14.42  (*------ Standard version of theorem -------*)
   14.43 -Goal "[| X ----> a; a ~= Numeral0 |] ==> (%n. inverse(X n)) ----> inverse(a)";
   14.44 +Goal "[| X ----> a; a ~= 0 |] ==> (%n. inverse(X n)) ----> inverse(a)";
   14.45  by (asm_full_simp_tac (simpset() addsimps [NSLIMSEQ_inverse,
   14.46      LIMSEQ_NSLIMSEQ_iff]) 1);
   14.47  qed "LIMSEQ_inverse";
   14.48  
   14.49 -Goal "[| X ----NS> a;  Y ----NS> b;  b ~= Numeral0 |] \
   14.50 +Goal "[| X ----NS> a;  Y ----NS> b;  b ~= 0 |] \
   14.51  \     ==> (%n. X n / Y n) ----NS> a/b";
   14.52  by (asm_full_simp_tac (simpset() addsimps [NSLIMSEQ_mult, NSLIMSEQ_inverse, 
   14.53                                             real_divide_def]) 1);
   14.54  qed "NSLIMSEQ_mult_inverse";
   14.55  
   14.56 -Goal "[| X ----> a;  Y ----> b;  b ~= Numeral0 |] ==> (%n. X n / Y n) ----> a/b";
   14.57 +Goal "[| X ----> a;  Y ----> b;  b ~= 0 |] ==> (%n. X n / Y n) ----> a/b";
   14.58  by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_mult, LIMSEQ_inverse, 
   14.59                                             real_divide_def]) 1);
   14.60  qed "LIMSEQ_divide";
   14.61 @@ -376,16 +376,16 @@
   14.62                    Bounded Sequence
   14.63   ------------------------------------------------------------------*)
   14.64  Goalw [Bseq_def] 
   14.65 -      "Bseq X ==> EX K. Numeral0 < K & (ALL n. abs(X n) <= K)";
   14.66 +      "Bseq X ==> EX K. 0 < K & (ALL n. abs(X n) <= K)";
   14.67  by (assume_tac 1);
   14.68  qed "BseqD";
   14.69  
   14.70  Goalw [Bseq_def]
   14.71 -      "[| Numeral0 < K; ALL n. abs(X n) <= K |] ==> Bseq X";
   14.72 +      "[| 0 < K; ALL n. abs(X n) <= K |] ==> Bseq X";
   14.73  by (Blast_tac 1);
   14.74  qed "BseqI";
   14.75  
   14.76 -Goal "(EX K. Numeral0 < K & (ALL n. abs(X n) <= K)) = \
   14.77 +Goal "(EX K. 0 < K & (ALL n. abs(X n) <= K)) = \
   14.78  \     (EX N. ALL n. abs(X n) <= real(Suc N))";
   14.79  by Auto_tac;
   14.80  by (cut_inst_tac [("x","K")] reals_Archimedean2 1);
   14.81 @@ -401,7 +401,7 @@
   14.82  by (simp_tac (simpset() addsimps [lemma_NBseq_def]) 1);
   14.83  qed "Bseq_iff";
   14.84  
   14.85 -Goal "(EX K. Numeral0 < K & (ALL n. abs(X n) <= K)) = \
   14.86 +Goal "(EX K. 0 < K & (ALL n. abs(X n) <= K)) = \
   14.87  \     (EX N. ALL n. abs(X n) < real(Suc N))";
   14.88  by (stac lemma_NBseq_def 1); 
   14.89  by Auto_tac;
   14.90 @@ -444,7 +444,7 @@
   14.91                                    HNatInfinite_FreeUltrafilterNat_iff]));
   14.92  by (EVERY[rtac bexI 1, rtac lemma_hyprel_refl 2]);
   14.93  by (dres_inst_tac [("f","Xa")] lemma_Bseq 1); 
   14.94 -by (res_inst_tac [("x","K+Numeral1")] exI 1);
   14.95 +by (res_inst_tac [("x","K+1")] exI 1);
   14.96  by (rotate_tac 2 1 THEN dtac FreeUltrafilterNat_all 1);
   14.97  by (Ultra_tac 1);
   14.98  qed "Bseq_NSBseq";
   14.99 @@ -461,14 +461,14 @@
  14.100     is not what we want (read useless!)
  14.101   -------------------------------------------------------------------*)
  14.102   
  14.103 -Goal "ALL K. Numeral0 < K --> (EX n. K < abs (X n)) \
  14.104 +Goal "ALL K. 0 < K --> (EX n. K < abs (X n)) \
  14.105  \          ==> ALL N. EX n. real(Suc N) < abs (X n)";
  14.106  by (Step_tac 1);
  14.107  by (cut_inst_tac [("n","N")] real_of_nat_Suc_gt_zero 1);
  14.108  by (Blast_tac 1);
  14.109  val lemmaNSBseq = result();
  14.110  
  14.111 -Goal "ALL K. Numeral0 < K --> (EX n. K < abs (X n)) \
  14.112 +Goal "ALL K. 0 < K --> (EX n. K < abs (X n)) \
  14.113  \         ==> EX f. ALL N. real(Suc N) < abs (X (f N))";
  14.114  by (dtac lemmaNSBseq 1);
  14.115  by (dtac choice 1);
  14.116 @@ -652,7 +652,7 @@
  14.117  Goal "!!(X::nat=> real). \
  14.118  \              [| ALL m. X m ~= U; \
  14.119  \                 isLub UNIV {x. EX n. X n = x} U; \
  14.120 -\                 Numeral0 < T; \
  14.121 +\                 0 < T; \
  14.122  \                 U + - T < U \
  14.123  \              |] ==> EX m. U + -T < X m & X m < U";
  14.124  by (dtac lemma_converg2 1 THEN assume_tac 1);
  14.125 @@ -722,7 +722,7 @@
  14.126   
  14.127  (***--- alternative formulation for boundedness---***)
  14.128  Goalw [Bseq_def] 
  14.129 -   "Bseq X = (EX k x. Numeral0 < k & (ALL n. abs(X(n) + -x) <= k))";
  14.130 +   "Bseq X = (EX k x. 0 < k & (ALL n. abs(X(n) + -x) <= k))";
  14.131  by (Step_tac 1);
  14.132  by (res_inst_tac [("x","k + abs(x)")] exI 2);
  14.133  by (res_inst_tac [("x","K")] exI 1);
  14.134 @@ -733,7 +733,7 @@
  14.135  qed "Bseq_iff2";
  14.136  
  14.137  (***--- alternative formulation for boundedness ---***)
  14.138 -Goal "Bseq X = (EX k N. Numeral0 < k & (ALL n. abs(X(n) + -X(N)) <= k))";
  14.139 +Goal "Bseq X = (EX k N. 0 < k & (ALL n. abs(X(n) + -X(N)) <= k))";
  14.140  by (Step_tac 1);
  14.141  by (asm_full_simp_tac (simpset() addsimps [Bseq_def]) 1);
  14.142  by (Step_tac 1);
  14.143 @@ -748,7 +748,7 @@
  14.144  qed "Bseq_iff3";
  14.145  
  14.146  Goalw [Bseq_def] "(ALL n. k <= f n & f n <= K) ==> Bseq f";
  14.147 -by (res_inst_tac [("x","(abs(k) + abs(K)) + Numeral1")] exI 1);
  14.148 +by (res_inst_tac [("x","(abs(k) + abs(K)) + 1")] exI 1);
  14.149  by (Auto_tac);
  14.150  by (dres_inst_tac [("x","n")] spec 2);
  14.151  by (ALLGOALS arith_tac);
  14.152 @@ -841,8 +841,8 @@
  14.153   -------------------------------------------------------*)
  14.154  
  14.155  (***-------------  VARIOUS LEMMAS --------------***)
  14.156 -Goal "ALL n. M <= n --> abs (X M + - X n) < (Numeral1::real) \
  14.157 -\         ==>  ALL n. M <= n --> abs(X n) < Numeral1 + abs(X M)";
  14.158 +Goal "ALL n. M <= n --> abs (X M + - X n) < (1::real) \
  14.159 +\         ==>  ALL n. M <= n --> abs(X n) < 1 + abs(X M)";
  14.160  by (Step_tac 1);
  14.161  by (dtac spec 1 THEN Auto_tac);
  14.162  by (arith_tac 1);
  14.163 @@ -911,8 +911,8 @@
  14.164     outlines sketched by various authors would suggest
  14.165   ---------------------------------------------------------*)
  14.166  Goalw [Cauchy_def,Bseq_def] "Cauchy X ==> Bseq X";
  14.167 -by (dres_inst_tac [("x","Numeral1")] spec 1);
  14.168 -by (etac (rename_numerals real_zero_less_one RSN (2,impE)) 1);
  14.169 +by (dres_inst_tac [("x","1")] spec 1);
  14.170 +by (etac (real_zero_less_one RSN (2,impE)) 1);
  14.171  by (Step_tac 1);
  14.172  by (dres_inst_tac [("x","M")] spec 1);
  14.173  by (Asm_full_simp_tac 1);
  14.174 @@ -920,7 +920,7 @@
  14.175  by (cut_inst_tac [("M","M"),("X","X")] SUP_rabs_subseq 1);
  14.176  by (Step_tac 1);
  14.177  by (cut_inst_tac [("R1.0","abs(X m)"),
  14.178 -     ("R2.0","Numeral1 + abs(X M)")] real_linear 1);
  14.179 +     ("R2.0","1 + abs(X M)")] real_linear 1);
  14.180  by (Step_tac 1);
  14.181  by (dtac lemma_trans1 1 THEN assume_tac 1);
  14.182  by (dtac lemma_trans2 3 THEN assume_tac 3);
  14.183 @@ -928,8 +928,8 @@
  14.184  by (dtac (abs_add_one_gt_zero RS order_less_trans) 3);
  14.185  by (dtac lemma_trans4 1);
  14.186  by (dtac lemma_trans4 2);
  14.187 -by (res_inst_tac [("x","Numeral1 + abs(X M)")] exI 1);
  14.188 -by (res_inst_tac [("x","Numeral1 + abs(X M)")] exI 2);
  14.189 +by (res_inst_tac [("x","1 + abs(X M)")] exI 1);
  14.190 +by (res_inst_tac [("x","1 + abs(X M)")] exI 2);
  14.191  by (res_inst_tac [("x","abs(X m)")] exI 3);
  14.192  by (auto_tac (claset() addSEs [lemma_Nat_covered],
  14.193                simpset()));
  14.194 @@ -1082,7 +1082,7 @@
  14.195   ----------------------------------------------------*)
  14.196  (* we can prove this directly since proof is trivial *)
  14.197  Goalw [LIMSEQ_def] 
  14.198 -      "((%n. abs(f n)) ----> Numeral0) = (f ----> Numeral0)";
  14.199 +      "((%n. abs(f n)) ----> 0) = (f ----> 0)";
  14.200  by (simp_tac (simpset() addsimps [abs_idempotent]) 1);
  14.201  qed "LIMSEQ_rabs_zero";
  14.202  
  14.203 @@ -1092,7 +1092,7 @@
  14.204  (* than the direct standard one above!                 *)
  14.205  (*-----------------------------------------------------*)
  14.206  
  14.207 -Goal "((%n. abs(f n)) ----NS> Numeral0) = (f ----NS> Numeral0)";
  14.208 +Goal "((%n. abs(f n)) ----NS> 0) = (f ----NS> 0)";
  14.209  by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
  14.210               LIMSEQ_rabs_zero]) 1);
  14.211  qed "NSLIMSEQ_rabs_zero";
  14.212 @@ -1119,7 +1119,7 @@
  14.213  (* standard proof seems easier *)
  14.214  Goalw [LIMSEQ_def] 
  14.215        "ALL y. EX N. ALL n. N <= n --> y < f(n) \
  14.216 -\      ==> (%n. inverse(f n)) ----> Numeral0";
  14.217 +\      ==> (%n. inverse(f n)) ----> 0";
  14.218  by (Step_tac 1 THEN Asm_full_simp_tac 1);
  14.219  by (dres_inst_tac [("x","inverse r")] spec 1 THEN Step_tac 1);
  14.220  by (res_inst_tac [("x","N")] exI 1 THEN Step_tac 1);
  14.221 @@ -1134,7 +1134,7 @@
  14.222  qed "LIMSEQ_inverse_zero";
  14.223  
  14.224  Goal "ALL y. EX N. ALL n. N <= n --> y < f(n) \
  14.225 -\     ==> (%n. inverse(f n)) ----NS> Numeral0";
  14.226 +\     ==> (%n. inverse(f n)) ----NS> 0";
  14.227  by (asm_simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
  14.228                    LIMSEQ_inverse_zero]) 1);
  14.229  qed "NSLIMSEQ_inverse_zero";
  14.230 @@ -1143,7 +1143,7 @@
  14.231               Sequence  1/n --> 0 as n --> infinity 
  14.232   -------------------------------------------------------------*)
  14.233  
  14.234 -Goal "(%n. inverse(real(Suc n))) ----> Numeral0";
  14.235 +Goal "(%n. inverse(real(Suc n))) ----> 0";
  14.236  by (rtac LIMSEQ_inverse_zero 1 THEN Step_tac 1);
  14.237  by (cut_inst_tac [("x","y")] reals_Archimedean2 1);
  14.238  by (Step_tac 1 THEN res_inst_tac [("x","n")] exI 1);
  14.239 @@ -1153,7 +1153,7 @@
  14.240  by (blast_tac (claset() addIs [order_less_le_trans]) 1);  
  14.241  qed "LIMSEQ_inverse_real_of_nat";
  14.242  
  14.243 -Goal "(%n. inverse(real(Suc n))) ----NS> Numeral0";
  14.244 +Goal "(%n. inverse(real(Suc n))) ----NS> 0";
  14.245  by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
  14.246      LIMSEQ_inverse_real_of_nat]) 1);
  14.247  qed "NSLIMSEQ_inverse_real_of_nat";
  14.248 @@ -1188,13 +1188,13 @@
  14.249      LIMSEQ_inverse_real_of_posnat_add_minus]) 1);
  14.250  qed "NSLIMSEQ_inverse_real_of_posnat_add_minus";
  14.251  
  14.252 -Goal "(%n. r*( Numeral1 + -inverse(real(Suc n)))) ----> r";
  14.253 -by (cut_inst_tac [("b","Numeral1")] ([LIMSEQ_const,
  14.254 +Goal "(%n. r*( 1 + -inverse(real(Suc n)))) ----> r";
  14.255 +by (cut_inst_tac [("b","1")] ([LIMSEQ_const,
  14.256      LIMSEQ_inverse_real_of_posnat_add_minus] MRS LIMSEQ_mult) 1);
  14.257  by (Auto_tac);
  14.258  qed "LIMSEQ_inverse_real_of_posnat_add_minus_mult";
  14.259  
  14.260 -Goal "(%n. r*( Numeral1 + -inverse(real(Suc n)))) ----NS> r";
  14.261 +Goal "(%n. r*( 1 + -inverse(real(Suc n)))) ----NS> r";
  14.262  by (simp_tac (simpset() addsimps [LIMSEQ_NSLIMSEQ_iff RS sym,
  14.263      LIMSEQ_inverse_real_of_posnat_add_minus_mult]) 1);
  14.264  qed "NSLIMSEQ_inverse_real_of_posnat_add_minus_mult";
  14.265 @@ -1214,22 +1214,22 @@
  14.266  qed "LIMSEQ_pow";
  14.267  
  14.268  (*----------------------------------------------------------------
  14.269 -               0 <= x < Numeral1 ==> (x ^ n ----> 0)
  14.270 +               0 <= x < 1 ==> (x ^ n ----> 0)
  14.271    Proof will use (NS) Cauchy equivalence for convergence and
  14.272    also fact that bounded and monotonic sequence converges.  
  14.273   ---------------------------------------------------------------*)
  14.274 -Goalw [Bseq_def] "[| Numeral0 <= x; x < Numeral1 |] ==> Bseq (%n. x ^ n)";
  14.275 -by (res_inst_tac [("x","Numeral1")] exI 1);
  14.276 +Goalw [Bseq_def] "[| 0 <= x; x < 1 |] ==> Bseq (%n. x ^ n)";
  14.277 +by (res_inst_tac [("x","1")] exI 1);
  14.278  by (auto_tac (claset() addDs [conjI RS realpow_le] 
  14.279                         addIs [order_less_imp_le], 
  14.280                simpset() addsimps [abs_eqI1, realpow_abs RS sym] ));
  14.281  qed "Bseq_realpow";
  14.282  
  14.283 -Goal "[| Numeral0 <= x; x < Numeral1 |] ==> monoseq (%n. x ^ n)";
  14.284 +Goal "[| 0 <= x; x < 1 |] ==> monoseq (%n. x ^ n)";
  14.285  by (blast_tac (claset() addSIs [mono_SucI2,realpow_Suc_le3]) 1);
  14.286  qed "monoseq_realpow";
  14.287  
  14.288 -Goal "[| Numeral0 <= x; x < Numeral1 |] ==> convergent (%n. x ^ n)";
  14.289 +Goal "[| 0 <= x; x < 1 |] ==> convergent (%n. x ^ n)";
  14.290  by (blast_tac (claset() addSIs [Bseq_monoseq_convergent,
  14.291                                  Bseq_realpow,monoseq_realpow]) 1);
  14.292  qed "convergent_realpow";
  14.293 @@ -1238,7 +1238,7 @@
  14.294  
  14.295  
  14.296  Goalw [NSLIMSEQ_def]
  14.297 -     "[| Numeral0 <= x; x < Numeral1 |] ==> (%n. x ^ n) ----NS> Numeral0";
  14.298 +     "[| 0 <= x; x < 1 |] ==> (%n. x ^ n) ----NS> 0";
  14.299  by (auto_tac (claset() addSDs [convergent_realpow],
  14.300                simpset() addsimps [convergent_NSconvergent_iff]));
  14.301  by (forward_tac [NSconvergentD] 1);
  14.302 @@ -1258,12 +1258,12 @@
  14.303  qed "NSLIMSEQ_realpow_zero";
  14.304  
  14.305  (*---------------  standard version ---------------*)
  14.306 -Goal "[| Numeral0 <= x; x < Numeral1 |] ==> (%n. x ^ n) ----> Numeral0";
  14.307 +Goal "[| 0 <= x; x < 1 |] ==> (%n. x ^ n) ----> 0";
  14.308  by (asm_simp_tac (simpset() addsimps [NSLIMSEQ_realpow_zero,
  14.309                                        LIMSEQ_NSLIMSEQ_iff]) 1);
  14.310  qed "LIMSEQ_realpow_zero";
  14.311  
  14.312 -Goal "Numeral1 < x ==> (%n. a / (x ^ n)) ----> Numeral0";
  14.313 +Goal "1 < x ==> (%n. a / (x ^ n)) ----> 0";
  14.314  by (cut_inst_tac [("a","a"),("x1","inverse x")] 
  14.315      ([LIMSEQ_const, LIMSEQ_realpow_zero] MRS LIMSEQ_mult) 1);
  14.316  by (auto_tac (claset(), 
  14.317 @@ -1275,22 +1275,22 @@
  14.318  (*----------------------------------------------------------------
  14.319                 Limit of c^n for |c| < 1  
  14.320   ---------------------------------------------------------------*)
  14.321 -Goal "abs(c) < Numeral1 ==> (%n. abs(c) ^ n) ----> Numeral0";
  14.322 +Goal "abs(c) < 1 ==> (%n. abs(c) ^ n) ----> 0";
  14.323  by (blast_tac (claset() addSIs [LIMSEQ_realpow_zero,abs_ge_zero]) 1);
  14.324  qed "LIMSEQ_rabs_realpow_zero";
  14.325  
  14.326 -Goal "abs(c) < Numeral1 ==> (%n. abs(c) ^ n) ----NS> Numeral0";
  14.327 +Goal "abs(c) < 1 ==> (%n. abs(c) ^ n) ----NS> 0";
  14.328  by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_rabs_realpow_zero,
  14.329      LIMSEQ_NSLIMSEQ_iff RS sym]) 1);
  14.330  qed "NSLIMSEQ_rabs_realpow_zero";
  14.331  
  14.332 -Goal "abs(c) < Numeral1 ==> (%n. c ^ n) ----> Numeral0";
  14.333 +Goal "abs(c) < 1 ==> (%n. c ^ n) ----> 0";
  14.334  by (rtac (LIMSEQ_rabs_zero RS iffD1) 1);
  14.335  by (auto_tac (claset() addIs [LIMSEQ_rabs_realpow_zero],
  14.336                simpset() addsimps [realpow_abs RS sym]));
  14.337  qed "LIMSEQ_rabs_realpow_zero2";
  14.338  
  14.339 -Goal "abs(c) < Numeral1 ==> (%n. c ^ n) ----NS> Numeral0";
  14.340 +Goal "abs(c) < 1 ==> (%n. c ^ n) ----NS> 0";
  14.341  by (asm_full_simp_tac (simpset() addsimps [LIMSEQ_rabs_realpow_zero2,
  14.342      LIMSEQ_NSLIMSEQ_iff RS sym]) 1);
  14.343  qed "NSLIMSEQ_rabs_realpow_zero2";
  14.344 @@ -1308,12 +1308,12 @@
  14.345  
  14.346  (*** A sequence converging to zero defines an infinitesimal ***)
  14.347  Goalw [NSLIMSEQ_def] 
  14.348 -      "X ----NS> Numeral0 ==> Abs_hypreal(hyprel``{X}) : Infinitesimal";
  14.349 +      "X ----NS> 0 ==> Abs_hypreal(hyprel``{X}) : Infinitesimal";
  14.350  by (dres_inst_tac [("x","whn")] bspec 1);
  14.351  by (simp_tac (simpset() addsimps [HNatInfinite_whn]) 1);
  14.352  by (auto_tac (claset(),
  14.353                simpset() addsimps [hypnat_omega_def, mem_infmal_iff RS sym,
  14.354 -                                  starfunNat,hypreal_of_real_zero]));
  14.355 +                                  starfunNat]));
  14.356  qed "NSLIMSEQ_zero_Infinitesimal_hypreal";
  14.357  
  14.358  (***---------------------------------------------------------------
    15.1 --- a/src/HOL/Hyperreal/SEQ.thy	Thu Nov 01 21:12:13 2001 +0100
    15.2 +++ b/src/HOL/Hyperreal/SEQ.thy	Fri Nov 02 17:55:24 2001 +0100
    15.3 @@ -10,7 +10,7 @@
    15.4  
    15.5    (* Standard definition of convergence of sequence *)           
    15.6    LIMSEQ :: [nat=>real,real] => bool    ("((_)/ ----> (_))" [60, 60] 60)
    15.7 -  "X ----> L == (ALL r. Numeral0 < r --> (EX no. ALL n. no <= n --> abs (X n + -L) < r))"
    15.8 +  "X ----> L == (ALL r. 0 < r --> (EX no. ALL n. no <= n --> abs (X n + -L) < r))"
    15.9    
   15.10    (* Nonstandard definition of convergence of sequence *)
   15.11    NSLIMSEQ :: [nat=>real,real] => bool    ("((_)/ ----NS> (_))" [60, 60] 60)
   15.12 @@ -33,7 +33,7 @@
   15.13  
   15.14    (* Standard definition for bounded sequence *)
   15.15    Bseq :: (nat => real) => bool
   15.16 -  "Bseq X == (EX K. (Numeral0 < K & (ALL n. abs(X n) <= K)))"
   15.17 +  "Bseq X == (EX K. (0 < K & (ALL n. abs(X n) <= K)))"
   15.18   
   15.19    (* Nonstandard definition for bounded sequence *)
   15.20    NSBseq :: (nat=>real) => bool
   15.21 @@ -52,7 +52,7 @@
   15.22  
   15.23    (* Standard definition *)
   15.24    Cauchy :: (nat => real) => bool
   15.25 -  "Cauchy X == (ALL e. (Numeral0 < e -->
   15.26 +  "Cauchy X == (ALL e. (0 < e -->
   15.27                         (EX M. (ALL m n. M <= m & M <= n 
   15.28                               --> abs((X m) + -(X n)) < e))))"
   15.29  
    16.1 --- a/src/HOL/Hyperreal/Series.ML	Thu Nov 01 21:12:13 2001 +0100
    16.2 +++ b/src/HOL/Hyperreal/Series.ML	Fri Nov 02 17:55:24 2001 +0100
    16.3 @@ -5,13 +5,13 @@
    16.4      Description : Finite summation and infinite series
    16.5  *) 
    16.6  
    16.7 -Goal "sumr (Suc n) n f = Numeral0";
    16.8 +Goal "sumr (Suc n) n f = 0";
    16.9  by (induct_tac "n" 1);
   16.10  by (Auto_tac);
   16.11  qed "sumr_Suc_zero";
   16.12  Addsimps [sumr_Suc_zero];
   16.13  
   16.14 -Goal "sumr m m f = Numeral0";
   16.15 +Goal "sumr m m f = 0";
   16.16  by (induct_tac "m" 1);
   16.17  by (Auto_tac);
   16.18  qed "sumr_eq_bounds";
   16.19 @@ -22,7 +22,7 @@
   16.20  qed "sumr_Suc_eq";
   16.21  Addsimps [sumr_Suc_eq];
   16.22  
   16.23 -Goal "sumr (m+k) k f = Numeral0";
   16.24 +Goal "sumr (m+k) k f = 0";
   16.25  by (induct_tac "k" 1);
   16.26  by (Auto_tac);
   16.27  qed "sumr_add_lbound_zero";
   16.28 @@ -83,7 +83,7 @@
   16.29  by (full_simp_tac (simpset() addsimps [sumr_add_mult_const]) 1);
   16.30  qed "sumr_diff_mult_const";
   16.31  
   16.32 -Goal "n < m --> sumr m n f = Numeral0";
   16.33 +Goal "n < m --> sumr m n f = 0";
   16.34  by (induct_tac "n" 1);
   16.35  by (auto_tac (claset() addDs [less_imp_le], simpset()));
   16.36  qed_spec_mp "sumr_less_bounds_zero";
   16.37 @@ -101,7 +101,7 @@
   16.38  by (Auto_tac);
   16.39  qed "sumr_shift_bounds";
   16.40  
   16.41 -Goal "sumr 0 (2*n) (%i. (-1) ^ Suc i) = Numeral0";
   16.42 +Goal "sumr 0 (2*n) (%i. (-1) ^ Suc i) = 0";
   16.43  by (induct_tac "n" 1);
   16.44  by (Auto_tac);
   16.45  qed "sumr_minus_one_realpow_zero";
   16.46 @@ -137,7 +137,7 @@
   16.47                                        real_of_nat_Suc]) 1);
   16.48  qed_spec_mp "sumr_interval_const2";
   16.49  
   16.50 -Goal "(ALL n. m <= n --> Numeral0 <= f n) & m < k --> sumr 0 m f <= sumr 0 k f";
   16.51 +Goal "(ALL n. m <= n --> 0 <= f n) & m < k --> sumr 0 m f <= sumr 0 k f";
   16.52  by (induct_tac "k" 1);
   16.53  by (Step_tac 1);
   16.54  by (ALLGOALS(asm_full_simp_tac (simpset() addsimps [less_Suc_eq_le])));
   16.55 @@ -156,21 +156,21 @@
   16.56      simpset() addsimps [le_def]));
   16.57  qed_spec_mp "sumr_le2";
   16.58  
   16.59 -Goal "(ALL n. Numeral0 <= f n) --> Numeral0 <= sumr m n f";
   16.60 +Goal "(ALL n. 0 <= f n) --> 0 <= sumr m n f";
   16.61  by (induct_tac "n" 1);
   16.62  by Auto_tac;
   16.63  by (dres_inst_tac [("x","n")] spec 1);
   16.64  by (arith_tac 1);
   16.65  qed_spec_mp "sumr_ge_zero";
   16.66  
   16.67 -Goal "(ALL n. m <= n --> Numeral0 <= f n) --> Numeral0 <= sumr m n f";
   16.68 +Goal "(ALL n. m <= n --> 0 <= f n) --> 0 <= sumr m n f";
   16.69  by (induct_tac "n" 1);
   16.70  by Auto_tac;
   16.71  by (dres_inst_tac [("x","n")] spec 1);
   16.72  by (arith_tac 1);
   16.73  qed_spec_mp "sumr_ge_zero2";
   16.74  
   16.75 -Goal "Numeral0 <= sumr m n (%n. abs (f n))";
   16.76 +Goal "0 <= sumr m n (%n. abs (f n))";
   16.77  by (induct_tac "n" 1);
   16.78  by Auto_tac;
   16.79  by (arith_tac 1);
   16.80 @@ -184,21 +184,21 @@
   16.81  qed "rabs_sumr_rabs_cancel";
   16.82  Addsimps [rabs_sumr_rabs_cancel];
   16.83  
   16.84 -Goal "ALL n. N <= n --> f n = Numeral0 \
   16.85 -\     ==> ALL m n. N <= m --> sumr m n f = Numeral0";   
   16.86 +Goal "ALL n. N <= n --> f n = 0 \
   16.87 +\     ==> ALL m n. N <= m --> sumr m n f = 0";   
   16.88  by (Step_tac 1);
   16.89  by (induct_tac "n" 1);
   16.90  by (Auto_tac);
   16.91  qed "sumr_zero";
   16.92  
   16.93 -Goal "ALL n. N <= n --> f (Suc n) = Numeral0 \
   16.94 -\     ==> ALL m n. Suc N <= m --> sumr m n f = Numeral0";   
   16.95 +Goal "ALL n. N <= n --> f (Suc n) = 0 \
   16.96 +\     ==> ALL m n. Suc N <= m --> sumr m n f = 0";   
   16.97  by (rtac sumr_zero 1 THEN Step_tac 1);
   16.98  by (case_tac "n" 1);
   16.99  by Auto_tac; 
  16.100  qed "Suc_le_imp_diff_ge2";
  16.101  
  16.102 -Goal "sumr (Suc 0) n (%n. f(n) * Numeral0 ^ n) = Numeral0";
  16.103 +Goal "sumr (Suc 0) n (%n. f(n) * 0 ^ n) = 0";
  16.104  by (induct_tac "n" 1);
  16.105  by (case_tac "n" 2);
  16.106  by Auto_tac; 
  16.107 @@ -269,7 +269,7 @@
  16.108  
  16.109  (*
  16.110  Goalw [sums_def,LIMSEQ_def] 
  16.111 -     "(ALL m. n <= Suc m --> f(m) = Numeral0) ==> f sums (sumr 0 n f)";
  16.112 +     "(ALL m. n <= Suc m --> f(m) = 0) ==> f sums (sumr 0 n f)";
  16.113  by (Step_tac 1);
  16.114  by (res_inst_tac [("x","n")] exI 1);
  16.115  by (Step_tac 1 THEN forward_tac [le_imp_less_or_eq] 1);
  16.116 @@ -283,7 +283,7 @@
  16.117  **********************)
  16.118  
  16.119  Goalw [sums_def,LIMSEQ_def] 
  16.120 -     "(ALL m. n <= m --> f(m) = Numeral0) ==> f sums (sumr 0 n f)";
  16.121 +     "(ALL m. n <= m --> f(m) = 0) ==> f sums (sumr 0 n f)";
  16.122  by (Step_tac 1);
  16.123  by (res_inst_tac [("x","n")] exI 1);
  16.124  by (Step_tac 1 THEN forward_tac [le_imp_less_or_eq] 1);
  16.125 @@ -341,7 +341,7 @@
  16.126  by (Auto_tac);
  16.127  qed "sums_group";
  16.128  
  16.129 -Goal "[|summable f; ALL d. Numeral0 < (f(n + (Suc (Suc 0) * d))) + f(n + ((Suc (Suc 0) * d) + 1))|] \
  16.130 +Goal "[|summable f; ALL d. 0 < (f(n + (Suc (Suc 0) * d))) + f(n + ((Suc (Suc 0) * d) + 1))|] \
  16.131  \     ==> sumr 0 n f < suminf f";
  16.132  by (dtac summable_sums 1);
  16.133  by (auto_tac (claset(),simpset() addsimps [sums_def,LIMSEQ_def]));
  16.134 @@ -369,8 +369,8 @@
  16.135  by (assume_tac 3);
  16.136  by (dres_inst_tac [("x","0")] spec 2);
  16.137  by (Asm_full_simp_tac 2);
  16.138 -by (subgoal_tac "Numeral0 <= sumr 0 (Suc (Suc 0) * Suc no + n) f + - suminf f" 1);
  16.139 -by (dtac (rename_numerals abs_eqI1) 1 );
  16.140 +by (subgoal_tac "0 <= sumr 0 (Suc (Suc 0) * Suc no + n) f + - suminf f" 1);
  16.141 +by (dtac (abs_eqI1) 1 );
  16.142  by (Asm_full_simp_tac 1);
  16.143  by (auto_tac (claset(),simpset() addsimps [real_le_def]));
  16.144  qed "sumr_pos_lt_pair";
  16.145 @@ -379,7 +379,7 @@
  16.146     Summable series of positive terms has limit >= any partial sum 
  16.147   ----------------------------------------------------------------*)
  16.148  Goal 
  16.149 -     "[| summable f; ALL m. n <= m --> Numeral0 <= f(m) |] \
  16.150 +     "[| summable f; ALL m. n <= m --> 0 <= f(m) |] \
  16.151  \          ==> sumr 0 n f <= suminf f";
  16.152  by (dtac summable_sums 1);
  16.153  by (rewtac sums_def);
  16.154 @@ -390,7 +390,7 @@
  16.155  by (auto_tac (claset() addIs [sumr_le], simpset()));
  16.156  qed "series_pos_le";
  16.157  
  16.158 -Goal "[| summable f; ALL m. n <= m --> Numeral0 < f(m) |] \
  16.159 +Goal "[| summable f; ALL m. n <= m --> 0 < f(m) |] \
  16.160  \          ==> sumr 0 n f < suminf f";
  16.161  by (res_inst_tac [("y","sumr 0 (Suc n) f")] order_less_le_trans 1);
  16.162  by (rtac series_pos_le 2);
  16.163 @@ -403,10 +403,10 @@
  16.164                      sum of geometric progression                 
  16.165   -------------------------------------------------------------------*)
  16.166  
  16.167 -Goal "x ~= Numeral1 ==> sumr 0 n (%n. x ^ n) = (x ^ n - Numeral1) / (x - Numeral1)";
  16.168 +Goal "x ~= 1 ==> sumr 0 n (%n. x ^ n) = (x ^ n - 1) / (x - 1)";
  16.169  by (induct_tac "n" 1);
  16.170  by (Auto_tac);
  16.171 -by (res_inst_tac [("c1","x - Numeral1")] (real_mult_right_cancel RS iffD1) 1);
  16.172 +by (res_inst_tac [("c1","x - 1")] (real_mult_right_cancel RS iffD1) 1);
  16.173  by (auto_tac (claset(),
  16.174         simpset() addsimps [real_mult_assoc, real_add_mult_distrib]));
  16.175  by (auto_tac (claset(),
  16.176 @@ -414,14 +414,14 @@
  16.177                             real_diff_def, real_mult_commute]));
  16.178  qed "sumr_geometric";
  16.179  
  16.180 -Goal "abs(x) < Numeral1 ==> (%n. x ^ n) sums (Numeral1/(Numeral1 - x))";
  16.181 -by (case_tac "x = Numeral1" 1);
  16.182 +Goal "abs(x) < 1 ==> (%n. x ^ n) sums (1/(1 - x))";
  16.183 +by (case_tac "x = 1" 1);
  16.184  by (auto_tac (claset() addSDs [LIMSEQ_rabs_realpow_zero2],
  16.185               simpset() addsimps [sumr_geometric ,sums_def,
  16.186                                   real_diff_def, real_add_divide_distrib]));
  16.187 -by (subgoal_tac "Numeral1 / (Numeral1 + - x) = Numeral0/(x-Numeral1) + - Numeral1/(x-Numeral1)" 1);
  16.188 +by (subgoal_tac "1 / (1 + -x) = 0/(x - 1) + - 1/(x - 1)" 1);
  16.189  by (asm_full_simp_tac (simpset() addsimps [real_divide_eq_cancel1,
  16.190 -                 real_divide_minus_eq RS sym, real_diff_def]) 2); 
  16.191 +                      real_divide_minus_eq RS sym, real_diff_def]) 2); 
  16.192  by (etac ssubst 1); 
  16.193  by (rtac LIMSEQ_add 1 THEN rtac LIMSEQ_divide 1);
  16.194  by (auto_tac (claset() addIs [LIMSEQ_const], 
  16.195 @@ -437,7 +437,7 @@
  16.196  qed "summable_convergent_sumr_iff";
  16.197  
  16.198  Goal "summable f = \
  16.199 -\     (ALL e. Numeral0 < e --> (EX N. ALL m n. N <= m --> abs(sumr m n f) < e))";
  16.200 +\     (ALL e. 0 < e --> (EX N. ALL m n. N <= m --> abs(sumr m n f) < e))";
  16.201  by (auto_tac (claset(),simpset() addsimps [summable_convergent_sumr_iff,
  16.202      Cauchy_convergent_iff RS sym,Cauchy_def]));
  16.203  by (ALLGOALS(dtac spec) THEN Auto_tac);
  16.204 @@ -455,7 +455,7 @@
  16.205  
  16.206  (*-------------------------------------------------------------------
  16.207       Terms of a convergent series tend to zero
  16.208 -     > Goalw [LIMSEQ_def] "summable f ==> f ----> Numeral0";
  16.209 +     > Goalw [LIMSEQ_def] "summable f ==> f ----> 0";
  16.210       Proved easily in HSeries after proving nonstandard case.
  16.211   -------------------------------------------------------------------*)
  16.212  (*-------------------------------------------------------------------
  16.213 @@ -527,10 +527,10 @@
  16.214                          The ratio test
  16.215   -------------------------------------------------------------------*)
  16.216  
  16.217 -Goal "[| c <= Numeral0; abs x <= c * abs y |] ==> x = (Numeral0::real)";
  16.218 +Goal "[| c <= 0; abs x <= c * abs y |] ==> x = (0::real)";
  16.219  by (dtac order_le_imp_less_or_eq 1);
  16.220  by Auto_tac;  
  16.221 -by (subgoal_tac "Numeral0 <= c * abs y" 1);
  16.222 +by (subgoal_tac "0 <= c * abs y" 1);
  16.223  by (arith_tac 2);
  16.224  by (asm_full_simp_tac (simpset() addsimps [real_0_le_mult_iff]) 1); 
  16.225  qed "rabs_ratiotest_lemma";
  16.226 @@ -546,19 +546,19 @@
  16.227  by (auto_tac (claset(),simpset() addsimps [le_Suc_ex]));
  16.228  qed "le_Suc_ex_iff";
  16.229  
  16.230 -(*All this trouble just to get Numeral0<c *)
  16.231 +(*All this trouble just to get 0<c *)
  16.232  Goal "[| ALL n. N <= n --> abs(f(Suc n)) <= c*abs(f n) |] \
  16.233 -\     ==> Numeral0 < c | summable f";
  16.234 +\     ==> 0 < c | summable f";
  16.235  by (simp_tac (simpset() addsimps [linorder_not_le RS sym]) 1); 
  16.236  by (asm_full_simp_tac (simpset() addsimps [summable_Cauchy]) 1);
  16.237 -by (Step_tac 1 THEN subgoal_tac "ALL n. N <= n --> f (Suc n) = Numeral0" 1);
  16.238 +by (Step_tac 1 THEN subgoal_tac "ALL n. N <= n --> f (Suc n) = 0" 1);
  16.239  by (blast_tac (claset() addIs [rabs_ratiotest_lemma]) 2);
  16.240  by (res_inst_tac [("x","Suc N")] exI 1);
  16.241  by (Clarify_tac 1); 
  16.242  by (dtac Suc_le_imp_diff_ge2 1 THEN Auto_tac);
  16.243  qed "ratio_test_lemma2";
  16.244  
  16.245 -Goal "[| c < Numeral1; ALL n. N <= n --> abs(f(Suc n)) <= c*abs(f n) |] \
  16.246 +Goal "[| c < 1; ALL n. N <= n --> abs(f(Suc n)) <= c*abs(f n) |] \
  16.247  \     ==> summable f";
  16.248  by (forward_tac [ratio_test_lemma2] 1);
  16.249  by Auto_tac;  
  16.250 @@ -566,14 +566,13 @@
  16.251      summable_comparison_test 1);
  16.252  by (res_inst_tac [("x","N")] exI 1 THEN Step_tac 1);
  16.253  by (dtac (le_Suc_ex_iff RS iffD1) 1);
  16.254 -by (auto_tac (claset(),simpset() addsimps [realpow_add,
  16.255 -    rename_numerals realpow_not_zero]));
  16.256 +by (auto_tac (claset(),simpset() addsimps [realpow_add, realpow_not_zero]));
  16.257  by (induct_tac "na" 1 THEN Auto_tac);
  16.258  by (res_inst_tac [("y","c*abs(f(N + n))")] order_trans 1);
  16.259  by (auto_tac (claset() addIs [real_mult_le_mono1],
  16.260                simpset() addsimps [summable_def]));
  16.261  by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 1);
  16.262 -by (res_inst_tac [("x","abs(f N) * (Numeral1/(Numeral1 - c)) / (c ^ N)")] exI 1);
  16.263 +by (res_inst_tac [("x","abs(f N) * (1/(1 - c)) / (c ^ N)")] exI 1);
  16.264  by (rtac sums_divide 1); 
  16.265  by (rtac sums_mult 1); 
  16.266  by (auto_tac (claset() addSIs [sums_mult,geometric_sums], 
    17.1 --- a/src/HOL/Hyperreal/Series.thy	Thu Nov 01 21:12:13 2001 +0100
    17.2 +++ b/src/HOL/Hyperreal/Series.thy	Fri Nov 02 17:55:24 2001 +0100
    17.3 @@ -9,8 +9,8 @@
    17.4  
    17.5  consts sumr :: "[nat,nat,(nat=>real)] => real"
    17.6  primrec
    17.7 -   sumr_0   "sumr m 0 f = Numeral0"
    17.8 -   sumr_Suc "sumr m (Suc n) f = (if n < m then Numeral0 
    17.9 +   sumr_0   "sumr m 0 f = 0"
   17.10 +   sumr_Suc "sumr m (Suc n) f = (if n < m then 0 
   17.11                                 else sumr m n f + f(n))"
   17.12  
   17.13  constdefs
    18.1 --- a/src/HOL/Hyperreal/Star.ML	Thu Nov 01 21:12:13 2001 +0100
    18.2 +++ b/src/HOL/Hyperreal/Star.ML	Fri Nov 02 17:55:24 2001 +0100
    18.3 @@ -176,8 +176,7 @@
    18.4  by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
    18.5  by (rtac bexI 1 THEN rtac lemma_hyprel_refl 2);
    18.6  by (auto_tac (claset() addSDs [spec],
    18.7 -              simpset() addsimps [hypreal_minus,hrabs_def,
    18.8 -                rename_numerals hypreal_zero_def,
    18.9 +              simpset() addsimps [hypreal_minus,hrabs_def, hypreal_zero_def,
   18.10                  hypreal_le_def, hypreal_less_def]));
   18.11  by (TRYALL(Ultra_tac));
   18.12  by (TRYALL(arith_tac));
    19.1 --- a/src/HOL/Hyperreal/hypreal_arith0.ML	Thu Nov 01 21:12:13 2001 +0100
    19.2 +++ b/src/HOL/Hyperreal/hypreal_arith0.ML	Fri Nov 02 17:55:24 2001 +0100
    19.3 @@ -9,24 +9,23 @@
    19.4  local
    19.5  
    19.6  (* reduce contradictory <= to False *)
    19.7 -val simps = 
    19.8 -    [order_less_irrefl, zero_eq_numeral_0, one_eq_numeral_1,
    19.9 +val add_rules =
   19.10 +    [order_less_irrefl, hypreal_numeral_0_eq_0, hypreal_numeral_1_eq_1,
   19.11       add_hypreal_number_of, minus_hypreal_number_of, diff_hypreal_number_of,
   19.12       mult_hypreal_number_of, eq_hypreal_number_of, less_hypreal_number_of,
   19.13       le_hypreal_number_of_eq_not_less, hypreal_diff_def,
   19.14 -     hypreal_minus_add_distrib, hypreal_minus_minus, hypreal_mult_assoc];
   19.15 -
   19.16 -val add_rules =
   19.17 -    map rename_numerals
   19.18 -        [hypreal_add_zero_left, hypreal_add_zero_right,
   19.19 -         hypreal_add_minus, hypreal_add_minus_left,
   19.20 -         hypreal_mult_0, hypreal_mult_0_right,
   19.21 -         hypreal_mult_1, hypreal_mult_1_right,
   19.22 -         hypreal_mult_minus_1, hypreal_mult_minus_1_right];
   19.23 +     hypreal_minus_add_distrib, hypreal_minus_minus, hypreal_mult_assoc,
   19.24 +     hypreal_minus_zero,
   19.25 +     hypreal_add_zero_left, hypreal_add_zero_right,
   19.26 +     hypreal_add_minus, hypreal_add_minus_left,
   19.27 +     hypreal_mult_0, hypreal_mult_0_right,
   19.28 +     hypreal_mult_1, hypreal_mult_1_right,
   19.29 +     hypreal_mult_minus_1, hypreal_mult_minus_1_right];
   19.30  
   19.31  val simprocs = [Hyperreal_Times_Assoc.conv, 
   19.32                  Hyperreal_Numeral_Simprocs.combine_numerals]@
   19.33 -               Hyperreal_Numeral_Simprocs.cancel_numerals;
   19.34 +               Hyperreal_Numeral_Simprocs.cancel_numerals @
   19.35 +               Hyperreal_Numeral_Simprocs.eval_numerals;
   19.36  
   19.37  val mono_ss = simpset() addsimps
   19.38                  [hypreal_add_le_mono,hypreal_add_less_mono,
   19.39 @@ -69,8 +68,7 @@
   19.40      mult_mono_thms = mult_mono_thms @ hypreal_mult_mono_thms,
   19.41      inj_thms = inj_thms, (*FIXME: add hypreal*)
   19.42      lessD = lessD,  (*We don't change LA_Data_Ref.lessD because the hypreal ordering is dense!*)
   19.43 -    simpset = simpset addsimps (add_rules @ simps)
   19.44 -                      addsimprocs simprocs}),
   19.45 +    simpset = simpset addsimps add_rules addsimprocs simprocs}),
   19.46    arith_discrete ("HyperDef.hypreal",false),
   19.47    Simplifier.change_simpset_of (op addsimprocs) [fast_hypreal_arith_simproc]];
   19.48  
    20.1 --- a/src/HOL/Integ/Bin.ML	Thu Nov 01 21:12:13 2001 +0100
    20.2 +++ b/src/HOL/Integ/Bin.ML	Fri Nov 02 17:55:24 2001 +0100
    20.3 @@ -189,6 +189,12 @@
    20.4  Addsimps (map (inst "y" "number_of ?v") 
    20.5  	  [zminus_zless, zminus_zle, zminus_equation]);
    20.6  
    20.7 +(*Equations and inequations involving 1*)
    20.8 +Addsimps (map (simplify (simpset()) o inst "x" "1") 
    20.9 +	  [zless_zminus, zle_zminus, equation_zminus]);
   20.10 +Addsimps (map (simplify (simpset()) o inst "y" "1") 
   20.11 +	  [zminus_zless, zminus_zle, zminus_equation]);
   20.12 +
   20.13  (*Moving negation out of products*)
   20.14  Addsimps [zmult_zminus, zmult_zminus_right];
   20.15  
    21.1 --- a/src/HOL/Integ/IntArith.ML	Thu Nov 01 21:12:13 2001 +0100
    21.2 +++ b/src/HOL/Integ/IntArith.ML	Fri Nov 02 17:55:24 2001 +0100
    21.3 @@ -4,6 +4,11 @@
    21.4  *)
    21.5  
    21.6  
    21.7 +Goal "x - - y = x + (y::int)";
    21.8 +by (Simp_tac 1); 
    21.9 +qed "int_diff_minus_eq";
   21.10 +Addsimps [int_diff_minus_eq];
   21.11 +
   21.12  Goal "abs(abs(x::int)) = abs(x)";
   21.13  by(arith_tac 1);
   21.14  qed "abs_abs";
    22.1 --- a/src/HOL/Integ/int_arith1.ML	Thu Nov 01 21:12:13 2001 +0100
    22.2 +++ b/src/HOL/Integ/int_arith1.ML	Fri Nov 02 17:55:24 2001 +0100
    22.3 @@ -407,7 +407,7 @@
    22.4  val add_rules = 
    22.5      simp_thms @ bin_arith_simps @ bin_rel_simps @ 
    22.6      [int_numeral_0_eq_0, int_numeral_1_eq_1,
    22.7 -     zadd_0, zadd_0_right, zdiff_def,
    22.8 +     zminus_0, zadd_0, zadd_0_right, zdiff_def,
    22.9       zadd_zminus_inverse, zadd_zminus_inverse2, 
   22.10       zmult_0, zmult_0_right, 
   22.11       zmult_1, zmult_1_right, 
    23.1 --- a/src/HOL/Integ/int_factor_simprocs.ML	Thu Nov 01 21:12:13 2001 +0100
    23.2 +++ b/src/HOL/Integ/int_factor_simprocs.ML	Fri Nov 02 17:55:24 2001 +0100
    23.3 @@ -44,10 +44,10 @@
    23.4    val dest_coeff	= dest_coeff 1
    23.5    val trans_tac         = trans_tac
    23.6    val norm_tac = 
    23.7 -     ALLGOALS (simp_tac (HOL_ss addsimps mult_1s))
    23.8 +     ALLGOALS (simp_tac (HOL_ss addsimps int_minus_from_mult_simps@mult_1s))
    23.9       THEN ALLGOALS (simp_tac (HOL_ss addsimps bin_simps@int_mult_minus_simps))
   23.10       THEN ALLGOALS
   23.11 -            (simp_tac (HOL_ss addsimps int_minus_from_mult_simps@zmult_ac))
   23.12 +            (simp_tac (HOL_ss addsimps zmult_ac))
   23.13    val numeral_simp_tac	= ALLGOALS (simp_tac (HOL_ss addsimps bin_simps))
   23.14    val simplify_meta_eq  = simplify_meta_eq mult_1s
   23.15    end
    24.1 --- a/src/HOL/Real/HahnBanach/Aux.thy	Thu Nov 01 21:12:13 2001 +0100
    24.2 +++ b/src/HOL/Real/HahnBanach/Aux.thy	Fri Nov 02 17:55:24 2001 +0100
    24.3 @@ -40,20 +40,20 @@
    24.4  
    24.5  text {* \medskip Some lemmas for the reals. *}
    24.6  
    24.7 -lemma real_add_minus_eq: "x - y = (Numeral0::real) \<Longrightarrow> x = y"
    24.8 +lemma real_add_minus_eq: "x - y = (0::real) \<Longrightarrow> x = y"
    24.9    by simp
   24.10  
   24.11 -lemma abs_minus_one: "abs (- (Numeral1::real)) = Numeral1"
   24.12 +lemma abs_minus_one: "abs (- (1::real)) = 1"
   24.13    by simp
   24.14  
   24.15  lemma real_mult_le_le_mono1a:
   24.16 -  "(Numeral0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x  \<le> z * y"
   24.17 +  "(0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x  \<le> z * y"
   24.18    by (simp add: real_mult_le_mono2)
   24.19  
   24.20  lemma real_mult_le_le_mono2:
   24.21 -  "(Numeral0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> x * z \<le> y * z"
   24.22 +  "(0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> x * z \<le> y * z"
   24.23  proof -
   24.24 -  assume "(Numeral0::real) \<le> z"  "x \<le> y"
   24.25 +  assume "(0::real) \<le> z"  "x \<le> y"
   24.26    hence "x < y \<or> x = y" by (auto simp add: order_le_less)
   24.27    thus ?thesis
   24.28    proof
   24.29 @@ -66,11 +66,11 @@
   24.30  qed
   24.31  
   24.32  lemma real_mult_less_le_anti:
   24.33 -  "z < (Numeral0::real) \<Longrightarrow> x \<le> y \<Longrightarrow> z * y \<le> z * x"
   24.34 +  "z < (0::real) \<Longrightarrow> x \<le> y \<Longrightarrow> z * y \<le> z * x"
   24.35  proof -
   24.36 -  assume "z < Numeral0"  "x \<le> y"
   24.37 -  hence "Numeral0 < - z" by simp
   24.38 -  hence "Numeral0 \<le> - z" by (rule order_less_imp_le)
   24.39 +  assume "z < 0"  "x \<le> y"
   24.40 +  hence "0 < - z" by simp
   24.41 +  hence "0 \<le> - z" by (rule order_less_imp_le)
   24.42    hence "x * (- z) \<le> y * (- z)"
   24.43      by (rule real_mult_le_le_mono2)
   24.44    hence  "- (x * z) \<le> - (y * z)"
   24.45 @@ -79,31 +79,23 @@
   24.46  qed
   24.47  
   24.48  lemma real_mult_less_le_mono:
   24.49 -  "(Numeral0::real) < z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x \<le> z * y"
   24.50 +  "(0::real) < z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x \<le> z * y"
   24.51  proof -
   24.52 -  assume "Numeral0 < z"  "x \<le> y"
   24.53 -  have "Numeral0 \<le> z" by (rule order_less_imp_le)
   24.54 +  assume "0 < z"  "x \<le> y"
   24.55 +  have "0 \<le> z" by (rule order_less_imp_le)
   24.56    hence "x * z \<le> y * z"
   24.57      by (rule real_mult_le_le_mono2)
   24.58    thus ?thesis by (simp only: real_mult_commute)
   24.59  qed
   24.60  
   24.61 -lemma real_inverse_gt_zero1: "Numeral0 < (x::real) \<Longrightarrow> Numeral0 < inverse x"
   24.62 -proof -
   24.63 -  assume "Numeral0 < x"
   24.64 -  have "0 < x" by simp
   24.65 -  hence "0 < inverse x" by (rule real_inverse_gt_zero)
   24.66 -  thus ?thesis by simp
   24.67 -qed
   24.68 -
   24.69 -lemma real_mult_inv_right1: "(x::real) \<noteq> Numeral0 \<Longrightarrow> x * inverse x = Numeral1"
   24.70 +lemma real_mult_inv_right1: "(x::real) \<noteq> 0 \<Longrightarrow> x * inverse x = 1"
   24.71    by simp
   24.72  
   24.73 -lemma real_mult_inv_left1: "(x::real) \<noteq> Numeral0 \<Longrightarrow> inverse x * x = Numeral1"
   24.74 +lemma real_mult_inv_left1: "(x::real) \<noteq> 0 \<Longrightarrow> inverse x * x = 1"
   24.75    by simp
   24.76  
   24.77  lemma real_le_mult_order1a:
   24.78 -  "(Numeral0::real) \<le> x \<Longrightarrow> Numeral0 \<le> y \<Longrightarrow> Numeral0 \<le> x * y"
   24.79 +  "(0::real) \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> 0 \<le> x * y"
   24.80    by (simp add: real_0_le_mult_iff)
   24.81  
   24.82  lemma real_mult_diff_distrib:
    25.1 --- a/src/HOL/Real/HahnBanach/FunctionNorm.thy	Thu Nov 01 21:12:13 2001 +0100
    25.2 +++ b/src/HOL/Real/HahnBanach/FunctionNorm.thy	Fri Nov 02 17:55:24 2001 +0100
    25.3 @@ -73,7 +73,7 @@
    25.4  constdefs
    25.5    B :: "'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> ('a::{plus, minus, zero} \<Rightarrow> real) \<Rightarrow> real set"
    25.6    "B V norm f \<equiv>
    25.7 -  {Numeral0} \<union> {\<bar>f x\<bar> * inverse (norm x) | x. x \<noteq> 0 \<and> x \<in> V}"
    25.8 +  {0} \<union> {\<bar>f x\<bar> * inverse (norm x) | x. x \<noteq> 0 \<and> x \<in> V}"
    25.9  
   25.10  text {*
   25.11    @{text n} is the function norm of @{text f}, iff @{text n} is the
   25.12 @@ -97,7 +97,7 @@
   25.13  syntax
   25.14    function_norm :: "('a \<Rightarrow> real) \<Rightarrow> 'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> real"  ("\<parallel>_\<parallel>_,_")
   25.15  
   25.16 -lemma B_not_empty: "Numeral0 \<in> B V norm f"
   25.17 +lemma B_not_empty: "0 \<in> B V norm f"
   25.18    by (unfold B_def) blast
   25.19  
   25.20  text {*
   25.21 @@ -125,7 +125,7 @@
   25.22  
   25.23      show "\<exists>X. X \<in> B V norm f"
   25.24      proof
   25.25 -      show "Numeral0 \<in> (B V norm f)" by (unfold B_def) blast
   25.26 +      show "0 \<in> (B V norm f)" by (unfold B_def) blast
   25.27      qed
   25.28  
   25.29      txt {* Then we have to show that @{text B} is bounded: *}
   25.30 @@ -136,7 +136,7 @@
   25.31        txt {* We know that @{text f} is bounded by some value @{text c}. *}
   25.32  
   25.33        fix c assume a: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x"
   25.34 -      def b \<equiv> "max c Numeral0"
   25.35 +      def b \<equiv> "max c 0"
   25.36  
   25.37        show "?thesis"
   25.38        proof (intro exI isUbI setleI ballI, unfold B_def,
   25.39 @@ -148,7 +148,7 @@
   25.40          two cases for @{text "y \<in> B"}.  If @{text "y = 0"} then
   25.41          @{text "y \<le> max c 0"}: *}
   25.42  
   25.43 -        fix y assume "y = (Numeral0::real)"
   25.44 +        fix y assume "y = (0::real)"
   25.45          show "y \<le> b" by (simp! add: le_maxI2)
   25.46  
   25.47          txt {* The second case is @{text "y = \<bar>f x\<bar> / \<parallel>x\<parallel>"} for some
   25.48 @@ -164,16 +164,16 @@
   25.49          assume "y = \<bar>f x\<bar> * inverse (norm x)"
   25.50          also have "... \<le> c * norm x * inverse (norm x)"
   25.51          proof (rule real_mult_le_le_mono2)
   25.52 -          show "Numeral0 \<le> inverse (norm x)"
   25.53 -            by (rule order_less_imp_le, rule real_inverse_gt_zero1,
   25.54 +          show "0 \<le> inverse (norm x)"
   25.55 +            by (rule order_less_imp_le, rule real_inverse_gt_0,
   25.56                  rule normed_vs_norm_gt_zero)
   25.57            from a show "\<bar>f x\<bar> \<le> c * norm x" ..
   25.58          qed
   25.59          also have "... = c * (norm x * inverse (norm x))"
   25.60            by (rule real_mult_assoc)
   25.61 -        also have "(norm x * inverse (norm x)) = (Numeral1::real)"
   25.62 +        also have "(norm x * inverse (norm x)) = (1::real)"
   25.63          proof (rule real_mult_inv_right1)
   25.64 -          show nz: "norm x \<noteq> Numeral0"
   25.65 +          show nz: "norm x \<noteq> 0"
   25.66              by (rule not_sym, rule lt_imp_not_eq,
   25.67                rule normed_vs_norm_gt_zero)
   25.68          qed
   25.69 @@ -188,7 +188,7 @@
   25.70  
   25.71  lemma fnorm_ge_zero [intro?]:
   25.72    "is_continuous V norm f \<Longrightarrow> is_normed_vectorspace V norm
   25.73 -   \<Longrightarrow> Numeral0 \<le> \<parallel>f\<parallel>V,norm"
   25.74 +   \<Longrightarrow> 0 \<le> \<parallel>f\<parallel>V,norm"
   25.75  proof -
   25.76    assume c: "is_continuous V norm f"
   25.77       and n: "is_normed_vectorspace V norm"
   25.78 @@ -200,23 +200,23 @@
   25.79  
   25.80    show ?thesis
   25.81    proof (unfold function_norm_def, rule sup_ub1)
   25.82 -    show "\<forall>x \<in> (B V norm f). Numeral0 \<le> x"
   25.83 +    show "\<forall>x \<in> (B V norm f). 0 \<le> x"
   25.84      proof (intro ballI, unfold B_def,
   25.85             elim UnE singletonE CollectE exE conjE)
   25.86        fix x r
   25.87        assume "x \<in> V"  "x \<noteq> 0"
   25.88          and r: "r = \<bar>f x\<bar> * inverse (norm x)"
   25.89  
   25.90 -      have ge: "Numeral0 \<le> \<bar>f x\<bar>" by (simp! only: abs_ge_zero)
   25.91 -      have "Numeral0 \<le> inverse (norm x)"
   25.92 -        by (rule order_less_imp_le, rule real_inverse_gt_zero1, rule)(***
   25.93 +      have ge: "0 \<le> \<bar>f x\<bar>" by (simp! only: abs_ge_zero)
   25.94 +      have "0 \<le> inverse (norm x)"
   25.95 +        by (rule order_less_imp_le, rule real_inverse_gt_0, rule)(***
   25.96          proof (rule order_less_imp_le);
   25.97 -          show "Numeral0 < inverse (norm x)";
   25.98 +          show "0 < inverse (norm x)";
   25.99            proof (rule real_inverse_gt_zero);
  25.100 -            show "Numeral0 < norm x"; ..;
  25.101 +            show "0 < norm x"; ..;
  25.102            qed;
  25.103          qed; ***)
  25.104 -      with ge show "Numeral0 \<le> r"
  25.105 +      with ge show "0 \<le> r"
  25.106         by (simp only: r, rule real_le_mult_order1a)
  25.107      qed (simp!)
  25.108  
  25.109 @@ -228,7 +228,7 @@
  25.110  
  25.111      txt {* @{text B} is non-empty by construction: *}
  25.112  
  25.113 -    show "Numeral0 \<in> B V norm f" by (rule B_not_empty)
  25.114 +    show "0 \<in> B V norm f" by (rule B_not_empty)
  25.115    qed
  25.116  qed
  25.117  
  25.118 @@ -258,20 +258,20 @@
  25.119  
  25.120      assume "x = 0"
  25.121      have "\<bar>f x\<bar> = \<bar>f 0\<bar>" by (simp!)
  25.122 -    also from v continuous_linearform have "f 0 = Numeral0" ..
  25.123 +    also from v continuous_linearform have "f 0 = 0" ..
  25.124      also note abs_zero
  25.125 -    also have "Numeral0 \<le> \<parallel>f\<parallel>V,norm * norm x"
  25.126 +    also have "0 \<le> \<parallel>f\<parallel>V,norm * norm x"
  25.127      proof (rule real_le_mult_order1a)
  25.128 -      show "Numeral0 \<le> \<parallel>f\<parallel>V,norm" ..
  25.129 -      show "Numeral0 \<le> norm x" ..
  25.130 +      show "0 \<le> \<parallel>f\<parallel>V,norm" ..
  25.131 +      show "0 \<le> norm x" ..
  25.132      qed
  25.133      finally
  25.134      show "\<bar>f x\<bar> \<le> \<parallel>f\<parallel>V,norm * norm x" .
  25.135  
  25.136    next
  25.137      assume "x \<noteq> 0"
  25.138 -    have n: "Numeral0 < norm x" ..
  25.139 -    hence nz: "norm x \<noteq> Numeral0"
  25.140 +    have n: "0 < norm x" ..
  25.141 +    hence nz: "norm x \<noteq> 0"
  25.142        by (simp only: lt_imp_not_eq)
  25.143  
  25.144      txt {* For the case @{text "x \<noteq> 0"} we derive the following fact
  25.145 @@ -289,8 +289,8 @@
  25.146  
  25.147      txt {* The thesis now follows by a short calculation: *}
  25.148  
  25.149 -    have "\<bar>f x\<bar> = \<bar>f x\<bar> * Numeral1" by (simp!)
  25.150 -    also from nz have "Numeral1 = inverse (norm x) * norm x"
  25.151 +    have "\<bar>f x\<bar> = \<bar>f x\<bar> * 1" by (simp!)
  25.152 +    also from nz have "1 = inverse (norm x) * norm x"
  25.153        by (simp add: real_mult_inv_left1)
  25.154      also have "\<bar>f x\<bar> * ... = \<bar>f x\<bar> * inverse (norm x) * norm x"
  25.155        by (simp! add: real_mult_assoc)
  25.156 @@ -310,13 +310,13 @@
  25.157  
  25.158  lemma fnorm_le_ub:
  25.159    "is_continuous V norm f \<Longrightarrow> is_normed_vectorspace V norm \<Longrightarrow>
  25.160 -     \<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x \<Longrightarrow> Numeral0 \<le> c
  25.161 +     \<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x \<Longrightarrow> 0 \<le> c
  25.162    \<Longrightarrow> \<parallel>f\<parallel>V,norm \<le> c"
  25.163  proof (unfold function_norm_def)
  25.164    assume "is_normed_vectorspace V norm"
  25.165    assume c: "is_continuous V norm f"
  25.166    assume fb: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x"
  25.167 -    and "Numeral0 \<le> c"
  25.168 +    and "0 \<le> c"
  25.169  
  25.170    txt {* Suppose the inequation holds for some @{text "c \<ge> 0"}.  If
  25.171    @{text c} is an upper bound of @{text B}, then @{text c} is greater
  25.172 @@ -340,7 +340,7 @@
  25.173  
  25.174         txt {* The first case for @{text "y \<in> B"} is @{text "y = 0"}. *}
  25.175  
  25.176 -        assume "y = Numeral0"
  25.177 +        assume "y = 0"
  25.178          show "y \<le> c" by (blast!)
  25.179  
  25.180          txt{* The second case is @{text "y = \<bar>f x\<bar> / \<parallel>x\<parallel>"} for some
  25.181 @@ -350,18 +350,18 @@
  25.182          fix x
  25.183          assume "x \<in> V"  "x \<noteq> 0"
  25.184  
  25.185 -        have lz: "Numeral0 < norm x"
  25.186 +        have lz: "0 < norm x"
  25.187            by (simp! add: normed_vs_norm_gt_zero)
  25.188  
  25.189 -        have nz: "norm x \<noteq> Numeral0"
  25.190 +        have nz: "norm x \<noteq> 0"
  25.191          proof (rule not_sym)
  25.192 -          from lz show "Numeral0 \<noteq> norm x"
  25.193 +          from lz show "0 \<noteq> norm x"
  25.194              by (simp! add: order_less_imp_not_eq)
  25.195          qed
  25.196  
  25.197 -        from lz have "Numeral0 < inverse (norm x)"
  25.198 -          by (simp! add: real_inverse_gt_zero1)
  25.199 -        hence inverse_gez: "Numeral0 \<le> inverse (norm x)"
  25.200 +        from lz have "0 < inverse (norm x)"
  25.201 +          by (simp! add: real_inverse_gt_0)
  25.202 +        hence inverse_gez: "0 \<le> inverse (norm x)"
  25.203            by (rule order_less_imp_le)
  25.204  
  25.205          assume "y = \<bar>f x\<bar> * inverse (norm x)"
    26.1 --- a/src/HOL/Real/HahnBanach/HahnBanach.thy	Thu Nov 01 21:12:13 2001 +0100
    26.2 +++ b/src/HOL/Real/HahnBanach/HahnBanach.thy	Fri Nov 02 17:55:24 2001 +0100
    26.3 @@ -201,7 +201,7 @@
    26.4                proof (rule graph_extI)
    26.5                  fix t assume "t \<in> H"
    26.6                  have "(SOME (y, a). t = y + a \<cdot> x' \<and> y \<in> H)
    26.7 -                     = (t, Numeral0)"
    26.8 +                     = (t, 0)"
    26.9                    by (rule decomp_H'_H) (assumption+, rule x')
   26.10                  thus "h t = h' t" by (simp! add: Let_def)
   26.11                next
   26.12 @@ -255,12 +255,12 @@
   26.13                proof (rule graph_extI)
   26.14                  fix x assume "x \<in> F"
   26.15                  have "f x = h x" ..
   26.16 -                also have " ... = h x + Numeral0 * xi" by simp
   26.17 +                also have " ... = h x + 0 * xi" by simp
   26.18                  also
   26.19 -                have "... = (let (y, a) = (x, Numeral0) in h y + a * xi)"
   26.20 +                have "... = (let (y, a) = (x, 0) in h y + a * xi)"
   26.21                    by (simp add: Let_def)
   26.22                  also have
   26.23 -                  "(x, Numeral0) = (SOME (y, a). x = y + a \<cdot> x' \<and> y \<in> H)"
   26.24 +                  "(x, 0) = (SOME (y, a). x = y + a \<cdot> x' \<and> y \<in> H)"
   26.25                    by (rule decomp_H'_H [symmetric]) (simp! add: x')+
   26.26                  also have
   26.27                    "(let (y, a) = (SOME (y, a). x = y + a \<cdot> x' \<and> y \<in> H)
   26.28 @@ -372,10 +372,10 @@
   26.29  
   26.30  txt {* @{text p} is positive definite: *}
   26.31  
   26.32 -show "Numeral0 \<le> p x"
   26.33 +show "0 \<le> p x"
   26.34  proof (unfold p_def, rule real_le_mult_order1a)
   26.35 -  from f_cont f_norm show "Numeral0 \<le> \<parallel>f\<parallel>F,norm" ..
   26.36 -  show "Numeral0 \<le> norm x" ..
   26.37 +  from f_cont f_norm show "0 \<le> \<parallel>f\<parallel>F,norm" ..
   26.38 +  show "0 \<le> norm x" ..
   26.39  qed
   26.40  
   26.41  txt {* @{text p} is absolutely homogenous: *}
   26.42 @@ -402,7 +402,7 @@
   26.43    also
   26.44    have "... \<le> \<parallel>f\<parallel>F,norm * (norm x + norm y)"
   26.45    proof (rule real_mult_le_le_mono1a)
   26.46 -    from f_cont f_norm show "Numeral0 \<le> \<parallel>f\<parallel>F,norm" ..
   26.47 +    from f_cont f_norm show "0 \<le> \<parallel>f\<parallel>F,norm" ..
   26.48      show "norm (x + y) \<le> norm x + norm y" ..
   26.49    qed
   26.50    also have "... = \<parallel>f\<parallel>F,norm * norm x
   26.51 @@ -489,7 +489,7 @@
   26.52  
   26.53      with g_cont e_norm show "?L \<le> ?R"
   26.54      proof (rule fnorm_le_ub)
   26.55 -      from f_cont f_norm show "Numeral0 \<le> \<parallel>f\<parallel>F,norm" ..
   26.56 +      from f_cont f_norm show "0 \<le> \<parallel>f\<parallel>F,norm" ..
   26.57      qed
   26.58  
   26.59      txt{* The other direction is achieved by a similar
   26.60 @@ -509,7 +509,7 @@
   26.61      qed
   26.62      thus "?R \<le> ?L"
   26.63      proof (rule fnorm_le_ub [OF f_cont f_norm])
   26.64 -      from g_cont show "Numeral0 \<le> \<parallel>g\<parallel>E,norm" ..
   26.65 +      from g_cont show "0 \<le> \<parallel>g\<parallel>E,norm" ..
   26.66      qed
   26.67    qed
   26.68  qed
    27.1 --- a/src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy	Thu Nov 01 21:12:13 2001 +0100
    27.2 +++ b/src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy	Fri Nov 02 17:55:24 2001 +0100
    27.3 @@ -279,14 +279,14 @@
    27.4      also have "... \<le> p (y + a \<cdot> x0)"
    27.5      proof (rule linorder_cases)
    27.6  
    27.7 -      assume z: "a = Numeral0"
    27.8 +      assume z: "a = 0"
    27.9        with vs y a show ?thesis by simp
   27.10  
   27.11      txt {* In the case @{text "a < 0"}, we use @{text "a\<^sub>1"}
   27.12      with @{text ya} taken as @{text "y / a"}: *}
   27.13  
   27.14      next
   27.15 -      assume lz: "a < Numeral0" hence nz: "a \<noteq> Numeral0" by simp
   27.16 +      assume lz: "a < 0" hence nz: "a \<noteq> 0" by simp
   27.17        from a1
   27.18        have "- p (inverse a \<cdot> y + x0) - h (inverse a \<cdot> y) \<le> xi"
   27.19          by (rule bspec) (simp!)
   27.20 @@ -315,7 +315,7 @@
   27.21          with @{text ya} taken as @{text "y / a"}: *}
   27.22  
   27.23      next
   27.24 -      assume gz: "Numeral0 < a" hence nz: "a \<noteq> Numeral0" by simp
   27.25 +      assume gz: "0 < a" hence nz: "a \<noteq> 0" by simp
   27.26        from a2 have "xi \<le> p (inverse a \<cdot> y + x0) - h (inverse a \<cdot> y)"
   27.27          by (rule bspec) (simp!)
   27.28  
    28.1 --- a/src/HOL/Real/HahnBanach/Linearform.thy	Thu Nov 01 21:12:13 2001 +0100
    28.2 +++ b/src/HOL/Real/HahnBanach/Linearform.thy	Fri Nov 02 17:55:24 2001 +0100
    28.3 @@ -37,8 +37,8 @@
    28.4    \<Longrightarrow> f (- x) = - f x"
    28.5  proof -
    28.6    assume "is_linearform V f"  "is_vectorspace V"  "x \<in> V"
    28.7 -  have "f (- x) = f ((- Numeral1) \<cdot> x)" by (simp! add: negate_eq1)
    28.8 -  also have "... = (- Numeral1) * (f x)" by (rule linearform_mult)
    28.9 +  have "f (- x) = f ((- 1) \<cdot> x)" by (simp! add: negate_eq1)
   28.10 +  also have "... = (- 1) * (f x)" by (rule linearform_mult)
   28.11    also have "... = - (f x)" by (simp!)
   28.12    finally show ?thesis .
   28.13  qed
   28.14 @@ -58,14 +58,14 @@
   28.15  text {* Every linear form yields @{text 0} for the @{text 0} vector. *}
   28.16  
   28.17  lemma linearform_zero [intro?, simp]:
   28.18 -  "is_vectorspace V \<Longrightarrow> is_linearform V f \<Longrightarrow> f 0 = Numeral0"
   28.19 +  "is_vectorspace V \<Longrightarrow> is_linearform V f \<Longrightarrow> f 0 = 0"
   28.20  proof -
   28.21    assume "is_vectorspace V"  "is_linearform V f"
   28.22    have "f 0 = f (0 - 0)" by (simp!)
   28.23    also have "... = f 0 - f 0"
   28.24      by (rule linearform_diff) (simp!)+
   28.25 -  also have "... = Numeral0" by simp
   28.26 -  finally show "f 0 = Numeral0" .
   28.27 +  also have "... = 0" by simp
   28.28 +  finally show "f 0 = 0" .
   28.29  qed
   28.30  
   28.31  end
    29.1 --- a/src/HOL/Real/HahnBanach/NormedSpace.thy	Thu Nov 01 21:12:13 2001 +0100
    29.2 +++ b/src/HOL/Real/HahnBanach/NormedSpace.thy	Fri Nov 02 17:55:24 2001 +0100
    29.3 @@ -18,19 +18,19 @@
    29.4  constdefs
    29.5    is_seminorm :: "'a::{plus, minus, zero} set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> bool"
    29.6    "is_seminorm V norm \<equiv> \<forall>x \<in> V. \<forall>y \<in> V. \<forall>a.
    29.7 -        Numeral0 \<le> norm x
    29.8 +        0 \<le> norm x
    29.9        \<and> norm (a \<cdot> x) = \<bar>a\<bar> * norm x
   29.10        \<and> norm (x + y) \<le> norm x + norm y"
   29.11  
   29.12  lemma is_seminormI [intro]:
   29.13 -  "(\<And>x y a. x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> Numeral0 \<le> norm x) \<Longrightarrow>
   29.14 +  "(\<And>x y a. x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> 0 \<le> norm x) \<Longrightarrow>
   29.15    (\<And>x a. x \<in> V \<Longrightarrow> norm (a \<cdot> x) = \<bar>a\<bar> * norm x) \<Longrightarrow>
   29.16    (\<And>x y. x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> norm (x + y) \<le> norm x + norm y)
   29.17    \<Longrightarrow> is_seminorm V norm"
   29.18    by (unfold is_seminorm_def) auto
   29.19  
   29.20  lemma seminorm_ge_zero [intro?]:
   29.21 -  "is_seminorm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral0 \<le> norm x"
   29.22 +  "is_seminorm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> 0 \<le> norm x"
   29.23    by (unfold is_seminorm_def) blast
   29.24  
   29.25  lemma seminorm_abs_homogenous:
   29.26 @@ -48,13 +48,13 @@
   29.27    \<Longrightarrow> norm (x - y) \<le> norm x + norm y"
   29.28  proof -
   29.29    assume "is_seminorm V norm"  "x \<in> V"  "y \<in> V"  "is_vectorspace V"
   29.30 -  have "norm (x - y) = norm (x + - Numeral1 \<cdot> y)"
   29.31 +  have "norm (x - y) = norm (x + - 1 \<cdot> y)"
   29.32      by (simp! add: diff_eq2 negate_eq2a)
   29.33 -  also have "... \<le> norm x + norm  (- Numeral1 \<cdot> y)"
   29.34 +  also have "... \<le> norm x + norm  (- 1 \<cdot> y)"
   29.35      by (simp! add: seminorm_subadditive)
   29.36 -  also have "norm (- Numeral1 \<cdot> y) = \<bar>- Numeral1\<bar> * norm y"
   29.37 +  also have "norm (- 1 \<cdot> y) = \<bar>- 1\<bar> * norm y"
   29.38      by (rule seminorm_abs_homogenous)
   29.39 -  also have "\<bar>- Numeral1\<bar> = (Numeral1::real)" by (rule abs_minus_one)
   29.40 +  also have "\<bar>- 1\<bar> = (1::real)" by (rule abs_minus_one)
   29.41    finally show "norm (x - y) \<le> norm x + norm y" by simp
   29.42  qed
   29.43  
   29.44 @@ -63,10 +63,10 @@
   29.45    \<Longrightarrow> norm (- x) = norm x"
   29.46  proof -
   29.47    assume "is_seminorm V norm"  "x \<in> V"  "is_vectorspace V"
   29.48 -  have "norm (- x) = norm (- Numeral1 \<cdot> x)" by (simp! only: negate_eq1)
   29.49 -  also have "... = \<bar>- Numeral1\<bar> * norm x"
   29.50 +  have "norm (- x) = norm (- 1 \<cdot> x)" by (simp! only: negate_eq1)
   29.51 +  also have "... = \<bar>- 1\<bar> * norm x"
   29.52      by (rule seminorm_abs_homogenous)
   29.53 -  also have "\<bar>- Numeral1\<bar> = (Numeral1::real)" by (rule abs_minus_one)
   29.54 +  also have "\<bar>- 1\<bar> = (1::real)" by (rule abs_minus_one)
   29.55    finally show "norm (- x) = norm x" by simp
   29.56  qed
   29.57  
   29.58 @@ -81,10 +81,10 @@
   29.59  constdefs
   29.60    is_norm :: "'a::{plus, minus, zero} set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> bool"
   29.61    "is_norm V norm \<equiv> \<forall>x \<in> V. is_seminorm V norm
   29.62 -      \<and> (norm x = Numeral0) = (x = 0)"
   29.63 +      \<and> (norm x = 0) = (x = 0)"
   29.64  
   29.65  lemma is_normI [intro]:
   29.66 -  "\<forall>x \<in> V.  is_seminorm V norm  \<and> (norm x = Numeral0) = (x = 0)
   29.67 +  "\<forall>x \<in> V.  is_seminorm V norm  \<and> (norm x = 0) = (x = 0)
   29.68    \<Longrightarrow> is_norm V norm" by (simp only: is_norm_def)
   29.69  
   29.70  lemma norm_is_seminorm [intro?]:
   29.71 @@ -92,11 +92,11 @@
   29.72    by (unfold is_norm_def) blast
   29.73  
   29.74  lemma norm_zero_iff:
   29.75 -  "is_norm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> (norm x = Numeral0) = (x = 0)"
   29.76 +  "is_norm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> (norm x = 0) = (x = 0)"
   29.77    by (unfold is_norm_def) blast
   29.78  
   29.79  lemma norm_ge_zero [intro?]:
   29.80 -  "is_norm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral0 \<le> norm x"
   29.81 +  "is_norm V norm \<Longrightarrow> x \<in> V \<Longrightarrow> 0 \<le> norm x"
   29.82    by (unfold is_norm_def is_seminorm_def) blast
   29.83  
   29.84  
   29.85 @@ -125,22 +125,22 @@
   29.86    by (unfold is_normed_vectorspace_def) blast
   29.87  
   29.88  lemma normed_vs_norm_ge_zero [intro?]:
   29.89 -  "is_normed_vectorspace V norm \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral0 \<le> norm x"
   29.90 +  "is_normed_vectorspace V norm \<Longrightarrow> x \<in> V \<Longrightarrow> 0 \<le> norm x"
   29.91    by (unfold is_normed_vectorspace_def) (fast elim: norm_ge_zero)
   29.92  
   29.93  lemma normed_vs_norm_gt_zero [intro?]:
   29.94 -  "is_normed_vectorspace V norm \<Longrightarrow> x \<in> V \<Longrightarrow> x \<noteq> 0 \<Longrightarrow> Numeral0 < norm x"
   29.95 +  "is_normed_vectorspace V norm \<Longrightarrow> x \<in> V \<Longrightarrow> x \<noteq> 0 \<Longrightarrow> 0 < norm x"
   29.96  proof (unfold is_normed_vectorspace_def, elim conjE)
   29.97    assume "x \<in> V"  "x \<noteq> 0"  "is_vectorspace V"  "is_norm V norm"
   29.98 -  have "Numeral0 \<le> norm x" ..
   29.99 -  also have "Numeral0 \<noteq> norm x"
  29.100 +  have "0 \<le> norm x" ..
  29.101 +  also have "0 \<noteq> norm x"
  29.102    proof
  29.103 -    presume "norm x = Numeral0"
  29.104 +    presume "norm x = 0"
  29.105      also have "?this = (x = 0)" by (rule norm_zero_iff)
  29.106      finally have "x = 0" .
  29.107      thus "False" by contradiction
  29.108    qed (rule sym)
  29.109 -  finally show "Numeral0 < norm x" .
  29.110 +  finally show "0 < norm x" .
  29.111  qed
  29.112  
  29.113  lemma normed_vs_norm_abs_homogenous [intro?]:
  29.114 @@ -170,14 +170,14 @@
  29.115      show "is_seminorm F norm"
  29.116      proof
  29.117        fix x y a presume "x \<in> E"
  29.118 -      show "Numeral0 \<le> norm x" ..
  29.119 +      show "0 \<le> norm x" ..
  29.120        show "norm (a \<cdot> x) = \<bar>a\<bar> * norm x" ..
  29.121        presume "y \<in> E"
  29.122        show "norm (x + y) \<le> norm x + norm y" ..
  29.123      qed (simp!)+
  29.124  
  29.125      fix x assume "x \<in> F"
  29.126 -    show "(norm x = Numeral0) = (x = 0)"
  29.127 +    show "(norm x = 0) = (x = 0)"
  29.128      proof (rule norm_zero_iff)
  29.129        show "is_norm E norm" ..
  29.130      qed (simp!)
    30.1 --- a/src/HOL/Real/HahnBanach/Subspace.thy	Thu Nov 01 21:12:13 2001 +0100
    30.2 +++ b/src/HOL/Real/HahnBanach/Subspace.thy	Fri Nov 02 17:55:24 2001 +0100
    30.3 @@ -87,7 +87,7 @@
    30.4      show "0 \<in> U" ..
    30.5      show "\<forall>x \<in> U. \<forall>a. a \<cdot> x \<in> U" by (simp!)
    30.6      show "\<forall>x \<in> U. \<forall>y \<in> U. x + y \<in> U" by (simp!)
    30.7 -    show "\<forall>x \<in> U. - x = -Numeral1 \<cdot> x" by (simp! add: negate_eq1)
    30.8 +    show "\<forall>x \<in> U. - x = - 1 \<cdot> x" by (simp! add: negate_eq1)
    30.9      show "\<forall>x \<in> U. \<forall>y \<in> U. x - y =  x + - y"
   30.10        by (simp! add: diff_eq1)
   30.11    qed (simp! add: vs_add_mult_distrib1 vs_add_mult_distrib2)+
   30.12 @@ -154,7 +154,7 @@
   30.13  lemma x_lin_x: "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> x \<in> lin x"
   30.14  proof (unfold lin_def, intro CollectI exI conjI)
   30.15    assume "is_vectorspace V"  "x \<in> V"
   30.16 -  show "x = Numeral1 \<cdot> x" by (simp!)
   30.17 +  show "x = 1 \<cdot> x" by (simp!)
   30.18  qed simp
   30.19  
   30.20  text {* Any linear closure is a subspace. *}
   30.21 @@ -165,7 +165,7 @@
   30.22    assume "is_vectorspace V"  "x \<in> V"
   30.23    show "0 \<in> lin x"
   30.24    proof (unfold lin_def, intro CollectI exI conjI)
   30.25 -    show "0 = (Numeral0::real) \<cdot> x" by (simp!)
   30.26 +    show "0 = (0::real) \<cdot> x" by (simp!)
   30.27    qed simp
   30.28  
   30.29    show "lin x \<subseteq> V"
   30.30 @@ -383,9 +383,9 @@
   30.31            fix a assume "x = a \<cdot> x'"
   30.32            show ?thesis
   30.33            proof cases
   30.34 -            assume "a = (Numeral0::real)" show ?thesis by (simp!)
   30.35 +            assume "a = (0::real)" show ?thesis by (simp!)
   30.36            next
   30.37 -            assume "a \<noteq> (Numeral0::real)"
   30.38 +            assume "a \<noteq> (0::real)"
   30.39              from h have "inverse a \<cdot> a \<cdot> x' \<in> H"
   30.40                by (rule subspace_mult_closed) (simp!)
   30.41              also have "inverse a \<cdot> a \<cdot> x' = x'" by (simp!)
   30.42 @@ -425,15 +425,15 @@
   30.43  lemma decomp_H'_H:
   30.44    "is_vectorspace E \<Longrightarrow> is_subspace H E \<Longrightarrow> t \<in> H \<Longrightarrow> x' \<notin> H \<Longrightarrow> x' \<in> E
   30.45    \<Longrightarrow> x' \<noteq> 0
   30.46 -  \<Longrightarrow> (SOME (y, a). t = y + a \<cdot> x' \<and> y \<in> H) = (t, (Numeral0::real))"
   30.47 +  \<Longrightarrow> (SOME (y, a). t = y + a \<cdot> x' \<and> y \<in> H) = (t, (0::real))"
   30.48  proof (rule, unfold split_tupled_all)
   30.49    assume "is_vectorspace E"  "is_subspace H E"  "t \<in> H"  "x' \<notin> H"  "x' \<in> E"
   30.50      "x' \<noteq> 0"
   30.51    have h: "is_vectorspace H" ..
   30.52    fix y a presume t1: "t = y + a \<cdot> x'" and "y \<in> H"
   30.53 -  have "y = t \<and> a = (Numeral0::real)"
   30.54 +  have "y = t \<and> a = (0::real)"
   30.55      by (rule decomp_H') (auto!)
   30.56 -  thus "(y, a) = (t, (Numeral0::real))" by (simp!)
   30.57 +  thus "(y, a) = (t, (0::real))" by (simp!)
   30.58  qed (simp_all!)
   30.59  
   30.60  text {*
    31.1 --- a/src/HOL/Real/HahnBanach/VectorSpace.thy	Thu Nov 01 21:12:13 2001 +0100
    31.2 +++ b/src/HOL/Real/HahnBanach/VectorSpace.thy	Fri Nov 02 17:55:24 2001 +0100
    31.3 @@ -31,7 +31,7 @@
    31.4    associative and commutative; @{text "- x"} is the inverse of @{text
    31.5    x} w.~r.~t.~addition and @{text 0} is the neutral element of
    31.6    addition.  Addition and multiplication are distributive; scalar
    31.7 -  multiplication is associative and the real number @{text "Numeral1"} is
    31.8 +  multiplication is associative and the real number @{text "1"} is
    31.9    the neutral element of scalar multiplication.
   31.10  *}
   31.11  
   31.12 @@ -48,8 +48,8 @@
   31.13        \<and> a \<cdot> (x + y) = a \<cdot> x + a \<cdot> y
   31.14        \<and> (a + b) \<cdot> x = a \<cdot> x + b \<cdot> x
   31.15        \<and> (a * b) \<cdot> x = a \<cdot> b \<cdot> x
   31.16 -      \<and> Numeral1 \<cdot> x = x
   31.17 -      \<and> - x = (- Numeral1) \<cdot> x
   31.18 +      \<and> 1 \<cdot> x = x
   31.19 +      \<and> - x = (- 1) \<cdot> x
   31.20        \<and> x - y = x + - y)"
   31.21  
   31.22  
   31.23 @@ -66,15 +66,15 @@
   31.24    \<forall>x \<in> V. \<forall>y \<in> V. \<forall>a. a \<cdot> (x + y) = a \<cdot> x + a \<cdot> y \<Longrightarrow>
   31.25    \<forall>x \<in> V. \<forall>a b. (a + b) \<cdot> x = a \<cdot> x + b \<cdot> x \<Longrightarrow>
   31.26    \<forall>x \<in> V. \<forall>a b. (a * b) \<cdot> x = a \<cdot> b \<cdot> x \<Longrightarrow>
   31.27 -  \<forall>x \<in> V. Numeral1 \<cdot> x = x \<Longrightarrow>
   31.28 -  \<forall>x \<in> V. - x = (- Numeral1) \<cdot> x \<Longrightarrow>
   31.29 +  \<forall>x \<in> V. 1 \<cdot> x = x \<Longrightarrow>
   31.30 +  \<forall>x \<in> V. - x = (- 1) \<cdot> x \<Longrightarrow>
   31.31    \<forall>x \<in> V. \<forall>y \<in> V. x - y = x + - y \<Longrightarrow> is_vectorspace V"
   31.32    by (unfold is_vectorspace_def) auto
   31.33  
   31.34  text {* \medskip The corresponding destruction rules are: *}
   31.35  
   31.36  lemma negate_eq1:
   31.37 -  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> - x = (- Numeral1) \<cdot> x"
   31.38 +  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> - x = (- 1) \<cdot> x"
   31.39    by (unfold is_vectorspace_def) simp
   31.40  
   31.41  lemma diff_eq1:
   31.42 @@ -82,7 +82,7 @@
   31.43    by (unfold is_vectorspace_def) simp
   31.44  
   31.45  lemma negate_eq2:
   31.46 -  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> (- Numeral1) \<cdot> x = - x"
   31.47 +  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> (- 1) \<cdot> x = - x"
   31.48    by (unfold is_vectorspace_def) simp
   31.49  
   31.50  lemma negate_eq2a:
   31.51 @@ -184,7 +184,7 @@
   31.52    by (simp only: vs_mult_assoc)
   31.53  
   31.54  lemma vs_mult_1 [simp]:
   31.55 -  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral1 \<cdot> x = x"
   31.56 +  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> 1 \<cdot> x = x"
   31.57    by (unfold is_vectorspace_def) simp
   31.58  
   31.59  lemma vs_diff_mult_distrib1:
   31.60 @@ -212,14 +212,14 @@
   31.61  text {* \medskip Further derived laws: *}
   31.62  
   31.63  lemma vs_mult_zero_left [simp]:
   31.64 -  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> Numeral0 \<cdot> x = 0"
   31.65 +  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> 0 \<cdot> x = 0"
   31.66  proof -
   31.67    assume "is_vectorspace V"  "x \<in> V"
   31.68 -  have  "Numeral0 \<cdot> x = (Numeral1 - Numeral1) \<cdot> x" by simp
   31.69 -  also have "... = (Numeral1 + - Numeral1) \<cdot> x" by simp
   31.70 -  also have "... =  Numeral1 \<cdot> x + (- Numeral1) \<cdot> x"
   31.71 +  have  "0 \<cdot> x = (1 - 1) \<cdot> x" by simp
   31.72 +  also have "... = (1 + - 1) \<cdot> x" by simp
   31.73 +  also have "... =  1 \<cdot> x + (- 1) \<cdot> x"
   31.74      by (rule vs_add_mult_distrib2)
   31.75 -  also have "... = x + (- Numeral1) \<cdot> x" by (simp!)
   31.76 +  also have "... = x + (- 1) \<cdot> x" by (simp!)
   31.77    also have "... = x + - x" by (simp! add: negate_eq2a)
   31.78    also have "... = x - x" by (simp! add: diff_eq2)
   31.79    also have "... = 0" by (simp!)
   31.80 @@ -349,12 +349,12 @@
   31.81  qed
   31.82  
   31.83  lemma vs_mult_left_cancel:
   31.84 -  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> a \<noteq> Numeral0 \<Longrightarrow>
   31.85 +  "is_vectorspace V \<Longrightarrow> x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> a \<noteq> 0 \<Longrightarrow>
   31.86    (a \<cdot> x = a \<cdot> y) = (x = y)"
   31.87    (concl is "?L = ?R")
   31.88  proof
   31.89 -  assume "is_vectorspace V"  "x \<in> V"  "y \<in> V"  "a \<noteq> Numeral0"
   31.90 -  have "x = Numeral1 \<cdot> x" by (simp!)
   31.91 +  assume "is_vectorspace V"  "x \<in> V"  "y \<in> V"  "a \<noteq> 0"
   31.92 +  have "x = 1 \<cdot> x" by (simp!)
   31.93    also have "... = (inverse a * a) \<cdot> x" by (simp!)
   31.94    also have "... = inverse a \<cdot> (a \<cdot> x)"
   31.95      by (simp! only: vs_mult_assoc)
    32.1 --- a/src/HOL/Real/PNat.ML	Thu Nov 01 21:12:13 2001 +0100
    32.2 +++ b/src/HOL/Real/PNat.ML	Fri Nov 02 17:55:24 2001 +0100
    32.3 @@ -38,7 +38,7 @@
    32.4  qed "PNat_induct";
    32.5  
    32.6  val prems = Goalw [pnat_one_def,pnat_Suc_def]
    32.7 -    "[| P(1p);   \
    32.8 +    "[| P(1);   \
    32.9  \       !!n. P(n) ==> P(pSuc n) |]  ==> P(n)";
   32.10  by (rtac (Rep_pnat_inverse RS subst) 1);   
   32.11  by (rtac (Rep_pnat RS PNat_induct) 1);
   32.12 @@ -51,8 +51,8 @@
   32.13    induct_thm_tac pnat_induct a i  THEN  rename_last_tac a [""] (i+1);
   32.14  
   32.15  val prems = Goal
   32.16 -    "[| !!x. P x 1p;  \
   32.17 -\       !!y. P 1p (pSuc y);  \
   32.18 +    "[| !!x. P x 1;  \
   32.19 +\       !!y. P 1 (pSuc y);  \
   32.20  \       !!x y. [| P x y |] ==> P (pSuc x) (pSuc y)  \
   32.21  \    |] ==> P m n";
   32.22  by (res_inst_tac [("x","m")] spec 1);
   32.23 @@ -64,8 +64,8 @@
   32.24  
   32.25  (*Case analysis on the natural numbers*)
   32.26  val prems = Goal
   32.27 -    "[| n=1p ==> P;  !!x. n = pSuc(x) ==> P |] ==> P";
   32.28 -by (subgoal_tac "n=1p | (EX x. n = pSuc(x))" 1);
   32.29 +    "[| n=1 ==> P;  !!x. n = pSuc(x) ==> P |] ==> P";
   32.30 +by (subgoal_tac "n=1 | (EX x. n = pSuc(x))" 1);
   32.31  by (fast_tac (claset() addSEs prems) 1);
   32.32  by (pnat_ind_tac "n" 1);
   32.33  by (rtac (refl RS disjI1) 1);
   32.34 @@ -131,7 +131,7 @@
   32.35  
   32.36  (*** Distinctness of constructors ***)
   32.37  
   32.38 -Goalw [pnat_one_def,pnat_Suc_def] "pSuc(m) ~= 1p";
   32.39 +Goalw [pnat_one_def,pnat_Suc_def] "pSuc(m) ~= 1";
   32.40  by (rtac (inj_on_Abs_pnat RS inj_on_contraD) 1);
   32.41  by (rtac (Rep_pnat_gt_zero RS Suc_mono RS less_not_refl2) 1);
   32.42  by (REPEAT (resolve_tac [Rep_pnat RS  pnat_Suc_RepI, one_RepI] 1));
   32.43 @@ -169,12 +169,12 @@
   32.44  
   32.45  bind_thm ("pSuc_n_not_n", n_not_pSuc_n RS not_sym);
   32.46  
   32.47 -Goal "n ~= 1p ==> EX m. n = pSuc m";
   32.48 +Goal "n ~= 1 ==> EX m. n = pSuc m";
   32.49  by (rtac pnatE 1);
   32.50  by (REPEAT (Blast_tac 1));
   32.51 -qed "not1p_implies_pSuc";
   32.52 +qed "not1_implies_pSuc";
   32.53  
   32.54 -Goal "pSuc m = m + 1p";
   32.55 +Goal "pSuc m = m + 1";
   32.56  by (auto_tac (claset(),simpset() addsimps [pnat_Suc_def,
   32.57      pnat_one_def,Abs_pnat_inverse,pnat_add_def]));
   32.58  qed "pSuc_is_plus_one";
   32.59 @@ -485,12 +485,12 @@
   32.60  (** embedding of naturals in positive naturals **)
   32.61  
   32.62  (* pnat_one_eq! *)
   32.63 -Goalw [pnat_of_nat_def,pnat_one_def]"1p = pnat_of_nat 0";
   32.64 +Goalw [pnat_of_nat_def,pnat_one_def]"1 = pnat_of_nat 0";
   32.65  by (Full_simp_tac 1);
   32.66  qed "pnat_one_iff";
   32.67  
   32.68  Goalw [pnat_of_nat_def,pnat_one_def,
   32.69 -       pnat_add_def] "1p + 1p = pnat_of_nat 1";
   32.70 +       pnat_add_def] "1 + 1 = pnat_of_nat 1";
   32.71  by (res_inst_tac [("f","Abs_pnat")] arg_cong 1);
   32.72  by (auto_tac (claset() addIs [(gt_0_mem_pnat RS Abs_pnat_inverse RS ssubst)],
   32.73      simpset()));
   32.74 @@ -514,7 +514,7 @@
   32.75  (* this worked with one call to auto_tac before! *)
   32.76  Goalw [pnat_add_def,pnat_of_nat_def,pnat_one_def] 
   32.77        "pnat_of_nat n1 + pnat_of_nat n2 = \
   32.78 -\      pnat_of_nat (n1 + n2) + 1p";
   32.79 +\      pnat_of_nat (n1 + n2) + 1";
   32.80  by (res_inst_tac [("f","Abs_pnat")] arg_cong 1);
   32.81  by (rtac (gt_0_mem_pnat RS Abs_pnat_inverse RS ssubst) 1);
   32.82  by (rtac (gt_0_mem_pnat RS Abs_pnat_inverse RS ssubst) 2);
    33.1 --- a/src/HOL/Real/PNat.thy	Thu Nov 01 21:12:13 2001 +0100
    33.2 +++ b/src/HOL/Real/PNat.thy	Fri Nov 02 17:55:24 2001 +0100
    33.3 @@ -12,12 +12,11 @@
    33.4    pnat = "lfp(%X. {Suc 0} Un Suc`X)"   (lfp_def)
    33.5  
    33.6  instance
    33.7 -   pnat :: {ord, plus, times}
    33.8 +   pnat :: {ord, one, plus, times}
    33.9  
   33.10  consts
   33.11  
   33.12    pSuc       :: pnat => pnat
   33.13 -  "1p"       :: pnat                ("1p")
   33.14  
   33.15  constdefs
   33.16    
   33.17 @@ -27,7 +26,7 @@
   33.18  defs
   33.19  
   33.20    pnat_one_def      
   33.21 -       "1p == Abs_pnat(Suc 0)"
   33.22 +       "1 == Abs_pnat(Suc 0)"
   33.23    pnat_Suc_def      
   33.24         "pSuc == (%n. Abs_pnat(Suc(Rep_pnat(n))))"
   33.25  
    34.1 --- a/src/HOL/Real/PRat.ML	Thu Nov 01 21:12:13 2001 +0100
    34.2 +++ b/src/HOL/Real/PRat.ML	Fri Nov 02 17:55:24 2001 +0100
    34.3 @@ -524,7 +524,7 @@
    34.4  qed "prat_qinv_gt_1";
    34.5  
    34.6  Goalw [pnat_one_def] 
    34.7 -     "q1 < prat_of_pnat 1p ==> prat_of_pnat 1p < qinv(q1)";
    34.8 +     "q1 < prat_of_pnat 1 ==> prat_of_pnat 1 < qinv(q1)";
    34.9  by (etac prat_qinv_gt_1 1);
   34.10  qed "prat_qinv_is_gt_1";
   34.11  
   34.12 @@ -562,7 +562,7 @@
   34.13  by (simp_tac (simpset() addsimps [prat_self_less_add_right]) 1);
   34.14  qed "prat_self_less_add_left";
   34.15  
   34.16 -Goalw [prat_less_def] "prat_of_pnat 1p < y ==> (x::prat) < x * y";
   34.17 +Goalw [prat_less_def] "prat_of_pnat 1 < y ==> (x::prat) < x * y";
   34.18  by (auto_tac (claset(),simpset() addsimps [pnat_one_def,
   34.19      prat_add_mult_distrib2]));
   34.20  qed "prat_self_less_mult_right";
    35.1 --- a/src/HOL/Real/PReal.ML	Thu Nov 01 21:12:13 2001 +0100
    35.2 +++ b/src/HOL/Real/PReal.ML	Fri Nov 02 17:55:24 2001 +0100
    35.3 @@ -7,8 +7,6 @@
    35.4                    [Gleason- p. 121] provides some of the definitions.
    35.5  *)
    35.6  
    35.7 -claset_ref() := claset() delWrapper "bspec";
    35.8 -
    35.9  Goal "inj_on Abs_preal preal";
   35.10  by (rtac inj_on_inverseI 1);
   35.11  by (etac Abs_preal_inverse 1);
   35.12 @@ -627,7 +625,7 @@
   35.13  (******)
   35.14  
   35.15  (*** FIXME: long! ***)
   35.16 -Goal "prat_of_pnat 1p < x ==> EX r: Rep_preal(A). r*x ~: Rep_preal(A)";
   35.17 +Goal "prat_of_pnat 1 < x ==> EX r: Rep_preal(A). r*x ~: Rep_preal(A)";
   35.18  by (res_inst_tac [("X1","A")] (mem_Rep_preal_Ex RS exE) 1);
   35.19  by (res_inst_tac [("Q","xa*x : Rep_preal(A)")] (excluded_middle RS disjE) 1);
   35.20  by (Fast_tac 1);
    36.1 --- a/src/HOL/Real/PReal.thy	Thu Nov 01 21:12:13 2001 +0100
    36.2 +++ b/src/HOL/Real/PReal.thy	Fri Nov 02 17:55:24 2001 +0100
    36.3 @@ -28,16 +28,16 @@
    36.4  defs
    36.5  
    36.6    preal_add_def
    36.7 -        "R + S == Abs_preal({w. ? x: Rep_preal(R). ? y: Rep_preal(S). w = x + y})"
    36.8 +    "R + S == Abs_preal({w. ? x: Rep_preal(R). ? y: Rep_preal(S). w = x + y})"
    36.9  
   36.10    preal_mult_def
   36.11 -        "R * S == Abs_preal({w. ? x: Rep_preal(R). ? y: Rep_preal(S). w = x * y})"
   36.12 +    "R * S == Abs_preal({w. ? x: Rep_preal(R). ? y: Rep_preal(S). w = x * y})"
   36.13  
   36.14    preal_less_def
   36.15 -        "R < (S::preal) == Rep_preal(R) < Rep_preal(S)"
   36.16 +    "R < (S::preal) == Rep_preal(R) < Rep_preal(S)"
   36.17  
   36.18    preal_le_def
   36.19 -        "R <= (S::preal) == Rep_preal(R) <= Rep_preal(S)"
   36.20 +    "R <= (S::preal) == Rep_preal(R) <= Rep_preal(S)"
   36.21   
   36.22  end
   36.23  
    37.1 --- a/src/HOL/Real/RComplete.ML	Thu Nov 01 21:12:13 2001 +0100
    37.2 +++ b/src/HOL/Real/RComplete.ML	Fri Nov 02 17:55:24 2001 +0100
    37.3 @@ -6,8 +6,6 @@
    37.4  Completeness theorems for positive reals and reals.
    37.5  *) 
    37.6  
    37.7 -claset_ref() := claset() delWrapper "bspec";
    37.8 -
    37.9  Goal "x/2 + x/2 = (x::real)";
   37.10  by (Simp_tac 1);
   37.11  qed "real_sum_of_halves";
   37.12 @@ -18,29 +16,25 @@
   37.13         previously in Real.ML. 
   37.14   ---------------------------------------------------------*)
   37.15   (*a few lemmas*)
   37.16 -Goal "ALL x:P. Numeral0 < x ==> \ 
   37.17 +Goal "ALL x:P. 0 < x ==> \ 
   37.18  \       ((EX x:P. y < x) = (EX X. real_of_preal X : P & \
   37.19  \                          y < real_of_preal X))";
   37.20  by (blast_tac (claset() addSDs [bspec, 
   37.21 -		    rename_numerals real_gt_zero_preal_Ex RS iffD1]) 1);
   37.22 +		    real_gt_zero_preal_Ex RS iffD1]) 1);
   37.23  qed "real_sup_lemma1";
   37.24  
   37.25 -Goal "[| ALL x:P. Numeral0 < x; EX x. x: P; EX y. ALL x: P. x < y |] \
   37.26 +Goal "[| ALL x:P. 0 < x;  a: P;   ALL x: P. x < y |] \
   37.27  \         ==> (EX X. X: {w. real_of_preal w : P}) & \
   37.28  \             (EX Y. ALL X: {w. real_of_preal w : P}. X < Y)";
   37.29  by (rtac conjI 1);
   37.30  by (blast_tac (claset() addDs [bspec, 
   37.31 -                rename_numerals real_gt_zero_preal_Ex RS iffD1]) 1);
   37.32 +                real_gt_zero_preal_Ex RS iffD1]) 1);
   37.33  by Auto_tac;
   37.34  by (dtac bspec 1 THEN assume_tac 1);
   37.35  by (ftac bspec 1  THEN assume_tac 1);
   37.36 -by (dtac order_less_trans 1 THEN assume_tac 1);
   37.37 -by (dtac ((rename_numerals real_gt_zero_preal_Ex) RS iffD1) 1
   37.38 -    THEN etac exE 1);    
   37.39 -by (res_inst_tac [("x","ya")] exI 1);
   37.40 -by Auto_tac;
   37.41 -by (dres_inst_tac [("x","real_of_preal X")] bspec 1 THEN assume_tac 1);
   37.42 -by (etac real_of_preal_lessD 1);
   37.43 +by (dtac order_less_trans 1 THEN assume_tac 1); 
   37.44 +by (dtac (real_gt_zero_preal_Ex RS iffD1) 1);
   37.45 +by (Force_tac 1);     
   37.46  qed "real_sup_lemma2";
   37.47  
   37.48  (*-------------------------------------------------------------
   37.49 @@ -49,33 +43,33 @@
   37.50  
   37.51  (**
   37.52   Supremum property for the set of positive reals
   37.53 - FIXME: long proof - should be improved - need 
   37.54 - only have one case split 
   37.55 + FIXME: long proof - should be improved
   37.56  **)
   37.57  
   37.58 -Goal "[| ALL x:P. (Numeral0::real) < x; EX x. x: P; EX y. ALL x: P. x < y |] \
   37.59 -\         ==> (EX S. ALL y. (EX x: P. y < x) = (y < S))";
   37.60 +(*Let P be a non-empty set of positive reals, with an upper bound y.
   37.61 +  Then P has a least upper bound (written S).*)
   37.62 +Goal "[| ALL x:P. (0::real) < x;  EX x. x: P;  EX y. ALL x: P. x<y |] \
   37.63 +\     ==> (EX S. ALL y. (EX x: P. y < x) = (y < S))";
   37.64  by (res_inst_tac 
   37.65     [("x","real_of_preal (psup({w. real_of_preal w : P}))")] exI 1);
   37.66 -by Auto_tac;
   37.67 -by (ftac real_sup_lemma2 1 THEN Auto_tac);
   37.68 -by (case_tac "Numeral0 < ya" 1);
   37.69 -by (dtac ((rename_numerals real_gt_zero_preal_Ex) RS iffD1) 1);
   37.70 -by (dtac (rename_numerals real_less_all_real2) 2);
   37.71 +by (Clarify_tac 1); 
   37.72 +by (case_tac "0 < ya" 1);
   37.73 +by Auto_tac; 
   37.74 +by (ftac real_sup_lemma2 1 THEN REPEAT (assume_tac 1));
   37.75 +by (dtac (real_gt_zero_preal_Ex RS iffD1) 1);
   37.76 +by (dtac (real_less_all_real2) 3);
   37.77  by Auto_tac;
   37.78  by (rtac (preal_complete RS spec RS iffD1) 1);
   37.79  by Auto_tac;
   37.80  by (ftac real_gt_preal_preal_Ex 1);
   37.81 -by Auto_tac;
   37.82 +by (Force_tac 1);   
   37.83  (* second part *)
   37.84  by (rtac (real_sup_lemma1 RS iffD2) 1 THEN assume_tac 1);
   37.85 -by (case_tac "Numeral0 < ya" 1);
   37.86 -by (auto_tac (claset() addSDs (map rename_numerals
   37.87 -			       [real_less_all_real2,
   37.88 -				real_gt_zero_preal_Ex RS iffD1]),
   37.89 +by (auto_tac (claset() addSDs [real_less_all_real2,
   37.90 +                               real_gt_zero_preal_Ex RS iffD1],
   37.91  	      simpset()));
   37.92 -by (ftac real_sup_lemma2 2 THEN Auto_tac);
   37.93 -by (ftac real_sup_lemma2 1 THEN Auto_tac);
   37.94 +by (ftac real_sup_lemma2 2 THEN REPEAT (assume_tac 1));
   37.95 +by (ftac real_sup_lemma2 1 THEN REPEAT (assume_tac 1));
   37.96  by (rtac (preal_complete RS spec RS iffD2 RS bexE) 1);
   37.97  by (Blast_tac 3);
   37.98  by (ALLGOALS(Blast_tac));
   37.99 @@ -100,7 +94,7 @@
  37.100             Completeness theorem for the positive reals(again)
  37.101   ----------------------------------------------------------------*)
  37.102  
  37.103 -Goal "[| ALL x: S. Numeral0 < x; \
  37.104 +Goal "[| ALL x: S. 0 < x; \
  37.105  \        EX x. x: S; \
  37.106  \        EX u. isUb (UNIV::real set) S u \
  37.107  \     |] ==> EX t. isLub (UNIV::real set) S t";
  37.108 @@ -109,10 +103,10 @@
  37.109  by (auto_tac (claset(), simpset() addsimps 
  37.110      [isLub_def,leastP_def,isUb_def]));
  37.111  by (auto_tac (claset() addSIs [setleI,setgeI] 
  37.112 -	         addSDs [(rename_numerals real_gt_zero_preal_Ex) RS iffD1],
  37.113 +	         addSDs [(real_gt_zero_preal_Ex) RS iffD1],
  37.114  	      simpset()));
  37.115  by (forw_inst_tac [("x","y")] bspec 1 THEN assume_tac 1);
  37.116 -by (dtac ((rename_numerals real_gt_zero_preal_Ex) RS iffD1) 1);
  37.117 +by (dtac ((real_gt_zero_preal_Ex) RS iffD1) 1);
  37.118  by (auto_tac (claset(), simpset() addsimps [real_of_preal_le_iff]));
  37.119  by (rtac preal_psup_leI2a 1);
  37.120  by (forw_inst_tac [("y","real_of_preal ya")] setleD 1 THEN assume_tac 1);
  37.121 @@ -122,7 +116,7 @@
  37.122  by (blast_tac (claset() addSDs [setleD] addIs [real_of_preal_le_iff RS iffD1]) 1);
  37.123  by (forw_inst_tac [("x","x")] bspec 1 THEN assume_tac 1);
  37.124  by (ftac isUbD2 1);
  37.125 -by (dtac ((rename_numerals real_gt_zero_preal_Ex) RS iffD1) 1);
  37.126 +by (dtac ((real_gt_zero_preal_Ex) RS iffD1) 1);
  37.127  by (auto_tac (claset() addSDs [isUbD, real_ge_preal_preal_Ex],
  37.128  	      simpset() addsimps [real_of_preal_le_iff]));
  37.129  by (blast_tac (claset() addSDs [setleD] addSIs [psup_le_ub1] 
  37.130 @@ -133,16 +127,17 @@
  37.131  (*-------------------------------
  37.132      Lemmas
  37.133   -------------------------------*)
  37.134 -Goal "ALL y : {z. EX x: P. z = x + (-xa) + Numeral1} Int {x. Numeral0 < x}. Numeral0 < y";
  37.135 +Goal "ALL y : {z. EX x: P. z = x + (-xa) + 1} Int {x. 0 < x}. 0 < y";
  37.136  by Auto_tac;
  37.137  qed "real_sup_lemma3";
  37.138   
  37.139  Goal "(xa <= S + X + (-Z)) = (xa + (-X) + Z <= (S::real))";
  37.140 -by (Auto_tac);
  37.141 +by Auto_tac;
  37.142  qed "lemma_le_swap2";
  37.143  
  37.144 -Goal "[| (x::real) + (-X) + Numeral1 <= S; xa <= x |] ==> xa <= S + X + (-Numeral1)";
  37.145 -by (Auto_tac);
  37.146 +Goal "[| (x::real) + (-X) + 1 <= S; xa <= x |] ==> xa <= S + X + (- 1)";
  37.147 +by (arith_tac 1);
  37.148 +by Auto_tac;
  37.149  qed "lemma_real_complete2b";
  37.150  
  37.151  (*----------------------------------------------------------
  37.152 @@ -151,19 +146,19 @@
  37.153  Goal "[| EX X. X: S;  EX Y. isUb (UNIV::real set) S Y |]  \
  37.154  \     ==> EX t. isLub (UNIV :: real set) S t";
  37.155  by (Step_tac 1);
  37.156 -by (subgoal_tac "EX u. u: {z. EX x: S. z = x + (-X) + Numeral1} \
  37.157 -\                Int {x. Numeral0 < x}" 1);
  37.158 -by (subgoal_tac "isUb (UNIV::real set) ({z. EX x: S. z = x + (-X) + Numeral1} \
  37.159 -\                Int {x. Numeral0 < x})  (Y + (-X) + Numeral1)" 1); 
  37.160 +by (subgoal_tac "EX u. u: {z. EX x: S. z = x + (-X) + 1} \
  37.161 +\                Int {x. 0 < x}" 1);
  37.162 +by (subgoal_tac "isUb (UNIV::real set) ({z. EX x: S. z = x + (-X) + 1} \
  37.163 +\                Int {x. 0 < x})  (Y + (-X) + 1)" 1); 
  37.164  by (cut_inst_tac [("P","S"),("xa","X")] real_sup_lemma3 1);
  37.165  by (EVERY1[forward_tac [exI RSN (3,posreals_complete)], Blast_tac, Blast_tac, 
  37.166  	   Step_tac]);
  37.167 -by (res_inst_tac [("x","t + X + (-Numeral1)")] exI 1);
  37.168 +by (res_inst_tac [("x","t + X + (- 1)")] exI 1);
  37.169  by (rtac isLubI2 1);
  37.170  by (rtac setgeI 2 THEN Step_tac 2);
  37.171 -by (subgoal_tac "isUb (UNIV:: real set) ({z. EX x: S. z = x + (-X) + Numeral1} \
  37.172 -\                Int {x. Numeral0 < x})  (y + (-X) + Numeral1)" 2); 
  37.173 -by (dres_inst_tac [("y","(y + (- X) + Numeral1)")] isLub_le_isUb 2 
  37.174 +by (subgoal_tac "isUb (UNIV:: real set) ({z. EX x: S. z = x + (-X) + 1} \
  37.175 +\                Int {x. 0 < x})  (y + (-X) + 1)" 2); 
  37.176 +by (dres_inst_tac [("y","(y + (- X) + 1)")] isLub_le_isUb 2 
  37.177        THEN assume_tac 2);
  37.178  by (full_simp_tac
  37.179      (simpset() addsimps [real_diff_def, real_diff_le_eq RS sym] @
  37.180 @@ -194,15 +189,15 @@
  37.181          Related: Archimedean property of reals
  37.182   ----------------------------------------------------------------*)
  37.183  
  37.184 -Goal "Numeral0 < real (Suc n)";
  37.185 +Goal "0 < real (Suc n)";
  37.186  by (res_inst_tac [("y","real n")] order_le_less_trans 1); 
  37.187 -by (rtac (rename_numerals real_of_nat_ge_zero) 1);
  37.188 +by (rtac (real_of_nat_ge_zero) 1);
  37.189  by (simp_tac (simpset() addsimps [real_of_nat_Suc]) 1); 
  37.190  qed "real_of_nat_Suc_gt_zero";
  37.191  
  37.192 -Goal "Numeral0 < x ==> EX n. inverse (real(Suc n)) < x";
  37.193 +Goal "0 < x ==> EX n. inverse (real(Suc n)) < x";
  37.194  by (rtac ccontr 1);
  37.195 -by (subgoal_tac "ALL n. x * real (Suc n) <= Numeral1" 1);
  37.196 +by (subgoal_tac "ALL n. x * real (Suc n) <= 1" 1);
  37.197  by (asm_full_simp_tac
  37.198      (simpset() addsimps [linorder_not_less, real_inverse_eq_divide]) 2); 
  37.199  by (Clarify_tac 2);
  37.200 @@ -213,7 +208,7 @@
  37.201  	 addsimps [real_of_nat_Suc_gt_zero RS real_not_refl2 RS not_sym, 
  37.202                     real_mult_commute]) 2); 
  37.203  by (subgoal_tac "isUb (UNIV::real set) \
  37.204 -\                     {z. EX n. z = x*(real (Suc n))} Numeral1" 1);
  37.205 +\                     {z. EX n. z = x*(real (Suc n))} 1" 1);
  37.206  by (subgoal_tac "EX X. X : {z. EX n. z = x*(real (Suc n))}" 1);
  37.207  by (dtac reals_complete 1);
  37.208  by (auto_tac (claset() addIs [isUbI,setleI],simpset()));
  37.209 @@ -234,17 +229,16 @@
  37.210  (*There must be other proofs, e.g. Suc of the largest integer in the
  37.211    cut representing x*)
  37.212  Goal "EX n. (x::real) < real (n::nat)";
  37.213 -by (res_inst_tac [("R1.0","x"),("R2.0","Numeral0")] real_linear_less2 1);
  37.214 +by (res_inst_tac [("R1.0","x"),("R2.0","0")] real_linear_less2 1);
  37.215  by (res_inst_tac [("x","0")] exI 1);
  37.216  by (res_inst_tac [("x","1")] exI 2);
  37.217  by (auto_tac (claset() addEs [order_less_trans],
  37.218  	      simpset() addsimps [real_of_nat_one]));
  37.219 -by (ftac ((rename_numerals real_inverse_gt_zero) RS reals_Archimedean) 1);
  37.220 +by (ftac (real_inverse_gt_0 RS reals_Archimedean) 1);
  37.221  by (Step_tac 1 THEN res_inst_tac [("x","Suc n")] exI 1);
  37.222 -by (forw_inst_tac [("y","inverse x")]
  37.223 -    (rename_numerals real_mult_less_mono1) 1);
  37.224 +by (forw_inst_tac [("y","inverse x")] real_mult_less_mono1 1);
  37.225  by Auto_tac;  
  37.226 -by (dres_inst_tac [("y","Numeral1"),("z","real (Suc n)")]
  37.227 +by (dres_inst_tac [("y","1"),("z","real (Suc n)")]
  37.228      (rotate_prems 1 real_mult_less_mono2) 1);
  37.229  by (auto_tac (claset(),
  37.230  	      simpset() addsimps [real_of_nat_Suc_gt_zero,
    38.1 --- a/src/HOL/Real/RealAbs.ML	Thu Nov 01 21:12:13 2001 +0100
    38.2 +++ b/src/HOL/Real/RealAbs.ML	Fri Nov 02 17:55:24 2001 +0100
    38.3 @@ -15,15 +15,15 @@
    38.4  by (simp_tac
    38.5      (simpset () addsimps
    38.6        bin_arith_simps@
    38.7 -      [minus_real_number_of, zero_eq_numeral_0, le_real_number_of_eq_not_less,
    38.8 +      [minus_real_number_of, le_real_number_of_eq_not_less,
    38.9         less_real_number_of, real_of_int_le_iff]) 1);
   38.10  qed "abs_nat_number_of";
   38.11  
   38.12  Addsimps [abs_nat_number_of];
   38.13  
   38.14  Goalw [real_abs_def]
   38.15 -  "P(abs (x::real)) = ((Numeral0 <= x --> P x) & (x < Numeral0 --> P(-x)))";
   38.16 -by(auto_tac (claset(), simpset() addsimps [zero_eq_numeral_0]));
   38.17 +  "P(abs (x::real)) = ((0 <= x --> P x) & (x < 0 --> P(-x)))";
   38.18 +by Auto_tac;
   38.19  qed "abs_split";
   38.20  
   38.21  
   38.22 @@ -32,36 +32,37 @@
   38.23         (adapted version of previously proved theorems about abs)
   38.24   ----------------------------------------------------------------------------*)
   38.25  
   38.26 -Goalw [real_abs_def] "abs (r::real) = (if Numeral0<=r then r else -r)";
   38.27 +Goalw [real_abs_def] "abs (r::real) = (if 0<=r then r else -r)";
   38.28  by Auto_tac;
   38.29  qed "abs_iff";
   38.30  
   38.31 -Goalw [real_abs_def] "abs Numeral0 = (Numeral0::real)";
   38.32 +Goalw [real_abs_def] "abs 0 = (0::real)";
   38.33  by Auto_tac;
   38.34  qed "abs_zero";
   38.35  Addsimps [abs_zero];
   38.36  
   38.37 -Goalw [real_abs_def] "abs (Numeral0::real) = -Numeral0";
   38.38 +Goalw [real_abs_def] "abs (1::real) = 1";
   38.39  by (Simp_tac 1);
   38.40 -qed "abs_minus_zero";
   38.41 +qed "abs_one";
   38.42 +Addsimps [abs_one];
   38.43  
   38.44 -Goalw [real_abs_def] "(Numeral0::real)<=x ==> abs x = x";
   38.45 +Goalw [real_abs_def] "(0::real)<=x ==> abs x = x";
   38.46  by (Asm_simp_tac 1);
   38.47  qed "abs_eqI1";
   38.48  
   38.49 -Goalw [real_abs_def] "(Numeral0::real) < x ==> abs x = x";
   38.50 +Goalw [real_abs_def] "(0::real) < x ==> abs x = x";
   38.51  by (Asm_simp_tac 1);
   38.52  qed "abs_eqI2";
   38.53  
   38.54 -Goalw [real_abs_def,real_le_def] "x < (Numeral0::real) ==> abs x = -x";
   38.55 +Goalw [real_abs_def,real_le_def] "x < (0::real) ==> abs x = -x";
   38.56  by (Asm_simp_tac 1);
   38.57  qed "abs_minus_eqI2";
   38.58  
   38.59 -Goalw [real_abs_def] "x<=(Numeral0::real) ==> abs x = -x";
   38.60 +Goalw [real_abs_def] "x<=(0::real) ==> abs x = -x";
   38.61  by (Asm_simp_tac 1);
   38.62  qed "abs_minus_eqI1";
   38.63  
   38.64 -Goalw [real_abs_def] "(Numeral0::real)<= abs x";
   38.65 +Goalw [real_abs_def] "(0::real)<= abs x";
   38.66  by (Simp_tac 1);
   38.67  qed "abs_ge_zero";
   38.68  
   38.69 @@ -70,17 +71,17 @@
   38.70  qed "abs_idempotent";
   38.71  Addsimps [abs_idempotent];
   38.72  
   38.73 -Goalw [real_abs_def] "(abs x = Numeral0) = (x=(Numeral0::real))";
   38.74 +Goalw [real_abs_def] "(abs x = 0) = (x=(0::real))";
   38.75  by (Full_simp_tac 1);
   38.76  qed "abs_zero_iff";
   38.77  AddIffs [abs_zero_iff];
   38.78  
   38.79  Goalw [real_abs_def] "x<=abs (x::real)";
   38.80 -by (simp_tac (simpset() addsimps [zero_eq_numeral_0]) 1);
   38.81 +by (Simp_tac 1);
   38.82  qed "abs_ge_self";
   38.83  
   38.84  Goalw [real_abs_def] "-x<=abs (x::real)";
   38.85 -by (simp_tac (simpset() addsimps [zero_eq_numeral_0]) 1);
   38.86 +by (Simp_tac 1);
   38.87  qed "abs_ge_minus_self";
   38.88  
   38.89  Goalw [real_abs_def] "abs (x * y) = abs x * abs (y::real)";
   38.90 @@ -91,8 +92,8 @@
   38.91  Goalw [real_abs_def] "abs(inverse(x::real)) = inverse(abs(x))";
   38.92  by (real_div_undefined_case_tac "x=0" 1);
   38.93  by (auto_tac (claset(), 
   38.94 -              simpset() addsimps [real_minus_inverse, real_le_less] @ 
   38.95 -	          (map rename_numerals [INVERSE_ZERO, real_inverse_gt_zero])));
   38.96 +              simpset() addsimps [real_minus_inverse, real_le_less,
   38.97 +                                  INVERSE_ZERO, real_inverse_gt_0]));
   38.98  qed "abs_inverse";
   38.99  
  38.100  Goal "abs (x * inverse y) = (abs x) * inverse (abs (y::real))";
  38.101 @@ -130,16 +131,16 @@
  38.102  qed "abs_add_minus_less";
  38.103  
  38.104  (* lemmas manipulating terms *)
  38.105 -Goal "((Numeral0::real)*x < r)=(Numeral0 < r)";
  38.106 +Goal "((0::real)*x < r)=(0 < r)";
  38.107  by (Simp_tac 1);
  38.108  qed "real_mult_0_less";
  38.109  
  38.110 -Goal "[| (Numeral0::real) < y; x < r; y*r < t*s |] ==> y*x < t*s";
  38.111 -by (blast_tac (claset() addSIs [rename_numerals real_mult_less_mono2] 
  38.112 +Goal "[| (0::real) < y; x < r; y*r < t*s |] ==> y*x < t*s";
  38.113 +by (blast_tac (claset() addSIs [real_mult_less_mono2] 
  38.114                          addIs  [order_less_trans]) 1);
  38.115  qed "real_mult_less_trans";
  38.116  
  38.117 -Goal "[| (Numeral0::real)<=y; x < r; y*r < t*s; Numeral0 < t*s|] ==> y*x < t*s";
  38.118 +Goal "[| (0::real)<=y; x < r; y*r < t*s; 0 < t*s|] ==> y*x < t*s";
  38.119  by (dtac order_le_imp_less_or_eq 1);
  38.120  by (fast_tac (HOL_cs addEs [real_mult_0_less RS iffD2,
  38.121  			    real_mult_less_trans]) 1);
  38.122 @@ -150,7 +151,7 @@
  38.123  by (rtac real_mult_le_less_trans 1);
  38.124  by (rtac abs_ge_zero 1);
  38.125  by (assume_tac 1);
  38.126 -by (rtac (rename_numerals real_mult_order) 2);
  38.127 +by (rtac real_mult_order 2);
  38.128  by (auto_tac (claset() addSIs [real_mult_less_mono1, abs_ge_zero] 
  38.129                         addIs [order_le_less_trans],
  38.130                simpset()));
  38.131 @@ -161,11 +162,11 @@
  38.132                simpset() addsimps [abs_mult RS sym]));
  38.133  qed "abs_mult_less2";
  38.134  
  38.135 -Goal "abs(x) < r ==> (Numeral0::real) < r";
  38.136 +Goal "abs(x) < r ==> (0::real) < r";
  38.137  by (blast_tac (claset() addSIs [order_le_less_trans,abs_ge_zero]) 1);
  38.138  qed "abs_less_gt_zero";
  38.139  
  38.140 -Goalw [real_abs_def] "abs (-Numeral1) = (Numeral1::real)";
  38.141 +Goalw [real_abs_def] "abs (-1) = (1::real)";
  38.142  by (Simp_tac 1);
  38.143  qed "abs_minus_one";
  38.144  Addsimps [abs_minus_one];
  38.145 @@ -182,17 +183,16 @@
  38.146  by Auto_tac;
  38.147  qed "abs_le_interval_iff";
  38.148  
  38.149 -Goalw [real_abs_def] "(Numeral0::real) < k ==> Numeral0 < k + abs(x)";
  38.150 +Goalw [real_abs_def] "(0::real) < k ==> 0 < k + abs(x)";
  38.151  by Auto_tac;
  38.152  qed "abs_add_pos_gt_zero";
  38.153  
  38.154 -Goalw [real_abs_def] "(Numeral0::real) < Numeral1 + abs(x)";
  38.155 +Goalw [real_abs_def] "(0::real) < 1 + abs(x)";
  38.156  by Auto_tac;
  38.157  qed "abs_add_one_gt_zero";
  38.158  Addsimps [abs_add_one_gt_zero];
  38.159  
  38.160 -(* 05/2000 *)
  38.161 -Goalw [real_abs_def] "~ abs x < (Numeral0::real)";
  38.162 +Goalw [real_abs_def] "~ abs x < (0::real)";
  38.163  by Auto_tac;
  38.164  qed "abs_not_less_zero";
  38.165  Addsimps [abs_not_less_zero];
  38.166 @@ -202,12 +202,12 @@
  38.167      simpset()));
  38.168  qed "abs_circle";
  38.169  
  38.170 -Goalw [real_abs_def] "(abs x <= (Numeral0::real)) = (x = Numeral0)";
  38.171 +Goalw [real_abs_def] "(abs x <= (0::real)) = (x = 0)";
  38.172  by Auto_tac;
  38.173  qed "abs_le_zero_iff";
  38.174  Addsimps [abs_le_zero_iff];
  38.175  
  38.176 -Goal "((Numeral0::real) < abs x) = (x ~= 0)";
  38.177 +Goal "((0::real) < abs x) = (x ~= 0)";
  38.178  by (simp_tac (simpset() addsimps [real_abs_def]) 1);
  38.179  by (arith_tac 1);
  38.180  qed "real_0_less_abs_iff";
  38.181 @@ -215,11 +215,11 @@
  38.182  
  38.183  Goal "abs (real x) = real (x::nat)";
  38.184  by (auto_tac (claset() addIs [abs_eqI1],
  38.185 -              simpset() addsimps [rename_numerals real_of_nat_ge_zero]));
  38.186 +              simpset() addsimps [real_of_nat_ge_zero]));
  38.187  qed "abs_real_of_nat_cancel";
  38.188  Addsimps [abs_real_of_nat_cancel];
  38.189  
  38.190 -Goal "~ abs(x) + (Numeral1::real) < x";
  38.191 +Goal "~ abs(x) + (1::real) < x";
  38.192  by (rtac real_leD 1);
  38.193  by (auto_tac (claset() addIs [abs_ge_self RS order_trans], simpset()));
  38.194  qed "abs_add_one_not_less_self";
  38.195 @@ -232,21 +232,21 @@
  38.196                simpset() addsimps [real_add_assoc]));
  38.197  qed "abs_triangle_ineq_three";
  38.198  
  38.199 -Goalw [real_abs_def] "abs(x - y) < y ==> (Numeral0::real) < y";
  38.200 -by (case_tac "Numeral0 <= x - y" 1);
  38.201 +Goalw [real_abs_def] "abs(x - y) < y ==> (0::real) < y";
  38.202 +by (case_tac "0 <= x - y" 1);
  38.203  by Auto_tac;
  38.204  qed "abs_diff_less_imp_gt_zero";
  38.205  
  38.206 -Goalw [real_abs_def] "abs(x - y) < x ==> (Numeral0::real) < x";
  38.207 -by (case_tac "Numeral0 <= x - y" 1);
  38.208 +Goalw [real_abs_def] "abs(x - y) < x ==> (0::real) < x";
  38.209 +by (case_tac "0 <= x - y" 1);
  38.210  by Auto_tac;
  38.211  qed "abs_diff_less_imp_gt_zero2";
  38.212  
  38.213 -Goal "abs(x - y) < y ==> (Numeral0::real) < x";
  38.214 +Goal "abs(x - y) < y ==> (0::real) < x";
  38.215  by (auto_tac (claset(),simpset() addsimps [abs_interval_iff]));
  38.216  qed "abs_diff_less_imp_gt_zero3";
  38.217  
  38.218 -Goal "abs(x - y) < -y ==> x < (Numeral0::real)";
  38.219 +Goal "abs(x - y) < -y ==> x < (0::real)";
  38.220  by (auto_tac (claset(),simpset() addsimps [abs_interval_iff]));
  38.221  qed "abs_diff_less_imp_gt_zero4";
  38.222  
    39.1 --- a/src/HOL/Real/RealAbs.thy	Thu Nov 01 21:12:13 2001 +0100
    39.2 +++ b/src/HOL/Real/RealAbs.thy	Fri Nov 02 17:55:24 2001 +0100
    39.3 @@ -9,6 +9,6 @@
    39.4  
    39.5  
    39.6  defs
    39.7 -  real_abs_def "abs r == (if (Numeral0::real) <= r then r else -r)"
    39.8 +  real_abs_def "abs r == (if (0::real) <= r then r else -r)"
    39.9  
   39.10  end
    40.1 --- a/src/HOL/Real/RealArith0.ML	Thu Nov 01 21:12:13 2001 +0100
    40.2 +++ b/src/HOL/Real/RealArith0.ML	Fri Nov 02 17:55:24 2001 +0100
    40.3 @@ -8,85 +8,88 @@
    40.4  Also, common factor cancellation
    40.5  *)
    40.6  
    40.7 +Goal "x - - y = x + (y::real)";
    40.8 +by (Simp_tac 1); 
    40.9 +qed "real_diff_minus_eq";
   40.10 +Addsimps [real_diff_minus_eq];
   40.11 +
   40.12  (** Division and inverse **)
   40.13  
   40.14 -Goal "Numeral0/x = (Numeral0::real)";
   40.15 +Goal "0/x = (0::real)";
   40.16  by (simp_tac (simpset() addsimps [real_divide_def]) 1); 
   40.17  qed "real_0_divide";
   40.18  Addsimps [real_0_divide];
   40.19  
   40.20 -Goal "((Numeral0::real) < inverse x) = (Numeral0 < x)";
   40.21 -by (case_tac "x=Numeral0" 1);
   40.22 -by (asm_simp_tac (HOL_ss addsimps [rename_numerals INVERSE_ZERO]) 1); 
   40.23 -by (auto_tac (claset() addDs [rename_numerals real_inverse_less_zero], 
   40.24 -              simpset() addsimps [linorder_neq_iff, 
   40.25 -                                  rename_numerals real_inverse_gt_zero]));  
   40.26 +Goal "((0::real) < inverse x) = (0 < x)";
   40.27 +by (case_tac "x=0" 1);
   40.28 +by (asm_simp_tac (HOL_ss addsimps [INVERSE_ZERO]) 1); 
   40.29 +by (auto_tac (claset() addDs [real_inverse_less_0], 
   40.30 +              simpset() addsimps [linorder_neq_iff, real_inverse_gt_0]));  
   40.31  qed "real_0_less_inverse_iff";
   40.32  Addsimps [real_0_less_inverse_iff];
   40.33  
   40.34 -Goal "(inverse x < (Numeral0::real)) = (x < Numeral0)";
   40.35 -by (case_tac "x=Numeral0" 1);
   40.36 -by (asm_simp_tac (HOL_ss addsimps [rename_numerals INVERSE_ZERO]) 1); 
   40.37 -by (auto_tac (claset() addDs [rename_numerals real_inverse_less_zero], 
   40.38 -              simpset() addsimps [linorder_neq_iff, 
   40.39 -                                  rename_numerals real_inverse_gt_zero]));  
   40.40 +Goal "(inverse x < (0::real)) = (x < 0)";
   40.41 +by (case_tac "x=0" 1);
   40.42 +by (asm_simp_tac (HOL_ss addsimps [INVERSE_ZERO]) 1); 
   40.43 +by (auto_tac (claset() addDs [real_inverse_less_0], 
   40.44 +              simpset() addsimps [linorder_neq_iff, real_inverse_gt_0]));  
   40.45  qed "real_inverse_less_0_iff";
   40.46  Addsimps [real_inverse_less_0_iff];
   40.47  
   40.48 -Goal "((Numeral0::real) <= inverse x) = (Numeral0 <= x)";
   40.49 +Goal "((0::real) <= inverse x) = (0 <= x)";
   40.50  by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); 
   40.51  qed "real_0_le_inverse_iff";
   40.52  Addsimps [real_0_le_inverse_iff];
   40.53  
   40.54 -Goal "(inverse x <= (Numeral0::real)) = (x <= Numeral0)";
   40.55 +Goal "(inverse x <= (0::real)) = (x <= 0)";
   40.56  by (simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); 
   40.57  qed "real_inverse_le_0_iff";
   40.58  Addsimps [real_inverse_le_0_iff];
   40.59  
   40.60 -Goalw [real_divide_def] "x/(Numeral0::real) = Numeral0";
   40.61 -by (stac (rename_numerals INVERSE_ZERO) 1); 
   40.62 +Goalw [real_divide_def] "x/(0::real) = 0";
   40.63 +by (stac INVERSE_ZERO 1); 
   40.64  by (Simp_tac 1); 
   40.65  qed "REAL_DIVIDE_ZERO";
   40.66  
   40.67 -Goal "inverse (x::real) = Numeral1/x";
   40.68 +Goal "inverse (x::real) = 1/x";
   40.69  by (simp_tac (simpset() addsimps [real_divide_def]) 1); 
   40.70  qed "real_inverse_eq_divide";
   40.71  
   40.72 -Goal "((Numeral0::real) < x/y) = (Numeral0 < x & Numeral0 < y | x < Numeral0 & y < Numeral0)";
   40.73 +Goal "((0::real) < x/y) = (0 < x & 0 < y | x < 0 & y < 0)";
   40.74  by (simp_tac (simpset() addsimps [real_divide_def, real_0_less_mult_iff]) 1);
   40.75  qed "real_0_less_divide_iff";
   40.76  Addsimps [inst "x" "number_of ?w" real_0_less_divide_iff];
   40.77  
   40.78 -Goal "(x/y < (Numeral0::real)) = (Numeral0 < x & y < Numeral0 | x < Numeral0 & Numeral0 < y)";
   40.79 +Goal "(x/y < (0::real)) = (0 < x & y < 0 | x < 0 & 0 < y)";
   40.80  by (simp_tac (simpset() addsimps [real_divide_def, real_mult_less_0_iff]) 1);
   40.81  qed "real_divide_less_0_iff";
   40.82  Addsimps [inst "x" "number_of ?w" real_divide_less_0_iff];
   40.83  
   40.84 -Goal "((Numeral0::real) <= x/y) = ((x <= Numeral0 | Numeral0 <= y) & (Numeral0 <= x | y <= Numeral0))";
   40.85 +Goal "((0::real) <= x/y) = ((x <= 0 | 0 <= y) & (0 <= x | y <= 0))";
   40.86  by (simp_tac (simpset() addsimps [real_divide_def, real_0_le_mult_iff]) 1);
   40.87  by Auto_tac;  
   40.88  qed "real_0_le_divide_iff";
   40.89  Addsimps [inst "x" "number_of ?w" real_0_le_divide_iff];
   40.90  
   40.91 -Goal "(x/y <= (Numeral0::real)) = ((x <= Numeral0 | y <= Numeral0) & (Numeral0 <= x | Numeral0 <= y))";
   40.92 +Goal "(x/y <= (0::real)) = ((x <= 0 | y <= 0) & (0 <= x | 0 <= y))";
   40.93  by (simp_tac (simpset() addsimps [real_divide_def, real_mult_le_0_iff]) 1);
   40.94  by Auto_tac;  
   40.95  qed "real_divide_le_0_iff";
   40.96  Addsimps [inst "x" "number_of ?w" real_divide_le_0_iff];
   40.97  
   40.98 -Goal "(inverse(x::real) = Numeral0) = (x = Numeral0)";
   40.99 -by (auto_tac (claset(), simpset() addsimps [rename_numerals INVERSE_ZERO]));  
  40.100 +Goal "(inverse(x::real) = 0) = (x = 0)";
  40.101 +by (auto_tac (claset(), simpset() addsimps [INVERSE_ZERO]));  
  40.102  by (rtac ccontr 1); 
  40.103 -by (blast_tac (claset() addDs [rename_numerals real_inverse_not_zero]) 1); 
  40.104 +by (blast_tac (claset() addDs [real_inverse_not_zero]) 1); 
  40.105  qed "real_inverse_zero_iff";
  40.106  Addsimps [real_inverse_zero_iff];
  40.107  
  40.108 -Goal "(x/y = Numeral0) = (x=Numeral0 | y=(Numeral0::real))";
  40.109 +Goal "(x/y = 0) = (x=0 | y=(0::real))";
  40.110  by (auto_tac (claset(), simpset() addsimps [real_divide_def]));  
  40.111  qed "real_divide_eq_0_iff";
  40.112  Addsimps [real_divide_eq_0_iff];
  40.113  
  40.114 -Goal "h ~= (Numeral0::real) ==> h/h = Numeral1";
  40.115 +Goal "h ~= (0::real) ==> h/h = 1";
  40.116  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_inv_left]) 1);
  40.117  qed "real_divide_self_eq"; 
  40.118  Addsimps [real_divide_self_eq];
  40.119 @@ -128,7 +131,7 @@
  40.120  by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [real_mult_commute])));
  40.121  qed "real_mult_le_mono2_neg";
  40.122  
  40.123 -Goal "(m*k < n*k) = (((Numeral0::real) < k & m<n) | (k < Numeral0 & n<m))";
  40.124 +Goal "(m*k < n*k) = (((0::real) < k & m<n) | (k < 0 & n<m))";
  40.125  by (case_tac "k = (0::real)" 1);
  40.126  by (auto_tac (claset(), 
  40.127                simpset() addsimps [linorder_neq_iff, 
  40.128 @@ -143,32 +146,32 @@
  40.129                                              real_mult_le_mono1_neg]));  
  40.130  qed "real_mult_less_cancel2";
  40.131  
  40.132 -Goal "(m*k <= n*k) = (((Numeral0::real) < k --> m<=n) & (k < Numeral0 --> n<=m))";
  40.133 +Goal "(m*k <= n*k) = (((0::real) < k --> m<=n) & (k < 0 --> n<=m))";
  40.134  by (simp_tac (simpset() addsimps [linorder_not_less RS sym, 
  40.135                                    real_mult_less_cancel2]) 1);
  40.136  qed "real_mult_le_cancel2";
  40.137  
  40.138 -Goal "(k*m < k*n) = (((Numeral0::real) < k & m<n) | (k < Numeral0 & n<m))";
  40.139 +Goal "(k*m < k*n) = (((0::real) < k & m<n) | (k < 0 & n<m))";
  40.140  by (simp_tac (simpset() addsimps [inst "z" "k" real_mult_commute, 
  40.141                                    real_mult_less_cancel2]) 1);
  40.142  qed "real_mult_less_cancel1";
  40.143  
  40.144 -Goal "!!k::real. (k*m <= k*n) = ((Numeral0 < k --> m<=n) & (k < Numeral0 --> n<=m))";
  40.145 +Goal "!!k::real. (k*m <= k*n) = ((0 < k --> m<=n) & (k < 0 --> n<=m))";
  40.146  by (simp_tac (simpset() addsimps [linorder_not_less RS sym, 
  40.147                                    real_mult_less_cancel1]) 1);
  40.148  qed "real_mult_le_cancel1";
  40.149  
  40.150 -Goal "!!k::real. (k*m = k*n) = (k = Numeral0 | m=n)";
  40.151 +Goal "!!k::real. (k*m = k*n) = (k = 0 | m=n)";
  40.152  by (case_tac "k=0" 1);
  40.153  by (auto_tac (claset(), simpset() addsimps [real_mult_left_cancel]));  
  40.154  qed "real_mult_eq_cancel1";
  40.155  
  40.156 -Goal "!!k::real. (m*k = n*k) = (k = Numeral0 | m=n)";
  40.157 +Goal "!!k::real. (m*k = n*k) = (k = 0 | m=n)";
  40.158  by (case_tac "k=0" 1);
  40.159  by (auto_tac (claset(), simpset() addsimps [real_mult_right_cancel]));  
  40.160  qed "real_mult_eq_cancel2";
  40.161  
  40.162 -Goal "!!k::real. k~=Numeral0 ==> (k*m) / (k*n) = (m/n)";
  40.163 +Goal "!!k::real. k~=0 ==> (k*m) / (k*n) = (m/n)";
  40.164  by (asm_simp_tac
  40.165      (simpset() addsimps [real_divide_def, real_inverse_distrib]) 1); 
  40.166  by (subgoal_tac "k * m * (inverse k * inverse n) = \
  40.167 @@ -178,7 +181,7 @@
  40.168  qed "real_mult_div_cancel1";
  40.169  
  40.170  (*For ExtractCommonTerm*)
  40.171 -Goal "(k*m) / (k*n) = (if k = (Numeral0::real) then Numeral0 else m/n)";
  40.172 +Goal "(k*m) / (k*n) = (if k = (0::real) then 0 else m/n)";
  40.173  by (simp_tac (simpset() addsimps [real_mult_div_cancel1]) 1); 
  40.174  qed "real_mult_div_cancel_disj";
  40.175  
  40.176 @@ -188,20 +191,17 @@
  40.177  in
  40.178  
  40.179  val rel_real_number_of = [eq_real_number_of, less_real_number_of, 
  40.180 -                          le_real_number_of_eq_not_less];
  40.181 +                          le_real_number_of_eq_not_less]
  40.182  
  40.183  structure CancelNumeralFactorCommon =
  40.184    struct
  40.185    val mk_coeff		= mk_coeff
  40.186    val dest_coeff	= dest_coeff 1
  40.187    val trans_tac         = trans_tac
  40.188 -  val norm_tac = ALLGOALS (simp_tac (HOL_ss addsimps mult_plus_1s))
  40.189 +  val norm_tac = 
  40.190 +     ALLGOALS (simp_tac (HOL_ss addsimps real_minus_from_mult_simps @ mult_1s))
  40.191       THEN ALLGOALS (simp_tac (HOL_ss addsimps bin_simps@real_mult_minus_simps))
  40.192 -     THEN ALLGOALS
  40.193 -	  (simp_tac 
  40.194 -	   (HOL_ss addsimps [eq_real_number_of, mult_real_number_of, 
  40.195 -                             real_mult_number_of_left]@
  40.196 -           real_minus_from_mult_simps @ real_mult_ac))
  40.197 +     THEN ALLGOALS (simp_tac (HOL_ss addsimps real_mult_ac))
  40.198    val numeral_simp_tac	= 
  40.199           ALLGOALS (simp_tac (HOL_ss addsimps rel_real_number_of@bin_simps))
  40.200    val simplify_meta_eq  = simplify_meta_eq
  40.201 @@ -253,17 +253,17 @@
  40.202       LessCancelNumeralFactor.proc),
  40.203      ("realle_cancel_numeral_factor", 
  40.204       prep_pats ["(l::real) * m <= n", "(l::real) <= m * n"], 
  40.205 -     LeCancelNumeralFactor.proc)];
  40.206 +     LeCancelNumeralFactor.proc)]
  40.207  
  40.208  val real_cancel_numeral_factors_divide = prep_simproc
  40.209  	("realdiv_cancel_numeral_factor", 
  40.210  	 prep_pats ["((l::real) * m) / n", "(l::real) / (m * n)", 
  40.211                       "((number_of v)::real) / (number_of w)"], 
  40.212 -	 DivCancelNumeralFactor.proc);
  40.213 +	 DivCancelNumeralFactor.proc)
  40.214  
  40.215  val real_cancel_numeral_factors = 
  40.216      real_cancel_numeral_factors_relations @ 
  40.217 -    [real_cancel_numeral_factors_divide];
  40.218 +    [real_cancel_numeral_factors_divide]
  40.219  
  40.220  end;
  40.221  
  40.222 @@ -276,7 +276,7 @@
  40.223  set trace_simp;
  40.224  fun test s = (Goal s; by (Simp_tac 1)); 
  40.225  
  40.226 -test "Numeral0 <= (y::real) * -2";
  40.227 +test "0 <= (y::real) * -2";
  40.228  test "9*x = 12 * (y::real)";
  40.229  test "(9*x) / (12 * (y::real)) = z";
  40.230  test "9*x < 12 * (y::real)";
  40.231 @@ -292,6 +292,7 @@
  40.232  test "999*x < -396 * (y::real)";
  40.233  test "999*x <= -396 * (y::real)";
  40.234  
  40.235 +test  "(- ((2::real) * x) <= 2 * y)";
  40.236  test "-99*x = -81 * (y::real)";
  40.237  test "(-99*x) / (-81 * (y::real)) = z";
  40.238  test "-99*x <= -81 * (y::real)";
  40.239 @@ -379,7 +380,7 @@
  40.240  
  40.241  (*** Simplification of inequalities involving literal divisors ***)
  40.242  
  40.243 -Goal "Numeral0<z ==> ((x::real) <= y/z) = (x*z <= y)";
  40.244 +Goal "0<z ==> ((x::real) <= y/z) = (x*z <= y)";
  40.245  by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
  40.246  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.247  by (etac ssubst 1);
  40.248 @@ -388,7 +389,7 @@
  40.249  qed "pos_real_le_divide_eq";
  40.250  Addsimps [inst "z" "number_of ?w" pos_real_le_divide_eq];
  40.251  
  40.252 -Goal "z<Numeral0 ==> ((x::real) <= y/z) = (y <= x*z)";
  40.253 +Goal "z<0 ==> ((x::real) <= y/z) = (y <= x*z)";
  40.254  by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
  40.255  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.256  by (etac ssubst 1);
  40.257 @@ -397,7 +398,7 @@
  40.258  qed "neg_real_le_divide_eq";
  40.259  Addsimps [inst "z" "number_of ?w" neg_real_le_divide_eq];
  40.260  
  40.261 -Goal "Numeral0<z ==> (y/z <= (x::real)) = (y <= x*z)";
  40.262 +Goal "0<z ==> (y/z <= (x::real)) = (y <= x*z)";
  40.263  by (subgoal_tac "(y <= x*z) = ((y/z)*z <= x*z)" 1);
  40.264  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.265  by (etac ssubst 1);
  40.266 @@ -406,7 +407,7 @@
  40.267  qed "pos_real_divide_le_eq";
  40.268  Addsimps [inst "z" "number_of ?w" pos_real_divide_le_eq];
  40.269  
  40.270 -Goal "z<Numeral0 ==> (y/z <= (x::real)) = (x*z <= y)";
  40.271 +Goal "z<0 ==> (y/z <= (x::real)) = (x*z <= y)";
  40.272  by (subgoal_tac "(x*z <= y) = (x*z <= (y/z)*z)" 1);
  40.273  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.274  by (etac ssubst 1);
  40.275 @@ -415,7 +416,7 @@
  40.276  qed "neg_real_divide_le_eq";
  40.277  Addsimps [inst "z" "number_of ?w" neg_real_divide_le_eq];
  40.278  
  40.279 -Goal "Numeral0<z ==> ((x::real) < y/z) = (x*z < y)";
  40.280 +Goal "0<z ==> ((x::real) < y/z) = (x*z < y)";
  40.281  by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
  40.282  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.283  by (etac ssubst 1);
  40.284 @@ -424,7 +425,7 @@
  40.285  qed "pos_real_less_divide_eq";
  40.286  Addsimps [inst "z" "number_of ?w" pos_real_less_divide_eq];
  40.287  
  40.288 -Goal "z<Numeral0 ==> ((x::real) < y/z) = (y < x*z)";
  40.289 +Goal "z<0 ==> ((x::real) < y/z) = (y < x*z)";
  40.290  by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
  40.291  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.292  by (etac ssubst 1);
  40.293 @@ -433,7 +434,7 @@
  40.294  qed "neg_real_less_divide_eq";
  40.295  Addsimps [inst "z" "number_of ?w" neg_real_less_divide_eq];
  40.296  
  40.297 -Goal "Numeral0<z ==> (y/z < (x::real)) = (y < x*z)";
  40.298 +Goal "0<z ==> (y/z < (x::real)) = (y < x*z)";
  40.299  by (subgoal_tac "(y < x*z) = ((y/z)*z < x*z)" 1);
  40.300  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.301  by (etac ssubst 1);
  40.302 @@ -442,7 +443,7 @@
  40.303  qed "pos_real_divide_less_eq";
  40.304  Addsimps [inst "z" "number_of ?w" pos_real_divide_less_eq];
  40.305  
  40.306 -Goal "z<Numeral0 ==> (y/z < (x::real)) = (x*z < y)";
  40.307 +Goal "z<0 ==> (y/z < (x::real)) = (x*z < y)";
  40.308  by (subgoal_tac "(x*z < y) = (x*z < (y/z)*z)" 1);
  40.309  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.310  by (etac ssubst 1);
  40.311 @@ -451,7 +452,7 @@
  40.312  qed "neg_real_divide_less_eq";
  40.313  Addsimps [inst "z" "number_of ?w" neg_real_divide_less_eq];
  40.314  
  40.315 -Goal "z~=Numeral0 ==> ((x::real) = y/z) = (x*z = y)";
  40.316 +Goal "z~=0 ==> ((x::real) = y/z) = (x*z = y)";
  40.317  by (subgoal_tac "(x*z = y) = (x*z = (y/z)*z)" 1);
  40.318  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.319  by (etac ssubst 1);
  40.320 @@ -460,7 +461,7 @@
  40.321  qed "real_eq_divide_eq";
  40.322  Addsimps [inst "z" "number_of ?w" real_eq_divide_eq];
  40.323  
  40.324 -Goal "z~=Numeral0 ==> (y/z = (x::real)) = (y = x*z)";
  40.325 +Goal "z~=0 ==> (y/z = (x::real)) = (y = x*z)";
  40.326  by (subgoal_tac "(y = x*z) = ((y/z)*z = x*z)" 1);
  40.327  by (asm_simp_tac (simpset() addsimps [real_divide_def, real_mult_assoc]) 2); 
  40.328  by (etac ssubst 1);
  40.329 @@ -469,38 +470,38 @@
  40.330  qed "real_divide_eq_eq";
  40.331  Addsimps [inst "z" "number_of ?w" real_divide_eq_eq];
  40.332  
  40.333 -Goal "(m/k = n/k) = (k = Numeral0 | m = (n::real))";
  40.334 -by (case_tac "k=Numeral0" 1);
  40.335 +Goal "(m/k = n/k) = (k = 0 | m = (n::real))";
  40.336 +by (case_tac "k=0" 1);
  40.337  by (asm_simp_tac (simpset() addsimps [REAL_DIVIDE_ZERO]) 1); 
  40.338  by (asm_simp_tac (simpset() addsimps [real_divide_eq_eq, real_eq_divide_eq, 
  40.339                                        real_mult_eq_cancel2]) 1); 
  40.340  qed "real_divide_eq_cancel2";
  40.341  
  40.342 -Goal "(k/m = k/n) = (k = Numeral0 | m = (n::real))";
  40.343 -by (case_tac "m=Numeral0 | n = Numeral0" 1);
  40.344 +Goal "(k/m = k/n) = (k = 0 | m = (n::real))";
  40.345 +by (case_tac "m=0 | n = 0" 1);
  40.346  by (auto_tac (claset(), 
  40.347                simpset() addsimps [REAL_DIVIDE_ZERO, real_divide_eq_eq, 
  40.348                                    real_eq_divide_eq, real_mult_eq_cancel1]));  
  40.349  qed "real_divide_eq_cancel1";
  40.350  
  40.351 -(*Moved from RealOrd.ML to use Numeral0 *)
  40.352 -Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x < inverse (r::real)) = (r < x)";
  40.353 +(*Moved from RealOrd.ML to use 0 *)
  40.354 +Goal "[| 0 < r; 0 < x|] ==> (inverse x < inverse (r::real)) = (r < x)";
  40.355  by (auto_tac (claset() addIs [real_inverse_less_swap], simpset()));
  40.356  by (res_inst_tac [("t","r")] (real_inverse_inverse RS subst) 1);
  40.357  by (res_inst_tac [("t","x")] (real_inverse_inverse RS subst) 1);
  40.358  by (auto_tac (claset() addIs [real_inverse_less_swap],
  40.359  	      simpset() delsimps [real_inverse_inverse]
  40.360 -			addsimps [real_inverse_gt_zero]));
  40.361 +			addsimps [real_inverse_gt_0]));
  40.362  qed "real_inverse_less_iff";
  40.363  
  40.364 -Goal "[| Numeral0 < r; Numeral0 < x|] ==> (inverse x <= inverse r) = (r <= (x::real))";
  40.365 +Goal "[| 0 < r; 0 < x|] ==> (inverse x <= inverse r) = (r <= (x::real))";
  40.366  by (asm_simp_tac (simpset() addsimps [linorder_not_less RS sym, 
  40.367                                        real_inverse_less_iff]) 1); 
  40.368  qed "real_inverse_le_iff";
  40.369  
  40.370  (** Division by 1, -1 **)
  40.371  
  40.372 -Goal "(x::real)/Numeral1 = x";
  40.373 +Goal "(x::real)/1 = x";
  40.374  by (simp_tac (simpset() addsimps [real_divide_def]) 1); 
  40.375  qed "real_divide_1";
  40.376  Addsimps [real_divide_1];
  40.377 @@ -510,30 +511,30 @@
  40.378  qed "real_divide_minus1";
  40.379  Addsimps [real_divide_minus1];
  40.380  
  40.381 -Goal "-1/(x::real) = - (Numeral1/x)";
  40.382 +Goal "-1/(x::real) = - (1/x)";
  40.383  by (simp_tac (simpset() addsimps [real_divide_def, real_minus_inverse]) 1); 
  40.384  qed "real_minus1_divide";
  40.385  Addsimps [real_minus1_divide];
  40.386  
  40.387 -Goal "[| (Numeral0::real) < d1; Numeral0 < d2 |] ==> EX e. Numeral0 < e & e < d1 & e < d2";
  40.388 +Goal "[| (0::real) < d1; 0 < d2 |] ==> EX e. 0 < e & e < d1 & e < d2";
  40.389  by (res_inst_tac [("x","(min d1 d2)/2")] exI 1); 
  40.390  by (asm_simp_tac (simpset() addsimps [min_def]) 1); 
  40.391  qed "real_lbound_gt_zero";
  40.392  
  40.393  Goal "(inverse x = inverse y) = (x = (y::real))";
  40.394 -by (case_tac "x=Numeral0 | y=Numeral0" 1);
  40.395 +by (case_tac "x=0 | y=0" 1);
  40.396  by (auto_tac (claset(), 
  40.397                simpset() addsimps [real_inverse_eq_divide, 
  40.398 -                                  rename_numerals DIVISION_BY_ZERO])); 
  40.399 +                                  DIVISION_BY_ZERO])); 
  40.400  by (dres_inst_tac [("f","%u. x*y*u")] arg_cong 1); 
  40.401  by (Asm_full_simp_tac 1); 
  40.402  qed "real_inverse_eq_iff";
  40.403  Addsimps [real_inverse_eq_iff];
  40.404  
  40.405 -Goal "(z/x = z/y) = (z = Numeral0 | x = (y::real))";
  40.406 -by (case_tac "x=Numeral0 | y=Numeral0" 1);
  40.407 +Goal "(z/x = z/y) = (z = 0 | x = (y::real))";
  40.408 +by (case_tac "x=0 | y=0" 1);
  40.409  by (auto_tac (claset(), 
  40.410 -              simpset() addsimps [rename_numerals DIVISION_BY_ZERO])); 
  40.411 +              simpset() addsimps [DIVISION_BY_ZERO])); 
  40.412  by (dres_inst_tac [("f","%u. x*y*u")] arg_cong 1);
  40.413  by Auto_tac;   
  40.414  qed "real_divide_eq_iff";
  40.415 @@ -569,7 +570,7 @@
  40.416  qed "real_minus_equation";
  40.417  
  40.418  
  40.419 -Goal "(x + - a = (Numeral0::real)) = (x=a)";
  40.420 +Goal "(x + - a = (0::real)) = (x=a)";
  40.421  by (arith_tac 1);
  40.422  qed "real_add_minus_iff";
  40.423  Addsimps [real_add_minus_iff];
  40.424 @@ -590,45 +591,50 @@
  40.425  Addsimps (map (inst "y" "number_of ?v") 
  40.426  	  [real_minus_less, real_minus_le, real_minus_equation]);
  40.427  
  40.428 +(*Equations and inequations involving 1*)
  40.429 +Addsimps (map (simplify (simpset()) o inst "x" "1") 
  40.430 +	  [real_less_minus, real_le_minus, real_equation_minus]);
  40.431 +Addsimps (map (simplify (simpset()) o inst "y" "1") 
  40.432 +	  [real_minus_less, real_minus_le, real_minus_equation]);
  40.433  
  40.434 -(*** Simprules combining x+y and Numeral0 ***)
  40.435 +(*** Simprules combining x+y and 0 ***)
  40.436  
  40.437 -Goal "(x+y = (Numeral0::real)) = (y = -x)";
  40.438 +Goal "(x+y = (0::real)) = (y = -x)";
  40.439  by Auto_tac;  
  40.440  qed "real_add_eq_0_iff";
  40.441  AddIffs [real_add_eq_0_iff];
  40.442  
  40.443 -Goal "(x+y < (Numeral0::real)) = (y < -x)";
  40.444 +Goal "(x+y < (0::real)) = (y < -x)";
  40.445  by Auto_tac;  
  40.446  qed "real_add_less_0_iff";
  40.447  AddIffs [real_add_less_0_iff];
  40.448  
  40.449 -Goal "((Numeral0::real) < x+y) = (-x < y)";
  40.450 +Goal "((0::real) < x+y) = (-x < y)";
  40.451  by Auto_tac;  
  40.452  qed "real_0_less_add_iff";
  40.453  AddIffs [real_0_less_add_iff];
  40.454  
  40.455 -Goal "(x+y <= (Numeral0::real)) = (y <= -x)";
  40.456 +Goal "(x+y <= (0::real)) = (y <= -x)";
  40.457  by Auto_tac;  
  40.458  qed "real_add_le_0_iff";
  40.459  AddIffs [real_add_le_0_iff];
  40.460  
  40.461 -Goal "((Numeral0::real) <= x+y) = (-x <= y)";
  40.462 +Goal "((0::real) <= x+y) = (-x <= y)";
  40.463  by Auto_tac;  
  40.464  qed "real_0_le_add_iff";
  40.465  AddIffs [real_0_le_add_iff];
  40.466  
  40.467  
  40.468 -(** Simprules combining x-y and Numeral0; see also real_less_iff_diff_less_0, etc.,
  40.469 +(** Simprules combining x-y and 0; see also real_less_iff_diff_less_0, etc.,
  40.470      in RealBin
  40.471  **)
  40.472  
  40.473 -Goal "((Numeral0::real) < x-y) = (y < x)";
  40.474 +Goal "((0::real) < x-y) = (y < x)";
  40.475  by Auto_tac;  
  40.476  qed "real_0_less_diff_iff";
  40.477  AddIffs [real_0_less_diff_iff];
  40.478  
  40.479 -Goal "((Numeral0::real) <= x-y) = (y <= x)";
  40.480 +Goal "((0::real) <= x-y) = (y <= x)";
  40.481  by Auto_tac;  
  40.482  qed "real_0_le_diff_iff";
  40.483  AddIffs [real_0_le_diff_iff];
  40.484 @@ -660,7 +666,7 @@
  40.485  qed "real_dense";
  40.486  
  40.487  
  40.488 -(*Replaces "inverse #nn" by Numeral1/#nn *)
  40.489 +(*Replaces "inverse #nn" by 1/#nn *)
  40.490  Addsimps [inst "x" "number_of ?w" real_inverse_eq_divide];
  40.491  
  40.492  
    41.1 --- a/src/HOL/Real/RealBin.ML	Thu Nov 01 21:12:13 2001 +0100
    41.2 +++ b/src/HOL/Real/RealBin.ML	Fri Nov 02 17:55:24 2001 +0100
    41.3 @@ -13,13 +13,13 @@
    41.4  qed "real_number_of";
    41.5  Addsimps [real_number_of];
    41.6  
    41.7 -Goalw [real_number_of_def] "(0::real) = Numeral0";
    41.8 +Goalw [real_number_of_def] "Numeral0 = (0::real)";
    41.9  by (simp_tac (simpset() addsimps [real_of_int_zero RS sym]) 1);
   41.10 -qed "zero_eq_numeral_0";
   41.11 +qed "real_numeral_0_eq_0";
   41.12  
   41.13 -Goalw [real_number_of_def] "(1::real) = Numeral1";
   41.14 +Goalw [real_number_of_def] "Numeral1 = (1::real)";
   41.15  by (simp_tac (simpset() addsimps [real_of_int_one RS sym]) 1);
   41.16 -qed "one_eq_numeral_1";
   41.17 +qed "real_numeral_1_eq_1";
   41.18  
   41.19  (** Addition **)
   41.20  
   41.21 @@ -52,21 +52,19 @@
   41.22  
   41.23  Goal "(number_of v :: real) * number_of v' = number_of (bin_mult v v')";
   41.24  by (simp_tac
   41.25 -    (HOL_ss addsimps [real_number_of_def, 
   41.26 -				  real_of_int_mult, number_of_mult]) 1);
   41.27 +    (HOL_ss addsimps [real_number_of_def, real_of_int_mult, 
   41.28 +                      number_of_mult]) 1);
   41.29  qed "mult_real_number_of";
   41.30  
   41.31  Addsimps [mult_real_number_of];
   41.32  
   41.33 -Goal "(2::real) = Numeral1 + Numeral1";
   41.34 -by (Simp_tac 1);
   41.35 +Goal "(2::real) = 1 + 1";
   41.36 +by (simp_tac (simpset() addsimps [real_numeral_1_eq_1 RS sym]) 1);
   41.37  val lemma = result();
   41.38  
   41.39  (*For specialist use: NOT as default simprules*)
   41.40  Goal "2 * z = (z+z::real)";
   41.41 -by (simp_tac (simpset ()
   41.42 -	      addsimps [lemma, real_add_mult_distrib,
   41.43 -			one_eq_numeral_1 RS sym]) 1);
   41.44 +by (simp_tac (simpset () addsimps [lemma, real_add_mult_distrib]) 1);
   41.45  qed "real_mult_2";
   41.46  
   41.47  Goal "z * 2 = (z+z::real)";
   41.48 @@ -111,66 +109,49 @@
   41.49  
   41.50  (*** New versions of existing theorems involving 0, 1 ***)
   41.51  
   41.52 -Goal "- Numeral1 = (-1::real)";
   41.53 -by (Simp_tac 1);
   41.54 -qed "minus_numeral_one";
   41.55 +Goal "- 1 = (-1::real)";
   41.56 +by (simp_tac (simpset() addsimps [real_numeral_1_eq_1 RS sym]) 1);
   41.57 +qed "real_minus_1_eq_m1";
   41.58 +
   41.59 +Goal "-1 * z = -(z::real)";
   41.60 +by (simp_tac (simpset() addsimps [real_minus_1_eq_m1 RS sym, 
   41.61 +                                  real_mult_minus_1]) 1);
   41.62 +qed "real_mult_minus1";
   41.63 +
   41.64 +Goal "z * -1 = -(z::real)";
   41.65 +by (stac real_mult_commute 1 THEN rtac real_mult_minus1 1);
   41.66 +qed "real_mult_minus1_right";
   41.67 +
   41.68 +Addsimps [real_mult_minus1, real_mult_minus1_right];
   41.69  
   41.70  
   41.71  (*Maps 0 to Numeral0 and 1 to Numeral1 and -(Numeral1) to -1*)
   41.72  val real_numeral_ss = 
   41.73 -    HOL_ss addsimps [zero_eq_numeral_0, one_eq_numeral_1, 
   41.74 -		     minus_numeral_one];
   41.75 +    HOL_ss addsimps [real_numeral_0_eq_0 RS sym, real_numeral_1_eq_1 RS sym, 
   41.76 +		     real_minus_1_eq_m1];
   41.77  
   41.78  fun rename_numerals th = 
   41.79      asm_full_simplify real_numeral_ss (Thm.transfer (the_context ()) th);
   41.80  
   41.81  
   41.82 -(*Now insert some identities previously stated for 0 and 1*)
   41.83 -
   41.84 -(** RealDef & Real **)
   41.85 -
   41.86 -Addsimps (map rename_numerals
   41.87 -	  [real_minus_zero, real_minus_zero_iff,
   41.88 -	   real_add_zero_left, real_add_zero_right, 
   41.89 -	   real_diff_0, real_diff_0_right,
   41.90 -	   real_mult_0_right, real_mult_0, real_mult_1_right, real_mult_1,
   41.91 -	   real_mult_minus_1_right, real_mult_minus_1, real_inverse_1,
   41.92 -	   real_minus_zero_less_iff]);
   41.93 -
   41.94 -AddIffs 
   41.95 - (map rename_numerals
   41.96 -      [real_mult_is_0, real_of_nat_zero_iff, real_le_square]);
   41.97 -
   41.98 -bind_thm ("real_0_less_mult_iff", 
   41.99 -	  rename_numerals real_zero_less_mult_iff);
  41.100 -bind_thm ("real_0_le_mult_iff", 
  41.101 -	  rename_numerals real_zero_le_mult_iff);
  41.102 -bind_thm ("real_mult_less_0_iff", 
  41.103 -	  rename_numerals real_mult_less_zero_iff);
  41.104 -bind_thm ("real_mult_le_0_iff", 
  41.105 -	  rename_numerals real_mult_le_zero_iff);
  41.106 -
  41.107 -bind_thm ("real_inverse_less_0", rename_numerals real_inverse_less_zero);
  41.108 -bind_thm ("real_inverse_gt_0", rename_numerals real_inverse_gt_zero);
  41.109 -
  41.110 -Addsimps [zero_eq_numeral_0,one_eq_numeral_1];
  41.111 -
  41.112 -
  41.113  (** real from type "nat" **)
  41.114  
  41.115 -Goal "(Numeral0 < real (n::nat)) = (0<n)";
  41.116 +Goal "(0 < real (n::nat)) = (0<n)";
  41.117  by (simp_tac (HOL_ss addsimps [real_of_nat_less_iff, 
  41.118 -                         rename_numerals real_of_nat_zero RS sym]) 1);
  41.119 +                               real_of_nat_zero RS sym]) 1);
  41.120  qed "zero_less_real_of_nat_iff";
  41.121  AddIffs [zero_less_real_of_nat_iff];
  41.122  
  41.123 -Goal "(Numeral0 <= real (n::nat)) = (0<=n)";
  41.124 +Goal "(0 <= real (n::nat)) = (0<=n)";
  41.125  by (simp_tac (HOL_ss addsimps [real_of_nat_le_iff, 
  41.126 -                         rename_numerals real_of_nat_zero RS sym]) 1);
  41.127 +                               real_of_nat_zero RS sym]) 1);
  41.128  qed "zero_le_real_of_nat_iff";
  41.129  AddIffs [zero_le_real_of_nat_iff];
  41.130  
  41.131  
  41.132 +(*Like the ones above, for "equals"*)
  41.133 +AddIffs [real_of_nat_zero_iff];
  41.134 +
  41.135  (** Simplification of arithmetic when nested to the right **)
  41.136  
  41.137  Goal "number_of v + (number_of w + z) = (number_of(bin_add v w) + z::real)";
  41.138 @@ -182,12 +163,12 @@
  41.139  qed "real_mult_number_of_left";
  41.140  
  41.141  Goalw [real_diff_def]
  41.142 -    "number_of v + (number_of w - c) = number_of(bin_add v w) - (c::real)";
  41.143 +     "number_of v + (number_of w - c) = number_of(bin_add v w) - (c::real)";
  41.144  by (rtac real_add_number_of_left 1);
  41.145  qed "real_add_number_of_diff1";
  41.146  
  41.147  Goal "number_of v + (c - number_of w) = \
  41.148 -\    number_of (bin_add v (bin_minus w)) + (c::real)";
  41.149 +\     number_of (bin_add v (bin_minus w)) + (c::real)";
  41.150  by (stac (diff_real_number_of RS sym) 1);
  41.151  by Auto_tac;
  41.152  qed "real_add_number_of_diff2";
  41.153 @@ -198,12 +179,12 @@
  41.154  
  41.155  (*"neg" is used in rewrite rules for binary comparisons*)
  41.156  Goal "real (number_of v :: nat) = \
  41.157 -\        (if neg (number_of v) then Numeral0 \
  41.158 -\         else (number_of v :: real))";
  41.159 +\       (if neg (number_of v) then 0 \
  41.160 +\        else (number_of v :: real))";
  41.161  by (simp_tac
  41.162      (HOL_ss addsimps [nat_number_of_def, real_of_nat_real_of_int,
  41.163 -				  real_of_nat_neg_int, real_number_of,
  41.164 -				  zero_eq_numeral_0]) 1);
  41.165 +                      real_of_nat_neg_int, real_number_of,
  41.166 +                      real_numeral_0_eq_0 RS sym]) 1);
  41.167  qed "real_of_nat_number_of";
  41.168  Addsimps [real_of_nat_number_of];
  41.169  
  41.170 @@ -212,15 +193,15 @@
  41.171  
  41.172  (** Combining of literal coefficients in sums of products **)
  41.173  
  41.174 -Goal "(x < y) = (x-y < (Numeral0::real))";
  41.175 +Goal "(x < y) = (x-y < (0::real))";
  41.176  by (simp_tac (simpset() addsimps [real_diff_less_eq]) 1);   
  41.177  qed "real_less_iff_diff_less_0";
  41.178  
  41.179 -Goal "(x = y) = (x-y = (Numeral0::real))";
  41.180 +Goal "(x = y) = (x-y = (0::real))";
  41.181  by (simp_tac (simpset() addsimps [real_diff_eq_eq]) 1);   
  41.182  qed "real_eq_iff_diff_eq_0";
  41.183  
  41.184 -Goal "(x <= y) = (x-y <= (Numeral0::real))";
  41.185 +Goal "(x <= y) = (x-y <= (0::real))";
  41.186  by (simp_tac (simpset() addsimps [real_diff_le_eq]) 1);   
  41.187  qed "real_le_iff_diff_le_0";
  41.188  
  41.189 @@ -272,15 +253,24 @@
  41.190  qed "real_le_add_iff2";
  41.191  
  41.192  
  41.193 +Addsimps [real_numeral_0_eq_0, real_numeral_1_eq_1];
  41.194 +
  41.195 +
  41.196  structure Real_Numeral_Simprocs =
  41.197  struct
  41.198  
  41.199 +(*Maps 0 to Numeral0 and 1 to Numeral1 so that arithmetic in simprocs
  41.200 +  isn't complicated by the abstract 0 and 1.*)
  41.201 +val numeral_syms = [real_numeral_0_eq_0 RS sym, real_numeral_1_eq_1 RS sym];
  41.202 +
  41.203  (*Utilities*)
  41.204  
  41.205  fun mk_numeral n = HOLogic.number_of_const HOLogic.realT $ HOLogic.mk_bin n;
  41.206  
  41.207 -(*Decodes a binary real constant*)
  41.208 -fun dest_numeral (Const("Numeral.number_of", _) $ w) = 
  41.209 +(*Decodes a binary real constant, or 0, 1*)
  41.210 +fun dest_numeral (Const("0", _)) = 0
  41.211 +  | dest_numeral (Const("1", _)) = 1
  41.212 +  | dest_numeral (Const("Numeral.number_of", _) $ w) = 
  41.213       (HOLogic.dest_binum w
  41.214        handle TERM _ => raise TERM("Real_Numeral_Simprocs.dest_numeral:1", [w]))
  41.215    | dest_numeral t = raise TERM("Real_Numeral_Simprocs.dest_numeral:2", [t]);
  41.216 @@ -295,7 +285,7 @@
  41.217  
  41.218  val uminus_const = Const ("uminus", HOLogic.realT --> HOLogic.realT);
  41.219  
  41.220 -(*Thus mk_sum[t] yields t+Numeral0; longer sums don't have a trailing zero*)
  41.221 +(*Thus mk_sum[t] yields t+0; longer sums don't have a trailing zero*)
  41.222  fun mk_sum []        = zero
  41.223    | mk_sum [t,u]     = mk_plus (t, u)
  41.224    | mk_sum (t :: ts) = mk_plus (t, mk_sum ts);
  41.225 @@ -355,24 +345,21 @@
  41.226  	handle TERM _ => find_first_coeff (t::past) u terms;
  41.227  
  41.228  
  41.229 -(*Simplify Numeral1*n and n*Numeral1 to n*)
  41.230 -val add_0s = map rename_numerals
  41.231 -                 [real_add_zero_left, real_add_zero_right];
  41.232 -val mult_plus_1s = map rename_numerals
  41.233 -                      [real_mult_1, real_mult_1_right];
  41.234 -val mult_minus_1s = map rename_numerals
  41.235 -                      [real_mult_minus_1, real_mult_minus_1_right];
  41.236 -val mult_1s = mult_plus_1s @ mult_minus_1s;
  41.237 +(*Simplify Numeral0+n, n+Numeral0, Numeral1*n, n*Numeral1*)
  41.238 +val add_0s  = map rename_numerals [real_add_zero_left, real_add_zero_right];
  41.239 +val mult_1s = map rename_numerals [real_mult_1, real_mult_1_right] @
  41.240 +              [real_mult_minus1, real_mult_minus1_right];
  41.241  
  41.242  (*To perform binary arithmetic*)
  41.243  val bin_simps =
  41.244 -    [add_real_number_of, real_add_number_of_left, minus_real_number_of, 
  41.245 +    [real_numeral_0_eq_0 RS sym, real_numeral_1_eq_1 RS sym,
  41.246 +     add_real_number_of, real_add_number_of_left, minus_real_number_of, 
  41.247       diff_real_number_of, mult_real_number_of, real_mult_number_of_left] @ 
  41.248      bin_arith_simps @ bin_rel_simps;
  41.249  
  41.250  (*To evaluate binary negations of coefficients*)
  41.251  val real_minus_simps = NCons_simps @
  41.252 -                   [minus_real_number_of, 
  41.253 +                   [real_minus_1_eq_m1, minus_real_number_of, 
  41.254  		    bin_minus_1, bin_minus_0, bin_minus_Pls, bin_minus_Min,
  41.255  		    bin_pred_1, bin_pred_0, bin_pred_Pls, bin_pred_Min];
  41.256  
  41.257 @@ -494,16 +481,17 @@
  41.258    val dest_coeff	= dest_coeff 1
  41.259    val left_distrib	= left_real_add_mult_distrib RS trans
  41.260    val prove_conv	= prove_conv_nohyps "real_combine_numerals"
  41.261 -  val trans_tac          = trans_tac
  41.262 +  val trans_tac         = trans_tac
  41.263    val norm_tac = 
  41.264 -     ALLGOALS (simp_tac (HOL_ss addsimps add_0s@mult_1s@diff_simps@
  41.265 -                                         real_minus_simps@real_add_ac))
  41.266 +     ALLGOALS (simp_tac (HOL_ss addsimps numeral_syms@add_0s@mult_1s@
  41.267 +                                   diff_simps@real_minus_simps@real_add_ac))
  41.268       THEN ALLGOALS (simp_tac (HOL_ss addsimps bin_simps@real_mult_minus_simps))
  41.269       THEN ALLGOALS (simp_tac (HOL_ss addsimps real_minus_from_mult_simps@
  41.270                                                real_add_ac@real_mult_ac))
  41.271    val numeral_simp_tac	= ALLGOALS 
  41.272                      (simp_tac (HOL_ss addsimps add_0s@bin_simps))
  41.273 -  val simplify_meta_eq  = simplify_meta_eq
  41.274 +  val simplify_meta_eq  = 
  41.275 +	Int_Numeral_Simprocs.simplify_meta_eq (add_0s@mult_1s)
  41.276    end;
  41.277  
  41.278  structure CombineNumerals = CombineNumeralsFun(CombineNumeralsData);
  41.279 @@ -533,9 +521,48 @@
  41.280          [real_mult_1, real_mult_1_right] 
  41.281          (([th, cancel_th]) MRS trans);
  41.282  
  41.283 +(*** Making constant folding work for 0 and 1 too ***)
  41.284 +
  41.285 +structure RealAbstractNumeralsData =
  41.286 +  struct
  41.287 +  val dest_eq         = HOLogic.dest_eq o HOLogic.dest_Trueprop o concl_of
  41.288 +  val is_numeral      = Bin_Simprocs.is_numeral
  41.289 +  val numeral_0_eq_0  = real_numeral_0_eq_0
  41.290 +  val numeral_1_eq_1  = real_numeral_1_eq_1
  41.291 +  val prove_conv      = prove_conv_nohyps "real_abstract_numerals"
  41.292 +  fun norm_tac simps  = ALLGOALS (simp_tac (HOL_ss addsimps simps))
  41.293 +  val simplify_meta_eq = Bin_Simprocs.simplify_meta_eq 
  41.294 +  end
  41.295 +
  41.296 +structure RealAbstractNumerals = AbstractNumeralsFun (RealAbstractNumeralsData)
  41.297 +
  41.298 +(*For addition, we already have rules for the operand 0.
  41.299 +  Multiplication is omitted because there are already special rules for 
  41.300 +  both 0 and 1 as operands.  Unary minus is trivial, just have - 1 = -1.
  41.301 +  For the others, having three patterns is a compromise between just having
  41.302 +  one (many spurious calls) and having nine (just too many!) *)
  41.303 +val eval_numerals = 
  41.304 +  map prep_simproc
  41.305 +   [("real_add_eval_numerals",
  41.306 +     prep_pats ["(m::real) + 1", "(m::real) + number_of v"], 
  41.307 +     RealAbstractNumerals.proc add_real_number_of),
  41.308 +    ("real_diff_eval_numerals",
  41.309 +     prep_pats ["(m::real) - 1", "(m::real) - number_of v"], 
  41.310 +     RealAbstractNumerals.proc diff_real_number_of),
  41.311 +    ("real_eq_eval_numerals",
  41.312 +     prep_pats ["(m::real) = 0", "(m::real) = 1", "(m::real) = number_of v"], 
  41.313 +     RealAbstractNumerals.proc eq_real_number_of),
  41.314 +    ("real_less_eval_numerals",
  41.315 +     prep_pats ["(m::real) < 0", "(m::real) < 1", "(m::real) < number_of v"], 
  41.316 +     RealAbstractNumerals.proc less_real_number_of),
  41.317 +    ("real_le_eval_numerals",
  41.318 +     prep_pats ["(m::real) <= 0", "(m::real) <= 1", "(m::real) <= number_of v"],
  41.319 +     RealAbstractNumerals.proc le_real_number_of_eq_not_less)]
  41.320 +
  41.321  end;
  41.322  
  41.323  
  41.324 +Addsimprocs Real_Numeral_Simprocs.eval_numerals;
  41.325  Addsimprocs Real_Numeral_Simprocs.cancel_numerals;
  41.326  Addsimprocs [Real_Numeral_Simprocs.combine_numerals];
  41.327  
  41.328 @@ -623,3 +650,5 @@
  41.329  by (etac real_mult_le_mono2 1);
  41.330  by (assume_tac 1);
  41.331  qed "real_mult_le_mono";
  41.332 +
  41.333 +Addsimps [real_minus_1_eq_m1];
    42.1 --- a/src/HOL/Real/RealDef.ML	Thu Nov 01 21:12:13 2001 +0100
    42.2 +++ b/src/HOL/Real/RealDef.ML	Fri Nov 02 17:55:24 2001 +0100
    42.3 @@ -11,7 +11,7 @@
    42.4  (*** Proving that realrel is an equivalence relation ***)
    42.5  
    42.6  Goal "[| (x1::preal) + y2 = x2 + y1; x2 + y3 = x3 + y2 |] \
    42.7 -\            ==> x1 + y3 = x3 + y1";        
    42.8 +\     ==> x1 + y3 = x3 + y1";        
    42.9  by (res_inst_tac [("C","y2")] preal_add_right_cancel 1);
   42.10  by (rotate_tac 1 1 THEN dtac sym 1);
   42.11  by (asm_full_simp_tac (simpset() addsimps preal_add_ac) 1);
   42.12 @@ -380,17 +380,18 @@
   42.13  				  real_minus_mult_eq1]) 1);
   42.14  qed "real_minus_mult_eq2";
   42.15  
   42.16 +(*Pull negations out*)
   42.17  Addsimps [real_minus_mult_eq1 RS sym, real_minus_mult_eq2 RS sym];
   42.18  
   42.19  Goal "(- (1::real)) * z = -z";
   42.20  by (Simp_tac 1);
   42.21  qed "real_mult_minus_1";
   42.22 +Addsimps [real_mult_minus_1];
   42.23  
   42.24  Goal "z * (- (1::real)) = -z";
   42.25  by (stac real_mult_commute 1);
   42.26  by (Simp_tac 1);
   42.27  qed "real_mult_minus_1_right";
   42.28 -
   42.29  Addsimps [real_mult_minus_1_right];
   42.30  
   42.31  Goal "(-x) * (-y) = x * (y::real)";
   42.32 @@ -458,12 +459,14 @@
   42.33  by (cut_inst_tac [("r1.0","xa"),("r2.0","y")] preal_linear 1);
   42.34  by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
   42.35             simpset() addsimps [real_zero_iff RS sym]));
   42.36 -by (res_inst_tac [("x","Abs_REAL (realrel `` \
   42.37 -\   {(preal_of_prat(prat_of_pnat 1p),pinv(D)+\
   42.38 -\    preal_of_prat(prat_of_pnat 1p))})")] exI 1);
   42.39 -by (res_inst_tac [("x","Abs_REAL (realrel `` \
   42.40 -\   {(pinv(D)+preal_of_prat(prat_of_pnat 1p),\
   42.41 -\    preal_of_prat(prat_of_pnat 1p))})")] exI 2);
   42.42 +by (res_inst_tac [("x",
   42.43 +    "Abs_REAL (realrel `` \
   42.44 +\     {(preal_of_prat(prat_of_pnat 1),  \
   42.45 +\       pinv(D) + preal_of_prat(prat_of_pnat 1))})")] exI 1);
   42.46 +by (res_inst_tac [("x",
   42.47 +     "Abs_REAL (realrel `` \
   42.48 +\      {(pinv(D) + preal_of_prat(prat_of_pnat 1),\
   42.49 +\        preal_of_prat(prat_of_pnat 1))})")] exI 2);
   42.50  by (auto_tac (claset(),
   42.51  	      simpset() addsimps [real_mult,
   42.52      pnat_one_def,preal_mult_1_right,preal_add_mult_distrib2,
   42.53 @@ -985,7 +988,6 @@
   42.54                          real_of_preal_not_less_zero,real_of_preal_zero_less,
   42.55                          real_of_preal_minus_less_zero]));
   42.56  qed "real_minus_zero_less_iff";
   42.57 -
   42.58  Addsimps [real_minus_zero_less_iff];
   42.59  
   42.60  Goal "(-R < 0) = ((0::real) < R)";
   42.61 @@ -995,6 +997,7 @@
   42.62                          real_of_preal_not_less_zero,real_of_preal_zero_less,
   42.63                          real_of_preal_minus_less_zero]));
   42.64  qed "real_minus_zero_less_iff2";
   42.65 +Addsimps [real_minus_zero_less_iff2];
   42.66  
   42.67  (*Alternative definition for real_less*)
   42.68  Goal "R < S ==> EX T::real. 0 < T & R + T = S";
   42.69 @@ -1007,8 +1010,7 @@
   42.70  				  real_of_preal_not_minus_gt_zero]));
   42.71  by (res_inst_tac [("x","real_of_preal D")] exI 1);
   42.72  by (res_inst_tac [("x","real_of_preal m+real_of_preal ma")] exI 2);
   42.73 -by (res_inst_tac [("x","real_of_preal m")] exI 3);
   42.74 -by (res_inst_tac [("x","real_of_preal D")] exI 4);
   42.75 +by (res_inst_tac [("x","real_of_preal D")] exI 3);
   42.76  by (auto_tac (claset(),
   42.77  	      simpset() addsimps [real_of_preal_zero_less,
   42.78  				  real_of_preal_sum_zero_less,real_add_assoc]));
    43.1 --- a/src/HOL/Real/RealDef.thy	Thu Nov 01 21:12:13 2001 +0100
    43.2 +++ b/src/HOL/Real/RealDef.thy	Fri Nov 02 17:55:24 2001 +0100
    43.3 @@ -33,11 +33,13 @@
    43.4  defs
    43.5  
    43.6    real_zero_def  
    43.7 -  "0 == Abs_REAL(realrel``{(preal_of_prat(prat_of_pnat 1p),
    43.8 -                                preal_of_prat(prat_of_pnat 1p))})"
    43.9 +  "0 == Abs_REAL(realrel``{(preal_of_prat(prat_of_pnat 1),
   43.10 +			    preal_of_prat(prat_of_pnat 1))})"
   43.11 +
   43.12    real_one_def   
   43.13 -  "1 == Abs_REAL(realrel``{(preal_of_prat(prat_of_pnat 1p) + 
   43.14 -            preal_of_prat(prat_of_pnat 1p),preal_of_prat(prat_of_pnat 1p))})"
   43.15 +  "1 == Abs_REAL(realrel``
   43.16 +               {(preal_of_prat(prat_of_pnat 1) + preal_of_prat(prat_of_pnat 1),
   43.17 +		 preal_of_prat(prat_of_pnat 1))})"
   43.18  
   43.19    real_minus_def
   43.20    "- R ==  Abs_REAL(UN (x,y):Rep_REAL(R). realrel``{(y,x)})"
   43.21 @@ -53,12 +55,12 @@
   43.22    
   43.23  constdefs
   43.24  
   43.25 -  (** these don't use the overloaded real because users don't see them **)
   43.26 +  (** these don't use the overloaded "real" function: users don't see them **)
   43.27    
   43.28    real_of_preal :: preal => real            
   43.29    "real_of_preal m     ==
   43.30 -           Abs_REAL(realrel``{(m+preal_of_prat(prat_of_pnat 1p),
   43.31 -                               preal_of_prat(prat_of_pnat 1p))})"
   43.32 +           Abs_REAL(realrel``{(m + preal_of_prat(prat_of_pnat 1),
   43.33 +                               preal_of_prat(prat_of_pnat 1))})"
   43.34  
   43.35    real_of_posnat :: nat => real             
   43.36    "real_of_posnat n == real_of_preal(preal_of_prat(prat_of_pnat(pnat_of_nat n)))"
    44.1 --- a/src/HOL/Real/RealOrd.ML	Thu Nov 01 21:12:13 2001 +0100
    44.2 +++ b/src/HOL/Real/RealOrd.ML	Fri Nov 02 17:55:24 2001 +0100
    44.3 @@ -128,14 +128,14 @@
    44.4  by (REPEAT(dtac (real_minus_zero_less_iff RS iffD2) 1));
    44.5  by (dtac real_mult_order 1 THEN assume_tac 1);
    44.6  by (Asm_full_simp_tac 1);
    44.7 -qed "real_mult_less_zero1";
    44.8 +qed "neg_real_mult_order";
    44.9  
   44.10  Goal "[| 0 < x; y < 0 |] ==> x*y < (0::real)";
   44.11  by (dtac (real_minus_zero_less_iff RS iffD2) 1);
   44.12  by (dtac real_mult_order 1 THEN assume_tac 1);
   44.13  by (rtac (real_minus_zero_less_iff RS iffD1) 1);
   44.14  by (Asm_full_simp_tac 1);
   44.15 -qed "real_mult_less_zero";
   44.16 +qed "real_mult_less_0";
   44.17  
   44.18  Goalw [real_one_def] "0 < (1::real)";
   44.19  by (auto_tac (claset() addIs [real_gt_zero_preal_Ex RS iffD2],
   44.20 @@ -255,7 +255,7 @@
   44.21  Goal "(0::real) <= x*x";
   44.22  by (res_inst_tac [("R2.0","0"),("R1.0","x")] real_linear_less2 1);
   44.23  by (auto_tac (claset() addIs [real_mult_order,
   44.24 -			      real_mult_less_zero1,order_less_imp_le],
   44.25 +			      neg_real_mult_order,order_less_imp_le],
   44.26  	      simpset()));
   44.27  qed "real_le_square";
   44.28  Addsimps [real_le_square];
   44.29 @@ -390,18 +390,18 @@
   44.30  by (forward_tac [real_not_refl2 RS not_sym] 1);
   44.31  by (dtac (real_not_refl2 RS not_sym RS real_inverse_not_zero) 1);
   44.32  by (EVERY1[dtac order_le_imp_less_or_eq, Step_tac]); 
   44.33 -by (dtac real_mult_less_zero1 1 THEN assume_tac 1);
   44.34 +by (dtac neg_real_mult_order 1 THEN assume_tac 1);
   44.35  by (auto_tac (claset() addIs [real_zero_less_one RS real_less_asym],
   44.36  	      simpset()));
   44.37 -qed "real_inverse_gt_zero";
   44.38 +qed "real_inverse_gt_0";
   44.39  
   44.40  Goal "x < 0 ==> inverse (x::real) < 0";
   44.41  by (ftac real_not_refl2 1);
   44.42  by (dtac (real_minus_zero_less_iff RS iffD2) 1);
   44.43  by (rtac (real_minus_zero_less_iff RS iffD1) 1);
   44.44  by (stac (real_minus_inverse RS sym) 1);
   44.45 -by (auto_tac (claset() addIs [real_inverse_gt_zero], simpset()));
   44.46 -qed "real_inverse_less_zero";
   44.47 +by (auto_tac (claset() addIs [real_inverse_gt_0], simpset()));
   44.48 +qed "real_inverse_less_0";
   44.49  
   44.50  Goal "[| (0::real) < z; x < y |] ==> x*z < y*z";       
   44.51  by (rotate_tac 1 1);
   44.52 @@ -419,7 +419,7 @@
   44.53  
   44.54  Goal "[| (0::real) < z; x * z < y * z |] ==> x < y";
   44.55  by (forw_inst_tac [("x","x*z")] 
   44.56 -    (real_inverse_gt_zero RS real_mult_less_mono1) 1);
   44.57 +    (real_inverse_gt_0 RS real_mult_less_mono1) 1);
   44.58  by (auto_tac (claset(),
   44.59  	      simpset() addsimps [real_mult_assoc,real_not_refl2 RS not_sym]));
   44.60  qed "real_mult_less_cancel1";
   44.61 @@ -495,13 +495,13 @@
   44.62  
   44.63  Goal "[| 0 < r; r < x |] ==> inverse x < inverse (r::real)";
   44.64  by (ftac order_less_trans 1 THEN assume_tac 1);
   44.65 -by (ftac real_inverse_gt_zero 1);
   44.66 -by (forw_inst_tac [("x","x")] real_inverse_gt_zero 1);
   44.67 +by (ftac real_inverse_gt_0 1);
   44.68 +by (forw_inst_tac [("x","x")] real_inverse_gt_0 1);
   44.69  by (forw_inst_tac [("x","r"),("z","inverse r")] real_mult_less_mono1 1);
   44.70  by (assume_tac 1);
   44.71  by (asm_full_simp_tac (simpset() addsimps [real_not_refl2 RS 
   44.72  					   not_sym RS real_mult_inv_right]) 1);
   44.73 -by (ftac real_inverse_gt_zero 1);
   44.74 +by (ftac real_inverse_gt_0 1);
   44.75  by (forw_inst_tac [("x","(1::real)"),("z","inverse x")] real_mult_less_mono2 1);
   44.76  by (assume_tac 1);
   44.77  by (asm_full_simp_tac (simpset() addsimps [real_not_refl2 RS 
   44.78 @@ -556,32 +556,32 @@
   44.79  Goal "((0::real) < x*y) = (0 < x & 0 < y | x < 0 & y < 0)";
   44.80  by (auto_tac (claset(), 
   44.81                simpset() addsimps [order_le_less, linorder_not_less, 
   44.82 -                                  real_mult_order, real_mult_less_zero1]));
   44.83 +                                  real_mult_order, neg_real_mult_order]));
   44.84  by (ALLGOALS (rtac ccontr)); 
   44.85  by (auto_tac (claset(), simpset() addsimps [order_le_less, linorder_not_less]));
   44.86  by (ALLGOALS (etac rev_mp)); 
   44.87 -by (ALLGOALS (dtac real_mult_less_zero THEN' assume_tac));
   44.88 +by (ALLGOALS (dtac real_mult_less_0 THEN' assume_tac));
   44.89  by (auto_tac (claset() addDs [order_less_not_sym], 
   44.90                simpset() addsimps [real_mult_commute]));  
   44.91 -qed "real_zero_less_mult_iff";
   44.92 +qed "real_0_less_mult_iff";
   44.93  
   44.94  Goal "((0::real) <= x*y) = (0 <= x & 0 <= y | x <= 0 & y <= 0)";
   44.95  by (auto_tac (claset(), 
   44.96                simpset() addsimps [order_le_less, linorder_not_less,  
   44.97 -                                  real_zero_less_mult_iff]));
   44.98 -qed "real_zero_le_mult_iff";
   44.99 +                                  real_0_less_mult_iff]));
  44.100 +qed "real_0_le_mult_iff";
  44.101  
  44.102  Goal "(x*y < (0::real)) = (0 < x & y < 0 | x < 0 & 0 < y)";
  44.103  by (auto_tac (claset(), 
  44.104 -              simpset() addsimps [real_zero_le_mult_iff, 
  44.105 +              simpset() addsimps [real_0_le_mult_iff, 
  44.106                                    linorder_not_le RS sym]));
  44.107  by (auto_tac (claset() addDs [order_less_not_sym],  
  44.108                simpset() addsimps [linorder_not_le]));
  44.109 -qed "real_mult_less_zero_iff";
  44.110 +qed "real_mult_less_0_iff";
  44.111  
  44.112  Goal "(x*y <= (0::real)) = (0 <= x & y <= 0 | x <= 0 & 0 <= y)";
  44.113  by (auto_tac (claset() addDs [order_less_not_sym], 
  44.114 -              simpset() addsimps [real_zero_less_mult_iff, 
  44.115 +              simpset() addsimps [real_0_less_mult_iff, 
  44.116                                    linorder_not_less RS sym]));
  44.117 -qed "real_mult_le_zero_iff";
  44.118 +qed "real_mult_le_0_iff";
  44.119  
    45.1 --- a/src/HOL/Real/RealPow.ML	Thu Nov 01 21:12:13 2001 +0100
    45.2 +++ b/src/HOL/Real/RealPow.ML	Fri Nov 02 17:55:24 2001 +0100
    45.3 @@ -7,17 +7,17 @@
    45.4  
    45.5  bind_thm ("realpow_Suc", thm "realpow_Suc");
    45.6  
    45.7 -Goal "(Numeral0::real) ^ (Suc n) = Numeral0";
    45.8 +Goal "(0::real) ^ (Suc n) = 0";
    45.9  by Auto_tac;
   45.10  qed "realpow_zero";
   45.11  Addsimps [realpow_zero];
   45.12  
   45.13 -Goal "r ~= (Numeral0::real) --> r ^ n ~= Numeral0";
   45.14 +Goal "r ~= (0::real) --> r ^ n ~= 0";
   45.15  by (induct_tac "n" 1);
   45.16  by Auto_tac; 
   45.17  qed_spec_mp "realpow_not_zero";
   45.18  
   45.19 -Goal "r ^ n = (Numeral0::real) ==> r = Numeral0";
   45.20 +Goal "r ^ n = (0::real) ==> r = 0";
   45.21  by (rtac ccontr 1);
   45.22  by (auto_tac (claset() addDs [realpow_not_zero], simpset()));
   45.23  qed "realpow_zero_zero";
   45.24 @@ -46,37 +46,37 @@
   45.25  by (Simp_tac 1);
   45.26  qed "realpow_two";
   45.27  
   45.28 -Goal "(Numeral0::real) < r --> Numeral0 < r ^ n";
   45.29 +Goal "(0::real) < r --> 0 < r ^ n";
   45.30  by (induct_tac "n" 1);
   45.31 -by (auto_tac (claset() addIs [rename_numerals real_mult_order],
   45.32 +by (auto_tac (claset() addIs [real_mult_order],
   45.33  	      simpset() addsimps [real_zero_less_one]));
   45.34  qed_spec_mp "realpow_gt_zero";
   45.35  
   45.36 -Goal "(Numeral0::real) <= r --> Numeral0 <= r ^ n";
   45.37 +Goal "(0::real) <= r --> 0 <= r ^ n";
   45.38  by (induct_tac "n" 1);
   45.39  by (auto_tac (claset(), simpset() addsimps [real_0_le_mult_iff]));
   45.40  qed_spec_mp "realpow_ge_zero";
   45.41  
   45.42 -Goal "(Numeral0::real) <= x & x <= y --> x ^ n <= y ^ n";
   45.43 +Goal "(0::real) <= x & x <= y --> x ^ n <= y ^ n";
   45.44  by (induct_tac "n" 1);
   45.45  by (auto_tac (claset() addSIs [real_mult_le_mono], simpset()));
   45.46  by (asm_simp_tac (simpset() addsimps [realpow_ge_zero]) 1);
   45.47  qed_spec_mp "realpow_le";
   45.48  
   45.49 -Goal "(Numeral0::real) < x & x < y & 0 < n --> x ^ n < y ^ n";
   45.50 +Goal "(0::real) < x & x < y & 0 < n --> x ^ n < y ^ n";
   45.51  by (induct_tac "n" 1);
   45.52 -by (auto_tac (claset() addIs [rename_numerals real_mult_less_mono, gr0I] 
   45.53 +by (auto_tac (claset() addIs [real_mult_less_mono, gr0I] 
   45.54                         addDs [realpow_gt_zero],
   45.55      simpset()));
   45.56  qed_spec_mp "realpow_less";
   45.57  
   45.58 -Goal "Numeral1 ^ n = (Numeral1::real)";
   45.59 +Goal "1 ^ n = (1::real)";
   45.60  by (induct_tac "n" 1);
   45.61  by Auto_tac;
   45.62  qed "realpow_eq_one";
   45.63  Addsimps [realpow_eq_one];
   45.64  
   45.65 -Goal "abs((-1) ^ n) = (Numeral1::real)";
   45.66 +Goal "abs((-1) ^ n) = (1::real)";
   45.67  by (induct_tac "n" 1);
   45.68  by (auto_tac (claset(), simpset() addsimps [abs_mult]));
   45.69  qed "abs_realpow_minus_one";
   45.70 @@ -87,14 +87,14 @@
   45.71  by (auto_tac (claset(),simpset() addsimps real_mult_ac));
   45.72  qed "realpow_mult";
   45.73  
   45.74 -Goal "(Numeral0::real) <= r^ Suc (Suc 0)";
   45.75 -by (simp_tac (simpset() addsimps [rename_numerals real_le_square]) 1);
   45.76 +Goal "(0::real) <= r^ Suc (Suc 0)";
   45.77 +by (simp_tac (simpset() addsimps [real_le_square]) 1);
   45.78  qed "realpow_two_le";
   45.79  Addsimps [realpow_two_le];
   45.80  
   45.81  Goal "abs((x::real)^Suc (Suc 0)) = x^Suc (Suc 0)";
   45.82  by (simp_tac (simpset() addsimps [abs_eqI1, 
   45.83 -				  rename_numerals real_le_square]) 1);
   45.84 +				  real_le_square]) 1);
   45.85  qed "abs_realpow_two";
   45.86  Addsimps [abs_realpow_two];
   45.87  
   45.88 @@ -104,31 +104,31 @@
   45.89  qed "realpow_two_abs";
   45.90  Addsimps [realpow_two_abs];
   45.91  
   45.92 -Goal "(Numeral1::real) < r ==> Numeral1 < r^ (Suc (Suc 0))";
   45.93 +Goal "(1::real) < r ==> 1 < r^ (Suc (Suc 0))";
   45.94  by Auto_tac;
   45.95 -by (cut_facts_tac [rename_numerals real_zero_less_one] 1);
   45.96 -by (forw_inst_tac [("x","Numeral0")] order_less_trans 1);
   45.97 +by (cut_facts_tac [real_zero_less_one] 1);
   45.98 +by (forw_inst_tac [("x","0")] order_less_trans 1);
   45.99  by (assume_tac 1);
  45.100 -by (dres_inst_tac [("z","r"),("x","Numeral1")] 
  45.101 -    (rename_numerals real_mult_less_mono1) 1);
  45.102 +by (dres_inst_tac [("z","r"),("x","1")] 
  45.103 +    (real_mult_less_mono1) 1);
  45.104  by (auto_tac (claset() addIs [order_less_trans], simpset()));
  45.105  qed "realpow_two_gt_one";
  45.106  
  45.107 -Goal "(Numeral1::real) < r --> Numeral1 <= r ^ n";
  45.108 +Goal "(1::real) < r --> 1 <= r ^ n";
  45.109  by (induct_tac "n" 1);
  45.110  by Auto_tac;  
  45.111 -by (subgoal_tac "Numeral1*Numeral1 <= r * r^n" 1);
  45.112 +by (subgoal_tac "1*1 <= r * r^n" 1);
  45.113  by (rtac real_mult_le_mono 2); 
  45.114  by Auto_tac;  
  45.115  qed_spec_mp "realpow_ge_one";
  45.116  
  45.117 -Goal "(Numeral1::real) <= r ==> Numeral1 <= r ^ n";
  45.118 +Goal "(1::real) <= r ==> 1 <= r ^ n";
  45.119  by (dtac order_le_imp_less_or_eq 1); 
  45.120  by (auto_tac (claset() addDs [realpow_ge_one], simpset()));
  45.121  qed "realpow_ge_one2";
  45.122  
  45.123 -Goal "(Numeral1::real) <= 2 ^ n";
  45.124 -by (res_inst_tac [("y","Numeral1 ^ n")] order_trans 1);
  45.125 +Goal "(1::real) <= 2 ^ n";
  45.126 +by (res_inst_tac [("y","1 ^ n")] order_trans 1);
  45.127  by (rtac realpow_le 2);
  45.128  by (auto_tac (claset() addIs [order_less_imp_le], simpset()));
  45.129  qed "two_realpow_ge_one";
  45.130 @@ -142,142 +142,142 @@
  45.131  qed "two_realpow_gt";
  45.132  Addsimps [two_realpow_gt,two_realpow_ge_one];
  45.133  
  45.134 -Goal "(-1) ^ (2*n) = (Numeral1::real)";
  45.135 +Goal "(-1) ^ (2*n) = (1::real)";
  45.136  by (induct_tac "n" 1);
  45.137  by Auto_tac;
  45.138  qed "realpow_minus_one";
  45.139  Addsimps [realpow_minus_one];
  45.140  
  45.141 -Goal "(-1) ^ Suc (2*n) = -(Numeral1::real)";
  45.142 +Goal "(-1) ^ Suc (2*n) = -(1::real)";
  45.143  by Auto_tac;
  45.144  qed "realpow_minus_one_odd";
  45.145  Addsimps [realpow_minus_one_odd];
  45.146  
  45.147 -Goal "(-1) ^ Suc (Suc (2*n)) = (Numeral1::real)";
  45.148 +Goal "(-1) ^ Suc (Suc (2*n)) = (1::real)";
  45.149  by Auto_tac;
  45.150  qed "realpow_minus_one_even";
  45.151  Addsimps [realpow_minus_one_even];
  45.152  
  45.153 -Goal "(Numeral0::real) < r & r < (Numeral1::real) --> r ^ Suc n < r ^ n";
  45.154 +Goal "(0::real) < r & r < (1::real) --> r ^ Suc n < r ^ n";
  45.155  by (induct_tac "n" 1);
  45.156  by Auto_tac;
  45.157  qed_spec_mp "realpow_Suc_less";
  45.158  
  45.159 -Goal "Numeral0 <= r & r < (Numeral1::real) --> r ^ Suc n <= r ^ n";
  45.160 +Goal "0 <= r & r < (1::real) --> r ^ Suc n <= r ^ n";
  45.161  by (induct_tac "n" 1);
  45.162  by (auto_tac (claset() addIs [order_less_imp_le] 
  45.163                         addSDs [order_le_imp_less_or_eq],
  45.164                simpset()));
  45.165  qed_spec_mp "realpow_Suc_le";
  45.166  
  45.167 -Goal "(Numeral0::real) <= Numeral0 ^ n";
  45.168 +Goal "(0::real) <= 0 ^ n";
  45.169  by (case_tac "n" 1);
  45.170  by Auto_tac;
  45.171  qed "realpow_zero_le";
  45.172  Addsimps [realpow_zero_le];
  45.173  
  45.174 -Goal "Numeral0 < r & r < (Numeral1::real) --> r ^ Suc n <= r ^ n";
  45.175 +Goal "0 < r & r < (1::real) --> r ^ Suc n <= r ^ n";
  45.176  by (blast_tac (claset() addSIs [order_less_imp_le,
  45.177      realpow_Suc_less]) 1);
  45.178  qed_spec_mp "realpow_Suc_le2";
  45.179  
  45.180 -Goal "[| Numeral0 <= r; r < (Numeral1::real) |] ==> r ^ Suc n <= r ^ n";
  45.181 +Goal "[| 0 <= r; r < (1::real) |] ==> r ^ Suc n <= r ^ n";
  45.182  by (etac (order_le_imp_less_or_eq RS disjE) 1);
  45.183  by (rtac realpow_Suc_le2 1);
  45.184  by Auto_tac;
  45.185  qed "realpow_Suc_le3";
  45.186  
  45.187 -Goal "Numeral0 <= r & r < (Numeral1::real) & n < N --> r ^ N <= r ^ n";
  45.188 +Goal "0 <= r & r < (1::real) & n < N --> r ^ N <= r ^ n";
  45.189  by (induct_tac "N" 1);
  45.190  by (ALLGOALS Asm_simp_tac); 
  45.191  by (Clarify_tac 1);
  45.192 -by (subgoal_tac "r * r ^ na <= Numeral1 * r ^ n" 1); 
  45.193 +by (subgoal_tac "r * r ^ na <= 1 * r ^ n" 1); 
  45.194  by (Asm_full_simp_tac 1); 
  45.195  by (rtac real_mult_le_mono 1); 
  45.196  by (auto_tac (claset(), simpset() addsimps [realpow_ge_zero, less_Suc_eq]));  
  45.197  qed_spec_mp "realpow_less_le";
  45.198  
  45.199 -Goal "[| Numeral0 <= r; r < (Numeral1::real); n <= N |] ==> r ^ N <= r ^ n";
  45.200 +Goal "[| 0 <= r; r < (1::real); n <= N |] ==> r ^ N <= r ^ n";
  45.201  by (dres_inst_tac [("n","N")] le_imp_less_or_eq 1);
  45.202  by (auto_tac (claset() addIs [realpow_less_le],
  45.203      simpset()));
  45.204  qed "realpow_le_le";
  45.205  
  45.206 -Goal "[| Numeral0 < r; r < (Numeral1::real) |] ==> r ^ Suc n <= r";
  45.207 +Goal "[| 0 < r; r < (1::real) |] ==> r ^ Suc n <= r";
  45.208  by (dres_inst_tac [("n","1"),("N","Suc n")] 
  45.209      (order_less_imp_le RS realpow_le_le) 1);
  45.210  by Auto_tac;
  45.211  qed "realpow_Suc_le_self";
  45.212  
  45.213 -Goal "[| Numeral0 < r; r < (Numeral1::real) |] ==> r ^ Suc n < Numeral1";
  45.214 +Goal "[| 0 < r; r < (1::real) |] ==> r ^ Suc n < 1";
  45.215  by (blast_tac (claset() addIs [realpow_Suc_le_self, order_le_less_trans]) 1);
  45.216  qed "realpow_Suc_less_one";
  45.217  
  45.218 -Goal "(Numeral1::real) <= r --> r ^ n <= r ^ Suc n";
  45.219 +Goal "(1::real) <= r --> r ^ n <= r ^ Suc n";
  45.220  by (induct_tac "n" 1);
  45.221  by Auto_tac;
  45.222  qed_spec_mp "realpow_le_Suc";
  45.223  
  45.224 -Goal "(Numeral1::real) < r --> r ^ n < r ^ Suc n";
  45.225 +Goal "(1::real) < r --> r ^ n < r ^ Suc n";
  45.226  by (induct_tac "n" 1);
  45.227  by Auto_tac;
  45.228  qed_spec_mp "realpow_less_Suc";
  45.229  
  45.230 -Goal "(Numeral1::real) < r --> r ^ n <= r ^ Suc n";
  45.231 +Goal "(1::real) < r --> r ^ n <= r ^ Suc n";
  45.232  by (blast_tac (claset() addSIs [order_less_imp_le, realpow_less_Suc]) 1);
  45.233  qed_spec_mp "realpow_le_Suc2";
  45.234  
  45.235 -Goal "(Numeral1::real) < r & n < N --> r ^ n <= r ^ N";
  45.236 +Goal "(1::real) < r & n < N --> r ^ n <= r ^ N";
  45.237  by (induct_tac "N" 1);
  45.238  by Auto_tac;
  45.239  by (ALLGOALS(forw_inst_tac [("n","na")] realpow_ge_one));
  45.240 -by (ALLGOALS(dtac (rename_numerals real_mult_self_le)));
  45.241 +by (ALLGOALS(dtac (real_mult_self_le)));
  45.242  by (assume_tac 1);
  45.243  by (assume_tac 2);
  45.244  by (auto_tac (claset() addIs [order_trans],
  45.245                simpset() addsimps [less_Suc_eq]));
  45.246  qed_spec_mp "realpow_gt_ge";
  45.247  
  45.248 -Goal "(Numeral1::real) <= r & n < N --> r ^ n <= r ^ N";
  45.249 +Goal "(1::real) <= r & n < N --> r ^ n <= r ^ N";
  45.250  by (induct_tac "N" 1);
  45.251  by Auto_tac;
  45.252  by (ALLGOALS(forw_inst_tac [("n","na")] realpow_ge_one2));
  45.253 -by (ALLGOALS(dtac (rename_numerals real_mult_self_le2)));
  45.254 +by (ALLGOALS(dtac (real_mult_self_le2)));
  45.255  by (assume_tac 1);
  45.256  by (assume_tac 2);
  45.257  by (auto_tac (claset() addIs [order_trans],
  45.258                simpset() addsimps [less_Suc_eq]));
  45.259  qed_spec_mp "realpow_gt_ge2";
  45.260  
  45.261 -Goal "[| (Numeral1::real) < r; n <= N |] ==> r ^ n <= r ^ N";
  45.262 +Goal "[| (1::real) < r; n <= N |] ==> r ^ n <= r ^ N";
  45.263  by (dres_inst_tac [("n","N")] le_imp_less_or_eq 1);
  45.264  by (auto_tac (claset() addIs [realpow_gt_ge], simpset()));
  45.265  qed "realpow_ge_ge";
  45.266  
  45.267 -Goal "[| (Numeral1::real) <= r; n <= N |] ==> r ^ n <= r ^ N";
  45.268 +Goal "[| (1::real) <= r; n <= N |] ==> r ^ n <= r ^ N";
  45.269  by (dres_inst_tac [("n","N")] le_imp_less_or_eq 1);
  45.270  by (auto_tac (claset() addIs [realpow_gt_ge2], simpset()));
  45.271  qed "realpow_ge_ge2";
  45.272  
  45.273 -Goal "(Numeral1::real) < r ==> r <= r ^ Suc n";
  45.274 +Goal "(1::real) < r ==> r <= r ^ Suc n";
  45.275  by (dres_inst_tac [("n","1"),("N","Suc n")] 
  45.276      realpow_ge_ge 1);
  45.277  by Auto_tac;
  45.278  qed_spec_mp "realpow_Suc_ge_self";
  45.279  
  45.280 -Goal "(Numeral1::real) <= r ==> r <= r ^ Suc n";
  45.281 +Goal "(1::real) <= r ==> r <= r ^ Suc n";
  45.282  by (dres_inst_tac [("n","1"),("N","Suc n")] 
  45.283      realpow_ge_ge2 1);
  45.284  by Auto_tac;
  45.285  qed_spec_mp "realpow_Suc_ge_self2";
  45.286  
  45.287 -Goal "[| (Numeral1::real) < r; 0 < n |] ==> r <= r ^ n";
  45.288 +Goal "[| (1::real) < r; 0 < n |] ==> r <= r ^ n";
  45.289  by (dtac (less_not_refl2 RS  not0_implies_Suc) 1);
  45.290  by (auto_tac (claset() addSIs 
  45.291      [realpow_Suc_ge_self],simpset()));
  45.292  qed "realpow_ge_self";
  45.293  
  45.294 -Goal "[| (Numeral1::real) <= r; 0 < n |] ==> r <= r ^ n";
  45.295 +Goal "[| (1::real) <= r; 0 < n |] ==> r <= r ^ n";
  45.296  by (dtac (less_not_refl2 RS  not0_implies_Suc) 1);
  45.297  by (auto_tac (claset() addSIs [realpow_Suc_ge_self2],simpset()));
  45.298  qed "realpow_ge_self2";
  45.299 @@ -289,7 +289,7 @@
  45.300  qed_spec_mp "realpow_minus_mult";
  45.301  Addsimps [realpow_minus_mult];
  45.302  
  45.303 -Goal "r ~= Numeral0 ==> r * inverse r ^Suc (Suc 0) = inverse (r::real)";
  45.304 +Goal "r ~= 0 ==> r * inverse r ^Suc (Suc 0) = inverse (r::real)";
  45.305  by (asm_simp_tac (simpset() addsimps [realpow_two,
  45.306                    real_mult_assoc RS sym]) 1);
  45.307  qed "realpow_two_mult_inverse";
  45.308 @@ -313,7 +313,7 @@
  45.309  qed "realpow_two_disj";
  45.310  
  45.311  (* used in Transc *)
  45.312 -Goal  "[|(x::real) ~= Numeral0; m <= n |] ==> x ^ (n - m) = x ^ n * inverse (x ^ m)";
  45.313 +Goal  "[|(x::real) ~= 0; m <= n |] ==> x ^ (n - m) = x ^ n * inverse (x ^ m)";
  45.314  by (auto_tac (claset(),
  45.315         simpset() addsimps [le_eq_less_or_eq, less_iff_Suc_add, realpow_add,
  45.316                             realpow_not_zero] @ real_mult_ac));
  45.317 @@ -325,15 +325,15 @@
  45.318                simpset() addsimps [real_of_nat_one, real_of_nat_mult]));
  45.319  qed "realpow_real_of_nat";
  45.320  
  45.321 -Goal "Numeral0 < real (Suc (Suc 0) ^ n)";
  45.322 +Goal "0 < real (Suc (Suc 0) ^ n)";
  45.323  by (induct_tac "n" 1);
  45.324  by (auto_tac (claset(),
  45.325 -          simpset() addsimps [real_of_nat_mult, real_zero_less_mult_iff]));
  45.326 +          simpset() addsimps [real_of_nat_mult, real_0_less_mult_iff]));
  45.327  qed "realpow_real_of_nat_two_pos";
  45.328  Addsimps [realpow_real_of_nat_two_pos];
  45.329  
  45.330  
  45.331 -Goal "(Numeral0::real) <= x --> Numeral0 <= y --> x ^ Suc n <= y ^ Suc n --> x <= y";
  45.332 +Goal "(0::real) <= x --> 0 <= y --> x ^ Suc n <= y ^ Suc n --> x <= y";
  45.333  by (induct_tac "n" 1);
  45.334  by Auto_tac;
  45.335  by (asm_full_simp_tac (simpset() addsimps [linorder_not_less RS sym]) 1); 
  45.336 @@ -345,7 +345,7 @@
  45.337  by Auto_tac;  
  45.338  qed_spec_mp "realpow_increasing";
  45.339    
  45.340 -Goal "[| (Numeral0::real) <= x; Numeral0 <= y; x ^ Suc n = y ^ Suc n |] ==> x = y";
  45.341 +Goal "[| (0::real) <= x; 0 <= y; x ^ Suc n = y ^ Suc n |] ==> x = y";
  45.342  by (blast_tac (claset() addIs [realpow_increasing, order_antisym, 
  45.343  			       order_eq_refl, sym]) 1);
  45.344  qed_spec_mp "realpow_Suc_cancel_eq";
    46.1 --- a/src/HOL/Real/RealPow.thy	Thu Nov 01 21:12:13 2001 +0100
    46.2 +++ b/src/HOL/Real/RealPow.thy	Fri Nov 02 17:55:24 2001 +0100
    46.3 @@ -15,7 +15,7 @@
    46.4  instance real :: power ..
    46.5  
    46.6  primrec (realpow)
    46.7 -     realpow_0:   "r ^ 0       = Numeral1"
    46.8 +     realpow_0:   "r ^ 0       = 1"
    46.9       realpow_Suc: "r ^ (Suc n) = (r::real) * (r ^ n)"
   46.10  
   46.11  end
    47.1 --- a/src/HOL/Real/ex/BinEx.thy	Thu Nov 01 21:12:13 2001 +0100
    47.2 +++ b/src/HOL/Real/ex/BinEx.thy	Fri Nov 02 17:55:24 2001 +0100
    47.3 @@ -57,7 +57,7 @@
    47.4  lemma "(13557456::real) < 18678654"
    47.5    by simp
    47.6  
    47.7 -lemma "(999999::real) \<le> (1000001 + Numeral1) - 2"
    47.8 +lemma "(999999::real) \<le> (1000001 + 1) - 2"
    47.9    by simp
   47.10  
   47.11  lemma "(1234567::real) \<le> 1234567"
   47.12 @@ -66,16 +66,16 @@
   47.13  
   47.14  text {* \medskip Tests *}
   47.15  
   47.16 -lemma "(x + y = x) = (y = (Numeral0::real))"
   47.17 +lemma "(x + y = x) = (y = (0::real))"
   47.18    by arith
   47.19  
   47.20 -lemma "(x + y = y) = (x = (Numeral0::real))"
   47.21 +lemma "(x + y = y) = (x = (0::real))"
   47.22    by arith
   47.23  
   47.24 -lemma "(x + y = (Numeral0::real)) = (x = -y)"
   47.25 +lemma "(x + y = (0::real)) = (x = -y)"
   47.26    by arith
   47.27  
   47.28 -lemma "(x + y = (Numeral0::real)) = (y = -x)"
   47.29 +lemma "(x + y = (0::real)) = (y = -x)"
   47.30    by arith
   47.31  
   47.32  lemma "((x + y) < (x + z)) = (y < (z::real))"
   47.33 @@ -123,25 +123,25 @@
   47.34  lemma "\<not>(x \<le> y \<and> y < (x::real))"
   47.35    by arith
   47.36  
   47.37 -lemma "(-x < (Numeral0::real)) = (Numeral0 < x)"
   47.38 +lemma "(-x < (0::real)) = (0 < x)"
   47.39    by arith
   47.40  
   47.41 -lemma "((Numeral0::real) < -x) = (x < Numeral0)"
   47.42 +lemma "((0::real) < -x) = (x < 0)"
   47.43    by arith
   47.44  
   47.45 -lemma "(-x \<le> (Numeral0::real)) = (Numeral0 \<le> x)"
   47.46 +lemma "(-x \<le> (0::real)) = (0 \<le> x)"
   47.47    by arith
   47.48  
   47.49 -lemma "((Numeral0::real) \<le> -x) = (x \<le> Numeral0)"
   47.50 +lemma "((0::real) \<le> -x) = (x \<le> 0)"
   47.51    by arith
   47.52  
   47.53  lemma "(x::real) = y \<or> x < y \<or> y < x"
   47.54    by arith
   47.55  
   47.56 -lemma "(x::real) = Numeral0 \<or> Numeral0 < x \<or> Numeral0 < -x"
   47.57 +lemma "(x::real) = 0 \<or> 0 < x \<or> 0 < -x"
   47.58    by arith
   47.59  
   47.60 -lemma "(Numeral0::real) \<le> x \<or> Numeral0 \<le> -x"
   47.61 +lemma "(0::real) \<le> x \<or> 0 \<le> -x"
   47.62    by arith
   47.63  
   47.64  lemma "((x::real) + y \<le> x + z) = (y \<le> z)"
   47.65 @@ -156,16 +156,16 @@
   47.66  lemma "(w::real) \<le> x \<and> y \<le> z ==> w + y \<le> x + z"
   47.67    by arith
   47.68  
   47.69 -lemma "(Numeral0::real) \<le> x \<and> Numeral0 \<le> y ==> Numeral0 \<le> x + y"
   47.70 +lemma "(0::real) \<le> x \<and> 0 \<le> y ==> 0 \<le> x + y"
   47.71    by arith
   47.72  
   47.73 -lemma "(Numeral0::real) < x \<and> Numeral0 < y ==> Numeral0 < x + y"
   47.74 +lemma "(0::real) < x \<and> 0 < y ==> 0 < x + y"
   47.75    by arith
   47.76  
   47.77 -lemma "(-x < y) = (Numeral0 < x + (y::real))"
   47.78 +lemma "(-x < y) = (0 < x + (y::real))"
   47.79    by arith
   47.80  
   47.81 -lemma "(x < -y) = (x + y < (Numeral0::real))"
   47.82 +lemma "(x < -y) = (x + y < (0::real))"
   47.83    by arith
   47.84  
   47.85  lemma "(y < x + -z) = (y + z < (x::real))"
   47.86 @@ -174,7 +174,7 @@
   47.87  lemma "(x + -y < z) = (x < z + (y::real))"
   47.88    by arith
   47.89  
   47.90 -lemma "x \<le> y ==> x < y + (Numeral1::real)"
   47.91 +lemma "x \<le> y ==> x < y + (1::real)"
   47.92    by arith
   47.93  
   47.94  lemma "(x - y) + y = (x::real)"
   47.95 @@ -183,31 +183,31 @@
   47.96  lemma "y + (x - y) = (x::real)"
   47.97    by arith
   47.98  
   47.99 -lemma "x - x = (Numeral0::real)"
  47.100 +lemma "x - x = (0::real)"
  47.101    by arith
  47.102  
  47.103 -lemma "(x - y = Numeral0) = (x = (y::real))"
  47.104 +lemma "(x - y = 0) = (x = (y::real))"
  47.105    by arith
  47.106  
  47.107 -lemma "((Numeral0::real) \<le> x + x) = (Numeral0 \<le> x)"
  47.108 +lemma "((0::real) \<le> x + x) = (0 \<le> x)"
  47.109    by arith
  47.110  
  47.111 -lemma "(-x \<le> x) = ((Numeral0::real) \<le> x)"
  47.112 +lemma "(-x \<le> x) = ((0::real) \<le> x)"
  47.113    by arith
  47.114  
  47.115 -lemma "(x \<le> -x) = (x \<le> (Numeral0::real))"
  47.116 +lemma "(x \<le> -x) = (x \<le> (0::real))"
  47.117    by arith
  47.118  
  47.119 -lemma "(-x = (Numeral0::real)) = (x = Numeral0)"
  47.120 +lemma "(-x = (0::real)) = (x = 0)"
  47.121    by arith
  47.122  
  47.123  lemma "-(x - y) = y - (x::real)"
  47.124    by arith
  47.125  
  47.126 -lemma "((Numeral0::real) < x - y) = (y < x)"
  47.127 +lemma "((0::real) < x - y) = (y < x)"
  47.128    by arith
  47.129  
  47.130 -lemma "((Numeral0::real) \<le> x - y) = (y \<le> x)"
  47.131 +lemma "((0::real) \<le> x - y) = (y \<le> x)"
  47.132    by arith
  47.133  
  47.134  lemma "(x + y) - x = (y::real)"
  47.135 @@ -219,16 +219,16 @@
  47.136  lemma "x < (y::real) ==> \<not>(x = y)"
  47.137    by arith
  47.138  
  47.139 -lemma "(x \<le> x + y) = ((Numeral0::real) \<le> y)"
  47.140 +lemma "(x \<le> x + y) = ((0::real) \<le> y)"
  47.141    by arith
  47.142  
  47.143 -lemma "(y \<le> x + y) = ((Numeral0::real) \<le> x)"
  47.144 +lemma "(y \<le> x + y) = ((0::real) \<le> x)"
  47.145    by arith
  47.146  
  47.147 -lemma "(x < x + y) = ((Numeral0::real) < y)"
  47.148 +lemma "(x < x + y) = ((0::real) < y)"
  47.149    by arith
  47.150  
  47.151 -lemma "(y < x + y) = ((Numeral0::real) < x)"
  47.152 +lemma "(y < x + y) = ((0::real) < x)"
  47.153    by arith
  47.154  
  47.155  lemma "(x - y) - x = (-y::real)"
  47.156 @@ -258,10 +258,10 @@
  47.157  lemma "(a + b) - (c + d) = (a - c) + (b - (d::real))"
  47.158    by arith
  47.159  
  47.160 -lemma "(Numeral0::real) - x = -x"
  47.161 +lemma "(0::real) - x = -x"
  47.162    by arith
  47.163  
  47.164 -lemma "x - (Numeral0::real) = x"
  47.165 +lemma "x - (0::real) = x"
  47.166    by arith
  47.167  
  47.168  lemma "w \<le> x \<and> y < z ==> w + y < x + (z::real)"
  47.169 @@ -270,10 +270,10 @@
  47.170  lemma "w < x \<and> y \<le> z ==> w + y < x + (z::real)"
  47.171    by arith
  47.172  
  47.173 -lemma "(Numeral0::real) \<le> x \<and> Numeral0 < y ==> Numeral0 < x + (y::real)"
  47.174 +lemma "(0::real) \<le> x \<and> 0 < y ==> 0 < x + (y::real)"
  47.175    by arith
  47.176  
  47.177 -lemma "(Numeral0::real) < x \<and> Numeral0 \<le> y ==> Numeral0 < x + y"
  47.178 +lemma "(0::real) < x \<and> 0 \<le> y ==> 0 < x + y"
  47.179    by arith
  47.180  
  47.181  lemma "-x - y = -(x + (y::real))"
  47.182 @@ -303,7 +303,7 @@
  47.183  lemma "x = y ==> x \<le> (y::real)"
  47.184    by arith
  47.185  
  47.186 -lemma "(Numeral0::real) < x ==> \<not>(x = Numeral0)"
  47.187 +lemma "(0::real) < x ==> \<not>(x = 0)"
  47.188    by arith
  47.189  
  47.190  lemma "(x + y) * (x - y) = (x * x) - (y * y)"
    48.1 --- a/src/HOL/Real/real_arith0.ML	Thu Nov 01 21:12:13 2001 +0100
    48.2 +++ b/src/HOL/Real/real_arith0.ML	Fri Nov 02 17:55:24 2001 +0100
    48.3 @@ -9,22 +9,22 @@
    48.4  local
    48.5  
    48.6  (* reduce contradictory <= to False *)
    48.7 -val simps = [order_less_irrefl, zero_eq_numeral_0, one_eq_numeral_1,
    48.8 -             add_real_number_of, minus_real_number_of, diff_real_number_of,
    48.9 -             mult_real_number_of, eq_real_number_of, less_real_number_of,
   48.10 -             le_real_number_of_eq_not_less, real_diff_def,
   48.11 -             real_minus_add_distrib, real_minus_minus, real_mult_assoc];
   48.12 -
   48.13 -val add_rules =
   48.14 -    map rename_numerals
   48.15 -        [real_add_zero_left, real_add_zero_right,
   48.16 -         real_add_minus, real_add_minus_left,
   48.17 -         real_mult_0, real_mult_0_right,
   48.18 -         real_mult_1, real_mult_1_right,
   48.19 -         real_mult_minus_1, real_mult_minus_1_right];
   48.20 +val add_rules = 
   48.21 +    [order_less_irrefl, real_numeral_0_eq_0, real_numeral_1_eq_1,
   48.22 +     add_real_number_of, minus_real_number_of, diff_real_number_of,
   48.23 +     mult_real_number_of, eq_real_number_of, less_real_number_of,
   48.24 +     le_real_number_of_eq_not_less, real_diff_def,
   48.25 +     real_minus_add_distrib, real_minus_minus, real_mult_assoc,
   48.26 +     real_minus_zero,
   48.27 +     real_add_zero_left, real_add_zero_right,
   48.28 +     real_add_minus, real_add_minus_left,
   48.29 +     real_mult_0, real_mult_0_right,
   48.30 +     real_mult_1, real_mult_1_right,
   48.31 +     real_mult_minus_1, real_mult_minus_1_right];
   48.32  
   48.33  val simprocs = [Real_Times_Assoc.conv, Real_Numeral_Simprocs.combine_numerals]@
   48.34 -               Real_Numeral_Simprocs.cancel_numerals;
   48.35 +               Real_Numeral_Simprocs.cancel_numerals @
   48.36 +               Real_Numeral_Simprocs.eval_numerals;
   48.37  
   48.38  val mono_ss = simpset() addsimps
   48.39                  [real_add_le_mono,real_add_less_mono,
   48.40 @@ -66,14 +66,14 @@
   48.41      mult_mono_thms = mult_mono_thms @ real_mult_mono_thms,
   48.42      inj_thms = inj_thms, (*FIXME: add real*)
   48.43      lessD = lessD,  (*We don't change LA_Data_Ref.lessD because the real ordering is dense!*)
   48.44 -    simpset = simpset addsimps (add_rules @ simps)
   48.45 +    simpset = simpset addsimps add_rules
   48.46                        addsimprocs simprocs}),
   48.47    arith_discrete ("RealDef.real",false),
   48.48    Simplifier.change_simpset_of (op addsimprocs) [fast_real_arith_simproc]];
   48.49  
   48.50  (* some thms for injection nat => real:
   48.51  real_of_nat_zero
   48.52 -zero_eq_numeral_0
   48.53 +?zero_eq_numeral_0
   48.54  real_of_nat_add
   48.55  *)
   48.56