diff -r 4c3bc0d2568f -r 7448423e5dba src/HOL/Analysis/Infinite_Sum.thy --- a/src/HOL/Analysis/Infinite_Sum.thy Mon May 23 17:21:57 2022 +0100 +++ b/src/HOL/Analysis/Infinite_Sum.thy Tue May 24 16:21:49 2022 +0100 @@ -696,11 +696,45 @@ shows \infsum f (A \ B) = infsum f A + infsum f B\ by (intro infsumI has_sum_Un_disjoint has_sum_infsum assms) -(* TODO move *) -lemma (in uniform_space) cauchy_filter_complete_converges: - assumes "cauchy_filter F" "complete A" "F \ principal A" "F \ bot" - shows "\c. F \ nhds c" - using assms unfolding complete_uniform by blast +lemma norm_summable_imp_has_sum: + fixes f :: "nat \ 'a :: banach" + assumes "summable (\n. norm (f n))" and "f sums S" + shows "has_sum f (UNIV :: nat set) S" + unfolding has_sum_def tendsto_iff eventually_finite_subsets_at_top +proof (safe, goal_cases) + case (1 \) + from assms(1) obtain S' where S': "(\n. norm (f n)) sums S'" + by (auto simp: summable_def) + with 1 obtain N where N: "\n. n \ N \ \S' - (\i < \" + by (auto simp: tendsto_iff eventually_at_top_linorder sums_def dist_norm abs_minus_commute) + + show ?case + proof (rule exI[of _ "{..n. if n \ Y then 0 else f n) sums (S - sum f Y)" + by (intro sums_If_finite_set'[OF \f sums S\]) (auto simp: sum_negf) + hence "S - sum f Y = (\n. if n \ Y then 0 else f n)" + by (simp add: sums_iff) + also have "norm \ \ (\n. norm (if n \ Y then 0 else f n))" + by (rule summable_norm[OF summable_comparison_test'[OF assms(1)]]) auto + also have "\ \ (\n. if n < N then 0 else norm (f n))" + using 2 by (intro suminf_le summable_comparison_test'[OF assms(1)]) auto + also have "(\n. if n \ {..in. if n < N then 0 else norm (f n)) = S' - (\ii \S' - (\i" by simp + also have "\ < \" by (rule N) auto + finally show ?case by (simp add: dist_norm norm_minus_commute) + qed auto +qed + +lemma norm_summable_imp_summable_on: + fixes f :: "nat \ 'a :: banach" + assumes "summable (\n. norm (f n))" + shows "f summable_on UNIV" + using norm_summable_imp_has_sum[OF assms, of "suminf f"] assms + by (auto simp: sums_iff summable_on_def dest: summable_norm_cancel) text \The following lemma indeed needs a complete space (as formalized by the premise \<^term>\complete UNIV\). The following two counterexamples show this: