src/HOL/Series.thy
changeset 44710 9caf6883f1f4
parent 44568 e6f291cb5810
child 44726 8478eab380e9
equal deleted inserted replaced
44709:79f10d9e63c1 44710:9caf6883f1f4
   120 lemma sums_split_initial_segment:
   120 lemma sums_split_initial_segment:
   121   fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
   121   fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
   122   shows "f sums s ==> (\<lambda>n. f(n + k)) sums (s - (SUM i = 0..< k. f i))"
   122   shows "f sums s ==> (\<lambda>n. f(n + k)) sums (s - (SUM i = 0..< k. f i))"
   123   apply (unfold sums_def)
   123   apply (unfold sums_def)
   124   apply (simp add: sumr_offset)
   124   apply (simp add: sumr_offset)
   125   apply (rule LIMSEQ_diff_const)
   125   apply (rule tendsto_diff [OF _ tendsto_const])
   126   apply (rule LIMSEQ_ignore_initial_segment)
   126   apply (rule LIMSEQ_ignore_initial_segment)
   127   apply assumption
   127   apply assumption
   128 done
   128 done
   129 
   129 
   130 lemma summable_ignore_initial_segment:
   130 lemma summable_ignore_initial_segment:
   164   fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
   164   fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
   165   assumes sumSuc: "(\<lambda> n. f (Suc n)) sums l" shows "f sums (l + f 0)"
   165   assumes sumSuc: "(\<lambda> n. f (Suc n)) sums l" shows "f sums (l + f 0)"
   166 proof -
   166 proof -
   167   from sumSuc[unfolded sums_def]
   167   from sumSuc[unfolded sums_def]
   168   have "(\<lambda>i. \<Sum>n = Suc 0..<Suc i. f n) ----> l" unfolding setsum_reindex[OF inj_Suc] image_Suc_atLeastLessThan[symmetric] comp_def .
   168   have "(\<lambda>i. \<Sum>n = Suc 0..<Suc i. f n) ----> l" unfolding setsum_reindex[OF inj_Suc] image_Suc_atLeastLessThan[symmetric] comp_def .
   169   from LIMSEQ_add_const[OF this, where b="f 0"]
   169   from tendsto_add[OF this tendsto_const, where b="f 0"]
   170   have "(\<lambda>i. \<Sum>n = 0..<Suc i. f n) ----> l + f 0" unfolding add_commute setsum_head_upt_Suc[OF zero_less_Suc] .
   170   have "(\<lambda>i. \<Sum>n = 0..<Suc i. f n) ----> l + f 0" unfolding add_commute setsum_head_upt_Suc[OF zero_less_Suc] .
   171   thus ?thesis unfolding sums_def by (rule LIMSEQ_imp_Suc)
   171   thus ?thesis unfolding sums_def by (rule LIMSEQ_imp_Suc)
   172 qed
   172 qed
   173 
   173 
   174 lemma series_zero:
   174 lemma series_zero:
   623  apply clarify
   623  apply clarify
   624  apply(erule_tac x = "n - Suc 0" in allE)
   624  apply(erule_tac x = "n - Suc 0" in allE)
   625  apply (simp add:diff_Suc split:nat.splits)
   625  apply (simp add:diff_Suc split:nat.splits)
   626  apply (blast intro: norm_ratiotest_lemma)
   626  apply (blast intro: norm_ratiotest_lemma)
   627 apply (rule_tac x = "Suc N" in exI, clarify)
   627 apply (rule_tac x = "Suc N" in exI, clarify)
   628 apply(simp cong:setsum_ivl_cong)
   628 apply(simp cong del: setsum_cong cong: setsum_ivl_cong)
   629 done
   629 done
   630 
   630 
   631 lemma ratio_test:
   631 lemma ratio_test:
   632   fixes f :: "nat \<Rightarrow> 'a::banach"
   632   fixes f :: "nat \<Rightarrow> 'a::banach"
   633   shows "\<lbrakk>c < 1; \<forall>n\<ge>N. norm (f (Suc n)) \<le> c * norm (f n)\<rbrakk> \<Longrightarrow> summable f"
   633   shows "\<lbrakk>c < 1; \<forall>n\<ge>N. norm (f (Suc n)) \<le> c * norm (f n)\<rbrakk> \<Longrightarrow> summable f"