(* Title : Series.thy Author : Jacques D. Fleuriot Copyright : 1998 University of Cambridge Converted to Isar and polished by lcp Converted to sum and polished yet more by TNN Additional contributions by Jeremy Avigad *)
section‹Infinite Series›
theory Series imports Limits Inequalities begin
subsection‹Definition of infinite summability›
definition sums :: "(nat ==> 'a::{topological_space, comm_monoid_add}) ==> 'a ==> bool"
(infixr‹sums› 80) where"f sums s ⟷ (λn. ∑i<---- s"
definition summable :: "(nat ==> 'a::{topological_space, comm_monoid_add}) ==> bool" where"summable f ⟷ (∃s. f sums s)"
definition suminf :: "(nat ==> 'a::{topological_space, comm_monoid_add}) ==> 'a"
(binder‹∑› 10) where"suminf f = (THE s. f sums s)"
text‹Variants of the definition› lemma sums_def': "f sums s ⟷ (λn. ∑i = 0..n. f i) <---- s" unfolding sums_def using LIMSEQ_lessThan_iff_atMost atMost_atLeast0 by auto
lemma sums_def_le: "f sums s ⟷ (λn. ∑i≤n. f i) <---- s" by (simp add: sums_def' atMost_atLeast0)
lemma bounded_imp_summable: fixes a :: "nat ==> 'a::{conditionally_complete_linorder,linorder_topology,linordered_comm_semiring_strict}" assumes 0: "∧n. a n ≥ 0"and bounded: "∧n. (∑k≤n. a k) ≤ B" shows"summable a" proof - have"bdd_above (range(λn. ∑k≤n. a k))" by (meson bdd_aboveI2 bounded) moreoverhave"incseq (λn. ∑k≤n. a k)" by (simp add: mono_def "0" sum_mono2) ultimatelyobtain s where"(λn. ∑k≤n. a k) <---- s" using LIMSEQ_incseq_SUP by blast thenshow ?thesis by (auto simp: sums_def_le summable_def) qed
subsection‹Infinite summability on topological monoids›
lemma sums_subst[trans]: "f = g ==> g sums z ==> f sums z" by simp
lemma sums_cong: "(∧n. f n = g n) ==> f sums c ⟷ g sums c" by presburger
lemma sums_summable: "f sums l ==> summable f" by (simp add: sums_def summable_def, blast)
lemma summable_iff_convergent: "summable f ⟷ convergent (λn. ∑i by (simp add: summable_def sums_def convergent_def)
lemma summable_iff_convergent': "summable f ⟷ convergent (λn. sum f {..n})" by (simp add: convergent_def summable_def sums_def_le)
lemma suminf_eq_lim: "suminf f = lim (λn. ∑i by (simp add: suminf_def sums_def lim_def)
lemma sums_group: "f sums s ==> 0 < k ==> (λn. sum f {n * k ..< n * k + k}) sums s" apply (simp only: sums_def sum.nat_group tendsto_def eventually_sequentially) apply (erule all_forward imp_forward exE| assumption)+ by (metis le_square mult.commute mult.left_neutral mult_le_cancel2 mult_le_mono)
lemma suminf_cong: "(∧n. f n = g n) ==> suminf f = suminf g" by presburger
lemma summable_cong: fixes f g :: "nat ==> 'a::real_normed_vector" assumes"eventually (λx. f x = g x) sequentially" shows"summable f = summable g" proof - from assms obtain N where N: "∀n≥N. f n = g n" by (auto simp: eventually_at_top_linorder)
define C where"C = (∑k from eventually_ge_at_top[of N] have"eventually (λn. sum f {.. proof eventually_elim case (elim n) thenhave"{..∪ {N.. by auto alsohave"sum f ... = sum f {.. by (intro sum.union_disjoint) auto alsofrom N have"sum f {N.. by (intro sum.cong) simp_all alsohave"sum f {.. unfolding C_def by (simp add: algebra_simps sum_subtractf) alsohave"sum g {..∪ {N.. by (intro sum.union_disjoint [symmetric]) auto alsofrom elim have"{..∪ {N.. by auto finallyshow"sum f {.. . qed from convergent_cong[OF this] show ?thesis by (simp add: summable_iff_convergent convergent_add_const_iff) qed
lemma sums_finite: assumes [simp]: "finite N" and f: "∧n. n ∉ N ==> f n = 0" shows"f sums (∑n∈N. f n)" proof - have eq: "sum f {..for n by (rule sum.mono_neutral_right) (auto simp: add_increasing less_Suc_eq_le f) show ?thesis unfolding sums_def by (rule LIMSEQ_offset[of _ "Suc (Max N)"])
(simp add: eq atLeast0LessThan del: add_Suc_right) qed
corollary sums_0: "(∧n. f n = 0) ==> (f sums 0)" by (metis (no_types) finite.emptyI sum.empty sums_finite)
lemma summable_finite: "finite N ==> (∧n. n ∉ N ==> f n = 0) ==> summable f" by (rule sums_summable) (rule sums_finite)
lemma sums_If_finite_set: "finite A ==> (λr. if r ∈ A then f r else 0) sums (∑r∈A. f r)" using sums_finite[of A "(λr. if r ∈ A then f r else 0)"] by simp
lemma summable_If_finite_set[simp, intro]: "finite A ==> summable (λr. if r ∈ A then f r else 0)" by (rule sums_summable) (rule sums_If_finite_set)
lemma sums_If_finite: "finite {r. P r} ==> (λr. if P r then f r else 0) sums (∑r | P r. f r)" using sums_If_finite_set[of "{r. P r}"] by simp
lemma summable_If_finite[simp, intro]: "finite {r. P r} ==> summable (λr. if P r then f r else 0)" by (rule sums_summable) (rule sums_If_finite)
lemma sums_single: "(λr. if r = i then f r else 0) sums f i" using sums_If_finite[of "λr. r = i"] by simp
lemma summable_single[simp, intro]: "summable (λr. if r = i then f r else 0)" by (rule sums_summable) (rule sums_single)
context fixes f :: "nat ==> 'a::{t2_space,comm_monoid_add}" begin
lemma summable_sums[intro]: "summable f ==> f sums (suminf f)" by (simp add: summable_def sums_def suminf_def)
(metis convergent_LIMSEQ_iff convergent_def lim_def)
lemma summable_LIMSEQ: "summable f ==> (λn. ∑i<---- suminf f" by (rule summable_sums [unfolded sums_def])
lemma summable_LIMSEQ': "summable f ==> (λn. ∑i≤n. f i) <---- suminf f" using sums_def_le by blast
lemma sums_unique: "f sums s ==> s = suminf f" by (metis limI suminf_eq_lim sums_def)
lemma sums_iff: "f sums x ⟷ summable f ∧ suminf f = x" by (metis summable_sums sums_summable sums_unique)
lemma summable_sums_iff: "summable f ⟷ f sums suminf f" by (auto simp: sums_iff summable_sums)
lemma sums_unique2: "f sums a ==> f sums b ==> a = b" for a b :: 'a by (simp add: sums_iff)
lemma sums_Uniq: "∃🪙≤🪙1a. f sums a" for a b :: 'a by (simp add: sums_unique2 Uniq_def)
lemma suminf_finite: assumes N: "finite N" and f: "∧n. n ∉ N ==> f n = 0" shows"suminf f = (∑n∈N. f n)" using sums_finite[OF assms, THEN sums_unique] by simp
subsection‹Infinite summability on ordered, topological monoids›
lemma sums_le: "(∧n. f n ≤ g n) ==> f sums s ==> g sums t ==> s ≤ t" for f g :: "nat ==> 'a::{ordered_comm_monoid_add,linorder_topology}" by (rule LIMSEQ_le) (auto intro: sum_mono simp: sums_def)
context fixes f :: "nat ==> 'a::{ordered_comm_monoid_add,linorder_topology}" begin
lemma suminf_le: "(∧n. f n ≤ g n) ==> summable f ==> summable g ==> suminf f ≤ suminf g" using sums_le by blast
lemma sum_le_suminf: shows"summable f ==> finite I ==> (∧n. n ∈- I ==> 0 ≤ f n) ==> sum f I ≤ suminf f" by (rule sums_le[OF _ sums_If_finite_set summable_sums]) auto
lemma suminf_nonneg: "summable f ==> (∧n. 0 ≤ f n) ==> 0 ≤ suminf f" using sum_le_suminf by force
lemma suminf_le_const: "summable f ==> (∧n. sum f {..≤ x) ==> suminf f ≤ x" by (metis LIMSEQ_le_const2 summable_LIMSEQ)
lemma suminf_eq_zero_iff: assumes"summable f"and pos: "∧n. 0 ≤ f n" shows"suminf f = 0 ⟷ (∀n. f n = 0)" proof assume L: "suminf f = 0" thenhave f: "(λn. ∑i<---- 0" using summable_LIMSEQ[of f] assms by simp thenhave"∧i. (∑n∈{i}. f n) ≤ 0" by (metis L ‹summable f› order_refl pos sum.infinite sum_le_suminf) with pos show"∀n. f n = 0" by (simp add: order.antisym) qed (metis suminf_zero fun_eq_iff)
lemma suminf_pos_iff: "summable f ==> (∧n. 0 ≤ f n) ==> 0 < suminf f ⟷ (∃i. 0 < f i)" using sum_le_suminf[of "{}"] suminf_eq_zero_iff by (simp add: less_le)
lemma suminf_pos2: assumes"summable f""∧n. 0 ≤ f n""0 < f i" shows"0 < suminf f" proof - have"0 < (∑n using assms by (intro sum_pos2[where i=i]) auto alsohave"…≤ suminf f" using assms by (intro sum_le_suminf) auto finallyshow ?thesis . qed
lemma suminf_pos: "summable f ==> (∧n. 0 < f n) ==> 0 < suminf f" by (intro suminf_pos2[where i=0]) (auto intro: less_imp_le)
end
context fixes f :: "nat ==> 'a::{ordered_cancel_comm_monoid_add,linorder_topology}" begin
lemma sum_less_suminf2: "summable f ==> (∧m. m≥n ==> 0 ≤ f m) ==> n ≤ i ==> 0 < f i ==> sum f {.. using sum_le_suminf[of f "{..< Suc i}"] and add_strict_increasing[of "f i""sum f {.."sum f {..] and sum_mono2[of "{.."{.. f] by (auto simp: less_imp_le ac_simps)
lemma sum_less_suminf: "summable f ==> (∧m. m≥n ==> 0 < f m) ==> sum f {.. using sum_less_suminf2[of n n] by (simp add: less_imp_le)
end
lemma summableI_nonneg_bounded: fixes f :: "nat ==> 'a::{ordered_comm_monoid_add,linorder_topology,conditionally_complete_linorder}" assumes pos[simp]: "∧n. 0 ≤ f n" and le: "∧n. (∑i≤ x" shows"summable f" unfolding summable_def sums_def [abs_def] proof (rule exI LIMSEQ_incseq_SUP)+ show"bdd_above (range (λn. sum f {.. using le by (auto simp: bdd_above_def) show"incseq (λn. sum f {.. by (auto simp: mono_def intro!: sum_mono2) qed
lemma summableI[intro, simp]: "summable f" for f :: "nat ==> 'a::{canonically_ordered_monoid_add,linorder_topology,complete_linorder}" by (intro summableI_nonneg_bounded[where x=top] zero_le top_greatest)
lemma suminf_eq_SUP_real: assumes X: "summable X""∧i. 0 ≤ X i"shows"suminf X = (SUP i. ∑n by (intro LIMSEQ_unique[OF summable_LIMSEQ] X LIMSEQ_incseq_SUP)
(auto intro!: bdd_aboveI2[where M="∑i. X i"] sum_le_suminf X monoI sum_mono2)
subsection‹Infinite summability on topological monoids›
context fixes f g :: "nat ==> 'a::{t2_space,topological_comm_monoid_add}" begin
lemma sums_Suc: assumes"(λn. f (Suc n)) sums l" shows"f sums (l + f 0)" proof - have"(λn. (∑i<---- l + f 0" using assms by (auto intro!: tendsto_add simp: sums_def) moreoverhave"(∑i∑ifor n unfolding lessThan_Suc_eq_insert_0 by (simp add: ac_simps sum.atLeast1_atMost_eq image_Suc_lessThan) ultimatelyshow ?thesis by (auto simp: sums_def simp del: sum.lessThan_Suc intro: filterlim_sequentially_Suc[THEN iffD1]) qed
lemma sums_add: "f sums a ==> g sums b ==> (λn. f n + g n) sums (a + b)" unfolding sums_def by (simp add: sum.distrib tendsto_add)
lemma summable_add: "summable f ==> summable g ==> summable (λn. f n + g n)" unfolding summable_def by (auto intro: sums_add)
lemma suminf_add: "summable f ==> summable g ==> suminf f + suminf g = (∑n. f n + g n)" by (intro sums_unique sums_add summable_sums)
end
context fixes f :: "'i ==> nat ==> 'a::{t2_space,topological_comm_monoid_add}" and I :: "'i set" begin
lemma sums_sum: "(∧i. i ∈ I ==> (f i) sums (x i)) ==> (λn. ∑i∈I. f i n) sums (∑i∈I. x i)" by (induct I rule: infinite_finite_induct) (auto intro!: sums_add)
lemma suminf_sum: "(∧i. i ∈ I ==> summable (f i)) ==> (∑n. ∑i∈I. f i n) = (∑i∈I. ∑n. f i n)" using sums_unique[OF sums_sum, OF summable_sums] by simp
lemma summable_sum: "(∧i. i ∈ I ==> summable (f i)) ==> summable (λn. ∑i∈I. f i n)" using sums_summable[OF sums_sum[OF summable_sums]] .
end
lemma sums_If_finite_set': fixes f g :: "nat ==> 'a::{t2_space,topological_ab_group_add}" assumes"g sums S"and"finite A"and"S' = S + (∑n∈A. f n - g n)" shows"(λn. if n ∈ A then f n else g n) sums S'" proof - have"(λn. g n + (if n ∈ A then f n - g n else 0)) sums (S + (∑n∈A. f n - g n))" by (intro sums_add assms sums_If_finite_set) alsohave"(λn. g n + (if n ∈ A then f n - g n else 0)) = (λn. if n ∈ A then f n else g n)" by (simp add: fun_eq_iff) finallyshow ?thesis using assms by simp qed
subsection‹Infinite summability on real normed vector spaces›
context fixes f :: "nat ==> 'a::real_normed_vector" begin
lemma sums_Suc_iff: "(λn. f (Suc n)) sums s ⟷ f sums (s + f 0)" proof - have"f sums (s + f 0) ⟷ (λi. ∑j<---- s + f 0" by (subst filterlim_sequentially_Suc) (simp add: sums_def) alsohave"…⟷ (λi. (∑j<---- s + f 0" by (simp add: ac_simps lessThan_Suc_eq_insert_0 image_Suc_lessThan sum.atLeast1_atMost_eq) alsohave"…⟷ (λn. f (Suc n)) sums s" proof assume"(λi. (∑j<---- s + f 0" with tendsto_add[OF this tendsto_const, of "- f 0"] show"(λi. f (Suc i)) sums s" by (simp add: sums_def) qed (auto intro: tendsto_add simp: sums_def) finallyshow ?thesis .. qed
lemma summable_Suc_iff: "summable (λn. f (Suc n)) = summable f" proof assume"summable f" thenhave"f sums suminf f" by (rule summable_sums) thenhave"(λn. f (Suc n)) sums (suminf f - f 0)" by (simp add: sums_Suc_iff) thenshow"summable (λn. f (Suc n))" unfolding summable_def by blast qed (auto simp: sums_Suc_iff summable_def)
lemma sums_Suc_imp: "f 0 = 0 ==> (λn. f (Suc n)) sums s ==> (λn. f n) sums s" using sums_Suc_iff by simp
end
context(* Separate contexts are necessary to allow general use of the results above, here. *) fixes f :: "nat ==> 'a::real_normed_vector" begin
lemma sums_diff: "f sums a ==> g sums b ==> (λn. f n - g n) sums (a - b)" unfolding sums_def by (simp add: sum_subtractf tendsto_diff)
lemma summable_diff: "summable f ==> summable g ==> summable (λn. f n - g n)" unfolding summable_def by (auto intro: sums_diff)
lemma suminf_diff: "summable f ==> summable g ==> suminf f - suminf g = (∑n. f n - g n)" by (intro sums_unique sums_diff summable_sums)
lemma sums_minus: "f sums a ==> (λn. - f n) sums (- a)" unfolding sums_def by (simp add: sum_negf tendsto_minus)
lemma summable_minus: "summable f ==> summable (λn. - f n)" unfolding summable_def by (auto intro: sums_minus)
lemma suminf_minus: "summable f ==> (∑n. - f n) = - (∑n. f n)" by (intro sums_unique [symmetric] sums_minus summable_sums)
lemma sums_iff_shift: "(λi. f (i + n)) sums s ⟷ f sums (s + (∑i proof (induct n arbitrary: s) case 0 thenshow ?caseby simp next case (Suc n) thenhave"(λi. f (Suc i + n)) sums s ⟷ (λi. f (i + n)) sums (s + f n)" by (subst sums_Suc_iff) simp with Suc show ?case by (simp add: ac_simps) qed
corollary sums_iff_shift': "(λi. f (i + n)) sums (s - (∑i⟷ f sums s" by (simp add: sums_iff_shift)
lemma sums_zero_iff_shift: assumes"∧i. i < n ==> f i = 0" shows"(λi. f (i+n)) sums s ⟷ (λi. f i) sums s" by (simp add: assms sums_iff_shift)
lemma summable_iff_shift [simp]: "summable (λn. f (n + k)) ⟷ summable f" by (metis diff_add_cancel summable_def sums_iff_shift [abs_def])
lemma sums_split_initial_segment: "f sums s ==> (λi. f (i + n)) sums (s - (∑i by (simp add: sums_iff_shift)
lemma summable_ignore_initial_segment: "summable f ==> summable (λn. f(n + k))" by (simp add: summable_iff_shift)
lemma suminf_minus_initial_segment: "summable f ==> (∑n. f (n + k)) = (∑n. f n) - (∑i by (rule sums_unique[symmetric]) (auto simp: sums_iff_shift)
lemma suminf_split_initial_segment: "summable f ==> suminf f = (∑n. f(n + k)) + (∑i by (auto simp add: suminf_minus_initial_segment)
lemma suminf_split_head: "summable f ==> (∑n. f (Suc n)) = suminf f - f 0" using suminf_split_initial_segment[of 1] by simp
lemma suminf_exist_split: fixes r :: real assumes"0 < r"and"summable f" shows"∃N. ∀n≥N. norm (∑i. f (i + n)) < r" proof - from LIMSEQ_D[OF summable_LIMSEQ[OF ‹summable f›] ‹0 🚫›] obtain N :: nat where"∀ n ≥ N. norm (sum f {.. by auto thenshow ?thesis by (auto simp: norm_minus_commute suminf_minus_initial_segment[OF ‹summable f›]) qed
lemma summable_LIMSEQ_zero: assumes"summable f"shows"f <---- 0" proof - have"Cauchy (λn. sum f {.. using LIMSEQ_imp_Cauchy assms summable_LIMSEQ by blast thenshow ?thesis unfolding Cauchy_iff LIMSEQ_iff by (metis add.commute add_diff_cancel_right' diff_zero le_SucI sum.lessThan_Suc) qed
lemma summable_imp_convergent: "summable f ==> convergent f" by (force dest!: summable_LIMSEQ_zero simp: convergent_def)
lemma summable_imp_Bseq: "summable f ==> Bseq f" by (simp add: convergent_imp_Bseq summable_imp_convergent)
end
lemma summable_minus_iff: "summable (λn. - f n) ⟷ summable f" for f :: "nat ==> 'a::real_normed_vector" by (auto dest: summable_minus) (* used two ways, hence must be outside the context above *)
lemma (in bounded_linear) sums: "(λn. X n) sums a ==> (λn. f (X n)) sums (f a)" unfolding sums_def by (drule tendsto) (simp only: sum)
lemma (in bounded_linear) summable: "summable (λn. X n) ==> summable (λn. f (X n))" unfolding summable_def by (auto intro: sums)
lemma (in bounded_linear) suminf: "summable (λn. X n) ==> f (∑n. X n) = (∑n. f (X n))" by (intro sums_unique sums summable_sums)
lemma summable_const_iff: "summable (λ_. c) ⟷ c = 0" for c :: "'a::real_normed_vector" proof - have"¬ summable (λ_. c)"if"c ≠ 0" proof - from that have"filterlim (λn. of_nat n * norm c) at_top sequentially" by (subst mult.commute)
(auto intro!: filterlim_tendsto_pos_mult_at_top filterlim_real_sequentially) thenhave"¬ convergent (λn. norm (∑k by (intro filterlim_at_infinity_imp_not_convergent filterlim_at_top_imp_at_infinity)
(simp_all add: sum_constant_scaleR) thenshow ?thesis unfolding summable_iff_convergent using convergent_norm by blast qed thenshow ?thesis by auto qed
subsection‹Infinite summability on real normed algebras›
context fixes f :: "nat ==> 'a::real_normed_algebra" begin
lemma sums_mult: "f sums a ==> (λn. c * f n) sums (c * a)" by (rule bounded_linear.sums [OF bounded_linear_mult_right])
lemma summable_mult: "summable f ==> summable (λn. c * f n)" by (rule bounded_linear.summable [OF bounded_linear_mult_right])
lemma suminf_mult: "summable f ==> suminf (λn. c * f n) = c * suminf f" by (rule bounded_linear.suminf [OF bounded_linear_mult_right, symmetric])
lemma sums_mult2: "f sums a ==> (λn. f n * c) sums (a * c)" by (rule bounded_linear.sums [OF bounded_linear_mult_left])
lemma summable_mult2: "summable f ==> summable (λn. f n * c)" by (rule bounded_linear.summable [OF bounded_linear_mult_left])
lemma suminf_mult2: "summable f ==> suminf f * c = (∑n. f n * c)" by (rule bounded_linear.suminf [OF bounded_linear_mult_left])
end
lemma sums_mult_iff: fixes f :: "nat ==> 'a::{real_normed_algebra,field}" assumes"c ≠ 0" shows"(λn. c * f n) sums (c * d) ⟷ f sums d" using sums_mult[of f d c] sums_mult[of "λn. c * f n""c * d""inverse c"] by (force simp: field_simps assms)
lemma sums_mult2_iff: fixes f :: "nat ==> 'a::{real_normed_algebra,field}" assumes"c ≠ 0" shows"(λn. f n * c) sums (d * c) ⟷ f sums d" using sums_mult_iff[OF assms, of f d] by (simp add: mult.commute)
lemma sums_of_real_iff: "(λn. of_real (f n) :: 'a::real_normed_div_algebra) sums of_real c ⟷ f sums c" by (simp add: sums_def of_real_sum[symmetric] tendsto_of_real_iff del: of_real_sum)
subsection‹Infinite summability on real normed fields›
context fixes c :: "'a::real_normed_field" begin
lemma sums_divide: "f sums a ==> (λn. f n / c) sums (a / c)" by (rule bounded_linear.sums [OF bounded_linear_divide])
lemma summable_divide: "summable f ==> summable (λn. f n / c)" by (rule bounded_linear.summable [OF bounded_linear_divide])
lemma suminf_divide: "summable f ==> suminf (λn. f n / c) = suminf f / c" by (rule bounded_linear.suminf [OF bounded_linear_divide, symmetric])
lemma summable_inverse_divide: "summable (inverse ∘ f) ==> summable (λn. c / f n)" by (auto dest: summable_mult [of _ c] simp: field_simps)
lemma sums_mult_D: "(λn. c * f n) sums a ==> c ≠ 0 ==> f sums (a/c)" using sums_mult_iff by fastforce
lemma summable_mult_D: "summable (λn. c * f n) ==> c ≠ 0 ==> summable f" by (auto dest: summable_divide)
text‹Sum of a geometric progression.›
lemma geometric_sums: assumes"norm c < 1" shows"(λn. c^n) sums (1 / (1 - c))" proof - have neq_0: "c - 1 ≠ 0" using assms by auto thenhave"(λn. c ^ n / (c - 1) - 1 / (c - 1)) <---- 0 / (c - 1) - 1 / (c - 1)" by (intro tendsto_intros assms) thenhave"(λn. (c ^ n - 1) / (c - 1)) <---- 1 / (1 - c)" by (simp add: nonzero_minus_divide_right [OF neq_0] diff_divide_distrib) with neq_0 show"(λn. c ^ n) sums (1 / (1 - c))" by (simp add: sums_def geometric_sum) qed
lemma summable_geometric: "norm c < 1 ==> summable (λn. c^n)" by (rule geometric_sums [THEN sums_summable])
lemma summable_geometric_iff [simp]: "summable (λn. c ^ n) ⟷ norm c < 1" proof assume"summable (λn. c ^ n :: 'a :: real_normed_field)" thenhave"(λn. norm c ^ n) <---- 0" by (simp add: norm_power [symmetric] tendsto_norm_zero_iff summable_LIMSEQ_zero) from order_tendstoD(2)[OF this zero_less_one] obtain n where"norm c ^ n < 1" by (auto simp: eventually_at_top_linorder) thenshow"norm c < 1"using one_le_power[of "norm c" n] by (cases "norm c ≥ 1") (linarith, simp) qed (rule summable_geometric)
end
text‹Biconditional versions for constant factors› context fixes c :: "'a::real_normed_field" begin
lemma summable_cmult_iff [simp]: "summable (λn. c * f n) ⟷ c=0 ∨ summable f" proof - have"[summable (λn. c * f n); c ≠ 0]==> summable f" using summable_mult_D by blast thenshow ?thesis by (auto simp: summable_mult) qed
lemma summable_divide_iff [simp]: "summable (λn. f n / c) ⟷ c=0 ∨ summable f" proof - have"[summable (λn. f n / c); c ≠ 0]==> summable f" by (auto dest: summable_divide [where c = "1/c"]) thenshow ?thesis by (auto simp: summable_divide) qed
end
lemma power_half_series: "(λn. (1/2::real)^Suc n) sums 1" proof - have 2: "(λn. (1/2::real)^n) sums 2" using geometric_sums [of "1/2::real"] by auto have"(λn. (1/2::real)^Suc n) = (λn. (1 / 2) ^ n / 2)" by (simp add: mult.commute) thenshow ?thesis using sums_divide [OF 2, of 2] by simp qed
subsection‹Telescoping›
lemma telescope_sums: fixes c :: "'a::real_normed_vector" assumes"f <---- c" shows"(λn. f (Suc n) - f n) sums (c - f 0)" unfolding sums_def proof (subst filterlim_sequentially_Suc [symmetric]) have"(λn. ∑k by (simp add: lessThan_Suc_atMost atLeast0AtMost [symmetric] sum_Suc_diff) alsohave"…<---- c - f 0" by (intro tendsto_diff LIMSEQ_Suc[OF assms] tendsto_const) finallyshow"(λn. ∑n<---- c - f 0" . qed
lemma telescope_sums': fixes c :: "'a::real_normed_vector" assumes"f <---- c" shows"(λn. f n - f (Suc n)) sums (f 0 - c)" using sums_minus[OF telescope_sums[OF assms]] by (simp add: algebra_simps)
lemma telescope_summable: fixes c :: "'a::real_normed_vector" assumes"f <---- c" shows"summable (λn. f (Suc n) - f n)" using telescope_sums[OF assms] by (simp add: sums_iff)
lemma telescope_summable': fixes c :: "'a::real_normed_vector" assumes"f <---- c" shows"summable (λn. f n - f (Suc n))" using summable_minus[OF telescope_summable[OF assms]] by (simp add: algebra_simps)
subsection‹Infinite summability on Banach spaces›
text‹Cauchy-type criterion for convergence of series (c.f. Harrison).›
lemma summable_Cauchy: "summable f ⟷ (∀e>0. ∃N. ∀m≥N. ∀n. norm (sum f {m.. (is"_ = ?rhs") for f :: "nat ==> 'a::banach" proof assume f: "summable f" show ?rhs proof clarify fix e :: real assume"0 < e" thenobtain M where M: "∧m n. [m≥M; n≥M]==> norm (sum f {.. using f by (force simp add: summable_iff_convergent Cauchy_convergent_iff [symmetric] Cauchy_iff) have"norm (sum f {m..if"m ≥ M"for m n proof (cases m n rule: linorder_class.le_cases) assume"m ≤ n" thenshow ?thesis by (metis (mono_tags, opaque_lifting) M atLeast0LessThan order_trans sum_diff_nat_ivl that zero_le) next assume"n ≤ m" thenshow ?thesis by (simp add: ‹0 🚫›) qed thenshow"∃N. ∀m≥N. ∀n. norm (sum f {m.. by blast qed next assume r: ?rhs thenshow"summable f" unfolding summable_iff_convergent Cauchy_convergent_iff [symmetric] Cauchy_iff proof clarify fix e :: real assume"0 < e" with r obtain N where N: "∧m n. m ≥ N ==> norm (sum f {m.. by blast have"norm (sum f {..if"m≥N""n≥N"for m n proof (cases m n rule: linorder_class.le_cases) assume"m ≤ n" thenshow ?thesis by (metis N finite_lessThan lessThan_minus_lessThan lessThan_subset_iff norm_minus_commute sum_diff ‹m≥N›) next assume"n ≤ m" thenshow ?thesis by (metis N finite_lessThan lessThan_minus_lessThan lessThan_subset_iff sum_diff ‹n≥N›) qed thenshow"∃M. ∀m≥M. ∀n≥M. norm (sum f {.. by blast qed qed
lemma summable_Cauchy': fixes f :: "nat ==> 'a :: banach" assumes ev: "eventually (λm. ∀n≥m. norm (sum f {m..≤ g m) sequentially" assumes g0: "g <---- 0" shows"summable f" proof (subst summable_Cauchy, intro allI impI, goal_cases) case (1 e) thenhave"∀🪙F x in sequentially. g x < e" using g0 order_tendstoD(2) by blast with ev have"eventually (λm. ∀n. norm (sum f {m.. proof eventually_elim case (elim m) show ?case proof fix n from elim show"norm (sum f {m.. by (cases "n ≥ m") auto qed qed thus ?caseby (auto simp: eventually_at_top_linorder) qed
context fixes f :: "nat ==> 'a::banach" begin
text‹Absolute convergence imples normal convergence.›
lemma summable_comparison_test: assumes fg: "∃N. ∀n≥N. norm (f n) ≤ g n"and g: "summable g" shows"summable f" proof - obtain N where N: "∧n. n≥N ==> norm (f n) ≤ g n" using assms by blast show ?thesis proof (clarsimp simp add: summable_Cauchy) fix e :: real assume"0 < e" thenobtain Ng where Ng: "∧m n. m ≥ Ng ==> norm (sum g {m.. using g by (fastforce simp: summable_Cauchy) with N have"norm (sum f {m..if"m≥max N Ng"for m n proof - have"norm (sum f {m..≤ sum g {m.. using N that by (force intro: sum_norm_le) alsohave"... ≤ norm (sum g {m.. by simp alsohave"... < e" using Ng that by auto finallyshow ?thesis . qed thenshow"∃N. ∀m≥N. ∀n. norm (sum f {m.. by blast qed qed
lemma summable_comparison_test_ev: "eventually (λn. norm (f n) ≤ g n) sequentially ==> summable g ==> summable f" by (rule summable_comparison_test) (auto simp: eventually_at_top_linorder)
text‹A better argument order.› lemma summable_comparison_test': "summable g ==> (∧n. n ≥ N ==> norm (f n) ≤ g n) ==> summable f" by (rule summable_comparison_test) auto
subsection‹The Ratio Test›
lemma summable_ratio_test: assumes"c < 1""∧n. n ≥ N ==> norm (f (Suc n)) ≤ c * norm (f n)" shows"summable f" proof (cases "0 < c") case True show"summable f" proof (rule summable_comparison_test) show"∃N'. ∀n≥N'. norm (f n) ≤ (norm (f N) / (c ^ N)) * c ^ n" proof (intro exI allI impI) fix n assume"N ≤ n" thenshow"norm (f n) ≤ (norm (f N) / (c ^ N)) * c ^ n" proof (induct rule: inc_induct) case base with True show ?caseby simp next case (step m) have"norm (f (Suc m)) / c ^ Suc m * c ^ n ≤ norm (f m) / c ^ m * c ^ n" using‹0 🚫›‹c 🚫› assms(2)[OF ‹N ≤ m›] by (simp add: field_simps) with step show ?caseby simp qed qed show"summable (λn. norm (f N) / c ^ N * c ^ n)" using‹0 🚫›‹c 🚫›by (intro summable_mult summable_geometric) simp qed next case False have"f (Suc n) = 0"if"n ≥ N"for n proof - from that have"norm (f (Suc n)) ≤ c * norm (f n)" by (rule assms(2)) alsohave"…≤ 0" using False by (simp add: not_less mult_nonpos_nonneg) finallyshow ?thesis by auto qed thenshow"summable f" by (intro sums_summable[OF sums_finite, of "{.. Suc N}"]) (auto simp: not_le Suc_less_eq2) qed
end
text‹Application to convergence of the log function› lemma norm_summable_ln_series: fixes z :: "'a :: {real_normed_field, banach}" assumes"norm z < 1" shows"summable (λn. norm (z ^ n / of_nat n))" proof (rule summable_comparison_test) show"summable (λn. norm (z ^ n))" using assms unfolding norm_power by (intro summable_geometric) auto have"norm z ^ n / real n ≤ norm z ^ n"for n proof (cases "n = 0") case False hence"norm z ^ n * 1 ≤ norm z ^ n * real n" by (intro mult_left_mono) auto thus ?thesis using False by (simp add: field_simps) qed auto thus"∃N. ∀n≥N. norm (norm (z ^ n / of_nat n)) ≤ norm (z ^ n)" by (intro exI[of _ 0]) (auto simp: norm_power norm_divide) qed
text‹Relations among convergence and absolute convergence for power series.›
lemma Abel_lemma: fixes a :: "nat ==> 'a::real_normed_vector" assumes r: "0 ≤ r" and r0: "r < r0" and M: "∧n. norm (a n) * r0^n ≤ M" shows"summable (λn. norm (a n) * r^n)" proof (rule summable_comparison_test') show"summable (λn. M * (r / r0) ^ n)" using assms by (auto simp add: summable_mult summable_geometric) show"norm (norm (a n) * r ^ n) ≤ M * (r / r0) ^ n"for n using r r0 M [of n] dual_order.order_iff_strict by (fastforce simp add: abs_mult field_simps) qed
text‹Summability of geometric series for real algebras.›
lemma complete_algebra_summable_geometric: fixes x :: "'a::{real_normed_algebra_1,banach}" assumes"norm x < 1" shows"summable (λn. x ^ n)" proof (rule summable_comparison_test) show"∃N. ∀n≥N. norm (x ^ n) ≤ norm x ^ n" by (simp add: norm_power_ineq) from assms show"summable (λn. norm x ^ n)" by (simp add: summable_geometric) qed
lemma Cauchy_product_sums: fixes a b :: "nat ==> 'a::{real_normed_algebra,banach}" assumes a: "summable (λk. norm (a k))" and b: "summable (λk. norm (b k))" shows"(λk. ∑i≤k. a i * b (k - i)) sums ((∑k. a k) * (∑k. b k))" proof - let ?S1 = "λn::nat. {..× {.. let ?S2 = "λn::nat. {(i,j). i + j < n}" have S1_mono: "∧m n. m ≤ n ==> ?S1 m ⊆ ?S1 n"by auto have S2_le_S1: "∧n. ?S2 n ⊆ ?S1 n"by auto have S1_le_S2: "∧n. ?S1 (n div 2) ⊆ ?S2 n"by auto have finite_S1: "∧n. finite (?S1 n)"by simp with S2_le_S1 have finite_S2: "∧n. finite (?S2 n)"by (rule finite_subset)
let ?g = "λ(i,j). a i * b j" let ?f = "λ(i,j). norm (a i) * norm (b j)" have f_nonneg: "∧x. 0 ≤ ?f x"by auto thenhave norm_sum_f: "∧A. norm (sum ?f A) = sum ?f A" unfolding real_norm_def by (simp only: abs_of_nonneg sum_nonneg [rule_format])
have"(λn. (∑k∑k<---- (∑k. a k) * (∑k. b k)" by (intro tendsto_mult summable_LIMSEQ summable_norm_cancel [OF a] summable_norm_cancel [OF b]) thenhave 1: "(λn. sum ?g (?S1 n)) <---- (∑k. a k) * (∑k. b k)" by (simp only: sum_product sum.Sigma [rule_format] finite_lessThan)
have"(λn. (∑k∑k<---- (∑k. norm (a k)) * (∑k. norm (b k))" using a b by (intro tendsto_mult summable_LIMSEQ) thenhave"(λn. sum ?f (?S1 n)) <---- (∑k. norm (a k)) * (∑k. norm (b k))" by (simp only: sum_product sum.Sigma [rule_format] finite_lessThan) thenhave"convergent (λn. sum ?f (?S1 n))" by (rule convergentI) thenhave Cauchy: "Cauchy (λn. sum ?f (?S1 n))" by (rule convergent_Cauchy) have"Zfun (λn. sum ?f (?S1 n - ?S2 n)) sequentially" proof (rule ZfunI, simp only: eventually_sequentially norm_sum_f) fix r :: real assume r: "0 < r" from CauchyD [OF Cauchy r] obtain N where"∀m≥N. ∀n≥N. norm (sum ?f (?S1 m) - sum ?f (?S1 n)) < r" .. thenhave"∧m n. N ≤ n ==> n ≤ m ==> norm (sum ?f (?S1 m - ?S1 n)) < r" by (simp only: sum_diff finite_S1 S1_mono) thenhave N: "∧m n. N ≤ n ==> n ≤ m ==> sum ?f (?S1 m - ?S1 n) < r" by (simp only: norm_sum_f) show"∃N. ∀n≥N. sum ?f (?S1 n - ?S2 n) < r" proof (intro exI allI impI) fix n assume"2 * N ≤ n" thenhave n: "N ≤ n div 2"by simp have"sum ?f (?S1 n - ?S2 n) ≤ sum ?f (?S1 n - ?S1 (n div 2))" by (intro sum_mono2 finite_Diff finite_S1 f_nonneg Diff_mono subset_refl S1_le_S2) alsohave"… < r" using n div_le_dividend by (rule N) finallyshow"sum ?f (?S1 n - ?S2 n) < r" . qed qed thenhave"Zfun (λn. sum ?g (?S1 n - ?S2 n)) sequentially" apply (rule Zfun_le [rule_format]) apply (simp only: norm_sum_f) apply (rule order_trans [OF norm_sum sum_mono]) apply (auto simp add: norm_mult_ineq) done thenhave 2: "(λn. sum ?g (?S1 n) - sum ?g (?S2 n)) <---- 0" unfolding tendsto_Zfun_iff diff_0_right by (simp only: sum_diff finite_S1 S2_le_S1) with 1 have"(λn. sum ?g (?S2 n)) <---- (∑k. a k) * (∑k. b k)" by (rule Lim_transform2) thenshow ?thesis by (simp only: sums_def sum.triangle_reindex) qed
lemma Cauchy_product: fixes a b :: "nat ==> 'a::{real_normed_algebra,banach}" assumes"summable (λk. norm (a k))" and"summable (λk. norm (b k))" shows"(∑k. a k) * (∑k. b k) = (∑k. ∑i≤k. a i * b (k - i))" using assms by (rule Cauchy_product_sums [THEN sums_unique])
lemma summable_Cauchy_product: fixes a b :: "nat ==> 'a::{real_normed_algebra,banach}" assumes"summable (λk. norm (a k))" and"summable (λk. norm (b k))" shows"summable (λk. ∑i≤k. a i * b (k - i))" using Cauchy_product_sums[OF assms] by (simp add: sums_iff)
subsection‹Series on 🍋‹real›s\<close>
lemma summable_norm_comparison_test: "∃N. ∀n≥N. norm (f n) ≤ g n ==> summable g ==> summable (λn. norm (f n))" by (rule summable_comparison_test) auto
lemma summable_rabs_comparison_test: "∃N. ∀n≥N. ∣f n∣≤ g n ==> summable g ==> summable (λn. ∣f n∣)" for f :: "nat ==> real" by (rule summable_comparison_test) auto
lemma summable_rabs_cancel: "summable (λn. ∣f n∣) ==> summable f" for f :: "nat ==> real" by (rule summable_norm_cancel) simp
lemma summable_rabs: "summable (λn. ∣f n∣) ==>∣suminf f∣≤ (∑n. ∣f n∣)" for f :: "nat ==> real" by (fold real_norm_def) (rule summable_norm)
lemma norm_suminf_le: assumes"∧n. norm (f n :: 'a :: banach) ≤ g n""summable g" shows"norm (suminf f) ≤ suminf g" proof - have *: "summable (λn. norm (f n))" using assms summable_norm_comparison_test by blast hence"norm (suminf f) ≤ (∑n. norm (f n))"by (intro summable_norm) auto alsohave"…≤ suminf g"by (intro suminf_le * assms allI) finallyshow ?thesis . qed
lemma norm_sums_le: assumes"f sums F""g sums G" assumes"∧n. norm (f n :: 'a :: banach) ≤ g n" shows"norm F ≤ G" using assms by (metis norm_suminf_le sums_iff)
lemma summable_zero_power [simp]: "summable (λn. 0 ^ n :: 'a::{comm_ring_1,topological_space})" by (simp add: power_0_left)
lemma summable_zero_power' [simp]: "summable (λn. f n * 0 ^ n :: 'a::{ring_1,topological_space})" proof - have"(λn. f n * 0 ^ n :: 'a) = (λn. if n = 0 then f 0 * 0^0 else 0)" by (intro ext) (simp add: zero_power) moreoverhave"summable …"by simp ultimatelyshow ?thesis by simp qed
lemma summable_power_series: fixes z :: real assumes le_1: "∧i. f i ≤ 1" and nonneg: "∧i. 0 ≤ f i" and z: "0 ≤ z""z < 1" shows"summable (λi. f i * z^i)" proof (rule summable_comparison_test[OF _ summable_geometric]) show"norm z < 1" using z by (auto simp: less_imp_le) show"∧n. ∃N. ∀na≥N. norm (f na * z ^ na) ≤ z ^ na" using z by (auto intro!: exI[of _ 0] mult_left_le_one_le simp: abs_mult nonneg power_abs less_imp_le le_1) qed
lemma summable_0_powser: "summable (λn. f n * 0 ^ n :: 'a::real_normed_div_algebra)" by simp
lemma summable_powser_split_head: "summable (λn. f (Suc n) * z ^ n :: 'a::real_normed_div_algebra) = summable (λn. f n * z ^ n)" proof - have"summable (λn. f (Suc n) * z ^ n) ⟷ summable (λn. f (Suc n) * z ^ Suc n)"
(is"?lhs ⟷ ?rhs") proof show ?rhs if ?lhs using summable_mult2[OF that, of z] by (simp add: power_commutes algebra_simps) show ?lhs if ?rhs using summable_mult2[OF that, of "inverse z"] by (cases "z ≠ 0", subst (asm) power_Suc2) (simp_all add: algebra_simps) qed alsohave"…⟷ summable (λn. f n * z ^ n)"by (rule summable_Suc_iff) finallyshow ?thesis . qed
lemma summable_powser_ignore_initial_segment: fixes f :: "nat ==> 'a :: real_normed_div_algebra" shows"summable (λn. f (n + m) * z ^ n) ⟷ summable (λn. f n * z ^ n)" proof (induction m) case (Suc m) have"summable (λn. f (n + Suc m) * z ^ n) = summable (λn. f (Suc n + m) * z ^ n)" by simp alsohave"… = summable (λn. f (n + m) * z ^ n)" by (rule summable_powser_split_head) alsohave"… = summable (λn. f n * z ^ n)" by (rule Suc.IH) finallyshow ?case . qed simp_all
lemma powser_split_head: fixes f :: "nat ==> 'a::{real_normed_div_algebra,banach}" assumes"summable (λn. f n * z ^ n)" shows"suminf (λn. f n * z ^ n) = f 0 + suminf (λn. f (Suc n) * z ^ n) * z" and"suminf (λn. f (Suc n) * z ^ n) * z = suminf (λn. f n * z ^ n) - f 0" and"summable (λn. f (Suc n) * z ^ n)" proof - from assms show"summable (λn. f (Suc n) * z ^ n)" by (subst summable_powser_split_head) from suminf_mult2[OF this, of z] have"(∑n. f (Suc n) * z ^ n) * z = (∑n. f (Suc n) * z ^ Suc n)" by (simp add: power_commutes algebra_simps) alsofrom assms have"… = suminf (λn. f n * z ^ n) - f 0" by (subst suminf_split_head) simp_all finallyshow"suminf (λn. f n * z ^ n) = f 0 + suminf (λn. f (Suc n) * z ^ n) * z" by simp thenshow"suminf (λn. f (Suc n) * z ^ n) * z = suminf (λn. f n * z ^ n) - f 0" by simp qed
lemma summable_partial_sum_bound: fixes f :: "nat ==> 'a :: banach" and e :: real assumes summable: "summable f" and e: "e > 0" obtains N where"∧m n. m ≥ N ==> norm (∑k=m..n. f k) < e" proof - from summable have"Cauchy (λn. ∑k by (simp add: Cauchy_convergent_iff summable_iff_convergent) from CauchyD [OF this e] obtain N where N: "∧m n. m ≥ N ==> n ≥ N ==> norm ((∑k∑k by blast have"norm (∑k=m..n. f k) < e"if m: "m ≥ N"for m n proof (cases "n ≥ m") case True with m have"norm ((∑k∑k by (intro N) simp_all alsofrom True have"(∑k∑k∑k=m..n. f k)" by (subst sum_diff [symmetric]) (simp_all add: sum.last_plus) finallyshow ?thesis . next case False with e show ?thesis by simp_all qed thenshow ?thesis by (rule that) qed
lemma powser_sums_if: "(λn. (if n = m then (1 :: 'a::{ring_1,topological_space}) else 0) * z^n) sums z^m" proof - have"(λn. (if n = m then 1 else 0) * z^n) = (λn. if n = m then z^n else 0)" by (intro ext) auto thenshow ?thesis by (simp add: sums_single) qed
lemma fixes f :: "nat ==> real" assumes"summable f" and"inj g" and pos: "∧x. 0 ≤ f x" shows summable_reindex: "summable (f ∘ g)" and suminf_reindex_mono: "suminf (f ∘ g) ≤ suminf f" and suminf_reindex: "(∧x. x ∉ range g ==> f x = 0) ==> suminf (f ∘ g) = suminf f" proof - from‹inj g›have [simp]: "∧A. inj_on g A" by (rule inj_on_subset) simp
have smaller: "∀n. (∑i∘ g) i) ≤ suminf f" proof fix n have"∀ n' ∈ (g ` {.. by (metis Max_ge finite_imageI finite_lessThan not_le not_less_eq) thenobtain m where n: "∧n'. n' < n ==> g n' < m" by blast
have"(∑i by (simp add: sum.reindex) alsohave"…≤ (∑i by (rule sum_mono2) (auto simp add: pos n[rule_format]) alsohave"…≤ suminf f" using‹summable f› by (rule sum_le_suminf) (simp_all add: pos) finallyshow"(∑i∘ g) i) ≤ suminf f" by simp qed
have"incseq (λn. ∑i∘ g) i)" by (rule incseq_SucI) (auto simp add: pos) thenobtain L where L: "(λ n. ∑i∘ g) i) <---- L" using smaller by(rule incseq_convergent) thenhave"(f ∘ g) sums L" by (simp add: sums_def) thenshow"summable (f ∘ g)" by (auto simp add: sums_iff)
from‹summable f›have"suminf f ≤ suminf (f ∘ g)" proof (rule suminf_le_const) fix n have"∀ n' ∈ (g -` {.. by(auto intro: Max_ge simp add: finite_vimageI less_Suc_eq_le) thenobtain m where n: "∧n'. g n' < n ==> n' < m" by blast have"(∑i∑i∈{..∩ range g. f i)" using f by(auto intro: sum.mono_neutral_cong_right) alsohave"… = (∑i∈g -` {..∘ g) i)" by (rule sum.reindex_cong[where l=g])(auto) alsohave"…≤ (∑i∘ g) i)" by (rule sum_mono2)(auto simp add: pos n) alsohave"…≤ suminf (f ∘ g)" using‹summable (f ∘ g)›by (rule sum_le_suminf) (simp_all add: pos) finallyshow"sum f {..≤ suminf (f ∘ g)" . qed with le show"suminf (f ∘ g) = suminf f" by (rule antisym) qed
lemma sums_mono_reindex: assumes subseq: "strict_mono g" and zero: "∧n. n ∉ range g ==> f n = 0" shows"(λn. f (g n)) sums c ⟷ f sums c" unfolding sums_def proof assume lim: "(λn. ∑k<---- c" have"(λn. ∑k∑k proof fix n :: nat from subseq have"(∑k∑k∈g`{.. by (subst sum.reindex) (auto intro: strict_mono_imp_inj_on) alsofrom subseq have"… = (∑k by (intro sum.mono_neutral_left ballI zero)
(auto simp: strict_mono_less strict_mono_less_eq) finallyshow"(∑k∑k . qed alsofrom LIMSEQ_subseq_LIMSEQ[OF lim subseq] have"…<---- c" by (simp only: o_def) finallyshow"(λn. ∑k<---- c" . next assume lim: "(λn. ∑k<---- c"
define g_inv where"g_inv n = (LEAST m. g m ≥ n)"for n from filterlim_subseq[OF subseq] have g_inv_ex: "∃m. g m ≥ n"for n by (auto simp: filterlim_at_top eventually_at_top_linorder) thenhave g_inv: "g (g_inv n) ≥ n"for n unfolding g_inv_def by (rule LeastI_ex) have g_inv_least: "m ≥ g_inv n"if"g m ≥ n"for m n using that unfolding g_inv_def by (rule Least_le) have g_inv_least': "g m < n"if"m < g_inv n"for m n using that g_inv_least[of n m] by linarith have"(λn. ∑k∑k proof fix n :: nat
{ fix k assume k: "k ∈ {.. have"k ∉ range g" proof (rule notI, elim imageE) fix l assume l: "k = g l" have"g l < g (g_inv n)" by (rule less_le_trans[OF _ g_inv]) (use k l in simp_all) with subseq have"l < g_inv n" by (simp add: strict_mono_less) with k l show False by simp qed thenhave"f k = 0" by (rule zero)
} with g_inv_least' g_inv have"(∑k∑k∈g`{.. by (intro sum.mono_neutral_right) auto alsofrom subseq have"… = (∑k using strict_mono_imp_inj_on by (subst sum.reindex) simp_all finallyshow"(∑k∑k . qed also { fix K n :: nat assume"g K ≤ n" alsohave"n ≤ g (g_inv n)" by (rule g_inv) finallyhave"K ≤ g_inv n" using subseq by (simp add: strict_mono_less_eq)
} thenhave"filterlim g_inv at_top sequentially" by (auto simp: filterlim_at_top eventually_at_top_linorder) with lim have"(λn. ∑k<---- c" by (rule filterlim_compose) finallyshow"(λn. ∑k<---- c" . qed
lemma summable_mono_reindex: assumes subseq: "strict_mono g" and zero: "∧n. n ∉ range g ==> f n = 0" shows"summable (λn. f (g n)) ⟷ summable f" using sums_mono_reindex[of g f, OF assms] by (simp add: summable_def)
lemma suminf_mono_reindex: fixes f :: "nat ==> 'a::{t2_space,comm_monoid_add}" assumes"strict_mono g""∧n. n ∉ range g ==> f n = 0" shows"suminf (λn. f (g n)) = suminf f" proof (cases "summable f") case True with sums_mono_reindex [of g f, OF assms] and summable_mono_reindex [of g f, OF assms] show ?thesis by (simp add: sums_iff) next case False thenhave"¬(∃c. f sums c)" unfolding summable_def by blast thenhave"suminf f = The (λ_. False)" by (simp add: suminf_def) moreoverfrom False have"¬ summable (λn. f (g n))" using summable_mono_reindex[of g f, OF assms] by simp thenhave"¬(∃c. (λn. f (g n)) sums c)" unfolding summable_def by blast thenhave"suminf (λn. f (g n)) = The (λ_. False)" by (simp add: suminf_def) ultimatelyshow ?thesis by simp qed
lemma summable_bounded_partials: fixes f :: "nat ==> 'a :: {real_normed_vector,complete_space}" assumes bound: "eventually (λx0. ∀a≥x0. ∀b>a. norm (sum f {a<..b}) ≤ g a) sequentially" assumes g: "g <---- 0" shows"summable f"unfolding summable_iff_convergent' proof (intro Cauchy_convergent CauchyI', goal_cases) case (1 ε) with g have"eventually (λx. ∣g x∣ < ε) sequentially" by (auto simp: tendsto_iff) from eventually_conj[OF this bound] obtain x0 where x0: "∧x. x ≥ x0 ==>∣g x∣ < ε""∧a b. x0 ≤ a ==> a < b ==> norm (sum f {a<..b}) ≤ g a" unfolding eventually_at_top_linorder by auto show ?case proof (intro exI[of _ x0] allI impI) fix m n assume mn: "x0 ≤ m""m < n" have"dist (sum f {..m}) (sum f {..n}) = norm (sum f {..n} - sum f {..m})" by (simp add: dist_norm norm_minus_commute) alsohave"sum f {..n} - sum f {..m} = sum f ({..n} - {..m})" using mn by (intro Groups_Big.sum_diff [symmetric]) auto alsohave"{..n} - {..m} = {m<..n}"using mn by auto alsohave"norm (sum f {m<..n}) ≤ g m"using mn by (intro x0) auto alsohave"…≤∣g m∣"by simp alsohave"… < ε"using mn by (intro x0) auto finallyshow"dist (sum f {..m}) (sum f {..n}) < ε" . qed qed
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.28 Sekunden
(vorverarbeitet am 2026-04-30)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.