src/HOL/Transcendental.thy
changeset 31790 05c92381363c
parent 31338 d41a8ba25b67
child 31880 6fb86c61747c
equal deleted inserted replaced
31789:c8a590599cb5 31790:05c92381363c
  2240   by (simp add: tan_def)
  2240   by (simp add: tan_def)
  2241 
  2241 
  2242 lemma tan_periodic_nat[simp]: fixes n :: nat shows "tan (x + real n * pi) = tan x" 
  2242 lemma tan_periodic_nat[simp]: fixes n :: nat shows "tan (x + real n * pi) = tan x" 
  2243 proof (induct n arbitrary: x)
  2243 proof (induct n arbitrary: x)
  2244   case (Suc n)
  2244   case (Suc n)
  2245   have split_pi_off: "x + real (Suc n) * pi = (x + real n * pi) + pi" unfolding Suc_plus1 real_of_nat_add real_of_one real_add_mult_distrib by auto
  2245   have split_pi_off: "x + real (Suc n) * pi = (x + real n * pi) + pi" unfolding Suc_eq_plus1 real_of_nat_add real_of_one real_add_mult_distrib by auto
  2246   show ?case unfolding split_pi_off using Suc by auto
  2246   show ?case unfolding split_pi_off using Suc by auto
  2247 qed auto
  2247 qed auto
  2248 
  2248 
  2249 lemma tan_periodic_int[simp]: fixes i :: int shows "tan (x + real i * pi) = tan x"
  2249 lemma tan_periodic_int[simp]: fixes i :: int shows "tan (x + real i * pi) = tan x"
  2250 proof (cases "0 \<le> i")
  2250 proof (cases "0 \<le> i")
  2777     } note mono = this
  2777     } note mono = this
  2778     
  2778     
  2779     show ?thesis
  2779     show ?thesis
  2780     proof (cases "0 \<le> x")
  2780     proof (cases "0 \<le> x")
  2781       case True from mono[OF this `x \<le> 1`, THEN allI]
  2781       case True from mono[OF this `x \<le> 1`, THEN allI]
  2782       show ?thesis unfolding Suc_plus1[symmetric] by (rule mono_SucI2)
  2782       show ?thesis unfolding Suc_eq_plus1[symmetric] by (rule mono_SucI2)
  2783     next
  2783     next
  2784       case False hence "0 \<le> -x" and "-x \<le> 1" using `-1 \<le> x` by auto
  2784       case False hence "0 \<le> -x" and "-x \<le> 1" using `-1 \<le> x` by auto
  2785       from mono[OF this]
  2785       from mono[OF this]
  2786       have "\<And>n. 1 / real (Suc (Suc n * 2)) * x ^ Suc (Suc n * 2) \<ge> 1 / real (Suc (n * 2)) * x ^ Suc (n * 2)" using `0 \<le> -x` by auto
  2786       have "\<And>n. 1 / real (Suc (Suc n * 2)) * x ^ Suc (Suc n * 2) \<ge> 1 / real (Suc (n * 2)) * x ^ Suc (n * 2)" using `0 \<le> -x` by auto
  2787       thus ?thesis unfolding Suc_plus1[symmetric] by (rule mono_SucI1[OF allI])
  2787       thus ?thesis unfolding Suc_eq_plus1[symmetric] by (rule mono_SucI1[OF allI])
  2788     qed
  2788     qed
  2789   qed
  2789   qed
  2790 qed
  2790 qed
  2791 
  2791 
  2792 lemma zeroseq_arctan_series: fixes x :: real
  2792 lemma zeroseq_arctan_series: fixes x :: real
  2798   show "?a ----> 0"
  2798   show "?a ----> 0"
  2799   proof (cases "\<bar>x\<bar> < 1")
  2799   proof (cases "\<bar>x\<bar> < 1")
  2800     case True hence "norm x < 1" by auto
  2800     case True hence "norm x < 1" by auto
  2801     from LIMSEQ_mult[OF LIMSEQ_inverse_real_of_nat LIMSEQ_power_zero[OF `norm x < 1`, THEN LIMSEQ_Suc]]
  2801     from LIMSEQ_mult[OF LIMSEQ_inverse_real_of_nat LIMSEQ_power_zero[OF `norm x < 1`, THEN LIMSEQ_Suc]]
  2802     have "(\<lambda>n. 1 / real (n + 1) * x ^ (n + 1)) ----> 0"
  2802     have "(\<lambda>n. 1 / real (n + 1) * x ^ (n + 1)) ----> 0"
  2803       unfolding inverse_eq_divide Suc_plus1 by simp
  2803       unfolding inverse_eq_divide Suc_eq_plus1 by simp
  2804     then show ?thesis using pos2 by (rule LIMSEQ_linear)
  2804     then show ?thesis using pos2 by (rule LIMSEQ_linear)
  2805   next
  2805   next
  2806     case False hence "x = -1 \<or> x = 1" using `\<bar>x\<bar> \<le> 1` by auto
  2806     case False hence "x = -1 \<or> x = 1" using `\<bar>x\<bar> \<le> 1` by auto
  2807     hence n_eq: "\<And> n. x ^ (n * 2 + 1) = x" unfolding One_nat_def by auto
  2807     hence n_eq: "\<And> n. x ^ (n * 2 + 1) = x" unfolding One_nat_def by auto
  2808     from LIMSEQ_mult[OF LIMSEQ_inverse_real_of_nat[THEN LIMSEQ_linear, OF pos2, unfolded inverse_eq_divide] LIMSEQ_const[of x]]
  2808     from LIMSEQ_mult[OF LIMSEQ_inverse_real_of_nat[THEN LIMSEQ_linear, OF pos2, unfolded inverse_eq_divide] LIMSEQ_const[of x]]
  2809     show ?thesis unfolding n_eq Suc_plus1 by auto
  2809     show ?thesis unfolding n_eq Suc_eq_plus1 by auto
  2810   qed
  2810   qed
  2811 qed
  2811 qed
  2812 
  2812 
  2813 lemma summable_arctan_series: fixes x :: real and n :: nat
  2813 lemma summable_arctan_series: fixes x :: real and n :: nat
  2814   assumes "\<bar>x\<bar> \<le> 1" shows "summable (\<lambda> k. (-1)^k * (1 / real (k*2+1) * x ^ (k*2+1)))" (is "summable (?c x)")
  2814   assumes "\<bar>x\<bar> \<le> 1" shows "summable (\<lambda> k. (-1)^k * (1 / real (k*2+1) * x ^ (k*2+1)))" (is "summable (?c x)")
  2919 	show "\<forall> y. a \<le> y \<and> y \<le> b \<longrightarrow> isCont (\<lambda> x. suminf (?c x) - arctan x) y" using DERIV_in_rball DERIV_isCont by auto
  2919 	show "\<forall> y. a \<le> y \<and> y \<le> b \<longrightarrow> isCont (\<lambda> x. suminf (?c x) - arctan x) y" using DERIV_in_rball DERIV_isCont by auto
  2920       qed
  2920       qed
  2921     qed
  2921     qed
  2922     
  2922     
  2923     have suminf_arctan_zero: "suminf (?c 0) - arctan 0 = 0"
  2923     have suminf_arctan_zero: "suminf (?c 0) - arctan 0 = 0"
  2924       unfolding Suc_plus1[symmetric] power_Suc2 mult_zero_right arctan_zero_zero suminf_zero by auto
  2924       unfolding Suc_eq_plus1[symmetric] power_Suc2 mult_zero_right arctan_zero_zero suminf_zero by auto
  2925     
  2925     
  2926     have "suminf (?c x) - arctan x = 0"
  2926     have "suminf (?c x) - arctan x = 0"
  2927     proof (cases "x = 0")
  2927     proof (cases "x = 0")
  2928       case True thus ?thesis using suminf_arctan_zero by auto
  2928       case True thus ?thesis using suminf_arctan_zero by auto
  2929     next
  2929     next