tweaking of lemmas in RealDef, RealOrd
authorpaulson
Thu Jan 01 10:06:32 2004 +0100 (2004-01-01)
changeset 143346137d24eef79
parent 14333 14f29eb097a3
child 14335 9c0b5e081037
tweaking of lemmas in RealDef, RealOrd
src/HOL/Complex/CLim.ML
src/HOL/Complex/CSeries.ML
src/HOL/Complex/Complex.thy
src/HOL/Complex/NSCA.ML
src/HOL/Complex/ROOT.ML
src/HOL/Hyperreal/Fact.ML
src/HOL/Hyperreal/HLog.ML
src/HOL/Hyperreal/HTranscendental.ML
src/HOL/Hyperreal/HyperBin.ML
src/HOL/Hyperreal/HyperDef.thy
src/HOL/Hyperreal/HyperOrd.thy
src/HOL/Hyperreal/HyperPow.ML
src/HOL/Hyperreal/Integration.ML
src/HOL/Hyperreal/Lim.ML
src/HOL/Hyperreal/Log.ML
src/HOL/Hyperreal/MacLaurin.ML
src/HOL/Hyperreal/NSA.ML
src/HOL/Hyperreal/NthRoot.thy
src/HOL/Hyperreal/Poly.ML
src/HOL/Hyperreal/SEQ.ML
src/HOL/Hyperreal/Series.ML
src/HOL/Hyperreal/Transcendental.ML
src/HOL/Hyperreal/hypreal_arith.ML
src/HOL/Hyperreal/hypreal_arith0.ML
src/HOL/IsaMakefile
src/HOL/Real/Complex_Numbers.thy
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/RComplete.ML
src/HOL/Real/RealArith.thy
src/HOL/Real/RealBin.ML
src/HOL/Real/RealDef.thy
src/HOL/Real/RealInt.thy
src/HOL/Real/RealOrd.thy
src/HOL/Real/RealPow.thy
src/HOL/Real/real_arith.ML
src/HOL/Real/real_arith0.ML
src/HOL/Ring_and_Field.thy
     1.1 --- a/src/HOL/Complex/CLim.ML	Mon Dec 29 06:49:26 2003 +0100
     1.2 +++ b/src/HOL/Complex/CLim.ML	Thu Jan 01 10:06:32 2004 +0100
     1.3 @@ -50,7 +50,7 @@
     1.4  \             cmod(xa - x) < inverse(real(Suc n)) & r <= cmod(f xa - L)";
     1.5  by (Clarify_tac 1); 
     1.6  by (cut_inst_tac [("n1","n")]
     1.7 -    (real_of_nat_Suc_gt_zero RS real_inverse_gt_0) 1);
     1.8 +    (real_of_nat_Suc_gt_zero RS positive_imp_inverse_positive) 1);
     1.9  by Auto_tac;
    1.10  val lemma_CLIM = result();
    1.11  
    1.12 @@ -132,7 +132,7 @@
    1.13  \             cmod(xa - x) < inverse(real(Suc n)) & r <= abs (f xa - L)";
    1.14  by (Clarify_tac 1); 
    1.15  by (cut_inst_tac [("n1","n")]
    1.16 -    (real_of_nat_Suc_gt_zero RS real_inverse_gt_0) 1);
    1.17 +    (real_of_nat_Suc_gt_zero RS positive_imp_inverse_positive) 1);
    1.18  by Auto_tac;
    1.19  val lemma_CRLIM = result();
    1.20  
     2.1 --- a/src/HOL/Complex/CSeries.ML	Mon Dec 29 06:49:26 2003 +0100
     2.2 +++ b/src/HOL/Complex/CSeries.ML	Thu Jan 01 10:06:32 2004 +0100
     2.3 @@ -30,7 +30,7 @@
     2.4  
     2.5  Goal "sumc m n f + sumc m n g = sumc m n (%n. f n + g n)";
     2.6  by (induct_tac "n" 1);
     2.7 -by (auto_tac (claset(),simpset() addsimps real_add_ac));
     2.8 +by (auto_tac (claset(),simpset() addsimps add_ac));
     2.9  qed "sumc_add";
    2.10  
    2.11  Goal "r * sumc m n f = sumc m n (%n. r * f n)";
    2.12 @@ -107,7 +107,7 @@
    2.13  Goal "(ALL n. m <= Suc n --> f n = r) & m <= na \
    2.14  \                --> sumc m na f = (complex_of_real(real (na - m)) * r)";
    2.15  by (induct_tac "na" 1);
    2.16 -by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib, Suc_diff_n,
    2.17 +by (auto_tac (claset(),simpset() addsimps [left_distrib, Suc_diff_n,
    2.18                                        real_of_nat_Suc,complex_of_real_add RS sym,
    2.19                                        complex_add_mult_distrib]));
    2.20  qed_spec_mp "sumc_interval_const";
    2.21 @@ -115,7 +115,7 @@
    2.22  Goal "(ALL n. m <= n --> f n = r) & m <= na \
    2.23  \     --> sumc m na f = (complex_of_real(real (na - m)) * r)";
    2.24  by (induct_tac "na" 1);
    2.25 -by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib, Suc_diff_n,
    2.26 +by (auto_tac (claset(),simpset() addsimps [left_distrib, Suc_diff_n,
    2.27                                        real_of_nat_Suc,complex_of_real_add RS sym,
    2.28                                        complex_add_mult_distrib]));
    2.29  qed_spec_mp "sumc_interval_const2";
    2.30 @@ -128,15 +128,15 @@
    2.31  by (ALLGOALS(dres_inst_tac [("x","n")] spec));
    2.32  by (Step_tac 1);
    2.33  by (dtac le_imp_less_or_eq 1 THEN Step_tac 1);
    2.34 -by (dtac real_add_le_mono 2);
    2.35 -by (dres_inst_tac [("i","sumr 0 m f")] (order_refl RS real_add_le_mono) 1);
    2.36 +by (dtac add_mono 2);
    2.37 +by (dres_inst_tac [("i","sumr 0 m f")] (order_refl RS add_mono) 1);
    2.38  by (Auto_tac);
    2.39  qed_spec_mp "sumc_le";
    2.40  
    2.41  Goal "!!f g. (ALL r. m <= r & r < n --> f r <= g r) \
    2.42  \                --> sumc m n f <= sumc m n g";
    2.43  by (induct_tac "n" 1);
    2.44 -by (auto_tac (claset() addIs [real_add_le_mono],
    2.45 +by (auto_tac (claset() addIs [add_mono],
    2.46      simpset() addsimps [le_def]));
    2.47  qed_spec_mp "sumc_le2";
    2.48  
     3.1 --- a/src/HOL/Complex/Complex.thy	Mon Dec 29 06:49:26 2003 +0100
     3.2 +++ b/src/HOL/Complex/Complex.thy	Thu Jan 01 10:06:32 2004 +0100
     3.3 @@ -127,14 +127,11 @@
     3.4  declare inj_Abs_complex [THEN injD, simp]
     3.5  
     3.6  lemma Abs_complex_cancel_iff: "(Abs_complex x = Abs_complex y) = (x = y)"
     3.7 -apply (auto dest: inj_Abs_complex [THEN injD])
     3.8 -done
     3.9 +by (auto dest: inj_Abs_complex [THEN injD])
    3.10  declare Abs_complex_cancel_iff [simp]
    3.11  
    3.12  lemma pair_mem_complex: "(x,y) : complex"
    3.13 -apply (unfold complex_def)
    3.14 -apply auto
    3.15 -done
    3.16 +by (unfold complex_def, auto)
    3.17  declare pair_mem_complex [simp]
    3.18  
    3.19  lemma Abs_complex_inverse2: "Rep_complex (Abs_complex (x,y)) = (x,y)"
    3.20 @@ -144,7 +141,7 @@
    3.21  
    3.22  lemma eq_Abs_complex: "(!!x y. z = Abs_complex(x,y) ==> P) ==> P"
    3.23  apply (rule_tac p = "Rep_complex z" in PairE)
    3.24 -apply (drule_tac f = "Abs_complex" in arg_cong)
    3.25 +apply (drule_tac f = Abs_complex in arg_cong)
    3.26  apply (force simp add: Rep_complex_inverse)
    3.27  done
    3.28  
    3.29 @@ -161,14 +158,14 @@
    3.30  declare Im [simp]
    3.31  
    3.32  lemma Abs_complex_cancel: "Abs_complex(Re(z),Im(z)) = z"
    3.33 -apply (rule_tac z = "z" in eq_Abs_complex)
    3.34 +apply (rule_tac z = z in eq_Abs_complex)
    3.35  apply (simp (no_asm_simp))
    3.36  done
    3.37  declare Abs_complex_cancel [simp]
    3.38  
    3.39  lemma complex_Re_Im_cancel_iff: "(w=z) = (Re(w) = Re(z) & Im(w) = Im(z))"
    3.40 -apply (rule_tac z = "w" in eq_Abs_complex)
    3.41 -apply (rule_tac z = "z" in eq_Abs_complex)
    3.42 +apply (rule_tac z = w in eq_Abs_complex)
    3.43 +apply (rule_tac z = z in eq_Abs_complex)
    3.44  apply (auto dest: inj_Abs_complex [THEN injD])
    3.45  done
    3.46  
    3.47 @@ -196,15 +193,11 @@
    3.48  declare complex_Im_one [simp]
    3.49  
    3.50  lemma complex_Re_i: "Re(ii) = 0"
    3.51 -apply (unfold i_def)
    3.52 -apply auto
    3.53 -done
    3.54 +by (unfold i_def, auto)
    3.55  declare complex_Re_i [simp]
    3.56  
    3.57  lemma complex_Im_i: "Im(ii) = 1"
    3.58 -apply (unfold i_def)
    3.59 -apply auto
    3.60 -done
    3.61 +by (unfold i_def, auto)
    3.62  declare complex_Im_i [simp]
    3.63  
    3.64  lemma Re_complex_of_real_zero: "Re(complex_of_real 0) = 0"
    3.65 @@ -232,15 +225,11 @@
    3.66  declare Im_complex_of_real_one [simp]
    3.67  
    3.68  lemma Re_complex_of_real: "Re(complex_of_real z) = z"
    3.69 -apply (unfold complex_of_real_def)
    3.70 -apply auto
    3.71 -done
    3.72 +by (unfold complex_of_real_def, auto)
    3.73  declare Re_complex_of_real [simp]
    3.74  
    3.75  lemma Im_complex_of_real: "Im(complex_of_real z) = 0"
    3.76 -apply (unfold complex_of_real_def)
    3.77 -apply auto
    3.78 -done
    3.79 +by (unfold complex_of_real_def, auto)
    3.80  declare Im_complex_of_real [simp]
    3.81  
    3.82  
    3.83 @@ -253,13 +242,13 @@
    3.84  
    3.85  lemma complex_Re_minus: "Re (-z) = - Re z"
    3.86  apply (unfold Re_def)
    3.87 -apply (rule_tac z = "z" in eq_Abs_complex)
    3.88 +apply (rule_tac z = z in eq_Abs_complex)
    3.89  apply (auto simp add: complex_minus)
    3.90  done
    3.91  
    3.92  lemma complex_Im_minus: "Im (-z) = - Im z"
    3.93  apply (unfold Im_def)
    3.94 -apply (rule_tac z = "z" in eq_Abs_complex)
    3.95 +apply (rule_tac z = z in eq_Abs_complex)
    3.96  apply (auto simp add: complex_minus)
    3.97  done
    3.98  
    3.99 @@ -271,8 +260,7 @@
   3.100  
   3.101  lemma inj_complex_minus: "inj(%r::complex. -r)"
   3.102  apply (rule inj_onI)
   3.103 -apply (drule_tac f = "uminus" in arg_cong)
   3.104 -apply simp
   3.105 +apply (drule_tac f = uminus in arg_cong, simp)
   3.106  done
   3.107  
   3.108  lemma complex_minus_zero: "-(0::complex) = 0"
   3.109 @@ -282,20 +270,18 @@
   3.110  declare complex_minus_zero [simp]
   3.111  
   3.112  lemma complex_minus_zero_iff: "(-x = 0) = (x = (0::complex))"
   3.113 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.114 +apply (rule_tac z = x in eq_Abs_complex)
   3.115  apply (auto dest: inj_Abs_complex [THEN injD]
   3.116              simp add: complex_zero_def complex_minus)
   3.117  done
   3.118  declare complex_minus_zero_iff [simp]
   3.119  
   3.120  lemma complex_minus_zero_iff2: "(0 = -x) = (x = (0::real))"
   3.121 -apply (auto dest: sym)
   3.122 -done
   3.123 +by (auto dest: sym)
   3.124  declare complex_minus_zero_iff2 [simp]
   3.125  
   3.126  lemma complex_minus_not_zero_iff: "(-x ~= 0) = (x ~= (0::complex))"
   3.127 -apply auto
   3.128 -done
   3.129 +by auto
   3.130  
   3.131  
   3.132  subsection{*Addition*}
   3.133 @@ -308,15 +294,15 @@
   3.134  
   3.135  lemma complex_Re_add: "Re(x + y) = Re(x) + Re(y)"
   3.136  apply (unfold Re_def)
   3.137 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.138 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.139 +apply (rule_tac z = x in eq_Abs_complex)
   3.140 +apply (rule_tac z = y in eq_Abs_complex)
   3.141  apply (auto simp add: complex_add)
   3.142  done
   3.143  
   3.144  lemma complex_Im_add: "Im(x + y) = Im(x) + Im(y)"
   3.145  apply (unfold Im_def)
   3.146 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.147 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.148 +apply (rule_tac z = x in eq_Abs_complex)
   3.149 +apply (rule_tac z = y in eq_Abs_complex)
   3.150  apply (auto simp add: complex_add)
   3.151  done
   3.152  
   3.153 @@ -332,7 +318,7 @@
   3.154  
   3.155  lemma complex_add_left_commute: "(x::complex) + (y + z) = y + (x + z)"
   3.156  apply (unfold complex_add_def)
   3.157 -apply (simp (no_asm) add: real_add_left_commute)
   3.158 +apply (simp (no_asm) add: add_left_commute)
   3.159  done
   3.160  
   3.161  lemmas complex_add_ac = complex_add_assoc complex_add_commute
   3.162 @@ -375,18 +361,17 @@
   3.163  declare complex_add_minus_cancel [simp] complex_minus_add_cancel [simp]
   3.164  
   3.165  lemma complex_add_minus_eq_minus: "x + y = (0::complex) ==> x = -y"
   3.166 -apply (auto simp add: complex_Re_Im_cancel_iff complex_Re_add complex_Im_add complex_Re_minus complex_Im_minus)
   3.167 -done
   3.168 +by (auto simp add: complex_Re_Im_cancel_iff complex_Re_add complex_Im_add complex_Re_minus complex_Im_minus)
   3.169  
   3.170  lemma complex_minus_add_distrib: "-(x + y) = -x + -(y::complex)"
   3.171 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.172 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.173 +apply (rule_tac z = x in eq_Abs_complex)
   3.174 +apply (rule_tac z = y in eq_Abs_complex)
   3.175  apply (auto simp add: complex_minus complex_add)
   3.176  done
   3.177  declare complex_minus_add_distrib [simp]
   3.178  
   3.179  lemma complex_add_left_cancel: "((x::complex) + y = x + z) = (y = z)"
   3.180 -apply (safe)
   3.181 +apply safe
   3.182  apply (drule_tac f = "%t.-x + t" in arg_cong)
   3.183  apply (simp add: complex_add_assoc [symmetric])
   3.184  done
   3.185 @@ -398,15 +383,13 @@
   3.186  declare complex_add_right_cancel [simp]
   3.187  
   3.188  lemma complex_eq_minus_iff: "((x::complex) = y) = (0 = x + - y)"
   3.189 -apply (safe)
   3.190 -apply (rule_tac [2] x1 = "-y" in complex_add_right_cancel [THEN iffD1])
   3.191 -apply auto
   3.192 +apply safe
   3.193 +apply (rule_tac [2] x1 = "-y" in complex_add_right_cancel [THEN iffD1], auto)
   3.194  done
   3.195  
   3.196  lemma complex_eq_minus_iff2: "((x::complex) = y) = (x + - y = 0)"
   3.197 -apply (safe)
   3.198 -apply (rule_tac [2] x1 = "-y" in complex_add_right_cancel [THEN iffD1])
   3.199 -apply auto
   3.200 +apply safe
   3.201 +apply (rule_tac [2] x1 = "-y" in complex_add_right_cancel [THEN iffD1], auto)
   3.202  done
   3.203  
   3.204  lemma complex_diff_0: "(0::complex) - x = -x"
   3.205 @@ -430,8 +413,7 @@
   3.206  done
   3.207  
   3.208  lemma complex_diff_eq_eq: "((x::complex) - y = z) = (x = z + y)"
   3.209 -apply (auto simp add: complex_diff_def complex_add_assoc)
   3.210 -done
   3.211 +by (auto simp add: complex_diff_def complex_add_assoc)
   3.212  
   3.213  
   3.214  subsection{*Multiplication*}
   3.215 @@ -450,12 +432,12 @@
   3.216  
   3.217  lemma complex_mult_assoc: "((u::complex) * v) * w = u * (v * w)"
   3.218  apply (unfold complex_mult_def)
   3.219 -apply (simp (no_asm) add: complex_Re_Im_cancel_iff real_mult_assoc real_diff_mult_distrib2 real_add_mult_distrib2 real_diff_mult_distrib real_add_mult_distrib real_mult_left_commute)
   3.220 +apply (simp (no_asm) add: complex_Re_Im_cancel_iff real_mult_assoc right_diff_distrib right_distrib left_diff_distrib left_distrib mult_left_commute)
   3.221  done
   3.222  
   3.223  lemma complex_mult_left_commute: "(x::complex) * (y * z) = y * (x * z)"
   3.224  apply (unfold complex_mult_def)
   3.225 -apply (simp (no_asm) add: complex_Re_Im_cancel_iff real_mult_left_commute real_diff_mult_distrib2 real_add_mult_distrib2)
   3.226 +apply (simp (no_asm) add: complex_Re_Im_cancel_iff mult_left_commute right_diff_distrib right_distrib)
   3.227  done
   3.228  
   3.229  lemmas complex_mult_ac = complex_mult_assoc complex_mult_commute
   3.230 @@ -463,7 +445,7 @@
   3.231  
   3.232  lemma complex_mult_one_left: "(1::complex) * z = z"
   3.233  apply (unfold complex_one_def)
   3.234 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.235 +apply (rule_tac z = z in eq_Abs_complex)
   3.236  apply (simp (no_asm_simp) add: complex_mult)
   3.237  done
   3.238  declare complex_mult_one_left [simp]
   3.239 @@ -475,7 +457,7 @@
   3.240  
   3.241  lemma complex_mult_zero_left: "(0::complex) * z = 0"
   3.242  apply (unfold complex_zero_def)
   3.243 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.244 +apply (rule_tac z = z in eq_Abs_complex)
   3.245  apply (simp (no_asm_simp) add: complex_mult)
   3.246  done
   3.247  declare complex_mult_zero_left [simp]
   3.248 @@ -486,20 +468,18 @@
   3.249  declare complex_mult_zero_right [simp]
   3.250  
   3.251  lemma complex_divide_zero: "0 / z = (0::complex)"
   3.252 -apply (unfold complex_divide_def)
   3.253 -apply auto
   3.254 -done
   3.255 +by (unfold complex_divide_def, auto)
   3.256  declare complex_divide_zero [simp]
   3.257  
   3.258  lemma complex_minus_mult_eq1: "-(x * y) = -x * (y::complex)"
   3.259 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.260 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.261 +apply (rule_tac z = x in eq_Abs_complex)
   3.262 +apply (rule_tac z = y in eq_Abs_complex)
   3.263  apply (auto simp add: complex_mult complex_minus real_diff_def)
   3.264  done
   3.265  
   3.266  lemma complex_minus_mult_eq2: "-(x * y) = x * -(y::complex)"
   3.267 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.268 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.269 +apply (rule_tac z = x in eq_Abs_complex)
   3.270 +apply (rule_tac z = y in eq_Abs_complex)
   3.271  apply (auto simp add: complex_mult complex_minus real_diff_def)
   3.272  done
   3.273  
   3.274 @@ -526,10 +506,10 @@
   3.275  done
   3.276  
   3.277  lemma complex_add_mult_distrib: "((z1::complex) + z2) * w = (z1 * w) + (z2 * w)"
   3.278 -apply (rule_tac z = "z1" in eq_Abs_complex)
   3.279 -apply (rule_tac z = "z2" in eq_Abs_complex)
   3.280 -apply (rule_tac z = "w" in eq_Abs_complex)
   3.281 -apply (auto simp add: complex_mult complex_add real_add_mult_distrib real_diff_def real_add_ac)
   3.282 +apply (rule_tac z = z1 in eq_Abs_complex)
   3.283 +apply (rule_tac z = z2 in eq_Abs_complex)
   3.284 +apply (rule_tac z = w in eq_Abs_complex)
   3.285 +apply (auto simp add: complex_mult complex_add left_distrib real_diff_def add_ac)
   3.286  done
   3.287  
   3.288  lemma complex_add_mult_distrib2: "(w::complex) * (z1 + z2) = (w * z1) + (w * z2)"
   3.289 @@ -555,26 +535,23 @@
   3.290  done
   3.291  
   3.292  lemma COMPLEX_INVERSE_ZERO: "inverse 0 = (0::complex)"
   3.293 -apply (unfold complex_inverse_def complex_zero_def)
   3.294 -apply auto
   3.295 -done
   3.296 +by (unfold complex_inverse_def complex_zero_def, auto)
   3.297  
   3.298  lemma COMPLEX_DIVISION_BY_ZERO: "a / (0::complex) = 0"
   3.299  apply (simp (no_asm) add: complex_divide_def COMPLEX_INVERSE_ZERO)
   3.300  done
   3.301  
   3.302  lemma complex_mult_inv_left: "z ~= (0::complex) ==> inverse(z) * z = 1"
   3.303 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.304 -apply (auto simp add: complex_mult complex_inverse complex_one_def complex_zero_def real_add_divide_distrib [symmetric] real_power_two mult_ac)
   3.305 -apply (drule_tac y = "y" in real_sum_squares_not_zero)
   3.306 -apply (drule_tac [2] x = "x" in real_sum_squares_not_zero2)
   3.307 -apply auto
   3.308 +apply (rule_tac z = z in eq_Abs_complex)
   3.309 +apply (auto simp add: complex_mult complex_inverse complex_one_def 
   3.310 +       complex_zero_def add_divide_distrib [symmetric] real_power_two mult_ac)
   3.311 +apply (drule_tac y = y in real_sum_squares_not_zero)
   3.312 +apply (drule_tac [2] x = x in real_sum_squares_not_zero2, auto)
   3.313  done
   3.314  declare complex_mult_inv_left [simp]
   3.315  
   3.316  lemma complex_mult_inv_right: "z ~= (0::complex) ==> z * inverse(z) = 1"
   3.317 -apply (auto intro: complex_mult_commute [THEN subst])
   3.318 -done
   3.319 +by (auto intro: complex_mult_commute [THEN subst])
   3.320  declare complex_mult_inv_right [simp]
   3.321  
   3.322  lemma complex_mult_left_cancel: "(c::complex) ~= 0 ==> (c*a=c*b) = (a=b)"
   3.323 @@ -584,21 +561,21 @@
   3.324  done
   3.325  
   3.326  lemma complex_mult_right_cancel: "(c::complex) ~= 0 ==> (a*c=b*c) = (a=b)"
   3.327 -apply (safe)
   3.328 +apply safe
   3.329  apply (drule_tac f = "%x. x*inverse c" in arg_cong)
   3.330  apply (simp add: complex_mult_ac)
   3.331  done
   3.332  
   3.333  lemma complex_inverse_not_zero: "z ~= 0 ==> inverse(z::complex) ~= 0"
   3.334 -apply (safe)
   3.335 +apply safe
   3.336  apply (frule complex_mult_right_cancel [THEN iffD2])
   3.337  apply (erule_tac [2] V = "inverse z = 0" in thin_rl)
   3.338 -apply (assumption , auto)
   3.339 +apply (assumption, auto)
   3.340  done
   3.341  declare complex_inverse_not_zero [simp]
   3.342  
   3.343  lemma complex_mult_not_zero: "!!x. [| x ~= 0; y ~= (0::complex) |] ==> x * y ~= 0"
   3.344 -apply (safe)
   3.345 +apply safe
   3.346  apply (drule_tac f = "%z. inverse x*z" in arg_cong)
   3.347  apply (simp add: complex_mult_assoc [symmetric])
   3.348  done
   3.349 @@ -621,10 +598,8 @@
   3.350  
   3.351  lemma complex_minus_inverse: "inverse(-x) = -inverse(x::complex)"
   3.352  apply (case_tac "x = 0", simp add: COMPLEX_INVERSE_ZERO)
   3.353 -apply (rule_tac c1 = "-x" in complex_mult_right_cancel [THEN iffD1])
   3.354 -apply force
   3.355 -apply (subst complex_mult_inv_left)
   3.356 -apply auto
   3.357 +apply (rule_tac c1 = "-x" in complex_mult_right_cancel [THEN iffD1], force)
   3.358 +apply (subst complex_mult_inv_left, auto)
   3.359  done
   3.360  
   3.361  lemma complex_inverse_distrib: "inverse(x*y) = inverse x * inverse (y::complex)"
   3.362 @@ -699,8 +674,7 @@
   3.363  declare complex_of_real_zero [simp]
   3.364  
   3.365  lemma complex_of_real_eq_iff: "(complex_of_real x = complex_of_real y) = (x = y)"
   3.366 -apply (auto dest: inj_complex_of_real [THEN injD])
   3.367 -done
   3.368 +by (auto dest: inj_complex_of_real [THEN injD])
   3.369  declare complex_of_real_eq_iff [iff]
   3.370  
   3.371  lemma complex_of_real_minus: "complex_of_real(-x) = - complex_of_real x"
   3.372 @@ -710,7 +684,8 @@
   3.373  lemma complex_of_real_inverse: "complex_of_real(inverse x) = inverse(complex_of_real x)"
   3.374  apply (case_tac "x=0")
   3.375  apply (simp add: DIVISION_BY_ZERO COMPLEX_INVERSE_ZERO)
   3.376 -apply (simp add: complex_inverse complex_of_real_def real_divide_def real_inverse_distrib real_power_two)
   3.377 +apply (simp add: complex_inverse complex_of_real_def real_divide_def 
   3.378 +                 inverse_mult_distrib real_power_two)
   3.379  done
   3.380  
   3.381  lemma complex_of_real_add: "complex_of_real x + complex_of_real y = complex_of_real (x + y)"
   3.382 @@ -750,9 +725,7 @@
   3.383  declare complex_mod_zero [simp]
   3.384  
   3.385  lemma complex_mod_one: "cmod(1) = 1"
   3.386 -apply (unfold cmod_def)
   3.387 -apply (simp add: );  
   3.388 -done
   3.389 +by (unfold cmod_def, simp)
   3.390  declare complex_mod_one [simp]
   3.391  
   3.392  lemma complex_mod_complex_of_real: "cmod(complex_of_real x) = abs x"
   3.393 @@ -779,8 +752,7 @@
   3.394  done
   3.395  
   3.396  lemma complex_cnj_cancel_iff: "(cnj x = cnj y) = (x = y)"
   3.397 -apply (auto dest: inj_cnj [THEN injD])
   3.398 -done
   3.399 +by (auto dest: inj_cnj [THEN injD])
   3.400  declare complex_cnj_cancel_iff [simp]
   3.401  
   3.402  lemma complex_cnj_cnj: "cnj (cnj z) = z"
   3.403 @@ -796,7 +768,7 @@
   3.404  declare complex_cnj_complex_of_real [simp]
   3.405  
   3.406  lemma complex_mod_cnj: "cmod (cnj z) = cmod z"
   3.407 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.408 +apply (rule_tac z = z in eq_Abs_complex)
   3.409  apply (simp (no_asm_simp) add: complex_cnj complex_mod real_power_two)
   3.410  done
   3.411  declare complex_mod_cnj [simp]
   3.412 @@ -807,13 +779,13 @@
   3.413  done
   3.414  
   3.415  lemma complex_cnj_inverse: "cnj(inverse z) = inverse(cnj z)"
   3.416 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.417 +apply (rule_tac z = z in eq_Abs_complex)
   3.418  apply (simp (no_asm_simp) add: complex_cnj complex_inverse real_power_two)
   3.419  done
   3.420  
   3.421  lemma complex_cnj_add: "cnj(w + z) = cnj(w) + cnj(z)"
   3.422 -apply (rule_tac z = "w" in eq_Abs_complex)
   3.423 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.424 +apply (rule_tac z = w in eq_Abs_complex)
   3.425 +apply (rule_tac z = z in eq_Abs_complex)
   3.426  apply (simp (no_asm_simp) add: complex_cnj complex_add)
   3.427  done
   3.428  
   3.429 @@ -823,8 +795,8 @@
   3.430  done
   3.431  
   3.432  lemma complex_cnj_mult: "cnj(w * z) = cnj(w) * cnj(z)"
   3.433 -apply (rule_tac z = "w" in eq_Abs_complex)
   3.434 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.435 +apply (rule_tac z = w in eq_Abs_complex)
   3.436 +apply (rule_tac z = z in eq_Abs_complex)
   3.437  apply (simp (no_asm_simp) add: complex_cnj complex_mult)
   3.438  done
   3.439  
   3.440 @@ -845,28 +817,27 @@
   3.441  done
   3.442  
   3.443  lemma complex_add_cnj: "z + cnj z = complex_of_real (2 * Re(z))"
   3.444 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.445 +apply (rule_tac z = z in eq_Abs_complex)
   3.446  apply (simp (no_asm_simp) add: complex_add complex_cnj complex_of_real_def)
   3.447  done
   3.448  
   3.449  lemma complex_diff_cnj: "z - cnj z = complex_of_real (2 * Im(z)) * ii"
   3.450 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.451 +apply (rule_tac z = z in eq_Abs_complex)
   3.452  apply (simp (no_asm_simp) add: complex_add complex_cnj complex_of_real_def complex_diff_def complex_minus i_def complex_mult)
   3.453  done
   3.454  
   3.455  lemma complex_cnj_zero: "cnj 0 = 0"
   3.456 -apply (simp add: cnj_def complex_zero_def) 
   3.457 -done
   3.458 +by (simp add: cnj_def complex_zero_def)
   3.459  declare complex_cnj_zero [simp]
   3.460  
   3.461  lemma complex_cnj_zero_iff: "(cnj z = 0) = (z = 0)"
   3.462 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.463 +apply (rule_tac z = z in eq_Abs_complex)
   3.464  apply (auto simp add: complex_zero_def complex_cnj)
   3.465  done
   3.466  declare complex_cnj_zero_iff [iff]
   3.467  
   3.468  lemma complex_mult_cnj: "z * cnj z = complex_of_real (Re(z) ^ 2 + Im(z) ^ 2)"
   3.469 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.470 +apply (rule_tac z = z in eq_Abs_complex)
   3.471  apply (auto simp add: complex_cnj complex_mult complex_of_real_def real_power_two)
   3.472  done
   3.473  
   3.474 @@ -881,8 +852,8 @@
   3.475  
   3.476  lemma complex_add_left_cancel_zero: "(x + y = x) = (y = (0::complex))"
   3.477  apply (unfold complex_zero_def)
   3.478 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.479 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.480 +apply (rule_tac z = x in eq_Abs_complex)
   3.481 +apply (rule_tac z = y in eq_Abs_complex)
   3.482  apply (auto simp add: complex_add)
   3.483  done
   3.484  declare complex_add_left_cancel_zero [simp]
   3.485 @@ -910,7 +881,7 @@
   3.486  *)
   3.487  
   3.488  lemma complex_mod_eq_zero_cancel: "(cmod x = 0) = (x = 0)"
   3.489 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.490 +apply (rule_tac z = x in eq_Abs_complex)
   3.491  apply (auto intro: real_sum_squares_cancel real_sum_squares_cancel2 simp add: complex_mod complex_zero_def real_power_two)
   3.492  done
   3.493  declare complex_mod_eq_zero_cancel [simp]
   3.494 @@ -921,21 +892,19 @@
   3.495  declare complex_mod_complex_of_real_of_nat [simp]
   3.496  
   3.497  lemma complex_mod_minus: "cmod (-x) = cmod(x)"
   3.498 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.499 +apply (rule_tac z = x in eq_Abs_complex)
   3.500  apply (simp (no_asm_simp) add: complex_mod complex_minus real_power_two)
   3.501  done
   3.502  declare complex_mod_minus [simp]
   3.503  
   3.504  lemma complex_mod_mult_cnj: "cmod(z * cnj(z)) = cmod(z) ^ 2"
   3.505 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.506 +apply (rule_tac z = z in eq_Abs_complex)
   3.507  apply (simp (no_asm_simp) add: complex_mod complex_cnj complex_mult);
   3.508  apply (simp (no_asm) add: real_power_two real_abs_def)
   3.509  done
   3.510  
   3.511  lemma complex_mod_squared: "cmod(Abs_complex(x,y)) ^ 2 = x ^ 2 + y ^ 2"
   3.512 -apply (unfold cmod_def)
   3.513 -apply auto
   3.514 -done
   3.515 +by (unfold cmod_def, auto)
   3.516  
   3.517  lemma complex_mod_ge_zero: "0 <= cmod x"
   3.518  apply (unfold cmod_def)
   3.519 @@ -944,41 +913,40 @@
   3.520  declare complex_mod_ge_zero [simp]
   3.521  
   3.522  lemma abs_cmod_cancel: "abs(cmod x) = cmod x"
   3.523 -apply (auto intro: abs_eqI1)
   3.524 -done
   3.525 +by (auto intro: abs_eqI1)
   3.526  declare abs_cmod_cancel [simp]
   3.527  
   3.528  lemma complex_mod_mult: "cmod(x*y) = cmod(x) * cmod(y)"
   3.529 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.530 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.531 +apply (rule_tac z = x in eq_Abs_complex)
   3.532 +apply (rule_tac z = y in eq_Abs_complex)
   3.533  apply (auto simp add: complex_mult complex_mod real_sqrt_mult_distrib2 [symmetric] simp del: realpow_Suc)
   3.534 -apply (rule_tac n = "1" in realpow_Suc_cancel_eq)
   3.535 +apply (rule_tac n = 1 in realpow_Suc_cancel_eq)
   3.536  apply (auto simp add: real_power_two [symmetric] simp del: realpow_Suc)
   3.537 -apply (auto simp add: real_diff_def real_power_two real_add_mult_distrib2 real_add_mult_distrib real_add_ac real_mult_ac)
   3.538 +apply (auto simp add: real_diff_def real_power_two right_distrib left_distrib add_ac mult_ac)
   3.539  done
   3.540  
   3.541  lemma complex_mod_add_squared_eq: "cmod(x + y) ^ 2 = cmod(x) ^ 2 + cmod(y) ^ 2 + 2 * Re(x * cnj y)"
   3.542 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.543 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.544 +apply (rule_tac z = x in eq_Abs_complex)
   3.545 +apply (rule_tac z = y in eq_Abs_complex)
   3.546  apply (auto simp add: complex_add complex_mod_squared complex_mult complex_cnj real_diff_def simp del: realpow_Suc)
   3.547 -apply (auto simp add: real_add_mult_distrib2 real_add_mult_distrib real_power_two real_mult_ac real_add_ac)
   3.548 +apply (auto simp add: right_distrib left_distrib real_power_two mult_ac add_ac)
   3.549  done
   3.550  
   3.551  lemma complex_Re_mult_cnj_le_cmod: "Re(x * cnj y) <= cmod(x * cnj y)"
   3.552 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.553 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.554 +apply (rule_tac z = x in eq_Abs_complex)
   3.555 +apply (rule_tac z = y in eq_Abs_complex)
   3.556  apply (auto simp add: complex_mod complex_mult complex_cnj real_diff_def simp del: realpow_Suc)
   3.557  done
   3.558  declare complex_Re_mult_cnj_le_cmod [simp]
   3.559  
   3.560  lemma complex_Re_mult_cnj_le_cmod2: "Re(x * cnj y) <= cmod(x * y)"
   3.561 -apply (cut_tac x = "x" and y = "y" in complex_Re_mult_cnj_le_cmod)
   3.562 +apply (cut_tac x = x and y = y in complex_Re_mult_cnj_le_cmod)
   3.563  apply (simp add: complex_mod_mult)
   3.564  done
   3.565  declare complex_Re_mult_cnj_le_cmod2 [simp]
   3.566  
   3.567  lemma real_sum_squared_expand: "((x::real) + y) ^ 2 = x ^ 2 + y ^ 2 + 2 * x * y"
   3.568 -apply (simp (no_asm) add: real_add_mult_distrib real_add_mult_distrib2 real_power_two)
   3.569 +apply (simp (no_asm) add: left_distrib right_distrib real_power_two)
   3.570  done
   3.571  
   3.572  lemma complex_mod_triangle_squared: "cmod (x + y) ^ 2 <= (cmod(x) + cmod(y)) ^ 2"
   3.573 @@ -993,38 +961,36 @@
   3.574  declare complex_mod_minus_le_complex_mod [simp]
   3.575  
   3.576  lemma complex_mod_triangle_ineq: "cmod (x + y) <= cmod(x) + cmod(y)"
   3.577 -apply (rule_tac n = "1" in realpow_increasing)
   3.578 +apply (rule_tac n = 1 in realpow_increasing)
   3.579  apply (auto intro:  order_trans [OF _ complex_mod_ge_zero]
   3.580              simp add: real_power_two [symmetric])
   3.581  done
   3.582  declare complex_mod_triangle_ineq [simp]
   3.583  
   3.584  lemma complex_mod_triangle_ineq2: "cmod(b + a) - cmod b <= cmod a"
   3.585 -apply (cut_tac x1 = "b" and y1 = "a" and z = "-cmod b" in complex_mod_triangle_ineq [THEN real_add_le_mono1])
   3.586 +apply (cut_tac x1 = b and y1 = a and c = "-cmod b" 
   3.587 +       in complex_mod_triangle_ineq [THEN add_right_mono])
   3.588  apply (simp (no_asm))
   3.589  done
   3.590  declare complex_mod_triangle_ineq2 [simp]
   3.591  
   3.592  lemma complex_mod_diff_commute: "cmod (x - y) = cmod (y - x)"
   3.593 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.594 -apply (rule_tac z = "y" in eq_Abs_complex)
   3.595 -apply (auto simp add: complex_diff complex_mod real_diff_mult_distrib2 real_power_two real_diff_mult_distrib real_add_ac real_mult_ac)
   3.596 +apply (rule_tac z = x in eq_Abs_complex)
   3.597 +apply (rule_tac z = y in eq_Abs_complex)
   3.598 +apply (auto simp add: complex_diff complex_mod right_diff_distrib real_power_two left_diff_distrib add_ac mult_ac)
   3.599  done
   3.600  
   3.601  lemma complex_mod_add_less: "[| cmod x < r; cmod y < s |] ==> cmod (x + y) < r + s"
   3.602 -apply (auto intro: order_le_less_trans complex_mod_triangle_ineq)
   3.603 -done
   3.604 +by (auto intro: order_le_less_trans complex_mod_triangle_ineq)
   3.605  
   3.606  lemma complex_mod_mult_less: "[| cmod x < r; cmod y < s |] ==> cmod (x * y) < r * s"
   3.607 -apply (auto intro: real_mult_less_mono' simp add: complex_mod_mult)
   3.608 -done
   3.609 +by (auto intro: real_mult_less_mono' simp add: complex_mod_mult)
   3.610  
   3.611  lemma complex_mod_diff_ineq: "cmod(a) - cmod(b) <= cmod(a + b)"
   3.612  apply (rule linorder_cases [of "cmod(a)" "cmod (b)"])
   3.613  apply auto
   3.614 -apply (rule order_trans [of _ 0] , rule order_less_imp_le)
   3.615 -apply (simp add: compare_rls)
   3.616 -apply (simp add: );  
   3.617 +apply (rule order_trans [of _ 0], rule order_less_imp_le)
   3.618 +apply (simp add: compare_rls, simp)  
   3.619  apply (simp add: compare_rls)
   3.620  apply (rule complex_mod_minus [THEN subst])
   3.621  apply (rule order_trans)
   3.622 @@ -1034,15 +1000,14 @@
   3.623  declare complex_mod_diff_ineq [simp]
   3.624  
   3.625  lemma complex_Re_le_cmod: "Re z <= cmod z"
   3.626 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.627 +apply (rule_tac z = z in eq_Abs_complex)
   3.628  apply (auto simp add: complex_mod simp del: realpow_Suc)
   3.629  done
   3.630  declare complex_Re_le_cmod [simp]
   3.631  
   3.632  lemma complex_mod_gt_zero: "z ~= 0 ==> 0 < cmod z"
   3.633 -apply (cut_tac x = "z" in complex_mod_ge_zero)
   3.634 -apply (drule order_le_imp_less_or_eq)
   3.635 -apply auto
   3.636 +apply (cut_tac x = z in complex_mod_ge_zero)
   3.637 +apply (drule order_le_imp_less_or_eq, auto)
   3.638  done
   3.639  
   3.640  
   3.641 @@ -1054,12 +1019,10 @@
   3.642  done
   3.643  
   3.644  lemma complexpow_minus: "(-x::complex) ^ n = (if even n then (x ^ n) else -(x ^ n))"
   3.645 -apply (induct_tac "n")
   3.646 -apply auto
   3.647 -done
   3.648 +by (induct_tac "n", auto)
   3.649  
   3.650  lemma complex_inverse_minus: "inverse (-x) = - inverse (x::complex)"
   3.651 -apply (rule_tac z = "x" in eq_Abs_complex)
   3.652 +apply (rule_tac z = x in eq_Abs_complex)
   3.653  apply (simp (no_asm_simp) add: complex_inverse complex_minus real_power_two)
   3.654  done
   3.655  
   3.656 @@ -1097,8 +1060,7 @@
   3.657  subsection{*More Exponentiation*}
   3.658  
   3.659  lemma complexpow_zero: "(0::complex) ^ (Suc n) = 0"
   3.660 -apply auto
   3.661 -done
   3.662 +by auto
   3.663  declare complexpow_zero [simp]
   3.664  
   3.665  lemma complexpow_not_zero [rule_format (no_asm)]: "r ~= (0::complex) --> r ^ n ~= 0"
   3.666 @@ -1109,8 +1071,7 @@
   3.667  declare complexpow_not_zero [intro]
   3.668  
   3.669  lemma complexpow_zero_zero: "r ^ n = (0::complex) ==> r = 0"
   3.670 -apply (blast intro: ccontr dest: complexpow_not_zero)
   3.671 -done
   3.672 +by (blast intro: ccontr dest: complexpow_not_zero)
   3.673  
   3.674  lemma complexpow_i_squared: "ii ^ 2 = -(1::complex)"
   3.675  apply (unfold i_def)
   3.676 @@ -1119,22 +1080,17 @@
   3.677  declare complexpow_i_squared [simp]
   3.678  
   3.679  lemma complex_i_not_zero: "ii ~= 0"
   3.680 -apply (unfold i_def complex_zero_def)
   3.681 -apply auto
   3.682 -done
   3.683 +by (unfold i_def complex_zero_def, auto)
   3.684  declare complex_i_not_zero [simp]
   3.685  
   3.686  lemma complex_mult_eq_zero_cancel1: "x * y ~= (0::complex) ==> x ~= 0"
   3.687 -apply auto
   3.688 -done
   3.689 +by auto
   3.690  
   3.691  lemma complex_mult_eq_zero_cancel2: "x * y ~= 0 ==> y ~= (0::complex)"
   3.692 -apply auto
   3.693 -done
   3.694 +by auto
   3.695  
   3.696  lemma complex_mult_not_eq_zero_iff: "(x * y ~= 0) = (x ~= 0 & y ~= (0::complex))"
   3.697 -apply auto
   3.698 -done
   3.699 +by auto
   3.700  declare complex_mult_not_eq_zero_iff [iff]
   3.701  
   3.702  lemma complexpow_inverse: "inverse ((r::complex) ^ n) = (inverse r) ^ n"
   3.703 @@ -1160,9 +1116,7 @@
   3.704  declare sgn_one [simp]
   3.705  
   3.706  lemma sgn_minus: "sgn (-z) = - sgn(z)"
   3.707 -apply (unfold sgn_def)
   3.708 -apply auto
   3.709 -done
   3.710 +by (unfold sgn_def, auto)
   3.711  
   3.712  lemma sgn_eq:
   3.713      "sgn z = z / complex_of_real (cmod z)"
   3.714 @@ -1171,18 +1125,16 @@
   3.715  done
   3.716  
   3.717  lemma complex_split: "EX x y. z = complex_of_real(x) + ii * complex_of_real(y)"
   3.718 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.719 +apply (rule_tac z = z in eq_Abs_complex)
   3.720  apply (auto simp add: complex_of_real_def i_def complex_mult complex_add)
   3.721  done
   3.722  
   3.723  lemma Re_complex_i: "Re(complex_of_real(x) + ii * complex_of_real(y)) = x"
   3.724 -apply (auto simp add: complex_of_real_def i_def complex_mult complex_add)
   3.725 -done
   3.726 +by (auto simp add: complex_of_real_def i_def complex_mult complex_add)
   3.727  declare Re_complex_i [simp]
   3.728  
   3.729  lemma Im_complex_i: "Im(complex_of_real(x) + ii * complex_of_real(y)) = y"
   3.730 -apply (auto simp add: complex_of_real_def i_def complex_mult complex_add)
   3.731 -done
   3.732 +by (auto simp add: complex_of_real_def i_def complex_mult complex_add)
   3.733  declare Im_complex_i [simp]
   3.734  
   3.735  lemma i_mult_eq: "ii * ii = complex_of_real (-1)"
   3.736 @@ -1243,7 +1195,7 @@
   3.737  
   3.738  lemma complex_eq_cancel_iff2: "(complex_of_real x + ii * complex_of_real y =
   3.739        complex_of_real xa) = (x = xa & y = 0)"
   3.740 -apply (cut_tac xa = "x" and ya = "y" and xb = "xa" and yb = "0" in complex_eq_cancel_iff)
   3.741 +apply (cut_tac xa = x and ya = y and xb = xa and yb = 0 in complex_eq_cancel_iff)
   3.742  apply (simp del: complex_eq_cancel_iff)
   3.743  done
   3.744  declare complex_eq_cancel_iff2 [simp]
   3.745 @@ -1256,7 +1208,7 @@
   3.746  
   3.747  lemma complex_eq_cancel_iff3: "(complex_of_real x + ii * complex_of_real y =
   3.748        ii * complex_of_real ya) = (x = 0 & y = ya)"
   3.749 -apply (cut_tac xa = "x" and ya = "y" and xb = "0" and yb = "ya" in complex_eq_cancel_iff)
   3.750 +apply (cut_tac xa = x and ya = y and xb = 0 and yb = ya in complex_eq_cancel_iff)
   3.751  apply (simp del: complex_eq_cancel_iff)
   3.752  done
   3.753  declare complex_eq_cancel_iff3 [simp]
   3.754 @@ -1284,7 +1236,7 @@
   3.755  lemma Re_sgn:
   3.756        "Re(sgn z) = Re(z)/cmod z"
   3.757  apply (unfold sgn_def complex_divide_def)
   3.758 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.759 +apply (rule_tac z = z in eq_Abs_complex)
   3.760  apply (auto simp add: complex_of_real_inverse [symmetric])
   3.761  apply (auto simp add: complex_of_real_def complex_mult real_divide_def)
   3.762  done
   3.763 @@ -1293,7 +1245,7 @@
   3.764  lemma Im_sgn:
   3.765        "Im(sgn z) = Im(z)/cmod z"
   3.766  apply (unfold sgn_def complex_divide_def)
   3.767 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.768 +apply (rule_tac z = z in eq_Abs_complex)
   3.769  apply (auto simp add: complex_of_real_inverse [symmetric])
   3.770  apply (auto simp add: complex_of_real_def complex_mult real_divide_def)
   3.771  done
   3.772 @@ -1337,10 +1289,8 @@
   3.773     "0 < y ==> cos (arg(ii * complex_of_real y)) = 0"
   3.774  apply (unfold arg_def)
   3.775  apply (auto simp add: abs_eqI2)
   3.776 -apply (rule_tac a = "pi/2" in someI2)
   3.777 -apply auto
   3.778 -apply (rule order_less_trans [of _ 0])
   3.779 -apply auto
   3.780 +apply (rule_tac a = "pi/2" in someI2, auto)
   3.781 +apply (rule order_less_trans [of _ 0], auto)
   3.782  done
   3.783  declare cos_arg_i_mult_zero [simp]
   3.784  
   3.785 @@ -1348,31 +1298,25 @@
   3.786     "y < 0 ==> cos (arg(ii * complex_of_real y)) = 0"
   3.787  apply (unfold arg_def)
   3.788  apply (auto simp add: abs_minus_eqI2)
   3.789 -apply (rule_tac a = "- pi/2" in someI2)
   3.790 -apply auto
   3.791 -apply (rule order_trans [of _ 0])
   3.792 -apply auto
   3.793 +apply (rule_tac a = "- pi/2" in someI2, auto)
   3.794 +apply (rule order_trans [of _ 0], auto)
   3.795  done
   3.796  declare cos_arg_i_mult_zero2 [simp]
   3.797  
   3.798  lemma complex_of_real_not_zero_iff:
   3.799        "(complex_of_real y ~= 0) = (y ~= 0)"
   3.800 -apply (unfold complex_zero_def complex_of_real_def)
   3.801 -apply auto
   3.802 +apply (unfold complex_zero_def complex_of_real_def, auto)
   3.803  done
   3.804  declare complex_of_real_not_zero_iff [simp]
   3.805  
   3.806  lemma complex_of_real_zero_iff: "(complex_of_real y = 0) = (y = 0)"
   3.807  apply auto
   3.808 -apply (rule ccontr , drule complex_of_real_not_zero_iff [THEN iffD2])
   3.809 -apply simp
   3.810 +apply (rule ccontr, drule complex_of_real_not_zero_iff [THEN iffD2], simp)
   3.811  done
   3.812  declare complex_of_real_zero_iff [simp]
   3.813  
   3.814  lemma cos_arg_i_mult_zero3: "y ~= 0 ==> cos (arg(ii * complex_of_real y)) = 0"
   3.815 -apply (cut_tac x = "y" and y = "0" in linorder_less_linear)
   3.816 -apply auto
   3.817 -done
   3.818 +by (cut_tac x = y and y = 0 in linorder_less_linear, auto)
   3.819  declare cos_arg_i_mult_zero3 [simp]
   3.820  
   3.821  
   3.822 @@ -1380,7 +1324,7 @@
   3.823  
   3.824  lemma complex_split_polar: "EX r a. z = complex_of_real r *
   3.825        (complex_of_real(cos a) + ii * complex_of_real(sin a))"
   3.826 -apply (cut_tac z = "z" in complex_split)
   3.827 +apply (cut_tac z = z in complex_split)
   3.828  apply (auto simp add: polar_Ex complex_add_mult_distrib2 complex_of_real_mult complex_mult_ac)
   3.829  done
   3.830  
   3.831 @@ -1396,9 +1340,7 @@
   3.832  declare Re_complex_polar [simp]
   3.833  
   3.834  lemma Re_rcis: "Re(rcis r a) = r * cos a"
   3.835 -apply (unfold rcis_def cis_def)
   3.836 -apply auto
   3.837 -done
   3.838 +by (unfold rcis_def cis_def, auto)
   3.839  declare Re_rcis [simp]
   3.840  
   3.841  lemma Im_complex_polar: "Im(complex_of_real r *
   3.842 @@ -1408,21 +1350,17 @@
   3.843  declare Im_complex_polar [simp]
   3.844  
   3.845  lemma Im_rcis: "Im(rcis r a) = r * sin a"
   3.846 -apply (unfold rcis_def cis_def)
   3.847 -apply auto
   3.848 -done
   3.849 +by (unfold rcis_def cis_def, auto)
   3.850  declare Im_rcis [simp]
   3.851  
   3.852  lemma complex_mod_complex_polar: "cmod (complex_of_real r *
   3.853        (complex_of_real(cos a) + ii * complex_of_real(sin a))) = abs r"
   3.854 -apply (auto simp add: complex_add_mult_distrib2 cmod_i complex_of_real_mult real_add_mult_distrib2 [symmetric] realpow_mult complex_mult_ac real_mult_ac simp del: realpow_Suc)
   3.855 +apply (auto simp add: complex_add_mult_distrib2 cmod_i complex_of_real_mult right_distrib [symmetric] realpow_mult complex_mult_ac mult_ac simp del: realpow_Suc)
   3.856  done
   3.857  declare complex_mod_complex_polar [simp]
   3.858  
   3.859  lemma complex_mod_rcis: "cmod(rcis r a) = abs r"
   3.860 -apply (unfold rcis_def cis_def)
   3.861 -apply auto
   3.862 -done
   3.863 +by (unfold rcis_def cis_def, auto)
   3.864  declare complex_mod_rcis [simp]
   3.865  
   3.866  lemma complex_mod_sqrt_Re_mult_cnj: "cmod z = sqrt (Re (z * cnj z))"
   3.867 @@ -1432,53 +1370,53 @@
   3.868  done
   3.869  
   3.870  lemma complex_Re_cnj: "Re(cnj z) = Re z"
   3.871 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.872 +apply (rule_tac z = z in eq_Abs_complex)
   3.873  apply (auto simp add: complex_cnj)
   3.874  done
   3.875  declare complex_Re_cnj [simp]
   3.876  
   3.877  lemma complex_Im_cnj: "Im(cnj z) = - Im z"
   3.878 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.879 +apply (rule_tac z = z in eq_Abs_complex)
   3.880  apply (auto simp add: complex_cnj)
   3.881  done
   3.882  declare complex_Im_cnj [simp]
   3.883  
   3.884  lemma complex_In_mult_cnj_zero: "Im (z * cnj z) = 0"
   3.885 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.886 +apply (rule_tac z = z in eq_Abs_complex)
   3.887  apply (auto simp add: complex_cnj complex_mult)
   3.888  done
   3.889  declare complex_In_mult_cnj_zero [simp]
   3.890  
   3.891  lemma complex_Re_mult: "[| Im w = 0; Im z = 0 |] ==> Re(w * z) = Re(w) * Re(z)"
   3.892 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.893 -apply (rule_tac z = "w" in eq_Abs_complex)
   3.894 +apply (rule_tac z = z in eq_Abs_complex)
   3.895 +apply (rule_tac z = w in eq_Abs_complex)
   3.896  apply (auto simp add: complex_mult)
   3.897  done
   3.898  
   3.899  lemma complex_Re_mult_complex_of_real: "Re (z * complex_of_real c) = Re(z) * c"
   3.900  apply (unfold complex_of_real_def)
   3.901 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.902 +apply (rule_tac z = z in eq_Abs_complex)
   3.903  apply (auto simp add: complex_mult)
   3.904  done
   3.905  declare complex_Re_mult_complex_of_real [simp]
   3.906  
   3.907  lemma complex_Im_mult_complex_of_real: "Im (z * complex_of_real c) = Im(z) * c"
   3.908  apply (unfold complex_of_real_def)
   3.909 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.910 +apply (rule_tac z = z in eq_Abs_complex)
   3.911  apply (auto simp add: complex_mult)
   3.912  done
   3.913  declare complex_Im_mult_complex_of_real [simp]
   3.914  
   3.915  lemma complex_Re_mult_complex_of_real2: "Re (complex_of_real c * z) = c * Re(z)"
   3.916  apply (unfold complex_of_real_def)
   3.917 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.918 +apply (rule_tac z = z in eq_Abs_complex)
   3.919  apply (auto simp add: complex_mult)
   3.920  done
   3.921  declare complex_Re_mult_complex_of_real2 [simp]
   3.922  
   3.923  lemma complex_Im_mult_complex_of_real2: "Im (complex_of_real c * z) = c * Im(z)"
   3.924  apply (unfold complex_of_real_def)
   3.925 -apply (rule_tac z = "z" in eq_Abs_complex)
   3.926 +apply (rule_tac z = z in eq_Abs_complex)
   3.927  apply (auto simp add: complex_mult)
   3.928  done
   3.929  declare complex_Im_mult_complex_of_real2 [simp]
   3.930 @@ -1498,7 +1436,7 @@
   3.931  apply (auto simp add: cos_add sin_add complex_add_mult_distrib2 complex_add_mult_distrib complex_mult_ac complex_add_ac)
   3.932  apply (auto simp add: complex_add_mult_distrib2 [symmetric] complex_mult_assoc [symmetric] complex_of_real_mult complex_of_real_add complex_add_assoc [symmetric] i_mult_eq simp del: i_mult_eq2)
   3.933  apply (auto simp add: complex_add_ac)
   3.934 -apply (auto simp add: complex_add_assoc [symmetric] complex_of_real_add real_add_mult_distrib2 real_diff_def mult_ac add_ac)
   3.935 +apply (auto simp add: complex_add_assoc [symmetric] complex_of_real_add right_distrib real_diff_def mult_ac add_ac)
   3.936  done
   3.937  
   3.938  lemma cis_mult: "cis a * cis b = cis (a + b)"
   3.939 @@ -1506,15 +1444,11 @@
   3.940  done
   3.941  
   3.942  lemma cis_zero: "cis 0 = 1"
   3.943 -apply (unfold cis_def)
   3.944 -apply auto
   3.945 -done
   3.946 +by (unfold cis_def, auto)
   3.947  declare cis_zero [simp]
   3.948  
   3.949  lemma cis_zero2: "cis 0 = complex_of_real 1"
   3.950 -apply (unfold cis_def)
   3.951 -apply auto
   3.952 -done
   3.953 +by (unfold cis_def, auto)
   3.954  declare cis_zero2 [simp]
   3.955  
   3.956  lemma rcis_zero_mod: "rcis 0 a = 0"
   3.957 @@ -1548,7 +1482,7 @@
   3.958  lemma cis_real_of_nat_Suc_mult:
   3.959     "cis (real (Suc n) * a) = cis a * cis (real n * a)"
   3.960  apply (unfold cis_def)
   3.961 -apply (auto simp add: real_of_nat_Suc real_add_mult_distrib cos_add sin_add complex_add_mult_distrib complex_add_mult_distrib2 complex_of_real_add complex_of_real_mult complex_mult_ac complex_add_ac)
   3.962 +apply (auto simp add: real_of_nat_Suc left_distrib cos_add sin_add complex_add_mult_distrib complex_add_mult_distrib2 complex_of_real_add complex_of_real_mult complex_mult_ac complex_add_ac)
   3.963  apply (auto simp add: complex_add_mult_distrib2 [symmetric] complex_mult_assoc [symmetric] i_mult_eq complex_of_real_mult complex_of_real_add complex_add_assoc [symmetric] complex_of_real_minus [symmetric] real_diff_def mult_ac simp del: i_mult_eq2)
   3.964  done
   3.965  
   3.966 @@ -1572,8 +1506,8 @@
   3.967  lemma rcis_inverse: "inverse(rcis r a) = rcis (1/r) (-a)"
   3.968  apply (case_tac "r=0")
   3.969  apply (simp (no_asm_simp) add: DIVISION_BY_ZERO COMPLEX_INVERSE_ZERO)
   3.970 -apply (auto simp add: complex_inverse_complex_split complex_add_mult_distrib2 complex_of_real_mult rcis_def cis_def real_power_two complex_mult_ac real_mult_ac)
   3.971 -apply (auto simp add: real_add_mult_distrib2 [symmetric] complex_of_real_minus complex_diff_def)
   3.972 +apply (auto simp add: complex_inverse_complex_split complex_add_mult_distrib2 complex_of_real_mult rcis_def cis_def real_power_two complex_mult_ac mult_ac)
   3.973 +apply (auto simp add: right_distrib [symmetric] complex_of_real_minus complex_diff_def)
   3.974  done
   3.975  
   3.976  lemma cis_divide: "cis a / cis b = cis (a - b)"
   3.977 @@ -1590,36 +1524,28 @@
   3.978  done
   3.979  
   3.980  lemma Re_cis: "Re(cis a) = cos a"
   3.981 -apply (unfold cis_def)
   3.982 -apply auto
   3.983 -done
   3.984 +by (unfold cis_def, auto)
   3.985  declare Re_cis [simp]
   3.986  
   3.987  lemma Im_cis: "Im(cis a) = sin a"
   3.988 -apply (unfold cis_def)
   3.989 -apply auto
   3.990 -done
   3.991 +by (unfold cis_def, auto)
   3.992  declare Im_cis [simp]
   3.993  
   3.994  lemma cos_n_Re_cis_pow_n: "cos (real n * a) = Re(cis a ^ n)"
   3.995 -apply (auto simp add: DeMoivre)
   3.996 -done
   3.997 +by (auto simp add: DeMoivre)
   3.998  
   3.999  lemma sin_n_Im_cis_pow_n: "sin (real n * a) = Im(cis a ^ n)"
  3.1000 -apply (auto simp add: DeMoivre)
  3.1001 -done
  3.1002 +by (auto simp add: DeMoivre)
  3.1003  
  3.1004  lemma expi_Im_split:
  3.1005      "expi (ii * complex_of_real y) =
  3.1006       complex_of_real (cos y) + ii * complex_of_real (sin y)"
  3.1007 -apply (unfold expi_def cis_def)
  3.1008 -apply auto
  3.1009 +apply (unfold expi_def cis_def, auto)
  3.1010  done
  3.1011  
  3.1012  lemma expi_Im_cis:
  3.1013      "expi (ii * complex_of_real y) = cis y"
  3.1014 -apply (unfold expi_def)
  3.1015 -apply auto
  3.1016 +apply (unfold expi_def, auto)
  3.1017  done
  3.1018  
  3.1019  lemma expi_add: "expi(a + b) = expi(a) * expi(b)"
  3.1020 @@ -1630,54 +1556,50 @@
  3.1021  lemma expi_complex_split:
  3.1022       "expi(complex_of_real x + ii * complex_of_real y) =
  3.1023        complex_of_real (exp(x)) * cis y"
  3.1024 -apply (unfold expi_def)
  3.1025 -apply auto
  3.1026 +apply (unfold expi_def, auto)
  3.1027  done
  3.1028  
  3.1029  lemma expi_zero: "expi (0::complex) = 1"
  3.1030 -apply (unfold expi_def)
  3.1031 -apply auto
  3.1032 -done
  3.1033 +by (unfold expi_def, auto)
  3.1034  declare expi_zero [simp]
  3.1035  
  3.1036  lemma complex_Re_mult_eq: "Re (w * z) = Re w * Re z - Im w * Im z"
  3.1037 -apply (rule_tac z = "z" in eq_Abs_complex)
  3.1038 -apply (rule_tac z = "w" in eq_Abs_complex)
  3.1039 +apply (rule_tac z = z in eq_Abs_complex)
  3.1040 +apply (rule_tac z = w in eq_Abs_complex)
  3.1041  apply (auto simp add: complex_mult)
  3.1042  done
  3.1043  
  3.1044  lemma complex_Im_mult_eq:
  3.1045       "Im (w * z) = Re w * Im z + Im w * Re z"
  3.1046 -apply (rule_tac z = "z" in eq_Abs_complex)
  3.1047 -apply (rule_tac z = "w" in eq_Abs_complex)
  3.1048 +apply (rule_tac z = z in eq_Abs_complex)
  3.1049 +apply (rule_tac z = w in eq_Abs_complex)
  3.1050  apply (auto simp add: complex_mult)
  3.1051  done
  3.1052  
  3.1053  lemma complex_expi_Ex: 
  3.1054     "EX a r. z = complex_of_real r * expi a"
  3.1055 -apply (cut_tac z = "z" in rcis_Ex)
  3.1056 +apply (cut_tac z = z in rcis_Ex)
  3.1057  apply (auto simp add: expi_def rcis_def complex_mult_assoc [symmetric] complex_of_real_mult)
  3.1058 -apply (rule_tac x = "ii * complex_of_real a" in exI)
  3.1059 -apply auto
  3.1060 +apply (rule_tac x = "ii * complex_of_real a" in exI, auto)
  3.1061  done
  3.1062  
  3.1063  
  3.1064  (****
  3.1065  Goal "[| - pi < a; a <= pi |] ==> (-pi < a & a <= 0) | (0 <= a & a <= pi)"
  3.1066 -by Auto_tac;
  3.1067 +by Auto_tac
  3.1068  qed "lemma_split_interval";
  3.1069  
  3.1070  Goalw [arg_def]
  3.1071    "[| r ~= 0; - pi < a; a <= pi |] \
  3.1072  \  ==> arg(complex_of_real r * \
  3.1073  \      (complex_of_real(cos a) + ii * complex_of_real(sin a))) = a";
  3.1074 -by Auto_tac;
  3.1075 +by Auto_tac
  3.1076  by (cut_inst_tac [("x","0"),("y","r")] linorder_less_linear 1);
  3.1077  by (auto_tac (claset(),simpset() addsimps (map (full_rename_numerals thy)
  3.1078      [rabs_eqI2,rabs_minus_eqI2,real_minus_rinv]) [real_divide_def,
  3.1079 -    real_minus_mult_eq2 RS sym] real_mult_ac));
  3.1080 +    minus_mult_right RS sym] mult_ac));
  3.1081  by (auto_tac (claset(),simpset() addsimps [real_mult_assoc RS sym]));
  3.1082 -by (dtac lemma_split_interval 1 THEN safe);
  3.1083 +by (dtac lemma_split_interval 1 THEN safe)
  3.1084  ****)
  3.1085  
  3.1086  
     4.1 --- a/src/HOL/Complex/NSCA.ML	Mon Dec 29 06:49:26 2003 +0100
     4.2 +++ b/src/HOL/Complex/NSCA.ML	Thu Jan 01 10:06:32 2004 +0100
     4.3 @@ -644,7 +644,7 @@
     4.4  by (res_inst_tac [("e","hcmod u"),("e'","- hcmod u")] Infinitesimal_interval2 1);
     4.5  by (auto_tac (claset() addDs [capprox_approx_zero_iff RS iffD1], 
     4.6      simpset() addsimps [mem_infmal_iff RS sym,hypreal_diff_def]));
     4.7 -by (res_inst_tac [("C","hcmod x")] hypreal_le_add_left_cancel 1);
     4.8 +by (res_inst_tac [("c1","hcmod x")] (add_le_cancel_left RS iffD1) 1);
     4.9  by (auto_tac (claset(),simpset() addsimps [symmetric hypreal_diff_def]));
    4.10  qed "Infinitesimal_hcmod_add_diff";
    4.11  
    4.12 @@ -868,7 +868,7 @@
    4.13  by (Ultra_tac 1);
    4.14  by (dtac sym 1 THEN res_inst_tac [("z","X x")] eq_Abs_complex 1);
    4.15  by (auto_tac (claset(),simpset() addsimps [complex_mod,numeral_2_eq_2] delsimps [realpow_Suc]));
    4.16 -by (rtac ccontr 1 THEN dtac real_leI 1);
    4.17 +by (rtac ccontr 1 THEN dtac (linorder_not_less RS iffD1) 1);
    4.18  by (dtac order_less_le_trans 1 THEN assume_tac 1);
    4.19  by (dtac (real_sqrt_ge_abs1 RSN (2,order_less_le_trans)) 1);
    4.20  by (auto_tac (claset(),simpset() addsimps [numeral_2_eq_2 RS sym]));
    4.21 @@ -883,7 +883,7 @@
    4.22  by (Ultra_tac 1);
    4.23  by (dtac sym 1 THEN res_inst_tac [("z","X x")] eq_Abs_complex 1);
    4.24  by (auto_tac (claset(),simpset() addsimps [complex_mod] delsimps [realpow_Suc]));
    4.25 -by (rtac ccontr 1 THEN dtac real_leI 1);
    4.26 +by (rtac ccontr 1 THEN dtac (linorder_not_less RS iffD1) 1);
    4.27  by (dtac order_less_le_trans 1 THEN assume_tac 1);
    4.28  by (dtac (real_sqrt_ge_abs2 RSN (2,order_less_le_trans)) 1);
    4.29  by Auto_tac;
     5.1 --- a/src/HOL/Complex/ROOT.ML	Mon Dec 29 06:49:26 2003 +0100
     5.2 +++ b/src/HOL/Complex/ROOT.ML	Thu Jan 01 10:06:32 2004 +0100
     5.3 @@ -5,6 +5,6 @@
     5.4  The Complex Numbers
     5.5  *)
     5.6  
     5.7 -with_path "../Real" use_thy "Real";
     5.8 +with_path "../Real"      use_thy "Real";
     5.9  with_path "../Hyperreal" use_thy "Hyperreal";
    5.10  time_use_thy "Complex_Main";
     6.1 --- a/src/HOL/Hyperreal/Fact.ML	Mon Dec 29 06:49:26 2003 +0100
     6.2 +++ b/src/HOL/Hyperreal/Fact.ML	Thu Jan 01 10:06:32 2004 +0100
     6.3 @@ -51,7 +51,7 @@
     6.4  qed "fact_less_mono";
     6.5  
     6.6  Goal "0 < inverse (real (fact n))";
     6.7 -by (auto_tac (claset(),simpset() addsimps [real_inverse_gt_0]));
     6.8 +by (auto_tac (claset(),simpset() addsimps [positive_imp_inverse_positive]));
     6.9  qed "inv_real_of_nat_fact_gt_zero";
    6.10  Addsimps [inv_real_of_nat_fact_gt_zero];
    6.11  
     7.1 --- a/src/HOL/Hyperreal/HLog.ML	Mon Dec 29 06:49:26 2003 +0100
     7.2 +++ b/src/HOL/Hyperreal/HLog.ML	Thu Jan 01 10:06:32 2004 +0100
     7.3 @@ -226,13 +226,13 @@
     7.4  Goal "[| 0 < a; a ~= 1; 0 < x |] ==> hlog a (inverse x) = - hlog a x";
     7.5  by (res_inst_tac [("a1","hlog a x")] (add_left_cancel RS iffD1) 1);
     7.6  by (auto_tac (claset(),simpset() addsimps [hypreal_not_refl2 RS not_sym,
     7.7 -    hlog_mult RS sym,hypreal_inverse_gt_0]));
     7.8 +    hlog_mult RS sym,positive_imp_inverse_positive]));
     7.9  qed "hlog_inverse";
    7.10  
    7.11  Goal "[| 0 < a; a ~= 1; 0 < x; 0 < y|] \
    7.12  \     ==> hlog a (x/y) = hlog a x - hlog a y";
    7.13  by (auto_tac (claset(),
    7.14 -    simpset() addsimps [hypreal_inverse_gt_0,hlog_mult, hlog_inverse,hypreal_diff_def,hypreal_divide_def]));
    7.15 +    simpset() addsimps [positive_imp_inverse_positive,hlog_mult, hlog_inverse,hypreal_diff_def,hypreal_divide_def]));
    7.16  qed "hlog_divide";
    7.17  
    7.18  Goal "[| 1 < a; 0 < x; 0 < y |] ==> (hlog a x < hlog a y) = (x < y)";
     8.1 --- a/src/HOL/Hyperreal/HTranscendental.ML	Mon Dec 29 06:49:26 2003 +0100
     8.2 +++ b/src/HOL/Hyperreal/HTranscendental.ML	Thu Jan 01 10:06:32 2004 +0100
     8.3 @@ -466,7 +466,7 @@
     8.4  (* we do proof by considering ln of 1/x *)
     8.5  Goal "[| x : Infinitesimal; 0 < x |] ==> ( *f* ln) x : HInfinite";
     8.6  by (dtac Infinitesimal_inverse_HInfinite 1);
     8.7 -by (ftac hypreal_inverse_gt_0 1);
     8.8 +by (ftac positive_imp_inverse_positive 1);
     8.9  by (dtac starfun_ln_HInfinite 2);
    8.10  by (auto_tac (claset(),simpset() addsimps [starfun_ln_inverse,
    8.11      HInfinite_minus_iff]));
     9.1 --- a/src/HOL/Hyperreal/HyperBin.ML	Mon Dec 29 06:49:26 2003 +0100
     9.2 +++ b/src/HOL/Hyperreal/HyperBin.ML	Thu Jan 01 10:06:32 2004 +0100
     9.3 @@ -615,23 +615,4 @@
     9.4      hypreal_of_real_le_number_of_iff, hypreal_of_real_less_number_of_iff,
     9.5      number_of_le_hypreal_of_real_iff, number_of_less_hypreal_of_real_iff]);
     9.6  
     9.7 -(** <= monotonicity results: needed for arithmetic **)
     9.8 -
     9.9 -Goal "[| i <= j;  (0::hypreal) <= k |] ==> i*k <= j*k";
    9.10 -by (auto_tac (claset(),
    9.11 -              simpset() addsimps [order_le_less, hypreal_mult_less_mono1]));
    9.12 -qed "hypreal_mult_le_mono1";
    9.13 -
    9.14 -Goal "[| i <= j;  (0::hypreal) <= k |] ==> k*i <= k*j";
    9.15 -by (dtac hypreal_mult_le_mono1 1);
    9.16 -by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [hypreal_mult_commute])));
    9.17 -qed "hypreal_mult_le_mono2";
    9.18 -
    9.19 -Goal "[| u <= v;  x <= y;  0 <= v;  (0::hypreal) <= x |] ==> u * x <= v * y";
    9.20 -by (etac (hypreal_mult_le_mono1 RS order_trans) 1);
    9.21 -by (assume_tac 1);
    9.22 -by (etac hypreal_mult_le_mono2 1);
    9.23 -by (assume_tac 1);
    9.24 -qed "hypreal_mult_le_mono";
    9.25 -
    9.26  Addsimps [hypreal_minus_1_eq_m1];
    10.1 --- a/src/HOL/Hyperreal/HyperDef.thy	Mon Dec 29 06:49:26 2003 +0100
    10.2 +++ b/src/HOL/Hyperreal/HyperDef.thy	Thu Jan 01 10:06:32 2004 +0100
    10.3 @@ -326,7 +326,7 @@
    10.4  lemma hypreal_add_commute: "(z::hypreal) + w = w + z"
    10.5  apply (rule_tac z = z in eq_Abs_hypreal)
    10.6  apply (rule_tac z = w in eq_Abs_hypreal)
    10.7 -apply (simp add: real_add_ac hypreal_add)
    10.8 +apply (simp add: add_ac hypreal_add)
    10.9  done
   10.10  
   10.11  lemma hypreal_add_assoc: "((z1::hypreal) + z2) + z3 = z1 + (z2 + z3)"
   10.12 @@ -419,7 +419,7 @@
   10.13  apply (rule_tac z = z1 in eq_Abs_hypreal)
   10.14  apply (rule_tac z = z2 in eq_Abs_hypreal)
   10.15  apply (rule_tac z = w in eq_Abs_hypreal)
   10.16 -apply (simp add: hypreal_mult hypreal_add real_add_mult_distrib)
   10.17 +apply (simp add: hypreal_mult hypreal_add left_distrib)
   10.18  done
   10.19  
   10.20  text{*one and zero are distinct*}
   10.21 @@ -452,7 +452,7 @@
   10.22  apply (rule_tac z = x in eq_Abs_hypreal)
   10.23  apply (simp add: hypreal_inverse hypreal_mult)
   10.24  apply (drule FreeUltrafilterNat_Compl_mem)
   10.25 -apply (blast intro!: real_mult_inv_right FreeUltrafilterNat_subset)
   10.26 +apply (blast intro!: right_inverse FreeUltrafilterNat_subset)
   10.27  done
   10.28  
   10.29  lemma hypreal_mult_inverse_left:
   10.30 @@ -476,10 +476,6 @@
   10.31    show "y \<noteq> 0 ==> x / y = x * inverse y" by (simp add: hypreal_divide_def)
   10.32  qed
   10.33  
   10.34 -(*Pull negations out*)
   10.35 -declare minus_mult_right [symmetric, simp] 
   10.36 -        minus_mult_left [symmetric, simp]
   10.37 -
   10.38  
   10.39  lemma HYPREAL_INVERSE_ZERO: "inverse 0 = (0::hypreal)"
   10.40  by (simp add: hypreal_inverse hypreal_zero_def)
    11.1 --- a/src/HOL/Hyperreal/HyperOrd.thy	Mon Dec 29 06:49:26 2003 +0100
    11.2 +++ b/src/HOL/Hyperreal/HyperOrd.thy	Thu Jan 01 10:06:32 2004 +0100
    11.3 @@ -25,20 +25,9 @@
    11.4  apply (erule add_strict_left_mono) 
    11.5  done
    11.6  
    11.7 -lemma hypreal_less_add_right_cancel: "(A::hypreal) + C < B + C ==> A < B"
    11.8 -apply (simp (no_asm_use))
    11.9 -done
   11.10 -
   11.11  lemma hypreal_add_zero_less_le_mono: "[|r < x; (0::hypreal) \<le> y|] ==> r < x + y"
   11.12  by (auto dest: hypreal_add_less_le_mono)
   11.13  
   11.14 -lemma hypreal_le_add_left_cancel: "!!(A::hypreal). C + A \<le> C + B ==> A \<le> B"
   11.15 -apply simp
   11.16 -done
   11.17 -
   11.18 -lemma hypreal_le_square [simp]: "(0::hypreal) \<le> x*x"
   11.19 -  by (rule Ring_and_Field.zero_le_square)
   11.20 -
   11.21  lemma hypreal_add_order: "[| 0 < x; 0 < y |] ==> (0::hypreal) < x + y"
   11.22  apply (erule order_less_trans)
   11.23  apply (drule hypreal_add_less_mono2, simp)
   11.24 @@ -54,12 +43,6 @@
   11.25       "[| u<v;  x<y;  (0::hypreal) < v;  0 < x |] ==> u*x < v* y"
   11.26   by (simp add: Ring_and_Field.mult_strict_mono order_less_imp_le)
   11.27  
   11.28 -lemma hypreal_inverse_gt_0: "0 < x ==> 0 < inverse (x::hypreal)"
   11.29 -  by (rule Ring_and_Field.positive_imp_inverse_positive)
   11.30 -
   11.31 -lemma hypreal_inverse_less_0: "x < 0 ==> inverse (x::hypreal) < 0"
   11.32 -  by (rule Ring_and_Field.negative_imp_inverse_negative)
   11.33 -
   11.34  
   11.35  subsection{*Existence of Infinite Hyperreal Number*}
   11.36  
   11.37 @@ -68,9 +51,11 @@
   11.38  apply (rule Rep_hypreal)
   11.39  done
   11.40  
   11.41 -(* existence of infinite number not corresponding to any real number *)
   11.42 -(* use assumption that member FreeUltrafilterNat is not finite       *)
   11.43 -(* a few lemmas first *)
   11.44 +text{*Existence of infinite number not corresponding to any real number.
   11.45 +Use assumption that member @{term FreeUltrafilterNat} is not finite.*}
   11.46 +
   11.47 +
   11.48 +text{*A few lemmas first*}
   11.49  
   11.50  lemma lemma_omega_empty_singleton_disj: "{n::nat. x = real n} = {} |  
   11.51        (\<exists>y. {n::nat. x = real n} = {y})"
   11.52 @@ -82,16 +67,18 @@
   11.53  lemma not_ex_hypreal_of_real_eq_omega: 
   11.54        "~ (\<exists>x. hypreal_of_real x = omega)"
   11.55  apply (unfold omega_def hypreal_of_real_def)
   11.56 -apply (auto simp add: real_of_nat_Suc diff_eq_eq [symmetric] lemma_finite_omega_set [THEN FreeUltrafilterNat_finite])
   11.57 +apply (auto simp add: real_of_nat_Suc diff_eq_eq [symmetric] 
   11.58 +            lemma_finite_omega_set [THEN FreeUltrafilterNat_finite])
   11.59  done
   11.60  
   11.61  lemma hypreal_of_real_not_eq_omega: "hypreal_of_real x \<noteq> omega"
   11.62  by (cut_tac not_ex_hypreal_of_real_eq_omega, auto)
   11.63  
   11.64 -(* existence of infinitesimal number also not *)
   11.65 -(* corresponding to any real number *)
   11.66 +text{*Existence of infinitesimal number also not corresponding to any
   11.67 + real number*}
   11.68  
   11.69 -lemma lemma_epsilon_empty_singleton_disj: "{n::nat. x = inverse(real(Suc n))} = {} |  
   11.70 +lemma lemma_epsilon_empty_singleton_disj:
   11.71 +     "{n::nat. x = inverse(real(Suc n))} = {} |  
   11.72        (\<exists>y. {n::nat. x = inverse(real(Suc n))} = {y})"
   11.73  apply (auto simp add: inj_real_of_nat [THEN inj_eq])
   11.74  done
   11.75 @@ -123,15 +110,10 @@
   11.76  val hypreal_add_left_le_mono1 = thm"hypreal_add_left_le_mono1";
   11.77  val hypreal_add_less_le_mono = thm"hypreal_add_less_le_mono";
   11.78  val hypreal_add_le_less_mono = thm"hypreal_add_le_less_mono";
   11.79 -val hypreal_less_add_right_cancel = thm"hypreal_less_add_right_cancel";
   11.80  val hypreal_add_zero_less_le_mono = thm"hypreal_add_zero_less_le_mono";
   11.81 -val hypreal_le_add_left_cancel = thm"hypreal_le_add_left_cancel";
   11.82 -val hypreal_le_square = thm"hypreal_le_square";
   11.83  val hypreal_mult_less_mono1 = thm"hypreal_mult_less_mono1";
   11.84  val hypreal_mult_less_mono2 = thm"hypreal_mult_less_mono2";
   11.85  val hypreal_mult_less_mono = thm"hypreal_mult_less_mono";
   11.86 -val hypreal_inverse_gt_0 = thm"hypreal_inverse_gt_0";
   11.87 -val hypreal_inverse_less_0 = thm"hypreal_inverse_less_0";
   11.88  val Rep_hypreal_omega = thm"Rep_hypreal_omega";
   11.89  val lemma_omega_empty_singleton_disj = thm"lemma_omega_empty_singleton_disj";
   11.90  val lemma_finite_omega_set = thm"lemma_finite_omega_set";
    12.1 --- a/src/HOL/Hyperreal/HyperPow.ML	Mon Dec 29 06:49:26 2003 +0100
    12.2 +++ b/src/HOL/Hyperreal/HyperPow.ML	Thu Jan 01 10:06:32 2004 +0100
    12.3 @@ -52,7 +52,7 @@
    12.4  
    12.5  Goal "x <= y & (0::hypreal) < x --> x ^ n <= y ^ n";
    12.6  by (induct_tac "n" 1);
    12.7 -by (auto_tac (claset() addSIs [hypreal_mult_le_mono], simpset()));
    12.8 +by (auto_tac (claset() addSIs [mult_mono], simpset()));
    12.9  by (asm_simp_tac (simpset() addsimps [hrealpow_ge_zero]) 1);
   12.10  qed_spec_mp "hrealpow_le";
   12.11  
   12.12 @@ -104,7 +104,7 @@
   12.13  qed "hypreal_add_nonneg_eq_0_iff";
   12.14  
   12.15  Goal "(x*x + y*y + z*z = 0) = (x = 0 & y = 0 & z = (0::hypreal))";
   12.16 -by (simp_tac (HOL_ss addsimps [hypreal_le_square, hypreal_le_add_order, 
   12.17 +by (simp_tac (HOL_ss addsimps [zero_le_square, hypreal_le_add_order, 
   12.18                           hypreal_add_nonneg_eq_0_iff]) 1);
   12.19  by Auto_tac;
   12.20  qed "hypreal_three_squares_add_zero_iff";
    13.1 --- a/src/HOL/Hyperreal/Integration.ML	Mon Dec 29 06:49:26 2003 +0100
    13.2 +++ b/src/HOL/Hyperreal/Integration.ML	Thu Jan 01 10:06:32 2004 +0100
    13.3 @@ -355,9 +355,9 @@
    13.4  by (subgoal_tac 
    13.5      "abs((rsum(D,p) f - k2) - (rsum(D,p) f - k1)) < abs(k1 - k2)" 1);
    13.6  by (arith_tac 1);
    13.7 -by (dtac real_add_less_mono 1 THEN assume_tac 1);
    13.8 +by (dtac add_strict_mono 1 THEN assume_tac 1);
    13.9  by (auto_tac (claset(),
   13.10 -    HOL_ss addsimps [real_add_mult_distrib RS sym,
   13.11 +    HOL_ss addsimps [left_distrib RS sym,
   13.12                       real_mult_2_right RS sym, mult_less_cancel_right]));
   13.13  by (ALLGOALS(arith_tac));
   13.14  qed "Integral_unique";
   13.15 @@ -390,7 +390,7 @@
   13.16  by (res_inst_tac [("x","%x. b - a")] exI 1);
   13.17  by (auto_tac (claset(),simpset() addsimps 
   13.18      [sumr_mult RS sym,gauge_def,abs_interval_iff,
   13.19 -     real_diff_mult_distrib2 RS sym,partition,tpart_def]));
   13.20 +     right_diff_distrib RS sym,partition,tpart_def]));
   13.21  qed "Integral_mult_const";
   13.22  
   13.23  Goal "[| a <= b; Integral(a,b) f k |] ==> Integral(a,b) (%x. c * f x) (c * k)";
   13.24 @@ -404,15 +404,17 @@
   13.25  by (dtac sym 2);
   13.26  by (Asm_full_simp_tac 2 THEN Blast_tac 2);
   13.27  by (dres_inst_tac [("x","e/abs c")] spec 1 THEN Auto_tac);
   13.28 -by (asm_full_simp_tac (simpset() addsimps [real_0_less_mult_iff,
   13.29 +by (asm_full_simp_tac (simpset() addsimps [zero_less_mult_iff,
   13.30      real_divide_def]) 1);
   13.31  by (rtac exI 1 THEN Auto_tac);
   13.32  by (REPEAT(dtac spec 1) THEN Auto_tac);
   13.33  by (res_inst_tac [("z1","inverse(abs c)")] (real_mult_less_iff1 RS iffD1) 1);
   13.34  by (fold_tac [real_divide_def]);
   13.35 -by (auto_tac (claset(),simpset() addsimps [real_diff_mult_distrib2 
   13.36 -    RS sym,abs_mult,real_mult_assoc RS sym,
   13.37 -    ARITH_PROVE "c ~= 0 ==> abs (c::real) ~= 0",real_inverse_gt_0]));
   13.38 +by (auto_tac (claset(),
   13.39 +      simpset() addsimps [right_diff_distrib RS sym,
   13.40 +                     abs_mult, real_mult_assoc RS sym,
   13.41 +    ARITH_PROVE "c ~= 0 ==> abs (c::real) ~= 0",
   13.42 +    positive_imp_inverse_positive]));
   13.43  qed "Integral_mult";
   13.44  
   13.45  (* ------------------------------------------------------------------------ *)
   13.46 @@ -476,15 +478,15 @@
   13.47       addsimps [abs_mult RS sym, real_mult_assoc RS sym]) 2);
   13.48  by (subgoal_tac "inverse (z - x) * (f z - f x - f' x * (z - x)) = \
   13.49  \                (f z - f x)/(z - x) - f' x" 2);
   13.50 -by (asm_full_simp_tac (simpset() addsimps [abs_mult RS sym] @ real_mult_ac) 2);
   13.51 +by (asm_full_simp_tac (simpset() addsimps [abs_mult RS sym] @ mult_ac) 2);
   13.52  by (asm_full_simp_tac (simpset() addsimps [real_diff_def]) 2);
   13.53  by (rtac (real_mult_commute RS subst) 2);
   13.54 -by (asm_full_simp_tac (simpset() addsimps [real_add_mult_distrib,
   13.55 +by (asm_full_simp_tac (simpset() addsimps [left_distrib,
   13.56      real_diff_def]) 2);
   13.57  by (dtac (CLAIM "z ~= x ==> z + -x ~= (0::real)") 2);
   13.58  by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc,
   13.59      real_divide_def]) 2);
   13.60 -by (simp_tac (simpset() addsimps [real_add_mult_distrib]) 2);
   13.61 +by (simp_tac (simpset() addsimps [left_distrib]) 2);
   13.62  by (res_inst_tac [("x","s")] exI 1 THEN Auto_tac);
   13.63  by (res_inst_tac [("u1","u"),("v1","v")] (ARITH_PROVE "u < v | v <= (u::real)"
   13.64      RS disjE) 1);
   13.65 @@ -494,10 +496,10 @@
   13.66  by (res_inst_tac [("j","abs((f(v) - f(x)) - (f'(x) * (v - x))) + \
   13.67  \                  abs((f(x) - f(u)) - (f'(x) * (x - u)))")] real_le_trans 1);
   13.68  by (rtac (abs_triangle_ineq RSN (2,real_le_trans)) 1);
   13.69 -by (asm_full_simp_tac (simpset() addsimps [real_diff_mult_distrib2]) 1);
   13.70 +by (asm_full_simp_tac (simpset() addsimps [right_diff_distrib]) 1);
   13.71  by (arith_tac 1);
   13.72  by (res_inst_tac [("t","e*(v - u)")] (real_sum_of_halves RS subst) 1);
   13.73 -by (rtac real_add_le_mono 1);
   13.74 +by (rtac add_mono 1);
   13.75  by (res_inst_tac [("j","(e / 2) * abs(v - x)")] real_le_trans 1);
   13.76  
   13.77  by (Asm_full_simp_tac 2 THEN arith_tac 2);
   13.78 @@ -511,7 +513,7 @@
   13.79  by (subgoal_tac "abs (f u - f x - f' x * (u - x)) = \
   13.80  \                abs (f x - f u - f' x * (x - u))" 1);
   13.81  by (Asm_full_simp_tac 1);
   13.82 -by (asm_full_simp_tac (simpset() addsimps [real_add_mult_distrib2,
   13.83 +by (asm_full_simp_tac (simpset() addsimps [right_distrib,
   13.84      real_diff_def]) 2);
   13.85  by (arith_tac 2);
   13.86  by(rtac real_le_trans 1);
   13.87 @@ -521,8 +523,8 @@
   13.88  
   13.89  Goal "((number_of c - 1) * x <= 0) =((number_of c ::real) * x <= x)";
   13.90  by (rtac ((ARITH_PROVE "(x <= y) = (x - y <= (0::real))") RS ssubst) 1);
   13.91 -by (simp_tac (simpset() addsimps [real_diff_mult_distrib,
   13.92 -    CLAIM_SIMP "c * x - x = (c - 1) * (x::real)" [real_diff_mult_distrib]]) 1);
   13.93 +by (simp_tac (simpset() addsimps [left_diff_distrib,
   13.94 +    CLAIM_SIMP "c * x - x = (c - 1) * (x::real)" [left_diff_distrib]]) 1);
   13.95  qed "lemma_number_of_mult_le";
   13.96   
   13.97  
   13.98 @@ -615,7 +617,7 @@
   13.99  Goal "tpart(a,c) (D,p) ==> p = (%n. if D n < c then p n else c)";
  13.100  by (rtac ext 1);
  13.101  by (auto_tac (claset(),simpset() addsimps [tpart_def]));
  13.102 -by (dtac real_leI 1);
  13.103 +by (dtac (linorder_not_less RS iffD1) 1);
  13.104  by (dres_inst_tac [("r","Suc n")] partition_ub 1);
  13.105  by (dres_inst_tac [("x","n")] spec 1);
  13.106  by Auto_tac;
  13.107 @@ -859,10 +861,10 @@
  13.108       tpart_tag_eq RS sym]));
  13.109  by (ftac (tpart_partition RSN (3,lemma_additivity1)) 1); 
  13.110  by (auto_tac (claset(),simpset() addsimps [tpart_def]));
  13.111 -by (dtac (real_leI RS real_le_imp_less_or_eq) 2);
  13.112 +by (dtac ((linorder_not_less RS iffD1) RS real_le_imp_less_or_eq) 2);
  13.113  by (Auto_tac);
  13.114  by (blast_tac (claset() addDs [lemma_additivity3]) 2);
  13.115 -by (dtac real_leI 2 THEN dres_inst_tac [("x","na")] spec 2);
  13.116 +by (dtac (linorder_not_less RS iffD1) 2 THEN dres_inst_tac [("x","na")] spec 2);
  13.117  by (arith_tac 2);
  13.118  by (ftac lemma_additivity4_psize_eq 1);
  13.119  by (REPEAT(assume_tac 1));
  13.120 @@ -889,7 +891,7 @@
  13.121  by (ALLGOALS(dres_inst_tac [("x","na")] spec));
  13.122  by Auto_tac;
  13.123  by (asm_full_simp_tac (simpset() addsimps [split_if]) 1);
  13.124 -by (dtac (real_leI RS real_le_imp_less_or_eq) 1);
  13.125 +by (dtac ((linorder_not_less RS iffD1) RS real_le_imp_less_or_eq) 1);
  13.126  by (Step_tac 1);
  13.127  by (blast_tac (claset() addDs [lemma_additivity3a]) 1);
  13.128  by (dtac sym 1 THEN Auto_tac);
  13.129 @@ -935,7 +937,7 @@
  13.130  
  13.131  Goalw [rsum_def] 
  13.132     "rsum (D, p) (%x. f x + g x) =  rsum (D, p) f + rsum(D, p) g";
  13.133 -by (auto_tac (claset(),simpset() addsimps [sumr_add,real_add_mult_distrib]));
  13.134 +by (auto_tac (claset(),simpset() addsimps [sumr_add,left_distrib]));
  13.135  qed "rsum_add";
  13.136  
  13.137  (* Bartle/Sherbert: Theorem 10.1.5 p. 278 *)
  13.138 @@ -950,10 +952,10 @@
  13.139  by Auto_tac;
  13.140  by (dtac fine_min 1);
  13.141  by (REPEAT(dtac spec 1) THEN Auto_tac);
  13.142 -by (dres_inst_tac  [("R1.0","abs (rsum (D, p) f - k1)* 2"),
  13.143 -    ("R2.0","abs (rsum (D, p) g - k2) * 2")] 
  13.144 -    real_add_less_mono 1 THEN assume_tac 1);
  13.145 -by (auto_tac (claset(),HOL_ss addsimps [rsum_add,real_add_mult_distrib RS sym,
  13.146 +by (dres_inst_tac  [("a","abs (rsum (D, p) f - k1)* 2"),
  13.147 +    ("c","abs (rsum (D, p) g - k2) * 2")] 
  13.148 +    add_strict_mono 1 THEN assume_tac 1);
  13.149 +by (auto_tac (claset(),HOL_ss addsimps [rsum_add,left_distrib RS sym,
  13.150      real_mult_2_right RS sym,real_mult_less_iff1,CLAIM "(0::real) < 2"]));
  13.151  by (arith_tac 1);
  13.152  qed "Integral_add_fun";
  13.153 @@ -1011,8 +1013,8 @@
  13.154  by (subgoal_tac 
  13.155      "abs((rsum(D,p) f - k1) - (rsum(D,p) g - k2)) < abs(k1 - k2)" 1);
  13.156  by (arith_tac 1);
  13.157 -by (dtac real_add_less_mono 1 THEN assume_tac 1);
  13.158 -by (auto_tac (claset(),HOL_ss addsimps [real_add_mult_distrib RS sym,
  13.159 +by (dtac add_strict_mono 1 THEN assume_tac 1);
  13.160 +by (auto_tac (claset(),HOL_ss addsimps [left_distrib RS sym,
  13.161      real_mult_2_right RS sym,real_mult_less_iff1,CLAIM "(0::real) < 2"]));
  13.162  by (arith_tac 1);
  13.163  qed "Integral_le";
  13.164 @@ -1033,8 +1035,8 @@
  13.165  by (forw_inst_tac [("x","D2")] spec 1);
  13.166  by (REPEAT(dtac spec 1) THEN Auto_tac);
  13.167  by (thin_tac "0 < e" 1);
  13.168 -by (dtac real_add_less_mono 1 THEN assume_tac 1);
  13.169 -by (auto_tac (claset(),HOL_ss addsimps [real_add_mult_distrib RS sym,
  13.170 +by (dtac add_strict_mono 1 THEN assume_tac 1);
  13.171 +by (auto_tac (claset(),HOL_ss addsimps [left_distrib RS sym,
  13.172      real_mult_2_right RS sym,real_mult_less_iff1,CLAIM "(0::real) < 2"]));
  13.173  by (arith_tac 1);
  13.174  qed "Integral_imp_Cauchy";
    14.1 --- a/src/HOL/Hyperreal/Lim.ML	Mon Dec 29 06:49:26 2003 +0100
    14.2 +++ b/src/HOL/Hyperreal/Lim.ML	Thu Jan 01 10:06:32 2004 +0100
    14.3 @@ -5,11 +5,6 @@
    14.4                    differentiation of real=>real functions
    14.5  *)
    14.6  
    14.7 -val times_divide_eq_right = thm"times_divide_eq_right";
    14.8 -
    14.9 -val inverse_mult_distrib = thm"inverse_mult_distrib";
   14.10 -val inverse_minus_eq = thm "inverse_minus_eq";
   14.11 -
   14.12  fun ARITH_PROVE str = prove_goal thy str 
   14.13                        (fn prems => [cut_facts_tac prems 1,arith_tac 1]);
   14.14  
   14.15 @@ -51,7 +46,7 @@
   14.16      THEN step_tac (claset() addSEs [order_less_trans]) 3);
   14.17  by (ALLGOALS(rtac (abs_sum_triangle_ineq RS order_le_less_trans)));
   14.18  by (ALLGOALS(rtac (real_sum_of_halves RS subst)));
   14.19 -by (auto_tac (claset() addIs [real_add_less_mono],simpset()));
   14.20 +by (auto_tac (claset() addIs [add_strict_mono],simpset()));
   14.21  qed "LIM_add";
   14.22  
   14.23  Goalw [LIM_def] "f -- a --> L ==> (%x. -f(x)) -- a --> -L";
   14.24 @@ -72,7 +67,7 @@
   14.25       LIM_zero
   14.26   ----------------------------------------------*)
   14.27  Goal "f -- a --> l ==> (%x. f(x) + -l) -- a --> 0";
   14.28 -by (res_inst_tac [("z1","l")] ((real_add_minus RS subst)) 1);
   14.29 +by (res_inst_tac [("a1","l")] ((right_minus RS subst)) 1);
   14.30  by (rtac LIM_add_minus 1 THEN Auto_tac);
   14.31  qed "LIM_zero";
   14.32  
   14.33 @@ -119,8 +114,7 @@
   14.34  by (dres_inst_tac [("x","1")] spec 1);
   14.35  by (dres_inst_tac [("x","r")] spec 1);
   14.36  by (cut_facts_tac [real_zero_less_one] 1);
   14.37 -by (asm_full_simp_tac (simpset() addsimps 
   14.38 -    [abs_mult]) 1);
   14.39 +by (asm_full_simp_tac (simpset() addsimps [abs_mult]) 1);
   14.40  by (Clarify_tac 1);
   14.41  by (res_inst_tac [("R1.0","s"),("R2.0","sa")] 
   14.42      real_linear_less2 1);
   14.43 @@ -193,7 +187,7 @@
   14.44  \             abs(xa + -x) < inverse(real(Suc n)) & r \\<le> abs(f xa + -L)";
   14.45  by (Clarify_tac 1); 
   14.46  by (cut_inst_tac [("n1","n")]
   14.47 -    (real_of_nat_Suc_gt_zero RS real_inverse_gt_0) 1);
   14.48 +    (real_of_nat_Suc_gt_zero RS positive_imp_inverse_positive) 1);
   14.49  by Auto_tac;
   14.50  val lemma_LIM = result();
   14.51  
   14.52 @@ -341,7 +335,7 @@
   14.53      NSLIM_zero
   14.54   ------------------------------*)
   14.55  Goal "f -- a --NS> l ==> (%x. f(x) + -l) -- a --NS> 0";
   14.56 -by (res_inst_tac [("z1","l")] ((real_add_minus RS subst)) 1);
   14.57 +by (res_inst_tac [("a1","l")] ((right_minus RS subst)) 1);
   14.58  by (rtac NSLIM_add_minus 1 THEN Auto_tac);
   14.59  qed "NSLIM_zero";
   14.60  
   14.61 @@ -702,7 +696,7 @@
   14.62  \              r \\<le> abs(f z + -f y)";
   14.63  by (Clarify_tac 1); 
   14.64  by (cut_inst_tac [("n1","n")]
   14.65 -    (real_of_nat_Suc_gt_zero RS real_inverse_gt_0) 1);
   14.66 +    (real_of_nat_Suc_gt_zero RS positive_imp_inverse_positive) 1);
   14.67  by Auto_tac;
   14.68  val lemma_LIMu = result();
   14.69  
   14.70 @@ -980,7 +974,7 @@
   14.71  by (asm_full_simp_tac (simpset() addsimps [NSDERIV_NSLIM_iff,
   14.72             NSLIM_def]) 1 THEN REPEAT (Step_tac 1));
   14.73  by (auto_tac (claset(),
   14.74 -       simpset() addsimps [hypreal_add_divide_distrib]));
   14.75 +       simpset() addsimps [add_divide_distrib]));
   14.76  by (dres_inst_tac [("b","hypreal_of_real Da"),
   14.77                     ("d","hypreal_of_real Db")] approx_add 1);
   14.78  by (auto_tac (claset(), simpset() addsimps add_ac));
   14.79 @@ -1020,7 +1014,7 @@
   14.80  by (REPEAT (Step_tac 1));
   14.81  by (auto_tac (claset(),
   14.82         simpset() addsimps [starfun_lambda_cancel, lemma_nsderiv1]));
   14.83 -by (simp_tac (simpset() addsimps [hypreal_add_divide_distrib]) 1); 
   14.84 +by (simp_tac (simpset() addsimps [add_divide_distrib]) 1); 
   14.85  by (REPEAT(dtac (bex_Infinitesimal_iff2 RS iffD2) 1));
   14.86  by (auto_tac (claset(),
   14.87          simpset() delsimps [times_divide_eq_right]
   14.88 @@ -1052,7 +1046,7 @@
   14.89  \     ==> NSDERIV (%x. c * f x) x :> c*D";
   14.90  by (asm_full_simp_tac 
   14.91      (HOL_ss addsimps [times_divide_eq_right RS sym, NSDERIV_NSLIM_iff,
   14.92 -                      real_minus_mult_eq2, real_add_mult_distrib2 RS sym]) 1);
   14.93 +                      minus_mult_right, right_distrib RS sym]) 1);
   14.94  by (etac (NSLIM_const RS NSLIM_mult) 1);
   14.95  qed "NSDERIV_cmult";
   14.96  
   14.97 @@ -1064,7 +1058,7 @@
   14.98  \      ==> DERIV (%x. c * f x) x :> c*D";
   14.99  by (asm_full_simp_tac 
  14.100      (HOL_ss addsimps [times_divide_eq_right RS sym, NSDERIV_NSLIM_iff,
  14.101 -                      real_minus_mult_eq2, real_add_mult_distrib2 RS sym]) 1);
  14.102 +                      minus_mult_right, right_distrib RS sym]) 1);
  14.103  by (etac (LIM_const RS LIM_mult2) 1);
  14.104  qed "DERIV_cmult";
  14.105  
  14.106 @@ -1295,7 +1289,7 @@
  14.107  by (induct_tac "n" 1);
  14.108  by (dtac (DERIV_Id RS DERIV_mult) 2);
  14.109  by (auto_tac (claset(), 
  14.110 -              simpset() addsimps [real_of_nat_Suc, real_add_mult_distrib]));
  14.111 +              simpset() addsimps [real_of_nat_Suc, left_distrib]));
  14.112  by (case_tac "0 < n" 1);
  14.113  by (dres_inst_tac [("x","x")] realpow_minus_mult 1);
  14.114  by (auto_tac (claset(), 
  14.115 @@ -1354,7 +1348,7 @@
  14.116  Goal "[| DERIV f x :> d; f(x) \\<noteq> 0 |] \
  14.117  \     ==> DERIV (%x. inverse(f x)) x :> (- (d * inverse(f(x) ^ Suc (Suc 0))))";
  14.118  by (rtac (real_mult_commute RS subst) 1);
  14.119 -by (asm_simp_tac (HOL_ss addsimps [real_minus_mult_eq1, realpow_inverse]) 1);
  14.120 +by (asm_simp_tac (HOL_ss addsimps [minus_mult_left, realpow_inverse]) 1);
  14.121  by (fold_goals_tac [o_def]);
  14.122  by (blast_tac (claset() addSIs [DERIV_chain,DERIV_inverse]) 1);
  14.123  qed "DERIV_inverse_fun";
  14.124 @@ -1374,10 +1368,9 @@
  14.125  by (dtac DERIV_mult 2);
  14.126  by (REPEAT(assume_tac 1));
  14.127  by (asm_full_simp_tac
  14.128 -    (simpset() addsimps [real_divide_def, real_add_mult_distrib2,
  14.129 -                         realpow_inverse,real_minus_mult_eq1] @ real_mult_ac 
  14.130 -       delsimps [realpow_Suc, real_mult_minus_eq1, real_mult_minus_eq2,
  14.131 -                 minus_mult_right RS sym, minus_mult_left RS sym]) 1);
  14.132 +    (simpset() addsimps [real_divide_def, right_distrib,
  14.133 +                         realpow_inverse,minus_mult_left] @ mult_ac 
  14.134 +       delsimps [realpow_Suc, minus_mult_right RS sym, minus_mult_left RS sym]) 1);
  14.135  qed "DERIV_quotient";
  14.136  
  14.137  Goal "[| NSDERIV f x :> d; DERIV g x :> e; g(x) \\<noteq> 0 |] \
  14.138 @@ -1456,7 +1449,7 @@
  14.139  qed "f_inc_g_dec_Beq_g";
  14.140  
  14.141  Goal "[| \\<forall>n. f n \\<le> f (Suc n);  convergent f |] ==> f n \\<le> lim f";
  14.142 -by (rtac real_leI 1);
  14.143 +by (rtac (linorder_not_less RS iffD1) 1);
  14.144  by (auto_tac (claset(), 
  14.145        simpset() addsimps [convergent_LIMSEQ_iff, LIMSEQ_iff, monoseq_Suc]));
  14.146  by (dtac real_less_sum_gt_zero 1);
  14.147 @@ -1551,7 +1544,7 @@
  14.148  \     (b-a) / (2 ^ n)";
  14.149  by (induct_tac "n" 1);
  14.150  by (auto_tac (claset(), 
  14.151 -      simpset() addsimps [eq_divide_2_times_iff, real_add_divide_distrib, 
  14.152 +      simpset() addsimps [eq_divide_2_times_iff, add_divide_distrib, 
  14.153                            Let_def, split_def]));
  14.154  by (auto_tac (claset(), 
  14.155                simpset() addsimps (add_ac@[Bolzano_bisect_le, real_diff_def])));
  14.156 @@ -1615,7 +1608,7 @@
  14.157      order_le_less_trans 1);
  14.158  by (asm_simp_tac (simpset() addsimps [real_abs_def]) 1);  
  14.159  by (rtac (real_sum_of_halves RS subst) 1);
  14.160 -by (rtac real_add_less_mono 1);
  14.161 +by (rtac add_strict_mono 1);
  14.162  by (ALLGOALS 
  14.163      (asm_full_simp_tac (simpset() addsimps [symmetric real_diff_def])));
  14.164  qed "lemma_BOLZANO";
  14.165 @@ -1708,7 +1701,7 @@
  14.166  Addsimps [abs_real_of_nat_cancel];
  14.167  
  14.168  Goal "~ abs(x) + (1::real) < x";
  14.169 -by (rtac real_leD 1);
  14.170 +by (asm_full_simp_tac (simpset() addsimps [linorder_not_less]) 1); 
  14.171  by (auto_tac (claset() addIs [abs_ge_self RS order_trans],simpset()));
  14.172  qed "abs_add_one_not_less_self";
  14.173  Addsimps [abs_add_one_not_less_self];
  14.174 @@ -1770,7 +1763,7 @@
  14.175  by (rtac exI 1 THEN Auto_tac);
  14.176  by (REPEAT(dtac spec 1) THEN Auto_tac);
  14.177  by (dres_inst_tac [("x","x")] spec 1);
  14.178 -by (auto_tac (claset() addSIs [real_leI],simpset()));
  14.179 +by (auto_tac (claset() addSIs [(linorder_not_less RS iffD1)],simpset()));
  14.180  qed "isCont_has_Ub";
  14.181  
  14.182  (*----------------------------------------------------------------------------*)
  14.183 @@ -1786,7 +1779,7 @@
  14.184  by (Asm_full_simp_tac 1); 
  14.185  by (rtac ccontr 1);
  14.186  by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> f x < M" 1 THEN Step_tac 1);
  14.187 -by (rtac ccontr 2 THEN dtac real_leI 2);
  14.188 +by (rtac ccontr 2 THEN dtac (linorder_not_less RS iffD1) 2);
  14.189  by (dres_inst_tac [("z","M")] real_le_anti_sym 2);
  14.190  by (REPEAT(Blast_tac 2));
  14.191  by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> isCont (%x. inverse(M - f x)) x" 1);
  14.192 @@ -1806,16 +1799,16 @@
  14.193      "\\<forall>x. a \\<le> x & x \\<le> b --> (%x. inverse(M - (f x))) x < (k + 1)" 1);
  14.194  by Safe_tac;
  14.195  by (res_inst_tac [("y","k")] order_le_less_trans 2);
  14.196 -by (asm_full_simp_tac (simpset() addsimps [real_zero_less_one]) 3);
  14.197 +by (asm_full_simp_tac (simpset() addsimps [zero_less_one]) 3);
  14.198  by (Asm_full_simp_tac 2); 
  14.199  by (subgoal_tac "\\<forall>x. a \\<le> x & x \\<le> b --> \
  14.200  \                inverse(k + 1) < inverse((%x. inverse(M - (f x))) x)" 1);
  14.201  by Safe_tac;
  14.202 -by (rtac real_inverse_less_swap 2);
  14.203 +by (rtac less_imp_inverse_less 2);
  14.204  by (ALLGOALS Asm_full_simp_tac);
  14.205  by (dres_inst_tac [("P", "%N. N<M --> ?Q N"),
  14.206                     ("x","M - inverse(k + 1)")] spec 1);
  14.207 -by (Step_tac 1 THEN dtac real_leI 1);
  14.208 +by (Step_tac 1 THEN dtac (linorder_not_less RS iffD1) 1);
  14.209  by (dtac (le_diff_eq RS iffD1) 1);
  14.210  by (REPEAT(dres_inst_tac [("x","a")] spec 1));
  14.211  by (Asm_full_simp_tac 1);
  14.212 @@ -2047,10 +2040,8 @@
  14.213  by (asm_full_simp_tac (simpset() addsimps [DIVISION_BY_ZERO]) 1); 
  14.214  by (res_inst_tac [("c1","b - a")] (real_mult_left_cancel RS iffD1) 1);
  14.215  by (arith_tac 1);
  14.216 -by (auto_tac (claset(),
  14.217 -              simpset() addsimps [real_diff_mult_distrib2]));
  14.218 -by (auto_tac (claset(),
  14.219 -           simpset() addsimps [real_diff_mult_distrib]));
  14.220 +by (auto_tac (claset(), simpset() addsimps [right_diff_distrib]));
  14.221 +by (auto_tac (claset(), simpset() addsimps [left_diff_distrib]));
  14.222  qed "lemma_MVT";
  14.223  
  14.224  Goal "[| a < b; \
  14.225 @@ -2134,7 +2125,7 @@
  14.226  by (auto_tac (claset() addDs [DERIV_isCont,DERIV_unique],simpset() addsimps 
  14.227      [differentiable_def]));
  14.228  by (auto_tac (claset() addDs [DERIV_unique],
  14.229 -       simpset() addsimps [real_add_mult_distrib, real_diff_def]));
  14.230 +       simpset() addsimps [left_distrib, real_diff_def]));
  14.231  qed "DERIV_const_ratio_const";
  14.232  
  14.233  Goal "[|a \\<noteq> b; \\<forall>x. DERIV f x :> k |] ==> (f(b) - f(a))/(b - a) = k";
    15.1 --- a/src/HOL/Hyperreal/Log.ML	Mon Dec 29 06:49:26 2003 +0100
    15.2 +++ b/src/HOL/Hyperreal/Log.ML	Thu Jan 01 10:06:32 2004 +0100
    15.3 @@ -25,7 +25,7 @@
    15.4  Goalw [powr_def] 
    15.5        "[| 0 < x; 0 < y |] ==> (x * y) powr a = (x powr a) * (y powr a)";
    15.6  by (asm_simp_tac (simpset() addsimps [exp_add RS sym,ln_mult,
    15.7 -    real_add_mult_distrib2]) 1);
    15.8 +    right_distrib]) 1);
    15.9  qed "powr_mult";
   15.10  
   15.11  Goalw [powr_def] "0 < x powr a";
   15.12 @@ -39,19 +39,18 @@
   15.13  Addsimps [powr_not_zero];
   15.14  
   15.15  Goal "[| 0 < x; 0 < y |] ==> (x / y) powr a = (x powr a)/(y powr a)";
   15.16 -by (asm_simp_tac (simpset() addsimps [real_divide_def,real_inverse_gt_0,
   15.17 -    powr_mult]) 1);
   15.18 +by (asm_simp_tac (simpset() addsimps [real_divide_def,positive_imp_inverse_positive, powr_mult]) 1);
   15.19  by (asm_simp_tac (simpset() addsimps [powr_def,exp_minus RS sym,
   15.20      exp_add RS sym,ln_inverse]) 1);
   15.21  qed "powr_divide";
   15.22  
   15.23  Goalw [powr_def] "x powr (a + b) = (x powr a) * (x powr b)";
   15.24  by (asm_simp_tac (simpset() addsimps [exp_add RS sym,
   15.25 -    real_add_mult_distrib]) 1);
   15.26 +    left_distrib]) 1);
   15.27  qed "powr_add";
   15.28  
   15.29  Goalw [powr_def] "(x powr a) powr b = x powr (a * b)";
   15.30 -by (simp_tac (simpset() addsimps real_mult_ac) 1);
   15.31 +by (simp_tac (simpset() addsimps mult_ac) 1);
   15.32  qed "powr_powr";
   15.33  
   15.34  Goal "(x powr a) powr b = (x powr b) powr a";
   15.35 @@ -108,7 +107,7 @@
   15.36       "[| 0 < a; a ~= 1; 0 < x; 0 < y  |] \
   15.37  \     ==> log a (x * y) = log a x + log a y";
   15.38  by (auto_tac (claset(),simpset() addsimps [ln_mult,real_divide_def,
   15.39 -    real_add_mult_distrib]));
   15.40 +    left_distrib]));
   15.41  qed "log_mult";
   15.42  
   15.43  Goalw [log_def,real_divide_def]
   15.44 @@ -138,7 +137,7 @@
   15.45  Addsimps [log_eq_one];
   15.46  
   15.47  Goal "[| 0 < a; a ~= 1; 0 < x |] ==> log a (inverse x) = - log a x";
   15.48 -by (res_inst_tac [("x1","log a x")] (real_add_left_cancel RS iffD1) 1);
   15.49 +by (res_inst_tac [("a1","log a x")] (add_left_cancel RS iffD1) 1);
   15.50  by (auto_tac (claset(),simpset() addsimps [log_mult RS sym]));
   15.51  qed "log_inverse";
   15.52  
    16.1 --- a/src/HOL/Hyperreal/MacLaurin.ML	Mon Dec 29 06:49:26 2003 +0100
    16.2 +++ b/src/HOL/Hyperreal/MacLaurin.ML	Thu Jan 01 10:06:32 2004 +0100
    16.3 @@ -101,9 +101,9 @@
    16.4  by (rtac DERIV_quotient 3);
    16.5  by (rtac DERIV_const 4);
    16.6  by (rtac DERIV_pow 3);
    16.7 -by (asm_simp_tac (simpset() addsimps [real_inverse_distrib,
    16.8 +by (asm_simp_tac (simpset() addsimps [inverse_mult_distrib,
    16.9      CLAIM_SIMP "(a::real) * b * c * (d * e) = a * b * (c * d) * e" 
   16.10 -    real_mult_ac,fact_diff_Suc]) 4);
   16.11 +    mult_ac,fact_diff_Suc]) 4);
   16.12  by (Asm_simp_tac 3);
   16.13  by (forw_inst_tac [("m","ma")] less_add_one 2);
   16.14  by (Clarify_tac 2);
   16.15 @@ -126,8 +126,8 @@
   16.16  by DERIV_tac;
   16.17  by (stac fact_Suc 2);
   16.18  by (stac real_of_nat_mult 2);
   16.19 -by (simp_tac (simpset() addsimps [real_inverse_distrib] @
   16.20 -    real_mult_ac) 2);
   16.21 +by (simp_tac (simpset() addsimps [inverse_mult_distrib] @
   16.22 +    mult_ac) 2);
   16.23  by (subgoal_tac "ALL ma. ma < n --> \
   16.24  \        (EX t. 0 < t & t < h & difg (Suc ma) t = 0)" 1);
   16.25  by (rotate_tac 11 1);
   16.26 @@ -267,7 +267,7 @@
   16.27                   ("h","-h"),("n","n")] Maclaurin_objl 1);
   16.28  by (Asm_full_simp_tac 1);
   16.29  by (etac impE 1 THEN Step_tac 1);
   16.30 -by (stac real_minus_mult_eq2 1);
   16.31 +by (stac minus_mult_right 1);
   16.32  by (rtac DERIV_cmult 1);
   16.33  by (rtac lemma_DERIV_subst 1);
   16.34  by (rtac (read_instantiate [("g","uminus")] DERIV_chain2) 1);
   16.35 @@ -446,7 +446,7 @@
   16.36  qed "lemma_exhaust_less_4";
   16.37  
   16.38  bind_thm ("real_mult_le_lemma",
   16.39 -          simplify (simpset()) (inst "y" "1" real_mult_le_le_mono2));
   16.40 +          simplify (simpset()) (inst "b" "1" mult_right_mono));
   16.41  
   16.42  
   16.43  Goal "abs(sin x - \
   16.44 @@ -489,7 +489,7 @@
   16.45  by (asm_full_simp_tac (simpset() addsimps [numeral_2_eq_2,real_divide_def]) 1);
   16.46  by (dtac lemma_odd_mod_4_div_2 1);
   16.47  by (asm_full_simp_tac (simpset() addsimps [numeral_2_eq_2, real_divide_def]) 1);
   16.48 -by (auto_tac (claset() addSIs [real_mult_le_lemma,real_mult_le_le_mono2],
   16.49 +by (auto_tac (claset() addSIs [real_mult_le_lemma,mult_right_mono],
   16.50        simpset() addsimps [real_divide_def,abs_mult,abs_inverse,realpow_abs RS
   16.51  sym]));
   16.52  qed "Maclaurin_sin_bound";
   16.53 @@ -660,7 +660,7 @@
   16.54  by (rtac sumr_fun_eq 1);
   16.55  by (auto_tac (claset(),simpset() addsimps [odd_not_even RS sym]));
   16.56  by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex,
   16.57 -    even_mult_two_ex,real_add_mult_distrib,cos_add]  delsimps 
   16.58 +    even_mult_two_ex,left_distrib,cos_add]  delsimps 
   16.59      [fact_Suc,realpow_Suc]));
   16.60  by (auto_tac (claset(),simpset() addsimps [real_mult_commute]));
   16.61  qed "Maclaurin_cos_expansion";
   16.62 @@ -687,7 +687,7 @@
   16.63  by (rtac sumr_fun_eq 1);
   16.64  by (auto_tac (claset(),simpset() addsimps [odd_not_even RS sym]));
   16.65  by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex,
   16.66 -    even_mult_two_ex,real_add_mult_distrib,cos_add]  delsimps 
   16.67 +    even_mult_two_ex,left_distrib,cos_add]  delsimps 
   16.68      [fact_Suc,realpow_Suc]));
   16.69  by (auto_tac (claset(),simpset() addsimps [real_mult_commute]));
   16.70  qed "Maclaurin_cos_expansion2";
   16.71 @@ -714,7 +714,7 @@
   16.72  by (rtac sumr_fun_eq 1);
   16.73  by (auto_tac (claset(),simpset() addsimps [odd_not_even RS sym]));
   16.74  by (auto_tac (claset(),simpset() addsimps [odd_Suc_mult_two_ex,
   16.75 -    even_mult_two_ex,real_add_mult_distrib,cos_add]  delsimps 
   16.76 +    even_mult_two_ex,left_distrib,cos_add]  delsimps 
   16.77      [fact_Suc,realpow_Suc]));
   16.78  by (auto_tac (claset(),simpset() addsimps [real_mult_commute]));
   16.79  qed "Maclaurin_minus_cos_expansion";
    17.1 --- a/src/HOL/Hyperreal/NSA.ML	Mon Dec 29 06:49:26 2003 +0100
    17.2 +++ b/src/HOL/Hyperreal/NSA.ML	Thu Jan 01 10:06:32 2004 +0100
    17.3 @@ -347,8 +347,8 @@
    17.4       "x: HInfinite ==> inverse x: Infinitesimal";
    17.5  by Auto_tac;
    17.6  by (eres_inst_tac [("x","inverse r")] ballE 1);
    17.7 -by (forw_inst_tac [("x1","r"),("z","abs x")]
    17.8 -    (hypreal_inverse_gt_0 RS order_less_trans) 1);
    17.9 +by (forw_inst_tac [("a1","r"),("z","abs x")]
   17.10 +    (positive_imp_inverse_positive RS order_less_trans) 1);
   17.11  by (assume_tac 1);
   17.12  by (dtac ((inverse_inverse_eq RS sym) RS subst) 1);
   17.13  by (rtac (inverse_less_iff_less RS iffD1) 1);
   17.14 @@ -457,8 +457,8 @@
   17.15  by (eres_inst_tac [("x","r*ra")] ballE 1);
   17.16  by (fast_tac (claset() addIs [SReal_mult]) 2);
   17.17  by (auto_tac (claset(), simpset() addsimps [zero_less_mult_iff]));
   17.18 -by (cut_inst_tac [("x","ra"),("y","abs y"),
   17.19 -                  ("u","r"),("v","abs x")] hypreal_mult_le_mono 1);
   17.20 +by (cut_inst_tac [("c","ra"),("d","abs y"),
   17.21 +                  ("a","r"),("b","abs x")] mult_mono 1);
   17.22  by Auto_tac;
   17.23  qed "not_Infinitesimal_mult";
   17.24  
   17.25 @@ -1514,7 +1514,7 @@
   17.26       "[| u: Infinitesimal; hypreal_of_real x + u <= hypreal_of_real y |] \
   17.27  \     ==> hypreal_of_real x <= hypreal_of_real y";
   17.28  by (EVERY1 [rtac notI, rtac contrapos_np, assume_tac]);
   17.29 -by (res_inst_tac [("C","-u")] hypreal_less_add_right_cancel 1);
   17.30 +by (res_inst_tac [("c1","-u")] (add_less_cancel_right RS iffD1) 1);
   17.31  by (Asm_full_simp_tac 1);
   17.32  by (dtac (Infinitesimal_minus_iff RS iffD2) 1);
   17.33  by (dtac Infinitesimal_add_hypreal_of_real_less 1);
   17.34 @@ -1560,16 +1560,16 @@
   17.35  
   17.36  Goal "x*x + y*y : Infinitesimal ==> x*x : Infinitesimal";
   17.37  by (rtac Infinitesimal_interval2 1);
   17.38 -by (rtac hypreal_le_square 3);
   17.39 +by (rtac zero_le_square 3);
   17.40  by (assume_tac 1);
   17.41 -by Auto_tac;
   17.42 +by (auto_tac (claset(), simpset() addsimps [zero_le_square]));
   17.43  qed "Infinitesimal_square_cancel";
   17.44  Addsimps [Infinitesimal_square_cancel];
   17.45  
   17.46  Goal "x*x + y*y : HFinite ==> x*x : HFinite";
   17.47  by (rtac HFinite_bounded 1);
   17.48  by (assume_tac 1);
   17.49 -by Auto_tac;
   17.50 +by (auto_tac (claset(), simpset() addsimps [zero_le_square]));
   17.51  qed "HFinite_square_cancel";
   17.52  Addsimps [HFinite_square_cancel];
   17.53  
   17.54 @@ -1590,7 +1590,7 @@
   17.55  Goal "x*x + y*y + z*z : Infinitesimal ==> x*x : Infinitesimal";
   17.56  by (rtac Infinitesimal_interval2 1);
   17.57  by (assume_tac 1);
   17.58 -by (rtac hypreal_le_square 2);
   17.59 +by (rtac zero_le_square 2);
   17.60  by (Asm_full_simp_tac 1);
   17.61  by (cut_inst_tac [("a","y")] (thm"zero_le_square") 1);
   17.62  by (cut_inst_tac [("a","z")] (thm"zero_le_square") 1);
   17.63 @@ -1601,7 +1601,7 @@
   17.64  Goal "x*x + y*y + z*z : HFinite ==> x*x : HFinite";
   17.65  by (rtac HFinite_bounded 1);
   17.66  by (assume_tac 1);
   17.67 -by (rtac hypreal_le_square 2);
   17.68 +by (rtac zero_le_square 2);
   17.69  by (cut_inst_tac [("a","y")] (thm"zero_le_square") 1);
   17.70  by (cut_inst_tac [("a","z")] (thm"zero_le_square") 1);
   17.71  by (asm_simp_tac (simpset() addsimps []) 1); 
   17.72 @@ -2073,7 +2073,7 @@
   17.73  by (dres_inst_tac [("x","inverse (hypreal_of_real(real (Suc n)))")]
   17.74      bspec 1);
   17.75  by (full_simp_tac (simpset() addsimps [SReal_inverse]) 1);
   17.76 -by (rtac (real_of_nat_Suc_gt_zero RS real_inverse_gt_0 RS
   17.77 +by (rtac (real_of_nat_Suc_gt_zero RS positive_imp_inverse_positive RS
   17.78            (hypreal_of_real_less_iff RS iffD2) RSN(2,impE)) 1);
   17.79  by (assume_tac 2);
   17.80  by (asm_full_simp_tac (simpset() addsimps
   17.81 @@ -2156,7 +2156,7 @@
   17.82   --------------------------------------------------------------*)
   17.83  Goal "- {n::nat. real n <= u} = {n. u < real n}";
   17.84  by (auto_tac (claset() addSDs [order_le_less_trans],
   17.85 -              simpset() addsimps [not_real_leE]));
   17.86 +              simpset() addsimps [linorder_not_le]));
   17.87  val lemma = result();
   17.88  
   17.89  (*-----------------------------------------------
   17.90 @@ -2274,7 +2274,7 @@
   17.91  Goal "- {n. u <= inverse(real(Suc n))} = \
   17.92  \     {n. inverse(real(Suc n)) < u}";
   17.93  by (auto_tac (claset() addSDs [order_le_less_trans],
   17.94 -              simpset() addsimps [not_real_leE]));
   17.95 +              simpset() addsimps [linorder_not_le]));
   17.96  val lemma = result();
   17.97  
   17.98  Goal "0 < u ==> \
    18.1 --- a/src/HOL/Hyperreal/NthRoot.thy	Mon Dec 29 06:49:26 2003 +0100
    18.2 +++ b/src/HOL/Hyperreal/NthRoot.thy	Thu Jan 01 10:06:32 2004 +0100
    18.3 @@ -18,9 +18,9 @@
    18.4       "[| (0::real) < a; 0 < n |] ==> \<exists>s. s : {x. x ^ n <= a & 0 < x}"
    18.5  apply (case_tac "1 <= a")
    18.6  apply (rule_tac x = "1" in exI)
    18.7 -apply (drule_tac [2] not_real_leE)
    18.8 +apply (drule_tac [2] linorder_not_le [THEN iffD1])
    18.9  apply (drule_tac [2] less_not_refl2 [THEN not0_implies_Suc])
   18.10 -apply (auto intro!: realpow_Suc_le_self simp add: real_zero_less_one)
   18.11 +apply (auto intro!: realpow_Suc_le_self simp add: zero_less_one)
   18.12  done
   18.13  
   18.14  lemma lemma_nth_realpow_isUb_ex:
   18.15 @@ -28,20 +28,20 @@
   18.16        ==> \<exists>u. isUb (UNIV::real set) {x. x ^ n <= a & 0 < x} u"
   18.17  apply (case_tac "1 <= a")
   18.18  apply (rule_tac x = "a" in exI)
   18.19 -apply (drule_tac [2] not_real_leE)
   18.20 +apply (drule_tac [2] linorder_not_le [THEN iffD1])
   18.21  apply (rule_tac [2] x = "1" in exI)
   18.22  apply (rule_tac [!] setleI [THEN isUbI])
   18.23  apply safe
   18.24  apply (simp_all (no_asm))
   18.25  apply (rule_tac [!] ccontr)
   18.26 -apply (drule_tac [!] not_real_leE)
   18.27 +apply (drule_tac [!] linorder_not_le [THEN iffD1])
   18.28  apply (drule realpow_ge_self2 , assumption)
   18.29  apply (drule_tac n = "n" in realpow_less)
   18.30  apply (assumption+)
   18.31  apply (drule real_le_trans , assumption)
   18.32  apply (drule_tac y = "y ^ n" in order_less_le_trans)
   18.33  apply (assumption , erule real_less_irrefl)
   18.34 -apply (drule_tac n = "n" in real_zero_less_one [THEN realpow_less])
   18.35 +apply (drule_tac n = "n" in zero_less_one [THEN realpow_less])
   18.36  apply auto
   18.37  done
   18.38  
   18.39 @@ -86,7 +86,7 @@
   18.40       {x. x ^ n <= a & 0 < x} u |] ==> a <= u ^ n"
   18.41  apply (frule lemma_nth_realpow_isLub_ge , safe)
   18.42  apply (rule LIMSEQ_inverse_real_of_nat_add [THEN LIMSEQ_pow, THEN LIMSEQ_le_const])
   18.43 -apply (auto simp add: real_of_nat_def real_of_posnat_Suc)
   18.44 +apply (auto simp add: real_of_nat_def)
   18.45  done
   18.46  
   18.47  subsection{*Second Half*}
   18.48 @@ -109,15 +109,16 @@
   18.49  done
   18.50  
   18.51  lemma real_mult_less_self: "0 < r ==> r * (1 + -inverse(real (Suc n))) < r"
   18.52 -apply (simp (no_asm) add: real_add_mult_distrib2)
   18.53 -apply (rule_tac C = "-r" in real_less_add_left_cancel)
   18.54 -apply (auto intro: real_mult_order simp add: real_add_assoc [symmetric] real_minus_zero_less_iff2)
   18.55 +apply (simp (no_asm) add: right_distrib)
   18.56 +apply (rule add_less_cancel_left [of "-r", THEN iffD1])
   18.57 +apply (auto intro: mult_pos
   18.58 +            simp add: add_assoc [symmetric] neg_less_0_iff_less)
   18.59  done
   18.60  
   18.61  lemma real_mult_add_one_minus_ge_zero:
   18.62       "0 < r ==>  0 <= r*(1 + -inverse(real (Suc n)))"
   18.63  apply (simp add: zero_le_mult_iff real_of_nat_inverse_le_iff) 
   18.64 -apply (simp add: RealOrd.real_of_nat_Suc) 
   18.65 +apply (simp add: real_of_nat_Suc) 
   18.66  done
   18.67  
   18.68  lemma lemma_nth_realpow_isLub_le:
   18.69 @@ -141,7 +142,7 @@
   18.70       {x. x ^ n <= a & 0 < x} u |] ==> u ^ n <= a"
   18.71  apply (frule lemma_nth_realpow_isLub_le , safe)
   18.72  apply (rule LIMSEQ_inverse_real_of_nat_add_minus_mult [THEN LIMSEQ_pow, THEN LIMSEQ_le_const2])
   18.73 -apply (auto simp add: real_of_nat_def real_of_posnat_Suc)
   18.74 +apply (auto simp add: real_of_nat_def)
   18.75  done
   18.76  
   18.77  (*----------- The theorem at last! -----------*)
    19.1 --- a/src/HOL/Hyperreal/Poly.ML	Mon Dec 29 06:49:26 2003 +0100
    19.2 +++ b/src/HOL/Hyperreal/Poly.ML	Thu Jan 01 10:06:32 2004 +0100
    19.3 @@ -68,7 +68,7 @@
    19.4  by (rtac allI 2 );
    19.5  by (case_tac "q" 2);
    19.6  by (Asm_simp_tac 2);
    19.7 -by (asm_simp_tac (simpset() addsimps [real_add_mult_distrib2] ) 2);
    19.8 +by (asm_simp_tac (simpset() addsimps [right_distrib] ) 2);
    19.9  by (Asm_simp_tac 1);
   19.10  qed "poly_cmult_distr";
   19.11  
   19.12 @@ -92,14 +92,14 @@
   19.13  by (induct_tac "p1" 2);
   19.14  by Auto_tac;
   19.15  by (case_tac "p2" 1);
   19.16 -by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib2]));
   19.17 +by (auto_tac (claset(),simpset() addsimps [right_distrib]));
   19.18  qed "poly_add";
   19.19  
   19.20  Goal "poly (c %* p) x = c * poly p x";
   19.21  by (induct_tac "p" 1); 
   19.22  by (case_tac "x=0" 2);
   19.23 -by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib2] 
   19.24 -    @ real_mult_ac));
   19.25 +by (auto_tac (claset(),simpset() addsimps [right_distrib] 
   19.26 +    @ mult_ac));
   19.27  qed "poly_cmult";
   19.28  
   19.29  Goalw [poly_minus_def] "poly (-- p) x = - (poly p x)";
   19.30 @@ -113,7 +113,7 @@
   19.31  by (auto_tac (claset(),simpset() addsimps [poly_cmult]));
   19.32  by (case_tac "list" 1);
   19.33  by (auto_tac (claset(),simpset() addsimps [poly_cmult,poly_add,
   19.34 -    real_add_mult_distrib,real_add_mult_distrib2] @ real_mult_ac));
   19.35 +    left_distrib,right_distrib] @ mult_ac));
   19.36  qed "poly_mult";
   19.37  
   19.38  Goal "poly (p %^ n) x = (poly p x) ^ n";
   19.39 @@ -178,7 +178,7 @@
   19.40      \   x ^ n * poly (pderiv_aux (Suc n) p) x ";
   19.41  by (induct_tac "p" 1);
   19.42  by (auto_tac (claset() addSIs [DERIV_add,DERIV_cmult2],simpset() addsimps 
   19.43 -    [pderiv_def,real_add_mult_distrib2,real_mult_assoc RS sym] delsimps 
   19.44 +    [pderiv_def,right_distrib,real_mult_assoc RS sym] delsimps 
   19.45      [realpow_Suc]));
   19.46  by (rtac (real_mult_commute RS subst) 1);
   19.47  by (simp_tac (simpset() delsimps [realpow_Suc]) 1);
   19.48 @@ -232,7 +232,7 @@
   19.49  Goal "[| a < b; 0 < poly p a; poly p b < 0 |] \
   19.50  \     ==> EX x. a < x & x < b & (poly p x = 0)";
   19.51  by (blast_tac (claset() addIs [full_simplify (simpset() 
   19.52 -    addsimps [poly_minus, rename_numerals real_minus_zero_less_iff2])
   19.53 +    addsimps [poly_minus, rename_numerals neg_less_0_iff_less])
   19.54     (read_instantiate [("p","-- p")] poly_IVT_pos)]) 1);
   19.55  qed "poly_IVT_neg";
   19.56  
   19.57 @@ -256,7 +256,7 @@
   19.58  by (induct_tac "p1" 1);
   19.59  by (Step_tac 2);
   19.60  by (case_tac "p2" 2);
   19.61 -by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib2]));
   19.62 +by (auto_tac (claset(),simpset() addsimps [right_distrib]));
   19.63  qed "lemma_poly_pderiv_aux_add";
   19.64  
   19.65  Goal "poly (pderiv_aux n (p1 +++ p2)) x = \
   19.66 @@ -266,7 +266,7 @@
   19.67  
   19.68  Goal "ALL n. poly (pderiv_aux n (c %* p) ) x = poly (c %* pderiv_aux n p) x";
   19.69  by (induct_tac "p" 1);
   19.70 -by (auto_tac (claset(),simpset() addsimps [poly_cmult] @ real_mult_ac));
   19.71 +by (auto_tac (claset(),simpset() addsimps [poly_cmult] @ mult_ac));
   19.72  qed "lemma_poly_pderiv_aux_cmult";
   19.73  
   19.74  Goal "poly (pderiv_aux n (c %* p) ) x = poly (c %* pderiv_aux n p) x";
   19.75 @@ -281,7 +281,7 @@
   19.76  Goal "ALL n. poly (pderiv_aux (Suc n) p) x = poly ((pderiv_aux n p) +++ p) x";
   19.77  by (induct_tac "p" 1);
   19.78  by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc,
   19.79 -    real_add_mult_distrib]));
   19.80 +    left_distrib]));
   19.81  qed "lemma_poly_pderiv_aux_mult1";
   19.82  
   19.83  Goal "poly (pderiv_aux (Suc n) p) x = poly ((pderiv_aux n p) +++ p) x";
   19.84 @@ -326,8 +326,8 @@
   19.85  by (rtac (lemma_poly_mult_pderiv RS ssubst) 1);
   19.86  by (rtac (poly_add RS ssubst) 1);
   19.87  by (rtac (poly_add RS ssubst) 1);
   19.88 -by (asm_simp_tac (simpset() addsimps [poly_mult,real_add_mult_distrib2] 
   19.89 -    @ real_add_ac @ real_mult_ac) 1);
   19.90 +by (asm_simp_tac (simpset() addsimps [poly_mult,right_distrib] 
   19.91 +    @ add_ac @ mult_ac) 1);
   19.92  qed "poly_pderiv_mult";
   19.93  
   19.94  Goal "poly (pderiv (p %^ (Suc n))) x = \
   19.95 @@ -335,8 +335,8 @@
   19.96  by (induct_tac "n" 1);
   19.97  by (auto_tac (claset(),simpset() addsimps [poly_add,poly_pderiv_cmult,
   19.98      poly_cmult,poly_pderiv_mult,real_of_nat_zero,poly_mult,
   19.99 -    real_of_nat_Suc,real_add_mult_distrib2,real_add_mult_distrib]
  19.100 -    @ real_mult_ac));
  19.101 +    real_of_nat_Suc,right_distrib,left_distrib]
  19.102 +    @ mult_ac));
  19.103  qed "poly_pderiv_exp";
  19.104  
  19.105  Goal "poly (pderiv ([-a, 1] %^ (Suc n))) x = \
  19.106 @@ -372,7 +372,7 @@
  19.107  
  19.108  Goal "(poly p a = 0) = ((p = []) | (EX q. p = [-a, 1] *** q))";
  19.109  by (auto_tac (claset(),simpset() addsimps [poly_add,poly_cmult,
  19.110 -    real_add_mult_distrib2]));
  19.111 +    right_distrib]));
  19.112  by (case_tac "p" 1);
  19.113  by (cut_inst_tac [("h","aa"),("t","list"),("a","a")] poly_linear_rem 2);
  19.114  by (Step_tac 2);
  19.115 @@ -439,8 +439,7 @@
  19.116  
  19.117  Goal "(poly (p *** q) x ~= poly [] x) = \
  19.118  \     (poly p x ~= poly [] x & poly q x ~= poly [] x)";
  19.119 -by (auto_tac (claset(),simpset() addsimps [poly_mult,rename_numerals
  19.120 -    real_mult_not_zero]));
  19.121 +by (auto_tac (claset(),simpset() addsimps [poly_mult]));
  19.122  qed "poly_mult_not_eq_poly_Nil";
  19.123  Addsimps [poly_mult_not_eq_poly_Nil];
  19.124  
  19.125 @@ -571,7 +570,7 @@
  19.126  
  19.127  Goal "poly (p *** q +++ --(p *** r)) = poly (p *** (q +++ -- r))";
  19.128  by (auto_tac (claset(),simpset() addsimps [poly_add,poly_minus_def,
  19.129 -    fun_eq,poly_mult,poly_cmult,real_add_mult_distrib2]));
  19.130 +    fun_eq,poly_mult,poly_cmult,right_distrib]));
  19.131  qed "poly_add_minus_mult_eq";
  19.132  
  19.133  Goal "(poly (p *** q) = poly (p *** r)) = (poly p = poly [] | poly q = poly r)";
  19.134 @@ -686,14 +685,14 @@
  19.135  
  19.136  Goal "([a, 1] divides (p *** q)) = ([a, 1] divides p | [a, 1] divides q)";
  19.137  by (auto_tac (claset(),simpset() addsimps [divides_def,fun_eq,poly_mult,
  19.138 -    poly_add,poly_cmult,real_add_mult_distrib RS sym]));
  19.139 +    poly_add,poly_cmult,left_distrib RS sym]));
  19.140  by (dres_inst_tac [("x","-a")] spec 1);
  19.141  by (auto_tac (claset(),simpset() addsimps [poly_linear_divides,poly_add,
  19.142 -    poly_cmult,real_add_mult_distrib RS sym]));
  19.143 +    poly_cmult,left_distrib RS sym]));
  19.144  by (res_inst_tac [("x","qa *** q")] exI 1);
  19.145  by (res_inst_tac [("x","p *** qa")] exI 2);
  19.146  by (auto_tac (claset(),simpset() addsimps [poly_add,poly_mult,
  19.147 -    poly_cmult] @ real_mult_ac));
  19.148 +    poly_cmult] @ mult_ac));
  19.149  qed "poly_primes";
  19.150  
  19.151  Goalw [divides_def] "p divides p";
  19.152 @@ -721,7 +720,7 @@
  19.153  by (auto_tac (claset(),simpset() addsimps [divides_def]));
  19.154  by (res_inst_tac [("x","p")] exI 1);
  19.155  by (auto_tac (claset(),simpset() addsimps [poly_mult,fun_eq]
  19.156 -    @ real_mult_ac));
  19.157 +    @ mult_ac));
  19.158  qed "poly_divides_exp";
  19.159  
  19.160  Goal "[| (p %^ n) divides q;  m <= n |] ==> (p %^ m) divides q";
  19.161 @@ -733,7 +732,7 @@
  19.162  by Auto_tac;
  19.163  by (res_inst_tac [("x","qa +++ qaa")] exI 1);
  19.164  by (auto_tac (claset(),simpset() addsimps [poly_add,fun_eq,poly_mult,
  19.165 -    real_add_mult_distrib2]));
  19.166 +    right_distrib]));
  19.167  qed "poly_divides_add";
  19.168  
  19.169  Goalw [divides_def] 
  19.170 @@ -741,14 +740,14 @@
  19.171  by Auto_tac;
  19.172  by (res_inst_tac [("x","qaa +++ -- qa")] exI 1);
  19.173  by (auto_tac (claset(),simpset() addsimps [poly_add,fun_eq,poly_mult,
  19.174 -    poly_minus,real_add_mult_distrib2,
  19.175 +    poly_minus,right_distrib,
  19.176      ARITH_PROVE "(x = y + -z) = (z + x = (y::real))"]));
  19.177  qed "poly_divides_diff";
  19.178  
  19.179  Goal "[| p divides r; p divides (q +++ r) |] ==> p divides q";
  19.180  by (etac poly_divides_diff 1);
  19.181  by (auto_tac (claset(),simpset() addsimps [poly_add,fun_eq,poly_mult,
  19.182 -    divides_def] @ real_add_ac));
  19.183 +    divides_def] @ add_ac));
  19.184  qed "poly_divides_diff2";
  19.185  
  19.186  Goalw [divides_def] "poly p = poly [] ==> q divides p";
  19.187 @@ -793,7 +792,7 @@
  19.188  by (induct_tac "n" 1);
  19.189  by (Simp_tac 1);
  19.190  by (asm_simp_tac (simpset() addsimps [poly_add,poly_cmult,poly_mult,
  19.191 -    real_add_mult_distrib2] @ real_mult_ac) 1);
  19.192 +    right_distrib] @ mult_ac) 1);
  19.193  by (Step_tac 1);
  19.194  by (rotate_tac 2 1);
  19.195  by (rtac swap 1 THEN assume_tac 2);
  19.196 @@ -916,7 +915,7 @@
  19.197  by (Step_tac 1);
  19.198  by (dres_inst_tac [("x","qa")] spec 1);
  19.199  by (auto_tac (claset(),simpset() addsimps [poly_mult,fun_eq,poly_exp] 
  19.200 -    @ real_mult_ac delsimps [pmult_Cons]));
  19.201 +    @ mult_ac delsimps [pmult_Cons]));
  19.202  qed "order_decomp";
  19.203  
  19.204  (* ------------------------------------------------------------------------- *)
  19.205 @@ -934,7 +933,7 @@
  19.206      poly_mult] delsimps [pmult_Cons]) 1);
  19.207  by (Step_tac 1);
  19.208  by (res_inst_tac [("x","qa *** qaa")] exI 1);
  19.209 -by (asm_full_simp_tac (simpset() addsimps [poly_mult] @ real_mult_ac
  19.210 +by (asm_full_simp_tac (simpset() addsimps [poly_mult] @ mult_ac
  19.211      delsimps [pmult_Cons]) 1);
  19.212  by (REPEAT(dres_inst_tac [("a","a")] order_decomp 1));
  19.213  by (Step_tac 1);
  19.214 @@ -955,7 +954,7 @@
  19.215  by (dtac (poly_mult_left_cancel RS iffD1) 1);
  19.216  by (Force_tac 1);
  19.217  by (asm_full_simp_tac (simpset() addsimps [fun_eq,poly_exp_add,poly_mult] 
  19.218 -    @ real_mult_ac delsimps [pmult_Cons]) 1);
  19.219 +    @ mult_ac delsimps [pmult_Cons]) 1);
  19.220  qed "order_mult";
  19.221  
  19.222  (* FIXME: too too long! *)
  19.223 @@ -980,10 +979,10 @@
  19.224      [("x","[-a, 1] *** (pderiv q) +++ real (Suc n) %* q")] exI 1);
  19.225  by (asm_full_simp_tac (simpset() addsimps [poly_pderiv_mult,
  19.226      poly_pderiv_exp_prime,poly_add,poly_mult,poly_cmult,
  19.227 -    real_add_mult_distrib2] @ real_mult_ac
  19.228 +    right_distrib] @ mult_ac
  19.229      delsimps [pmult_Cons,pexp_Suc]) 1);
  19.230 -by (asm_full_simp_tac (simpset() addsimps [poly_mult,real_add_mult_distrib2,
  19.231 -    real_add_mult_distrib] @ real_mult_ac delsimps [pmult_Cons]) 1);
  19.232 +by (asm_full_simp_tac (simpset() addsimps [poly_mult,right_distrib,
  19.233 +    left_distrib] @ mult_ac delsimps [pmult_Cons]) 1);
  19.234  by (thin_tac "ALL r. \
  19.235  \             r divides pderiv p = \
  19.236  \             r divides pderiv ([- a, 1] %^ Suc n *** q)" 1);
  19.237 @@ -1010,11 +1009,11 @@
  19.238  by (Simp_tac 1);
  19.239  by (rtac ((CLAIM_SIMP 
  19.240      "a * (b * (c * (d * e))) = e * (b * (c * (d * (a::real))))" 
  19.241 -     real_mult_ac) RS ssubst) 1);
  19.242 +     mult_ac) RS ssubst) 1);
  19.243  by (rotate_tac 2 1);
  19.244  by (dres_inst_tac [("x","xa")] spec 1);
  19.245  by (asm_full_simp_tac (simpset()
  19.246 -    addsimps [real_add_mult_distrib] @ real_mult_ac
  19.247 +    addsimps [left_distrib] @ mult_ac
  19.248      delsimps [pmult_Cons]) 1);
  19.249  qed_spec_mp "lemma_order_pderiv";
  19.250  
  19.251 @@ -1063,7 +1062,7 @@
  19.252  by (Step_tac 2);
  19.253  by (res_inst_tac [("x","r *** qa +++ s *** qaa")] exI 2);
  19.254  by (asm_full_simp_tac (simpset() addsimps [fun_eq,poly_add,poly_mult,
  19.255 -    real_add_mult_distrib, real_add_mult_distrib2] @ real_mult_ac
  19.256 +    left_distrib, right_distrib] @ mult_ac
  19.257      delsimps [pexp_Suc,pmult_Cons]) 2);
  19.258  by Auto_tac;
  19.259  qed "poly_squarefree_decomp_order";
  19.260 @@ -1199,7 +1198,7 @@
  19.261  by Auto_tac;
  19.262  by (res_inst_tac [("j","abs a + abs(x * poly list x)")] real_le_trans 1);
  19.263  by (rtac abs_triangle_ineq 1);
  19.264 -by (auto_tac (claset() addSIs [real_mult_le_mono],simpset() 
  19.265 +by (auto_tac (claset() addSIs [mult_mono],simpset() 
  19.266      addsimps [abs_mult]));
  19.267  by (arith_tac 1);
  19.268  qed_spec_mp "poly_mono"; 
    20.1 --- a/src/HOL/Hyperreal/SEQ.ML	Mon Dec 29 06:49:26 2003 +0100
    20.2 +++ b/src/HOL/Hyperreal/SEQ.ML	Thu Jan 01 10:06:32 2004 +0100
    20.3 @@ -914,7 +914,7 @@
    20.4   ---------------------------------------------------------*)
    20.5  Goalw [Cauchy_def,Bseq_def] "Cauchy X ==> Bseq X";
    20.6  by (dres_inst_tac [("x","1")] spec 1);
    20.7 -by (etac (real_zero_less_one RSN (2,impE)) 1);
    20.8 +by (etac (zero_less_one RSN (2,impE)) 1);
    20.9  by (Step_tac 1);
   20.10  by (dres_inst_tac [("x","M")] spec 1);
   20.11  by (Asm_full_simp_tac 1);
   20.12 @@ -1126,9 +1126,9 @@
   20.13  by (dres_inst_tac [("x","inverse r")] spec 1 THEN Step_tac 1);
   20.14  by (res_inst_tac [("x","N")] exI 1 THEN Step_tac 1);
   20.15  by (dtac spec 1 THEN Auto_tac);
   20.16 -by (ftac real_inverse_gt_0 1);
   20.17 +by (ftac positive_imp_inverse_positive 1);
   20.18  by (ftac order_less_trans 1 THEN assume_tac 1);
   20.19 -by (forw_inst_tac [("x","f n")] real_inverse_gt_0 1);
   20.20 +by (forw_inst_tac [("a","f n")] positive_imp_inverse_positive 1);
   20.21  by (asm_simp_tac (simpset() addsimps [abs_eqI2]) 1);
   20.22  by (res_inst_tac [("t","r")] (inverse_inverse_eq RS subst) 1);
   20.23  by (auto_tac (claset() addIs [inverse_less_iff_less RS iffD2], 
    21.1 --- a/src/HOL/Hyperreal/Series.ML	Mon Dec 29 06:49:26 2003 +0100
    21.2 +++ b/src/HOL/Hyperreal/Series.ML	Thu Jan 01 10:06:32 2004 +0100
    21.3 @@ -30,14 +30,14 @@
    21.4  
    21.5  Goal "sumr m n f + sumr m n g = sumr m n (%n. f n + g n)";
    21.6  by (induct_tac "n" 1);
    21.7 -by (auto_tac (claset(),simpset() addsimps real_add_ac));
    21.8 +by (auto_tac (claset(),simpset() addsimps add_ac));
    21.9  qed "sumr_add";
   21.10  
   21.11  Goal "r * sumr m n f = sumr m n (%n. r * f n)";
   21.12  by (induct_tac "n" 1);
   21.13  by (Auto_tac);
   21.14  by (auto_tac (claset(),simpset() addsimps 
   21.15 -    [real_add_mult_distrib2]));
   21.16 +    [right_distrib]));
   21.17  qed "sumr_mult";
   21.18  
   21.19  Goal "n < p --> sumr 0 n f + sumr n p f = sumr 0 p f";
   21.20 @@ -49,7 +49,7 @@
   21.21  Goal "n < p ==> sumr 0 p f + \
   21.22  \                - sumr 0 n f = sumr n p f";
   21.23  by (dres_inst_tac [("f1","f")] (sumr_split_add RS sym) 1);
   21.24 -by (asm_simp_tac (simpset() addsimps real_add_ac) 1);
   21.25 +by (asm_simp_tac (simpset() addsimps add_ac) 1);
   21.26  qed "sumr_split_add_minus";
   21.27  
   21.28  Goal "0 < n --> n < p --> sumr (Suc 0) n f + sumr n p f = sumr (Suc 0) p f";
   21.29 @@ -66,7 +66,7 @@
   21.30  Goal "abs(sumr m n f) <= sumr m n (%i. abs(f i))";
   21.31  by (induct_tac "n" 1);
   21.32  by (auto_tac (claset() addIs [abs_triangle_ineq RS order_trans,
   21.33 -                              real_add_le_mono1], 
   21.34 +                              add_right_mono], 
   21.35                simpset()));
   21.36  qed "sumr_rabs";
   21.37  
   21.38 @@ -79,13 +79,13 @@
   21.39  Goal "sumr 0 n (%i. r) = real n * r";
   21.40  by (induct_tac "n" 1);
   21.41  by (auto_tac (claset(),
   21.42 -              simpset() addsimps [real_add_mult_distrib,real_of_nat_zero,
   21.43 +              simpset() addsimps [left_distrib,real_of_nat_zero,
   21.44                                    real_of_nat_Suc]));
   21.45  qed "sumr_const";
   21.46  Addsimps [sumr_const];
   21.47  
   21.48  Goal "sumr 0 n f + -(real n * r) = sumr 0 n (%i. f i + -r)";
   21.49 -by (full_simp_tac (HOL_ss addsimps [sumr_add RS sym, real_minus_mult_eq2]) 1);
   21.50 +by (full_simp_tac (HOL_ss addsimps [sumr_add RS sym, minus_mult_right]) 1);
   21.51  by (Simp_tac 1);
   21.52  qed "sumr_add_mult_const";
   21.53  
   21.54 @@ -103,8 +103,7 @@
   21.55  Goal "sumr m n (%i. - f i) = - sumr m n f";
   21.56  by (induct_tac "n" 1);
   21.57  by (case_tac "Suc n <= m" 2);
   21.58 -by (auto_tac (claset(),simpset() addsimps 
   21.59 -    [real_minus_add_distrib]));
   21.60 +by (auto_tac (claset(),simpset() addsimps [minus_add_distrib]));
   21.61  qed "sumr_minus";
   21.62  
   21.63  Goal "sumr (m+k) (n+k) f = sumr m n (%i. f(i + k))";
   21.64 @@ -131,7 +130,7 @@
   21.65  by (Step_tac 1);
   21.66  by (dres_inst_tac [("x","n")] spec 3);
   21.67  by (auto_tac (claset() addSDs [le_imp_less_or_eq], simpset()));
   21.68 -by (asm_simp_tac (simpset() addsimps [real_add_mult_distrib, Suc_diff_n,
   21.69 +by (asm_simp_tac (simpset() addsimps [left_distrib, Suc_diff_n,
   21.70                                        real_of_nat_Suc]) 1);
   21.71  qed_spec_mp "sumr_interval_const";
   21.72  
   21.73 @@ -144,7 +143,7 @@
   21.74  by (dres_inst_tac [("x","n")] spec 3);
   21.75  by (auto_tac (claset() addSDs [le_imp_less_or_eq],
   21.76      simpset()));
   21.77 -by (asm_simp_tac (simpset() addsimps [Suc_diff_n, real_add_mult_distrib,
   21.78 +by (asm_simp_tac (simpset() addsimps [Suc_diff_n, left_distrib,
   21.79                                        real_of_nat_Suc]) 1);
   21.80  qed_spec_mp "sumr_interval_const2";
   21.81  
   21.82 @@ -155,15 +154,15 @@
   21.83  by (ALLGOALS(dres_inst_tac [("x","n")] spec));
   21.84  by (Step_tac 1);
   21.85  by (dtac le_imp_less_or_eq 1 THEN Step_tac 1);
   21.86 -by (dtac real_add_le_mono 2);
   21.87 -by (dres_inst_tac [("i","sumr 0 m f")] (order_refl RS real_add_le_mono) 1);
   21.88 +by (dres_inst_tac [("a","sumr 0 m f")] add_mono 2);
   21.89 +by (dres_inst_tac [("a","sumr 0 m f")] (order_refl RS add_mono) 1);
   21.90  by (Auto_tac);
   21.91  qed_spec_mp "sumr_le";
   21.92  
   21.93  Goal "!!f g. (ALL r. m <= r & r < n --> f r <= g r) \
   21.94  \                --> sumr m n f <= sumr m n g";
   21.95  by (induct_tac "n" 1);
   21.96 -by (auto_tac (claset() addIs [real_add_le_mono],
   21.97 +by (auto_tac (claset() addIs [add_mono],
   21.98      simpset() addsimps [le_def]));
   21.99  qed_spec_mp "sumr_le2";
  21.100  
  21.101 @@ -228,15 +227,15 @@
  21.102  Goal "(ALL p. m <= p & p < m + n --> (f(p) <= K)) \
  21.103  \     --> (sumr m (m + n) f <= (real n * K))";
  21.104  by (induct_tac "n" 1);
  21.105 -by (auto_tac (claset() addIs [real_add_le_mono],
  21.106 -              simpset() addsimps [real_add_mult_distrib, real_of_nat_Suc]));
  21.107 +by (auto_tac (claset() addIs [add_mono],
  21.108 +              simpset() addsimps [left_distrib, real_of_nat_Suc]));
  21.109  qed_spec_mp "sumr_bound";
  21.110  
  21.111  Goal "(ALL p. 0 <= p & p < n --> (f(p) <= K)) \
  21.112  \     --> (sumr 0 n f <= (real n * K))";
  21.113  by (induct_tac "n" 1);
  21.114 -by (auto_tac (claset() addIs [real_add_le_mono],
  21.115 -        simpset() addsimps [real_add_mult_distrib, real_of_nat_Suc]));
  21.116 +by (auto_tac (claset() addIs [add_mono],
  21.117 +        simpset() addsimps [left_distrib, real_of_nat_Suc]));
  21.118  qed_spec_mp "sumr_bound2";
  21.119  
  21.120  Goal "sumr 0 n (%m. sumr (m * k) (m*k + k) f) = sumr 0 (n * k) f";
  21.121 @@ -358,7 +357,7 @@
  21.122  by (auto_tac (claset(),simpset() addsimps [sums_def,LIMSEQ_def]));
  21.123  by (dres_inst_tac [("x","f(n) + f(n + 1)")] spec 1);
  21.124  by (Auto_tac);
  21.125 -by (rtac ccontr 2 THEN dtac real_leI 2);
  21.126 +by (rtac ccontr 2 THEN dtac (linorder_not_less RS iffD1) 2);
  21.127  by (subgoal_tac "sumr 0 (n + Suc (Suc 0)) f <= sumr 0 (Suc (Suc 0) * (Suc no) + n) f" 2);
  21.128  by (induct_tac "no" 3 THEN Simp_tac 3);
  21.129  by (res_inst_tac [("y","sumr 0 (Suc (Suc 0)*(Suc na)+n) f")] order_trans 3);
  21.130 @@ -419,9 +418,9 @@
  21.131  by (Auto_tac);
  21.132  by (res_inst_tac [("c1","x - 1")] (real_mult_right_cancel RS iffD1) 1);
  21.133  by (auto_tac (claset(),
  21.134 -       simpset() addsimps [real_mult_assoc, real_add_mult_distrib]));
  21.135 +       simpset() addsimps [real_mult_assoc, left_distrib]));
  21.136  by (auto_tac (claset(),
  21.137 -       simpset() addsimps [real_add_mult_distrib2,
  21.138 +       simpset() addsimps [right_distrib,
  21.139                             real_diff_def, real_mult_commute]));
  21.140  qed "sumr_geometric";
  21.141  
  21.142 @@ -429,7 +428,7 @@
  21.143  by (case_tac "x = 1" 1);
  21.144  by (auto_tac (claset() addSDs [LIMSEQ_rabs_realpow_zero2],
  21.145               simpset() addsimps [sumr_geometric ,sums_def,
  21.146 -                                 real_diff_def, real_add_divide_distrib]));
  21.147 +                                 real_diff_def, add_divide_distrib]));
  21.148  by (subgoal_tac "1 / (1 + -x) = 0/(x - 1) + - 1/(x - 1)" 1); 
  21.149  by (asm_full_simp_tac (simpset() addsimps [thm"minus_divide_right"]) 2); 
  21.150  by (etac ssubst 1); 
  21.151 @@ -542,7 +541,7 @@
  21.152  by Auto_tac;  
  21.153  by (subgoal_tac "0 <= c * abs y" 1);
  21.154  by (arith_tac 2);
  21.155 -by (asm_full_simp_tac (simpset() addsimps [real_0_le_mult_iff]) 1); 
  21.156 +by (asm_full_simp_tac (simpset() addsimps [zero_le_mult_iff]) 1); 
  21.157  qed "rabs_ratiotest_lemma";
  21.158  
  21.159  (* lemmas *)
  21.160 @@ -579,9 +578,9 @@
  21.161  by (auto_tac (claset(),simpset() addsimps [realpow_add, realpow_not_zero]));
  21.162  by (induct_tac "na" 1 THEN Auto_tac);
  21.163  by (res_inst_tac [("y","c*abs(f(N + n))")] order_trans 1);
  21.164 -by (auto_tac (claset() addIs [real_mult_le_mono1],
  21.165 +by (auto_tac (claset() addIs [mult_right_mono],
  21.166                simpset() addsimps [summable_def]));
  21.167 -by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 1);
  21.168 +by (asm_full_simp_tac (simpset() addsimps mult_ac) 1);
  21.169  by (res_inst_tac [("x","abs(f N) * (1/(1 - c)) / (c ^ N)")] exI 1);
  21.170  by (rtac sums_divide 1); 
  21.171  by (rtac sums_mult 1); 
    22.1 --- a/src/HOL/Hyperreal/Transcendental.ML	Mon Dec 29 06:49:26 2003 +0100
    22.2 +++ b/src/HOL/Hyperreal/Transcendental.ML	Thu Jan 01 10:06:32 2004 +0100
    22.3 @@ -35,7 +35,7 @@
    22.4       "0 < x ==> root(Suc n) (x ^ (Suc n)) = x";
    22.5  by (rtac some_equality 1);
    22.6  by (forw_inst_tac [("n","n")] realpow_gt_zero 2);
    22.7 -by (auto_tac (claset(),simpset() addsimps [real_0_less_mult_iff]));
    22.8 +by (auto_tac (claset(),simpset() addsimps [zero_less_mult_iff]));
    22.9  by (res_inst_tac [("R1.0","u"),("R2.0","x")] real_linear_less2 1);
   22.10  by (dres_inst_tac [("n1","n"),("x","u")] (zero_less_Suc RSN  (3, realpow_less)) 1);
   22.11  by (dres_inst_tac [("n1","n"),("x","x")] (zero_less_Suc RSN (3, realpow_less)) 4);
   22.12 @@ -52,7 +52,7 @@
   22.13  by (dres_inst_tac [("n","n")] realpow_pos_nth2 1);
   22.14  by (Safe_tac THEN rtac someI2 1);
   22.15  by (auto_tac (claset() addSIs [order_less_imp_le] 
   22.16 -    addDs [realpow_gt_zero],simpset() addsimps [real_0_less_mult_iff]));
   22.17 +    addDs [realpow_gt_zero],simpset() addsimps [zero_less_mult_iff]));
   22.18  qed "real_root_pos_pos";
   22.19  
   22.20  Goal "0 <= x ==> 0 <= root(Suc n) x";
   22.21 @@ -151,7 +151,7 @@
   22.22  by (cut_inst_tac [("x","x"),("y","0")] linorder_less_linear 1);
   22.23  by Auto_tac;
   22.24  by (ftac (real_mult_order) 2);
   22.25 -by (asm_full_simp_tac (simpset() addsimps [real_0_less_mult_iff]) 1); 
   22.26 +by (asm_full_simp_tac (simpset() addsimps [zero_less_mult_iff]) 1); 
   22.27  by Auto_tac;
   22.28  qed "not_real_square_gt_zero";
   22.29  Addsimps [not_real_square_gt_zero];
   22.30 @@ -171,7 +171,7 @@
   22.31  by (Asm_full_simp_tac 1 THEN Asm_full_simp_tac 1);
   22.32  by (res_inst_tac [("a","xa * x")] someI2 1);
   22.33  by (auto_tac (claset() addEs [real_less_asym],
   22.34 -    simpset() addsimps real_mult_ac@[realpow_mult RS sym,realpow_two_disj,
   22.35 +    simpset() addsimps mult_ac@[realpow_mult RS sym,realpow_two_disj,
   22.36      realpow_gt_zero, real_mult_order] delsimps [realpow_Suc]));
   22.37  qed "real_sqrt_mult_distrib";
   22.38  
   22.39 @@ -204,14 +204,14 @@
   22.40  
   22.41  Goal "0 <= sqrt ((x ^ 2 + y ^ 2)*(xa ^ 2 + ya ^ 2))";
   22.42  by (auto_tac (claset() addSIs [real_sqrt_ge_zero],simpset() 
   22.43 -    addsimps [real_0_le_mult_iff]));
   22.44 +    addsimps [zero_le_mult_iff]));
   22.45  qed "real_sqrt_sum_squares_mult_ge_zero";
   22.46  Addsimps [real_sqrt_sum_squares_mult_ge_zero];
   22.47  
   22.48  Goal "sqrt ((x ^ 2 + y ^ 2) * (xa ^ 2 + ya ^ 2)) ^ 2 = \
   22.49  \     (x ^ 2 + y ^ 2) * (xa ^ 2 + ya ^ 2)";
   22.50  by (auto_tac (claset(),simpset() addsimps [real_sqrt_pow2_iff,
   22.51 -    real_0_le_mult_iff] delsimps [realpow_Suc]));
   22.52 +    zero_le_mult_iff] delsimps [realpow_Suc]));
   22.53  qed "real_sqrt_sum_squares_mult_squared_eq";
   22.54  Addsimps [real_sqrt_sum_squares_mult_squared_eq];
   22.55  
   22.56 @@ -283,21 +283,21 @@
   22.57  (*-------------------------------------------------------------------------*)
   22.58  
   22.59  Goal "summable (%n. inverse (real (fact n)) * x ^ n)";
   22.60 -by (cut_facts_tac [real_zero_less_one RS real_dense] 1);
   22.61 +by (cut_facts_tac [zero_less_one RS real_dense] 1);
   22.62  by (Step_tac 1);
   22.63  by (cut_inst_tac [("x","r")] reals_Archimedean3 1);
   22.64  by Auto_tac;
   22.65  by (dres_inst_tac [("x","abs x")] spec 1 THEN Safe_tac);
   22.66  by (res_inst_tac [("N","n"),("c","r")] ratio_test 1);
   22.67 -by (auto_tac (claset(),simpset() addsimps [abs_mult,real_mult_assoc RS sym]
   22.68 -    delsimps [fact_Suc]));
   22.69 -by (rtac real_mult_le_le_mono2 1);
   22.70 -by (res_inst_tac [("b1","abs x")] (mult_commute RS ssubst) 2);
   22.71 -by (stac fact_Suc 2);
   22.72 -by (stac real_of_nat_mult 2);
   22.73 -by (auto_tac (claset(),simpset() addsimps [abs_mult,real_inverse_distrib]));
   22.74 +by (auto_tac (claset(),
   22.75 +     simpset() addsimps [abs_mult,mult_assoc RS sym] delsimps [fact_Suc]));
   22.76 +by (rtac mult_right_mono 1);
   22.77 +by (res_inst_tac [("b1","abs x")] (mult_commute RS ssubst) 1);
   22.78 +by (stac fact_Suc 1);
   22.79 +by (stac real_of_nat_mult 1);
   22.80 +by (auto_tac (claset(),simpset() addsimps [abs_mult,inverse_mult_distrib]));
   22.81  by (auto_tac (claset(), simpset() addsimps 
   22.82 -     [mult_assoc RS sym, abs_eqI2, real_inverse_gt_0]));
   22.83 +     [mult_assoc RS sym, abs_eqI2, positive_imp_inverse_positive]));
   22.84  by (rtac order_less_imp_le 1);
   22.85  by (res_inst_tac [("z1","real (Suc na)")] (real_mult_less_iff1
   22.86      RS iffD1) 1);
   22.87 @@ -321,9 +321,9 @@
   22.88  by (rtac summable_exp 2);
   22.89  by (res_inst_tac [("x","0")] exI 1);
   22.90  by (auto_tac (claset(), simpset() addsimps [realpow_abs RS sym,
   22.91 -    abs_mult,real_0_le_mult_iff]));
   22.92 -by (auto_tac (claset() addIs [real_mult_le_le_mono2],
   22.93 -    simpset() addsimps [real_inverse_gt_0,abs_eqI2]));
   22.94 +    abs_mult,zero_le_mult_iff]));
   22.95 +by (auto_tac (claset() addIs [mult_right_mono],
   22.96 +    simpset() addsimps [positive_imp_inverse_positive,abs_eqI2]));
   22.97  qed "summable_sin";
   22.98  
   22.99  Goalw [real_divide_def] 
  22.100 @@ -335,9 +335,9 @@
  22.101  by (rtac summable_exp 2);
  22.102  by (res_inst_tac [("x","0")] exI 1);
  22.103  by (auto_tac (claset(), simpset() addsimps [realpow_abs RS sym,abs_mult,
  22.104 -    real_0_le_mult_iff]));
  22.105 -by (auto_tac (claset() addSIs [real_mult_le_le_mono2],
  22.106 -    simpset() addsimps [real_inverse_gt_0,abs_eqI2]));
  22.107 +    zero_le_mult_iff]));
  22.108 +by (auto_tac (claset() addSIs [mult_right_mono],
  22.109 +    simpset() addsimps [positive_imp_inverse_positive,abs_eqI2]));
  22.110  qed "summable_cos";
  22.111  
  22.112  Goal "(if even n then 0 \
  22.113 @@ -408,7 +408,7 @@
  22.114  by (rtac sumr_subst 1);
  22.115  by (strip_tac 1);
  22.116  by (stac lemma_realpow_diff 1);
  22.117 -by (auto_tac (claset(),simpset() addsimps real_mult_ac));
  22.118 +by (auto_tac (claset(),simpset() addsimps mult_ac));
  22.119  qed "lemma_realpow_diff_sumr";
  22.120  
  22.121  Goal "x ^ (Suc n) - y ^ (Suc n) = \
  22.122 @@ -418,8 +418,8 @@
  22.123  by (stac sumr_Suc 1);
  22.124  by (dtac sym 1);
  22.125  by (auto_tac (claset(),simpset() addsimps [lemma_realpow_diff_sumr,
  22.126 -    real_add_mult_distrib2,real_diff_def] @ 
  22.127 -    real_mult_ac delsimps [sumr_Suc]));
  22.128 +    right_distrib,real_diff_def] @ 
  22.129 +    mult_ac delsimps [sumr_Suc]));
  22.130  qed "lemma_realpow_diff_sumr2";
  22.131  
  22.132  Goal "sumr 0 (Suc n) (%p. (x ^ p) * (y ^ (n - p))) = \
  22.133 @@ -428,8 +428,8 @@
  22.134  by (auto_tac (claset(),simpset() addsimps [real_mult_commute,
  22.135      realpow_add RS sym] delsimps [sumr_Suc]));
  22.136  by (res_inst_tac [("c1","x - y")] (real_mult_left_cancel RS iffD1) 1);
  22.137 -by (rtac (real_minus_minus RS subst) 2);
  22.138 -by (stac real_minus_mult_eq1 2);
  22.139 +by (rtac (minus_minus RS subst) 2);
  22.140 +by (stac minus_mult_left 2);
  22.141  by (auto_tac (claset(),simpset() addsimps [lemma_realpow_diff_sumr2 
  22.142      RS sym] delsimps [sumr_Suc]));
  22.143  qed "lemma_realpow_rev_sumr";
  22.144 @@ -460,12 +460,11 @@
  22.145  by (auto_tac (claset(),
  22.146      simpset() addsimps [real_mult_assoc,realpow_abs]));
  22.147  by (dres_inst_tac [("x","0")] spec 2 THEN Force_tac 2); 
  22.148 -by (auto_tac (claset(),simpset() addsimps [abs_mult,realpow_abs] @ real_mult_ac));
  22.149 +by (auto_tac (claset(),simpset() addsimps [abs_mult,realpow_abs] @ mult_ac));
  22.150  by (res_inst_tac [("a2","z ^ n")] (abs_ge_zero RS real_le_imp_less_or_eq
  22.151      RS disjE) 1 THEN dtac sym 2);
  22.152 -by (auto_tac (claset() addSIs [real_mult_le_le_mono2],
  22.153 -    simpset() addsimps [real_mult_assoc RS sym,
  22.154 -    realpow_abs,summable_def]));
  22.155 +by (auto_tac (claset() addSIs [mult_right_mono],
  22.156 +    simpset() addsimps [mult_assoc RS sym, realpow_abs,summable_def]));
  22.157  by (res_inst_tac [("x","K * inverse(1 - (abs(z) * inverse(abs x)))")] exI 1);
  22.158  by (auto_tac (claset() addSIs [sums_mult],simpset() addsimps [real_mult_assoc]));
  22.159  by (subgoal_tac 
  22.160 @@ -543,9 +542,9 @@
  22.161  \       sumr 0 m (%p. (z ^ p) * \
  22.162  \       (((z + h) ^ (m - p)) - (z ^ (m - p))))";
  22.163  by (rtac sumr_subst 1);
  22.164 -by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib2,
  22.165 +by (auto_tac (claset(),simpset() addsimps [right_distrib,
  22.166      real_diff_def,realpow_add RS sym] 
  22.167 -    @ real_mult_ac));
  22.168 +    @ mult_ac));
  22.169  qed "lemma_termdiff1";
  22.170  
  22.171  (* proved elsewhere? *)
  22.172 @@ -563,23 +562,23 @@
  22.173  \              sumr 0 ((n - Suc 0) - p) \
  22.174  \                (%q. ((z + h) ^ q) * (z ^ (((n - 2) - p) - q))))";
  22.175  by (rtac (real_mult_left_cancel RS iffD1) 1 THEN Asm_simp_tac 1);
  22.176 -by (asm_full_simp_tac (simpset() addsimps [real_diff_mult_distrib2]
  22.177 -    @ real_mult_ac) 1);
  22.178 +by (asm_full_simp_tac (simpset() addsimps [right_diff_distrib]
  22.179 +    @ mult_ac) 1);
  22.180  by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc RS sym]) 1);
  22.181  by (case_tac "n" 1 THEN auto_tac (claset(),simpset() 
  22.182      addsimps [lemma_realpow_diff_sumr2,
  22.183 -    real_diff_mult_distrib2 RS sym,real_mult_assoc] 
  22.184 +    right_diff_distrib RS sym,real_mult_assoc] 
  22.185      delsimps [realpow_Suc,sumr_Suc]));
  22.186  by (auto_tac (claset(),simpset() addsimps [lemma_realpow_rev_sumr]
  22.187      delsimps [sumr_Suc]));
  22.188  by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc,sumr_diff_mult_const,
  22.189 -    real_add_mult_distrib,CLAIM "(a + b) - (c + d) = a - c + b - (d::real)",
  22.190 +    left_distrib,CLAIM "(a + b) - (c + d) = a - c + b - (d::real)",
  22.191      lemma_termdiff1,sumr_mult]));
  22.192  by (auto_tac (claset() addSIs [sumr_subst],simpset() addsimps 
  22.193      [real_diff_def,real_add_assoc]));
  22.194  by (fold_tac [real_diff_def] THEN dtac less_add_one 1);
  22.195  by (auto_tac (claset(),simpset() addsimps [sumr_mult,lemma_realpow_diff_sumr2] 
  22.196 -    @ real_mult_ac delsimps [sumr_Suc,realpow_Suc]));
  22.197 +    @ mult_ac delsimps [sumr_Suc,realpow_Suc]));
  22.198  qed "lemma_termdiff2";
  22.199  
  22.200  Goal "[| h ~= 0; abs z <= K; abs (z + h) <= K |] \
  22.201 @@ -595,9 +594,9 @@
  22.202  by (case_tac "n" 1 THEN Auto_tac);
  22.203  by (dtac less_add_one 1);
  22.204  by (auto_tac (claset(),simpset() addsimps [realpow_add,real_add_assoc RS sym,
  22.205 -    CLAIM_SIMP "(a * b) * c = a * (c * (b::real))" real_mult_ac] 
  22.206 +    CLAIM_SIMP "(a * b) * c = a * (c * (b::real))" mult_ac] 
  22.207      delsimps [sumr_Suc]));
  22.208 -by (auto_tac (claset() addSIs [real_mult_le_mono],simpset()delsimps [sumr_Suc])); 
  22.209 +by (auto_tac (claset() addSIs [mult_mono],simpset()delsimps [sumr_Suc])); 
  22.210  by (auto_tac (claset() addSIs [realpow_le2],simpset() addsimps 
  22.211      [realpow_abs] delsimps [sumr_Suc] ));
  22.212  by (res_inst_tac [("j","real (Suc d) * (K ^ d)")] real_le_trans 1);
  22.213 @@ -606,8 +605,9 @@
  22.214  by (dres_inst_tac [("n","d")] realpow_ge_zero2 2);
  22.215  by (auto_tac (claset(),simpset() delsimps [sumr_Suc] ));
  22.216  by (rtac (sumr_rabs RS real_le_trans) 1);
  22.217 -by (rtac sumr_bound2 1 THEN auto_tac (claset() addSDs [less_add_one]
  22.218 -    addSIs [real_mult_le_mono],simpset() addsimps [abs_mult, realpow_add]));
  22.219 +by (rtac sumr_bound2 1 THEN 
  22.220 +    auto_tac (claset() addSDs [less_add_one]
  22.221 +    addSIs [mult_mono], simpset() addsimps [abs_mult, realpow_add]));
  22.222  by (auto_tac (claset() addSIs [realpow_le2,realpow_ge_zero],simpset() addsimps 
  22.223      [realpow_abs]));
  22.224  by (ALLGOALS(arith_tac));
  22.225 @@ -632,8 +632,8 @@
  22.226  by (REPEAT(rtac (real_mult_order) 2));
  22.227  by (dres_inst_tac [("d1.0","r * inverse K * inverse 2"),("d2.0","k")]
  22.228      real_lbound_gt_zero 1);
  22.229 -by (auto_tac (claset(),simpset() addsimps [real_inverse_gt_0,
  22.230 -    real_0_less_mult_iff]));
  22.231 +by (auto_tac (claset(),simpset() addsimps [positive_imp_inverse_positive,
  22.232 +    zero_less_mult_iff]));
  22.233  by (rtac real_le_trans 2 THEN assume_tac 3 THEN Auto_tac);
  22.234  by (res_inst_tac [("x","e")] exI 1 THEN Auto_tac);
  22.235  by (res_inst_tac [("y","K * abs x")] order_le_less_trans 1);
  22.236 @@ -659,7 +659,7 @@
  22.237  by (simp_tac (simpset() addsimps [summable_def]) 3);
  22.238  by (res_inst_tac [("x","suminf f * abs h")] exI 3);
  22.239  by (dres_inst_tac [("c","abs h")] sums_mult 3);
  22.240 -by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 3);
  22.241 +by (asm_full_simp_tac (simpset() addsimps mult_ac) 3);
  22.242  by (subgoal_tac "summable (%n. abs(g(h::real)(n::nat)))" 2);
  22.243  by (res_inst_tac [("g","%n. f(n::nat) * abs(h)")] summable_comparison_test 3);
  22.244  by (res_inst_tac [("x","0")] exI 3);
  22.245 @@ -701,7 +701,7 @@
  22.246      ("c","inverse xa")] sums_mult 1);
  22.247  by (rtac (sums_unique RS sym) 1);
  22.248  by (asm_full_simp_tac (simpset() addsimps [real_diff_def,
  22.249 -    real_divide_def] @ real_add_ac @ real_mult_ac) 1);
  22.250 +    real_divide_def] @ add_ac @ mult_ac) 1);
  22.251  by (rtac LIM_zero_cancel 1);
  22.252  by (res_inst_tac [("g","%h. suminf (%n. c(n) * (((((x + h) ^ n) - \
  22.253  \   (x ^ n)) * inverse  h) - (real n * (x ^ (n - Suc 0)))))")] LIM_trans 1);
  22.254 @@ -728,7 +728,7 @@
  22.255  by (forw_inst_tac [("x","(%n. c n * (xa + x) ^ n)"),
  22.256      ("y","(%n. c n * x ^ n)")] sums_diff 1 THEN assume_tac 1);
  22.257  by (asm_full_simp_tac (simpset() addsimps [[sums_summable,sums_summable] 
  22.258 -    MRS suminf_diff,real_diff_mult_distrib2 RS sym]) 1);
  22.259 +    MRS suminf_diff,right_diff_distrib RS sym]) 1);
  22.260  by (forw_inst_tac [("x","(%n. c n * ((xa + x) ^ n - x ^ n))"),
  22.261      ("c","inverse xa")] sums_mult 1);
  22.262  by (asm_full_simp_tac (simpset() addsimps [sums_summable RS suminf_mult2]) 1);
  22.263 @@ -737,11 +737,11 @@
  22.264  by (assume_tac 1);
  22.265  by (rtac (ARITH_PROVE "z - y = x ==> - x = (y::real) - z") 1);
  22.266  by (asm_full_simp_tac (simpset() addsimps [[sums_summable,sums_summable] 
  22.267 -    MRS suminf_diff] @ real_add_ac @ real_mult_ac ) 1);
  22.268 +    MRS suminf_diff] @ add_ac @ mult_ac ) 1);
  22.269  by (res_inst_tac [("f","suminf")] arg_cong 1);
  22.270  by (rtac ext 1);
  22.271  by (asm_full_simp_tac (simpset() addsimps [real_diff_def,
  22.272 -     real_add_mult_distrib2] @ real_add_ac @ real_mult_ac) 1);
  22.273 +     right_distrib] @ add_ac @ mult_ac) 1);
  22.274  (* 46 *)
  22.275  by (dtac real_dense 1 THEN Step_tac 1);
  22.276  by (ftac (real_less_sum_gt_zero) 1);
  22.277 @@ -766,7 +766,7 @@
  22.278      THEN asm_full_simp_tac (simpset() addsimps [diffs_def]) 2);
  22.279  by (dtac diffs_equiv 1);
  22.280  by (dtac sums_summable 1);
  22.281 -by (asm_full_simp_tac (simpset() addsimps [diffs_def] @ real_mult_ac) 1);
  22.282 +by (asm_full_simp_tac (simpset() addsimps [diffs_def] @ mult_ac) 1);
  22.283  by (subgoal_tac "(%n. real n * (real (Suc n) * (abs(c(Suc n)) * \
  22.284  \                 (r ^ (n - Suc 0))))) = (%n. diffs(%m. real (m - Suc 0) * \
  22.285  \                  abs(c m) * inverse r) n * (r ^ n))" 1);
  22.286 @@ -777,7 +777,7 @@
  22.287  by Auto_tac;
  22.288  (* 69 *)
  22.289  by (dtac (abs_ge_zero RS order_le_less_trans) 2);
  22.290 -by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 2);
  22.291 +by (asm_full_simp_tac (simpset() addsimps mult_ac) 2);
  22.292  by (dtac diffs_equiv 1);
  22.293  by (dtac sums_summable 1);
  22.294  by (res_inst_tac [("a","summable (%n. real n * \
  22.295 @@ -785,7 +785,7 @@
  22.296      (CLAIM "(a = b) ==> a ==> b") 1  THEN assume_tac 2);
  22.297  by (res_inst_tac [("f","summable")] arg_cong 1 THEN rtac ext 1);
  22.298  by (dtac (abs_ge_zero RS order_le_less_trans) 2);
  22.299 -by (asm_full_simp_tac (simpset() addsimps real_mult_ac) 2);
  22.300 +by (asm_full_simp_tac (simpset() addsimps mult_ac) 2);
  22.301  (* 77 *)
  22.302  by (case_tac "n" 1);
  22.303  by Auto_tac;
  22.304 @@ -794,13 +794,13 @@
  22.305  by (dtac (abs_ge_zero RS order_le_less_trans) 1);
  22.306  by (auto_tac (claset(),simpset() addsimps [CLAIM_SIMP 
  22.307      "(a::real) * (b * (c * d)) = a * (b * c) * d"
  22.308 -     real_mult_ac]));
  22.309 +     mult_ac]));
  22.310  by (dtac (abs_ge_zero RS order_le_less_trans) 1);
  22.311  by (asm_full_simp_tac (simpset() addsimps [abs_mult,real_mult_assoc]) 1);
  22.312 -by (rtac real_mult_le_le_mono1 1);
  22.313 -by (rtac (real_add_commute RS subst) 2);
  22.314 -by (simp_tac (simpset() addsimps [real_mult_assoc RS sym]) 2);
  22.315 -by (rtac lemma_termdiff3 2);
  22.316 +by (rtac mult_left_mono 1);
  22.317 +by (rtac (add_commute RS subst) 1);
  22.318 +by (simp_tac (simpset() addsimps [mult_assoc RS sym]) 1);
  22.319 +by (rtac lemma_termdiff3 1);
  22.320  by (auto_tac (claset() addIs [(abs_triangle_ineq RS real_le_trans)],
  22.321      simpset()));
  22.322  by (arith_tac 1);
  22.323 @@ -815,7 +815,7 @@
  22.324  by (rtac ext 1);
  22.325  by (stac fact_Suc 1);
  22.326  by (stac real_of_nat_mult 1);
  22.327 -by (stac real_inverse_distrib 1);
  22.328 +by (stac inverse_mult_distrib 1);
  22.329  by (auto_tac (claset(),simpset() addsimps [real_mult_assoc RS sym]));
  22.330  qed "exp_fdiffs";
  22.331  
  22.332 @@ -829,7 +829,7 @@
  22.333  by (stac fact_Suc 1);
  22.334  by (stac real_of_nat_mult 1);
  22.335  by (stac even_Suc 1);
  22.336 -by (stac real_inverse_distrib 1);
  22.337 +by (stac inverse_mult_distrib 1);
  22.338  by Auto_tac;
  22.339  qed "sin_fdiffs";
  22.340  
  22.341 @@ -842,7 +842,7 @@
  22.342  by (stac fact_Suc 1);
  22.343  by (stac real_of_nat_mult 1);
  22.344  by (stac even_Suc 1);
  22.345 -by (stac real_inverse_distrib 1);
  22.346 +by (stac inverse_mult_distrib 1);
  22.347  by Auto_tac;
  22.348  qed "sin_fdiffs2";
  22.349  
  22.350 @@ -856,7 +856,7 @@
  22.351  by (stac fact_Suc 1);
  22.352  by (stac real_of_nat_mult 1);
  22.353  by (stac even_Suc 1);
  22.354 -by (stac real_inverse_distrib 1);
  22.355 +by (stac inverse_mult_distrib 1);
  22.356  by (res_inst_tac [("z1","real (Suc n)")] (real_mult_commute RS ssubst) 1);
  22.357  by (res_inst_tac [("z1","inverse(real (Suc n))")] 
  22.358       (real_mult_commute RS ssubst) 1);
  22.359 @@ -873,7 +873,7 @@
  22.360  by (stac fact_Suc 1);
  22.361  by (stac real_of_nat_mult 1);
  22.362  by (stac even_Suc 1);
  22.363 -by (stac real_inverse_distrib 1);
  22.364 +by (stac inverse_mult_distrib 1);
  22.365  by (res_inst_tac [("z1","real (Suc n)")] (real_mult_commute RS ssubst) 1);
  22.366  by (res_inst_tac [("z1","inverse (real (Suc n))")] 
  22.367       (real_mult_commute RS ssubst) 1);
  22.368 @@ -932,7 +932,7 @@
  22.369  Goal "DERIV cos x :> -sin(x)";
  22.370  by (stac lemma_cos_ext 1);
  22.371  by (auto_tac (claset(),simpset() addsimps [lemma_sin_minus,
  22.372 -    cos_fdiffs2 RS sym,real_minus_mult_eq1]));
  22.373 +    cos_fdiffs2 RS sym,minus_mult_left]));
  22.374  by (res_inst_tac [("K","1 + abs(x)")] termdiffs 1);
  22.375  by (auto_tac (claset() addIs [sin_converges,cos_converges, sums_summable] 
  22.376      addSIs [sums_minus RS sums_summable],
  22.377 @@ -962,7 +962,7 @@
  22.378  by (res_inst_tac [("n","2"),("f","(%n. inverse (real (fact n)) * x ^ n)")]
  22.379      series_pos_le 2);
  22.380  by (auto_tac (claset() addIs [summable_exp],simpset() 
  22.381 -    addsimps [numeral_2_eq_2,realpow_ge_zero,real_0_le_mult_iff]));
  22.382 +    addsimps [numeral_2_eq_2,realpow_ge_zero,zero_le_mult_iff]));
  22.383  qed "exp_ge_add_one_self";
  22.384  Addsimps [exp_ge_add_one_self];
  22.385  
  22.386 @@ -978,7 +978,7 @@
  22.387      [CLAIM_SIMP "(%x. exp (x + y)) = exp o (%x. x + y)" [ext]]));
  22.388  by (rtac (real_mult_1_right RS subst) 1);
  22.389  by (rtac DERIV_chain 1);
  22.390 -by (rtac (real_add_zero_right RS subst) 2);
  22.391 +by (rtac (add_zero_right RS subst) 2);
  22.392  by (rtac DERIV_add 2);
  22.393  by Auto_tac;
  22.394  qed "DERIV_exp_add_const";
  22.395 @@ -988,8 +988,8 @@
  22.396  by (auto_tac (claset(),simpset() addsimps
  22.397      [CLAIM_SIMP "(%x. exp(-x)) = exp o (%x. - x)" [ext]]));
  22.398  by (rtac (real_mult_1_right RS subst) 1);
  22.399 -by (rtac (real_minus_mult_eq1 RS subst) 1);
  22.400 -by (stac real_minus_mult_eq2 1);
  22.401 +by (rtac (minus_mult_left RS subst) 1);
  22.402 +by (stac minus_mult_right 1);
  22.403  by (rtac DERIV_chain 1);
  22.404  by (rtac DERIV_minus 2);
  22.405  by Auto_tac;
  22.406 @@ -999,7 +999,7 @@
  22.407  Goal "DERIV (%x. exp (x + y) * exp (- x)) x :> 0";
  22.408  by (cut_inst_tac [("x","x"),("y2","y")] ([DERIV_exp_add_const,
  22.409      DERIV_exp_minus] MRS DERIV_mult) 1);
  22.410 -by (auto_tac (claset(),simpset() addsimps real_mult_ac));
  22.411 +by (auto_tac (claset(),simpset() addsimps mult_ac));
  22.412  qed "DERIV_exp_exp_zero";
  22.413  Addsimps [DERIV_exp_exp_zero];
  22.414  
  22.415 @@ -1031,7 +1031,7 @@
  22.416      (exp_add_mult_minus RS (CLAIM "x = y ==> z * y = z * (x::real)")) 1);
  22.417  by (asm_full_simp_tac HOL_ss 1);
  22.418  by (asm_full_simp_tac (simpset() delsimps [exp_add_mult_minus] 
  22.419 -    addsimps real_mult_ac) 1);
  22.420 +    addsimps mult_ac) 1);
  22.421  qed "exp_add";
  22.422  
  22.423  Goal "0 <= exp x";
  22.424 @@ -1053,7 +1053,7 @@
  22.425  Addsimps [exp_gt_zero];
  22.426  
  22.427  Goal "0 < inverse(exp x)";
  22.428 -by (auto_tac (claset() addIs [real_inverse_gt_0],simpset()));
  22.429 +by (auto_tac (claset() addIs [positive_imp_inverse_positive],simpset()));
  22.430  qed "inv_exp_gt_zero";
  22.431  Addsimps [inv_exp_gt_zero];
  22.432  
  22.433 @@ -1065,7 +1065,7 @@
  22.434  Goal "exp(real n * x) = exp(x) ^ n";
  22.435  by (induct_tac "n" 1);
  22.436  by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc,
  22.437 -    real_add_mult_distrib2,exp_add,real_mult_commute]));
  22.438 +    right_distrib,exp_add,real_mult_commute]));
  22.439  qed "exp_real_of_nat_mult";
  22.440  
  22.441  Goalw [real_diff_def,real_divide_def] 
  22.442 @@ -1080,7 +1080,7 @@
  22.443  qed "exp_less_mono";
  22.444  
  22.445  Goal "exp x < exp y ==> x < y";
  22.446 -by (EVERY1[rtac ccontr, dtac real_leI, dtac real_le_imp_less_or_eq]);
  22.447 +by (EVERY1[rtac ccontr, dtac (linorder_not_less RS iffD1), dtac real_le_imp_less_or_eq]);
  22.448  by (auto_tac (claset() addDs [exp_less_mono],simpset()));
  22.449  qed "exp_less_cancel";
  22.450  
  22.451 @@ -1155,13 +1155,13 @@
  22.452  Addsimps [ln_one];
  22.453  
  22.454  Goal "0 < x ==> ln(inverse x) = - ln x";
  22.455 -by (res_inst_tac [("x1","ln x")] (real_add_left_cancel RS iffD1) 1);
  22.456 -by (auto_tac (claset(),simpset() addsimps [real_inverse_gt_0,ln_mult RS sym]));
  22.457 +by (res_inst_tac [("a1","ln x")] (add_left_cancel RS iffD1) 1);
  22.458 +by (auto_tac (claset(),simpset() addsimps [positive_imp_inverse_positive,ln_mult RS sym]));
  22.459  qed "ln_inverse";
  22.460  
  22.461  Goalw [real_divide_def]
  22.462      "[|0 < x; 0 < y|] ==> ln(x/y) = ln x - ln y";
  22.463 -by (auto_tac (claset(),simpset() addsimps [real_inverse_gt_0,
  22.464 +by (auto_tac (claset(),simpset() addsimps [positive_imp_inverse_positive,
  22.465      ln_mult,ln_inverse]));
  22.466  qed "ln_div";
  22.467  
  22.468 @@ -1284,7 +1284,7 @@
  22.469  
  22.470  Goal "DERIV (%x. cos(x)*cos(x)) x :> -2 * cos(x) * sin(x)";
  22.471  by (cut_inst_tac [("x","x")] DERIV_cos_cos_mult 1);
  22.472 -by (auto_tac (claset(),simpset() addsimps real_mult_ac));
  22.473 +by (auto_tac (claset(),simpset() addsimps mult_ac));
  22.474  qed "DERIV_cos_cos_mult2";
  22.475  Addsimps [DERIV_cos_cos_mult2];
  22.476  
  22.477 @@ -1351,12 +1351,12 @@
  22.478  Addsimps [sin_cos_squared_add3];
  22.479  
  22.480  Goal "(sin(x) ^ 2) = 1 - (cos(x) ^ 2)";
  22.481 -by (res_inst_tac [("x1","(cos(x) ^ 2)")] (real_add_right_cancel RS iffD1) 1);
  22.482 +by (res_inst_tac [("a1","(cos(x) ^ 2)")] (add_right_cancel RS iffD1) 1);
  22.483  by (simp_tac (simpset() delsimps [realpow_Suc]) 1);
  22.484  qed "sin_squared_eq";
  22.485  
  22.486  Goal "(cos(x) ^ 2) = 1 - (sin(x) ^ 2)";
  22.487 -by (res_inst_tac [("x1","(sin(x) ^ 2)")] (real_add_right_cancel RS iffD1) 1);
  22.488 +by (res_inst_tac [("a1","(sin(x) ^ 2)")] (add_right_cancel RS iffD1) 1);
  22.489  by (simp_tac (simpset() delsimps [realpow_Suc]) 1);
  22.490  qed "cos_squared_eq";
  22.491  
  22.492 @@ -1472,8 +1472,8 @@
  22.493  by (Step_tac 1 THEN rtac lemma_DERIV_subst 1);
  22.494  by DERIV_tac;
  22.495  by (auto_tac (claset(),simpset() addsimps [real_diff_def,
  22.496 -    real_add_mult_distrib,real_add_mult_distrib2] @ 
  22.497 -    real_mult_ac @ real_add_ac));
  22.498 +    left_distrib,right_distrib] @ 
  22.499 +    mult_ac @ add_ac));
  22.500  val lemma_DERIV_sin_cos_add = result();
  22.501  
  22.502  Goal "(sin (x + y) - (sin x * cos y + cos x * sin y)) ^ 2 + \
  22.503 @@ -1500,8 +1500,8 @@
  22.504  by (Step_tac 1 THEN rtac lemma_DERIV_subst 1);
  22.505  by DERIV_tac;
  22.506  by (auto_tac (claset(),simpset() addsimps [real_diff_def,
  22.507 -    real_add_mult_distrib,real_add_mult_distrib2]
  22.508 -    @ real_mult_ac @ real_add_ac));
  22.509 +    left_distrib,right_distrib]
  22.510 +    @ mult_ac @ add_ac));
  22.511  val lemma_DERIV_sin_cos_minus = result();
  22.512  
  22.513  Goal "(sin(-x) + (sin x)) ^ 2 + (cos(-x) - (cos x)) ^ 2 = 0";
  22.514 @@ -1587,7 +1587,7 @@
  22.515  by (asm_full_simp_tac (simpset() addsimps []) 1); 
  22.516  by (asm_simp_tac (simpset() addsimps [numeral_2_eq_2 RS sym, real_mult_assoc RS sym]) 1);
  22.517  by (stac (CLAIM "6 = 2 * (3::real)") 1);
  22.518 -by (rtac real_mult_less_mono 1);  
  22.519 +by (rtac real_mult_less_mono 1); (*mult_strict_mono would be stronger*)  
  22.520  by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc] delsimps [fact_Suc]));
  22.521  by (stac fact_Suc 1);
  22.522  by (stac fact_Suc 1);
  22.523 @@ -1598,7 +1598,7 @@
  22.524  by (stac real_of_nat_mult 1);
  22.525  by (stac real_of_nat_mult 1);
  22.526  by (simp_tac (simpset() addsimps [real_divide_def,
  22.527 -    real_inverse_distrib] delsimps [fact_Suc]) 1);
  22.528 +    inverse_mult_distrib] delsimps [fact_Suc]) 1);
  22.529  by (auto_tac (claset(),simpset() addsimps [real_mult_assoc RS sym] 
  22.530      delsimps [fact_Suc]));
  22.531  by (multr_by_tac "real (Suc (Suc (4*m)))" 1);
  22.532 @@ -1613,7 +1613,7 @@
  22.533  by (subgoal_tac "0 < x ^ (4 * m)" 1);
  22.534  by (asm_simp_tac (simpset() addsimps [realpow_gt_zero]) 2); 
  22.535  by (asm_simp_tac (simpset() addsimps [mult_less_cancel_left]) 1); 
  22.536 -by (rtac real_mult_less_mono 1);
  22.537 +by (rtac real_mult_less_mono 1); (*mult_strict_mono would be stronger*)
  22.538  by (ALLGOALS(Asm_simp_tac));
  22.539  by (TRYALL(rtac real_less_trans));
  22.540  by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc] delsimps [fact_Suc]));
  22.541 @@ -1626,10 +1626,11 @@
  22.542  qed "sin_gt_zero1";
  22.543  
  22.544  Goal "[| 0 < x; x < 2 |] ==> cos (2 * x) < 1";
  22.545 -by (auto_tac (claset(),simpset() addsimps [cos_squared_eq,
  22.546 -    real_minus_add_distrib RS sym, real_minus_zero_less_iff2,sin_gt_zero1,
  22.547 -    real_add_order,realpow_gt_zero,cos_double] delsimps 
  22.548 -    [realpow_Suc,real_minus_add_distrib]));
  22.549 +by (auto_tac (claset(),
  22.550 +    simpset() addsimps [cos_squared_eq,
  22.551 +    minus_add_distrib RS sym, neg_less_0_iff_less,sin_gt_zero1,
  22.552 +    real_add_order,realpow_gt_zero,cos_double] 
  22.553 +    delsimps [realpow_Suc,minus_add_distrib]));
  22.554  qed "cos_double_less_one";
  22.555  
  22.556  Goal  "(%n. (- 1) ^ n /(real (fact (2 * n))) * x ^ (2 * n)) \
  22.557 @@ -1666,7 +1667,7 @@
  22.558  by (stac fact_Suc 1);
  22.559  by (stac real_of_nat_mult 1);
  22.560  by (stac real_of_nat_mult 1);
  22.561 -by (rtac real_mult_less_mono 1);
  22.562 +by (rtac real_mult_less_mono 1); (*mult_strict_mono would be stronger*)
  22.563  by (Force_tac 1);
  22.564  by (Force_tac 2);
  22.565  by (rtac real_of_nat_fact_gt_zero 2);
  22.566 @@ -1820,14 +1821,14 @@
  22.567  Goal "cos (real n * pi) = (-(1::real)) ^ n";
  22.568  by (induct_tac "n" 1);
  22.569  by (auto_tac (claset(),simpset() addsimps 
  22.570 -    [real_of_nat_Suc,real_add_mult_distrib]));
  22.571 +    [real_of_nat_Suc,left_distrib]));
  22.572  qed "cos_npi";
  22.573  Addsimps [cos_npi];
  22.574  
  22.575  Goal "sin (real (n::nat) * pi) = 0";
  22.576  by (induct_tac "n" 1);
  22.577  by (auto_tac (claset(),simpset() addsimps 
  22.578 -    [real_of_nat_Suc,real_add_mult_distrib]));
  22.579 +    [real_of_nat_Suc,left_distrib]));
  22.580  qed "sin_npi";
  22.581  Addsimps [sin_npi];
  22.582  
  22.583 @@ -1977,7 +1978,7 @@
  22.584  \    (cos(x - real n * pi) = 0)" 1);
  22.585  by (Step_tac 1);
  22.586  by (asm_full_simp_tac (simpset() addsimps [real_of_nat_Suc,
  22.587 -    real_add_mult_distrib]) 2);
  22.588 +    left_distrib]) 2);
  22.589  by (asm_full_simp_tac (simpset() addsimps [cos_diff]) 1);
  22.590  by (asm_full_simp_tac (simpset() addsimps [cos_diff]) 2);
  22.591  by (subgoal_tac "EX! x. 0 <= x & x <= pi & cos x = 0" 1);
  22.592 @@ -1988,7 +1989,7 @@
  22.593  by (asm_full_simp_tac (simpset() addsimps [cos_diff]) 1);
  22.594  by (res_inst_tac [("x","Suc (2 * n)")] exI 1);
  22.595  by (asm_full_simp_tac (simpset() addsimps [real_of_nat_Suc,
  22.596 -    real_add_mult_distrib]) 1);
  22.597 +    left_distrib]) 1);
  22.598  by Auto_tac;
  22.599  qed "cos_zero_lemma";
  22.600  
  22.601 @@ -2003,7 +2004,7 @@
  22.602  by (rtac real_le_trans 2 THEN assume_tac 3);
  22.603  by (auto_tac (claset(),simpset() addsimps [odd_not_even RS sym,
  22.604      odd_Suc_mult_two_ex,real_of_nat_Suc,
  22.605 -    real_add_mult_distrib,real_mult_assoc RS sym]));
  22.606 +    left_distrib,real_mult_assoc RS sym]));
  22.607  qed "sin_zero_lemma";
  22.608  
  22.609  (* also spoilt by numeral arithmetic *)
  22.610 @@ -2019,7 +2020,7 @@
  22.611  by (Step_tac 1);
  22.612  by (dtac (CLAIM "-x = y ==> x = -(y::real)") 2);
  22.613  by (auto_tac (claset(),HOL_ss addsimps [odd_not_even RS sym,
  22.614 -    odd_Suc_mult_two_ex,real_of_nat_Suc,real_add_mult_distrib]));
  22.615 +    odd_Suc_mult_two_ex,real_of_nat_Suc,left_distrib]));
  22.616  by (auto_tac (claset(),simpset() addsimps [cos_add]));
  22.617  qed "cos_zero_iff";
  22.618  
  22.619 @@ -2058,7 +2059,7 @@
  22.620  Addsimps [tan_npi];
  22.621  
  22.622  Goalw [tan_def] "tan (-x) = - tan x";
  22.623 -by (simp_tac (simpset() addsimps [real_minus_mult_eq1]) 1);
  22.624 +by (simp_tac (simpset() addsimps [minus_mult_left]) 1);
  22.625  qed "tan_minus";
  22.626  Addsimps [tan_minus];
  22.627  
  22.628 @@ -2072,12 +2073,11 @@
  22.629  \       ==> 1 - tan(x)*tan(y) = cos (x + y)/(cos x * cos y)";
  22.630  by (auto_tac (claset(),
  22.631     simpset() delsimps [thm"Ring_and_Field.inverse_mult_distrib"]
  22.632 -	     addsimps [real_inverse_distrib RS sym] @ real_mult_ac));
  22.633 +	     addsimps [inverse_mult_distrib RS sym] @ mult_ac));
  22.634  by (res_inst_tac [("c1","cos x * cos y")] (real_mult_right_cancel RS subst) 1);
  22.635  by (auto_tac (claset(), 
  22.636      simpset() delsimps [thm"Ring_and_Field.inverse_mult_distrib"]
  22.637 -	      addsimps [real_mult_assoc, 
  22.638 -    real_mult_not_zero,real_diff_mult_distrib,cos_add]));
  22.639 +	      addsimps [mult_assoc, left_diff_distrib,cos_add]));
  22.640  val lemma_tan_add1 = result();
  22.641  Addsimps [lemma_tan_add1];
  22.642  
  22.643 @@ -2085,8 +2085,7 @@
  22.644        "[| cos x ~= 0; cos y ~= 0 |] \
  22.645  \      ==> tan x + tan y = sin(x + y)/(cos x * cos y)";
  22.646  by (res_inst_tac [("c1","cos x * cos y")] (real_mult_right_cancel RS subst) 1);
  22.647 -by (auto_tac (claset(), simpset() addsimps [real_mult_assoc,
  22.648 -    real_mult_not_zero,real_add_mult_distrib]));
  22.649 +by (auto_tac (claset(), simpset() addsimps [mult_assoc, left_distrib]));
  22.650  by (simp_tac (simpset() addsimps [sin_add]) 1);
  22.651  qed "add_tan_eq";
  22.652  
  22.653 @@ -2106,8 +2105,7 @@
  22.654  
  22.655  Goalw [tan_def,real_divide_def] "[| 0 < x; x < pi/2 |] ==> 0 < tan x";
  22.656  by (auto_tac (claset() addSIs [sin_gt_zero2,cos_gt_zero_pi]
  22.657 -    addSIs [real_mult_order,
  22.658 -    real_inverse_gt_0],simpset()));
  22.659 +    addSIs [real_mult_order, positive_imp_inverse_positive],simpset()));
  22.660  qed "tan_gt_zero";
  22.661  
  22.662  Goal "[| - pi/2 < x; x < 0 |] ==> tan x < 0";
  22.663 @@ -2131,9 +2129,9 @@
  22.664  
  22.665  Goalw [real_divide_def] 
  22.666        "(%x. cos(x)/sin(x)) -- pi/2 --> 0";
  22.667 -by (res_inst_tac [("z1","1")] ((real_mult_0) RS subst) 1);
  22.668 +by (res_inst_tac [("a1","1")] ((mult_left_zero) RS subst) 1);
  22.669  by (rtac LIM_mult2 1); 
  22.670 -by (rtac ((real_inverse_1) RS subst) 2);
  22.671 +by (rtac (inverse_1 RS subst) 2);
  22.672  by (rtac LIM_inverse 2);
  22.673  by (fold_tac [real_divide_def]);
  22.674  by (auto_tac (claset() addSIs [DERIV_isCont],simpset() 
  22.675 @@ -2163,10 +2161,10 @@
  22.676  by (subgoal_tac "0 < sin e" 3);
  22.677  by (subgoal_tac "0 < cos e" 3);
  22.678  by (auto_tac (claset() addIs [cos_gt_zero,sin_gt_zero2],simpset()
  22.679 -    addsimps [real_inverse_distrib,abs_mult]));
  22.680 -by (dres_inst_tac [("x","cos e")] (real_inverse_gt_0) 1);
  22.681 +    addsimps [inverse_mult_distrib,abs_mult]));
  22.682 +by (dres_inst_tac [("a","cos e")] (positive_imp_inverse_positive) 1);
  22.683  by (dres_inst_tac [("x","inverse (cos e)")] abs_eqI2 1);
  22.684 -by (auto_tac (claset() addSDs [abs_eqI2],simpset() addsimps real_mult_ac));
  22.685 +by (auto_tac (claset() addSDs [abs_eqI2],simpset() addsimps mult_ac));
  22.686  qed "lemma_tan_total";
  22.687  
  22.688  
  22.689 @@ -2376,9 +2374,9 @@
  22.690  by (case_tac "n" 3);
  22.691  by (cut_inst_tac [("y","x")] arctan_ubound 2);
  22.692  by (cut_inst_tac [("y","x")] arctan_lbound 4);
  22.693 -by (auto_tac (claset(),simpset() addsimps [real_of_nat_Suc,
  22.694 -    real_add_mult_distrib,real_le_def,
  22.695 -    real_mult_less_0_iff] delsimps [arctan]));
  22.696 +by (auto_tac (claset(),
  22.697 +     simpset() addsimps [real_of_nat_Suc, left_distrib,real_le_def, mult_less_0_iff] 
  22.698 +     delsimps [arctan]));
  22.699  qed "cos_arctan_not_zero";
  22.700  Addsimps [cos_arctan_not_zero];
  22.701  
  22.702 @@ -2386,7 +2384,7 @@
  22.703  by (rtac (realpow_inverse RS subst) 1);
  22.704  by (res_inst_tac [("c1","cos(x) ^ 2")] (real_mult_right_cancel RS iffD1) 1);
  22.705  by (auto_tac (claset() addDs [realpow_not_zero], simpset() addsimps
  22.706 -    [realpow_mult,real_add_mult_distrib,realpow_divide,
  22.707 +    [realpow_mult,left_distrib,realpow_divide,
  22.708       tan_def,real_mult_assoc,realpow_inverse RS sym] 
  22.709       delsimps [realpow_Suc]));
  22.710  qed "tan_sec";
  22.711 @@ -2399,7 +2397,7 @@
  22.712  Goal "sin (xa + 1 / 2 * real (Suc m) * pi) = \
  22.713  \     cos (xa + 1 / 2 * real  (m) * pi)";
  22.714  by (simp_tac (HOL_ss addsimps [cos_add,sin_add,
  22.715 -    real_of_nat_Suc,real_add_mult_distrib,real_add_mult_distrib2]) 1);
  22.716 +    real_of_nat_Suc,left_distrib,right_distrib]) 1);
  22.717  by Auto_tac;
  22.718  qed "lemma_sin_cos_eq";
  22.719  Addsimps [lemma_sin_cos_eq];
  22.720 @@ -2407,7 +2405,7 @@
  22.721  Goal "sin (xa + real (Suc m) * pi / 2) = \
  22.722  \     cos (xa + real (m) * pi / 2)";
  22.723  by (simp_tac (HOL_ss addsimps [cos_add,sin_add,real_divide_def,
  22.724 -    real_of_nat_Suc,real_add_mult_distrib,real_add_mult_distrib2]) 1);
  22.725 +    real_of_nat_Suc,left_distrib,right_distrib]) 1);
  22.726  by Auto_tac;
  22.727  qed "lemma_sin_cos_eq2";
  22.728  Addsimps [lemma_sin_cos_eq2];
  22.729 @@ -2422,15 +2420,15 @@
  22.730  
  22.731  (* which further simplifies to (- 1 ^ m) !! *)
  22.732  Goal "sin ((real m + 1/2) * pi) = cos (real m * pi)";
  22.733 -by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib2,
  22.734 -    sin_add,real_add_mult_distrib] @ real_mult_ac));
  22.735 +by (auto_tac (claset(),simpset() addsimps [right_distrib,
  22.736 +    sin_add,left_distrib] @ mult_ac));
  22.737  qed "sin_cos_npi";
  22.738  Addsimps [sin_cos_npi];
  22.739  
  22.740  Goal "sin (real (Suc (2 * n)) * pi / 2) = (- 1) ^ n";
  22.741  by (cut_inst_tac [("m","n")] sin_cos_npi 1);
  22.742  by (auto_tac (claset(),HOL_ss addsimps [real_of_nat_Suc,
  22.743 -    real_add_mult_distrib,real_divide_def]));
  22.744 +    left_distrib,real_divide_def]));
  22.745  by Auto_tac;
  22.746  qed "sin_cos_npi2";
  22.747  Addsimps [ sin_cos_npi2];
  22.748 @@ -2444,8 +2442,8 @@
  22.749  
  22.750  Goal "cos (3 / 2 * pi) = 0";
  22.751  by (rtac (CLAIM "(1::real) + 1/2 = 3/2" RS subst) 1);
  22.752 -by (stac real_add_mult_distrib 1);
  22.753 -by (auto_tac (claset(),simpset() addsimps [cos_add] @ real_mult_ac));
  22.754 +by (stac left_distrib 1);
  22.755 +by (auto_tac (claset(),simpset() addsimps [cos_add] @ mult_ac));
  22.756  qed "cos_3over2_pi";
  22.757  Addsimps [cos_3over2_pi];
  22.758  
  22.759 @@ -2456,16 +2454,16 @@
  22.760  
  22.761  Goal "sin (3 / 2 * pi) = - 1";
  22.762  by (rtac (CLAIM "(1::real) + 1/2 = 3/2" RS subst) 1);
  22.763 -by (stac real_add_mult_distrib 1);
  22.764 -by (auto_tac (claset(),simpset() addsimps [sin_add] @real_mult_ac));
  22.765 +by (stac left_distrib 1);
  22.766 +by (auto_tac (claset(),simpset() addsimps [sin_add] @mult_ac));
  22.767  qed "sin_3over2_pi";
  22.768  Addsimps [sin_3over2_pi];
  22.769  
  22.770  Goal "cos(xa + 1 / 2 * real (Suc m) * pi) = \
  22.771  \     -sin  (xa + 1 / 2 * real (m) * pi)";
  22.772  by (simp_tac (HOL_ss addsimps [cos_add,sin_add,
  22.773 -    real_of_nat_Suc,real_add_mult_distrib2,real_add_mult_distrib,
  22.774 -    real_minus_mult_eq2]) 1);
  22.775 +    real_of_nat_Suc,right_distrib,left_distrib,
  22.776 +    minus_mult_right]) 1);
  22.777  by Auto_tac;
  22.778  qed "lemma_cos_sin_eq";
  22.779  Addsimps [lemma_cos_sin_eq];
  22.780 @@ -2473,14 +2471,14 @@
  22.781  Goal "cos (xa + real (Suc m) * pi / 2) = \
  22.782  \     -sin (xa + real (m) * pi / 2)";
  22.783  by (simp_tac (HOL_ss addsimps [cos_add,sin_add,real_divide_def,
  22.784 -    real_of_nat_Suc,real_add_mult_distrib,real_add_mult_distrib2]) 1);
  22.785 +    real_of_nat_Suc,left_distrib,right_distrib]) 1);
  22.786  by Auto_tac;
  22.787  qed "lemma_cos_sin_eq2";
  22.788  Addsimps [lemma_cos_sin_eq2];
  22.789  
  22.790  Goal "cos (pi * real (Suc (2 * m)) / 2) = 0";
  22.791  by (simp_tac (HOL_ss addsimps [cos_add,sin_add,real_divide_def,
  22.792 -    real_of_nat_Suc,real_add_mult_distrib,real_add_mult_distrib2]) 1);
  22.793 +    real_of_nat_Suc,left_distrib,right_distrib]) 1);
  22.794  by Auto_tac;
  22.795  qed "cos_pi_eq_zero";
  22.796  Addsimps [cos_pi_eq_zero];
  22.797 @@ -2559,7 +2557,7 @@
  22.798  
  22.799  Goal "[| 0 <= x; 0 <= y |] ==> (root(Suc n) x < root(Suc n) y) = (x < y)";
  22.800  by (auto_tac (claset() addIs [real_root_less_mono],simpset()));
  22.801 -by (rtac ccontr 1 THEN dtac real_leI 1);
  22.802 +by (rtac ccontr 1 THEN dtac (linorder_not_less RS iffD1) 1);
  22.803  by (dres_inst_tac [("x","y"),("n","n")] real_root_le_mono 1);
  22.804  by Auto_tac;
  22.805  qed "real_root_less_iff";
  22.806 @@ -2591,7 +2589,7 @@
  22.807  \     ==> root(Suc n) (x * y) = root(Suc n) x * root(Suc n) y";
  22.808  by (rtac real_root_pos_unique 1);
  22.809  by (auto_tac (claset() addSIs [real_root_pos_pos_le],simpset() 
  22.810 -    addsimps [realpow_mult,real_0_le_mult_iff,
  22.811 +    addsimps [realpow_mult,zero_le_mult_iff,
  22.812      real_root_pow_pos2] delsimps [realpow_Suc]));
  22.813  qed "real_root_mult";
  22.814  
  22.815 @@ -2651,7 +2649,7 @@
  22.816  
  22.817  Goalw [real_divide_def] "(((r::real) * a) / (r * r)) = a / r";
  22.818  by (case_tac "r=0" 1);
  22.819 -by (auto_tac (claset(),simpset() addsimps [real_inverse_distrib] @ real_mult_ac));
  22.820 +by (auto_tac (claset(),simpset() addsimps [inverse_mult_distrib] @ mult_ac));
  22.821  qed "real_divide_square_eq";
  22.822  Addsimps [real_divide_square_eq];
  22.823  
  22.824 @@ -2677,13 +2675,13 @@
  22.825  Goal "x < 0 ==> 0 < sqrt (x * x + y * y)";
  22.826  by (rtac real_sqrt_gt_zero 1);
  22.827  by (rtac (ARITH_PROVE "[| 0 < x; 0 <= y |] ==> (0::real) < x + y") 1);
  22.828 -by (auto_tac (claset(),simpset() addsimps [real_0_less_mult_iff]));
  22.829 +by (auto_tac (claset(),simpset() addsimps [zero_less_mult_iff]));
  22.830  qed "real_sqrt_sum_squares_gt_zero1";
  22.831  
  22.832  Goal "0 < x ==> 0 < sqrt (x * x + y * y)";
  22.833  by (rtac real_sqrt_gt_zero 1);
  22.834  by (rtac (ARITH_PROVE "[| 0 < x; 0 <= y |] ==> (0::real) < x + y") 1);
  22.835 -by (auto_tac (claset(),simpset() addsimps [real_0_less_mult_iff]));
  22.836 +by (auto_tac (claset(),simpset() addsimps [zero_less_mult_iff]));
  22.837  qed "real_sqrt_sum_squares_gt_zero2";
  22.838  
  22.839  Goal "x ~= 0 ==> 0 < sqrt(x ^ 2 + y ^ 2)";
  22.840 @@ -2725,7 +2723,7 @@
  22.841  by (case_tac "y = 0" 1);
  22.842  by Auto_tac;
  22.843  by (ftac abs_minus_eqI2 1);
  22.844 -by (auto_tac (claset(),simpset() addsimps [real_minus_inverse]));
  22.845 +by (auto_tac (claset(),simpset() addsimps [inverse_minus_eq]));
  22.846  by (rtac order_less_imp_le 1);
  22.847  by (res_inst_tac [("z1","sqrt(x * x + y * y)")] 
  22.848       (real_mult_less_iff1 RS iffD1) 1);
  22.849 @@ -2733,7 +2731,7 @@
  22.850      (real_sqrt_sum_squares_gt_zero1 RS real_not_refl2 
  22.851      RS not_sym) 2);
  22.852  by (auto_tac (claset() addIs [real_sqrt_sum_squares_gt_zero1],
  22.853 -    simpset() addsimps real_mult_ac));
  22.854 +    simpset() addsimps mult_ac));
  22.855  by (rtac (ARITH_PROVE "-x < y ==> -y < (x::real)") 1);
  22.856  by (cut_inst_tac [("x","-x"),("y","y")] real_sqrt_sum_squares_ge1 1);
  22.857  by (dtac real_le_imp_less_or_eq 1);
  22.858 @@ -2836,8 +2834,8 @@
  22.859  by (thin_tac "(1 - z) * (x + y) = x /(x + y) * (x + y)" 2);
  22.860  by (thin_tac "1 - z = x /(x + y)" 2);
  22.861  by (auto_tac (claset(),simpset() addsimps [real_mult_assoc]));
  22.862 -by (auto_tac (claset(),simpset() addsimps [real_add_mult_distrib2,
  22.863 -    real_diff_mult_distrib]));
  22.864 +by (auto_tac (claset(),simpset() addsimps [right_distrib,
  22.865 +    left_diff_distrib]));
  22.866  qed "lemma_divide_rearrange";
  22.867  
  22.868  Goal "[| 0 < x * x + y * y; \
  22.869 @@ -2901,7 +2899,7 @@
  22.870  
  22.871  Goalw [real_divide_def] "x ~= 0 ==> x / sqrt (x * x + y * y) ~= 0";
  22.872  by (forw_inst_tac [("y3","y")] (real_sqrt_sum_squares_gt_zero3 
  22.873 -    RS real_not_refl2 RS not_sym RS real_inverse_not_zero) 1);
  22.874 +    RS real_not_refl2 RS not_sym RS nonzero_imp_inverse_nonzero) 1);
  22.875  by (auto_tac (claset(),simpset() addsimps [real_power_two]));
  22.876  qed "lemma_cos_not_eq_zero";
  22.877  
  22.878 @@ -2925,7 +2923,7 @@
  22.879  by (case_tac "x = 0" 1);
  22.880  by (auto_tac (claset(),simpset() addsimps [abs_eqI2]));
  22.881  by (dres_inst_tac [("y","y")] real_sqrt_sum_squares_gt_zero3 1);
  22.882 -by (auto_tac (claset(),simpset() addsimps [real_0_less_mult_iff,
  22.883 +by (auto_tac (claset(),simpset() addsimps [zero_less_mult_iff,
  22.884      real_divide_def,real_power_two])); 
  22.885  qed "real_sqrt_divide_less_zero";
  22.886  
  22.887 @@ -3039,7 +3037,7 @@
  22.888      simpset() addsimps [real_0_le_divide_iff,realpow_divide,
  22.889      real_sqrt_gt_zero_pow2,numeral_2_eq_2 RS sym] delsimps [realpow_Suc]));
  22.890  by (res_inst_tac [("t","u ^ 2")] (real_sum_of_halves RS subst) 1);
  22.891 -by (rtac real_add_le_mono 1);
  22.892 +by (rtac add_mono 1);
  22.893  by (auto_tac (claset(),simpset() delsimps [realpow_Suc]));
  22.894  by (ALLGOALS(rtac ((CLAIM "(2::real) ^ 2 = 4") RS subst)));
  22.895  by (ALLGOALS(rtac (realpow_mult RS subst)));
    23.1 --- a/src/HOL/Hyperreal/hypreal_arith.ML	Mon Dec 29 06:49:26 2003 +0100
    23.2 +++ b/src/HOL/Hyperreal/hypreal_arith.ML	Thu Jan 01 10:06:32 2004 +0100
    23.3 @@ -214,8 +214,8 @@
    23.4  val hypreal_mult_mono_thms =
    23.5   [(rotate_prems 1 hypreal_mult_less_mono2,
    23.6     cvar(hypreal_mult_less_mono2, hd(prems_of hypreal_mult_less_mono2))),
    23.7 -  (hypreal_mult_le_mono2,
    23.8 -   cvar(hypreal_mult_le_mono2, hd(tl(prems_of hypreal_mult_le_mono2))))]
    23.9 +  (mult_left_mono,
   23.10 +   cvar(mult_left_mono, hd(tl(prems_of mult_left_mono))))]
   23.11  
   23.12  in
   23.13  
    24.1 --- a/src/HOL/Hyperreal/hypreal_arith0.ML	Mon Dec 29 06:49:26 2003 +0100
    24.2 +++ b/src/HOL/Hyperreal/hypreal_arith0.ML	Thu Jan 01 10:06:32 2004 +0100
    24.3 @@ -14,8 +14,7 @@
    24.4       add_hypreal_number_of, minus_hypreal_number_of, diff_hypreal_number_of,
    24.5       mult_hypreal_number_of, eq_hypreal_number_of, less_hypreal_number_of,
    24.6       le_hypreal_number_of_eq_not_less, hypreal_diff_def,
    24.7 -     minus_add_distrib, minus_minus, hypreal_mult_assoc,
    24.8 -     minus_zero,
    24.9 +     minus_add_distrib, minus_minus, mult_assoc, minus_zero,
   24.10       hypreal_add_zero_left, hypreal_add_zero_right,
   24.11       hypreal_add_minus, hypreal_add_minus_left,
   24.12       mult_left_zero, mult_right_zero,
   24.13 @@ -49,8 +48,8 @@
   24.14  val hypreal_mult_mono_thms =
   24.15   [(rotate_prems 1 hypreal_mult_less_mono2,
   24.16     cvar(hypreal_mult_less_mono2, hd(prems_of hypreal_mult_less_mono2))),
   24.17 -  (hypreal_mult_le_mono2,
   24.18 -   cvar(hypreal_mult_le_mono2, hd(tl(prems_of hypreal_mult_le_mono2))))]
   24.19 +  (mult_left_mono,
   24.20 +   cvar(mult_left_mono, hd(tl(prems_of mult_left_mono))))]
   24.21  
   24.22  in
   24.23  
    25.1 --- a/src/HOL/IsaMakefile	Mon Dec 29 06:49:26 2003 +0100
    25.2 +++ b/src/HOL/IsaMakefile	Thu Jan 01 10:06:32 2004 +0100
    25.3 @@ -144,8 +144,7 @@
    25.4    Real/RealArith0.thy Real/real_arith0.ML \
    25.5    Real/RealArith.thy Real/real_arith.ML Real/RealBin.ML \
    25.6    Real/RealBin.thy Real/RealDef.thy \
    25.7 -  Real/RealInt.thy Real/RealOrd.thy \
    25.8 -  Real/RealPow.thy Real/document/root.tex Real/real_arith.ML\
    25.9 +  Real/RealInt.thy Real/RealPow.thy Real/document/root.tex Real/real_arith.ML\
   25.10    Hyperreal/EvenOdd.ML Hyperreal/EvenOdd.thy \
   25.11    Hyperreal/Fact.ML Hyperreal/Fact.thy\
   25.12    Hyperreal/Filter.ML Hyperreal/Filter.thy Hyperreal/HRealAbs.ML\
    26.1 --- a/src/HOL/Real/Complex_Numbers.thy	Mon Dec 29 06:49:26 2003 +0100
    26.2 +++ b/src/HOL/Real/Complex_Numbers.thy	Thu Jan 01 10:06:32 2004 +0100
    26.3 @@ -120,10 +120,10 @@
    26.4        thus ?thesis by rule (insert ge, arith+)
    26.5      qed
    26.6      with neq show "Re (inverse w * w) = Re 1"
    26.7 -      by (simp add: inverse_complex_def real_power_two real_add_divide_distrib [symmetric])
    26.8 +      by (simp add: inverse_complex_def real_power_two add_divide_distrib [symmetric])
    26.9      from neq show "Im (inverse w * w) = Im 1"
   26.10        by (simp add: inverse_complex_def real_power_two
   26.11 -        real_mult_ac real_add_divide_distrib [symmetric])
   26.12 +        mult_ac add_divide_distrib [symmetric])
   26.13    qed
   26.14  qed
   26.15  
    27.1 --- a/src/HOL/Real/HahnBanach/Aux.thy	Mon Dec 29 06:49:26 2003 +0100
    27.2 +++ b/src/HOL/Real/HahnBanach/Aux.thy	Thu Jan 01 10:06:32 2004 +0100
    27.3 @@ -3,7 +3,7 @@
    27.4      Author:     Gertrud Bauer, TU Munich
    27.5  *)
    27.6  
    27.7 -header {* Auxiliary theorems *}  (* FIXME clean *)
    27.8 +header {* Auxiliary theorems *}  (* FIXME clean: many are in Ring_and_Field *)
    27.9  
   27.10  theory Aux = Real + Bounds + Zorn:
   27.11  
   27.12 @@ -38,45 +38,16 @@
   27.13  
   27.14  lemma real_mult_le_le_mono1a:
   27.15    "(0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x  \<le> z * y"
   27.16 -  by (simp add: real_mult_le_mono2)
   27.17 +  by (simp add: mult_left_mono)
   27.18  
   27.19 -lemma real_mult_le_le_mono2:
   27.20 -  "(0::real) \<le> z \<Longrightarrow> x \<le> y \<Longrightarrow> x * z \<le> y * z"
   27.21 -proof -
   27.22 -  assume "(0::real) \<le> z"  "x \<le> y"
   27.23 -  hence "x < y \<or> x = y" by (auto simp add: order_le_less)
   27.24 -  thus ?thesis
   27.25 -  proof
   27.26 -    assume "x < y"
   27.27 -    show ?thesis by (rule real_mult_le_less_mono1) (simp!)
   27.28 -  next
   27.29 -    assume "x = y"
   27.30 -    thus ?thesis by simp
   27.31 -  qed
   27.32 -qed
   27.33 -
   27.34 +text{*The next two results are needlessly weak*}
   27.35  lemma real_mult_less_le_anti:
   27.36    "z < (0::real) \<Longrightarrow> x \<le> y \<Longrightarrow> z * y \<le> z * x"
   27.37 -proof -
   27.38 -  assume "z < 0"  "x \<le> y"
   27.39 -  hence "0 < - z" by simp
   27.40 -  hence "0 \<le> - z" by (rule order_less_imp_le)
   27.41 -  hence "x * (- z) \<le> y * (- z)"
   27.42 -    by (rule real_mult_le_le_mono2)
   27.43 -  hence  "- (x * z) \<le> - (y * z)"
   27.44 -    by (simp only: real_mult_minus_eq2)
   27.45 -  thus ?thesis by (simp only: real_mult_commute)
   27.46 -qed
   27.47 +  by (simp add: mult_left_mono_neg order_less_imp_le)
   27.48  
   27.49  lemma real_mult_less_le_mono:
   27.50    "(0::real) < z \<Longrightarrow> x \<le> y \<Longrightarrow> z * x \<le> z * y"
   27.51 -proof -
   27.52 -  assume "0 < z"  "x \<le> y"
   27.53 -  have "0 \<le> z" by (rule order_less_imp_le)
   27.54 -  hence "x * z \<le> y * z"
   27.55 -    by (rule real_mult_le_le_mono2)
   27.56 -  thus ?thesis by (simp only: real_mult_commute)
   27.57 -qed
   27.58 +  by (simp add: mult_left_mono order_less_imp_le)
   27.59  
   27.60  lemma real_mult_inv_right1: "(x::real) \<noteq> 0 \<Longrightarrow> x * inverse x = 1"
   27.61    by simp
   27.62 @@ -86,14 +57,14 @@
   27.63  
   27.64  lemma real_le_mult_order1a:
   27.65    "(0::real) \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> 0 \<le> x * y"
   27.66 -  by (simp add: real_0_le_mult_iff)
   27.67 +  by (simp add: zero_le_mult_iff)
   27.68  
   27.69  lemma real_mult_diff_distrib:
   27.70    "a * (- x - (y::real)) = - a * x - a * y"
   27.71  proof -
   27.72    have "- x - y = - x + - y" by simp
   27.73    also have "a * ... = a * - x + a * - y"
   27.74 -    by (simp only: real_add_mult_distrib2)
   27.75 +    by (simp only: right_distrib)
   27.76    also have "... = - a * x - a * y"
   27.77      by simp
   27.78    finally show ?thesis .
   27.79 @@ -103,7 +74,7 @@
   27.80  proof -
   27.81    have "x - y = x + - y" by simp
   27.82    also have "a * ... = a * x + a * - y"
   27.83 -    by (simp only: real_add_mult_distrib2)
   27.84 +    by (simp only: right_distrib)
   27.85    also have "... = a * x - a * y"
   27.86      by simp
   27.87    finally show ?thesis .
    28.1 --- a/src/HOL/Real/HahnBanach/FunctionNorm.thy	Mon Dec 29 06:49:26 2003 +0100
    28.2 +++ b/src/HOL/Real/HahnBanach/FunctionNorm.thy	Thu Jan 01 10:06:32 2004 +0100
    28.3 @@ -127,9 +127,10 @@
    28.4  
    28.5            note y_rep
    28.6            also have "\<bar>f x\<bar> * inverse \<parallel>x\<parallel> \<le> (c * \<parallel>x\<parallel>) * inverse \<parallel>x\<parallel>"
    28.7 -          proof (rule real_mult_le_le_mono2)
    28.8 +          proof (rule mult_right_mono)
    28.9              from c show "\<bar>f x\<bar> \<le> c * \<parallel>x\<parallel>" ..
   28.10 -            from gt have "0 < inverse \<parallel>x\<parallel>" by (rule real_inverse_gt_0)
   28.11 +            from gt have "0 < inverse \<parallel>x\<parallel>" 
   28.12 +              by (rule positive_imp_inverse_positive)
   28.13              thus "0 \<le> inverse \<parallel>x\<parallel>" by (rule order_less_imp_le)
   28.14            qed
   28.15            also have "\<dots> = c * (\<parallel>x\<parallel> * inverse \<parallel>x\<parallel>)"
   28.16 @@ -211,7 +212,7 @@
   28.17    with x have neq: "\<parallel>x\<parallel> \<noteq> 0" by simp
   28.18    then have "\<bar>f x\<bar> = (\<bar>f x\<bar> * inverse \<parallel>x\<parallel>) * \<parallel>x\<parallel>" by simp
   28.19    also have "\<dots> \<le>  \<parallel>f\<parallel>\<hyphen>V * \<parallel>x\<parallel>"
   28.20 -  proof (rule real_mult_le_le_mono2)
   28.21 +  proof (rule mult_right_mono)
   28.22      from x show "0 \<le> \<parallel>x\<parallel>" ..
   28.23      from x and neq have "\<bar>f x\<bar> * inverse \<parallel>x\<parallel> \<in> B V f"
   28.24        by (auto simp add: B_def real_divide_def)
   28.25 @@ -246,7 +247,7 @@
   28.26        by (auto simp add: B_def real_divide_def)
   28.27      note b_rep
   28.28      also have "\<bar>f x\<bar> * inverse \<parallel>x\<parallel> \<le> (c * \<parallel>x\<parallel>) * inverse \<parallel>x\<parallel>"
   28.29 -    proof (rule real_mult_le_le_mono2)
   28.30 +    proof (rule mult_right_mono)
   28.31        have "0 < \<parallel>x\<parallel>" ..
   28.32        then show "0 \<le> inverse \<parallel>x\<parallel>" by simp
   28.33        from ineq and x show "\<bar>f x\<bar> \<le> c * \<parallel>x\<parallel>" ..
    29.1 --- a/src/HOL/Real/HahnBanach/HahnBanach.thy	Mon Dec 29 06:49:26 2003 +0100
    29.2 +++ b/src/HOL/Real/HahnBanach/HahnBanach.thy	Thu Jan 01 10:06:32 2004 +0100
    29.3 @@ -382,7 +382,7 @@
    29.4          show "0 \<le> \<parallel>f\<parallel>\<hyphen>F" by (rule ge_zero)
    29.5          from x y show "\<parallel>x + y\<parallel> \<le> \<parallel>x\<parallel> + \<parallel>y\<parallel>" ..
    29.6        qed
    29.7 -      also have "\<dots> = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel> + \<parallel>f\<parallel>\<hyphen>F * \<parallel>y\<parallel>" by (simp only: real_add_mult_distrib2)
    29.8 +      also have "\<dots> = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel> + \<parallel>f\<parallel>\<hyphen>F * \<parallel>y\<parallel>" by (simp only: right_distrib)
    29.9        also have "\<dots> = p x + p y" by (simp only: p_def)
   29.10        finally show ?thesis .
   29.11      qed
    30.1 --- a/src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy	Mon Dec 29 06:49:26 2003 +0100
    30.2 +++ b/src/HOL/Real/HahnBanach/HahnBanachExtLemmas.thy	Thu Jan 01 10:06:32 2004 +0100
    30.3 @@ -134,7 +134,7 @@
    30.4        also from y1 y2 have "h (y1 + y2) = h y1 + h y2"
    30.5          by simp
    30.6        also have "\<dots> + (a1 + a2) * xi = (h y1 + a1 * xi) + (h y2 + a2 * xi)"
    30.7 -        by (simp add: real_add_mult_distrib)
    30.8 +        by (simp add: left_distrib)
    30.9        also from h'_def x1_rep _ HE y1 x0
   30.10        have "h y1 + a1 * xi = h' x1"
   30.11          by (rule h'_definite [symmetric])
   30.12 @@ -173,7 +173,7 @@
   30.13        also from y1 have "h (c \<cdot> y1) = c * h y1"
   30.14          by simp
   30.15        also have "\<dots> + (c * a1) * xi = c * (h y1 + a1 * xi)"
   30.16 -        by (simp only: real_add_mult_distrib2)
   30.17 +        by (simp only: right_distrib)
   30.18        also from h'_def x1_rep _ HE y1 x0 have "h y1 + a1 * xi = h' x1"
   30.19          by (rule h'_definite [symmetric])
   30.20        finally show ?thesis .
    31.1 --- a/src/HOL/Real/RComplete.ML	Mon Dec 29 06:49:26 2003 +0100
    31.2 +++ b/src/HOL/Real/RComplete.ML	Thu Jan 01 10:06:32 2004 +0100
    31.3 @@ -162,7 +162,7 @@
    31.4        THEN assume_tac 2);
    31.5  by (full_simp_tac
    31.6      (simpset() addsimps [real_diff_def, diff_le_eq RS sym] @
    31.7 -                        real_add_ac) 2);
    31.8 +                        add_ac) 2);
    31.9  by (rtac (setleI RS isUbI) 1);
   31.10  by (Step_tac 1);
   31.11  by (res_inst_tac [("R1.0","x"),("R2.0","y")] real_linear_less2 1);
   31.12 @@ -179,9 +179,9 @@
   31.13  by (blast_tac (claset() addSIs [isLubD2]) 1 THEN Step_tac 1);
   31.14  by (full_simp_tac (simpset() addsimps [real_add_assoc]) 1);
   31.15  by (blast_tac (claset() addDs [isUbD] addSIs [setleI RS isUbI]
   31.16 -                        addIs [real_add_le_mono1]) 1);
   31.17 +                        addIs [add_right_mono]) 1);
   31.18  by (blast_tac (claset() addDs [isUbD] addSIs [setleI RS isUbI]
   31.19 -                        addIs [real_add_le_mono1]) 1);
   31.20 +                        addIs [add_right_mono]) 1);
   31.21  by (Auto_tac);
   31.22  qed "reals_complete";
   31.23  
   31.24 @@ -202,7 +202,7 @@
   31.25      (simpset() addsimps [linorder_not_less, inverse_eq_divide]) 2); 
   31.26  by (Clarify_tac 2);
   31.27  by (dres_inst_tac [("x","n")] spec 2); 
   31.28 -by (dres_inst_tac [("k","real (Suc n)")] (real_mult_le_mono1) 2); 
   31.29 +by (dres_inst_tac [("c","real (Suc n)")] (mult_right_mono) 2); 
   31.30  by (rtac real_of_nat_ge_zero 2);
   31.31  by (asm_full_simp_tac (simpset()  
   31.32  	 addsimps [real_of_nat_Suc_gt_zero RS real_not_refl2 RS not_sym, 
   31.33 @@ -214,7 +214,7 @@
   31.34  by (auto_tac (claset() addIs [isUbI,setleI],simpset()));
   31.35  by (subgoal_tac "ALL m. x*(real(Suc m)) <= t" 1);
   31.36  by (asm_full_simp_tac (simpset() addsimps 
   31.37 -                       [real_of_nat_Suc, real_add_mult_distrib2]) 1);
   31.38 +                       [real_of_nat_Suc, right_distrib]) 1);
   31.39  by (blast_tac (claset() addIs [isLubD2]) 2);
   31.40  by (asm_full_simp_tac
   31.41      (simpset() addsimps [le_diff_eq RS sym, real_diff_def]) 1);
   31.42 @@ -223,7 +223,7 @@
   31.43  by (blast_tac (claset() addSIs [isUbI,setleI]) 2);
   31.44  by (dres_inst_tac [("y","t+(-x)")] isLub_le_isUb 1);
   31.45  by (auto_tac (claset(), 
   31.46 -	      simpset() addsimps [real_of_nat_Suc,real_add_mult_distrib2]));
   31.47 +	      simpset() addsimps [real_of_nat_Suc,right_distrib]));
   31.48  qed "reals_Archimedean";
   31.49  
   31.50  (*There must be other proofs, e.g. Suc of the largest integer in the
   31.51 @@ -234,20 +234,17 @@
   31.52  by (res_inst_tac [("x","1")] exI 2);
   31.53  by (auto_tac (claset() addEs [order_less_trans],
   31.54  	      simpset() addsimps [real_of_nat_one]));
   31.55 -by (ftac (real_inverse_gt_0 RS reals_Archimedean) 1);
   31.56 +by (ftac (positive_imp_inverse_positive RS reals_Archimedean) 1);
   31.57  by (Step_tac 1 THEN res_inst_tac [("x","Suc n")] exI 1);
   31.58 -by (forw_inst_tac [("y","inverse x")] real_mult_less_mono1 1);
   31.59 +by (forw_inst_tac [("b","inverse x")] mult_strict_right_mono 1);
   31.60  by Auto_tac;  
   31.61 -by (rtac (thm "less_imp_inverse_less") 1); 
   31.62 -by (assume_tac 1); 
   31.63 -by (assume_tac 1); 
   31.64  qed "reals_Archimedean2";
   31.65  
   31.66  Goal "0 < x ==> ALL y. EX (n::nat). y < real n * x";
   31.67  by (Step_tac 1);
   31.68  by (cut_inst_tac [("x","y*inverse(x)")] reals_Archimedean2 1);
   31.69  by (Step_tac 1);
   31.70 -by (forw_inst_tac [("x","y * inverse x")] (real_mult_less_mono1) 1);
   31.71 +by (forw_inst_tac [("a","y * inverse x")] (mult_strict_right_mono) 1);
   31.72  by (auto_tac (claset(),simpset() addsimps [real_mult_assoc,real_of_nat_def]));
   31.73  qed "reals_Archimedean3";
   31.74  
    32.1 --- a/src/HOL/Real/RealArith.thy	Mon Dec 29 06:49:26 2003 +0100
    32.2 +++ b/src/HOL/Real/RealArith.thy	Thu Jan 01 10:06:32 2004 +0100
    32.3 @@ -51,7 +51,7 @@
    32.4  by simp
    32.5  
    32.6  lemma real_minus1_divide [simp]: "-1/(x::real) = - (1/x)"
    32.7 -by (simp add: real_divide_def real_minus_inverse)
    32.8 +by (simp add: real_divide_def inverse_minus_eq)
    32.9  
   32.10  lemma real_lbound_gt_zero:
   32.11       "[| (0::real) < d1; 0 < d2 |] ==> \<exists>e. 0 < e & e < d1 & e < d2"
   32.12 @@ -116,14 +116,14 @@
   32.13  by (auto intro: abs_eqI1 simp add: real_of_nat_ge_zero)
   32.14  
   32.15  lemma abs_add_one_not_less_self [simp]: "~ abs(x) + (1::real) < x"
   32.16 -apply (rule real_leD)
   32.17 +apply (simp add: linorder_not_less)
   32.18  apply (auto intro: abs_ge_self [THEN order_trans])
   32.19  done
   32.20   
   32.21  text{*Used only in Hyperreal/Lim.ML*}
   32.22  lemma abs_sum_triangle_ineq: "abs ((x::real) + y + (-l + -m)) \<le> abs(x + -l) + abs(y + -m)"
   32.23  apply (simp add: real_add_assoc)
   32.24 -apply (rule_tac x1 = y in real_add_left_commute [THEN ssubst])
   32.25 +apply (rule_tac a1 = y in add_left_commute [THEN ssubst])
   32.26  apply (rule real_add_assoc [THEN subst])
   32.27  apply (rule abs_triangle_ineq)
   32.28  done
    33.1 --- a/src/HOL/Real/RealBin.ML	Mon Dec 29 06:49:26 2003 +0100
    33.2 +++ b/src/HOL/Real/RealBin.ML	Thu Jan 01 10:06:32 2004 +0100
    33.3 @@ -65,7 +65,7 @@
    33.4  
    33.5  (*For specialist use: NOT as default simprules*)
    33.6  Goal "2 * z = (z+z::real)";
    33.7 -by (simp_tac (simpset () addsimps [lemma, real_add_mult_distrib]) 1);
    33.8 +by (simp_tac (simpset () addsimps [lemma, left_distrib]) 1);
    33.9  qed "real_mult_2";
   33.10  
   33.11  Goal "z * 2 = (z+z::real)";
   33.12 @@ -115,8 +115,7 @@
   33.13  qed "real_minus_1_eq_m1";
   33.14  
   33.15  Goal "-1 * z = -(z::real)";
   33.16 -by (simp_tac (simpset() addsimps [real_minus_1_eq_m1 RS sym,
   33.17 -                                  real_mult_minus_1]) 1);
   33.18 +by (simp_tac (simpset() addsimps [real_minus_1_eq_m1 RS sym]) 1);
   33.19  qed "real_mult_minus1";
   33.20  
   33.21  Goal "z * -1 = -(z::real)";
   33.22 @@ -195,7 +194,7 @@
   33.23  (** For combine_numerals **)
   33.24  
   33.25  Goal "i*u + (j*u + k) = (i+j)*u + (k::real)";
   33.26 -by (asm_simp_tac (simpset() addsimps [real_add_mult_distrib] @ add_ac) 1);
   33.27 +by (asm_simp_tac (simpset() addsimps [left_distrib] @ add_ac) 1);
   33.28  qed "left_real_add_mult_distrib";
   33.29  
   33.30  
   33.31 @@ -207,33 +206,33 @@
   33.32                     [less_iff_diff_less_0, eq_iff_diff_eq_0, le_iff_diff_le_0];
   33.33  
   33.34  Goal "!!i::real. (i*u + m = j*u + n) = ((i-j)*u + m = n)";
   33.35 -by (asm_simp_tac (simpset() addsimps [real_diff_def, real_add_mult_distrib]@
   33.36 -                                     real_add_ac@rel_iff_rel_0_rls) 1);
   33.37 +by (asm_simp_tac (simpset() addsimps [real_diff_def, left_distrib]@
   33.38 +                                     add_ac@rel_iff_rel_0_rls) 1);
   33.39  qed "real_eq_add_iff1";
   33.40  
   33.41  Goal "!!i::real. (i*u + m = j*u + n) = (m = (j-i)*u + n)";
   33.42 -by (asm_simp_tac (simpset() addsimps [real_diff_def, real_add_mult_distrib]@
   33.43 -                                     real_add_ac@rel_iff_rel_0_rls) 1);
   33.44 +by (asm_simp_tac (simpset() addsimps [real_diff_def, left_distrib]@
   33.45 +                                     add_ac@rel_iff_rel_0_rls) 1);
   33.46  qed "real_eq_add_iff2";
   33.47  
   33.48  Goal "!!i::real. (i*u + m < j*u + n) = ((i-j)*u + m < n)";
   33.49 -by (asm_simp_tac (simpset() addsimps [real_diff_def, real_add_mult_distrib]@
   33.50 -                                     real_add_ac@rel_iff_rel_0_rls) 1);
   33.51 +by (asm_simp_tac (simpset() addsimps [real_diff_def, left_distrib]@
   33.52 +                                     add_ac@rel_iff_rel_0_rls) 1);
   33.53  qed "real_less_add_iff1";
   33.54  
   33.55  Goal "!!i::real. (i*u + m < j*u + n) = (m < (j-i)*u + n)";
   33.56 -by (asm_simp_tac (simpset() addsimps [real_diff_def, real_add_mult_distrib]@
   33.57 -                                     real_add_ac@rel_iff_rel_0_rls) 1);
   33.58 +by (asm_simp_tac (simpset() addsimps [real_diff_def, left_distrib]@
   33.59 +                                     add_ac@rel_iff_rel_0_rls) 1);
   33.60  qed "real_less_add_iff2";
   33.61  
   33.62  Goal "!!i::real. (i*u + m <= j*u + n) = ((i-j)*u + m <= n)";
   33.63 -by (asm_simp_tac (simpset() addsimps [real_diff_def, real_add_mult_distrib]@
   33.64 -                                     real_add_ac@rel_iff_rel_0_rls) 1);
   33.65 +by (asm_simp_tac (simpset() addsimps [real_diff_def, left_distrib]@
   33.66 +                                     add_ac@rel_iff_rel_0_rls) 1);
   33.67  qed "real_le_add_iff1";
   33.68  
   33.69  Goal "!!i::real. (i*u + m <= j*u + n) = (m <= (j-i)*u + n)";
   33.70 -by (asm_simp_tac (simpset() addsimps [real_diff_def, real_add_mult_distrib]
   33.71 -                                     @real_add_ac@rel_iff_rel_0_rls) 1);
   33.72 +by (asm_simp_tac (simpset() addsimps [real_diff_def, left_distrib]
   33.73 +                                     @add_ac@rel_iff_rel_0_rls) 1);
   33.74  qed "real_le_add_iff2";
   33.75  
   33.76  
   33.77 @@ -344,21 +343,15 @@
   33.78                      bin_pred_1, bin_pred_0, bin_pred_Pls, bin_pred_Min];
   33.79  
   33.80  (*To let us treat subtraction as addition*)
   33.81 -val diff_simps = [real_diff_def, real_minus_add_distrib, real_minus_minus];
   33.82 -
   33.83 -(*push the unary minus down: - x * y = x * - y
   33.84 -val real_minus_mult_eq_1_to_2 =
   33.85 -    [real_minus_mult_eq1 RS sym, real_minus_mult_eq2] MRS trans |> standard;
   33.86 -same as real_minus_mult_commute
   33.87 -*)
   33.88 +val diff_simps = [real_diff_def, minus_add_distrib, minus_minus];
   33.89  
   33.90  (*to extract again any uncancelled minuses*)
   33.91  val real_minus_from_mult_simps =
   33.92 -    [real_minus_minus, real_mult_minus_eq1, real_mult_minus_eq2];
   33.93 +    [minus_minus, minus_mult_left RS sym, minus_mult_right RS sym];
   33.94  
   33.95  (*combine unary minus with numeric literals, however nested within a product*)
   33.96  val real_mult_minus_simps =
   33.97 -    [real_mult_assoc, real_minus_mult_eq1, real_minus_mult_commute];
   33.98 +    [real_mult_assoc, minus_mult_left, real_minus_mult_commute];
   33.99  
  33.100  (*Apply the given rewrite (if present) just once*)
  33.101  fun trans_tac None      = all_tac
  33.102 @@ -367,8 +360,8 @@
  33.103  (*Final simplification: cancel + and *  *)
  33.104  val simplify_meta_eq =
  33.105      Int_Numeral_Simprocs.simplify_meta_eq
  33.106 -         [real_add_zero_left, real_add_zero_right,
  33.107 -          real_mult_0, real_mult_0_right, real_mult_1, real_mult_1_right];
  33.108 +         [add_0, add_0_right,
  33.109 +          mult_left_zero, mult_right_zero, mult_1, mult_1_right];
  33.110  
  33.111  fun prep_simproc (name, pats, proc) =
  33.112    Simplifier.simproc (Theory.sign_of (the_context ())) name pats proc;
  33.113 @@ -383,11 +376,11 @@
  33.114    val trans_tac         = trans_tac
  33.115    val norm_tac =
  33.116       ALLGOALS (simp_tac (HOL_ss addsimps add_0s@mult_1s@diff_simps@
  33.117 -                                         real_minus_simps@real_add_ac))
  33.118 +                                         real_minus_simps@add_ac))
  33.119       THEN ALLGOALS (simp_tac (HOL_ss addsimps non_add_bin_simps@real_mult_minus_simps))
  33.120       THEN ALLGOALS
  33.121                (simp_tac (HOL_ss addsimps real_minus_from_mult_simps@
  33.122 -                                         real_add_ac@real_mult_ac))
  33.123 +                                         add_ac@mult_ac))
  33.124    val numeral_simp_tac  = ALLGOALS (simp_tac (HOL_ss addsimps add_0s@bin_simps))
  33.125    val simplify_meta_eq  = simplify_meta_eq
  33.126    end;
  33.127 @@ -451,10 +444,10 @@
  33.128    val trans_tac         = trans_tac
  33.129    val norm_tac =
  33.130       ALLGOALS (simp_tac (HOL_ss addsimps numeral_syms@add_0s@mult_1s@
  33.131 -                                   diff_simps@real_minus_simps@real_add_ac))
  33.132 +                                   diff_simps@real_minus_simps@add_ac))
  33.133       THEN ALLGOALS (simp_tac (HOL_ss addsimps non_add_bin_simps@real_mult_minus_simps))
  33.134       THEN ALLGOALS (simp_tac (HOL_ss addsimps real_minus_from_mult_simps@
  33.135 -                                              real_add_ac@real_mult_ac))
  33.136 +                                              add_ac@mult_ac))
  33.137    val numeral_simp_tac  = ALLGOALS
  33.138                      (simp_tac (HOL_ss addsimps add_0s@bin_simps))
  33.139    val simplify_meta_eq  =
  33.140 @@ -582,7 +575,7 @@
  33.141    val sg_ref    = Sign.self_ref (Theory.sign_of (the_context ()))
  33.142    val T      = HOLogic.realT
  33.143    val plus   = Const ("op *", [HOLogic.realT,HOLogic.realT] ---> HOLogic.realT)
  33.144 -  val add_ac = real_mult_ac
  33.145 +  val add_ac = mult_ac
  33.146  end;
  33.147  
  33.148  structure Real_Times_Assoc = Assoc_Fold (Real_Times_Assoc_Data);
  33.149 @@ -594,23 +587,4 @@
  33.150  AddIffs [eq_iff_diff_eq_0 RS sym];
  33.151  AddIffs [le_iff_diff_le_0 RS sym];
  33.152  
  33.153 -(** <= monotonicity results: needed for arithmetic **)
  33.154 -
  33.155 -Goal "[| i <= j;  (0::real) <= k |] ==> i*k <= j*k";
  33.156 -by (auto_tac (claset(),
  33.157 -              simpset() addsimps [order_le_less, real_mult_less_mono1]));
  33.158 -qed "real_mult_le_mono1";
  33.159 -
  33.160 -Goal "[| i <= j;  (0::real) <= k |] ==> k*i <= k*j";
  33.161 -by (dtac real_mult_le_mono1 1);
  33.162 -by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [real_mult_commute])));
  33.163 -qed "real_mult_le_mono2";
  33.164 -
  33.165 -Goal "[| (i::real) <= j;  k <= l;  0 <= j;  0 <= k |] ==> i*k <= j*l";
  33.166 -by (etac (real_mult_le_mono1 RS order_trans) 1);
  33.167 -by (assume_tac 1);
  33.168 -by (etac real_mult_le_mono2 1);
  33.169 -by (assume_tac 1);
  33.170 -qed "real_mult_le_mono";
  33.171 -
  33.172  Addsimps [real_minus_1_eq_m1];
    34.1 --- a/src/HOL/Real/RealDef.thy	Mon Dec 29 06:49:26 2003 +0100
    34.2 +++ b/src/HOL/Real/RealDef.thy	Thu Jan 01 10:06:32 2004 +0100
    34.3 @@ -107,6 +107,9 @@
    34.4    real_le_def:
    34.5    "P \<le> (Q::real) == ~(Q < P)"
    34.6  
    34.7 +  real_abs_def:  "abs (r::real) == (if 0 \<le> r then r else -r)"
    34.8 +
    34.9 +
   34.10  syntax (xsymbols)
   34.11    Reals     :: "'a set"                   ("\<real>")
   34.12    Nats      :: "'a set"                   ("\<nat>")
   34.13 @@ -182,48 +185,6 @@
   34.14  apply (simp add: Rep_REAL_inverse)
   34.15  done
   34.16  
   34.17 -(**** real_minus: additive inverse on real ****)
   34.18 -
   34.19 -lemma real_minus_congruent:
   34.20 -  "congruent realrel (%p. (%(x,y). realrel``{(y,x)}) p)"
   34.21 -apply (unfold congruent_def, clarify)
   34.22 -apply (simp add: preal_add_commute)
   34.23 -done
   34.24 -
   34.25 -lemma real_minus:
   34.26 -      "- (Abs_REAL(realrel``{(x,y)})) = Abs_REAL(realrel `` {(y,x)})"
   34.27 -apply (unfold real_minus_def)
   34.28 -apply (rule_tac f = Abs_REAL in arg_cong)
   34.29 -apply (simp add: realrel_in_real [THEN Abs_REAL_inverse] 
   34.30 -            UN_equiv_class [OF equiv_realrel real_minus_congruent])
   34.31 -done
   34.32 -
   34.33 -lemma real_minus_minus: "- (- z) = (z::real)"
   34.34 -apply (rule_tac z = z in eq_Abs_REAL)
   34.35 -apply (simp add: real_minus)
   34.36 -done
   34.37 -
   34.38 -declare real_minus_minus [simp]
   34.39 -
   34.40 -lemma inj_real_minus: "inj(%r::real. -r)"
   34.41 -apply (rule inj_onI)
   34.42 -apply (drule_tac f = uminus in arg_cong)
   34.43 -apply (simp add: real_minus_minus)
   34.44 -done
   34.45 -
   34.46 -lemma real_minus_zero: "- 0 = (0::real)"
   34.47 -apply (unfold real_zero_def)
   34.48 -apply (simp add: real_minus)
   34.49 -done
   34.50 -
   34.51 -declare real_minus_zero [simp]
   34.52 -
   34.53 -lemma real_minus_zero_iff: "(-x = 0) = (x = (0::real))"
   34.54 -apply (rule_tac z = x in eq_Abs_REAL)
   34.55 -apply (auto simp add: real_zero_def real_minus preal_add_ac)
   34.56 -done
   34.57 -
   34.58 -declare real_minus_zero_iff [simp]
   34.59  
   34.60  subsection{*Congruence property for addition*}
   34.61  
   34.62 @@ -258,27 +219,14 @@
   34.63  apply (simp add: real_add preal_add_assoc)
   34.64  done
   34.65  
   34.66 -(*For AC rewriting*)
   34.67 -lemma real_add_left_commute: "(x::real)+(y+z)=y+(x+z)"
   34.68 -  apply (rule mk_left_commute [of "op +"])
   34.69 -  apply (rule real_add_assoc)
   34.70 -  apply (rule real_add_commute)
   34.71 -  done
   34.72 -
   34.73 -
   34.74 -(* real addition is an AC operator *)
   34.75 -lemmas real_add_ac = real_add_assoc real_add_commute real_add_left_commute
   34.76 -
   34.77  lemma real_add_zero_left: "(0::real) + z = z"
   34.78  apply (unfold real_of_preal_def real_zero_def)
   34.79  apply (rule_tac z = z in eq_Abs_REAL)
   34.80  apply (simp add: real_add preal_add_ac)
   34.81  done
   34.82 -declare real_add_zero_left [simp]
   34.83  
   34.84  lemma real_add_zero_right: "z + (0::real) = z"
   34.85 -by (simp add: real_add_commute)
   34.86 -declare real_add_zero_right [simp]
   34.87 +by (simp add: real_add_zero_left real_add_commute)
   34.88  
   34.89  instance real :: plus_ac0
   34.90    by (intro_classes,
   34.91 @@ -286,16 +234,27 @@
   34.92         rule real_add_commute real_add_assoc real_add_zero_left)+)
   34.93  
   34.94  
   34.95 -lemma real_add_minus: "z + (-z) = (0::real)"
   34.96 +subsection{*Additive Inverse on real*}
   34.97 +
   34.98 +lemma real_minus_congruent:
   34.99 +  "congruent realrel (%p. (%(x,y). realrel``{(y,x)}) p)"
  34.100 +apply (unfold congruent_def, clarify)
  34.101 +apply (simp add: preal_add_commute)
  34.102 +done
  34.103 +
  34.104 +lemma real_minus:
  34.105 +      "- (Abs_REAL(realrel``{(x,y)})) = Abs_REAL(realrel `` {(y,x)})"
  34.106 +apply (unfold real_minus_def)
  34.107 +apply (rule_tac f = Abs_REAL in arg_cong)
  34.108 +apply (simp add: realrel_in_real [THEN Abs_REAL_inverse] 
  34.109 +            UN_equiv_class [OF equiv_realrel real_minus_congruent])
  34.110 +done
  34.111 +
  34.112 +lemma real_add_minus_left: "(-z) + z = (0::real)"
  34.113  apply (unfold real_zero_def)
  34.114  apply (rule_tac z = z in eq_Abs_REAL)
  34.115  apply (simp add: real_minus real_add preal_add_commute)
  34.116  done
  34.117 -declare real_add_minus [simp]
  34.118 -
  34.119 -lemma real_add_minus_left: "(-z) + z = (0::real)"
  34.120 -by (simp add: real_add_commute)
  34.121 -declare real_add_minus_left [simp]
  34.122  
  34.123  
  34.124  subsection{*Congruence property for multiplication*}
  34.125 @@ -340,77 +299,12 @@
  34.126  apply (simp add: preal_add_mult_distrib2 real_mult preal_add_ac preal_mult_ac)
  34.127  done
  34.128  
  34.129 -
  34.130 -(*For AC rewriting*)
  34.131 -lemma real_mult_left_commute: "(x::real)*(y*z)=y*(x*z)"
  34.132 -  apply (rule mk_left_commute [of "op *"])
  34.133 -  apply (rule real_mult_assoc)
  34.134 -  apply (rule real_mult_commute)
  34.135 -  done
  34.136 -
  34.137 -(* real multiplication is an AC operator *)
  34.138 -lemmas real_mult_ac = real_mult_assoc real_mult_commute real_mult_left_commute
  34.139 -
  34.140  lemma real_mult_1: "(1::real) * z = z"
  34.141  apply (unfold real_one_def pnat_one_def)
  34.142  apply (rule_tac z = z in eq_Abs_REAL)
  34.143 -apply (simp add: real_mult preal_add_mult_distrib2 preal_mult_1_right preal_mult_ac preal_add_ac)
  34.144 -done
  34.145 -
  34.146 -declare real_mult_1 [simp]
  34.147 -
  34.148 -lemma real_mult_1_right: "z * (1::real) = z"
  34.149 -by (simp add: real_mult_commute)
  34.150 -
  34.151 -declare real_mult_1_right [simp]
  34.152 -
  34.153 -lemma real_mult_0: "0 * z = (0::real)"
  34.154 -apply (unfold real_zero_def pnat_one_def)
  34.155 -apply (rule_tac z = z in eq_Abs_REAL)
  34.156 -apply (simp add: real_mult preal_add_mult_distrib2 preal_mult_1_right preal_mult_ac preal_add_ac)
  34.157 -done
  34.158 -
  34.159 -lemma real_mult_0_right: "z * 0 = (0::real)"
  34.160 -by (simp add: real_mult_commute real_mult_0)
  34.161 -
  34.162 -declare real_mult_0_right [simp] real_mult_0 [simp]
  34.163 -
  34.164 -lemma real_mult_minus_eq1: "(-x) * (y::real) = -(x * y)"
  34.165 -apply (rule_tac z = x in eq_Abs_REAL)
  34.166 -apply (rule_tac z = y in eq_Abs_REAL)
  34.167 -apply (auto simp add: real_minus real_mult preal_mult_ac preal_add_ac)
  34.168 +apply (simp add: real_mult preal_add_mult_distrib2 preal_mult_1_right
  34.169 +                 preal_mult_ac preal_add_ac)
  34.170  done
  34.171 -declare real_mult_minus_eq1 [simp]
  34.172 -
  34.173 -lemmas real_minus_mult_eq1 = real_mult_minus_eq1 [symmetric, standard]
  34.174 -
  34.175 -lemma real_mult_minus_eq2: "x * (- y :: real) = -(x * y)"
  34.176 -by (simp add: real_mult_commute [of x])
  34.177 -declare real_mult_minus_eq2 [simp]
  34.178 -
  34.179 -lemmas real_minus_mult_eq2 = real_mult_minus_eq2 [symmetric, standard]
  34.180 -
  34.181 -lemma real_mult_minus_1: "(- (1::real)) * z = -z"
  34.182 -by simp
  34.183 -declare real_mult_minus_1 [simp]
  34.184 -
  34.185 -lemma real_mult_minus_1_right: "z * (- (1::real)) = -z"
  34.186 -by (subst real_mult_commute, simp)
  34.187 -declare real_mult_minus_1_right [simp]
  34.188 -
  34.189 -lemma real_minus_mult_cancel: "(-x) * (-y) = x * (y::real)"
  34.190 -by simp
  34.191 -
  34.192 -declare real_minus_mult_cancel [simp]
  34.193 -
  34.194 -lemma real_minus_mult_commute: "(-x) * y = x * (- y :: real)"
  34.195 -by simp
  34.196 -
  34.197 -(** Lemmas **)
  34.198 -
  34.199 -lemma real_add_assoc_cong:
  34.200 -     "(z::real) + v = z' + v' ==> z + (v + w) = z' + (v' + w)"
  34.201 -by (simp add: real_add_assoc [symmetric])
  34.202  
  34.203  lemma real_add_mult_distrib: "((z1::real) + z2) * w = (z1 * w) + (z2 * w)"
  34.204  apply (rule_tac z = z1 in eq_Abs_REAL)
  34.205 @@ -419,17 +313,6 @@
  34.206  apply (simp add: preal_add_mult_distrib2 real_add real_mult preal_add_ac preal_mult_ac)
  34.207  done
  34.208  
  34.209 -lemma real_add_mult_distrib2: "(w::real) * (z1 + z2) = (w * z1) + (w * z2)"
  34.210 -by (simp add: real_mult_commute [of w] real_add_mult_distrib)
  34.211 -
  34.212 -lemma real_diff_mult_distrib: "((z1::real) - z2) * w = (z1 * w) - (z2 * w)"
  34.213 -apply (unfold real_diff_def)
  34.214 -apply (simp add: real_add_mult_distrib)
  34.215 -done
  34.216 -
  34.217 -lemma real_diff_mult_distrib2: "(w::real) * (z1 - z2) = (w * z1) - (w * z2)"
  34.218 -by (simp add: real_mult_commute [of w] real_diff_mult_distrib)
  34.219 -
  34.220  text{*one and zero are distinct*}
  34.221  lemma real_zero_not_eq_one: "0 ~= (1::real)"
  34.222  apply (unfold real_zero_def real_one_def)
  34.223 @@ -443,36 +326,77 @@
  34.224  apply (auto simp add: preal_add_commute)
  34.225  done
  34.226  
  34.227 -lemma real_mult_inv_right_ex:
  34.228 -          "!!(x::real). x ~= 0 ==> \<exists>y. x*y = (1::real)"
  34.229 +lemma real_mult_inv_left_ex: "x ~= 0 ==> \<exists>y. y*x = (1::real)"
  34.230  apply (unfold real_zero_def real_one_def)
  34.231  apply (rule_tac z = x in eq_Abs_REAL)
  34.232  apply (cut_tac x = xa and y = y in linorder_less_linear)
  34.233  apply (auto dest!: preal_less_add_left_Ex simp add: real_zero_iff [symmetric])
  34.234 -apply (rule_tac x = "Abs_REAL (realrel `` { (preal_of_prat (prat_of_pnat 1), pinv (D) + preal_of_prat (prat_of_pnat 1))}) " in exI)
  34.235 -apply (rule_tac [2] x = "Abs_REAL (realrel `` { (pinv (D) + preal_of_prat (prat_of_pnat 1), preal_of_prat (prat_of_pnat 1))}) " in exI)
  34.236 +apply (rule_tac
  34.237 +        x = "Abs_REAL (realrel `` { (preal_of_prat (prat_of_pnat 1), 
  34.238 +                            pinv (D) + preal_of_prat (prat_of_pnat 1))}) " 
  34.239 +       in exI)
  34.240 +apply (rule_tac [2]
  34.241 +        x = "Abs_REAL (realrel `` { (pinv (D) + preal_of_prat (prat_of_pnat 1),
  34.242 +                   preal_of_prat (prat_of_pnat 1))})" 
  34.243 +       in exI)
  34.244  apply (auto simp add: real_mult pnat_one_def preal_mult_1_right
  34.245                preal_add_mult_distrib2 preal_add_mult_distrib preal_mult_1
  34.246                preal_mult_inv_right preal_add_ac preal_mult_ac)
  34.247  done
  34.248  
  34.249 -lemma real_mult_inv_left_ex: "x ~= 0 ==> \<exists>y. y*x = (1::real)"
  34.250 -apply (drule real_mult_inv_right_ex)
  34.251 -apply (auto simp add: real_mult_commute)
  34.252 -done
  34.253 -
  34.254  lemma real_mult_inv_left: "x ~= 0 ==> inverse(x)*x = (1::real)"
  34.255  apply (unfold real_inverse_def)
  34.256  apply (frule real_mult_inv_left_ex, safe)
  34.257  apply (rule someI2, auto)
  34.258  done
  34.259 -declare real_mult_inv_left [simp]
  34.260 +
  34.261 +instance real :: field
  34.262 +proof
  34.263 +  fix x y z :: real
  34.264 +  show "(x + y) + z = x + (y + z)" by (rule real_add_assoc)
  34.265 +  show "x + y = y + x" by (rule real_add_commute)
  34.266 +  show "0 + x = x" by simp
  34.267 +  show "- x + x = 0" by (rule real_add_minus_left)
  34.268 +  show "x - y = x + (-y)" by (simp add: real_diff_def)
  34.269 +  show "(x * y) * z = x * (y * z)" by (rule real_mult_assoc)
  34.270 +  show "x * y = y * x" by (rule real_mult_commute)
  34.271 +  show "1 * x = x" by (rule real_mult_1)
  34.272 +  show "(x + y) * z = x * z + y * z" by (simp add: real_add_mult_distrib)
  34.273 +  show "0 \<noteq> (1::real)" by (rule real_zero_not_eq_one)
  34.274 +  show "x \<noteq> 0 ==> inverse x * x = 1" by (rule real_mult_inv_left)
  34.275 +  show "y \<noteq> 0 ==> x / y = x * inverse y" by (simp add: real_divide_def)
  34.276 +qed
  34.277 +
  34.278 +
  34.279 +(** Inverse of zero!  Useful to simplify certain equations **)
  34.280  
  34.281 -lemma real_mult_inv_right: "x ~= 0 ==> x*inverse(x) = (1::real)"
  34.282 -apply (subst real_mult_commute)
  34.283 -apply (auto simp add: real_mult_inv_left)
  34.284 +lemma INVERSE_ZERO: "inverse 0 = (0::real)"
  34.285 +apply (unfold real_inverse_def)
  34.286 +apply (rule someI2)
  34.287 +apply (auto simp add: zero_neq_one)
  34.288  done
  34.289 -declare real_mult_inv_right [simp]
  34.290 +
  34.291 +lemma DIVISION_BY_ZERO: "a / (0::real) = 0"
  34.292 +  by (simp add: real_divide_def INVERSE_ZERO)
  34.293 +
  34.294 +instance real :: division_by_zero
  34.295 +proof
  34.296 +  fix x :: real
  34.297 +  show "inverse 0 = (0::real)" by (rule INVERSE_ZERO)
  34.298 +  show "x/0 = 0" by (rule DIVISION_BY_ZERO) 
  34.299 +qed
  34.300 +
  34.301 +
  34.302 +(*Pull negations out*)
  34.303 +declare minus_mult_right [symmetric, simp] 
  34.304 +        minus_mult_left [symmetric, simp]
  34.305 +
  34.306 +text{*Used in RealBin*}
  34.307 +lemma real_minus_mult_commute: "(-x) * y = x * (- y :: real)"
  34.308 +by simp
  34.309 +
  34.310 +lemma real_mult_1_right: "z * (1::real) = z"
  34.311 +  by (rule Ring_and_Field.mult_1_right)
  34.312  
  34.313  
  34.314  subsection{*Theorems for Ordering*}
  34.315 @@ -714,8 +638,6 @@
  34.316  apply (blast intro!: real_of_preal_minus_less_rev1 real_of_preal_minus_less_rev2)
  34.317  done
  34.318  
  34.319 -declare real_of_preal_minus_less_rev_iff [simp]
  34.320 -
  34.321  
  34.322  subsection{*Linearity of the Ordering*}
  34.323  
  34.324 @@ -724,7 +646,8 @@
  34.325  apply (rule_tac [!] x = y in real_of_preal_trichotomyE)
  34.326  apply (auto dest!: preal_le_anti_sym 
  34.327              simp add: preal_less_le_iff real_of_preal_minus_less_zero 
  34.328 -                      real_of_preal_zero_less real_of_preal_minus_less_all)
  34.329 +                      real_of_preal_zero_less real_of_preal_minus_less_all
  34.330 +                      real_of_preal_minus_less_rev_iff)
  34.331  done
  34.332  
  34.333  lemma real_neq_iff: "!!w::real. (w ~= z) = (w<z | z<w)"
  34.334 @@ -769,23 +692,498 @@
  34.335  val eq_Abs_REAL = thm"eq_Abs_REAL";
  34.336  val real_minus_congruent = thm"real_minus_congruent";
  34.337  val real_minus = thm"real_minus";
  34.338 -val real_minus_minus = thm"real_minus_minus";
  34.339 -val inj_real_minus = thm"inj_real_minus";
  34.340 -val real_minus_zero = thm"real_minus_zero";
  34.341 -val real_minus_zero_iff = thm"real_minus_zero_iff";
  34.342 -val real_add_congruent2_lemma = thm"real_add_congruent2_lemma";
  34.343  val real_add = thm"real_add";
  34.344  val real_add_commute = thm"real_add_commute";
  34.345  val real_add_assoc = thm"real_add_assoc";
  34.346 -val real_add_left_commute = thm"real_add_left_commute";
  34.347  val real_add_zero_left = thm"real_add_zero_left";
  34.348  val real_add_zero_right = thm"real_add_zero_right";
  34.349 -val real_add_minus = thm"real_add_minus";
  34.350 -val real_add_minus_left = thm"real_add_minus_left";
  34.351  
  34.352 -val real_add_ac = thms"real_add_ac";
  34.353 -val real_mult_ac = thms"real_mult_ac";
  34.354  *}
  34.355  
  34.356 +subsection{*Properties of Less-Than Or Equals*}
  34.357 +
  34.358 +lemma real_le_imp_less_or_eq: "!!(x::real). x \<le> y ==> x < y | x = y"
  34.359 +apply (unfold real_le_def)
  34.360 +apply (cut_tac real_linear)
  34.361 +apply (blast elim: real_less_irrefl real_less_asym)
  34.362 +done
  34.363 +
  34.364 +lemma real_less_or_eq_imp_le: "z<w | z=w ==> z \<le>(w::real)"
  34.365 +apply (unfold real_le_def)
  34.366 +apply (cut_tac real_linear)
  34.367 +apply (fast elim: real_less_irrefl real_less_asym)
  34.368 +done
  34.369 +
  34.370 +lemma real_le_less: "(x \<le> (y::real)) = (x < y | x=y)"
  34.371 +by (blast intro!: real_less_or_eq_imp_le dest!: real_le_imp_less_or_eq)
  34.372 +
  34.373 +lemma real_le_refl: "w \<le> (w::real)"
  34.374 +by (simp add: real_le_less)
  34.375 +
  34.376 +lemma real_le_trans: "[| i \<le> j; j \<le> k |] ==> i \<le> (k::real)"
  34.377 +apply (drule real_le_imp_less_or_eq) 
  34.378 +apply (drule real_le_imp_less_or_eq) 
  34.379 +apply (rule real_less_or_eq_imp_le) 
  34.380 +apply (blast intro: real_less_trans) 
  34.381 +done
  34.382 +
  34.383 +lemma real_le_anti_sym: "[| z \<le> w; w \<le> z |] ==> z = (w::real)"
  34.384 +apply (drule real_le_imp_less_or_eq) 
  34.385 +apply (drule real_le_imp_less_or_eq) 
  34.386 +apply (fast elim: real_less_irrefl real_less_asym)
  34.387 +done
  34.388 +
  34.389 +(* Axiom 'order_less_le' of class 'order': *)
  34.390 +lemma real_less_le: "((w::real) < z) = (w \<le> z & w \<noteq> z)"
  34.391 +apply (simp add: real_le_def real_neq_iff)
  34.392 +apply (blast elim!: real_less_asym)
  34.393 +done
  34.394 +
  34.395 +instance real :: order
  34.396 +  by (intro_classes,
  34.397 +      (assumption | 
  34.398 +       rule real_le_refl real_le_trans real_le_anti_sym real_less_le)+)
  34.399 +
  34.400 +(* Axiom 'linorder_linear' of class 'linorder': *)
  34.401 +lemma real_le_linear: "(z::real) \<le> w | w \<le> z"
  34.402 +apply (simp add: real_le_less)
  34.403 +apply (cut_tac real_linear, blast)
  34.404 +done
  34.405 +
  34.406 +instance real :: linorder
  34.407 +  by (intro_classes, rule real_le_linear)
  34.408 +
  34.409 +
  34.410 +subsection{*Theorems About the Ordering*}
  34.411 +
  34.412 +lemma real_gt_zero_preal_Ex: "(0 < x) = (\<exists>y. x = real_of_preal y)"
  34.413 +apply (auto simp add: real_of_preal_zero_less)
  34.414 +apply (cut_tac x = x in real_of_preal_trichotomy)
  34.415 +apply (blast elim!: real_less_irrefl real_of_preal_not_minus_gt_zero [THEN notE])
  34.416 +done
  34.417 +
  34.418 +lemma real_gt_preal_preal_Ex:
  34.419 +     "real_of_preal z < x ==> \<exists>y. x = real_of_preal y"
  34.420 +by (blast dest!: real_of_preal_zero_less [THEN real_less_trans]
  34.421 +             intro: real_gt_zero_preal_Ex [THEN iffD1])
  34.422 +
  34.423 +lemma real_ge_preal_preal_Ex:
  34.424 +     "real_of_preal z \<le> x ==> \<exists>y. x = real_of_preal y"
  34.425 +by (blast dest: order_le_imp_less_or_eq real_gt_preal_preal_Ex)
  34.426 +
  34.427 +lemma real_less_all_preal: "y \<le> 0 ==> \<forall>x. y < real_of_preal x"
  34.428 +by (auto elim: order_le_imp_less_or_eq [THEN disjE] 
  34.429 +            intro: real_of_preal_zero_less [THEN [2] real_less_trans] 
  34.430 +            simp add: real_of_preal_zero_less)
  34.431 +
  34.432 +lemma real_less_all_real2: "~ 0 < y ==> \<forall>x. y < real_of_preal x"
  34.433 +by (blast intro!: real_less_all_preal linorder_not_less [THEN iffD1])
  34.434 +
  34.435 +lemma real_of_preal_le_iff:
  34.436 +     "(real_of_preal m1 \<le> real_of_preal m2) = (m1 \<le> m2)"
  34.437 +apply (auto intro!: preal_leI simp add: linorder_not_less [symmetric])
  34.438 +done
  34.439 +
  34.440 +
  34.441 +subsection{*Monotonicity of Addition*}
  34.442 +
  34.443 +lemma real_mult_order: "[| 0 < x; 0 < y |] ==> (0::real) < x * y"
  34.444 +apply (auto simp add: real_gt_zero_preal_Ex)
  34.445 +apply (rule_tac x = "y*ya" in exI)
  34.446 +apply (simp (no_asm_use) add: real_of_preal_mult)
  34.447 +done
  34.448 +
  34.449 +(*Alternative definition for real_less*)
  34.450 +lemma real_less_add_positive_left_Ex: "R < S ==> \<exists>T::real. 0 < T & R + T = S"
  34.451 +apply (rule_tac x = R in real_of_preal_trichotomyE)
  34.452 +apply (rule_tac [!] x = S in real_of_preal_trichotomyE)
  34.453 +apply (auto dest!: preal_less_add_left_Ex simp add: real_of_preal_not_minus_gt_all real_of_preal_add real_of_preal_not_less_zero real_less_not_refl real_of_preal_not_minus_gt_zero real_of_preal_minus_less_rev_iff)
  34.454 +apply (rule real_of_preal_zero_less) 
  34.455 +apply (rule_tac [1] x = "real_of_preal m+real_of_preal ma" in exI)
  34.456 +apply (rule_tac [2] x = "real_of_preal D" in exI)
  34.457 +apply (auto simp add: real_of_preal_minus_less_rev_iff real_of_preal_zero_less real_of_preal_sum_zero_less real_add_assoc)
  34.458 +apply (simp add: real_add_assoc [symmetric])
  34.459 +done
  34.460 +
  34.461 +lemma real_less_sum_gt_zero: "(W < S) ==> (0 < S + (-W::real))"
  34.462 +apply (drule real_less_add_positive_left_Ex)
  34.463 +apply (auto simp add: add_ac)
  34.464 +done
  34.465 +
  34.466 +lemma real_lemma_change_eq_subj: "!!S::real. T = S + W ==> S = T + (-W)"
  34.467 +by (simp add: add_ac)
  34.468 +
  34.469 +(* FIXME: long! *)
  34.470 +lemma real_sum_gt_zero_less: "(0 < S + (-W::real)) ==> (W < S)"
  34.471 +apply (rule ccontr)
  34.472 +apply (drule linorder_not_less [THEN iffD1, THEN real_le_imp_less_or_eq])
  34.473 +apply (auto simp add: real_less_not_refl)
  34.474 +apply (drule real_less_add_positive_left_Ex, clarify, simp)
  34.475 +apply (drule real_lemma_change_eq_subj, auto)
  34.476 +apply (drule real_less_sum_gt_zero)
  34.477 +apply (auto elim: real_less_asym simp add: add_left_commute [of W] add_ac)
  34.478 +done
  34.479 +
  34.480 +lemma real_mult_less_mono2: "[| (0::real) < z; x < y |] ==> z * x < z * y"
  34.481 +apply (rule real_sum_gt_zero_less)
  34.482 +apply (drule real_less_sum_gt_zero [of x y])
  34.483 +apply (drule real_mult_order, assumption)
  34.484 +apply (simp add: right_distrib)
  34.485 +done
  34.486 +
  34.487 +lemma real_less_sum_gt_0_iff: "(0 < S + (-W::real)) = (W < S)"
  34.488 +by (blast intro: real_less_sum_gt_zero real_sum_gt_zero_less)
  34.489 +
  34.490 +lemma real_less_eq_diff: "(x<y) = (x-y < (0::real))"
  34.491 +apply (unfold real_diff_def)
  34.492 +apply (subst real_minus_zero_less_iff [symmetric])
  34.493 +apply (simp add: real_add_commute real_less_sum_gt_0_iff)
  34.494 +done
  34.495 +
  34.496 +lemma real_less_eqI: "(x::real) - y = x' - y' ==> (x<y) = (x'<y')"
  34.497 +apply (subst real_less_eq_diff)
  34.498 +apply (rule_tac y1 = y in real_less_eq_diff [THEN ssubst], simp)
  34.499 +done
  34.500 +
  34.501 +lemma real_le_eqI: "(x::real) - y = x' - y' ==> (y\<le>x) = (y'\<le>x')"
  34.502 +apply (drule real_less_eqI)
  34.503 +apply (simp add: real_le_def)
  34.504 +done
  34.505 +
  34.506 +lemma real_add_left_mono: "x \<le> y ==> z + x \<le> z + (y::real)"
  34.507 +apply (rule real_le_eqI [THEN iffD1]) 
  34.508 + prefer 2 apply assumption
  34.509 +apply (simp add: real_diff_def add_ac)
  34.510 +done
  34.511 +
  34.512 +
  34.513 +subsection{*The Reals Form an Ordered Field*}
  34.514 +
  34.515 +instance real :: ordered_field
  34.516 +proof
  34.517 +  fix x y z :: real
  34.518 +  show "x \<le> y ==> z + x \<le> z + y" by (rule real_add_left_mono)
  34.519 +  show "x < y ==> 0 < z ==> z * x < z * y" by (simp add: real_mult_less_mono2)
  34.520 +  show "\<bar>x\<bar> = (if x < 0 then -x else x)"
  34.521 +    by (auto dest: order_le_less_trans simp add: real_abs_def linorder_not_le)
  34.522 +qed
  34.523 +
  34.524 +text{*These two need to be proved in @{text Ring_and_Field}*}
  34.525 +lemma real_add_less_le_mono: "[| w'<w; z'\<le>z |] ==> w' + z' < w + (z::real)"
  34.526 +apply (erule add_strict_right_mono [THEN order_less_le_trans])
  34.527 +apply (erule add_left_mono) 
  34.528 +done
  34.529 +
  34.530 +lemma real_add_le_less_mono:
  34.531 +     "!!z z'::real. [| w'\<le>w; z'<z |] ==> w' + z' < w + z"
  34.532 +apply (erule add_right_mono [THEN order_le_less_trans])
  34.533 +apply (erule add_strict_left_mono) 
  34.534 +done
  34.535 +
  34.536 +lemma real_zero_less_one: "0 < (1::real)"
  34.537 +  by (rule Ring_and_Field.zero_less_one)
  34.538 +
  34.539 +lemma real_le_square [simp]: "(0::real) \<le> x*x"
  34.540 + by (rule Ring_and_Field.zero_le_square)
  34.541 +
  34.542 +
  34.543 +subsection{*More Lemmas*}
  34.544 +
  34.545 +lemma real_mult_left_cancel: "(c::real) \<noteq> 0 ==> (c*a=c*b) = (a=b)"
  34.546 +by auto
  34.547 +
  34.548 +lemma real_mult_right_cancel: "(c::real) \<noteq> 0 ==> (a*c=b*c) = (a=b)"
  34.549 +by auto
  34.550 +
  34.551 +text{*The precondition could be weakened to @{term "0\<le>x"}*}
  34.552 +lemma real_mult_less_mono:
  34.553 +     "[| u<v;  x<y;  (0::real) < v;  0 < x |] ==> u*x < v* y"
  34.554 + by (simp add: Ring_and_Field.mult_strict_mono order_less_imp_le)
  34.555 +
  34.556 +lemma real_mult_less_iff1 [simp]: "(0::real) < z ==> (x*z < y*z) = (x < y)"
  34.557 +  by (force elim: order_less_asym
  34.558 +            simp add: Ring_and_Field.mult_less_cancel_right)
  34.559 +
  34.560 +lemma real_mult_le_cancel_iff1 [simp]: "(0::real) < z ==> (x*z \<le> y*z) = (x\<le>y)"
  34.561 +by (auto simp add: real_le_def)
  34.562 +
  34.563 +lemma real_mult_le_cancel_iff2 [simp]: "(0::real) < z ==> (z*x \<le> z*y) = (x\<le>y)"
  34.564 +  by (force elim: order_less_asym
  34.565 +            simp add: Ring_and_Field.mult_le_cancel_left)
  34.566 +
  34.567 +text{*Only two uses?*}
  34.568 +lemma real_mult_less_mono':
  34.569 +     "[| x < y;  r1 < r2;  (0::real) \<le> r1;  0 \<le> x|] ==> r1 * x < r2 * y"
  34.570 + by (rule Ring_and_Field.mult_strict_mono')
  34.571 +
  34.572 +text{*FIXME: delete or at least combine the next two lemmas*}
  34.573 +lemma real_sum_squares_cancel: "x * x + y * y = 0 ==> x = (0::real)"
  34.574 +apply (drule Ring_and_Field.equals_zero_I [THEN sym])
  34.575 +apply (cut_tac x = y in real_le_square) 
  34.576 +apply (auto, drule real_le_anti_sym, auto)
  34.577 +done
  34.578 +
  34.579 +lemma real_sum_squares_cancel2: "x * x + y * y = 0 ==> y = (0::real)"
  34.580 +apply (rule_tac y = x in real_sum_squares_cancel)
  34.581 +apply (simp add: real_add_commute)
  34.582 +done
  34.583 +
  34.584 +
  34.585 +lemma real_add_order: "[| 0 < x; 0 < y |] ==> (0::real) < x + y"
  34.586 +apply (drule add_strict_mono [of concl: 0 0], assumption)
  34.587 +apply simp 
  34.588 +done
  34.589 +
  34.590 +lemma real_le_add_order: "[| 0 \<le> x; 0 \<le> y |] ==> (0::real) \<le> x + y"
  34.591 +apply (drule order_le_imp_less_or_eq)+
  34.592 +apply (auto intro: real_add_order order_less_imp_le)
  34.593 +done
  34.594 +
  34.595 +
  34.596 +subsection{*An Embedding of the Naturals in the Reals*}
  34.597 +
  34.598 +lemma real_of_posnat_one: "real_of_posnat 0 = (1::real)"
  34.599 +by (simp add: real_of_posnat_def pnat_one_iff [symmetric]
  34.600 +              real_of_preal_def symmetric real_one_def)
  34.601 +
  34.602 +lemma real_of_posnat_two: "real_of_posnat (Suc 0) = (1::real) + (1::real)"
  34.603 +by (simp add: real_of_posnat_def real_of_preal_def real_one_def pnat_two_eq
  34.604 +                 real_add
  34.605 +            prat_of_pnat_add [symmetric] preal_of_prat_add [symmetric]
  34.606 +            pnat_add_ac)
  34.607 +
  34.608 +lemma real_of_posnat_add: 
  34.609 +     "real_of_posnat n1 + real_of_posnat n2 = real_of_posnat (n1 + n2) + (1::real)"
  34.610 +apply (unfold real_of_posnat_def)
  34.611 +apply (simp (no_asm_use) add: real_of_posnat_one [symmetric] real_of_posnat_def real_of_preal_add [symmetric] preal_of_prat_add [symmetric] prat_of_pnat_add [symmetric] pnat_of_nat_add)
  34.612 +done
  34.613 +
  34.614 +lemma real_of_posnat_add_one:
  34.615 +     "real_of_posnat (n + 1) = real_of_posnat n + (1::real)"
  34.616 +apply (rule_tac a1 = " (1::real) " in add_right_cancel [THEN iffD1])
  34.617 +apply (rule real_of_posnat_add [THEN subst])
  34.618 +apply (simp (no_asm_use) add: real_of_posnat_two real_add_assoc)
  34.619 +done
  34.620 +
  34.621 +lemma real_of_posnat_Suc:
  34.622 +     "real_of_posnat (Suc n) = real_of_posnat n + (1::real)"
  34.623 +by (subst real_of_posnat_add_one [symmetric], simp)
  34.624 +
  34.625 +lemma inj_real_of_posnat: "inj(real_of_posnat)"
  34.626 +apply (rule inj_onI)
  34.627 +apply (unfold real_of_posnat_def)
  34.628 +apply (drule inj_real_of_preal [THEN injD])
  34.629 +apply (drule inj_preal_of_prat [THEN injD])
  34.630 +apply (drule inj_prat_of_pnat [THEN injD])
  34.631 +apply (erule inj_pnat_of_nat [THEN injD])
  34.632 +done
  34.633 +
  34.634 +lemma real_of_nat_zero [simp]: "real (0::nat) = 0"
  34.635 +by (simp add: real_of_nat_def real_of_posnat_one)
  34.636 +
  34.637 +lemma real_of_nat_one [simp]: "real (Suc 0) = (1::real)"
  34.638 +by (simp add: real_of_nat_def real_of_posnat_two real_add_assoc)
  34.639 +
  34.640 +lemma real_of_nat_add [simp]: 
  34.641 +     "real (m + n) = real (m::nat) + real n"
  34.642 +apply (simp add: real_of_nat_def add_ac)
  34.643 +apply (simp add: real_of_posnat_add add_assoc [symmetric])
  34.644 +apply (simp add: add_commute) 
  34.645 +apply (simp add: add_assoc [symmetric])
  34.646 +done
  34.647 +
  34.648 +(*Not for addsimps: often the LHS is used to represent a positive natural*)
  34.649 +lemma real_of_nat_Suc: "real (Suc n) = real n + (1::real)"
  34.650 +by (simp add: real_of_nat_def real_of_posnat_Suc add_ac)
  34.651 +
  34.652 +lemma real_of_nat_less_iff [iff]: 
  34.653 +     "(real (n::nat) < real m) = (n < m)"
  34.654 +by (auto simp add: real_of_nat_def real_of_posnat_def)
  34.655 +
  34.656 +lemma real_of_nat_le_iff [iff]: "(real (n::nat) \<le> real m) = (n \<le> m)"
  34.657 +by (simp add: linorder_not_less [symmetric])
  34.658 +
  34.659 +lemma inj_real_of_nat: "inj (real :: nat => real)"
  34.660 +apply (rule inj_onI)
  34.661 +apply (auto intro!: inj_real_of_posnat [THEN injD]
  34.662 +            simp add: real_of_nat_def add_right_cancel)
  34.663 +done
  34.664 +
  34.665 +lemma real_of_nat_ge_zero [iff]: "0 \<le> real (n::nat)"
  34.666 +apply (induct_tac "n")
  34.667 +apply (auto simp add: real_of_nat_Suc)
  34.668 +apply (drule real_add_le_less_mono)
  34.669 +apply (rule zero_less_one)
  34.670 +apply (simp add: order_less_imp_le)
  34.671 +done
  34.672 +
  34.673 +lemma real_of_nat_mult [simp]: "real (m * n) = real (m::nat) * real n"
  34.674 +apply (induct_tac "m")
  34.675 +apply (auto simp add: real_of_nat_Suc left_distrib add_commute)
  34.676 +done
  34.677 +
  34.678 +lemma real_of_nat_inject [iff]: "(real (n::nat) = real m) = (n = m)"
  34.679 +by (auto dest: inj_real_of_nat [THEN injD])
  34.680 +
  34.681 +lemma real_of_nat_diff [rule_format]:
  34.682 +     "n \<le> m --> real (m - n) = real (m::nat) - real n"
  34.683 +apply (induct_tac "m", simp)
  34.684 +apply (simp add: real_diff_def Suc_diff_le le_Suc_eq real_of_nat_Suc add_ac)
  34.685 +apply (simp add: add_left_commute [of _ "- 1"]) 
  34.686 +done
  34.687 +
  34.688 +lemma real_of_nat_zero_iff: "(real (n::nat) = 0) = (n = 0)"
  34.689 +  proof 
  34.690 +    assume "real n = 0"
  34.691 +    have "real n = real (0::nat)" by simp
  34.692 +    then show "n = 0" by (simp only: real_of_nat_inject)
  34.693 +  next
  34.694 +    show "n = 0 \<Longrightarrow> real n = 0" by simp
  34.695 +  qed
  34.696 +
  34.697 +lemma real_of_nat_neg_int [simp]: "neg z ==> real (nat z) = 0"
  34.698 +by (simp add: neg_nat real_of_nat_zero)
  34.699 +
  34.700 +
  34.701 +lemma real_inverse_unique: "x*y = (1::real) ==> y = inverse x"
  34.702 +apply (case_tac "x \<noteq> 0")
  34.703 +apply (rule_tac c1 = x in real_mult_left_cancel [THEN iffD1], auto)
  34.704 +done
  34.705 +
  34.706 +lemma real_inverse_gt_one: "[| (0::real) < x; x < 1 |] ==> 1 < inverse x"
  34.707 +by (auto dest: less_imp_inverse_less)
  34.708 +
  34.709 +lemma real_of_nat_gt_zero_cancel_iff: "(0 < real (n::nat)) = (0 < n)"
  34.710 +by (rule real_of_nat_less_iff [THEN subst], auto)
  34.711 +declare real_of_nat_gt_zero_cancel_iff [simp]
  34.712 +
  34.713 +lemma real_of_nat_le_zero_cancel_iff: "(real (n::nat) <= 0) = (n = 0)"
  34.714 +apply (rule real_of_nat_zero [THEN subst])
  34.715 +apply (subst real_of_nat_le_iff, auto)
  34.716 +done
  34.717 +declare real_of_nat_le_zero_cancel_iff [simp]
  34.718 +
  34.719 +lemma not_real_of_nat_less_zero: "~ real (n::nat) < 0"
  34.720 +apply (simp (no_asm) add: real_le_def [symmetric] real_of_nat_ge_zero)
  34.721 +done
  34.722 +declare not_real_of_nat_less_zero [simp]
  34.723 +
  34.724 +lemma real_of_nat_ge_zero_cancel_iff [simp]: 
  34.725 +      "(0 <= real (n::nat)) = (0 <= n)"
  34.726 +apply (simp add: real_le_def le_def)
  34.727 +done
  34.728 +
  34.729 +lemma real_mult_self_sum_ge_zero: "(0::real) \<le> x*x + y*y"
  34.730 +proof -
  34.731 +  have "0 + 0 \<le> x*x + y*y" by (blast intro: add_mono zero_le_square)
  34.732 +  thus ?thesis by simp
  34.733 +qed
  34.734 +
  34.735 +
  34.736 +ML
  34.737 +{*
  34.738 +val real_abs_def = thm "real_abs_def";
  34.739 +
  34.740 +val real_less_eq_diff = thm "real_less_eq_diff";
  34.741 +
  34.742 +val real_mult = thm"real_mult";
  34.743 +val real_mult_commute = thm"real_mult_commute";
  34.744 +val real_mult_assoc = thm"real_mult_assoc";
  34.745 +val real_mult_1 = thm"real_mult_1";
  34.746 +val real_mult_1_right = thm"real_mult_1_right";
  34.747 +val real_minus_mult_commute = thm"real_minus_mult_commute";
  34.748 +val preal_le_linear = thm"preal_le_linear";
  34.749 +val real_mult_inv_left = thm"real_mult_inv_left";
  34.750 +val real_less_not_refl = thm"real_less_not_refl";
  34.751 +val real_less_irrefl = thm"real_less_irrefl";
  34.752 +val real_not_refl2 = thm"real_not_refl2";
  34.753 +val preal_lemma_trans = thm"preal_lemma_trans";
  34.754 +val real_less_trans = thm"real_less_trans";
  34.755 +val real_less_not_sym = thm"real_less_not_sym";
  34.756 +val real_less_asym = thm"real_less_asym";
  34.757 +val real_of_preal_add = thm"real_of_preal_add";
  34.758 +val real_of_preal_mult = thm"real_of_preal_mult";
  34.759 +val real_of_preal_ExI = thm"real_of_preal_ExI";
  34.760 +val real_of_preal_ExD = thm"real_of_preal_ExD";
  34.761 +val real_of_preal_iff = thm"real_of_preal_iff";
  34.762 +val real_of_preal_trichotomy = thm"real_of_preal_trichotomy";
  34.763 +val real_of_preal_trichotomyE = thm"real_of_preal_trichotomyE";
  34.764 +val real_of_preal_lessD = thm"real_of_preal_lessD";
  34.765 +val real_of_preal_lessI = thm"real_of_preal_lessI";
  34.766 +val real_of_preal_less_iff1 = thm"real_of_preal_less_iff1";
  34.767 +val real_of_preal_minus_less_self = thm"real_of_preal_minus_less_self";
  34.768 +val real_of_preal_minus_less_zero = thm"real_of_preal_minus_less_zero";
  34.769 +val real_of_preal_not_minus_gt_zero = thm"real_of_preal_not_minus_gt_zero";
  34.770 +val real_of_preal_zero_less = thm"real_of_preal_zero_less";
  34.771 +val real_of_preal_not_less_zero = thm"real_of_preal_not_less_zero";
  34.772 +val real_minus_minus_zero_less = thm"real_minus_minus_zero_less";
  34.773 +val real_of_preal_sum_zero_less = thm"real_of_preal_sum_zero_less";
  34.774 +val real_of_preal_minus_less_all = thm"real_of_preal_minus_less_all";
  34.775 +val real_of_preal_not_minus_gt_all = thm"real_of_preal_not_minus_gt_all";
  34.776 +val real_of_preal_minus_less_rev1 = thm"real_of_preal_minus_less_rev1";
  34.777 +val real_of_preal_minus_less_rev2 = thm"real_of_preal_minus_less_rev2";
  34.778 +val real_linear = thm"real_linear";
  34.779 +val real_neq_iff = thm"real_neq_iff";
  34.780 +val real_linear_less2 = thm"real_linear_less2";
  34.781 +val real_le_imp_less_or_eq = thm"real_le_imp_less_or_eq";
  34.782 +val real_less_or_eq_imp_le = thm"real_less_or_eq_imp_le";
  34.783 +val real_le_less = thm"real_le_less";
  34.784 +val real_le_refl = thm"real_le_refl";
  34.785 +val real_le_linear = thm"real_le_linear";
  34.786 +val real_le_trans = thm"real_le_trans";
  34.787 +val real_le_anti_sym = thm"real_le_anti_sym";
  34.788 +val real_less_le = thm"real_less_le";
  34.789 +val real_less_sum_gt_zero = thm"real_less_sum_gt_zero";
  34.790 +val real_sum_gt_zero_less = thm"real_sum_gt_zero_less";
  34.791 +
  34.792 +val real_gt_zero_preal_Ex = thm "real_gt_zero_preal_Ex";
  34.793 +val real_gt_preal_preal_Ex = thm "real_gt_preal_preal_Ex";
  34.794 +val real_ge_preal_preal_Ex = thm "real_ge_preal_preal_Ex";
  34.795 +val real_less_all_preal = thm "real_less_all_preal";
  34.796 +val real_less_all_real2 = thm "real_less_all_real2";
  34.797 +val real_of_preal_le_iff = thm "real_of_preal_le_iff";
  34.798 +val real_mult_order = thm "real_mult_order";
  34.799 +val real_zero_less_one = thm "real_zero_less_one";
  34.800 +val real_add_less_le_mono = thm "real_add_less_le_mono";
  34.801 +val real_add_le_less_mono = thm "real_add_le_less_mono";
  34.802 +val real_add_order = thm "real_add_order";
  34.803 +val real_le_add_order = thm "real_le_add_order";
  34.804 +val real_le_square = thm "real_le_square";
  34.805 +val real_mult_less_mono2 = thm "real_mult_less_mono2";
  34.806 +
  34.807 +val real_mult_less_iff1 = thm "real_mult_less_iff1";
  34.808 +val real_mult_le_cancel_iff1 = thm "real_mult_le_cancel_iff1";
  34.809 +val real_mult_le_cancel_iff2 = thm "real_mult_le_cancel_iff2";
  34.810 +val real_mult_less_mono = thm "real_mult_less_mono";
  34.811 +val real_mult_less_mono' = thm "real_mult_less_mono'";
  34.812 +val real_sum_squares_cancel = thm "real_sum_squares_cancel";
  34.813 +val real_sum_squares_cancel2 = thm "real_sum_squares_cancel2";
  34.814 +
  34.815 +val real_mult_left_cancel = thm"real_mult_left_cancel";
  34.816 +val real_mult_right_cancel = thm"real_mult_right_cancel";
  34.817 +val real_of_posnat_one = thm "real_of_posnat_one";
  34.818 +val real_of_posnat_two = thm "real_of_posnat_two";
  34.819 +val real_of_posnat_add = thm "real_of_posnat_add";
  34.820 +val real_of_posnat_add_one = thm "real_of_posnat_add_one";
  34.821 +val real_of_nat_zero = thm "real_of_nat_zero";
  34.822 +val real_of_nat_one = thm "real_of_nat_one";
  34.823 +val real_of_nat_add = thm "real_of_nat_add";
  34.824 +val real_of_nat_Suc = thm "real_of_nat_Suc";
  34.825 +val real_of_nat_less_iff = thm "real_of_nat_less_iff";
  34.826 +val real_of_nat_le_iff = thm "real_of_nat_le_iff";
  34.827 +val inj_real_of_nat = thm "inj_real_of_nat";
  34.828 +val real_of_nat_ge_zero = thm "real_of_nat_ge_zero";
  34.829 +val real_of_nat_mult = thm "real_of_nat_mult";
  34.830 +val real_of_nat_inject = thm "real_of_nat_inject";
  34.831 +val real_of_nat_diff = thm "real_of_nat_diff";
  34.832 +val real_of_nat_zero_iff = thm "real_of_nat_zero_iff";
  34.833 +val real_of_nat_neg_int = thm "real_of_nat_neg_int";
  34.834 +val real_inverse_unique = thm "real_inverse_unique";
  34.835 +val real_inverse_gt_one = thm "real_inverse_gt_one";
  34.836 +val real_of_nat_gt_zero_cancel_iff = thm "real_of_nat_gt_zero_cancel_iff";
  34.837 +val real_of_nat_le_zero_cancel_iff = thm "real_of_nat_le_zero_cancel_iff";
  34.838 +val not_real_of_nat_less_zero = thm "not_real_of_nat_less_zero";
  34.839 +val real_of_nat_ge_zero_cancel_iff = thm "real_of_nat_ge_zero_cancel_iff";
  34.840 +*}
  34.841  
  34.842  end
    35.1 --- a/src/HOL/Real/RealInt.thy	Mon Dec 29 06:49:26 2003 +0100
    35.2 +++ b/src/HOL/Real/RealInt.thy	Thu Jan 01 10:06:32 2004 +0100
    35.3 @@ -6,7 +6,7 @@
    35.4  
    35.5  header{*Embedding the Integers into the Reals*}
    35.6  
    35.7 -theory RealInt = RealOrd:
    35.8 +theory RealInt = RealDef:
    35.9  
   35.10  defs (overloaded)
   35.11    real_of_int_def:
   35.12 @@ -106,9 +106,8 @@
   35.13  apply (rule ccontr, drule linorder_not_less [THEN iffD1])
   35.14  apply (auto simp add: zle_iff_zadd real_of_int_add [symmetric] real_of_int_real_of_nat linorder_not_le [symmetric])
   35.15  apply (subgoal_tac "~ real y + 0 \<le> real y + real n") 
   35.16 - prefer 2 apply (simp add: ); 
   35.17 -apply (simp only: add_le_cancel_left) 
   35.18 -apply (simp add: ); 
   35.19 + prefer 2 apply simp 
   35.20 +apply (simp only: add_le_cancel_left, simp) 
   35.21  done
   35.22  
   35.23  lemma real_of_int_inject [iff]: "(real (x::int) = real y) = (x = y)"
    36.1 --- a/src/HOL/Real/RealOrd.thy	Mon Dec 29 06:49:26 2003 +0100
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,769 +0,0 @@
    36.4 -(*  Title:	 Real/RealOrd.thy
    36.5 -    ID: 	 $Id$
    36.6 -    Author:      Jacques D. Fleuriot and Lawrence C. Paulson
    36.7 -    Copyright:   1998  University of Cambridge
    36.8 -*)
    36.9 -
   36.10 -header{*The Reals Form an Ordered Field, etc.*}
   36.11 -
   36.12 -theory RealOrd = RealDef:
   36.13 -
   36.14 -defs (overloaded)
   36.15 -  real_abs_def:  "abs (r::real) == (if 0 \<le> r then r else -r)"
   36.16 -
   36.17 -
   36.18 -
   36.19 -subsection{*Properties of Less-Than Or Equals*}
   36.20 -
   36.21 -lemma real_leI: "~(w < z) ==> z \<le> (w::real)"
   36.22 -by (unfold real_le_def, assumption)
   36.23 -
   36.24 -lemma real_leD: "z\<le>w ==> ~(w<(z::real))"
   36.25 -by (unfold real_le_def, assumption)
   36.26 -
   36.27 -lemma not_real_leE: "~ z \<le> w ==> w<(z::real)"
   36.28 -by (unfold real_le_def, blast)
   36.29 -
   36.30 -lemma real_le_imp_less_or_eq: "!!(x::real). x \<le> y ==> x < y | x = y"
   36.31 -apply (unfold real_le_def)
   36.32 -apply (cut_tac real_linear)
   36.33 -apply (blast elim: real_less_irrefl real_less_asym)
   36.34 -done
   36.35 -
   36.36 -lemma real_less_or_eq_imp_le: "z<w | z=w ==> z \<le>(w::real)"
   36.37 -apply (unfold real_le_def)
   36.38 -apply (cut_tac real_linear)
   36.39 -apply (fast elim: real_less_irrefl real_less_asym)
   36.40 -done
   36.41 -
   36.42 -lemma real_le_less: "(x \<le> (y::real)) = (x < y | x=y)"
   36.43 -by (blast intro!: real_less_or_eq_imp_le dest!: real_le_imp_less_or_eq)
   36.44 -
   36.45 -lemma real_le_refl: "w \<le> (w::real)"
   36.46 -by (simp add: real_le_less)
   36.47 -
   36.48 -lemma real_le_trans: "[| i \<le> j; j \<le> k |] ==> i \<le> (k::real)"
   36.49 -apply (drule real_le_imp_less_or_eq) 
   36.50 -apply (drule real_le_imp_less_or_eq) 
   36.51 -apply (rule real_less_or_eq_imp_le) 
   36.52 -apply (blast intro: real_less_trans) 
   36.53 -done
   36.54 -
   36.55 -lemma real_le_anti_sym: "[| z \<le> w; w \<le> z |] ==> z = (w::real)"
   36.56 -apply (drule real_le_imp_less_or_eq) 
   36.57 -apply (drule real_le_imp_less_or_eq) 
   36.58 -apply (fast elim: real_less_irrefl real_less_asym)
   36.59 -done
   36.60 -
   36.61 -(* Axiom 'order_less_le' of class 'order': *)
   36.62 -lemma real_less_le: "((w::real) < z) = (w \<le> z & w \<noteq> z)"
   36.63 -apply (simp add: real_le_def real_neq_iff)
   36.64 -apply (blast elim!: real_less_asym)
   36.65 -done
   36.66 -
   36.67 -instance real :: order
   36.68 -  by (intro_classes,
   36.69 -      (assumption | 
   36.70 -       rule real_le_refl real_le_trans real_le_anti_sym real_less_le)+)
   36.71 -
   36.72 -(* Axiom 'linorder_linear' of class 'linorder': *)
   36.73 -lemma real_le_linear: "(z::real) \<le> w | w \<le> z"
   36.74 -apply (simp add: real_le_less)
   36.75 -apply (cut_tac real_linear, blast)
   36.76 -done
   36.77 -
   36.78 -instance real :: linorder
   36.79 -  by (intro_classes, rule real_le_linear)
   36.80 -
   36.81 -
   36.82 -subsection{*Theorems About the Ordering*}
   36.83 -
   36.84 -lemma real_gt_zero_preal_Ex: "(0 < x) = (\<exists>y. x = real_of_preal y)"
   36.85 -apply (auto simp add: real_of_preal_zero_less)
   36.86 -apply (cut_tac x = x in real_of_preal_trichotomy)
   36.87 -apply (blast elim!: real_less_irrefl real_of_preal_not_minus_gt_zero [THEN notE])
   36.88 -done
   36.89 -
   36.90 -lemma real_gt_preal_preal_Ex:
   36.91 -     "real_of_preal z < x ==> \<exists>y. x = real_of_preal y"
   36.92 -by (blast dest!: real_of_preal_zero_less [THEN real_less_trans]
   36.93 -             intro: real_gt_zero_preal_Ex [THEN iffD1])
   36.94 -
   36.95 -lemma real_ge_preal_preal_Ex:
   36.96 -     "real_of_preal z \<le> x ==> \<exists>y. x = real_of_preal y"
   36.97 -by (blast dest: order_le_imp_less_or_eq real_gt_preal_preal_Ex)
   36.98 -
   36.99 -lemma real_less_all_preal: "y \<le> 0 ==> \<forall>x. y < real_of_preal x"
  36.100 -by (auto elim: order_le_imp_less_or_eq [THEN disjE] 
  36.101 -            intro: real_of_preal_zero_less [THEN [2] real_less_trans] 
  36.102 -            simp add: real_of_preal_zero_less)
  36.103 -
  36.104 -lemma real_less_all_real2: "~ 0 < y ==> \<forall>x. y < real_of_preal x"
  36.105 -by (blast intro!: real_less_all_preal real_leI)
  36.106 -
  36.107 -lemma real_of_preal_le_iff:
  36.108 -     "(real_of_preal m1 \<le> real_of_preal m2) = (m1 \<le> m2)"
  36.109 -apply (auto intro!: preal_leI simp add: linorder_not_less [symmetric])
  36.110 -done
  36.111 -
  36.112 -
  36.113 -subsection{*Monotonicity of Addition*}
  36.114 -
  36.115 -lemma real_add_left_cancel: "((x::real) + y = x + z) = (y = z)"
  36.116 -apply safe
  36.117 -apply (drule_tac f = "%t. (-x) + t" in arg_cong)
  36.118 -apply (simp add: real_add_assoc [symmetric])
  36.119 -done
  36.120 -
  36.121 -
  36.122 -lemma real_mult_order: "[| 0 < x; 0 < y |] ==> (0::real) < x * y"
  36.123 -apply (auto simp add: real_gt_zero_preal_Ex)
  36.124 -apply (rule_tac x = "y*ya" in exI)
  36.125 -apply (simp (no_asm_use) add: real_of_preal_mult)
  36.126 -done
  36.127 -
  36.128 -lemma real_minus_add_distrib [simp]: "-(x + y) = (-x) + (- y :: real)"
  36.129 -apply (rule_tac z = x in eq_Abs_REAL)
  36.130 -apply (rule_tac z = y in eq_Abs_REAL)
  36.131 -apply (auto simp add: real_minus real_add)
  36.132 -done
  36.133 -
  36.134 -(*Alternative definition for real_less*)
  36.135 -lemma real_less_add_positive_left_Ex: "R < S ==> \<exists>T::real. 0 < T & R + T = S"
  36.136 -apply (rule_tac x = R in real_of_preal_trichotomyE)
  36.137 -apply (rule_tac [!] x = S in real_of_preal_trichotomyE)
  36.138 -apply (auto dest!: preal_less_add_left_Ex simp add: real_of_preal_not_minus_gt_all real_of_preal_add real_of_preal_not_less_zero real_less_not_refl real_of_preal_not_minus_gt_zero)
  36.139 -apply (rule_tac x = "real_of_preal D" in exI)
  36.140 -apply (rule_tac [2] x = "real_of_preal m+real_of_preal ma" in exI)
  36.141 -apply (rule_tac [3] x = "real_of_preal D" in exI)
  36.142 -apply (auto simp add: real_of_preal_zero_less real_of_preal_sum_zero_less real_add_assoc)
  36.143 -apply (simp add: real_add_assoc [symmetric])
  36.144 -done
  36.145 -
  36.146 -lemma real_less_sum_gt_zero: "(W < S) ==> (0 < S + (-W::real))"
  36.147 -apply (drule real_less_add_positive_left_Ex)
  36.148 -apply (auto simp add: real_add_minus real_add_zero_right real_add_ac)
  36.149 -done
  36.150 -
  36.151 -lemma real_lemma_change_eq_subj: "!!S::real. T = S + W ==> S = T + (-W)"
  36.152 -by (simp add: real_add_ac)
  36.153 -
  36.154 -(* FIXME: long! *)
  36.155 -lemma real_sum_gt_zero_less: "(0 < S + (-W::real)) ==> (W < S)"
  36.156 -apply (rule ccontr)
  36.157 -apply (drule real_leI [THEN real_le_imp_less_or_eq])
  36.158 -apply (auto simp add: real_less_not_refl)
  36.159 -apply (drule real_less_add_positive_left_Ex, clarify, simp)
  36.160 -apply (drule real_lemma_change_eq_subj, auto)
  36.161 -apply (drule real_less_sum_gt_zero)
  36.162 -apply (auto elim: real_less_asym simp add: real_add_left_commute [of W] real_add_ac)
  36.163 -done
  36.164 -
  36.165 -lemma real_mult_less_mono2: "[| (0::real) < z; x < y |] ==> z * x < z * y"
  36.166 -apply (rule real_sum_gt_zero_less)
  36.167 -apply (drule real_less_sum_gt_zero [of x y])
  36.168 -apply (drule real_mult_order, assumption)
  36.169 -apply (simp add: real_add_mult_distrib2)
  36.170 -done
  36.171 -
  36.172 -lemma real_less_sum_gt_0_iff: "(0 < S + (-W::real)) = (W < S)"
  36.173 -by (blast intro: real_less_sum_gt_zero real_sum_gt_zero_less)
  36.174 -
  36.175 -lemma real_less_eq_diff: "(x<y) = (x-y < (0::real))"
  36.176 -apply (unfold real_diff_def)
  36.177 -apply (subst real_minus_zero_less_iff [symmetric])
  36.178 -apply (simp add: real_add_commute real_less_sum_gt_0_iff)
  36.179 -done
  36.180 -
  36.181 -lemma real_less_eqI: "(x::real) - y = x' - y' ==> (x<y) = (x'<y')"
  36.182 -apply (subst real_less_eq_diff)
  36.183 -apply (rule_tac y1 = y in real_less_eq_diff [THEN ssubst], simp)
  36.184 -done
  36.185 -
  36.186 -lemma real_le_eqI: "(x::real) - y = x' - y' ==> (y\<le>x) = (y'\<le>x')"
  36.187 -apply (drule real_less_eqI)
  36.188 -apply (simp add: real_le_def)
  36.189 -done
  36.190 -
  36.191 -lemma real_add_left_mono: "x \<le> y ==> z + x \<le> z + (y::real)"
  36.192 -apply (rule real_le_eqI [THEN iffD1]) 
  36.193 - prefer 2 apply assumption
  36.194 -apply (simp add: real_diff_def real_add_ac)
  36.195 -done
  36.196 -
  36.197 -
  36.198 -subsection{*The Reals Form an Ordered Field*}
  36.199 -
  36.200 -instance real :: inverse ..
  36.201 -
  36.202 -instance real :: ordered_field
  36.203 -proof
  36.204 -  fix x y z :: real
  36.205 -  show "(x + y) + z = x + (y + z)" by (rule real_add_assoc)
  36.206 -  show "x + y = y + x" by (rule real_add_commute)
  36.207 -  show "0 + x = x" by simp
  36.208 -  show "- x + x = 0" by simp
  36.209 -  show "x - y = x + (-y)" by (simp add: real_diff_def)
  36.210 -  show "(x * y) * z = x * (y * z)" by (rule real_mult_assoc)
  36.211 -  show "x * y = y * x" by (rule real_mult_commute)
  36.212 -  show "1 * x = x" by simp
  36.213 -  show "(x + y) * z = x * z + y * z" by (simp add: real_add_mult_distrib)
  36.214 -  show "0 \<noteq> (1::real)" by (rule real_zero_not_eq_one)
  36.215 -  show "x \<le> y ==> z + x \<le> z + y" by (rule real_add_left_mono)
  36.216 -  show "x < y ==> 0 < z ==> z * x < z * y" by (simp add: real_mult_less_mono2)
  36.217 -  show "\<bar>x\<bar> = (if x < 0 then -x else x)"
  36.218 -    by (auto dest: order_le_less_trans simp add: real_abs_def linorder_not_le)
  36.219 -  show "x \<noteq> 0 ==> inverse x * x = 1" by simp
  36.220 -  show "y \<noteq> 0 ==> x / y = x * inverse y" by (simp add: real_divide_def)
  36.221 -qed
  36.222 -
  36.223 -
  36.224 -lemma real_zero_less_one: "0 < (1::real)"
  36.225 -  by (rule Ring_and_Field.zero_less_one)
  36.226 -
  36.227 -lemma real_add_less_mono: "[| R1 < S1; R2 < S2 |] ==> R1+R2 < S1+(S2::real)"
  36.228 - by (rule Ring_and_Field.add_strict_mono)
  36.229 -
  36.230 -lemma real_add_le_mono: "[|i\<le>j;  k\<le>l |] ==> i + k \<le> j + (l::real)"
  36.231 - by (rule Ring_and_Field.add_mono)
  36.232 -
  36.233 -lemma real_le_minus_iff: "(-s \<le> -r) = ((r::real) \<le> s)"
  36.234 - by (rule Ring_and_Field.neg_le_iff_le)
  36.235 -
  36.236 -lemma real_le_square [simp]: "(0::real) \<le> x*x"
  36.237 - by (rule Ring_and_Field.zero_le_square)
  36.238 -
  36.239 -
  36.240 -subsection{*Division Lemmas*}
  36.241 -
  36.242 -(** Inverse of zero!  Useful to simplify certain equations **)
  36.243 -
  36.244 -lemma INVERSE_ZERO: "inverse 0 = (0::real)"
  36.245 -apply (unfold real_inverse_def)
  36.246 -apply (rule someI2)
  36.247 -apply (auto simp add: real_zero_not_eq_one)
  36.248 -done
  36.249 -
  36.250 -lemma DIVISION_BY_ZERO: "a / (0::real) = 0"
  36.251 -  by (simp add: real_divide_def INVERSE_ZERO)
  36.252 -
  36.253 -instance real :: division_by_zero
  36.254 -proof
  36.255 -  fix x :: real
  36.256 -  show "inverse 0 = (0::real)" by (rule INVERSE_ZERO)
  36.257 -  show "x/0 = 0" by (rule DIVISION_BY_ZERO) 
  36.258 -qed
  36.259 -
  36.260 -lemma real_mult_left_cancel: "(c::real) \<noteq> 0 ==> (c*a=c*b) = (a=b)"
  36.261 -by auto
  36.262 -
  36.263 -lemma real_mult_right_cancel: "(c::real) \<noteq> 0 ==> (a*c=b*c) = (a=b)"
  36.264 -by auto
  36.265 -
  36.266 -lemma real_mult_left_cancel_ccontr: "c*a \<noteq> c*b ==> a \<noteq> b"
  36.267 -by auto
  36.268 -
  36.269 -lemma real_mult_right_cancel_ccontr: "a*c \<noteq> b*c ==> a \<noteq> b"
  36.270 -by auto
  36.271 -
  36.272 -lemma real_inverse_not_zero: "x \<noteq> 0 ==> inverse(x::real) \<noteq> 0"
  36.273 -  by (rule Ring_and_Field.nonzero_imp_inverse_nonzero)
  36.274 -
  36.275 -lemma real_mult_not_zero: "[| x \<noteq> 0; y \<noteq> 0 |] ==> x * y \<noteq> (0::real)"
  36.276 -by simp
  36.277 -
  36.278 -lemma real_inverse_1: "inverse((1::real)) = (1::real)"
  36.279 -  by (rule Ring_and_Field.inverse_1)
  36.280 -
  36.281 -lemma real_minus_inverse: "inverse(-x) = -inverse(x::real)"
  36.282 -  by (rule Ring_and_Field.inverse_minus_eq)
  36.283 -
  36.284 -lemma real_inverse_distrib: "inverse(x*y) = inverse(x)*inverse(y::real)"
  36.285 -  by (rule Ring_and_Field.inverse_mult_distrib)
  36.286 -
  36.287 -lemma real_add_divide_distrib: "(x+y)/(z::real) = x/z + y/z"
  36.288 -  by (rule Ring_and_Field.add_divide_distrib)
  36.289 -
  36.290 -
  36.291 -subsection{*More Lemmas*}
  36.292 -
  36.293 -lemma real_add_right_cancel: "(y + (x::real)= z + x) = (y = z)"
  36.294 -  by (rule Ring_and_Field.add_right_cancel)
  36.295 -
  36.296 -lemma real_add_less_mono1: "v < (w::real) ==> v + z < w + z"
  36.297 -  by (rule Ring_and_Field.add_strict_right_mono)
  36.298 -
  36.299 -lemma real_add_le_mono1: "v \<le> (w::real) ==> v + z \<le> w + z"
  36.300 -  by (rule Ring_and_Field.add_right_mono)
  36.301 -
  36.302 -lemma real_add_less_le_mono: "[| w'<w; z'\<le>z |] ==> w' + z' < w + (z::real)"
  36.303 -apply (erule add_strict_right_mono [THEN order_less_le_trans])
  36.304 -apply (erule add_left_mono) 
  36.305 -done
  36.306 -
  36.307 -lemma real_add_le_less_mono:
  36.308 -     "!!z z'::real. [| w'\<le>w; z'<z |] ==> w' + z' < w + z"
  36.309 -apply (erule add_right_mono [THEN order_le_less_trans])
  36.310 -apply (erule add_strict_left_mono) 
  36.311 -done
  36.312 -
  36.313 -lemma real_less_add_right_cancel: "!!(A::real). A + C < B + C ==> A < B"
  36.314 -  by (rule Ring_and_Field.add_less_imp_less_right)
  36.315 -
  36.316 -lemma real_less_add_left_cancel: "!!(A::real). C + A < C + B ==> A < B"
  36.317 -  by (rule Ring_and_Field.add_less_imp_less_left)
  36.318 -
  36.319 -lemma real_le_add_right_cancel: "!!(A::real). A + C \<le> B + C ==> A \<le> B"
  36.320 -  by (rule Ring_and_Field.add_le_imp_le_right)
  36.321 -
  36.322 -lemma real_le_add_left_cancel: "!!(A::real). C + A \<le> C + B ==> A \<le> B"
  36.323 -  by (rule Ring_and_Field.add_le_imp_le_left)
  36.324 -
  36.325 -lemma real_add_right_cancel_less: "(v+z < w+z) = (v < (w::real))"
  36.326 -  by (rule Ring_and_Field.add_less_cancel_right)
  36.327 -
  36.328 -lemma real_add_left_cancel_less: "(z+v < z+w) = (v < (w::real))"
  36.329 -  by (rule Ring_and_Field.add_less_cancel_left)
  36.330 -
  36.331 -lemma real_add_right_cancel_le: "(v+z \<le> w+z) = (v \<le> (w::real))"
  36.332 -  by (rule Ring_and_Field.add_le_cancel_right)
  36.333 -
  36.334 -lemma real_add_left_cancel_le: "(z+v \<le> z+w) = (v \<le> (w::real))"
  36.335 -  by (rule Ring_and_Field.add_le_cancel_left)
  36.336 -
  36.337 -
  36.338 -subsection{*Inverse and Division*}
  36.339 -
  36.340 -lemma real_inverse_gt_0: "0 < x ==> 0 < inverse (x::real)"
  36.341 -  by (rule Ring_and_Field.positive_imp_inverse_positive)
  36.342 -
  36.343 -lemma real_inverse_less_0: "x < 0 ==> inverse (x::real) < 0"
  36.344 -  by (rule Ring_and_Field.negative_imp_inverse_negative)
  36.345 -
  36.346 -lemma real_mult_less_mono1: "[| (0::real) < z; x < y |] ==> x*z < y*z"
  36.347 - by (rule Ring_and_Field.mult_strict_right_mono)
  36.348 -
  36.349 -text{*The precondition could be weakened to @{term "0\<le>x"}*}
  36.350 -lemma real_mult_less_mono:
  36.351 -     "[| u<v;  x<y;  (0::real) < v;  0 < x |] ==> u*x < v* y"
  36.352 - by (simp add: Ring_and_Field.mult_strict_mono order_less_imp_le)
  36.353 -
  36.354 -lemma real_mult_less_iff1 [simp]: "(0::real) < z ==> (x*z < y*z) = (x < y)"
  36.355 -  by (force elim: order_less_asym
  36.356 -            simp add: Ring_and_Field.mult_less_cancel_right)
  36.357 -
  36.358 -lemma real_mult_le_cancel_iff1 [simp]: "(0::real) < z ==> (x*z \<le> y*z) = (x\<le>y)"
  36.359 -by (auto simp add: real_le_def)
  36.360 -
  36.361 -lemma real_mult_le_cancel_iff2 [simp]: "(0::real) < z ==> (z*x \<le> z*y) = (x\<le>y)"
  36.362 -  by (force elim: order_less_asym
  36.363 -            simp add: Ring_and_Field.mult_le_cancel_left)
  36.364 -
  36.365 -text{*Only two uses?*}
  36.366 -lemma real_mult_less_mono':
  36.367 -     "[| x < y;  r1 < r2;  (0::real) \<le> r1;  0 \<le> x|] ==> r1 * x < r2 * y"
  36.368 - by (rule Ring_and_Field.mult_strict_mono')
  36.369 -
  36.370 -lemma real_inverse_less_swap:
  36.371 -     "[| 0 < r; r < x |] ==> inverse x < inverse (r::real)"
  36.372 -  by (rule Ring_and_Field.less_imp_inverse_less)
  36.373 -
  36.374 -(*FIXME: remove the [iff], since the general theorem is already [simp]*)
  36.375 -lemma real_mult_is_0 [iff]: "(x*y = 0) = (x = 0 | y = (0::real))"
  36.376 -by (rule Ring_and_Field.mult_eq_0_iff)
  36.377 -
  36.378 -lemma real_inverse_add:
  36.379 -     "[| x \<noteq> 0; y \<noteq> 0 |]  
  36.380 -      ==> inverse x + inverse y = (x + y) * inverse (x * (y::real))"
  36.381 -by (simp add: Ring_and_Field.inverse_add mult_assoc)
  36.382 -
  36.383 -text{*FIXME: delete or at least combine the next two lemmas*}
  36.384 -lemma real_sum_squares_cancel: "x * x + y * y = 0 ==> x = (0::real)"
  36.385 -apply (drule Ring_and_Field.equals_zero_I [THEN sym])
  36.386 -apply (cut_tac x = y in real_le_square) 
  36.387 -apply (auto, drule real_le_anti_sym, auto)
  36.388 -done
  36.389 -
  36.390 -lemma real_sum_squares_cancel2: "x * x + y * y = 0 ==> y = (0::real)"
  36.391 -apply (rule_tac y = x in real_sum_squares_cancel)
  36.392 -apply (simp add: real_add_commute)
  36.393 -done
  36.394 -
  36.395 -
  36.396 -subsection{*Convenient Biconditionals for Products of Signs*}
  36.397 -
  36.398 -lemma real_0_less_mult_iff: "((0::real) < x*y) = (0<x & 0<y | x<0 & y<0)"
  36.399 -  by (rule Ring_and_Field.zero_less_mult_iff) 
  36.400 -
  36.401 -lemma real_0_le_mult_iff: "((0::real)\<le>x*y) = (0\<le>x & 0\<le>y | x\<le>0 & y\<le>0)"
  36.402 -  by (rule Ring_and_Field.zero_le_mult_iff) 
  36.403 -
  36.404 -lemma real_mult_less_0_iff: "(x*y < (0::real)) = (0<x & y<0 | x<0 & 0<y)"
  36.405 -  by (rule Ring_and_Field.mult_less_0_iff) 
  36.406 -
  36.407 -lemma real_mult_le_0_iff: "(x*y \<le> (0::real)) = (0\<le>x & y\<le>0 | x\<le>0 & 0\<le>y)"
  36.408 -  by (rule Ring_and_Field.mult_le_0_iff) 
  36.409 -
  36.410 -subsection{*Hardly Used Theorems to be Deleted*}
  36.411 -
  36.412 -lemma real_add_less_mono2: "!!(A::real). A < B ==> C + A < C + B"
  36.413 -by simp
  36.414 -
  36.415 -lemma real_add_order: "[| 0 < x; 0 < y |] ==> (0::real) < x + y"
  36.416 -apply (erule order_less_trans)
  36.417 -apply (drule real_add_less_mono2, simp)
  36.418 -done
  36.419 -
  36.420 -lemma real_le_add_order: "[| 0 \<le> x; 0 \<le> y |] ==> (0::real) \<le> x + y"
  36.421 -apply (drule order_le_imp_less_or_eq)+
  36.422 -apply (auto intro: real_add_order order_less_imp_le)
  36.423 -done
  36.424 -
  36.425 -
  36.426 -subsection{*An Embedding of the Naturals in the Reals*}
  36.427 -
  36.428 -lemma real_of_posnat_one: "real_of_posnat 0 = (1::real)"
  36.429 -by (simp add: real_of_posnat_def pnat_one_iff [symmetric]
  36.430 -              real_of_preal_def symmetric real_one_def)
  36.431 -
  36.432 -lemma real_of_posnat_two: "real_of_posnat (Suc 0) = (1::real) + (1::real)"
  36.433 -by (simp add: real_of_posnat_def real_of_preal_def real_one_def pnat_two_eq
  36.434 -                 real_add
  36.435 -            prat_of_pnat_add [symmetric] preal_of_prat_add [symmetric]
  36.436 -            pnat_add_ac)
  36.437 -
  36.438 -lemma real_of_posnat_add: 
  36.439 -     "real_of_posnat n1 + real_of_posnat n2 = real_of_posnat (n1 + n2) + (1::real)"
  36.440 -apply (unfold real_of_posnat_def)
  36.441 -apply (simp (no_asm_use) add: real_of_posnat_one [symmetric] real_of_posnat_def real_of_preal_add [symmetric] preal_of_prat_add [symmetric] prat_of_pnat_add [symmetric] pnat_of_nat_add)
  36.442 -done
  36.443 -
  36.444 -lemma real_of_posnat_add_one:
  36.445 -     "real_of_posnat (n + 1) = real_of_posnat n + (1::real)"
  36.446 -apply (rule_tac x1 = " (1::real) " in real_add_right_cancel [THEN iffD1])
  36.447 -apply (rule real_of_posnat_add [THEN subst])
  36.448 -apply (simp (no_asm_use) add: real_of_posnat_two real_add_assoc)
  36.449 -done
  36.450 -
  36.451 -lemma real_of_posnat_Suc:
  36.452 -     "real_of_posnat (Suc n) = real_of_posnat n + (1::real)"
  36.453 -by (subst real_of_posnat_add_one [symmetric], simp)
  36.454 -
  36.455 -lemma inj_real_of_posnat: "inj(real_of_posnat)"
  36.456 -apply (rule inj_onI)
  36.457 -apply (unfold real_of_posnat_def)
  36.458 -apply (drule inj_real_of_preal [THEN injD])
  36.459 -apply (drule inj_preal_of_prat [THEN injD])
  36.460 -apply (drule inj_prat_of_pnat [THEN injD])
  36.461 -apply (erule inj_pnat_of_nat [THEN injD])
  36.462 -done
  36.463 -
  36.464 -lemma real_of_nat_zero [simp]: "real (0::nat) = 0"
  36.465 -by (simp add: real_of_nat_def real_of_posnat_one)
  36.466 -
  36.467 -lemma real_of_nat_one [simp]: "real (Suc 0) = (1::real)"
  36.468 -by (simp add: real_of_nat_def real_of_posnat_two real_add_assoc)
  36.469 -
  36.470 -lemma real_of_nat_add [simp]: 
  36.471 -     "real (m + n) = real (m::nat) + real n"
  36.472 -apply (simp add: real_of_nat_def add_ac)
  36.473 -apply (simp add: real_of_posnat_add add_assoc [symmetric])
  36.474 -apply (simp add: add_commute) 
  36.475 -apply (simp add: add_assoc [symmetric])
  36.476 -done
  36.477 -
  36.478 -(*Not for addsimps: often the LHS is used to represent a positive natural*)
  36.479 -lemma real_of_nat_Suc: "real (Suc n) = real n + (1::real)"
  36.480 -by (simp add: real_of_nat_def real_of_posnat_Suc real_add_ac)
  36.481 -
  36.482 -lemma real_of_nat_less_iff [iff]: 
  36.483 -     "(real (n::nat) < real m) = (n < m)"
  36.484 -by (auto simp add: real_of_nat_def real_of_posnat_def)
  36.485 -
  36.486 -lemma real_of_nat_le_iff [iff]: "(real (n::nat) \<le> real m) = (n \<le> m)"
  36.487 -by (simp add: linorder_not_less [symmetric])
  36.488 -
  36.489 -lemma inj_real_of_nat: "inj (real :: nat => real)"
  36.490 -apply (rule inj_onI)
  36.491 -apply (auto intro!: inj_real_of_posnat [THEN injD]
  36.492 -            simp add: real_of_nat_def real_add_right_cancel)
  36.493 -done
  36.494 -
  36.495 -lemma real_of_nat_ge_zero [iff]: "0 \<le> real (n::nat)"
  36.496 -apply (induct_tac "n")
  36.497 -apply (auto simp add: real_of_nat_Suc)
  36.498 -apply (drule real_add_le_less_mono)
  36.499 -apply (rule real_zero_less_one)
  36.500 -apply (simp add: order_less_imp_le)
  36.501 -done
  36.502 -
  36.503 -lemma real_of_nat_mult [simp]: "real (m * n) = real (m::nat) * real n"
  36.504 -apply (induct_tac "m")
  36.505 -apply (auto simp add: real_of_nat_Suc real_add_mult_distrib real_add_commute)
  36.506 -done
  36.507 -
  36.508 -lemma real_of_nat_inject [iff]: "(real (n::nat) = real m) = (n = m)"
  36.509 -by (auto dest: inj_real_of_nat [THEN injD])
  36.510 -
  36.511 -lemma real_of_nat_diff [rule_format]:
  36.512 -     "n \<le> m --> real (m - n) = real (m::nat) - real n"
  36.513 -apply (induct_tac "m", simp)
  36.514 -apply (simp add: real_diff_def Suc_diff_le le_Suc_eq real_of_nat_Suc add_ac)
  36.515 -apply (simp add: add_left_commute [of _ "- 1"]) 
  36.516 -done
  36.517 -
  36.518 -lemma real_of_nat_zero_iff: "(real (n::nat) = 0) = (n = 0)"
  36.519 -  proof 
  36.520 -    assume "real n = 0"
  36.521 -    have "real n = real (0::nat)" by simp
  36.522 -    then show "n = 0" by (simp only: real_of_nat_inject)
  36.523 -  next
  36.524 -    show "n = 0 \<Longrightarrow> real n = 0" by simp
  36.525 -  qed
  36.526 -
  36.527 -lemma real_of_nat_neg_int [simp]: "neg z ==> real (nat z) = 0"
  36.528 -by (simp add: neg_nat real_of_nat_zero)
  36.529 -
  36.530 -
  36.531 -lemma real_mult_le_le_mono1: "[| (0::real) <=z; x<=y |] ==> z*x<=z*y"
  36.532 -  by (rule Ring_and_Field.mult_left_mono)
  36.533 -
  36.534 -lemma real_mult_le_le_mono2: "[| (0::real)<=z; x<=y |] ==> x*z<=y*z"
  36.535 -  by (rule Ring_and_Field.mult_right_mono)
  36.536 -
  36.537 -(*Used just below and in HahnBanach/Aux.thy*)
  36.538 -lemma real_mult_le_less_mono1: "[| (0::real) \<le> z; x < y |] ==> x*z \<le> y*z"
  36.539 -apply (rule real_less_or_eq_imp_le)
  36.540 -apply (drule order_le_imp_less_or_eq)
  36.541 -apply (auto intro: real_mult_less_mono1)
  36.542 -done
  36.543 -
  36.544 -lemma real_inverse_unique: "x*y = (1::real) ==> y = inverse x"
  36.545 -apply (case_tac "x \<noteq> 0")
  36.546 -apply (rule_tac c1 = x in real_mult_left_cancel [THEN iffD1], auto)
  36.547 -done
  36.548 -
  36.549 -lemma real_inverse_gt_one: "[| (0::real) < x; x < 1 |] ==> 1 < inverse x"
  36.550 -by (auto dest: real_inverse_less_swap)
  36.551 -
  36.552 -lemma real_of_nat_gt_zero_cancel_iff: "(0 < real (n::nat)) = (0 < n)"
  36.553 -by (rule real_of_nat_less_iff [THEN subst], auto)
  36.554 -declare real_of_nat_gt_zero_cancel_iff [simp]
  36.555 -
  36.556 -lemma real_of_nat_le_zero_cancel_iff: "(real (n::nat) <= 0) = (n = 0)"
  36.557 -apply (rule real_of_nat_zero [THEN subst])
  36.558 -apply (subst real_of_nat_le_iff, auto)
  36.559 -done
  36.560 -declare real_of_nat_le_zero_cancel_iff [simp]
  36.561 -
  36.562 -lemma not_real_of_nat_less_zero: "~ real (n::nat) < 0"
  36.563 -apply (simp (no_asm) add: real_le_def [symmetric] real_of_nat_ge_zero)
  36.564 -done
  36.565 -declare not_real_of_nat_less_zero [simp]
  36.566 -
  36.567 -lemma real_of_nat_ge_zero_cancel_iff: 
  36.568 -      "(0 <= real (n::nat)) = (0 <= n)"
  36.569 -apply (unfold real_le_def le_def)
  36.570 -apply (simp (no_asm))
  36.571 -done
  36.572 -declare real_of_nat_ge_zero_cancel_iff [simp]
  36.573 -
  36.574 -lemma real_of_nat_num_if:
  36.575 -     "real n = (if n=0 then 0 else 1 + real ((n::nat) - 1))"
  36.576 -apply (case_tac "n", simp) 
  36.577 -apply (simp add: real_of_nat_Suc add_commute)
  36.578 -done
  36.579 -
  36.580 -lemma real_mult_self_sum_ge_zero: "(0::real) \<le> x*x + y*y"
  36.581 -proof -
  36.582 -  have "0 + 0 \<le> x*x + y*y" by (blast intro: add_mono zero_le_square)
  36.583 -  thus ?thesis by simp
  36.584 -qed
  36.585 -
  36.586 -declare real_mult_self_sum_ge_zero [simp]
  36.587 -
  36.588 -ML
  36.589 -{*
  36.590 -val real_abs_def = thm "real_abs_def";
  36.591 -
  36.592 -val real_less_eq_diff = thm "real_less_eq_diff";
  36.593 -
  36.594 -val real_add_right_cancel = thm"real_add_right_cancel";
  36.595 -val real_mult_congruent2_lemma = thm"real_mult_congruent2_lemma";
  36.596 -val real_mult_congruent2 = thm"real_mult_congruent2";
  36.597 -val real_mult = thm"real_mult";
  36.598 -val real_mult_commute = thm"real_mult_commute";
  36.599 -val real_mult_assoc = thm"real_mult_assoc";
  36.600 -val real_mult_left_commute = thm"real_mult_left_commute";
  36.601 -val real_mult_1 = thm"real_mult_1";
  36.602 -val real_mult_1_right = thm"real_mult_1_right";
  36.603 -val real_mult_0 = thm"real_mult_0";
  36.604 -val real_mult_0_right = thm"real_mult_0_right";
  36.605 -val real_mult_minus_eq1 = thm"real_mult_minus_eq1";
  36.606 -val real_minus_mult_eq1 = thm"real_minus_mult_eq1";
  36.607 -val real_mult_minus_eq2 = thm"real_mult_minus_eq2";
  36.608 -val real_minus_mult_eq2 = thm"real_minus_mult_eq2";
  36.609 -val real_mult_minus_1 = thm"real_mult_minus_1";
  36.610 -val real_mult_minus_1_right = thm"real_mult_minus_1_right";
  36.611 -val real_minus_mult_cancel = thm"real_minus_mult_cancel";
  36.612 -val real_minus_mult_commute = thm"real_minus_mult_commute";
  36.613 -val real_add_assoc_cong = thm"real_add_assoc_cong";
  36.614 -val real_add_mult_distrib = thm"real_add_mult_distrib";
  36.615 -val real_add_mult_distrib2 = thm"real_add_mult_distrib2";
  36.616 -val real_diff_mult_distrib = thm"real_diff_mult_distrib";
  36.617 -val real_diff_mult_distrib2 = thm"real_diff_mult_distrib2";
  36.618 -val real_zero_not_eq_one = thm"real_zero_not_eq_one";
  36.619 -val real_zero_iff = thm"real_zero_iff";
  36.620 -val preal_le_linear = thm"preal_le_linear";
  36.621 -val real_mult_inv_right_ex = thm"real_mult_inv_right_ex";
  36.622 -val real_mult_inv_left_ex = thm"real_mult_inv_left_ex";
  36.623 -val real_mult_inv_left = thm"real_mult_inv_left";
  36.624 -val real_mult_inv_right = thm"real_mult_inv_right";
  36.625 -val preal_lemma_eq_rev_sum = thm"preal_lemma_eq_rev_sum";
  36.626 -val preal_add_left_commute_cancel = thm"preal_add_left_commute_cancel";
  36.627 -val preal_lemma_for_not_refl = thm"preal_lemma_for_not_refl";
  36.628 -val real_less_not_refl = thm"real_less_not_refl";
  36.629 -val real_less_irrefl = thm"real_less_irrefl";
  36.630 -val real_not_refl2 = thm"real_not_refl2";
  36.631 -val preal_lemma_trans = thm"preal_lemma_trans";
  36.632 -val real_less_trans = thm"real_less_trans";
  36.633 -val real_less_not_sym = thm"real_less_not_sym";
  36.634 -val real_less_asym = thm"real_less_asym";
  36.635 -val real_of_preal_add = thm"real_of_preal_add";
  36.636 -val real_of_preal_mult = thm"real_of_preal_mult";
  36.637 -val real_of_preal_ExI = thm"real_of_preal_ExI";
  36.638 -val real_of_preal_ExD = thm"real_of_preal_ExD";
  36.639 -val real_of_preal_iff = thm"real_of_preal_iff";
  36.640 -val real_of_preal_trichotomy = thm"real_of_preal_trichotomy";
  36.641 -val real_of_preal_trichotomyE = thm"real_of_preal_trichotomyE";
  36.642 -val real_of_preal_lessD = thm"real_of_preal_lessD";
  36.643 -val real_of_preal_lessI = thm"real_of_preal_lessI";
  36.644 -val real_of_preal_less_iff1 = thm"real_of_preal_less_iff1";
  36.645 -val real_of_preal_minus_less_self = thm"real_of_preal_minus_less_self";
  36.646 -val real_of_preal_minus_less_zero = thm"real_of_preal_minus_less_zero";
  36.647 -val real_of_preal_not_minus_gt_zero = thm"real_of_preal_not_minus_gt_zero";
  36.648 -val real_of_preal_zero_less = thm"real_of_preal_zero_less";
  36.649 -val real_of_preal_not_less_zero = thm"real_of_preal_not_less_zero";
  36.650 -val real_minus_minus_zero_less = thm"real_minus_minus_zero_less";
  36.651 -val real_of_preal_sum_zero_less = thm"real_of_preal_sum_zero_less";
  36.652 -val real_of_preal_minus_less_all = thm"real_of_preal_minus_less_all";
  36.653 -val real_of_preal_not_minus_gt_all = thm"real_of_preal_not_minus_gt_all";
  36.654 -val real_of_preal_minus_less_rev1 = thm"real_of_preal_minus_less_rev1";
  36.655 -val real_of_preal_minus_less_rev2 = thm"real_of_preal_minus_less_rev2";
  36.656 -val real_of_preal_minus_less_rev_iff = thm"real_of_preal_minus_less_rev_iff";
  36.657 -val real_linear = thm"real_linear";
  36.658 -val real_neq_iff = thm"real_neq_iff";
  36.659 -val real_linear_less2 = thm"real_linear_less2";
  36.660 -val real_leI = thm"real_leI";
  36.661 -val real_leD = thm"real_leD";
  36.662 -val not_real_leE = thm"not_real_leE";
  36.663 -val real_le_imp_less_or_eq = thm"real_le_imp_less_or_eq";
  36.664 -val real_less_or_eq_imp_le = thm"real_less_or_eq_imp_le";
  36.665 -val real_le_less = thm"real_le_less";
  36.666 -val real_le_refl = thm"real_le_refl";
  36.667 -val real_le_linear = thm"real_le_linear";
  36.668 -val real_le_trans = thm"real_le_trans";
  36.669 -val real_le_anti_sym = thm"real_le_anti_sym";
  36.670 -val real_less_le = thm"real_less_le";
  36.671 -val real_minus_zero_less_iff = thm"real_minus_zero_less_iff";
  36.672 -val real_minus_zero_less_iff2 = thm"real_minus_zero_less_iff2";
  36.673 -val real_less_add_positive_left_Ex = thm"real_less_add_positive_left_Ex";
  36.674 -val real_less_sum_gt_zero = thm"real_less_sum_gt_zero";
  36.675 -val real_sum_gt_zero_less = thm"real_sum_gt_zero_less";
  36.676 -
  36.677 -val real_gt_zero_preal_Ex = thm "real_gt_zero_preal_Ex";
  36.678 -val real_gt_preal_preal_Ex = thm "real_gt_preal_preal_Ex";
  36.679 -val real_ge_preal_preal_Ex = thm "real_ge_preal_preal_Ex";
  36.680 -val real_less_all_preal = thm "real_less_all_preal";
  36.681 -val real_less_all_real2 = thm "real_less_all_real2";
  36.682 -val real_of_preal_le_iff = thm "real_of_preal_le_iff";
  36.683 -val real_mult_order = thm "real_mult_order";
  36.684 -val real_zero_less_one = thm "real_zero_less_one";
  36.685 -val real_add_right_cancel_less = thm "real_add_right_cancel_less";
  36.686 -val real_add_left_cancel_less = thm "real_add_left_cancel_less";
  36.687 -val real_add_right_cancel_le = thm "real_add_right_cancel_le";
  36.688 -val real_add_left_cancel_le = thm "real_add_left_cancel_le";
  36.689 -val real_add_less_mono1 = thm "real_add_less_mono1";
  36.690 -val real_add_le_mono1 = thm "real_add_le_mono1";
  36.691 -val real_add_less_le_mono = thm "real_add_less_le_mono";
  36.692 -val real_add_le_less_mono = thm "real_add_le_less_mono";
  36.693 -val real_add_less_mono2 = thm "real_add_less_mono2";
  36.694 -val real_less_add_right_cancel = thm "real_less_add_right_cancel";
  36.695 -val real_less_add_left_cancel = thm "real_less_add_left_cancel";
  36.696 -val real_le_add_right_cancel = thm "real_le_add_right_cancel";
  36.697 -val real_le_add_left_cancel = thm "real_le_add_left_cancel";
  36.698 -val real_add_order = thm "real_add_order";
  36.699 -val real_le_add_order = thm "real_le_add_order";
  36.700 -val real_add_less_mono = thm "real_add_less_mono";
  36.701 -val real_add_le_mono = thm "real_add_le_mono";
  36.702 -val real_le_minus_iff = thm "real_le_minus_iff";
  36.703 -val real_le_square = thm "real_le_square";
  36.704 -val real_mult_less_mono1 = thm "real_mult_less_mono1";
  36.705 -val real_mult_less_mono2 = thm "real_mult_less_mono2";
  36.706 -
  36.707 -val real_inverse_gt_0 = thm "real_inverse_gt_0";
  36.708 -val real_inverse_less_0 = thm "real_inverse_less_0";
  36.709 -val real_mult_less_iff1 = thm "real_mult_less_iff1";
  36.710 -val real_mult_le_cancel_iff1 = thm "real_mult_le_cancel_iff1";
  36.711 -val real_mult_le_cancel_iff2 = thm "real_mult_le_cancel_iff2";
  36.712 -val real_mult_less_mono = thm "real_mult_less_mono";
  36.713 -val real_mult_less_mono' = thm "real_mult_less_mono'";
  36.714 -val real_inverse_less_swap = thm "real_inverse_less_swap";
  36.715 -val real_mult_is_0 = thm "real_mult_is_0";
  36.716 -val real_inverse_add = thm "real_inverse_add";
  36.717 -val real_sum_squares_cancel = thm "real_sum_squares_cancel";
  36.718 -val real_sum_squares_cancel2 = thm "real_sum_squares_cancel2";
  36.719 -val real_0_less_mult_iff = thm "real_0_less_mult_iff";
  36.720 -val real_0_le_mult_iff = thm "real_0_le_mult_iff";
  36.721 -val real_mult_less_0_iff = thm "real_mult_less_0_iff";
  36.722 -val real_mult_le_0_iff = thm "real_mult_le_0_iff";
  36.723 -
  36.724 -val INVERSE_ZERO = thm"INVERSE_ZERO";
  36.725 -val DIVISION_BY_ZERO = thm"DIVISION_BY_ZERO";
  36.726 -val real_mult_left_cancel = thm"real_mult_left_cancel";
  36.727 -val real_mult_right_cancel = thm"real_mult_right_cancel";
  36.728 -val real_mult_left_cancel_ccontr = thm"real_mult_left_cancel_ccontr";
  36.729 -val real_mult_right_cancel_ccontr = thm"real_mult_right_cancel_ccontr";
  36.730 -val real_inverse_not_zero = thm"real_inverse_not_zero";
  36.731 -val real_mult_not_zero = thm"real_mult_not_zero";
  36.732 -val real_inverse_1 = thm"real_inverse_1";
  36.733 -val real_minus_inverse = thm"real_minus_inverse";
  36.734 -val real_inverse_distrib = thm"real_inverse_distrib";
  36.735 -val real_add_divide_distrib = thm"real_add_divide_distrib";
  36.736 -
  36.737 -val real_of_posnat_one = thm "real_of_posnat_one";
  36.738 -val real_of_posnat_two = thm "real_of_posnat_two";
  36.739 -val real_of_posnat_add = thm "real_of_posnat_add";
  36.740 -val real_of_posnat_add_one = thm "real_of_posnat_add_one";
  36.741 -val real_of_posnat_Suc = thm "real_of_posnat_Suc";
  36.742 -val inj_real_of_posnat = thm "inj_real_of_posnat";
  36.743 -val real_of_nat_zero = thm "real_of_nat_zero";
  36.744 -val real_of_nat_one = thm "real_of_nat_one";
  36.745 -val real_of_nat_add = thm "real_of_nat_add";
  36.746 -val real_of_nat_Suc = thm "real_of_nat_Suc";
  36.747 -val real_of_nat_less_iff = thm "real_of_nat_less_iff";
  36.748 -val real_of_nat_le_iff = thm "real_of_nat_le_iff";
  36.749 -val inj_real_of_nat = thm "inj_real_of_nat";
  36.750 -val real_of_nat_ge_zero = thm "real_of_nat_ge_zero";
  36.751 -val real_of_nat_mult = thm "real_of_nat_mult";
  36.752 -val real_of_nat_inject = thm "real_of_nat_inject";
  36.753 -val real_of_nat_diff = thm "real_of_nat_diff";
  36.754 -val real_of_nat_zero_iff = thm "real_of_nat_zero_iff";
  36.755 -val real_of_nat_neg_int = thm "real_of_nat_neg_int";
  36.756 -
  36.757 -val real_mult_le_le_mono1 = thm "real_mult_le_le_mono1";
  36.758 -val real_mult_le_le_mono2 = thm "real_mult_le_le_mono2";
  36.759 -val real_inverse_unique = thm "real_inverse_unique";
  36.760 -val real_inverse_gt_one = thm "real_inverse_gt_one";
  36.761 -val real_of_nat_gt_zero_cancel_iff = thm "real_of_nat_gt_zero_cancel_iff";
  36.762 -val real_of_nat_le_zero_cancel_iff = thm "real_of_nat_le_zero_cancel_iff";
  36.763 -val not_real_of_nat_less_zero = thm "not_real_of_nat_less_zero";
  36.764 -val real_of_nat_ge_zero_cancel_iff = thm "real_of_nat_ge_zero_cancel_iff";
  36.765 -val real_of_nat_num_if = thm "real_of_nat_num_if";
  36.766 -
  36.767 -val real_minus_add_distrib = thm"real_minus_add_distrib";
  36.768 -val real_add_left_cancel = thm"real_add_left_cancel";
  36.769 -val real_mult_self_sum_ge_zero = thm "real_mult_self_sum_ge_zero";
  36.770 -*}
  36.771 -
  36.772 -end
    37.1 --- a/src/HOL/Real/RealPow.thy	Mon Dec 29 06:49:26 2003 +0100
    37.2 +++ b/src/HOL/Real/RealPow.thy	Thu Jan 01 10:06:32 2004 +0100
    37.3 @@ -28,7 +28,7 @@
    37.4  
    37.5  lemma realpow_inverse: "inverse ((r::real) ^ n) = (inverse r) ^ n"
    37.6  apply (induct_tac "n")
    37.7 -apply (auto simp add: real_inverse_distrib)
    37.8 +apply (auto simp add: inverse_mult_distrib)
    37.9  done
   37.10  
   37.11  lemma realpow_abs: "abs(r ^ n) = abs(r::real) ^ n"
   37.12 @@ -38,7 +38,7 @@
   37.13  
   37.14  lemma realpow_add: "(r::real) ^ (n + m) = (r ^ n) * (r ^ m)"
   37.15  apply (induct_tac "n")
   37.16 -apply (auto simp add: real_mult_ac)
   37.17 +apply (auto simp add: mult_ac)
   37.18  done
   37.19  
   37.20  lemma realpow_one [simp]: "(r::real) ^ 1 = r"
   37.21 @@ -49,17 +49,17 @@
   37.22  
   37.23  lemma realpow_gt_zero [rule_format]: "(0::real) < r --> 0 < r ^ n"
   37.24  apply (induct_tac "n")
   37.25 -apply (auto intro: real_mult_order simp add: real_zero_less_one)
   37.26 +apply (auto intro: real_mult_order simp add: zero_less_one)
   37.27  done
   37.28  
   37.29  lemma realpow_ge_zero [rule_format]: "(0::real) \<le> r --> 0 \<le> r ^ n"
   37.30  apply (induct_tac "n")
   37.31 -apply (auto simp add: real_0_le_mult_iff)
   37.32 +apply (auto simp add: zero_le_mult_iff)
   37.33  done
   37.34  
   37.35  lemma realpow_le [rule_format]: "(0::real) \<le> x & x \<le> y --> x ^ n \<le> y ^ n"
   37.36  apply (induct_tac "n")
   37.37 -apply (auto intro!: real_mult_le_mono)
   37.38 +apply (auto intro!: mult_mono)
   37.39  apply (simp (no_asm_simp) add: realpow_ge_zero)
   37.40  done
   37.41  
   37.42 @@ -90,7 +90,7 @@
   37.43  
   37.44  lemma realpow_mult: "((r::real) * s) ^ n = (r ^ n) * (s ^ n)"
   37.45  apply (induct_tac "n")
   37.46 -apply (auto simp add: real_mult_ac)
   37.47 +apply (auto simp add: mult_ac)
   37.48  done
   37.49  
   37.50  lemma realpow_two_le [simp]: "(0::real) \<le> r^ Suc (Suc 0)"
   37.51 @@ -106,14 +106,15 @@
   37.52  apply auto
   37.53  apply (cut_tac real_zero_less_one)
   37.54  apply (frule_tac x = 0 in order_less_trans, assumption)
   37.55 -apply (drule_tac  z = r and x = 1 in real_mult_less_mono1)
   37.56 -apply (auto intro: order_less_trans)
   37.57 +apply (frule_tac c = r and a = 1 in mult_strict_right_mono)
   37.58 +apply assumption; 
   37.59 +apply (simp add: ); 
   37.60  done
   37.61  
   37.62  lemma realpow_ge_one [rule_format]: "(1::real) < r --> 1 \<le> r ^ n"
   37.63  apply (induct_tac "n", auto)
   37.64  apply (subgoal_tac "1*1 \<le> r * r^n")
   37.65 -apply (rule_tac [2] real_mult_le_mono, auto)
   37.66 +apply (rule_tac [2] mult_mono, auto)
   37.67  done
   37.68  
   37.69  lemma realpow_ge_one2: "(1::real) \<le> r ==> 1 \<le> r ^ n"
   37.70 @@ -170,7 +171,7 @@
   37.71  apply (simp_all (no_asm_simp))
   37.72  apply clarify
   37.73  apply (subgoal_tac "r * r ^ na \<le> 1 * r ^ n", simp)
   37.74 -apply (rule real_mult_le_mono)
   37.75 +apply (rule mult_mono)
   37.76  apply (auto simp add: realpow_ge_zero less_Suc_eq)
   37.77  done
   37.78  
   37.79 @@ -237,7 +238,7 @@
   37.80  
   37.81  lemma realpow_two_diff: "(x::real)^Suc (Suc 0) - y^Suc (Suc 0) = (x - y) * (x + y)"
   37.82  apply (unfold real_diff_def)
   37.83 -apply (simp add: real_add_mult_distrib2 real_add_mult_distrib real_mult_ac)
   37.84 +apply (simp add: right_distrib left_distrib mult_ac)
   37.85  done
   37.86  
   37.87  lemma realpow_two_disj: "((x::real)^Suc (Suc 0) = y^Suc (Suc 0)) = (x = y | x = -y)"
   37.88 @@ -247,7 +248,7 @@
   37.89  
   37.90  (* used in Transc *)
   37.91  lemma realpow_diff: "[|(x::real) \<noteq> 0; m \<le> n |] ==> x ^ (n - m) = x ^ n * inverse (x ^ m)"
   37.92 -by (auto simp add: le_eq_less_or_eq less_iff_Suc_add realpow_add realpow_not_zero real_mult_ac)
   37.93 +by (auto simp add: le_eq_less_or_eq less_iff_Suc_add realpow_add realpow_not_zero mult_ac)
   37.94  
   37.95  lemma realpow_real_of_nat: "real (m::nat) ^ n = real (m ^ n)"
   37.96  apply (induct_tac "n")
   37.97 @@ -256,7 +257,7 @@
   37.98  
   37.99  lemma realpow_real_of_nat_two_pos [simp] : "0 < real (Suc (Suc 0) ^ n)"
  37.100  apply (induct_tac "n")
  37.101 -apply (auto simp add: real_of_nat_mult real_0_less_mult_iff)
  37.102 +apply (auto simp add: real_of_nat_mult zero_less_mult_iff)
  37.103  done
  37.104  
  37.105  lemma realpow_increasing:
  37.106 @@ -284,12 +285,12 @@
  37.107  
  37.108  lemma zero_less_realpow_abs_iff [simp]: "(0 < (abs x)^n) = (x \<noteq> (0::real) | n=0)"
  37.109  apply (induct_tac "n")
  37.110 -apply (auto simp add: real_0_less_mult_iff)
  37.111 +apply (auto simp add: zero_less_mult_iff)
  37.112  done
  37.113  
  37.114  lemma zero_le_realpow_abs [simp]: "(0::real) \<le> (abs x)^n"
  37.115  apply (induct_tac "n")
  37.116 -apply (auto simp add: real_0_le_mult_iff)
  37.117 +apply (auto simp add: zero_le_mult_iff)
  37.118  done
  37.119  
  37.120  
  37.121 @@ -332,7 +333,7 @@
  37.122    by (auto intro: real_sum_squares_cancel)
  37.123  
  37.124  lemma real_squared_diff_one_factored: "x*x - (1::real) = (x + 1)*(x - 1)"
  37.125 -apply (auto simp add: real_add_mult_distrib real_add_mult_distrib2 real_diff_def)
  37.126 +apply (auto simp add: left_distrib right_distrib real_diff_def)
  37.127  done
  37.128  
  37.129  lemma real_mult_is_one: "(x*x = (1::real)) = (x = 1 | x = - 1)"
  37.130 @@ -357,14 +358,14 @@
  37.131        ==> inverse x * y < inverse x1 * u"
  37.132  apply (rule_tac c=x in mult_less_imp_less_left) 
  37.133  apply (auto simp add: real_mult_assoc [symmetric])
  37.134 -apply (simp (no_asm) add: real_mult_ac)
  37.135 +apply (simp (no_asm) add: mult_ac)
  37.136  apply (rule_tac c=x1 in mult_less_imp_less_right) 
  37.137 -apply (auto simp add: real_mult_ac)
  37.138 +apply (auto simp add: mult_ac)
  37.139  done
  37.140  
  37.141  text{*Used once: in Hyperreal/Transcendental.ML*}
  37.142  lemma real_mult_inverse_cancel2: "[|(0::real) < x;0 < x1; x1 * y < x * u |] ==> y * inverse x < u * inverse x1"
  37.143 -apply (auto dest: real_mult_inverse_cancel simp add: real_mult_ac)
  37.144 +apply (auto dest: real_mult_inverse_cancel simp add: mult_ac)
  37.145  done
  37.146  
  37.147  lemma inverse_real_of_nat_gt_zero: "0 < inverse (real (Suc n))"
  37.148 @@ -403,18 +404,18 @@
  37.149  
  37.150  lemma realpow_ge_zero2 [rule_format (no_asm)]: "(0::real) \<le> r --> 0 \<le> r ^ n"
  37.151  apply (induct_tac "n")
  37.152 -apply (auto simp add: real_0_le_mult_iff)
  37.153 +apply (auto simp add: zero_le_mult_iff)
  37.154  done
  37.155  
  37.156  lemma realpow_le2 [rule_format (no_asm)]: "(0::real) \<le> x & x \<le> y --> x ^ n \<le> y ^ n"
  37.157  apply (induct_tac "n")
  37.158 -apply (auto intro!: real_mult_le_mono simp add: realpow_ge_zero2)
  37.159 +apply (auto intro!: mult_mono simp add: realpow_ge_zero2)
  37.160  done
  37.161  
  37.162  lemma realpow_Suc_gt_one: "(1::real) < r ==> 1 < r ^ (Suc n)"
  37.163  apply (frule_tac n = "n" in realpow_ge_one)
  37.164  apply (drule real_le_imp_less_or_eq, safe)
  37.165 -apply (frule real_zero_less_one [THEN real_less_trans])
  37.166 +apply (frule zero_less_one [THEN real_less_trans])
  37.167  apply (drule_tac y = "r ^ n" in real_mult_less_mono2)
  37.168  apply assumption
  37.169  apply (auto dest: real_less_trans)
    38.1 --- a/src/HOL/Real/real_arith.ML	Mon Dec 29 06:49:26 2003 +0100
    38.2 +++ b/src/HOL/Real/real_arith.ML	Thu Jan 01 10:06:32 2004 +0100
    38.3 @@ -34,7 +34,7 @@
    38.4    val norm_tac =
    38.5       ALLGOALS (simp_tac (HOL_ss addsimps real_minus_from_mult_simps @ mult_1s))
    38.6       THEN ALLGOALS (simp_tac (HOL_ss addsimps bin_simps@real_mult_minus_simps))
    38.7 -     THEN ALLGOALS (simp_tac (HOL_ss addsimps real_mult_ac))
    38.8 +     THEN ALLGOALS (simp_tac (HOL_ss addsimps mult_ac))
    38.9    val numeral_simp_tac  =
   38.10           ALLGOALS (simp_tac (HOL_ss addsimps rel_real_number_of@bin_simps))
   38.11    val simplify_meta_eq  = simplify_meta_eq
   38.12 @@ -155,7 +155,7 @@
   38.13    val dest_coeff        = dest_coeff
   38.14    val find_first        = find_first []
   38.15    val trans_tac         = trans_tac
   38.16 -  val norm_tac = ALLGOALS (simp_tac (HOL_ss addsimps mult_1s@real_mult_ac))
   38.17 +  val norm_tac = ALLGOALS (simp_tac (HOL_ss addsimps mult_1s@mult_ac))
   38.18    end;
   38.19  
   38.20  structure EqCancelFactor = ExtractCommonTermFun
   38.21 @@ -210,16 +210,11 @@
   38.22  (****Augmentation of real linear arithmetic with 
   38.23       rational coefficient handling****)
   38.24  
   38.25 -val divide_1 = thm"divide_1";
   38.26 -
   38.27 -val times_divide_eq_left = thm"times_divide_eq_left";
   38.28 -val times_divide_eq_right = thm"times_divide_eq_right";
   38.29 -
   38.30  local
   38.31  
   38.32  (* reduce contradictory <= to False *)
   38.33  val simps = [True_implies_equals,
   38.34 -             inst "w" "number_of ?v" real_add_mult_distrib2,
   38.35 +             inst "a" "(number_of ?v)::real" right_distrib,
   38.36               divide_1,times_divide_eq_right,times_divide_eq_left];
   38.37  
   38.38  val simprocs = [real_cancel_numeral_factors_divide,
   38.39 @@ -230,8 +225,8 @@
   38.40  val real_mult_mono_thms =
   38.41   [(rotate_prems 1 real_mult_less_mono2,
   38.42     cvar(real_mult_less_mono2, hd(prems_of real_mult_less_mono2))),
   38.43 -  (real_mult_le_mono2,
   38.44 -   cvar(real_mult_le_mono2, hd(tl(prems_of real_mult_le_mono2))))]
   38.45 +  (real_mult_left_mono,
   38.46 +   cvar(real_mult_left_mono, hd(tl(prems_of real_mult_left_mono))))]
   38.47  
   38.48  in
   38.49  
    39.1 --- a/src/HOL/Real/real_arith0.ML	Mon Dec 29 06:49:26 2003 +0100
    39.2 +++ b/src/HOL/Real/real_arith0.ML	Thu Jan 01 10:06:32 2004 +0100
    39.3 @@ -6,6 +6,11 @@
    39.4  Instantiation of the generic linear arithmetic package for type real.
    39.5  *)
    39.6  
    39.7 +val add_zero_left = thm"Ring_and_Field.add_0";
    39.8 +val add_zero_right = thm"Ring_and_Field.add_0_right";
    39.9 +
   39.10 +val real_mult_left_mono =
   39.11 +    read_instantiate_sg(sign_of RealBin.thy) [("a","?a::real")] mult_left_mono;
   39.12  
   39.13  
   39.14  local
   39.15 @@ -17,20 +22,17 @@
   39.16       add_real_number_of, minus_real_number_of, diff_real_number_of,
   39.17       mult_real_number_of, eq_real_number_of, less_real_number_of,
   39.18       le_real_number_of_eq_not_less, real_diff_def,
   39.19 -     real_minus_add_distrib, real_minus_minus, real_mult_assoc,
   39.20 -     real_minus_zero,
   39.21 -     real_add_zero_left, real_add_zero_right,
   39.22 -     real_add_minus, real_add_minus_left,
   39.23 -     real_mult_0, real_mult_0_right,
   39.24 -     real_mult_1, real_mult_1_right,
   39.25 -     real_mult_minus_eq1, real_mult_minus_eq2];
   39.26 +     minus_add_distrib, minus_minus, mult_assoc, minus_zero,
   39.27 +     add_zero_left, add_zero_right, left_minus, right_minus,
   39.28 +     mult_left_zero, mult_right_zero, mult_1, mult_1_right,
   39.29 +     minus_mult_left RS sym, minus_mult_right RS sym];
   39.30  
   39.31  val simprocs = [Real_Times_Assoc.conv, Real_Numeral_Simprocs.combine_numerals]@
   39.32                 Real_Numeral_Simprocs.cancel_numerals @
   39.33                 Real_Numeral_Simprocs.eval_numerals;
   39.34  
   39.35  val mono_ss = simpset() addsimps
   39.36 -                [real_add_le_mono,real_add_less_mono,
   39.37 +                [add_mono,add_strict_mono,
   39.38                   real_add_less_le_mono,real_add_le_less_mono];
   39.39  
   39.40  val add_mono_thms_real =
   39.41 @@ -51,8 +53,8 @@
   39.42  val real_mult_mono_thms =
   39.43   [(rotate_prems 1 real_mult_less_mono2,
   39.44     cvar(real_mult_less_mono2, hd(prems_of real_mult_less_mono2))),
   39.45 -  (real_mult_le_mono2,
   39.46 -   cvar(real_mult_le_mono2, hd(tl(prems_of real_mult_le_mono2))))]
   39.47 +  (real_mult_left_mono,
   39.48 +   cvar(real_mult_left_mono, hd(tl(prems_of real_mult_left_mono))))]
   39.49  
   39.50  in
   39.51  
    40.1 --- a/src/HOL/Ring_and_Field.thy	Mon Dec 29 06:49:26 2003 +0100
    40.2 +++ b/src/HOL/Ring_and_Field.thy	Thu Jan 01 10:06:32 2004 +0100
    40.3 @@ -1505,8 +1505,20 @@
    40.4  
    40.5  ML
    40.6  {*
    40.7 +val add_assoc = thm"add_assoc";
    40.8 +val add_commute = thm"add_commute";
    40.9 +val mult_assoc = thm"mult_assoc";
   40.10 +val mult_commute = thm"mult_commute";
   40.11 +val zero_neq_one = thm"zero_neq_one";
   40.12 +val diff_minus = thm"diff_minus";
   40.13 +val abs_if = thm"abs_if";
   40.14 +val divide_inverse = thm"divide_inverse";
   40.15 +val inverse_zero = thm"inverse_zero";
   40.16 +val divide_zero = thm"divide_zero";
   40.17 +val add_0 = thm"add_0";
   40.18  val add_0_right = thm"add_0_right";
   40.19  val add_left_commute = thm"add_left_commute";
   40.20 +val left_minus = thm"left_minus";
   40.21  val right_minus = thm"right_minus";
   40.22  val right_minus_eq = thm"right_minus_eq";
   40.23  val add_left_cancel = thm"add_left_cancel";
   40.24 @@ -1523,10 +1535,12 @@
   40.25  val neg_0_equal_iff_equal = thm"neg_0_equal_iff_equal";
   40.26  val equation_minus_iff = thm"equation_minus_iff";
   40.27  val minus_equation_iff = thm"minus_equation_iff";
   40.28 +val mult_1 = thm"mult_1";
   40.29  val mult_1_right = thm"mult_1_right";
   40.30  val mult_left_commute = thm"mult_left_commute";
   40.31  val mult_left_zero = thm"mult_left_zero";
   40.32  val mult_right_zero = thm"mult_right_zero";
   40.33 +val left_distrib = thm "left_distrib";
   40.34  val right_distrib = thm"right_distrib";
   40.35  val combine_common_factor = thm"combine_common_factor";
   40.36  val minus_add_distrib = thm"minus_add_distrib";
   40.37 @@ -1536,6 +1550,7 @@
   40.38  val right_diff_distrib = thm"right_diff_distrib";
   40.39  val left_diff_distrib = thm"left_diff_distrib";
   40.40  val minus_diff_eq = thm"minus_diff_eq";
   40.41 +val add_left_mono = thm"add_left_mono";
   40.42  val add_right_mono = thm"add_right_mono";
   40.43  val add_mono = thm"add_mono";
   40.44  val add_strict_left_mono = thm"add_strict_left_mono";
   40.45 @@ -1579,6 +1594,7 @@
   40.46  val less_add_iff2 = thm"less_add_iff2";
   40.47  val le_add_iff1 = thm"le_add_iff1";
   40.48  val le_add_iff2 = thm"le_add_iff2";
   40.49 +val mult_strict_left_mono = thm"mult_strict_left_mono";
   40.50  val mult_strict_right_mono = thm"mult_strict_right_mono";
   40.51  val mult_left_mono = thm"mult_left_mono";
   40.52  val mult_right_mono = thm"mult_right_mono";