src/HOL/Transcendental.thy
changeset 29170 dad3933c88dd
parent 29167 37a952bb9ebc
child 29171 5eff800a695f
equal deleted inserted replaced
29169:6a5f1d8d7344 29170:dad3933c88dd
   562 
   562 
   563 lemma exp_add: "exp (x + y) = exp x * exp y"
   563 lemma exp_add: "exp (x + y) = exp x * exp y"
   564 unfolding exp_def
   564 unfolding exp_def
   565 by (simp only: Cauchy_product summable_norm_exp exp_series_add)
   565 by (simp only: Cauchy_product summable_norm_exp exp_series_add)
   566 
   566 
       
   567 lemma mult_exp_exp: "exp x * exp y = exp (x + y)"
       
   568 by (rule exp_add [symmetric])
       
   569 
   567 lemma exp_of_real: "exp (of_real x) = of_real (exp x)"
   570 lemma exp_of_real: "exp (of_real x) = of_real (exp x)"
   568 unfolding exp_def
   571 unfolding exp_def
   569 apply (subst of_real.suminf)
   572 apply (subst of_real.suminf)
   570 apply (rule summable_exp_generic)
   573 apply (rule summable_exp_generic)
   571 apply (simp add: scaleR_conv_of_real)
   574 apply (simp add: scaleR_conv_of_real)
   572 done
   575 done
   573 
   576 
   574 lemma DERIV_exp_add_const: "DERIV (%x. exp (x + y)) x :> exp(x + y)"
       
   575 proof -
       
   576   have "DERIV (exp \<circ> (\<lambda>x. x + y)) x :> exp (x + y) * (1+0)"
       
   577     by (fast intro: DERIV_chain DERIV_add DERIV_exp DERIV_ident DERIV_const) 
       
   578   thus ?thesis by (simp add: o_def)
       
   579 qed
       
   580 
       
   581 lemma DERIV_exp_minus [simp]: "DERIV (%x. exp (-x)) x :> - exp(-x)"
       
   582 proof -
       
   583   have "DERIV (exp \<circ> uminus) x :> exp (- x) * - 1"
       
   584     by (fast intro: DERIV_chain DERIV_minus DERIV_exp DERIV_ident)
       
   585   thus ?thesis by (simp add: o_def)
       
   586 qed
       
   587 
       
   588 lemma DERIV_exp_exp_zero [simp]: "DERIV (%x. exp (x + y) * exp (- x)) x :> 0"
       
   589 proof -
       
   590   have "DERIV (\<lambda>x. exp (x + y) * exp (- x)) x
       
   591        :> exp (x + y) * exp (- x) + - exp (- x) * exp (x + y)"
       
   592     by (fast intro: DERIV_exp_add_const DERIV_exp_minus DERIV_mult) 
       
   593   thus ?thesis by (simp add: mult_commute)
       
   594 qed
       
   595 
       
   596 lemma exp_mult_minus [simp]: "exp x * exp(-x) = 1"
       
   597 by (simp add: exp_add [symmetric])
       
   598 
       
   599 lemma exp_mult_minus2 [simp]: "exp(-x)*exp(x) = 1"
       
   600 by (simp add: mult_commute)
       
   601 
       
   602 lemma exp_minus: "exp(-x) = inverse(exp(x))"
       
   603 by (auto intro: inverse_unique [symmetric])
       
   604 
       
   605 lemma exp_diff: "exp(x - y) = exp(x)/(exp y)"
       
   606 apply (simp add: diff_minus divide_inverse)
       
   607 apply (simp add: exp_add exp_minus)
       
   608 done
       
   609 
       
   610 lemma exp_not_eq_zero [simp]: "exp x \<noteq> 0"
   577 lemma exp_not_eq_zero [simp]: "exp x \<noteq> 0"
   611 apply (cut_tac x = x in exp_mult_minus2)
   578 proof
   612 apply (auto simp del: exp_mult_minus2)
   579   have "exp x * exp (- x) = 1" by (simp add: mult_exp_exp)
   613 done
   580   also assume "exp x = 0"
       
   581   finally show "False" by simp
       
   582 qed
       
   583 
       
   584 lemma exp_minus: "exp (- x) = inverse (exp x)"
       
   585 by (rule inverse_unique [symmetric], simp add: mult_exp_exp)
       
   586 
       
   587 lemma exp_diff: "exp (x - y) = exp x / exp y"
       
   588   unfolding diff_minus divide_inverse
       
   589   by (simp add: exp_add exp_minus)
   614 
   590 
   615 
   591 
   616 subsubsection {* Properties of the Exponential Function on Reals *}
   592 subsubsection {* Properties of the Exponential Function on Reals *}
       
   593 
       
   594 text {* Comparisons of @{term "exp x"} with zero. *}
       
   595 
       
   596 text{*Proof: because every exponential can be seen as a square.*}
       
   597 lemma exp_ge_zero [simp]: "0 \<le> exp (x::real)"
       
   598 proof -
       
   599   have "0 \<le> exp (x/2) * exp (x/2)" by simp
       
   600   thus ?thesis by (simp add: exp_add [symmetric])
       
   601 qed
       
   602 
       
   603 lemma exp_gt_zero [simp]: "0 < exp (x::real)"
       
   604 by (simp add: order_less_le)
       
   605 
       
   606 lemma not_exp_less_zero [simp]: "\<not> exp (x::real) < 0"
       
   607 by (simp add: not_less)
       
   608 
       
   609 lemma not_exp_le_zero [simp]: "\<not> exp (x::real) \<le> 0"
       
   610 by (simp add: not_le)
       
   611 
       
   612 lemma abs_exp_cancel [simp]: "\<bar>exp x::real\<bar> = exp x"
       
   613 by simp
       
   614 
       
   615 lemma exp_real_of_nat_mult: "exp(real n * x) = exp(x) ^ n"
       
   616 apply (induct "n")
       
   617 apply (auto simp add: real_of_nat_Suc right_distrib exp_add mult_commute)
       
   618 done
       
   619 
       
   620 text {* Strict monotonicity of exponential. *}
   617 
   621 
   618 lemma exp_ge_add_one_self_aux: "0 \<le> (x::real) ==> (1 + x) \<le> exp(x)"
   622 lemma exp_ge_add_one_self_aux: "0 \<le> (x::real) ==> (1 + x) \<le> exp(x)"
   619 apply (drule order_le_imp_less_or_eq, auto)
   623 apply (drule order_le_imp_less_or_eq, auto)
   620 apply (simp add: exp_def)
   624 apply (simp add: exp_def)
   621 apply (rule real_le_trans)
   625 apply (rule real_le_trans)
   622 apply (rule_tac [2] n = 2 and f = "(%n. inverse (real (fact n)) * x ^ n)" in series_pos_le)
   626 apply (rule_tac [2] n = 2 and f = "(%n. inverse (real (fact n)) * x ^ n)" in series_pos_le)
   623 apply (auto intro: summable_exp simp add: numeral_2_eq_2 zero_le_mult_iff)
   627 apply (auto intro: summable_exp simp add: numeral_2_eq_2 zero_le_mult_iff)
   624 done
   628 done
   625 
   629 
   626 lemma exp_gt_one [simp]: "0 < (x::real) ==> 1 < exp x"
   630 lemma exp_gt_one: "0 < (x::real) \<Longrightarrow> 1 < exp x"
   627 apply (rule order_less_le_trans)
   631 proof -
   628 apply (rule_tac [2] exp_ge_add_one_self_aux, auto)
   632   assume x: "0 < x"
   629 done
   633   hence "1 < 1 + x" by simp
   630 
   634   also from x have "1 + x \<le> exp x"
   631 lemma exp_add_mult_minus [simp]: "exp(x + y)*exp(-x) = exp(y::real)"
   635     by (simp add: exp_ge_add_one_self_aux)
   632 by (simp add: exp_add [symmetric])
   636   finally show ?thesis .
   633 
   637 qed
   634 text{*Proof: because every exponential can be seen as a square.*}
       
   635 lemma exp_ge_zero [simp]: "0 \<le> exp (x::real)"
       
   636 proof -
       
   637   have "0 \<le> exp (x/2) * exp (x/2)" by simp
       
   638   thus ?thesis by (simp add: exp_add [symmetric])
       
   639 qed
       
   640 
       
   641 lemma exp_gt_zero [simp]: "0 < exp (x::real)"
       
   642 by (simp add: order_less_le)
       
   643 
       
   644 lemma inv_exp_gt_zero: "0 < inverse(exp x::real)"
       
   645 by simp
       
   646 
       
   647 lemma abs_exp_cancel [simp]: "\<bar>exp x::real\<bar> = exp x"
       
   648 by simp
       
   649 
       
   650 lemma exp_real_of_nat_mult: "exp(real n * x) = exp(x) ^ n"
       
   651 apply (induct "n")
       
   652 apply (auto simp add: real_of_nat_Suc right_distrib exp_add mult_commute)
       
   653 done
       
   654 
   638 
   655 lemma exp_less_mono:
   639 lemma exp_less_mono:
   656   fixes x y :: real
   640   fixes x y :: real
   657   assumes "x < y" shows "exp x < exp y"
   641   assumes "x < y" shows "exp x < exp y"
   658 proof -
   642 proof -
   661   hence "1 < exp y / exp x" by (simp only: exp_diff)
   645   hence "1 < exp y / exp x" by (simp only: exp_diff)
   662   thus "exp x < exp y" by simp
   646   thus "exp x < exp y" by simp
   663 qed
   647 qed
   664 
   648 
   665 lemma exp_less_cancel: "exp (x::real) < exp y ==> x < y"
   649 lemma exp_less_cancel: "exp (x::real) < exp y ==> x < y"
   666 apply (simp add: linorder_not_le [symmetric]) 
   650 apply (simp add: linorder_not_le [symmetric])
   667 apply (auto simp add: order_le_less exp_less_mono) 
   651 apply (auto simp add: order_le_less exp_less_mono)
   668 done
   652 done
   669 
   653 
   670 lemma exp_less_cancel_iff [iff]: "(exp(x::real) < exp(y)) = (x < y)"
   654 lemma exp_less_cancel_iff [iff]: "exp (x::real) < exp y \<longleftrightarrow> x < y"
   671 by (auto intro: exp_less_mono exp_less_cancel)
   655 by (auto intro: exp_less_mono exp_less_cancel)
   672 
   656 
   673 lemma exp_le_cancel_iff [iff]: "(exp(x::real) \<le> exp(y)) = (x \<le> y)"
   657 lemma exp_le_cancel_iff [iff]: "exp (x::real) \<le> exp y \<longleftrightarrow> x \<le> y"
   674 by (auto simp add: linorder_not_less [symmetric])
   658 by (auto simp add: linorder_not_less [symmetric])
   675 
   659 
   676 lemma exp_inj_iff [iff]: "(exp (x::real) = exp y) = (x = y)"
   660 lemma exp_inj_iff [iff]: "exp (x::real) = exp y \<longleftrightarrow> x = y"
   677 by (simp add: order_eq_iff)
   661 by (simp add: order_eq_iff)
       
   662 
       
   663 text {* Comparisons of @{term "exp x"} with one. *}
       
   664 
       
   665 lemma one_less_exp_iff [simp]: "1 < exp (x::real) \<longleftrightarrow> 0 < x"
       
   666   using exp_less_cancel_iff [where x=0 and y=x] by simp
       
   667 
       
   668 lemma exp_less_one_iff [simp]: "exp (x::real) < 1 \<longleftrightarrow> x < 0"
       
   669   using exp_less_cancel_iff [where x=x and y=0] by simp
       
   670 
       
   671 lemma one_le_exp_iff [simp]: "1 \<le> exp (x::real) \<longleftrightarrow> 0 \<le> x"
       
   672   using exp_le_cancel_iff [where x=0 and y=x] by simp
       
   673 
       
   674 lemma exp_le_one_iff [simp]: "exp (x::real) \<le> 1 \<longleftrightarrow> x \<le> 0"
       
   675   using exp_le_cancel_iff [where x=x and y=0] by simp
       
   676 
       
   677 lemma exp_eq_one_iff [simp]: "exp (x::real) = 1 \<longleftrightarrow> x = 0"
       
   678   using exp_inj_iff [where x=x and y=0] by simp
   678 
   679 
   679 lemma lemma_exp_total: "1 \<le> y ==> \<exists>x. 0 \<le> x & x \<le> y - 1 & exp(x::real) = y"
   680 lemma lemma_exp_total: "1 \<le> y ==> \<exists>x. 0 \<le> x & x \<le> y - 1 & exp(x::real) = y"
   680 apply (rule IVT)
   681 apply (rule IVT)
   681 apply (auto intro: isCont_exp simp add: le_diff_eq)
   682 apply (auto intro: isCont_exp simp add: le_diff_eq)
   682 apply (subgoal_tac "1 + (y - 1) \<le> exp (y - 1)") 
   683 apply (subgoal_tac "1 + (y - 1) \<le> exp (y - 1)") 
  2106 done
  2107 done
  2107 
  2108 
  2108 lemma sin_zero_abs_cos_one: "sin x = 0 ==> \<bar>cos x\<bar> = 1"
  2109 lemma sin_zero_abs_cos_one: "sin x = 0 ==> \<bar>cos x\<bar> = 1"
  2109 by (auto simp add: sin_zero_iff even_mult_two_ex)
  2110 by (auto simp add: sin_zero_iff even_mult_two_ex)
  2110 
  2111 
  2111 lemma exp_eq_one_iff [simp]: "(exp (x::real) = 1) = (x = 0)"
       
  2112 apply auto
       
  2113 apply (drule_tac f = ln in arg_cong, auto)
       
  2114 done
       
  2115 
       
  2116 lemma cos_one_sin_zero: "cos x = 1 ==> sin x = 0"
  2112 lemma cos_one_sin_zero: "cos x = 1 ==> sin x = 0"
  2117 by (cut_tac x = x in sin_cos_squared_add3, auto)
  2113 by (cut_tac x = x in sin_cos_squared_add3, auto)
  2118 
  2114 
  2119 
  2115 
  2120 subsection {* Existence of Polar Coordinates *}
  2116 subsection {* Existence of Polar Coordinates *}