src/HOL/Real/RealDef.ML
changeset 9043 ca761fe227d8
parent 8027 8a27d0579e37
child 9108 9fff97d29837
equal deleted inserted replaced
9042:4d4521cbbcca 9043:ca761fe227d8
   133 by (rtac injI 1);
   133 by (rtac injI 1);
   134 by (dres_inst_tac [("f","uminus")] arg_cong 1);
   134 by (dres_inst_tac [("f","uminus")] arg_cong 1);
   135 by (asm_full_simp_tac (simpset() addsimps [real_minus_minus]) 1);
   135 by (asm_full_simp_tac (simpset() addsimps [real_minus_minus]) 1);
   136 qed "inj_real_minus";
   136 qed "inj_real_minus";
   137 
   137 
   138 Goalw [real_zero_def] "-0r = 0r";
   138 Goalw [real_zero_def] "-0 = (0::real)";
   139 by (simp_tac (simpset() addsimps [real_minus]) 1);
   139 by (simp_tac (simpset() addsimps [real_minus]) 1);
   140 qed "real_minus_zero";
   140 qed "real_minus_zero";
   141 
   141 
   142 Addsimps [real_minus_zero];
   142 Addsimps [real_minus_zero];
   143 
   143 
   144 Goal "(-x = 0r) = (x = 0r)"; 
   144 Goal "(-x = 0) = (x = (0::real))"; 
   145 by (res_inst_tac [("z","x")] eq_Abs_real 1);
   145 by (res_inst_tac [("z","x")] eq_Abs_real 1);
   146 by (auto_tac (claset(),
   146 by (auto_tac (claset(),
   147 	      simpset() addsimps [real_zero_def, real_minus] @ preal_add_ac));
   147 	      simpset() addsimps [real_zero_def, real_minus] @ preal_add_ac));
   148 qed "real_minus_zero_iff";
   148 qed "real_minus_zero_iff";
   149 
   149 
   150 Addsimps [real_minus_zero_iff];
   150 Addsimps [real_minus_zero_iff];
   151 
       
   152 Goal "(-x ~= 0r) = (x ~= 0r)"; 
       
   153 by Auto_tac;
       
   154 qed "real_minus_not_zero_iff";
       
   155 
   151 
   156 (*** Congruence property for addition ***)
   152 (*** Congruence property for addition ***)
   157 Goalw [congruent2_def]
   153 Goalw [congruent2_def]
   158     "congruent2 realrel (%p1 p2.                  \
   154     "congruent2 realrel (%p1 p2.                  \
   159 \         split (%x1 y1. split (%x2 y2. realrel^^{(x1+x2, y1+y2)}) p2) p1)";
   155 \         split (%x1 y1. split (%x2 y2. realrel^^{(x1+x2, y1+y2)}) p2) p1)";
   194 qed "real_add_left_commute";
   190 qed "real_add_left_commute";
   195 
   191 
   196 (* real addition is an AC operator *)
   192 (* real addition is an AC operator *)
   197 bind_thms ("real_add_ac", [real_add_assoc,real_add_commute,real_add_left_commute]);
   193 bind_thms ("real_add_ac", [real_add_assoc,real_add_commute,real_add_left_commute]);
   198 
   194 
   199 Goalw [real_of_preal_def,real_zero_def] "0r + z = z";
   195 Goalw [real_of_preal_def,real_zero_def] "(0::real) + z = z";
   200 by (res_inst_tac [("z","z")] eq_Abs_real 1);
   196 by (res_inst_tac [("z","z")] eq_Abs_real 1);
   201 by (asm_full_simp_tac (simpset() addsimps [real_add] @ preal_add_ac) 1);
   197 by (asm_full_simp_tac (simpset() addsimps [real_add] @ preal_add_ac) 1);
   202 qed "real_add_zero_left";
   198 qed "real_add_zero_left";
   203 Addsimps [real_add_zero_left];
   199 Addsimps [real_add_zero_left];
   204 
   200 
   205 Goal "z + 0r = z";
   201 Goal "z + (0::real) = z";
   206 by (simp_tac (simpset() addsimps [real_add_commute]) 1);
   202 by (simp_tac (simpset() addsimps [real_add_commute]) 1);
   207 qed "real_add_zero_right";
   203 qed "real_add_zero_right";
   208 Addsimps [real_add_zero_right];
   204 Addsimps [real_add_zero_right];
   209 
   205 
   210 Goalw [real_zero_def] "z + (-z) = 0r";
   206 Goalw [real_zero_def] "z + (-z) = (0::real)";
   211 by (res_inst_tac [("z","z")] eq_Abs_real 1);
   207 by (res_inst_tac [("z","z")] eq_Abs_real 1);
   212 by (asm_full_simp_tac (simpset() addsimps [real_minus,
   208 by (asm_full_simp_tac (simpset() addsimps [real_minus,
   213         real_add, preal_add_commute]) 1);
   209         real_add, preal_add_commute]) 1);
   214 qed "real_add_minus";
   210 qed "real_add_minus";
   215 Addsimps [real_add_minus];
   211 Addsimps [real_add_minus];
   216 
   212 
   217 Goal "(-z) + z = 0r";
   213 Goal "(-z) + z = (0::real)";
   218 by (simp_tac (simpset() addsimps [real_add_commute]) 1);
   214 by (simp_tac (simpset() addsimps [real_add_commute]) 1);
   219 qed "real_add_minus_left";
   215 qed "real_add_minus_left";
   220 Addsimps [real_add_minus_left];
   216 Addsimps [real_add_minus_left];
   221 
   217 
   222 
   218 
   228 by (simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1);
   224 by (simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1);
   229 qed "real_minus_add_cancel";
   225 qed "real_minus_add_cancel";
   230 
   226 
   231 Addsimps [real_add_minus_cancel, real_minus_add_cancel];
   227 Addsimps [real_add_minus_cancel, real_minus_add_cancel];
   232 
   228 
   233 Goal "? y. (x::real) + y = 0r";
   229 Goal "EX y. (x::real) + y = 0";
   234 by (blast_tac (claset() addIs [real_add_minus]) 1);
   230 by (blast_tac (claset() addIs [real_add_minus]) 1);
   235 qed "real_minus_ex";
   231 qed "real_minus_ex";
   236 
   232 
   237 Goal "?! y. (x::real) + y = 0r";
   233 Goal "EX! y. (x::real) + y = 0";
   238 by (auto_tac (claset() addIs [real_add_minus],simpset()));
   234 by (auto_tac (claset() addIs [real_add_minus],simpset()));
   239 by (dres_inst_tac [("f","%x. ya+x")] arg_cong 1);
   235 by (dres_inst_tac [("f","%x. ya+x")] arg_cong 1);
   240 by (asm_full_simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1);
   236 by (asm_full_simp_tac (simpset() addsimps [real_add_assoc RS sym]) 1);
   241 by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1);
   237 by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1);
   242 qed "real_minus_ex1";
   238 qed "real_minus_ex1";
   243 
   239 
   244 Goal "?! y. y + (x::real) = 0r";
   240 Goal "EX! y. y + (x::real) = 0";
   245 by (auto_tac (claset() addIs [real_add_minus_left],simpset()));
   241 by (auto_tac (claset() addIs [real_add_minus_left],simpset()));
   246 by (dres_inst_tac [("f","%x. x+ya")] arg_cong 1);
   242 by (dres_inst_tac [("f","%x. x+ya")] arg_cong 1);
   247 by (asm_full_simp_tac (simpset() addsimps [real_add_assoc]) 1);
   243 by (asm_full_simp_tac (simpset() addsimps [real_add_assoc]) 1);
   248 by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1);
   244 by (asm_full_simp_tac (simpset() addsimps [real_add_commute]) 1);
   249 qed "real_minus_left_ex1";
   245 qed "real_minus_left_ex1";
   250 
   246 
   251 Goal "x + y = 0r ==> x = -y";
   247 Goal "x + y = (0::real) ==> x = -y";
   252 by (cut_inst_tac [("z","y")] real_add_minus_left 1);
   248 by (cut_inst_tac [("z","y")] real_add_minus_left 1);
   253 by (res_inst_tac [("x1","y")] (real_minus_left_ex1 RS ex1E) 1);
   249 by (res_inst_tac [("x1","y")] (real_minus_left_ex1 RS ex1E) 1);
   254 by (Blast_tac 1);
   250 by (Blast_tac 1);
   255 qed "real_add_minus_eq_minus";
   251 qed "real_add_minus_eq_minus";
   256 
   252 
   257 Goal "? (y::real). x = -y";
   253 Goal "EX (y::real). x = -y";
   258 by (cut_inst_tac [("x","x")] real_minus_ex 1);
   254 by (cut_inst_tac [("x","x")] real_minus_ex 1);
   259 by (etac exE 1 THEN dtac real_add_minus_eq_minus 1);
   255 by (etac exE 1 THEN dtac real_add_minus_eq_minus 1);
   260 by (Fast_tac 1);
   256 by (Fast_tac 1);
   261 qed "real_as_add_inverse_ex";
   257 qed "real_as_add_inverse_ex";
   262 
   258 
   276 
   272 
   277 Goal "(y + (x::real)= z + x) = (y = z)";
   273 Goal "(y + (x::real)= z + x) = (y = z)";
   278 by (simp_tac (simpset() addsimps [real_add_commute,real_add_left_cancel]) 1);
   274 by (simp_tac (simpset() addsimps [real_add_commute,real_add_left_cancel]) 1);
   279 qed "real_add_right_cancel";
   275 qed "real_add_right_cancel";
   280 
   276 
   281 Goal "((x::real) = y) = (0r = x + (- y))";
   277 Goal "((x::real) = y) = (0 = x + (- y))";
   282 by (Step_tac 1);
   278 by (Step_tac 1);
   283 by (res_inst_tac [("x1","-y")] 
   279 by (res_inst_tac [("x1","-y")] 
   284       (real_add_right_cancel RS iffD1) 2);
   280       (real_add_right_cancel RS iffD1) 2);
   285 by Auto_tac;
   281 by Auto_tac;
   286 qed "real_eq_minus_iff"; 
   282 qed "real_eq_minus_iff"; 
   287 
   283 
   288 Goal "((x::real) = y) = (x + (- y) = 0r)";
   284 Goal "((x::real) = y) = (x + (- y) = 0)";
   289 by (Step_tac 1);
   285 by (Step_tac 1);
   290 by (res_inst_tac [("x1","-y")] 
   286 by (res_inst_tac [("x1","-y")] 
   291       (real_add_right_cancel RS iffD1) 2);
   287       (real_add_right_cancel RS iffD1) 2);
   292 by Auto_tac;
   288 by Auto_tac;
   293 qed "real_eq_minus_iff2"; 
   289 qed "real_eq_minus_iff2"; 
   294 
   290 
   295 Goal "0r - x = -x";
   291 Goal "(0::real) - x = -x";
   296 by (simp_tac (simpset() addsimps [real_diff_def]) 1);
   292 by (simp_tac (simpset() addsimps [real_diff_def]) 1);
   297 qed "real_diff_0";
   293 qed "real_diff_0";
   298 
   294 
   299 Goal "x - 0r = x";
   295 Goal "x - (0::real) = x";
   300 by (simp_tac (simpset() addsimps [real_diff_def]) 1);
   296 by (simp_tac (simpset() addsimps [real_diff_def]) 1);
   301 qed "real_diff_0_right";
   297 qed "real_diff_0_right";
   302 
   298 
   303 Goal "x - x = 0r";
   299 Goal "x - x = (0::real)";
   304 by (simp_tac (simpset() addsimps [real_diff_def]) 1);
   300 by (simp_tac (simpset() addsimps [real_diff_def]) 1);
   305 qed "real_diff_self";
   301 qed "real_diff_self";
   306 
   302 
   307 Addsimps [real_diff_0, real_diff_0_right, real_diff_self];
   303 Addsimps [real_diff_0, real_diff_0_right, real_diff_self];
   308 
   304 
   353 by (res_inst_tac [("z","z3")] eq_Abs_real 1);
   349 by (res_inst_tac [("z","z3")] eq_Abs_real 1);
   354 by (asm_simp_tac (simpset() addsimps [preal_add_mult_distrib2,real_mult] @ 
   350 by (asm_simp_tac (simpset() addsimps [preal_add_mult_distrib2,real_mult] @ 
   355                                      preal_add_ac @ preal_mult_ac) 1);
   351                                      preal_add_ac @ preal_mult_ac) 1);
   356 qed "real_mult_assoc";
   352 qed "real_mult_assoc";
   357 
   353 
   358 qed_goal "real_mult_left_commute" thy
   354 Goal "(z1::real) * (z2 * z3) = z2 * (z1 * z3)";
   359     "(z1::real) * (z2 * z3) = z2 * (z1 * z3)"
   355 by (rtac (real_mult_commute RS trans) 1);
   360  (fn _ => [rtac (real_mult_commute RS trans) 1, rtac (real_mult_assoc RS trans) 1,
   356 by (rtac (real_mult_assoc RS trans) 1);
   361            rtac (real_mult_commute RS arg_cong) 1]);
   357 by (rtac (real_mult_commute RS arg_cong) 1);
       
   358 qed "real_mult_left_commute";
   362 
   359 
   363 (* real multiplication is an AC operator *)
   360 (* real multiplication is an AC operator *)
   364 bind_thms ("real_mult_ac", [real_mult_assoc, real_mult_commute, real_mult_left_commute]);
   361 bind_thms ("real_mult_ac", 
       
   362 	   [real_mult_assoc, real_mult_commute, real_mult_left_commute]);
   365 
   363 
   366 Goalw [real_one_def,pnat_one_def] "1r * z = z";
   364 Goalw [real_one_def,pnat_one_def] "1r * z = z";
   367 by (res_inst_tac [("z","z")] eq_Abs_real 1);
   365 by (res_inst_tac [("z","z")] eq_Abs_real 1);
   368 by (asm_full_simp_tac
   366 by (asm_full_simp_tac
   369     (simpset() addsimps [real_mult,
   367     (simpset() addsimps [real_mult,
   377 by (simp_tac (simpset() addsimps [real_mult_commute]) 1);
   375 by (simp_tac (simpset() addsimps [real_mult_commute]) 1);
   378 qed "real_mult_1_right";
   376 qed "real_mult_1_right";
   379 
   377 
   380 Addsimps [real_mult_1_right];
   378 Addsimps [real_mult_1_right];
   381 
   379 
   382 Goalw [real_zero_def,pnat_one_def] "0r * z = 0r";
   380 Goalw [real_zero_def,pnat_one_def] "0 * z = (0::real)";
   383 by (res_inst_tac [("z","z")] eq_Abs_real 1);
   381 by (res_inst_tac [("z","z")] eq_Abs_real 1);
   384 by (asm_full_simp_tac (simpset() addsimps [real_mult,
   382 by (asm_full_simp_tac (simpset() addsimps [real_mult,
   385     preal_add_mult_distrib2,preal_mult_1_right] 
   383     preal_add_mult_distrib2,preal_mult_1_right] 
   386     @ preal_mult_ac @ preal_add_ac) 1);
   384     @ preal_mult_ac @ preal_add_ac) 1);
   387 qed "real_mult_0";
   385 qed "real_mult_0";
   388 
   386 
   389 Goal "z * 0r = 0r";
   387 Goal "z * 0 = (0::real)";
   390 by (simp_tac (simpset() addsimps [real_mult_commute, real_mult_0]) 1);
   388 by (simp_tac (simpset() addsimps [real_mult_commute, real_mult_0]) 1);
   391 qed "real_mult_0_right";
   389 qed "real_mult_0_right";
   392 
   390 
   393 Addsimps [real_mult_0_right, real_mult_0];
   391 Addsimps [real_mult_0_right, real_mult_0];
   394 
   392 
   399 	      simpset() addsimps [real_minus,real_mult] 
   397 	      simpset() addsimps [real_minus,real_mult] 
   400     @ preal_mult_ac @ preal_add_ac));
   398     @ preal_mult_ac @ preal_add_ac));
   401 qed "real_minus_mult_eq1";
   399 qed "real_minus_mult_eq1";
   402 
   400 
   403 Goal "-(x * y) = x * (- y :: real)";
   401 Goal "-(x * y) = x * (- y :: real)";
   404 by (res_inst_tac [("z","x")] eq_Abs_real 1);
   402 by (simp_tac (simpset() addsimps [inst "z" "x" real_mult_commute,
   405 by (res_inst_tac [("z","y")] eq_Abs_real 1);
   403 				  real_minus_mult_eq1]) 1);
   406 by (auto_tac (claset(),
       
   407 	      simpset() addsimps [real_minus,real_mult] 
       
   408     @ preal_mult_ac @ preal_add_ac));
       
   409 qed "real_minus_mult_eq2";
   404 qed "real_minus_mult_eq2";
   410 
   405 
       
   406 Addsimps [real_minus_mult_eq1 RS sym, real_minus_mult_eq2 RS sym];
       
   407 
   411 Goal "(- 1r) * z = -z";
   408 Goal "(- 1r) * z = -z";
   412 by (simp_tac (simpset() addsimps [real_minus_mult_eq1 RS sym]) 1);
   409 by (Simp_tac 1);
   413 qed "real_mult_minus_1";
   410 qed "real_mult_minus_1";
   414 
       
   415 Addsimps [real_mult_minus_1];
       
   416 
   411 
   417 Goal "z * (- 1r) = -z";
   412 Goal "z * (- 1r) = -z";
   418 by (stac real_mult_commute 1);
   413 by (stac real_mult_commute 1);
   419 by (Simp_tac 1);
   414 by (Simp_tac 1);
   420 qed "real_mult_minus_1_right";
   415 qed "real_mult_minus_1_right";
   453 by (asm_simp_tac 
   448 by (asm_simp_tac 
   454     (simpset() addsimps [preal_add_mult_distrib2, real_add, real_mult] @ 
   449     (simpset() addsimps [preal_add_mult_distrib2, real_add, real_mult] @ 
   455                         preal_add_ac @ preal_mult_ac) 1);
   450                         preal_add_ac @ preal_mult_ac) 1);
   456 qed "real_add_mult_distrib";
   451 qed "real_add_mult_distrib";
   457 
   452 
   458 val real_mult_commute'= read_instantiate [("z","w")] real_mult_commute;
   453 val real_mult_commute'= inst "z" "w" real_mult_commute;
   459 
   454 
   460 Goal "(w::real) * (z1 + z2) = (w * z1) + (w * z2)";
   455 Goal "(w::real) * (z1 + z2) = (w * z1) + (w * z2)";
   461 by (simp_tac (simpset() addsimps [real_mult_commute',real_add_mult_distrib]) 1);
   456 by (simp_tac (simpset() addsimps [real_mult_commute',
       
   457 				  real_add_mult_distrib]) 1);
   462 qed "real_add_mult_distrib2";
   458 qed "real_add_mult_distrib2";
   463 
   459 
   464 Goalw [real_diff_def] "((z1::real) - z2) * w = (z1 * w) - (z2 * w)";
   460 Goalw [real_diff_def] "((z1::real) - z2) * w = (z1 * w) - (z2 * w)";
   465 by (simp_tac (simpset() addsimps [real_add_mult_distrib, 
   461 by (simp_tac (simpset() addsimps [real_add_mult_distrib]) 1);
   466 				  real_minus_mult_eq1]) 1);
       
   467 qed "real_diff_mult_distrib";
   462 qed "real_diff_mult_distrib";
   468 
   463 
   469 Goal "(w::real) * (z1 - z2) = (w * z1) - (w * z2)";
   464 Goal "(w::real) * (z1 - z2) = (w * z1) - (w * z2)";
   470 by (simp_tac (simpset() addsimps [real_mult_commute', 
   465 by (simp_tac (simpset() addsimps [real_mult_commute', 
   471 				  real_diff_mult_distrib]) 1);
   466 				  real_diff_mult_distrib]) 1);
   472 qed "real_diff_mult_distrib2";
   467 qed "real_diff_mult_distrib2";
   473 
   468 
   474 (*** one and zero are distinct ***)
   469 (*** one and zero are distinct ***)
   475 Goalw [real_zero_def,real_one_def] "0r ~= 1r";
   470 Goalw [real_zero_def,real_one_def] "0 ~= 1r";
   476 by (auto_tac (claset(),
   471 by (auto_tac (claset(),
   477          simpset() addsimps [preal_self_less_add_left RS preal_not_refl2]));
   472          simpset() addsimps [preal_self_less_add_left RS preal_not_refl2]));
   478 qed "real_zero_not_eq_one";
   473 qed "real_zero_not_eq_one";
   479 
   474 
   480 (*** existence of inverse ***)
   475 (*** existence of inverse ***)
   481 (** lemma -- alternative definition for 0r **)
   476 (** lemma -- alternative definition of 0 **)
   482 Goalw [real_zero_def] "0r = Abs_real (realrel ^^ {(x, x)})";
   477 Goalw [real_zero_def] "0 = Abs_real (realrel ^^ {(x, x)})";
   483 by (auto_tac (claset(),simpset() addsimps [preal_add_commute]));
   478 by (auto_tac (claset(),simpset() addsimps [preal_add_commute]));
   484 qed "real_zero_iff";
   479 qed "real_zero_iff";
   485 
   480 
   486 Goalw [real_zero_def,real_one_def] 
   481 Goalw [real_zero_def,real_one_def] 
   487           "!!(x::real). x ~= 0r ==> ? y. x*y = 1r";
   482           "!!(x::real). x ~= 0 ==> EX y. x*y = 1r";
   488 by (res_inst_tac [("z","x")] eq_Abs_real 1);
   483 by (res_inst_tac [("z","x")] eq_Abs_real 1);
   489 by (cut_inst_tac [("r1.0","xa"),("r2.0","y")] preal_linear 1);
   484 by (cut_inst_tac [("r1.0","xa"),("r2.0","y")] preal_linear 1);
   490 by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
   485 by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
   491            simpset() addsimps [real_zero_iff RS sym]));
   486            simpset() addsimps [real_zero_iff RS sym]));
   492 by (res_inst_tac [("x","Abs_real (realrel ^^ \
   487 by (res_inst_tac [("x","Abs_real (realrel ^^ \
   500     pnat_one_def,preal_mult_1_right,preal_add_mult_distrib2,
   495     pnat_one_def,preal_mult_1_right,preal_add_mult_distrib2,
   501     preal_add_mult_distrib,preal_mult_1,preal_mult_inv_right] 
   496     preal_add_mult_distrib,preal_mult_1,preal_mult_inv_right] 
   502     @ preal_add_ac @ preal_mult_ac));
   497     @ preal_add_ac @ preal_mult_ac));
   503 qed "real_mult_inv_right_ex";
   498 qed "real_mult_inv_right_ex";
   504 
   499 
   505 Goal "!!(x::real). x ~= 0r ==> ? y. y*x = 1r";
   500 Goal "!!(x::real). x ~= 0 ==> EX y. y*x = 1r";
   506 by (asm_simp_tac (simpset() addsimps [real_mult_commute,
   501 by (asm_simp_tac (simpset() addsimps [real_mult_commute,
   507 				      real_mult_inv_right_ex]) 1);
   502 				      real_mult_inv_right_ex]) 1);
   508 qed "real_mult_inv_left_ex";
   503 qed "real_mult_inv_left_ex";
   509 
   504 
   510 Goalw [rinv_def] "x ~= 0r ==> rinv(x)*x = 1r";
   505 Goalw [rinv_def] "x ~= 0 ==> rinv(x)*x = 1r";
   511 by (ftac real_mult_inv_left_ex 1);
   506 by (ftac real_mult_inv_left_ex 1);
   512 by (Step_tac 1);
   507 by (Step_tac 1);
   513 by (rtac selectI2 1);
   508 by (rtac selectI2 1);
   514 by Auto_tac;
   509 by Auto_tac;
   515 qed "real_mult_inv_left";
   510 qed "real_mult_inv_left";
   516 
   511 
   517 Goal "x ~= 0r ==> x*rinv(x) = 1r";
   512 Goal "x ~= 0 ==> x*rinv(x) = 1r";
   518 by (auto_tac (claset() addIs [real_mult_commute RS subst],
   513 by (auto_tac (claset() addIs [real_mult_commute RS subst],
   519               simpset() addsimps [real_mult_inv_left]));
   514               simpset() addsimps [real_mult_inv_left]));
   520 qed "real_mult_inv_right";
   515 qed "real_mult_inv_right";
   521 
   516 
   522 Goal "(c::real) ~= 0r ==> (c*a=c*b) = (a=b)";
   517 Goal "(c::real) ~= 0 ==> (c*a=c*b) = (a=b)";
   523 by Auto_tac;
   518 by Auto_tac;
   524 by (dres_inst_tac [("f","%x. x*rinv c")] arg_cong 1);
   519 by (dres_inst_tac [("f","%x. x*rinv c")] arg_cong 1);
   525 by (asm_full_simp_tac (simpset() addsimps [real_mult_inv_right] @ real_mult_ac)  1);
   520 by (asm_full_simp_tac (simpset() addsimps [real_mult_inv_right] @ real_mult_ac)  1);
   526 qed "real_mult_left_cancel";
   521 qed "real_mult_left_cancel";
   527     
   522     
   528 Goal "(c::real) ~= 0r ==> (a*c=b*c) = (a=b)";
   523 Goal "(c::real) ~= 0 ==> (a*c=b*c) = (a=b)";
   529 by (Step_tac 1);
   524 by (Step_tac 1);
   530 by (dres_inst_tac [("f","%x. x*rinv c")] arg_cong 1);
   525 by (dres_inst_tac [("f","%x. x*rinv c")] arg_cong 1);
   531 by (asm_full_simp_tac
   526 by (asm_full_simp_tac
   532     (simpset() addsimps [real_mult_inv_right] @ real_mult_ac)  1);
   527     (simpset() addsimps [real_mult_inv_right] @ real_mult_ac)  1);
   533 qed "real_mult_right_cancel";
   528 qed "real_mult_right_cancel";
   538 
   533 
   539 Goal "a*c ~= b*c ==> a ~= b";
   534 Goal "a*c ~= b*c ==> a ~= b";
   540 by Auto_tac;
   535 by Auto_tac;
   541 qed "real_mult_right_cancel_ccontr";
   536 qed "real_mult_right_cancel_ccontr";
   542 
   537 
   543 Goalw [rinv_def] "x ~= 0r ==> rinv(x) ~= 0r";
   538 Goalw [rinv_def] "x ~= 0 ==> rinv(x) ~= 0";
   544 by (ftac real_mult_inv_left_ex 1);
   539 by (ftac real_mult_inv_left_ex 1);
   545 by (etac exE 1);
   540 by (etac exE 1);
   546 by (rtac selectI2 1);
   541 by (rtac selectI2 1);
   547 by (auto_tac (claset(),
   542 by (auto_tac (claset(),
   548 	      simpset() addsimps [real_mult_0,
   543 	      simpset() addsimps [real_mult_0,
   549     real_zero_not_eq_one]));
   544     real_zero_not_eq_one]));
   550 qed "rinv_not_zero";
   545 qed "rinv_not_zero";
   551 
   546 
   552 Addsimps [real_mult_inv_left,real_mult_inv_right];
   547 Addsimps [real_mult_inv_left,real_mult_inv_right];
   553 
   548 
   554 Goal "[| x ~= 0r; y ~= 0r |] ==> x * y ~= 0r";
   549 Goal "[| x ~= 0; y ~= 0 |] ==> x * y ~= (0::real)";
   555 by (Step_tac 1);
   550 by (Step_tac 1);
   556 by (dres_inst_tac [("f","%z. rinv x*z")] arg_cong 1);
   551 by (dres_inst_tac [("f","%z. rinv x*z")] arg_cong 1);
   557 by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc RS sym]) 1);
   552 by (asm_full_simp_tac (simpset() addsimps [real_mult_assoc RS sym]) 1);
   558 qed "real_mult_not_zero";
   553 qed "real_mult_not_zero";
   559 
   554 
   560 bind_thm ("real_mult_not_zeroE",real_mult_not_zero RS notE);
   555 bind_thm ("real_mult_not_zeroE",real_mult_not_zero RS notE);
   561 
   556 
   562 Goal "x ~= 0r ==> rinv(rinv x) = x";
   557 Goal "x ~= 0 ==> rinv(rinv x) = x";
   563 by (res_inst_tac [("c1","rinv x")] (real_mult_right_cancel RS iffD1) 1);
   558 by (res_inst_tac [("c1","rinv x")] (real_mult_right_cancel RS iffD1) 1);
   564 by (etac rinv_not_zero 1);
   559 by (etac rinv_not_zero 1);
   565 by (auto_tac (claset() addDs [rinv_not_zero],simpset()));
   560 by (auto_tac (claset() addDs [rinv_not_zero],simpset()));
   566 qed "real_rinv_rinv";
   561 qed "real_rinv_rinv";
   567 
   562 
   568 Goalw [rinv_def] "rinv(1r) = 1r";
   563 Goalw [rinv_def] "rinv(1r) = 1r";
   569 by (cut_facts_tac [real_zero_not_eq_one RS 
   564 by (cut_facts_tac [real_zero_not_eq_one RS 
   570        not_sym RS real_mult_inv_left_ex] 1);
   565                    not_sym RS real_mult_inv_left_ex] 1);
   571 by (etac exE 1);
   566 by (auto_tac (claset(),
   572 by (rtac selectI2 1);
   567 	      simpset() addsimps [real_zero_not_eq_one RS not_sym]));
   573 by (auto_tac (claset(),
       
   574 	      simpset() addsimps 
       
   575     [real_zero_not_eq_one RS not_sym]));
       
   576 qed "real_rinv_1";
   568 qed "real_rinv_1";
   577 Addsimps [real_rinv_1];
   569 Addsimps [real_rinv_1];
   578 
   570 
   579 Goal "x ~= 0r ==> rinv(-x) = -rinv(x)";
   571 Goal "x ~= 0 ==> rinv(-x) = -rinv(x)";
   580 by (res_inst_tac [("c1","-x")] (real_mult_right_cancel RS iffD1) 1);
   572 by (res_inst_tac [("c1","-x")] (real_mult_right_cancel RS iffD1) 1);
       
   573 by (stac real_mult_inv_left 2);
   581 by Auto_tac;
   574 by Auto_tac;
   582 qed "real_minus_rinv";
   575 qed "real_minus_rinv";
   583 
   576 
   584 Goal "[| x ~= 0r; y ~= 0r |] ==> rinv(x*y) = rinv(x)*rinv(y)";
   577 Goal "[| x ~= 0; y ~= 0 |] ==> rinv(x*y) = rinv(x)*rinv(y)";
   585 by (forw_inst_tac [("y","y")] real_mult_not_zero 1 THEN assume_tac 1);
   578 by (forw_inst_tac [("y","y")] real_mult_not_zero 1 THEN assume_tac 1);
   586 by (res_inst_tac [("c1","x")] (real_mult_left_cancel RS iffD1) 1);
   579 by (res_inst_tac [("c1","x")] (real_mult_left_cancel RS iffD1) 1);
   587 by (auto_tac (claset(),simpset() addsimps [real_mult_assoc RS sym]));
   580 by (auto_tac (claset(),simpset() addsimps [real_mult_assoc RS sym]));
   588 by (res_inst_tac [("c1","y")] (real_mult_left_cancel RS iffD1) 1);
   581 by (res_inst_tac [("c1","y")] (real_mult_left_cancel RS iffD1) 1);
   589 by (auto_tac (claset(),simpset() addsimps [real_mult_left_commute]));
   582 by (auto_tac (claset(),simpset() addsimps [real_mult_left_commute]));
   680         @ preal_add_ac @ preal_mult_ac) 1);
   673         @ preal_add_ac @ preal_mult_ac) 1);
   681 qed "real_of_preal_mult";
   674 qed "real_of_preal_mult";
   682 
   675 
   683 Goalw [real_of_preal_def]
   676 Goalw [real_of_preal_def]
   684       "!!(x::preal). y < x ==> \
   677       "!!(x::preal). y < x ==> \
   685 \      ? m. Abs_real (realrel ^^ {(x,y)}) = real_of_preal m";
   678 \      EX m. Abs_real (realrel ^^ {(x,y)}) = real_of_preal m";
   686 by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
   679 by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
   687     simpset() addsimps preal_add_ac));
   680     simpset() addsimps preal_add_ac));
   688 qed "real_of_preal_ExI";
   681 qed "real_of_preal_ExI";
   689 
   682 
   690 Goalw [real_of_preal_def]
   683 Goalw [real_of_preal_def]
   691       "!!(x::preal). ? m. Abs_real (realrel ^^ {(x,y)}) = \
   684       "!!(x::preal). EX m. Abs_real (realrel ^^ {(x,y)}) = \
   692 \                    real_of_preal m ==> y < x";
   685 \                    real_of_preal m ==> y < x";
   693 by (auto_tac (claset(),
   686 by (auto_tac (claset(),
   694 	      simpset() addsimps 
   687 	      simpset() addsimps 
   695     [preal_add_commute,preal_add_assoc]));
   688     [preal_add_commute,preal_add_assoc]));
   696 by (asm_full_simp_tac (simpset() addsimps 
   689 by (asm_full_simp_tac (simpset() addsimps 
   697     [preal_add_assoc RS sym,preal_self_less_add_left]) 1);
   690     [preal_add_assoc RS sym,preal_self_less_add_left]) 1);
   698 qed "real_of_preal_ExD";
   691 qed "real_of_preal_ExD";
   699 
   692 
   700 Goal "(? m. Abs_real (realrel ^^ {(x,y)}) = real_of_preal m) = (y < x)";
   693 Goal "(EX m. Abs_real (realrel ^^ {(x,y)}) = real_of_preal m) = (y < x)";
   701 by (blast_tac (claset() addSIs [real_of_preal_ExI,real_of_preal_ExD]) 1);
   694 by (blast_tac (claset() addSIs [real_of_preal_ExI,real_of_preal_ExD]) 1);
   702 qed "real_of_preal_iff";
   695 qed "real_of_preal_iff";
   703 
   696 
   704 (*** Gleason prop 9-4.4 p 127 ***)
   697 (*** Gleason prop 9-4.4 p 127 ***)
   705 Goalw [real_of_preal_def,real_zero_def] 
   698 Goalw [real_of_preal_def,real_zero_def] 
   706       "? m. (x::real) = real_of_preal m | x = 0r | x = -(real_of_preal m)";
   699       "EX m. (x::real) = real_of_preal m | x = 0 | x = -(real_of_preal m)";
   707 by (res_inst_tac [("z","x")] eq_Abs_real 1);
   700 by (res_inst_tac [("z","x")] eq_Abs_real 1);
   708 by (auto_tac (claset(),simpset() addsimps [real_minus] @ preal_add_ac));
   701 by (auto_tac (claset(),simpset() addsimps [real_minus] @ preal_add_ac));
   709 by (cut_inst_tac [("r1.0","x"),("r2.0","y")] preal_linear 1);
   702 by (cut_inst_tac [("r1.0","x"),("r2.0","y")] preal_linear 1);
   710 by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
   703 by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
   711     simpset() addsimps [preal_add_assoc RS sym]));
   704     simpset() addsimps [preal_add_assoc RS sym]));
   712 by (auto_tac (claset(),simpset() addsimps [preal_add_commute]));
   705 by (auto_tac (claset(),simpset() addsimps [preal_add_commute]));
   713 qed "real_of_preal_trichotomy";
   706 qed "real_of_preal_trichotomy";
   714 
   707 
   715 Goal "!!P. [| !!m. x = real_of_preal m ==> P; \
   708 Goal "!!P. [| !!m. x = real_of_preal m ==> P; \
   716 \             x = 0r ==> P; \
   709 \             x = 0 ==> P; \
   717 \             !!m. x = -(real_of_preal m) ==> P |] ==> P";
   710 \             !!m. x = -(real_of_preal m) ==> P |] ==> P";
   718 by (cut_inst_tac [("x","x")] real_of_preal_trichotomy 1);
   711 by (cut_inst_tac [("x","x")] real_of_preal_trichotomy 1);
   719 by Auto_tac;
   712 by Auto_tac;
   720 qed "real_of_preal_trichotomyE";
   713 qed "real_of_preal_trichotomyE";
   721 
   714 
   754 by (full_simp_tac (simpset() addsimps preal_add_ac) 1);
   747 by (full_simp_tac (simpset() addsimps preal_add_ac) 1);
   755 by (full_simp_tac (simpset() addsimps [preal_self_less_add_right,
   748 by (full_simp_tac (simpset() addsimps [preal_self_less_add_right,
   756     preal_add_assoc RS sym]) 1);
   749     preal_add_assoc RS sym]) 1);
   757 qed "real_of_preal_minus_less_self";
   750 qed "real_of_preal_minus_less_self";
   758 
   751 
   759 Goalw [real_zero_def] "- real_of_preal m < 0r";
   752 Goalw [real_zero_def] "- real_of_preal m < 0";
   760 by (auto_tac (claset(),
   753 by (auto_tac (claset(),
   761 	      simpset() addsimps [real_of_preal_def,
   754 	      simpset() addsimps [real_of_preal_def,
   762 				  real_less_def,real_minus]));
   755 				  real_less_def,real_minus]));
   763 by (REPEAT(rtac exI 1));
   756 by (REPEAT(rtac exI 1));
   764 by (EVERY[rtac conjI 1, rtac conjI 2]);
   757 by (EVERY[rtac conjI 1, rtac conjI 2]);
   765 by (REPEAT(Blast_tac 2));
   758 by (REPEAT(Blast_tac 2));
   766 by (full_simp_tac (simpset() addsimps 
   759 by (full_simp_tac (simpset() addsimps 
   767   [preal_self_less_add_right] @ preal_add_ac) 1);
   760   [preal_self_less_add_right] @ preal_add_ac) 1);
   768 qed "real_of_preal_minus_less_zero";
   761 qed "real_of_preal_minus_less_zero";
   769 
   762 
   770 Goal "~ 0r < - real_of_preal m";
   763 Goal "~ 0 < - real_of_preal m";
   771 by (cut_facts_tac [real_of_preal_minus_less_zero] 1);
   764 by (cut_facts_tac [real_of_preal_minus_less_zero] 1);
   772 by (fast_tac (claset() addDs [real_less_trans] 
   765 by (fast_tac (claset() addDs [real_less_trans] 
   773                         addEs [real_less_irrefl]) 1);
   766                         addEs [real_less_irrefl]) 1);
   774 qed "real_of_preal_not_minus_gt_zero";
   767 qed "real_of_preal_not_minus_gt_zero";
   775 
   768 
   776 Goalw [real_zero_def] "0r < real_of_preal m";
   769 Goalw [real_zero_def] "0 < real_of_preal m";
   777 by (auto_tac (claset(),simpset() addsimps 
   770 by (auto_tac (claset(),simpset() addsimps 
   778    [real_of_preal_def,real_less_def,real_minus]));
   771    [real_of_preal_def,real_less_def,real_minus]));
   779 by (REPEAT(rtac exI 1));
   772 by (REPEAT(rtac exI 1));
   780 by (EVERY[rtac conjI 1, rtac conjI 2]);
   773 by (EVERY[rtac conjI 1, rtac conjI 2]);
   781 by (REPEAT(Blast_tac 2));
   774 by (REPEAT(Blast_tac 2));
   782 by (full_simp_tac (simpset() addsimps 
   775 by (full_simp_tac (simpset() addsimps 
   783 		   [preal_self_less_add_right] @ preal_add_ac) 1);
   776 		   [preal_self_less_add_right] @ preal_add_ac) 1);
   784 qed "real_of_preal_zero_less";
   777 qed "real_of_preal_zero_less";
   785 
   778 
   786 Goal "~ real_of_preal m < 0r";
   779 Goal "~ real_of_preal m < 0";
   787 by (cut_facts_tac [real_of_preal_zero_less] 1);
   780 by (cut_facts_tac [real_of_preal_zero_less] 1);
   788 by (blast_tac (claset() addDs [real_less_trans] 
   781 by (blast_tac (claset() addDs [real_less_trans] 
   789                         addEs [real_less_irrefl]) 1);
   782                         addEs [real_less_irrefl]) 1);
   790 qed "real_of_preal_not_less_zero";
   783 qed "real_of_preal_not_less_zero";
   791 
   784 
   792 Goal "0r < - (- real_of_preal m)";
   785 Goal "0 < - (- real_of_preal m)";
   793 by (simp_tac (simpset() addsimps 
   786 by (simp_tac (simpset() addsimps 
   794     [real_of_preal_zero_less]) 1);
   787     [real_of_preal_zero_less]) 1);
   795 qed "real_minus_minus_zero_less";
   788 qed "real_minus_minus_zero_less";
   796 
   789 
   797 (* another lemma *)
   790 (* another lemma *)
   798 Goalw [real_zero_def]
   791 Goalw [real_zero_def]
   799       "0r < real_of_preal m + real_of_preal m1";
   792       "0 < real_of_preal m + real_of_preal m1";
   800 by (auto_tac (claset(),
   793 by (auto_tac (claset(),
   801 	      simpset() addsimps [real_of_preal_def,
   794 	      simpset() addsimps [real_of_preal_def,
   802 				  real_less_def,real_add]));
   795 				  real_less_def,real_add]));
   803 by (REPEAT(rtac exI 1));
   796 by (REPEAT(rtac exI 1));
   804 by (EVERY[rtac conjI 1, rtac conjI 2]);
   797 by (EVERY[rtac conjI 1, rtac conjI 2]);
   960 Goal "(w::real) < z = (w <= z & w ~= z)";
   953 Goal "(w::real) < z = (w <= z & w ~= z)";
   961 by (simp_tac (simpset() addsimps [real_le_def, real_neq_iff]) 1);
   954 by (simp_tac (simpset() addsimps [real_le_def, real_neq_iff]) 1);
   962 by (blast_tac (claset() addSEs [real_less_asym]) 1);
   955 by (blast_tac (claset() addSEs [real_less_asym]) 1);
   963 qed "real_less_le";
   956 qed "real_less_le";
   964 
   957 
   965 Goal "(0r < -R) = (R < 0r)";
   958 Goal "(0 < -R) = (R < (0::real))";
   966 by (res_inst_tac [("x","R")]  real_of_preal_trichotomyE 1);
   959 by (res_inst_tac [("x","R")]  real_of_preal_trichotomyE 1);
   967 by (auto_tac (claset(),
   960 by (auto_tac (claset(),
   968 	      simpset() addsimps [real_of_preal_not_minus_gt_zero,
   961 	      simpset() addsimps [real_of_preal_not_minus_gt_zero,
   969                         real_of_preal_not_less_zero,real_of_preal_zero_less,
   962                         real_of_preal_not_less_zero,real_of_preal_zero_less,
   970                         real_of_preal_minus_less_zero]));
   963                         real_of_preal_minus_less_zero]));
   971 qed "real_minus_zero_less_iff";
   964 qed "real_minus_zero_less_iff";
   972 
   965 
   973 Addsimps [real_minus_zero_less_iff];
   966 Addsimps [real_minus_zero_less_iff];
   974 
   967 
   975 Goal "(-R < 0r) = (0r < R)";
   968 Goal "(-R < 0) = ((0::real) < R)";
   976 by (res_inst_tac [("x","R")]  real_of_preal_trichotomyE 1);
   969 by (res_inst_tac [("x","R")]  real_of_preal_trichotomyE 1);
   977 by (auto_tac (claset(),
   970 by (auto_tac (claset(),
   978 	      simpset() addsimps [real_of_preal_not_minus_gt_zero,
   971 	      simpset() addsimps [real_of_preal_not_minus_gt_zero,
   979                         real_of_preal_not_less_zero,real_of_preal_zero_less,
   972                         real_of_preal_not_less_zero,real_of_preal_zero_less,
   980                         real_of_preal_minus_less_zero]));
   973                         real_of_preal_minus_less_zero]));
   981 qed "real_minus_zero_less_iff2";
   974 qed "real_minus_zero_less_iff2";
   982 
   975 
   983 (*Alternative definition for real_less*)
   976 (*Alternative definition for real_less*)
   984 Goal "R < S ==> ? T. 0r < T & R + T = S";
   977 Goal "R < S ==> EX T::real. 0 < T & R + T = S";
   985 by (res_inst_tac [("x","R")]  real_of_preal_trichotomyE 1);
   978 by (res_inst_tac [("x","R")]  real_of_preal_trichotomyE 1);
   986 by (ALLGOALS(res_inst_tac [("x","S")]  real_of_preal_trichotomyE));
   979 by (ALLGOALS(res_inst_tac [("x","S")]  real_of_preal_trichotomyE));
   987 by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
   980 by (auto_tac (claset() addSDs [preal_less_add_left_Ex],
   988 	      simpset() addsimps [real_of_preal_not_minus_gt_all,
   981 	      simpset() addsimps [real_of_preal_not_minus_gt_all,
   989 				  real_of_preal_add, real_of_preal_not_less_zero,
   982 				  real_of_preal_add, real_of_preal_not_less_zero,
   997 	      simpset() addsimps [real_of_preal_zero_less,
   990 	      simpset() addsimps [real_of_preal_zero_less,
   998 				  real_of_preal_sum_zero_less,real_add_assoc]));
   991 				  real_of_preal_sum_zero_less,real_add_assoc]));
   999 qed "real_less_add_positive_left_Ex";
   992 qed "real_less_add_positive_left_Ex";
  1000 
   993 
  1001 (** change naff name(s)! **)
   994 (** change naff name(s)! **)
  1002 Goal "(W < S) ==> (0r < S + (-W))";
   995 Goal "(W < S) ==> (0 < S + (-W::real))";
  1003 by (dtac real_less_add_positive_left_Ex 1);
   996 by (dtac real_less_add_positive_left_Ex 1);
  1004 by (auto_tac (claset(),
   997 by (auto_tac (claset(),
  1005 	      simpset() addsimps [real_add_minus,
   998 	      simpset() addsimps [real_add_minus,
  1006     real_add_zero_right] @ real_add_ac));
   999     real_add_zero_right] @ real_add_ac));
  1007 qed "real_less_sum_gt_zero";
  1000 qed "real_less_sum_gt_zero";
  1009 Goal "!!S::real. T = S + W ==> S = T + (-W)";
  1002 Goal "!!S::real. T = S + W ==> S = T + (-W)";
  1010 by (asm_simp_tac (simpset() addsimps real_add_ac) 1);
  1003 by (asm_simp_tac (simpset() addsimps real_add_ac) 1);
  1011 qed "real_lemma_change_eq_subj";
  1004 qed "real_lemma_change_eq_subj";
  1012 
  1005 
  1013 (* FIXME: long! *)
  1006 (* FIXME: long! *)
  1014 Goal "(0r < S + (-W)) ==> (W < S)";
  1007 Goal "(0 < S + (-W::real)) ==> (W < S)";
  1015 by (rtac ccontr 1);
  1008 by (rtac ccontr 1);
  1016 by (dtac (real_leI RS real_le_imp_less_or_eq) 1);
  1009 by (dtac (real_leI RS real_le_imp_less_or_eq) 1);
  1017 by (auto_tac (claset(),
  1010 by (auto_tac (claset(),
  1018 	      simpset() addsimps [real_less_not_refl]));
  1011 	      simpset() addsimps [real_less_not_refl]));
  1019 by (EVERY1[dtac real_less_add_positive_left_Ex, etac exE, etac conjE]);
  1012 by (EVERY1[dtac real_less_add_positive_left_Ex, etac exE, etac conjE]);
  1024 by (asm_full_simp_tac (simpset() addsimps real_add_ac) 1);
  1017 by (asm_full_simp_tac (simpset() addsimps real_add_ac) 1);
  1025 by (EVERY1[rotate_tac 1, dtac (real_add_left_commute RS ssubst)]);
  1018 by (EVERY1[rotate_tac 1, dtac (real_add_left_commute RS ssubst)]);
  1026 by (auto_tac (claset() addEs [real_less_asym], simpset()));
  1019 by (auto_tac (claset() addEs [real_less_asym], simpset()));
  1027 qed "real_sum_gt_zero_less";
  1020 qed "real_sum_gt_zero_less";
  1028 
  1021 
  1029 Goal "(0r < S + (-W)) = (W < S)";
  1022 Goal "(0 < S + (-W::real)) = (W < S)";
  1030 by (blast_tac (claset() addIs [real_less_sum_gt_zero,
  1023 by (blast_tac (claset() addIs [real_less_sum_gt_zero,
  1031 			       real_sum_gt_zero_less]) 1);
  1024 			       real_sum_gt_zero_less]) 1);
  1032 qed "real_less_sum_gt_0_iff";
  1025 qed "real_less_sum_gt_0_iff";
  1033 
  1026 
  1034 
  1027 
  1035 Goalw [real_diff_def] "(x<y) = (x-y < 0r)";
  1028 Goalw [real_diff_def] "(x<y) = (x-y < (0::real))";
  1036 by (stac (real_minus_zero_less_iff RS sym) 1);
  1029 by (stac (real_minus_zero_less_iff RS sym) 1);
  1037 by (simp_tac (simpset() addsimps [real_add_commute,
  1030 by (simp_tac (simpset() addsimps [real_add_commute,
  1038 				  real_less_sum_gt_0_iff]) 1);
  1031 				  real_less_sum_gt_0_iff]) 1);
  1039 qed "real_less_eq_diff";
  1032 qed "real_less_eq_diff";
  1040 
  1033