src/HOL/Real/RealPow.ML
changeset 10712 351ba950d4d9
parent 10699 f0c3da8477e9
child 10715 c838477b5c18
equal deleted inserted replaced
10711:a9f6994fb906 10712:351ba950d4d9
    41 Goal "(r::real) ^ 1 = r";
    41 Goal "(r::real) ^ 1 = r";
    42 by (Simp_tac 1);
    42 by (Simp_tac 1);
    43 qed "realpow_one";
    43 qed "realpow_one";
    44 Addsimps [realpow_one];
    44 Addsimps [realpow_one];
    45 
    45 
    46 Goal "(r::real) ^ 2 = r * r";
    46 Goal "(r::real)^2 = r * r";
    47 by (Simp_tac 1);
    47 by (Simp_tac 1);
    48 qed "realpow_two";
    48 qed "realpow_two";
    49 
    49 
    50 Goal "(#0::real) < r --> #0 <= r ^ n";
    50 Goal "(#0::real) < r --> #0 <= r ^ n";
    51 by (induct_tac "n" 1);
    51 by (induct_tac "n" 1);
   109 Goal "((r::real) * s) ^ n = (r ^ n) * (s ^ n)";
   109 Goal "((r::real) * s) ^ n = (r ^ n) * (s ^ n)";
   110 by (induct_tac "n" 1);
   110 by (induct_tac "n" 1);
   111 by (auto_tac (claset(),simpset() addsimps real_mult_ac));
   111 by (auto_tac (claset(),simpset() addsimps real_mult_ac));
   112 qed "realpow_mult";
   112 qed "realpow_mult";
   113 
   113 
   114 Goal "(#0::real) <= r ^ 2";
   114 Goal "(#0::real) <= r^2";
   115 by (simp_tac (simpset() addsimps [rename_numerals real_le_square]) 1);
   115 by (simp_tac (simpset() addsimps [rename_numerals real_le_square]) 1);
   116 qed "realpow_two_le";
   116 qed "realpow_two_le";
   117 Addsimps [realpow_two_le];
   117 Addsimps [realpow_two_le];
   118 
   118 
   119 Goal "abs((x::real) ^ 2) = x ^ 2";
   119 Goal "abs((x::real)^2) = x^2";
   120 by (simp_tac (simpset() addsimps [abs_eqI1, 
   120 by (simp_tac (simpset() addsimps [abs_eqI1, 
   121 				  rename_numerals real_le_square]) 1);
   121 				  rename_numerals real_le_square]) 1);
   122 qed "abs_realpow_two";
   122 qed "abs_realpow_two";
   123 Addsimps [abs_realpow_two];
   123 Addsimps [abs_realpow_two];
   124 
   124 
   125 Goal "abs(x::real) ^ 2 = x ^ 2";
   125 Goal "abs(x::real) ^ 2 = x^2";
   126 by (simp_tac (simpset() addsimps [realpow_abs,abs_eqI1]
   126 by (simp_tac (simpset() addsimps [realpow_abs,abs_eqI1]
   127                         delsimps [realpow_Suc]) 1);
   127                         delsimps [realpow_Suc]) 1);
   128 qed "realpow_two_abs";
   128 qed "realpow_two_abs";
   129 Addsimps [realpow_two_abs];
   129 Addsimps [realpow_two_abs];
   130 
   130 
   131 Goal "(#1::real) < r ==> #1 < r ^ 2";
   131 Goal "(#1::real) < r ==> #1 < r^2";
   132 by Auto_tac;
   132 by Auto_tac;
   133 by (cut_facts_tac [rename_numerals real_zero_less_one] 1);
   133 by (cut_facts_tac [rename_numerals real_zero_less_one] 1);
   134 by (forw_inst_tac [("R1.0","#0")] real_less_trans 1);
   134 by (forw_inst_tac [("R1.0","#0")] real_less_trans 1);
   135 by (assume_tac 1);
   135 by (assume_tac 1);
   136 by (dres_inst_tac [("z","r"),("x","#1")] 
   136 by (dres_inst_tac [("z","r"),("x","#1")] 
   350                   real_mult_assoc RS sym]) 1);
   350                   real_mult_assoc RS sym]) 1);
   351 qed "realpow_two_mult_inverse";
   351 qed "realpow_two_mult_inverse";
   352 Addsimps [realpow_two_mult_inverse];
   352 Addsimps [realpow_two_mult_inverse];
   353 
   353 
   354 (* 05/00 *)
   354 (* 05/00 *)
   355 Goal "(-x) ^ 2 = (x::real) ^ 2";
   355 Goal "(-x)^2 = (x::real) ^ 2";
   356 by (Simp_tac 1);
   356 by (Simp_tac 1);
   357 qed "realpow_two_minus";
   357 qed "realpow_two_minus";
   358 Addsimps [realpow_two_minus];
   358 Addsimps [realpow_two_minus];
   359 
   359 
   360 Goal "(x::real) ^ 2 + - (y ^ 2) = (x + -y) * (x + y)";
   360 Goalw [real_diff_def] "(x::real)^2 - y^2 = (x - y) * (x + y)";
   361 by (simp_tac (simpset() addsimps [real_add_mult_distrib2,
   361 by (simp_tac (simpset() addsimps 
   362     real_add_mult_distrib, real_minus_mult_eq2 RS sym] 
   362               [real_add_mult_distrib2, real_add_mult_distrib, 
   363     @ real_mult_ac) 1);
   363                real_minus_mult_eq2 RS sym] @ real_mult_ac) 1);
   364 qed "realpow_two_add_minus";
       
   365 
       
   366 Goalw [real_diff_def] 
       
   367       "(x::real) ^ 2 - y ^ 2 = (x - y) * (x + y)";
       
   368 by (simp_tac (simpset() addsimps [realpow_two_add_minus]
       
   369                         delsimps [realpow_Suc]) 1);
       
   370 qed "realpow_two_diff";
   364 qed "realpow_two_diff";
   371 
   365 
   372 Goalw [real_diff_def] 
   366 Goalw [real_diff_def] "((x::real)^2 = y^2) = (x = y | x = -y)";
   373       "((x::real) ^ 2 = y ^ 2) = (x = y | x = -y)";
   367 by (cut_inst_tac [("x","x"),("y","y")] realpow_two_diff 1);
   374 by (auto_tac (claset(),simpset() delsimps [realpow_Suc]));
   368 by (auto_tac (claset(), simpset() delsimps [realpow_Suc]));
   375 by (dtac (rename_numerals (real_eq_minus_iff RS iffD1 RS sym)) 1);
       
   376 by (auto_tac (claset() addDs [rename_numerals real_add_minus_eq_minus], 
       
   377           simpset() addsimps [realpow_two_add_minus] delsimps [realpow_Suc]));
       
   378 qed "realpow_two_disj";
   369 qed "realpow_two_disj";
   379 
   370 
   380 (* used in Transc *)
   371 (* used in Transc *)
   381 Goal  "[|(x::real) ~= #0; m <= n |] ==> x ^ (n - m) = x ^ n * inverse (x ^ m)";
   372 Goal  "[|(x::real) ~= #0; m <= n |] ==> x ^ (n - m) = x ^ n * inverse (x ^ m)";
   382 by (auto_tac (claset(),
   373 by (auto_tac (claset(),
   383               simpset() addsimps [le_eq_less_or_eq,
   374        simpset() addsimps [le_eq_less_or_eq, less_iff_Suc_add, realpow_add,
   384                                   less_iff_Suc_add,realpow_add,
   375                            realpow_not_zero] @ real_mult_ac));
   385                                   realpow_not_zero] @ real_mult_ac));
       
   386 qed "realpow_diff";
   376 qed "realpow_diff";
   387 
   377 
   388 Goal "real_of_nat (m) ^ n = real_of_nat (m ^ n)";
   378 Goal "real_of_nat (m) ^ n = real_of_nat (m ^ n)";
   389 by (induct_tac "n" 1);
   379 by (induct_tac "n" 1);
   390 by (auto_tac (claset(),
   380 by (auto_tac (claset(),