src/HOL/Transcendental.thy
changeset 56381 0556204bc230
parent 56371 fb9ae0727548
child 56409 36489d77c484
equal deleted inserted replaced
56380:9bb2856cc845 56381:0556204bc230
   628   assumes 1: "summable (\<lambda>n. c n * K ^ n)"
   628   assumes 1: "summable (\<lambda>n. c n * K ^ n)"
   629       and 2: "summable (\<lambda>n. (diffs c) n * K ^ n)"
   629       and 2: "summable (\<lambda>n. (diffs c) n * K ^ n)"
   630       and 3: "summable (\<lambda>n. (diffs (diffs c)) n * K ^ n)"
   630       and 3: "summable (\<lambda>n. (diffs (diffs c)) n * K ^ n)"
   631       and 4: "norm x < norm K"
   631       and 4: "norm x < norm K"
   632   shows "DERIV (\<lambda>x. \<Sum>n. c n * x ^ n) x :> (\<Sum>n. (diffs c) n * x ^ n)"
   632   shows "DERIV (\<lambda>x. \<Sum>n. c n * x ^ n) x :> (\<Sum>n. (diffs c) n * x ^ n)"
   633   unfolding deriv_def
   633   unfolding DERIV_def
   634 proof (rule LIM_zero_cancel)
   634 proof (rule LIM_zero_cancel)
   635   show "(\<lambda>h. (suminf (\<lambda>n. c n * (x + h) ^ n) - suminf (\<lambda>n. c n * x ^ n)) / h
   635   show "(\<lambda>h. (suminf (\<lambda>n. c n * (x + h) ^ n) - suminf (\<lambda>n. c n * x ^ n)) / h
   636             - suminf (\<lambda>n. diffs c n * x ^ n)) -- 0 --> 0"
   636             - suminf (\<lambda>n. diffs c n * x ^ n)) -- 0 --> 0"
   637   proof (rule LIM_equal2)
   637   proof (rule LIM_equal2)
   638     show "0 < norm K - norm x" using 4 by (simp add: less_diff_eq)
   638     show "0 < norm K - norm x" using 4 by (simp add: less_diff_eq)
   667     and allf_summable: "\<And> x. x \<in> {a <..< b} \<Longrightarrow> summable (f x)" and x0_in_I: "x0 \<in> {a <..< b}"
   667     and allf_summable: "\<And> x. x \<in> {a <..< b} \<Longrightarrow> summable (f x)" and x0_in_I: "x0 \<in> {a <..< b}"
   668     and "summable (f' x0)"
   668     and "summable (f' x0)"
   669     and "summable L"
   669     and "summable L"
   670     and L_def: "\<And>n x y. \<lbrakk> x \<in> { a <..< b} ; y \<in> { a <..< b} \<rbrakk> \<Longrightarrow> \<bar>f x n - f y n\<bar> \<le> L n * \<bar>x - y\<bar>"
   670     and L_def: "\<And>n x y. \<lbrakk> x \<in> { a <..< b} ; y \<in> { a <..< b} \<rbrakk> \<Longrightarrow> \<bar>f x n - f y n\<bar> \<le> L n * \<bar>x - y\<bar>"
   671   shows "DERIV (\<lambda> x. suminf (f x)) x0 :> (suminf (f' x0))"
   671   shows "DERIV (\<lambda> x. suminf (f x)) x0 :> (suminf (f' x0))"
   672   unfolding deriv_def
   672   unfolding DERIV_def
   673 proof (rule LIM_I)
   673 proof (rule LIM_I)
   674   fix r :: real
   674   fix r :: real
   675   assume "0 < r" hence "0 < r/3" by auto
   675   assume "0 < r" hence "0 < r/3" by auto
   676 
   676 
   677   obtain N_L where N_L: "\<And> n. N_L \<le> n \<Longrightarrow> \<bar> \<Sum> i. L (i + n) \<bar> < r/3"
   677   obtain N_L where N_L: "\<And> n. N_L \<le> n \<Longrightarrow> \<bar> \<Sum> i. L (i + n) \<bar> < r/3"
   861         qed
   861         qed
   862       }
   862       }
   863       {
   863       {
   864         fix n
   864         fix n
   865         show "DERIV (\<lambda> x. ?f x n) x0 :> (?f' x0 n)"
   865         show "DERIV (\<lambda> x. ?f x n) x0 :> (?f' x0 n)"
   866           by (auto intro!: DERIV_intros simp del: power_Suc)
   866           by (auto intro!: derivative_eq_intros simp del: power_Suc simp: real_of_nat_def)
   867       }
   867       }
   868       {
   868       {
   869         fix x
   869         fix x
   870         assume "x \<in> {-R' <..< R'}"
   870         assume "x \<in> {-R' <..< R'}"
   871         hence "R' \<in> {-R <..< R}" and "norm x < norm R'"
   871         hence "R' \<in> {-R <..< R}" and "norm x < norm R'"
   976   apply (simp_all only: diffs_of_real scaleR_conv_of_real exp_fdiffs)
   976   apply (simp_all only: diffs_of_real scaleR_conv_of_real exp_fdiffs)
   977   apply (rule exp_converges [THEN sums_summable, unfolded scaleR_conv_of_real])+
   977   apply (rule exp_converges [THEN sums_summable, unfolded scaleR_conv_of_real])+
   978   apply (simp del: of_real_add)
   978   apply (simp del: of_real_add)
   979   done
   979   done
   980 
   980 
   981 declare DERIV_exp[THEN DERIV_chain2, THEN DERIV_cong, DERIV_intros]
   981 declare DERIV_exp[THEN DERIV_chain2, derivative_intros]
   982 
   982 
   983 lemma isCont_exp: "isCont exp x"
   983 lemma isCont_exp: "isCont exp x"
   984   by (rule DERIV_exp [THEN DERIV_isCont])
   984   by (rule DERIV_exp [THEN DERIV_isCont])
   985 
   985 
   986 lemma isCont_exp' [simp]: "isCont f a \<Longrightarrow> isCont (\<lambda>x. exp (f x)) a"
   986 lemma isCont_exp' [simp]: "isCont f a \<Longrightarrow> isCont (\<lambda>x. exp (f x)) a"
  1313   done
  1313   done
  1314 
  1314 
  1315 lemma DERIV_ln_divide: "0 < x \<Longrightarrow> DERIV ln x :> 1 / x"
  1315 lemma DERIV_ln_divide: "0 < x \<Longrightarrow> DERIV ln x :> 1 / x"
  1316   by (rule DERIV_ln[THEN DERIV_cong], simp, simp add: divide_inverse)
  1316   by (rule DERIV_ln[THEN DERIV_cong], simp, simp add: divide_inverse)
  1317 
  1317 
  1318 declare DERIV_ln_divide[THEN DERIV_chain2, THEN DERIV_cong, DERIV_intros]
  1318 declare DERIV_ln_divide[THEN DERIV_chain2, derivative_intros]
  1319 
  1319 
  1320 lemma ln_series:
  1320 lemma ln_series:
  1321   assumes "0 < x" and "x < 2"
  1321   assumes "0 < x" and "x < 2"
  1322   shows "ln x = (\<Sum> n. (-1)^n * (1 / real (n + 1)) * (x - 1)^(Suc n))"
  1322   shows "ln x = (\<Sum> n. (-1)^n * (1 / real (n + 1)) * (x - 1)^(Suc n))"
  1323   (is "ln x = suminf (?f (x - 1))")
  1323   (is "ln x = suminf (?f (x - 1))")
  1354         by (auto simp add: power_mult_distrib[symmetric] summable_geometric[OF `norm (-x) < 1`])
  1354         by (auto simp add: power_mult_distrib[symmetric] summable_geometric[OF `norm (-x) < 1`])
  1355     qed
  1355     qed
  1356     hence "DERIV (\<lambda>x. suminf (?f x)) (x - 1) :> suminf (?f' x)"
  1356     hence "DERIV (\<lambda>x. suminf (?f x)) (x - 1) :> suminf (?f' x)"
  1357       unfolding One_nat_def by auto
  1357       unfolding One_nat_def by auto
  1358     hence "DERIV (\<lambda>x. suminf (?f (x - 1))) x :> suminf (?f' x)"
  1358     hence "DERIV (\<lambda>x. suminf (?f (x - 1))) x :> suminf (?f' x)"
  1359       unfolding deriv_def repos .
  1359       unfolding DERIV_def repos .
  1360     ultimately have "DERIV (\<lambda>x. ln x - suminf (?f (x - 1))) x :> (suminf (?f' x) - suminf (?f' x))"
  1360     ultimately have "DERIV (\<lambda>x. ln x - suminf (?f (x - 1))) x :> (suminf (?f' x) - suminf (?f' x))"
  1361       by (rule DERIV_diff)
  1361       by (rule DERIV_diff)
  1362     thus "DERIV (\<lambda>x. ln x - suminf (?f (x - 1))) x :> 0" by auto
  1362     thus "DERIV (\<lambda>x. ln x - suminf (?f (x - 1))) x :> 0" by auto
  1363   qed (auto simp add: assms)
  1363   qed (auto simp add: assms)
  1364   thus ?thesis by auto
  1364   thus ?thesis by auto
  1619   assumes "0 < x" "ln x = x - 1"
  1619   assumes "0 < x" "ln x = x - 1"
  1620   shows "x = 1"
  1620   shows "x = 1"
  1621 proof -
  1621 proof -
  1622   let ?l = "\<lambda>y. ln y - y + 1"
  1622   let ?l = "\<lambda>y. ln y - y + 1"
  1623   have D: "\<And>x. 0 < x \<Longrightarrow> DERIV ?l x :> (1 / x - 1)"
  1623   have D: "\<And>x. 0 < x \<Longrightarrow> DERIV ?l x :> (1 / x - 1)"
  1624     by (auto intro!: DERIV_intros)
  1624     by (auto intro!: derivative_eq_intros)
  1625 
  1625 
  1626   show ?thesis
  1626   show ?thesis
  1627   proof (cases rule: linorder_cases)
  1627   proof (cases rule: linorder_cases)
  1628     assume "x < 1"
  1628     assume "x < 1"
  1629     from dense[OF `x < 1`] obtain a where "x < a" "a < 1" by blast
  1629     from dense[OF `x < 1`] obtain a where "x < a" "a < 1" by blast
  1697 next
  1697 next
  1698   case (Suc k)
  1698   case (Suc k)
  1699   show ?case
  1699   show ?case
  1700   proof (rule lhospital_at_top_at_top)
  1700   proof (rule lhospital_at_top_at_top)
  1701     show "eventually (\<lambda>x. DERIV (\<lambda>x. x ^ Suc k) x :> (real (Suc k) * x^k)) at_top"
  1701     show "eventually (\<lambda>x. DERIV (\<lambda>x. x ^ Suc k) x :> (real (Suc k) * x^k)) at_top"
  1702       by eventually_elim (intro DERIV_intros, simp, simp)
  1702       by eventually_elim (intro derivative_eq_intros, auto)
  1703     show "eventually (\<lambda>x. DERIV exp x :> exp x) at_top"
  1703     show "eventually (\<lambda>x. DERIV exp x :> exp x) at_top"
  1704       by eventually_elim (auto intro!: DERIV_intros)
  1704       by eventually_elim auto
  1705     show "eventually (\<lambda>x. exp x \<noteq> 0) at_top"
  1705     show "eventually (\<lambda>x. exp x \<noteq> 0) at_top"
  1706       by auto
  1706       by auto
  1707     from tendsto_mult[OF tendsto_const Suc, of "real (Suc k)"]
  1707     from tendsto_mult[OF tendsto_const Suc, of "real (Suc k)"]
  1708     show "((\<lambda>x. real (Suc k) * x ^ k / exp x) ---> 0) at_top"
  1708     show "((\<lambda>x. real (Suc k) * x ^ k / exp x) ---> 0) at_top"
  1709       by simp
  1709       by simp
  1823   assumes "x > 0"
  1823   assumes "x > 0"
  1824   shows "DERIV (\<lambda>y. log b y) x :> 1 / (ln b * x)"
  1824   shows "DERIV (\<lambda>y. log b y) x :> 1 / (ln b * x)"
  1825 proof -
  1825 proof -
  1826   def lb \<equiv> "1 / ln b"
  1826   def lb \<equiv> "1 / ln b"
  1827   moreover have "DERIV (\<lambda>y. lb * ln y) x :> lb / x"
  1827   moreover have "DERIV (\<lambda>y. lb * ln y) x :> lb / x"
  1828     using `x > 0` by (auto intro!: DERIV_intros)
  1828     using `x > 0` by (auto intro!: derivative_eq_intros)
  1829   ultimately show ?thesis
  1829   ultimately show ?thesis
  1830     by (simp add: log_def)
  1830     by (simp add: log_def)
  1831 qed
  1831 qed
  1832 
  1832 
  1833 lemmas DERIV_log[THEN DERIV_chain2, THEN DERIV_cong, DERIV_intros]
  1833 lemmas DERIV_log[THEN DERIV_chain2, derivative_intros]
  1834 
  1834 
  1835 lemma powr_log_cancel [simp]: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> a powr (log a x) = x"
  1835 lemma powr_log_cancel [simp]: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> a powr (log a x) = x"
  1836   by (simp add: powr_def log_def)
  1836   by (simp add: powr_def log_def)
  1837 
  1837 
  1838 lemma log_powr_cancel [simp]: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> log a (a powr y) = y"
  1838 lemma log_powr_cancel [simp]: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> log a (a powr y) = y"
  2178   apply (rule DERIV_cong, rule termdiffs [where K="1 + \<bar>x\<bar>"])
  2178   apply (rule DERIV_cong, rule termdiffs [where K="1 + \<bar>x\<bar>"])
  2179   apply (simp_all add: diffs_sin_coeff diffs_cos_coeff
  2179   apply (simp_all add: diffs_sin_coeff diffs_cos_coeff
  2180     summable_minus summable_sin summable_cos)
  2180     summable_minus summable_sin summable_cos)
  2181   done
  2181   done
  2182 
  2182 
  2183 declare DERIV_sin[THEN DERIV_chain2, THEN DERIV_cong, DERIV_intros]
  2183 declare DERIV_sin[THEN DERIV_chain2, derivative_intros]
  2184 
  2184 
  2185 lemma DERIV_cos [simp]: "DERIV cos x :> -sin(x)"
  2185 lemma DERIV_cos [simp]: "DERIV cos x :> -sin(x)"
  2186   unfolding cos_def sin_def
  2186   unfolding cos_def sin_def
  2187   apply (rule DERIV_cong, rule termdiffs [where K="1 + \<bar>x\<bar>"])
  2187   apply (rule DERIV_cong, rule termdiffs [where K="1 + \<bar>x\<bar>"])
  2188   apply (simp_all add: diffs_sin_coeff diffs_cos_coeff diffs_minus
  2188   apply (simp_all add: diffs_sin_coeff diffs_cos_coeff diffs_minus
  2189     summable_minus summable_sin summable_cos suminf_minus)
  2189     summable_minus summable_sin summable_cos suminf_minus)
  2190   done
  2190   done
  2191 
  2191 
  2192 declare DERIV_cos[THEN DERIV_chain2, THEN DERIV_cong, DERIV_intros]
  2192 declare DERIV_cos[THEN DERIV_chain2, derivative_intros]
  2193 
  2193 
  2194 lemma isCont_sin: "isCont sin x"
  2194 lemma isCont_sin: "isCont sin x"
  2195   by (rule DERIV_sin [THEN DERIV_isCont])
  2195   by (rule DERIV_sin [THEN DERIV_isCont])
  2196 
  2196 
  2197 lemma isCont_cos: "isCont cos x"
  2197 lemma isCont_cos: "isCont cos x"
  2236   unfolding cos_def cos_coeff_def by (simp add: powser_zero)
  2236   unfolding cos_def cos_coeff_def by (simp add: powser_zero)
  2237 
  2237 
  2238 lemma sin_cos_squared_add [simp]: "(sin x)\<^sup>2 + (cos x)\<^sup>2 = 1"
  2238 lemma sin_cos_squared_add [simp]: "(sin x)\<^sup>2 + (cos x)\<^sup>2 = 1"
  2239 proof -
  2239 proof -
  2240   have "\<forall>x. DERIV (\<lambda>x. (sin x)\<^sup>2 + (cos x)\<^sup>2) x :> 0"
  2240   have "\<forall>x. DERIV (\<lambda>x. (sin x)\<^sup>2 + (cos x)\<^sup>2) x :> 0"
  2241     by (auto intro!: DERIV_intros)
  2241     by (auto intro!: derivative_eq_intros)
  2242   hence "(sin x)\<^sup>2 + (cos x)\<^sup>2 = (sin 0)\<^sup>2 + (cos 0)\<^sup>2"
  2242   hence "(sin x)\<^sup>2 + (cos x)\<^sup>2 = (sin 0)\<^sup>2 + (cos 0)\<^sup>2"
  2243     by (rule DERIV_isconst_all)
  2243     by (rule DERIV_isconst_all)
  2244   thus "(sin x)\<^sup>2 + (cos x)\<^sup>2 = 1" by simp
  2244   thus "(sin x)\<^sup>2 + (cos x)\<^sup>2 = 1" by simp
  2245 qed
  2245 qed
  2246 
  2246 
  2274 lemma cos_le_one [simp]: "cos x \<le> 1"
  2274 lemma cos_le_one [simp]: "cos x \<le> 1"
  2275   using abs_cos_le_one [of x] unfolding abs_le_iff by simp
  2275   using abs_cos_le_one [of x] unfolding abs_le_iff by simp
  2276 
  2276 
  2277 lemma DERIV_fun_pow: "DERIV g x :> m ==>
  2277 lemma DERIV_fun_pow: "DERIV g x :> m ==>
  2278       DERIV (\<lambda>x. (g x) ^ n) x :> real n * (g x) ^ (n - 1) * m"
  2278       DERIV (\<lambda>x. (g x) ^ n) x :> real n * (g x) ^ (n - 1) * m"
  2279   by (auto intro!: DERIV_intros)
  2279   by (auto intro!: derivative_eq_intros simp: real_of_nat_def)
  2280 
  2280 
  2281 lemma DERIV_fun_exp:
  2281 lemma DERIV_fun_exp:
  2282      "DERIV g x :> m ==> DERIV (\<lambda>x. exp(g x)) x :> exp(g x) * m"
  2282      "DERIV g x :> m ==> DERIV (\<lambda>x. exp(g x)) x :> exp(g x) * m"
  2283   by (auto intro!: DERIV_intros)
  2283   by (auto intro!: derivative_intros)
  2284 
  2284 
  2285 lemma DERIV_fun_sin:
  2285 lemma DERIV_fun_sin:
  2286      "DERIV g x :> m ==> DERIV (\<lambda>x. sin(g x)) x :> cos(g x) * m"
  2286      "DERIV g x :> m ==> DERIV (\<lambda>x. sin(g x)) x :> cos(g x) * m"
  2287   by (auto intro!: DERIV_intros)
  2287   by (auto intro!: derivative_intros)
  2288 
  2288 
  2289 lemma DERIV_fun_cos:
  2289 lemma DERIV_fun_cos:
  2290      "DERIV g x :> m ==> DERIV (\<lambda>x. cos(g x)) x :> -sin(g x) * m"
  2290      "DERIV g x :> m ==> DERIV (\<lambda>x. cos(g x)) x :> -sin(g x) * m"
  2291   by (auto intro!: DERIV_intros)
  2291   by (auto intro!: derivative_eq_intros simp: real_of_nat_def)
  2292 
  2292 
  2293 lemma sin_cos_add_lemma:
  2293 lemma sin_cos_add_lemma:
  2294   "(sin (x + y) - (sin x * cos y + cos x * sin y))\<^sup>2 +
  2294   "(sin (x + y) - (sin x * cos y + cos x * sin y))\<^sup>2 +
  2295     (cos (x + y) - (cos x * cos y - sin x * sin y))\<^sup>2 = 0"
  2295     (cos (x + y) - (cos x * cos y - sin x * sin y))\<^sup>2 = 0"
  2296   (is "?f x = 0")
  2296   (is "?f x = 0")
  2297 proof -
  2297 proof -
  2298   have "\<forall>x. DERIV (\<lambda>x. ?f x) x :> 0"
  2298   have "\<forall>x. DERIV (\<lambda>x. ?f x) x :> 0"
  2299     by (auto intro!: DERIV_intros simp add: algebra_simps)
  2299     by (auto intro!: derivative_eq_intros simp add: algebra_simps)
  2300   hence "?f x = ?f 0"
  2300   hence "?f x = ?f 0"
  2301     by (rule DERIV_isconst_all)
  2301     by (rule DERIV_isconst_all)
  2302   thus ?thesis by simp
  2302   thus ?thesis by simp
  2303 qed
  2303 qed
  2304 
  2304 
  2310 
  2310 
  2311 lemma sin_cos_minus_lemma:
  2311 lemma sin_cos_minus_lemma:
  2312   "(sin(-x) + sin(x))\<^sup>2 + (cos(-x) - cos(x))\<^sup>2 = 0" (is "?f x = 0")
  2312   "(sin(-x) + sin(x))\<^sup>2 + (cos(-x) - cos(x))\<^sup>2 = 0" (is "?f x = 0")
  2313 proof -
  2313 proof -
  2314   have "\<forall>x. DERIV (\<lambda>x. ?f x) x :> 0"
  2314   have "\<forall>x. DERIV (\<lambda>x. ?f x) x :> 0"
  2315     by (auto intro!: DERIV_intros simp add: algebra_simps)
  2315     by (auto intro!: derivative_eq_intros simp add: algebra_simps)
  2316   hence "?f x = ?f 0"
  2316   hence "?f x = ?f 0"
  2317     by (rule DERIV_isconst_all)
  2317     by (rule DERIV_isconst_all)
  2318   thus ?thesis by simp
  2318   thus ?thesis by simp
  2319 qed
  2319 qed
  2320 
  2320 
  2857   unfolding tan_def sin_double cos_double sin_squared_eq
  2857   unfolding tan_def sin_double cos_double sin_squared_eq
  2858   by (simp add: power2_eq_square)
  2858   by (simp add: power2_eq_square)
  2859 
  2859 
  2860 lemma DERIV_tan [simp]: "cos x \<noteq> 0 \<Longrightarrow> DERIV tan x :> inverse ((cos x)\<^sup>2)"
  2860 lemma DERIV_tan [simp]: "cos x \<noteq> 0 \<Longrightarrow> DERIV tan x :> inverse ((cos x)\<^sup>2)"
  2861   unfolding tan_def
  2861   unfolding tan_def
  2862   by (auto intro!: DERIV_intros, simp add: divide_inverse power2_eq_square)
  2862   by (auto intro!: derivative_eq_intros, simp add: divide_inverse power2_eq_square)
  2863 
  2863 
  2864 lemma isCont_tan: "cos x \<noteq> 0 \<Longrightarrow> isCont tan x"
  2864 lemma isCont_tan: "cos x \<noteq> 0 \<Longrightarrow> isCont tan x"
  2865   by (rule DERIV_tan [THEN DERIV_isCont])
  2865   by (rule DERIV_tan [THEN DERIV_isCont])
  2866 
  2866 
  2867 lemma isCont_tan' [simp]:
  2867 lemma isCont_tan' [simp]:
  3330   apply (simp add: add_pos_nonneg)
  3330   apply (simp add: add_pos_nonneg)
  3331   apply (simp, simp, simp, rule isCont_arctan)
  3331   apply (simp, simp, simp, rule isCont_arctan)
  3332   done
  3332   done
  3333 
  3333 
  3334 declare
  3334 declare
  3335   DERIV_arcsin[THEN DERIV_chain2, THEN DERIV_cong, DERIV_intros]
  3335   DERIV_arcsin[THEN DERIV_chain2, derivative_intros]
  3336   DERIV_arccos[THEN DERIV_chain2, THEN DERIV_cong, DERIV_intros]
  3336   DERIV_arccos[THEN DERIV_chain2, derivative_intros]
  3337   DERIV_arctan[THEN DERIV_chain2, THEN DERIV_cong, DERIV_intros]
  3337   DERIV_arctan[THEN DERIV_chain2, derivative_intros]
  3338 
  3338 
  3339 lemma filterlim_tan_at_right: "filterlim tan at_bot (at_right (- pi/2))"
  3339 lemma filterlim_tan_at_right: "filterlim tan at_bot (at_right (- pi/2))"
  3340   by (rule filterlim_at_bot_at_right[where Q="\<lambda>x. - pi/2 < x \<and> x < pi/2" and P="\<lambda>x. True" and g=arctan])
  3340   by (rule filterlim_at_bot_at_right[where Q="\<lambda>x. - pi/2 < x \<and> x < pi/2" and P="\<lambda>x. True" and g=arctan])
  3341      (auto simp: le_less eventually_at dist_real_def simp del: less_divide_eq_numeral1
  3341      (auto simp: le_less eventually_at dist_real_def simp del: less_divide_eq_numeral1
  3342            intro!: tan_monotone exI[of _ "pi/2"])
  3342            intro!: tan_monotone exI[of _ "pi/2"])
  3463   apply (simp only: cos_add sin_add real_of_nat_Suc distrib_right distrib_left add_divide_distrib)
  3463   apply (simp only: cos_add sin_add real_of_nat_Suc distrib_right distrib_left add_divide_distrib)
  3464   apply auto
  3464   apply auto
  3465   done
  3465   done
  3466 
  3466 
  3467 lemma DERIV_cos_add [simp]: "DERIV (\<lambda>x. cos (x + k)) xa :> - sin (xa + k)"
  3467 lemma DERIV_cos_add [simp]: "DERIV (\<lambda>x. cos (x + k)) xa :> - sin (xa + k)"
  3468   by (auto intro!: DERIV_intros)
  3468   by (auto intro!: derivative_eq_intros)
  3469 
  3469 
  3470 lemma sin_zero_abs_cos_one: "sin x = 0 ==> \<bar>cos x\<bar> = 1"
  3470 lemma sin_zero_abs_cos_one: "sin x = 0 ==> \<bar>cos x\<bar> = 1"
  3471   by (auto simp add: sin_zero_iff even_mult_two_ex)
  3471   by (auto simp add: sin_zero_iff even_mult_two_ex)
  3472 
  3472 
  3473 lemma cos_one_sin_zero: "cos x = 1 ==> sin x = 0"
  3473 lemma cos_one_sin_zero: "cos x = 1 ==> sin x = 0"