diff -r 830597d13d6d -r 711cef61c0ce src/HOL/Analysis/Infinite_Sum.thy --- a/src/HOL/Analysis/Infinite_Sum.thy Wed Jan 04 19:06:16 2023 +0000 +++ b/src/HOL/Analysis/Infinite_Sum.thy Mon Jan 09 17:16:04 2023 +0000 @@ -135,11 +135,9 @@ have \P (sum g F)\ if \finite F\ \F \ T\ \F \ F0'\ for F proof - have \P (sum f ((F\S) \ (F0\S)))\ - apply (rule F0_P) - using \F0 \ S\ \finite F0\ that by auto + by (intro F0_P) (use \F0 \ S\ \finite F0\ that in auto) also have \sum f ((F\S) \ (F0\S)) = sum g F\ - apply (rule sum.mono_neutral_cong) - using that \finite F0\ F0'_def assms by auto + by (intro sum.mono_neutral_cong) (use that \finite F0\ F0'_def assms in auto) finally show ?thesis . qed with \F0' \ T\ \finite F0'\ show \eventually P (filtermap (sum g) (finite_subsets_at_top T))\ @@ -154,11 +152,9 @@ have \P (sum f F)\ if \finite F\ \F \ S\ \F \ F0'\ for F proof - have \P (sum g ((F\T) \ (F0\T)))\ - apply (rule F0_P) - using \F0 \ T\ \finite F0\ that by auto + by (intro F0_P) (use \F0 \ T\ \finite F0\ that in auto) also have \sum g ((F\T) \ (F0\T)) = sum f F\ - apply (rule sum.mono_neutral_cong) - using that \finite F0\ F0'_def assms by auto + by (intro sum.mono_neutral_cong) (use that \finite F0\ F0'_def assms in auto) finally show ?thesis . qed with \F0' \ S\ \finite F0'\ show \eventually P (filtermap (sum f) (finite_subsets_at_top S))\ @@ -187,8 +183,7 @@ assumes \\x. x\S-T \ f x = 0\ assumes \\x. x\S\T \ f x = g x\ shows \infsum f S = infsum g T\ - apply (rule infsum_eqI') - using assms by (rule has_sum_cong_neutral) + by (smt (verit, best) assms has_sum_cong_neutral infsum_eqI') lemma has_sum_cong: assumes "\x. x\A \ f x = g x" @@ -289,7 +284,7 @@ from assms(2) have limA: "(sum f \ a) (finite_subsets_at_top A)" using has_sum_def by blast have "((\F. sum f (F\A)) \ a) (finite_subsets_at_top B)" - proof (subst asm_rl [of "(\F. sum f (F\A)) = sum f o (\F. F\A)"]) + proof (subst asm_rl [of "(\F. sum f (F\A)) = sum f \ (\F. F\A)"]) show "(\F. sum f (F \ A)) = sum f \ (\F. F \ A)" unfolding o_def by auto show "((sum f \ (\F. F \ A)) \ a) (finite_subsets_at_top B)" @@ -309,11 +304,8 @@ \((\F. sum f F - sum f (F \ A)) \ b - a) (finite_subsets_at_top B)\ by fastforce hence "(sum f \ b - a) (filtermap (\F. F-A) (finite_subsets_at_top B))" by (subst tendsto_compose_filtermap[symmetric], simp add: o_def) - hence limBA: "(sum f \ b - a) (finite_subsets_at_top (B-A))" - apply (rule tendsto_mono[rotated]) - by (rule finite_subsets1) thus ?thesis - by (simp add: has_sum_def) + using finite_subsets1 has_sum_def tendsto_mono by blast qed @@ -342,23 +334,20 @@ have [simp]: \f summable_on A\ \g summable_on B\ using assms(1,2) summable_on_def by auto have \has_sum f' (A\B) a\ - apply (subst has_sum_cong_neutral[where g=f and T=A]) - by (auto simp: f'_def assms(1)) + by (smt (verit, best) DiffE IntE Un_iff f'_def assms(1) has_sum_cong_neutral) then have f'_lim: \(sum f' \ a) (finite_subsets_at_top (A\B))\ by (meson has_sum_def) have \has_sum g' (A\B) b\ - apply (subst has_sum_cong_neutral[where g=g and T=B]) - by (auto simp: g'_def assms(2)) + by (smt (verit, best) DiffD1 DiffD2 IntE UnCI g'_def assms(2) has_sum_cong_neutral) then have g'_lim: \(sum g' \ b) (finite_subsets_at_top (A\B))\ using has_sum_def by blast - have *: \\\<^sub>F x in finite_subsets_at_top (A \ B). sum f' x \ sum g' x\ - apply (rule eventually_finite_subsets_at_top_weakI) - apply (rule sum_mono) + have "\X i. \X \ A \ B; i \ X\ \ f' i \ g' i" using assms by (auto simp: f'_def g'_def) - show ?thesis - apply (rule tendsto_le) - using * g'_lim f'_lim by auto + then have \\\<^sub>F x in finite_subsets_at_top (A \ B). sum f' x \ sum g' x\ + by (intro eventually_finite_subsets_at_top_weakI sum_mono) + then show ?thesis + using f'_lim finite_subsets_at_top_neq_bot g'_lim tendsto_le by blast qed lemma infsum_mono_neutral: @@ -375,16 +364,14 @@ assumes "has_sum f A x" and "has_sum g A y" assumes \\x. x \ A \ f x \ g x\ shows "x \ y" - apply (rule has_sum_mono_neutral) - using assms by auto + using assms has_sum_mono_neutral by force lemma infsum_mono: fixes f :: "'a\'b::{ordered_comm_monoid_add,linorder_topology}" assumes "f summable_on A" and "g summable_on A" assumes \\x. x \ A \ f x \ g x\ shows "infsum f A \ infsum g A" - apply (rule infsum_mono_neutral) - using assms by auto + by (meson assms has_sum_infsum has_sum_mono) lemma has_sum_finite[simp]: assumes "finite F" @@ -483,11 +470,10 @@ qed then have \cauchy_filter (filtermap (sum f) (finite_subsets_at_top A))\ by (simp add: cauchy_filter_metric_filtermap) - then obtain L' where \(sum f \ L') (finite_subsets_at_top A)\ - apply atomize_elim unfolding filterlim_def - apply (rule complete_uniform[where S=UNIV, simplified, THEN iffD1, rule_format]) - apply (auto simp add: filtermap_bot_iff) + moreover have "complete (UNIV::'b set)" by (meson Cauchy_convergent UNIV_I complete_def convergent_def) + ultimately obtain L' where \(sum f \ L') (finite_subsets_at_top A)\ + using complete_uniform[where S=UNIV] by (force simp add: filterlim_def) then show ?thesis using summable_on_def has_sum_def by blast qed @@ -522,9 +508,10 @@ also have "\ \ sum (\x. norm (f x)) F + \" using norm_sum by auto also have "\ \ n + \" - apply (rule add_right_mono) - apply (rule has_sum_mono_neutral[where A=F and B=A and f=\\x. norm (f x)\ and g=\\x. norm (f x)\]) - using \finite F\ \F \ A\ assms by auto + proof (intro add_right_mono [OF has_sum_mono_neutral]) + show "has_sum (\x. norm (f x)) F (\x\F. norm (f x))" + by (simp add: \finite F\) + qed (use \F \ A\ assms in auto) finally show ?thesis by assumption qed @@ -539,10 +526,10 @@ shows "norm (infsum f A) \ infsum (\x. norm (f x)) A" proof (cases "f summable_on A") case True - show ?thesis - apply (rule norm_has_sum_bound[where A=A and f=f and a=\infsum f A\ and n=\infsum (\x. norm (f x)) A\]) - using assms True - by (metis finite_subsets_at_top_neq_bot infsum_def summable_on_def has_sum_def tendsto_Lim)+ + have "has_sum (\x. norm (f x)) A (\\<^sub>\x\A. norm (f x))" + by (simp add: assms) + then show ?thesis + by (metis True has_sum_infsum norm_has_sum_bound) next case False obtain t where t_def: "(sum (\x. norm (f x)) \ t) (finite_subsets_at_top A)" @@ -595,14 +582,10 @@ shows \((\F. sum f F) \ infsum f S) (finite_subsets_at_top S)\ using assms by (simp flip: has_sum_def) - lemma has_sum_0: assumes \\x. x\M \ f x = 0\ shows \has_sum f M 0\ - unfolding has_sum_def - apply (subst tendsto_cong[where g=\\_. 0\]) - apply (rule eventually_finite_subsets_at_top_weakI) - using assms by (auto simp add: subset_iff) + by (metis assms finite.intros(1) has_sum_cong has_sum_cong_neutral has_sum_finite sum.neutral_const) lemma summable_on_0: assumes \\x. x\M \ f x = 0\ @@ -668,11 +651,9 @@ define fA fB where \fA x = (if x \ A then f x else 0)\ and \fB x = (if x \ A then f x else 0)\ for x have fA: \has_sum fA (A \ B) a\ - apply (subst has_sum_cong_neutral[where T=A and g=f]) - using assms by (auto simp: fA_def) + by (smt (verit, ccfv_SIG) DiffD1 DiffD2 UnCI fA_def assms(1) has_sum_cong_neutral inf_sup_absorb) have fB: \has_sum fB (A \ B) b\ - apply (subst has_sum_cong_neutral[where T=B and g=f]) - using assms by (auto simp: fB_def) + by (smt (verit, best) DiffD1 DiffD2 IntE Un_iff fB_def assms(2) disj disjoint_iff has_sum_cong_neutral) have fAB: \f x = fA x + fB x\ for x unfolding fA_def fB_def by simp show ?thesis @@ -857,8 +838,8 @@ assumes conv: \\a. a \ A \ has_sum f (B a) (s a)\ assumes disj: \\a a'. a\A \ a'\A \ a\a' \ B a \ B a' = {}\ shows \has_sum f (\a\A. B a) (sum s A)\ - using assms -proof (insert finite conv disj, induction) + using assms finite conv +proof (induction) case empty then show ?case by simp @@ -869,8 +850,7 @@ moreover have IH: \has_sum f (\a\A. B a) (sum s A)\ using insert by simp ultimately have \has_sum f (B x \ (\a\A. B a)) (s x + sum s A)\ - apply (rule has_sum_Un_disjoint) - using insert by auto + using insert by (intro has_sum_Un_disjoint) auto then show ?case using insert.hyps by auto qed @@ -882,7 +862,7 @@ assumes conv: \\a. a \ A \ f summable_on (B a)\ assumes disj: \\a a'. a\A \ a'\A \ a\a' \ B a \ B a' = {}\ shows \f summable_on (\a\A. B a)\ - using finite conv disj apply induction by (auto intro!: summable_on_Un_disjoint) + using finite conv disj by induction (auto intro!: summable_on_Un_disjoint) lemma sum_infsum: fixes f :: "'a \ 'b::{topological_comm_monoid_add, t2_space}" @@ -903,42 +883,41 @@ lemma has_sum_comm_additive_general: fixes f :: \'b :: {comm_monoid_add,topological_space} \ 'c :: {comm_monoid_add,topological_space}\ - assumes f_sum: \\F. finite F \ F \ S \ sum (f o g) F = f (sum g F)\ + assumes f_sum: \\F. finite F \ F \ S \ sum (f \ g) F = f (sum g F)\ \ \Not using \<^const>\additive\ because it would add sort constraint \<^class>\ab_group_add\\ assumes cont: \f \x\ f x\ \ \For \<^class>\t2_space\, this is equivalent to \isCont f x\ by @{thm [source] isCont_def}.\ assumes infsum: \has_sum g S x\ - shows \has_sum (f o g) S (f x)\ + shows \has_sum (f \ g) S (f x)\ proof - have \(sum g \ x) (finite_subsets_at_top S)\ using infsum has_sum_def by blast - then have \((f o sum g) \ f x) (finite_subsets_at_top S)\ - apply (rule tendsto_compose_at) - using assms by auto - then have \(sum (f o g) \ f x) (finite_subsets_at_top S)\ - apply (rule tendsto_cong[THEN iffD1, rotated]) - using f_sum by fastforce - then show \has_sum (f o g) S (f x)\ + then have \((f \ sum g) \ f x) (finite_subsets_at_top S)\ + by (meson cont filterlim_def tendsto_at_iff_tendsto_nhds tendsto_compose_filtermap tendsto_mono) + then have \(sum (f \ g) \ f x) (finite_subsets_at_top S)\ + using tendsto_cong f_sum + by (simp add: Lim_transform_eventually eventually_finite_subsets_at_top_weakI) + then show \has_sum (f \ g) S (f x)\ using has_sum_def by blast qed lemma summable_on_comm_additive_general: fixes f :: \'b :: {comm_monoid_add,topological_space} \ 'c :: {comm_monoid_add,topological_space}\ - assumes \\F. finite F \ F \ S \ sum (f o g) F = f (sum g F)\ + assumes \\F. finite F \ F \ S \ sum (f \ g) F = f (sum g F)\ \ \Not using \<^const>\additive\ because it would add sort constraint \<^class>\ab_group_add\\ assumes \\x. has_sum g S x \ f \x\ f x\ \ \For \<^class>\t2_space\, this is equivalent to \isCont f x\ by @{thm [source] isCont_def}.\ assumes \g summable_on S\ - shows \(f o g) summable_on S\ + shows \(f \ g) summable_on S\ by (meson assms summable_on_def has_sum_comm_additive_general has_sum_def infsum_tendsto) lemma infsum_comm_additive_general: fixes f :: \'b :: {comm_monoid_add,t2_space} \ 'c :: {comm_monoid_add,t2_space}\ - assumes f_sum: \\F. finite F \ F \ S \ sum (f o g) F = f (sum g F)\ + assumes f_sum: \\F. finite F \ F \ S \ sum (f \ g) F = f (sum g F)\ \ \Not using \<^const>\additive\ because it would add sort constraint \<^class>\ab_group_add\\ assumes \isCont f (infsum g S)\ assumes \g summable_on S\ - shows \infsum (f o g) S = f (infsum g S)\ + shows \infsum (f \ g) S = f (infsum g S)\ using assms by (intro infsumI has_sum_comm_additive_general has_sum_infsum) (auto simp: isCont_def) @@ -948,7 +927,7 @@ assumes \f \x\ f x\ \ \For \<^class>\t2_space\, this is equivalent to \isCont f x\ by @{thm [source] isCont_def}.\ assumes infsum: \has_sum g S x\ - shows \has_sum (f o g) S (f x)\ + shows \has_sum (f \ g) S (f x)\ using assms by (intro has_sum_comm_additive_general has_sum_infsum) (auto simp: isCont_def additive.sum) @@ -957,7 +936,7 @@ assumes \additive f\ assumes \isCont f (infsum g S)\ assumes \g summable_on S\ - shows \(f o g) summable_on S\ + shows \(f \ g) summable_on S\ by (meson assms(1) assms(2) assms(3) summable_on_def has_sum_comm_additive has_sum_infsum isContD) lemma infsum_comm_additive: @@ -965,7 +944,7 @@ assumes \additive f\ assumes \isCont f (infsum g S)\ assumes \g summable_on S\ - shows \infsum (f o g) S = f (infsum g S)\ + shows \infsum (f \ g) S = f (infsum g S)\ by (rule infsum_comm_additive_general; auto simp: assms additive.sum) lemma nonneg_bdd_above_has_sum: @@ -1049,9 +1028,7 @@ fixes f :: "'a \ 'b::{ordered_comm_monoid_add,linorder_topology}" assumes "\x. x \ M \ 0 \ f x" shows "infsum f M \ 0" (is "?lhs \ _") - apply (cases \f summable_on M\) - apply (metis assms infsum_0_simp summable_on_0_simp infsum_mono) - using assms by (auto simp add: infsum_not_exists) + by (metis assms has_sum_infsum has_sum_nonneg infsum_not_exists linorder_linear) lemma has_sum_mono2: fixes f :: "'a \ 'b::{topological_ab_group_add, ordered_comm_monoid_add,linorder_topology}" @@ -1100,13 +1077,12 @@ have \has_sum g (h ` A) x \ (sum g \ x) (finite_subsets_at_top (h ` A))\ by (simp add: has_sum_def) also have \\ \ ((\F. sum g (h ` F)) \ x) (finite_subsets_at_top A)\ - apply (subst filtermap_image_finite_subsets_at_top[symmetric]) - using assms by (auto simp: filterlim_def filtermap_filtermap) + by (metis assms filterlim_filtermap filtermap_image_finite_subsets_at_top) also have \\ \ (sum (g \ h) \ x) (finite_subsets_at_top A)\ - apply (rule tendsto_cong) - apply (rule eventually_finite_subsets_at_top_weakI) - apply (rule sum.reindex) - using assms subset_inj_on by blast + proof (intro tendsto_cong eventually_finite_subsets_at_top_weakI sum.reindex) + show "\X. \finite X; X \ A\ \ inj_on h X" + using assms subset_inj_on by blast + qed also have \\ \ has_sum (g \ h) A x\ by (simp add: has_sum_def) finally show ?thesis . @@ -1127,10 +1103,10 @@ assumes "bij_betw g A B" shows "(\x. f (g x)) summable_on A \ f summable_on B" proof - - thm summable_on_reindex - have \(\x. f (g x)) summable_on A \ f summable_on g ` A\ - apply (rule summable_on_reindex[symmetric, unfolded o_def]) + have "inj_on g A" using assms bij_betw_imp_inj_on by blast + then have \(\x. f (g x)) summable_on A \ f summable_on g ` A\ + by (metis (mono_tags, lifting) comp_apply summable_on_cong summable_on_reindex) also have \\ \ f summable_on B\ using assms bij_betw_imp_surj_on by blast finally show ?thesis . @@ -1228,8 +1204,7 @@ using F_def has_sum_def by blast have finite_proj: \finite {b| b. (a,b) \ H}\ if \finite H\ for H :: \('a\'b) set\ and a - apply (subst asm_rl[of \{b| b. (a,b) \ H} = snd ` {ab. ab \ H \ fst ab = a}\]) - by (auto simp: image_iff that) + by (metis (no_types, lifting) finite_imageI finite_subset image_eqI mem_Collect_eq snd_conv subsetI that) have \(sum b \ a) FA\ proof (rule tendsto_iff_uniformity[THEN iffD2, rule_format]) @@ -1255,9 +1230,8 @@ proof - obtain D' where D'_uni: \eventually D' uniformity\ and \card M' \ card M \ (\m\M'. D' (g m, g' m)) \ D (sum g M', sum g' M')\ - for M' :: \'a set\ and g g' - apply (rule sum_uniformity[OF plus_cont \eventually D uniformity\, where n=\card M\]) - by auto + for M' :: \'a set\ and g g' + using sum_uniformity[OF plus_cont \eventually D uniformity\] by blast then have D'_sum_D: \(\m\M. D' (g m, g' m)) \ D (sum g M, sum g' M)\ for g g' by auto @@ -1282,11 +1256,9 @@ have \Sigma M Ha' = H\ using that by (auto simp: Ha'_def) then have *: \(\(a,b)\H. f (a,b)) = (\a\M. \b\Ha' a. f (a,b))\ - apply (subst sum.Sigma) - using \finite M\ by auto + by (simp add: \finite M\ sum.Sigma) have \D' (b a, sum (\b. f (a,b)) (Ha' a))\ if \a \ M\ for a - apply (rule D'_sum_Ha) - using that \M \ A\ by auto + using D'_sum_Ha \M \ A\ that by auto then have \D (\a\M. b a, \a\M. sum (\b. f (a,b)) (Ha' a))\ by (rule_tac D'_sum_D, auto) with * show ?thesis @@ -1372,23 +1344,20 @@ shows infsum_Sigma'_banach: \infsum (\x. infsum (f x) (B x)) A = infsum (\(x,y). f x y) (Sigma A B)\ (is ?thesis1) and summable_on_Sigma_banach: \(\x. infsum (f x) (B x)) summable_on A\ (is ?thesis2) proof - - have [simp]: \(f x) summable_on (B x)\ if \x \ A\ for x + have fsum: \(f x) summable_on (B x)\ if \x \ A\ for x proof - from assms have \(\(x,y). f x y) summable_on (Pair x ` B x)\ by (meson image_subset_iff summable_on_subset_banach mem_Sigma_iff that) - then have \((\(x,y). f x y) o Pair x) summable_on (B x)\ - apply (rule_tac summable_on_reindex[THEN iffD1]) - by (simp add: inj_on_def) + then have \((\(x,y). f x y) \ Pair x) summable_on (B x)\ + by (metis summable_on_reindex inj_on_def prod.inject) then show ?thesis by (auto simp: o_def) qed show ?thesis1 - apply (rule infsum_Sigma') - by auto + using fsum assms infsum_Sigma' isUCont_plus by blast show ?thesis2 - apply (rule summable_on_Sigma) - by auto + using fsum assms isUCont_plus summable_on_Sigma by blast qed lemma infsum_Sigma_banach: @@ -1408,20 +1377,18 @@ assumes \\b. b\B \ (\a. f a b) summable_on A\ shows \infsum (\x. infsum (\y. f x y) B) A = infsum (\y. infsum (\x. f x y) A) B\ proof - - have [simp]: \(\(x, y). f y x) summable_on (B \ A)\ - apply (subst product_swap[symmetric]) - apply (subst summable_on_reindex) - using assms by (auto simp: o_def) + have "(\(x, y). f y x) \ prod.swap summable_on A \ B" + by (simp add: assms(2) summable_on_cong) + then have fyx: \(\(x, y). f y x) summable_on (B \ A)\ + by (metis has_sum_reindex infsum_reindex inj_swap product_swap summable_iff_has_sum_infsum) have \infsum (\x. infsum (\y. f x y) B) A = infsum (\(x,y). f x y) (A \ B)\ - apply (subst infsum_Sigma) - using assms by auto + using assms infsum_Sigma' by blast also have \\ = infsum (\(x,y). f y x) (B \ A)\ apply (subst product_swap[symmetric]) apply (subst infsum_reindex) using assms by (auto simp: o_def) also have \\ = infsum (\y. infsum (\x. f x y) A) B\ - apply (subst infsum_Sigma) - using assms by auto + by (smt (verit) fyx assms(1) assms(4) infsum_Sigma' infsum_cong) finally show ?thesis . qed @@ -1431,20 +1398,16 @@ assumes \(\(x, y). f x y) summable_on (A \ B)\ shows "infsum (\x. infsum (\y. f x y) B) A = infsum (\y. infsum (\x. f x y) A) B" proof - - have [simp]: \(\(x, y). f y x) summable_on (B \ A)\ - apply (subst product_swap[symmetric]) - apply (subst summable_on_reindex) - using assms by (auto simp: o_def) + have \
: \(\(x, y). f y x) summable_on (B \ A)\ + by (metis (mono_tags, lifting) assms case_swap inj_swap o_apply product_swap summable_on_cong summable_on_reindex) have \infsum (\x. infsum (\y. f x y) B) A = infsum (\(x,y). f x y) (A \ B)\ - apply (subst infsum_Sigma'_banach) - using assms by auto + using assms infsum_Sigma'_banach by blast also have \\ = infsum (\(x,y). f y x) (B \ A)\ apply (subst product_swap[symmetric]) apply (subst infsum_reindex) using assms by (auto simp: o_def) also have \\ = infsum (\y. infsum (\x. f x y) A) B\ - apply (subst infsum_Sigma'_banach) - using assms by auto + by (metis (mono_tags, lifting) \
infsum_Sigma'_banach infsum_cong) finally show ?thesis . qed @@ -1494,9 +1457,7 @@ then have \((\F. sum f F * c) \ a * c) (finite_subsets_at_top A)\ by (simp add: tendsto_mult_right) then have \(sum (\x. f x * c) \ a * c) (finite_subsets_at_top A)\ - apply (rule tendsto_cong[THEN iffD1, rotated]) - apply (rule eventually_finite_subsets_at_top_weakI) - using sum_distrib_right by blast + by (metis (mono_tags) tendsto_cong eventually_finite_subsets_at_top_weakI sum_distrib_right) then show ?thesis using infsumI has_sum_def by blast qed @@ -1532,9 +1493,7 @@ then have \((\F. c * sum f F) \ c * a) (finite_subsets_at_top A)\ by (simp add: tendsto_mult_left) then have \(sum (\x. c * f x) \ c * a) (finite_subsets_at_top A)\ - apply (rule tendsto_cong[THEN iffD1, rotated]) - apply (rule eventually_finite_subsets_at_top_weakI) - using sum_distrib_left by blast + by (metis (mono_tags, lifting) tendsto_cong eventually_finite_subsets_at_top_weakI sum_distrib_left) then show ?thesis using infsumI has_sum_def by blast qed @@ -1543,16 +1502,7 @@ fixes f :: "'a \ 'b :: {t2_space, topological_semigroup_mult, semiring_0}" assumes \c \ 0 \ f summable_on A\ shows \infsum (\x. c * f x) A = c * infsum f A\ -proof (cases \c=0\) - case True - then show ?thesis by auto -next - case False - then have \has_sum f A (infsum f A)\ - by (simp add: assms) - then show ?thesis - by (auto intro!: infsumI has_sum_cmult_right) -qed + using assms has_sum_cmult_right infsumI summable_iff_has_sum_infsum by fastforce lemma summable_on_cmult_right: fixes f :: "'a \ 'b :: {t2_space, topological_semigroup_mult, semiring_0}" @@ -1595,52 +1545,12 @@ lemma infsum_cmult_left': fixes f :: "'a \ 'b :: {t2_space, topological_semigroup_mult, division_ring}" shows "infsum (\x. f x * c) A = infsum f A * c" -proof (cases \c \ 0 \ f summable_on A\) - case True - then show ?thesis - apply (rule_tac infsum_cmult_left) by auto -next - case False - note asm = False - then show ?thesis - proof (cases \c=0\) - case True - then show ?thesis by auto - next - case False - with asm have nex: \\ f summable_on A\ - by simp - moreover have nex': \\ (\x. f x * c) summable_on A\ - using asm False apply (subst summable_on_cmult_left') by auto - ultimately show ?thesis - unfolding infsum_def by simp - qed -qed + by (metis (full_types) infsum_cmult_left infsum_not_exists mult_eq_0_iff summable_on_cmult_left') lemma infsum_cmult_right': fixes f :: "'a \ 'b :: {t2_space,topological_semigroup_mult,division_ring}" shows "infsum (\x. c * f x) A = c * infsum f A" -proof (cases \c \ 0 \ f summable_on A\) - case True - then show ?thesis - apply (rule_tac infsum_cmult_right) by auto -next - case False - note asm = False - then show ?thesis - proof (cases \c=0\) - case True - then show ?thesis by auto - next - case False - with asm have nex: \\ f summable_on A\ - by simp - moreover have nex': \\ (\x. c * f x) summable_on A\ - using asm False apply (subst summable_on_cmult_right') by auto - ultimately show ?thesis - unfolding infsum_def by simp - qed -qed + by (metis (full_types) infsum_cmult_right infsum_not_exists mult_eq_0_iff summable_on_cmult_right') lemma has_sum_constant[simp]: @@ -1651,7 +1561,7 @@ lemma infsum_constant[simp]: assumes \finite F\ shows \infsum (\_. c) F = of_nat (card F) * c\ - apply (subst infsum_finite[OF assms]) by simp + by (simp add: assms) lemma infsum_diverge_constant: \ \This probably does not really need all of \<^class>\archimedean_field\ but Isabelle/HOL @@ -1679,7 +1589,7 @@ apply (rule infsum_mono_neutral) using \finite F\ \F \ A\ by auto finally show ?thesis . - qed + qed then show False by (meson linordered_field_no_ub not_less) qed @@ -1689,11 +1599,7 @@ has no type class such as, e.g., "archimedean ring".\ fixes c :: \'a::{archimedean_field, comm_monoid_add, linorder_topology, topological_semigroup_mult}\ shows \infsum (\_. c) A = of_nat (card A) * c\ - apply (cases \finite A\) - apply simp - apply (cases \c = 0\) - apply simp - by (simp add: infsum_diverge_constant infsum_not_exists) + by (metis infsum_0 infsum_constant infsum_diverge_constant infsum_not_exists sum.infinite sum_constant) lemma has_sum_uminus: fixes f :: \'a \ 'b::topological_ab_group_add\ @@ -1715,18 +1621,7 @@ assumes \has_sum f A a\ assumes \\F. finite F \ F \ A \ sum f F \ b\ shows \a \ b\ -proof - - from assms(1) - have 1: \(sum f \ a) (finite_subsets_at_top A)\ - unfolding has_sum_def . - from assms(2) - have 2: \\\<^sub>F F in finite_subsets_at_top A. sum f F \ b\ - by (rule_tac eventually_finite_subsets_at_top_weakI) - show \a \ b\ - using _ _ 1 2 - apply (rule tendsto_le[where f=\\_. b\]) - by auto -qed + by (metis assms eventually_finite_subsets_at_top_weakI finite_subsets_at_top_neq_bot has_sum_def tendsto_upperbound) lemma infsum_le_finite_sums: fixes b :: \'a::{comm_monoid_add,topological_space,linorder_topology}\ @@ -1740,29 +1635,38 @@ fixes c :: \'a :: real_normed_vector\ assumes "c \ 0 \ f summable_on A" shows "(\x. f x *\<^sub>R c) summable_on A" - apply (cases \c \ 0\) - apply (subst asm_rl[of \(\x. f x *\<^sub>R c) = (\y. y *\<^sub>R c) o f\], simp add: o_def) - apply (rule summable_on_comm_additive) - using assms by (auto simp add: scaleR_left.additive_axioms) +proof (cases \c = 0\) + case False + then have "(\y. y *\<^sub>R c) \ f summable_on A" + using assms by (auto simp add: scaleR_left.additive_axioms summable_on_comm_additive) + then show ?thesis + by (metis (mono_tags, lifting) comp_apply summable_on_cong) +qed auto lemma summable_on_scaleR_right [intro]: fixes f :: \'a \ 'b :: real_normed_vector\ assumes "c \ 0 \ f summable_on A" shows "(\x. c *\<^sub>R f x) summable_on A" - apply (cases \c \ 0\) - apply (subst asm_rl[of \(\x. c *\<^sub>R f x) = (\y. c *\<^sub>R y) o f\], simp add: o_def) - apply (rule summable_on_comm_additive) - using assms by (auto simp add: scaleR_right.additive_axioms) +proof (cases \c = 0\) + case False + then have "(*\<^sub>R) c \ f summable_on A" + using assms by (auto simp add: scaleR_right.additive_axioms summable_on_comm_additive) + then show ?thesis + by (metis (mono_tags, lifting) comp_apply summable_on_cong) +qed auto lemma infsum_scaleR_left: fixes c :: \'a :: real_normed_vector\ assumes "c \ 0 \ f summable_on A" shows "infsum (\x. f x *\<^sub>R c) A = infsum f A *\<^sub>R c" - apply (cases \c \ 0\) - apply (subst asm_rl[of \(\x. f x *\<^sub>R c) = (\y. y *\<^sub>R c) o f\], simp add: o_def) - apply (rule infsum_comm_additive) - using assms by (auto simp add: scaleR_left.additive_axioms) +proof (cases \c = 0\) + case False + then have "infsum ((\y. y *\<^sub>R c) \ f) A = infsum f A *\<^sub>R c" + using assms by (auto simp add: scaleR_left.additive_axioms infsum_comm_additive) + then show ?thesis + by (metis (mono_tags, lifting) comp_apply infsum_cong) +qed auto lemma infsum_scaleR_right: fixes f :: \'a \ 'b :: real_normed_vector\ @@ -1773,10 +1677,10 @@ then show ?thesis proof cases case summable + then have "infsum ((*\<^sub>R) c \ f) A = c *\<^sub>R infsum f A" + by (auto simp add: scaleR_right.additive_axioms infsum_comm_additive) then show ?thesis - apply (subst asm_rl[of \(\x. c *\<^sub>R f x) = (\y. c *\<^sub>R y) o f\], simp add: o_def) - apply (rule infsum_comm_additive) - using summable by (auto simp add: scaleR_right.additive_axioms) + by (metis (mono_tags, lifting) comp_apply infsum_cong) next case c0 then show ?thesis by auto @@ -1787,8 +1691,6 @@ assume \(\x. c *\<^sub>R f x) summable_on A\ then have \(\x. inverse c *\<^sub>R c *\<^sub>R f x) summable_on A\ using summable_on_scaleR_right by blast - then have \f summable_on A\ - using not_summable by auto with not_summable show False by simp qed @@ -1800,22 +1702,18 @@ lemma infsum_Un_Int: fixes f :: "'a \ 'b::{topological_ab_group_add, t2_space}" - assumes [simp]: "f summable_on A - B" "f summable_on B - A" \f summable_on A \ B\ + assumes "f summable_on A - B" "f summable_on B - A" \f summable_on A \ B\ shows "infsum f (A \ B) = infsum f A + infsum f B - infsum f (A \ B)" + proof - - have [simp]: \f summable_on A\ - apply (subst asm_rl[of \A = (A-B) \ (A\B)\]) apply auto[1] - apply (rule summable_on_Un_disjoint) - by auto + have \f summable_on A\ + using assms by (metis Diff_Diff_Int Diff_disjoint Un_Diff_Int summable_on_Un_disjoint) have \infsum f (A \ B) = infsum f A + infsum f (B - A)\ - apply (subst infsum_Un_disjoint[symmetric]) - by auto + by (metis Diff_disjoint Un_Diff_cancel \f summable_on A\ assms(2) infsum_Un_disjoint) moreover have \infsum f (B - A \ A \ B) = infsum f (B - A) + infsum f (A \ B)\ - by (rule infsum_Un_disjoint) auto - moreover have "B - A \ A \ B = B" - by blast + using assms by (metis Int_Diff_disjoint inf_commute infsum_Un_disjoint) ultimately show ?thesis - by auto + by (metis Un_Diff_Int add_diff_cancel_right' add_diff_eq inf_commute) qed lemma inj_combinator': @@ -1866,39 +1764,23 @@ then have \(\p. \\<^sub>\y\B x. f x y * (\x'\F. f x' (p x'))) summable_on Pi\<^sub>E F B\ by (rule summable_on_Sigma_banach) then have \(\p. (\\<^sub>\y\B x. f x y) * (\x'\F. f x' (p x'))) summable_on Pi\<^sub>E F B\ - apply (subst infsum_cmult_left[symmetric]) - using insert.prems(1) by blast + by (metis (mono_tags, lifting) infsum_cmult_left' infsum_cong summable_on_cong) then have summable3: \(\p. (\x'\F. f x' (p x'))) summable_on Pi\<^sub>E F B\ if \(\\<^sub>\y\B x. f x y) \ 0\ - apply (subst (asm) summable_on_cmult_right') - using that by auto + using summable_on_cmult_right' that by blast have \(\\<^sub>\g\Pi\<^sub>E (insert x F) B. \x\insert x F. f x (g x)) = (\\<^sub>\(p,y)\Pi\<^sub>E F B \ B x. \x'\insert x F. f x' ((p(x:=y)) x'))\ - apply (subst pi) - apply (subst infsum_reindex) - using inj by (auto simp: o_def case_prod_unfold) + by (smt (verit, ccfv_SIG) comp_apply infsum_cong infsum_reindex inj pi prod.cong split_def) also have \\ = (\\<^sub>\(p, y)\Pi\<^sub>E F B \ B x. f x y * (\x'\F. f x' ((p(x:=y)) x')))\ - apply (subst prod.insert) - using insert by auto + using insert.hyps by auto also have \\ = (\\<^sub>\(p, y)\Pi\<^sub>E F B \ B x. f x y * (\x'\F. f x' (p x')))\ - apply (subst prod) by rule + using prod by presburger also have \\ = (\\<^sub>\p\Pi\<^sub>E F B. \\<^sub>\y\B x. f x y * (\x'\F. f x' (p x')))\ - apply (subst infsum_Sigma_banach[symmetric]) - using summable2 apply blast - by fastforce + using infsum_Sigma'_banach summable2 by force also have \\ = (\\<^sub>\y\B x. f x y) * (\\<^sub>\p\Pi\<^sub>E F B. \x'\F. f x' (p x'))\ - apply (subst infsum_cmult_left') - apply (subst infsum_cmult_right') - by (rule refl) + by (smt (verit) infsum_cmult_left' infsum_cmult_right' infsum_cong) also have \\ = (\x\insert x F. infsum (f x) (B x))\ - apply (subst prod.insert) - using \finite F\ \x \ F\ apply auto[2] - apply (cases \infsum (f x) (B x) = 0\) - apply simp - apply (subst insert.IH) - apply (simp add: insert.prems(1)) - apply (rule summable3) - by auto + using insert summable3 by auto finally show ?case by simp qed @@ -1914,15 +1796,15 @@ then show ?case by auto next - case (insert x F) + case (insert x A) have pi: \Pi\<^sub>E (insert x F) B = (\(g,y). g(x:=y)) ` (Pi\<^sub>E F B \ B x)\ for x F and B :: "'a \ 'b set" unfolding PiE_insert_eq by (subst swap_product [symmetric]) (simp add: image_image case_prod_unfold) - have prod: \(\x'\F. f x' ((p(x:=y)) x')) = (\x'\F. f x' (p x'))\ for p y + have prod: \(\x'\A. f x' ((p(x:=y)) x')) = (\x'\A. f x' (p x'))\ for p y by (rule prod.cong) (use insert.hyps in auto) - have inj: \inj_on (\(g, y). g(x := y)) (Pi\<^sub>E F B \ B x)\ - using \x \ F\ by (rule inj_combinator') + have inj: \inj_on (\(g, y). g(x := y)) (Pi\<^sub>E A B \ B x)\ + using \x \ A\ by (rule inj_combinator') define s where \s x = infsum (\y. norm (f x y)) (B x)\ for x @@ -1931,7 +1813,7 @@ and sum: \\x. x \ F \ f x abs_summable_on B x\ for P F proof - define B' where \B' x = {p x| p. p\P}\ for x - have [simp]: \finite (B' x)\ for x + have fin_B'[simp]: \finite (B' x)\ for x using that by (auto simp: B'_def) have [simp]: \finite (Pi\<^sub>E F B')\ by (simp add: finite_PiE) @@ -1941,15 +1823,11 @@ unfolding B'_def using P that by auto have s_bound: \(\y\B' x. norm (f x y)) \ s x\ if \x \ F\ for x - apply (simp_all add: s_def flip: infsum_finite) - apply (rule infsum_mono_neutral) - using that sum B'B by auto + by (metis B'B fin_B' finite_sum_le_has_sum has_sum_infsum norm_ge_zero s_def sum that) have \(\p\P. norm (\x\F. f x (p x))) \ (\p\Pi\<^sub>E F B'. norm (\x\F. f x (p x)))\ - apply (rule sum_mono2) - by auto + by (simp add: sum_mono2) also have \\ = (\p\Pi\<^sub>E F B'. \x\F. norm (f x (p x)))\ - apply (subst prod_norm[symmetric]) - by simp + by (simp add: prod_norm) also have \\ = (\x\F. \y\B' x. norm (f x y))\ proof (use \finite F\ in induction) case empty @@ -1959,27 +1837,16 @@ have aux: \a = b \ c * a = c * b\ for a b c :: real by auto have inj: \inj_on (\(g, y). g(x := y)) (Pi\<^sub>E F B' \ B' x)\ - by (rule inj_combinator') (use insert.hyps in auto) - have \(\p\Pi\<^sub>E (insert x F) B'. \x\insert x F. norm (f x (p x))) + by (simp add: inj_combinator' insert.hyps) + then have \(\p\Pi\<^sub>E (insert x F) B'. \x\insert x F. norm (f x (p x))) = (\(p,y)\Pi\<^sub>E F B' \ B' x. \x'\insert x F. norm (f x' ((p(x := y)) x')))\ - apply (subst pi) - apply (subst sum.reindex) - using inj by (auto simp: case_prod_unfold) + by (simp add: pi sum.reindex case_prod_unfold) also have \\ = (\(p,y)\Pi\<^sub>E F B' \ B' x. norm (f x y) * (\x'\F. norm (f x' ((p(x := y)) x'))))\ - apply (subst prod.insert) - using insert.hyps by (auto simp: case_prod_unfold) + using insert.hyps by auto also have \\ = (\(p, y)\Pi\<^sub>E F B' \ B' x. norm (f x y) * (\x'\F. norm (f x' (p x'))))\ - apply (rule sum.cong) - apply blast - unfolding case_prod_unfold - apply (rule aux) - apply (rule prod.cong) - using insert.hyps(2) by auto + by (smt (verit) fun_upd_apply insert.hyps(2) prod.cong split_def sum.cong) also have \\ = (\y\B' x. norm (f x y)) * (\p\Pi\<^sub>E F B'. \x'\F. norm (f x' (p x')))\ - apply (subst sum_product) - apply (subst sum.swap) - apply (subst sum.cartesian_product) - by simp + by (simp add: sum_product sum.swap [of _ "Pi\<^sub>E F B'"] sum.cartesian_product) also have \\ = (\y\B' x. norm (f x y)) * (\x\F. \y\B' x. norm (f x y))\ by (simp add: insert.IH) also have \\ = (\x\insert x F. \y\B' x. norm (f x y))\ @@ -1989,56 +1856,41 @@ also have \\ = (\x\F. \\<^sub>\y\B' x. norm (f x y))\ by auto also have \\ \ (\x\F. s x)\ - apply (rule prod_mono) - apply auto - apply (simp add: sum_nonneg) - using s_bound by presburger + using s_bound by (simp add: prod_mono sum_nonneg) finally show ?thesis . qed - have \(\g. \x\insert x F. f x (g x)) abs_summable_on Pi\<^sub>E (insert x F) B\ - apply (rule nonneg_bdd_above_summable_on) - apply (simp; fail) - apply (rule bdd_aboveI[where M=\\x'\insert x F. s x'\]) + have "bdd_above + (sum (\g. norm (\x\insert x A. f x (g x))) ` {F. F \ Pi\<^sub>E (insert x A) B \ finite F})" + apply (rule bdd_aboveI) using * insert.hyps insert.prems by blast - - also have \Pi\<^sub>E (insert x F) B = (\(g,y). g(x:=y)) ` (Pi\<^sub>E F B \ B x)\ + then have \(\g. \x\insert x A. f x (g x)) abs_summable_on Pi\<^sub>E (insert x A) B\ + using nonneg_bdd_above_summable_on + by (metis (mono_tags, lifting) Collect_cong norm_ge_zero) + also have \Pi\<^sub>E (insert x A) B = (\(g,y). g(x:=y)) ` (Pi\<^sub>E A B \ B x)\ by (simp only: pi) - also have "(\g. \x\insert x F. f x (g x)) abs_summable_on \ \ - ((\g. \x\insert x F. f x (g x)) \ (\(g,y). g(x:=y))) abs_summable_on (Pi\<^sub>E F B \ B x)" + also have "(\g. \x\insert x A. f x (g x)) abs_summable_on \ \ + ((\g. \x\insert x A. f x (g x)) \ (\(g,y). g(x:=y))) abs_summable_on (Pi\<^sub>E A B \ B x)" using inj by (subst summable_on_reindex) (auto simp: o_def) - also have "(\z\F. f z ((g(x := y)) z)) = (\z\F. f z (g z))" for g y + also have "(\z\A. f z ((g(x := y)) z)) = (\z\A. f z (g z))" for g y using insert.hyps by (intro prod.cong) auto - hence "((\g. \x\insert x F. f x (g x)) \ (\(g,y). g(x:=y))) = - (\(p, y). f x y * (\x'\F. f x' (p x')))" + hence "((\g. \x\insert x A. f x (g x)) \ (\(g,y). g(x:=y))) = + (\(p, y). f x y * (\x'\A. f x' (p x')))" using insert.hyps by (auto simp: fun_eq_iff cong: prod.cong_simp) - finally have summable2: \(\(p, y). f x y * (\x'\F. f x' (p x'))) abs_summable_on Pi\<^sub>E F B \ B x\ . + finally have summable2: \(\(p, y). f x y * (\x'\A. f x' (p x'))) abs_summable_on Pi\<^sub>E A B \ B x\ . - have \(\\<^sub>\g\Pi\<^sub>E (insert x F) B. \x\insert x F. f x (g x)) - = (\\<^sub>\(p,y)\Pi\<^sub>E F B \ B x. \x'\insert x F. f x' ((p(x:=y)) x'))\ - apply (subst pi) - apply (subst infsum_reindex) - using inj by (auto simp: o_def case_prod_unfold) - also have \\ = (\\<^sub>\(p, y)\Pi\<^sub>E F B \ B x. f x y * (\x'\F. f x' ((p(x:=y)) x')))\ - apply (subst prod.insert) - using insert by auto - also have \\ = (\\<^sub>\(p, y)\Pi\<^sub>E F B \ B x. f x y * (\x'\F. f x' (p x')))\ - apply (subst prod) by rule - also have \\ = (\\<^sub>\p\Pi\<^sub>E F B. \\<^sub>\y\B x. f x y * (\x'\F. f x' (p x')))\ - apply (subst infsum_Sigma_banach[symmetric]) - using summable2 abs_summable_summable apply blast - by fastforce - also have \\ = (\\<^sub>\y\B x. f x y) * (\\<^sub>\p\Pi\<^sub>E F B. \x'\F. f x' (p x'))\ - apply (subst infsum_cmult_left') - apply (subst infsum_cmult_right') - by (rule refl) - also have \\ = (\x\insert x F. infsum (f x) (B x))\ - apply (subst prod.insert) - using \finite F\ \x \ F\ apply auto[2] - apply (cases \infsum (f x) (B x) = 0\) - apply (simp; fail) - apply (subst insert.IH) - apply (auto simp add: insert.prems(1)) - done + have \(\\<^sub>\g\Pi\<^sub>E (insert x A) B. \x\insert x A. f x (g x)) + = (\\<^sub>\(p,y)\Pi\<^sub>E A B \ B x. \x'\insert x A. f x' ((p(x:=y)) x'))\ + using inj by (simp add: pi infsum_reindex o_def case_prod_unfold) + also have \\ = (\\<^sub>\(p,y) \ Pi\<^sub>E A B \ B x. f x y * (\x'\A. f x' ((p(x:=y)) x')))\ + using insert.hyps by auto + also have \\ = (\\<^sub>\(p,y) \ Pi\<^sub>E A B \ B x. f x y * (\x'\A. f x' (p x')))\ + using prod by presburger + also have \\ = (\\<^sub>\p\Pi\<^sub>E A B. \\<^sub>\y\B x. f x y * (\x'\A. f x' (p x')))\ + using abs_summable_summable infsum_Sigma'_banach summable2 by fastforce + also have \\ = (\\<^sub>\y\B x. f x y) * (\\<^sub>\p\Pi\<^sub>E A B. \x'\A. f x' (p x'))\ + by (smt (verit, best) infsum_cmult_left' infsum_cmult_right' infsum_cong) + also have \\ = (\x\insert x A. infsum (f x) (B x))\ + by (simp add: insert) finally show ?case by simp qed @@ -2104,21 +1956,16 @@ assume \f summable_on A\ define n A\<^sub>p A\<^sub>n where \n x = norm (f x)\ and \A\<^sub>p = {x\A. f x \ 0}\ and \A\<^sub>n = {x\A. f x < 0}\ for x - have [simp]: \A\<^sub>p \ A\<^sub>n = A\ \A\<^sub>p \ A\<^sub>n = {}\ + have A: \A\<^sub>p \ A\<^sub>n = A\ \A\<^sub>p \ A\<^sub>n = {}\ by (auto simp: A\<^sub>p_def A\<^sub>n_def) - from \f summable_on A\ have [simp]: \f summable_on A\<^sub>p\ \f summable_on A\<^sub>n\ + from \f summable_on A\ have \f summable_on A\<^sub>p\ \f summable_on A\<^sub>n\ using A\<^sub>p_def A\<^sub>n_def summable_on_subset_banach by fastforce+ - then have [simp]: \n summable_on A\<^sub>p\ - apply (subst summable_on_cong[where g=f]) - by (simp_all add: A\<^sub>p_def n_def) - moreover have [simp]: \n summable_on A\<^sub>n\ - apply (subst summable_on_cong[where g=\\x. - f x\]) - apply (simp add: A\<^sub>n_def n_def[abs_def]) - by (simp add: summable_on_uminus) - ultimately have [simp]: \n summable_on (A\<^sub>p \ A\<^sub>n)\ - apply (rule summable_on_Un_disjoint) by simp - then show \n summable_on A\ - by simp + then have \n summable_on A\<^sub>p\ + by (smt (verit) A\<^sub>p_def n_def mem_Collect_eq real_norm_def summable_on_cong) + moreover have \n summable_on A\<^sub>n\ + by (smt (verit, best) \f summable_on A\<^sub>n\ summable_on_uminus A\<^sub>n_def n_def summable_on_cong mem_Collect_eq real_norm_def) + ultimately show \n summable_on A\ + using A summable_on_Un_disjoint by blast next show \f abs_summable_on A \ f summable_on A\ using abs_summable_summable by blast @@ -2131,19 +1978,16 @@ proof (intro iffI conjI ballI) assume asm: \f abs_summable_on Sigma A B\ then have \(\x. infsum (\y. norm (f (x,y))) (B x)) summable_on A\ - apply (rule_tac summable_on_Sigma_banach) - by (auto simp: case_prod_unfold) + by (simp add: cond_case_prod_eta summable_on_Sigma_banach) then show \(\x. \\<^sub>\y\B x. norm (f (x, y))) abs_summable_on A\ using summable_on_iff_abs_summable_on_real by force show \(\y. f (x, y)) abs_summable_on B x\ if \x \ A\ for x proof - from asm have \f abs_summable_on Pair x ` B x\ - apply (rule summable_on_subset_banach) - using that by auto + by (simp add: image_subset_iff summable_on_subset_banach that) then show ?thesis - apply (subst (asm) summable_on_reindex) - by (auto simp: o_def inj_on_def) + by (metis (mono_tags, lifting) o_def inj_on_def summable_on_reindex prod.inject summable_on_cong) qed next assume asm: \(\x\A. (\xa. f (x, xa)) abs_summable_on B x) \ @@ -2156,17 +2000,11 @@ have [simp]: \finite {y. (x, y) \ F}\ for x by (metis \finite F\ Range.intros finite_Range finite_subset mem_Collect_eq subsetI) have \(\xy\F. norm (f xy)) = (\x\fst ` F. \y\{y. (x,y)\F}. norm (f (x,y)))\ - apply (subst sum.Sigma) - by auto + by (simp add: sum.Sigma) also have \\ = (\\<^sub>\x\fst ` F. \\<^sub>\y\{y. (x,y)\F}. norm (f (x,y)))\ - apply (subst infsum_finite) by auto also have \\ \ (\\<^sub>\x\fst ` F. \\<^sub>\y\B x. norm (f (x,y)))\ - apply (rule infsum_mono) - apply (simp; fail) - apply (simp; fail) - apply (rule infsum_mono_neutral) - using asm that(1) by auto + using asm that(1) by (intro infsum_mono infsum_mono_neutral) auto also have \\ \ (\\<^sub>\x\A. \\<^sub>\y\B x. norm (f (x,y)))\ by (rule infsum_mono_neutral) (use asm that(1) in \auto simp add: infsum_nonneg\) finally show ?thesis . @@ -2226,8 +2064,7 @@ by auto have a1: "(\\<^sub>\i\F. norm (x i * x i)) \ (\\<^sub>\i\A. norm (x i * x i))" - apply (rule infsum_mono_neutral) - using b4 r1 x2_sum by auto + by (metis (no_types, lifting) b4 infsum_mono2 norm_ge_zero summable_on_subset_banach x2_sum) have "norm (x i * y i) \ norm (x i * x i) + norm (y i * y i)" for i unfolding norm_mult by (smt mult_left_mono mult_nonneg_nonneg mult_right_mono norm_ge_zero) @@ -2308,14 +2145,13 @@ have "0 < e2ennreal b" using b' b by (metis dual_order.refl enn2ereal_e2ennreal gr_zeroI order_less_le zero_ennreal.abs_eq) - hence *: \infsum (e2ennreal o f) S = \\ + hence *: \infsum (e2ennreal \ f) S = \\ using assms b' by (intro infsum_superconst_infinite_ennreal[where b=b']) (auto intro!: e2ennreal_mono) - have \infsum f S = infsum (enn2ereal o (e2ennreal o f)) S\ + have \infsum f S = infsum (enn2ereal \ (e2ennreal \ f)) S\ using geqb b by (intro infsum_cong) (fastforce simp: enn2ereal_e2ennreal) also have \\ = enn2ereal \\ - apply (subst infsum_comm_additive_general) - using * by (auto simp: continuous_at_enn2ereal) + using * by (simp add: infsum_comm_additive_general continuous_at_enn2ereal) also have \\ = \\ by simp finally show ?thesis . @@ -2336,11 +2172,10 @@ assumes \infinite S\ shows "infsum f S = \" proof - - have \ennreal_of_enat (infsum f S) = infsum (ennreal_of_enat o f) S\ - apply (rule infsum_comm_additive_general[symmetric]) - by auto + have \ennreal_of_enat (infsum f S) = infsum (ennreal_of_enat \ f) S\ + by (simp flip: infsum_comm_additive_general) also have \\ = \\ - by (metis assms(3) b comp_apply ennreal_of_enat_0 ennreal_of_enat_inj ennreal_of_enat_le_iff geqb infsum_superconst_infinite_ennreal not_gr_zero) + by (metis assms(3) b comp_def ennreal_of_enat_0 ennreal_of_enat_le_iff geqb infsum_superconst_infinite_ennreal leD leI) also have \\ = ennreal_of_enat \\ by simp finally show ?thesis @@ -2363,15 +2198,12 @@ and fnn: "\x. x\A \ f x \ 0" shows "ennreal (infsum f A) = (SUP F\{F. finite F \ F \ A}. (ennreal (sum f F)))" proof - - have \ennreal (infsum f A) = infsum (ennreal o f) A\ - apply (rule infsum_comm_additive_general[symmetric]) - apply (subst sum_ennreal[symmetric]) - using assms by auto + have \
: "\F. \finite F; F \ A\ \ sum (ennreal \ f) F = ennreal (sum f F)" + by (metis (mono_tags, lifting) comp_def fnn subsetD sum.cong sum_ennreal) + then have \ennreal (infsum f A) = infsum (ennreal \ f) A\ + by (simp add: infsum_comm_additive_general local.summable) also have \\ = (SUP F\{F. finite F \ F \ A}. (ennreal (sum f F)))\ - apply (subst nonneg_infsum_complete, simp) - apply (rule SUP_cong, blast) - apply (subst sum_ennreal[symmetric]) - using fnn by auto + by (metis (mono_tags, lifting) \
image_cong mem_Collect_eq nonneg_infsum_complete zero_le) finally show ?thesis . qed @@ -2383,9 +2215,10 @@ and fnn: "\x. x\A \ f x \ 0" shows "ereal (infsum f A) = (SUP F\{F. finite F \ F \ A}. (ereal (sum f F)))" proof - - have \ereal (infsum f A) = infsum (ereal o f) A\ - apply (rule infsum_comm_additive_general[symmetric]) - using assms by auto + have "\F. \finite F; F \ A\ \ sum (ereal \ f) F = ereal (sum f F)" + by auto + then have \ereal (infsum f A) = infsum (ereal \ f) A\ + by (simp add: infsum_comm_additive_general local.summable) also have \\ = (SUP F\{F. finite F \ F \ A}. (ereal (sum f F)))\ by (subst nonneg_infsum_complete) (simp_all add: assms) finally show ?thesis . @@ -2442,41 +2275,37 @@ lemma infsum_cnj[simp]: \infsum (\x. cnj (f x)) M = cnj (infsum f M)\ by (metis complex_cnj_zero infsumI has_sum_cnj_iff infsum_def summable_on_cnj_iff has_sum_infsum) +lemma has_sum_Re: + assumes "has_sum f M a" + shows "has_sum (\x. Re (f x)) M (Re a)" + using has_sum_comm_additive[where f=Re] + using assms tendsto_Re by (fastforce simp add: o_def additive_def) + lemma infsum_Re: assumes "f summable_on M" shows "infsum (\x. Re (f x)) M = Re (infsum f M)" - apply (rule infsum_comm_additive[where f=Re, unfolded o_def]) - using assms by (auto intro!: additive.intro) - -lemma has_sum_Re: - assumes "has_sum f M a" - shows "has_sum (\x. Re (f x)) M (Re a)" - apply (rule has_sum_comm_additive[where f=Re, unfolded o_def]) - using assms by (auto intro!: additive.intro tendsto_Re) + by (simp add: assms has_sum_Re infsumI) lemma summable_on_Re: assumes "f summable_on M" shows "(\x. Re (f x)) summable_on M" - apply (rule summable_on_comm_additive[where f=Re, unfolded o_def]) - using assms by (auto intro!: additive.intro) + by (metis assms has_sum_Re summable_on_def) + +lemma has_sum_Im: + assumes "has_sum f M a" + shows "has_sum (\x. Im (f x)) M (Im a)" + using has_sum_comm_additive[where f=Im] + using assms tendsto_Im by (fastforce simp add: o_def additive_def) lemma infsum_Im: assumes "f summable_on M" shows "infsum (\x. Im (f x)) M = Im (infsum f M)" - apply (rule infsum_comm_additive[where f=Im, unfolded o_def]) - using assms by (auto intro!: additive.intro) - -lemma has_sum_Im: - assumes "has_sum f M a" - shows "has_sum (\x. Im (f x)) M (Im a)" - apply (rule has_sum_comm_additive[where f=Im, unfolded o_def]) - using assms by (auto intro!: additive.intro tendsto_Im) + by (simp add: assms has_sum_Im infsumI) lemma summable_on_Im: assumes "f summable_on M" shows "(\x. Im (f x)) summable_on M" - apply (rule summable_on_comm_additive[where f=Im, unfolded o_def]) - using assms by (auto intro!: additive.intro) + by (metis assms has_sum_Im summable_on_def) lemma nonneg_infsum_le_0D_complex: fixes f :: "'a \ complex" @@ -2487,12 +2316,9 @@ shows "f x = 0" proof - have \Im (f x) = 0\ - apply (rule nonneg_infsum_le_0D[where A=A]) - using assms - by (auto simp add: infsum_Im summable_on_Im less_eq_complex_def) + using assms(4) less_eq_complex_def nneg by auto moreover have \Re (f x) = 0\ - apply (rule nonneg_infsum_le_0D[where A=A]) - using assms by (auto simp add: summable_on_Re infsum_Re less_eq_complex_def) + using assms by (auto simp add: summable_on_Re infsum_Re less_eq_complex_def intro: nonneg_infsum_le_0D[where A=A]) ultimately show ?thesis by (simp add: complex_eqI) qed @@ -2517,13 +2343,11 @@ shows \infsum f A \ infsum g B\ proof - have \infsum (\x. Re (f x)) A \ infsum (\x. Re (g x)) B\ - apply (rule infsum_mono_neutral) - using assms(3-5) by (auto simp add: summable_on_Re less_eq_complex_def) + by (smt (verit) assms infsum_cong infsum_mono_neutral less_eq_complex_def summable_on_Re zero_complex.simps(1)) then have Re: \Re (infsum f A) \ Re (infsum g B)\ by (metis assms(1-2) infsum_Re) have \infsum (\x. Im (f x)) A = infsum (\x. Im (g x)) B\ - apply (rule infsum_cong_neutral) - using assms(3-5) by (auto simp add: summable_on_Re less_eq_complex_def) + by (smt (verit, best) assms(3-5) infsum_cong_neutral less_eq_complex_def zero_complex.simps(2)) then have Im: \Im (infsum f A) = Im (infsum g B)\ by (metis assms(1-2) infsum_Im) from Re Im show ?thesis @@ -2545,7 +2369,7 @@ assumes "f summable_on M" and "\x. x \ M \ 0 \ f x" shows "infsum f M \ 0" (is "?lhs \ _") - by (metis assms(1) assms(2) infsum_0_simp summable_on_0_simp infsum_mono_complex) + by (metis assms infsum_0_simp summable_on_0_simp infsum_mono_complex) lemma infsum_cmod: assumes "f summable_on M" @@ -2561,8 +2385,7 @@ finally show \ . qed (auto simp: additive_def) also have \\ = infsum f M\ - apply (rule infsum_cong) - using fnn cmod_eq_Re complex_is_Real_iff less_eq_complex_def by force + using fnn cmod_eq_Re complex_is_Real_iff less_eq_complex_def by (force cong: infsum_cong) finally show ?thesis by (metis abs_of_nonneg infsum_def le_less_trans norm_ge_zero norm_infsum_bound norm_of_real not_le order_refl) qed @@ -2589,12 +2412,12 @@ by (simp add: n_def nr_def ni_def r_def i_def cmod_le) have *: \(\x. nr x + ni x) summable_on A\ - apply (rule summable_on_add) by auto - show \n summable_on A\ - apply (rule nonneg_bdd_above_summable_on) - apply (simp add: n_def; fail) + by (simp add: summable_on_add) + have "bdd_above (sum n ` {F. F \ A \ finite F})" apply (rule bdd_aboveI[where M=\infsum (\x. nr x + ni x) A\]) - using * n_sum by (auto simp flip: infsum_finite simp: ni_def[abs_def] nr_def[abs_def] intro!: infsum_mono_neutral) + using * n_sum by (auto simp flip: infsum_finite simp: ni_def nr_def intro!: infsum_mono_neutral) + then show \n summable_on A\ + by (simp add: n_def nonneg_bdd_above_summable_on) next show \f abs_summable_on A \ f summable_on A\ using abs_summable_summable by blast