src/HOL/Real/PReal.ML
changeset 9266 1b917b8b1b38
parent 9189 69b71b554e91
child 9427 a9c60e655107
equal deleted inserted replaced
9265:35aab1c9c08c 9266:1b917b8b1b38
   273 by (auto_tac (claset(),simpset() addsimps prat_add_ac));
   273 by (auto_tac (claset(),simpset() addsimps prat_add_ac));
   274 by (rtac bexI 1);
   274 by (rtac bexI 1);
   275 by (auto_tac (claset() addSIs [exI],simpset() addsimps prat_add_ac));
   275 by (auto_tac (claset() addSIs [exI],simpset() addsimps prat_add_ac));
   276 qed "preal_add_assoc";
   276 qed "preal_add_assoc";
   277 
   277 
   278 qed_goal "preal_add_left_commute" thy
   278 Goal "(z1::preal) + (z2 + z3) = z2 + (z1 + z3)";
   279     "(z1::preal) + (z2 + z3) = z2 + (z1 + z3)"
   279 by (rtac (preal_add_commute RS trans) 1);
   280  (fn _ => [rtac (preal_add_commute RS trans) 1, rtac (preal_add_assoc RS trans) 1,
   280 by (rtac (preal_add_assoc RS trans) 1);
   281            rtac (preal_add_commute RS arg_cong) 1]);
   281 by (rtac (preal_add_commute RS arg_cong) 1);
       
   282 qed "preal_add_left_commute";
   282 
   283 
   283 (* Positive Reals addition is an AC operator *)
   284 (* Positive Reals addition is an AC operator *)
   284 bind_thms ("preal_add_ac", [preal_add_assoc, preal_add_commute, preal_add_left_commute]);
   285 bind_thms ("preal_add_ac", [preal_add_assoc, preal_add_commute, preal_add_left_commute]);
   285 
   286 
   286   (*** Properties of multiplication ***)
   287   (*** Properties of multiplication ***)
   358 by (auto_tac (claset(),simpset() addsimps prat_mult_ac));
   359 by (auto_tac (claset(),simpset() addsimps prat_mult_ac));
   359 by (rtac bexI 1);
   360 by (rtac bexI 1);
   360 by (auto_tac (claset() addSIs [exI],simpset() addsimps prat_mult_ac));
   361 by (auto_tac (claset() addSIs [exI],simpset() addsimps prat_mult_ac));
   361 qed "preal_mult_assoc";
   362 qed "preal_mult_assoc";
   362 
   363 
   363 qed_goal "preal_mult_left_commute" thy
   364 Goal "(z1::preal) * (z2 * z3) = z2 * (z1 * z3)";
   364     "(z1::preal) * (z2 * z3) = z2 * (z1 * z3)"
   365 by (rtac (preal_mult_commute RS trans) 1);
   365  (fn _ => [rtac (preal_mult_commute RS trans) 1, 
   366 by (rtac (preal_mult_assoc RS trans) 1);
   366            rtac (preal_mult_assoc RS trans) 1,
   367 by (rtac (preal_mult_commute RS arg_cong) 1);
   367            rtac (preal_mult_commute RS arg_cong) 1]);
   368 qed "preal_mult_left_commute";
   368 
   369 
   369 (* Positive Reals multiplication is an AC operator *)
   370 (* Positive Reals multiplication is an AC operator *)
   370 bind_thms ("preal_mult_ac", [preal_mult_assoc, 
   371 bind_thms ("preal_mult_ac", [preal_mult_assoc, 
   371                      preal_mult_commute, 
   372                      preal_mult_commute, 
   372                      preal_mult_left_commute]);
   373                      preal_mult_left_commute]);
   395 by (rtac preal_mult_1 1);
   396 by (rtac preal_mult_1 1);
   396 qed "preal_mult_1_right";
   397 qed "preal_mult_1_right";
   397 
   398 
   398 (** Lemmas **)
   399 (** Lemmas **)
   399 
   400 
   400 qed_goal "preal_add_assoc_cong" thy
   401 Goal "(z::preal) + v = z' + v' ==> z + (v + w) = z' + (v' + w)";
   401     "!!z. (z::preal) + v = z' + v' ==> z + (v + w) = z' + (v' + w)"
   402 by (asm_simp_tac (simpset() addsimps [preal_add_assoc RS sym]) 1);
   402  (fn _ => [(asm_simp_tac (simpset() addsimps [preal_add_assoc RS sym]) 1)]);
   403 qed "preal_add_assoc_cong";
   403 
   404 
   404 qed_goal "preal_add_assoc_swap" thy "(z::preal) + (v + w) = v + (z + w)"
   405 Goal "(z::preal) + (v + w) = v + (z + w)";
   405  (fn _ => [(REPEAT (ares_tac [preal_add_commute RS preal_add_assoc_cong] 1))]);
   406 by (REPEAT (ares_tac [preal_add_commute RS preal_add_assoc_cong] 1));
       
   407 qed "preal_add_assoc_swap";
   406 
   408 
   407 (** Distribution of multiplication across addition **)
   409 (** Distribution of multiplication across addition **)
   408 (** lemmas for the proof **)
   410 (** lemmas for the proof **)
   409 
   411 
   410  (** lemmas **)
   412  (** lemmas **)