Zulip Chat Archive
Stream: Is there code for X?
Topic: error term for summable alternating series?
Kim Morrison (Sep 04 2025 at 09:51):
import Mathlib
open Filter Finset Topology
example (f : β β β) (hfa : Antitone f) (hfs : Summable f)
(hf0 : Tendsto f atTop (π 0)) (n : β) :
|(β' i : β, (-1) ^ i * f i) - (β i β range n, (-1) ^ i * f i)| β€ f n :=
sorry
SΓ©bastien GouΓ«zel (Sep 04 2025 at 09:56):
We have docs#Antitone.alternating_series_le_tendsto and docs#Antitone.tendsto_le_alternating_series which should imply your estimate, separating even and odd cases.
Kim Morrison (Sep 04 2025 at 11:38):
namespace Summable
open Filter Finset
open Topology
theorem alternating {f : β β β} (hf : Summable f) :
Summable (fun n => (-1) ^ n * f n) :=
Summable.of_abs (by simpa [summable_abs_iff])
theorem tendsto_alternating_series_tsum {f : β β β} (hfs : Summable f) :
Tendsto (fun n => (β i β range n, (-1) ^ i * f i)) atTop (π (β' i : β, (-1) ^ i * f i)) :=
Summable.tendsto_sum_tsum_nat hfs.alternating
theorem alternating_series_error_bound
(f : β β β) (hfa : Antitone f) (hfs : Summable f) (n : β) :
|(β' i : β, (-1) ^ i * f i) - (β i β range n, (-1) ^ i * f i)| β€ f n := by
obtain h := hfs.tendsto_alternating_series_tsum
have upper := hfa.alternating_series_le_tendsto h
have lower := hfa.tendsto_le_alternating_series h
obtain (h | h) := even_or_odd n
Β· obtain β¨n, rflβ© := even_iff_exists_two_mul.mp h
specialize upper n
specialize lower n
simp [Finset.sum_range_succ] at lower
rw [abs_sub_le_iff]
constructor <;> linarith
Β· obtain β¨n, rflβ© := odd_iff_exists_bit1.mp h
specialize upper (n + 1)
specialize lower n
rw [Nat.mul_add, Finset.sum_range_succ,
show (-1 : β) ^ (2 * n + 1) = -1 by simp [pow_add]] at upper
rw [abs_sub_le_iff]
constructor <;> linarith
end Summable
seems to serve my purpose, thank you.
Kim Morrison (Sep 12 2025 at 05:20):
Jeremy Tan (Sep 12 2025 at 05:54):
Kim Morrison said:
I did some work in that direction in #10120; cf.
Jeremy Tan (Sep 12 2025 at 05:54):
docs#Monotone.tendsto_le_alternating_series
Jeremy Tan (Sep 12 2025 at 05:55):
wait⦠you used my lemmas?
Kim Morrison (Sep 12 2025 at 06:30):
That's why they call them lemmas. :-)
Last updated: Dec 20 2025 at 21:32 UTC