158 thus ?thesis unfolding sums_def by (rule LIMSEQ_imp_Suc) |
158 thus ?thesis unfolding sums_def by (rule LIMSEQ_imp_Suc) |
159 qed |
159 qed |
160 |
160 |
161 lemma series_zero: |
161 lemma series_zero: |
162 "(\<forall>m. n \<le> m --> f(m) = 0) ==> f sums (setsum f {0..<n})" |
162 "(\<forall>m. n \<le> m --> f(m) = 0) ==> f sums (setsum f {0..<n})" |
163 apply (simp add: sums_def LIMSEQ_def diff_minus[symmetric], safe) |
163 apply (simp add: sums_def LIMSEQ_iff diff_minus[symmetric], safe) |
164 apply (rule_tac x = n in exI) |
164 apply (rule_tac x = n in exI) |
165 apply (clarsimp simp add:setsum_diff[symmetric] cong:setsum_ivl_cong) |
165 apply (clarsimp simp add:setsum_diff[symmetric] cong:setsum_ivl_cong) |
166 done |
166 done |
167 |
167 |
168 lemma sums_zero: "(\<lambda>n. 0) sums 0" |
168 lemma sums_zero: "(\<lambda>n. 0) sums 0" |
262 |
262 |
263 lemma sums_group: |
263 lemma sums_group: |
264 "[|summable f; 0 < k |] ==> (%n. setsum f {n*k..<n*k+k}) sums (suminf f)" |
264 "[|summable f; 0 < k |] ==> (%n. setsum f {n*k..<n*k+k}) sums (suminf f)" |
265 apply (drule summable_sums) |
265 apply (drule summable_sums) |
266 apply (simp only: sums_def sumr_group) |
266 apply (simp only: sums_def sumr_group) |
267 apply (unfold LIMSEQ_def, safe) |
267 apply (unfold LIMSEQ_iff, safe) |
268 apply (drule_tac x="r" in spec, safe) |
268 apply (drule_tac x="r" in spec, safe) |
269 apply (rule_tac x="no" in exI, safe) |
269 apply (rule_tac x="no" in exI, safe) |
270 apply (drule_tac x="n*k" in spec) |
270 apply (drule_tac x="n*k" in spec) |
271 apply (erule mp) |
271 apply (erule mp) |
272 apply (erule order_trans) |
272 apply (erule order_trans) |
359 by (simp add: summable_def sums_def convergent_def) |
359 by (simp add: summable_def sums_def convergent_def) |
360 |
360 |
361 lemma summable_LIMSEQ_zero: "summable f \<Longrightarrow> f ----> 0" |
361 lemma summable_LIMSEQ_zero: "summable f \<Longrightarrow> f ----> 0" |
362 apply (drule summable_convergent_sumr_iff [THEN iffD1]) |
362 apply (drule summable_convergent_sumr_iff [THEN iffD1]) |
363 apply (drule convergent_Cauchy) |
363 apply (drule convergent_Cauchy) |
364 apply (simp only: Cauchy_def LIMSEQ_def, safe) |
364 apply (simp only: Cauchy_iff LIMSEQ_iff, safe) |
365 apply (drule_tac x="r" in spec, safe) |
365 apply (drule_tac x="r" in spec, safe) |
366 apply (rule_tac x="M" in exI, safe) |
366 apply (rule_tac x="M" in exI, safe) |
367 apply (drule_tac x="Suc n" in spec, simp) |
367 apply (drule_tac x="Suc n" in spec, simp) |
368 apply (drule_tac x="n" in spec, simp) |
368 apply (drule_tac x="n" in spec, simp) |
369 done |
369 done |
370 |
370 |
371 lemma summable_Cauchy: |
371 lemma summable_Cauchy: |
372 "summable (f::nat \<Rightarrow> 'a::banach) = |
372 "summable (f::nat \<Rightarrow> 'a::banach) = |
373 (\<forall>e > 0. \<exists>N. \<forall>m \<ge> N. \<forall>n. norm (setsum f {m..<n}) < e)" |
373 (\<forall>e > 0. \<exists>N. \<forall>m \<ge> N. \<forall>n. norm (setsum f {m..<n}) < e)" |
374 apply (simp only: summable_convergent_sumr_iff Cauchy_convergent_iff [symmetric] Cauchy_def, safe) |
374 apply (simp only: summable_convergent_sumr_iff Cauchy_convergent_iff [symmetric] Cauchy_iff, safe) |
375 apply (drule spec, drule (1) mp) |
375 apply (drule spec, drule (1) mp) |
376 apply (erule exE, rule_tac x="M" in exI, clarify) |
376 apply (erule exE, rule_tac x="M" in exI, clarify) |
377 apply (rule_tac x="m" and y="n" in linorder_le_cases) |
377 apply (rule_tac x="m" and y="n" in linorder_le_cases) |
378 apply (frule (1) order_trans) |
378 apply (frule (1) order_trans) |
379 apply (drule_tac x="n" in spec, drule (1) mp) |
379 apply (drule_tac x="n" in spec, drule (1) mp) |