src/HOL/Transcendental.thy
changeset 61284 2314c2f62eb1
parent 61076 bdc1e2f0a86a
child 61518 ff12606337e9
equal deleted inserted replaced
61282:3e578ddef85d 61284:2314c2f62eb1
   868       then obtain n where "x = ?s n" and "n \<in> {..<?N}"
   868       then obtain n where "x = ?s n" and "n \<in> {..<?N}"
   869         using image_iff[THEN iffD1] by blast
   869         using image_iff[THEN iffD1] by blast
   870       from DERIV_D[OF DERIV_f[where n=n], THEN LIM_D, OF \<open>0 < ?r\<close>, unfolded real_norm_def]
   870       from DERIV_D[OF DERIV_f[where n=n], THEN LIM_D, OF \<open>0 < ?r\<close>, unfolded real_norm_def]
   871       obtain s where s_bound: "0 < s \<and> (\<forall>x. x \<noteq> 0 \<and> \<bar>x\<bar> < s \<longrightarrow> \<bar>?diff n x - f' x0 n\<bar> < ?r)"
   871       obtain s where s_bound: "0 < s \<and> (\<forall>x. x \<noteq> 0 \<and> \<bar>x\<bar> < s \<longrightarrow> \<bar>?diff n x - f' x0 n\<bar> < ?r)"
   872         by auto
   872         by auto
   873       have "0 < ?s n" by (rule someI2[where a=s]) (auto simp add: s_bound)
   873       have "0 < ?s n" by (rule someI2[where a=s]) (auto simp add: s_bound simp del: real_of_nat_Suc)
   874       thus "0 < x" unfolding \<open>x = ?s n\<close> .
   874       thus "0 < x" unfolding \<open>x = ?s n\<close> .
   875     qed
   875     qed
   876   qed auto
   876   qed auto
   877 
   877 
   878   def S \<equiv> "min (min (x0 - a) (b - x0)) S'"
   878   def S \<equiv> "min (min (x0 - a) (b - x0)) S'"
   928     qed auto
   928     qed auto
   929     also have "\<dots> = of_nat (card {..<?N}) * ?r"
   929     also have "\<dots> = of_nat (card {..<?N}) * ?r"
   930       by (rule setsum_constant)
   930       by (rule setsum_constant)
   931     also have "\<dots> = real ?N * ?r"
   931     also have "\<dots> = real ?N * ?r"
   932       unfolding real_eq_of_nat by auto
   932       unfolding real_eq_of_nat by auto
   933     also have "\<dots> = r/3" by auto
   933     also have "\<dots> = r/3" by (auto simp del: real_of_nat_Suc)
   934     finally have "\<bar>\<Sum>n<?N. ?diff n x - f' x0 n \<bar> < r / 3" (is "?diff_part < r / 3") .
   934     finally have "\<bar>\<Sum>n<?N. ?diff n x - f' x0 n \<bar> < r / 3" (is "?diff_part < r / 3") .
   935 
   935 
   936     from suminf_diff[OF allf_summable[OF x_in_I] allf_summable[OF x0_in_I]]
   936     from suminf_diff[OF allf_summable[OF x_in_I] allf_summable[OF x0_in_I]]
   937     have "\<bar>(suminf (f (x0 + x)) - (suminf (f x0))) / x - suminf (f' x0)\<bar> =
   937     have "\<bar>(suminf (f (x0 + x)) - (suminf (f x0))) / x - suminf (f' x0)\<bar> =
   938         \<bar>\<Sum>n. ?diff n x - f' x0 n\<bar>"
   938         \<bar>\<Sum>n. ?diff n x - f' x0 n\<bar>"
  1040           fix n
  1040           fix n
  1041           have le: "\<bar>f n\<bar> * 1 \<le> \<bar>f n\<bar> * real (Suc n)"
  1041           have le: "\<bar>f n\<bar> * 1 \<le> \<bar>f n\<bar> * real (Suc n)"
  1042             by (rule mult_left_mono) auto
  1042             by (rule mult_left_mono) auto
  1043           show "norm (f n * x^n) \<le> norm (f n * real (Suc n) * x^n)"
  1043           show "norm (f n * x^n) \<le> norm (f n * real (Suc n) * x^n)"
  1044             unfolding real_norm_def abs_mult
  1044             unfolding real_norm_def abs_mult
  1045             by (rule mult_right_mono) (auto simp add: le[unfolded mult_1_right])
  1045             using le mult_right_mono by fastforce
  1046         qed (rule powser_insidea[OF converges[OF \<open>R' \<in> {-R <..< R}\<close>] \<open>norm x < norm R'\<close>])
  1046         qed (rule powser_insidea[OF converges[OF \<open>R' \<in> {-R <..< R}\<close>] \<open>norm x < norm R'\<close>])
  1047         from this[THEN summable_mult2[where c=x], unfolded mult.assoc, unfolded mult.commute]
  1047         from this[THEN summable_mult2[where c=x], unfolded mult.assoc, unfolded mult.commute]
  1048         show "summable (?f x)" by auto
  1048         show "summable (?f x)" by auto
  1049       }
  1049       }
  1050       show "summable (?f' x0)"
  1050       show "summable (?f' x0)"
  5108         by (rule LIM_less_bound)
  5108         by (rule LIM_less_bound)
  5109       hence "?diff 1 n \<le> ?a 1 n" by auto
  5109       hence "?diff 1 n \<le> ?a 1 n" by auto
  5110     }
  5110     }
  5111     have "?a 1 ----> 0"
  5111     have "?a 1 ----> 0"
  5112       unfolding tendsto_rabs_zero_iff power_one divide_inverse One_nat_def
  5112       unfolding tendsto_rabs_zero_iff power_one divide_inverse One_nat_def
  5113       by (auto intro!: tendsto_mult LIMSEQ_linear LIMSEQ_inverse_real_of_nat)
  5113       by (auto intro!: tendsto_mult LIMSEQ_linear LIMSEQ_inverse_real_of_nat simp del: real_of_nat_Suc)
  5114     have "?diff 1 ----> 0"
  5114     have "?diff 1 ----> 0"
  5115     proof (rule LIMSEQ_I)
  5115     proof (rule LIMSEQ_I)
  5116       fix r :: real
  5116       fix r :: real
  5117       assume "0 < r"
  5117       assume "0 < r"
  5118       obtain N :: nat where N_I: "\<And>n. N \<le> n \<Longrightarrow> ?a 1 n < r"
  5118       obtain N :: nat where N_I: "\<And>n. N \<le> n \<Longrightarrow> ?a 1 n < r"