Zulip Chat Archive

Stream: mathlib4

Topic: index shift in tsum


Matthias Liesenfeld (Aug 12 2025 at 20:36):

Hi there,
is there a lemma about shifting the index in a tsum? Something like
(n : ℕ) (f : ℕ → ℝ) : ∑' k, {k | k ≥ n}.indicator f k = ∑' k, f (k+n)
I wasnt able to find it using apply? and multiple ai tools.

Or is there even a more idomatic different way to express the shifted sum?

Ruben Van de Velde (Aug 12 2025 at 20:58):

Maybe with Set.Ici?

Jireh Loreaux (Aug 12 2025 at 22:08):

It's not quite immediate, but you should be able to get it from docs#Summable.sum_add_tsum_nat_add (start by rewriting backwards with that lemma). Then the finite sum of the indicator will be zero, and the remaining infinite sum of the indicator will simplify to f.

Jireh Loreaux (Aug 12 2025 at 22:15):

like so:

import Mathlib

example {f :   } (n : ) (h : Summable f) :
    ∑' k, {k | k  n}.indicator f k = ∑' k, f (k+n) := by
  rw [ (h.indicator {k | k  n}).sum_add_tsum_nat_add n,
    Finset.sum_eq_zero (by simp_all), zero_add]
  congr! 2 with k
  simp

Matthias Liesenfeld (Aug 13 2025 at 18:24):

Thank you! :)
I tried to prove it for {f : ℕ → ℝ≥0∞} but keep running in a timeout (in the proof of h2):

lemma aux2 {f :   0} (n : ) (h : Summable f) :
    ∑' k, {k | k  n}.indicator f k = ∑' k, f (k+n) := by
  let g :   0 := fun i => {i | i  n}.indicator f i
  have h1 : ∑' (k : ), {k | k  n}.indicator f k = ∑' (k : ), g k := by rfl
  rw [h1]
  have hg : Summable g := ENNReal.summable
  have h2 : ∑' (k : ), g k =  k  Finset.range n, g k + ∑' (k : ), g (k + n) := (hg.sum_add_tsum_nat_add n).symm
  rw [Finset.sum_eq_zero (by simp_all), zero_add]
  congr! 2 with k
  simp

Do you have any ideas?

Etienne Marion (Aug 13 2025 at 18:33):

That's because sum_add_tsum_nat_add wants a function whose codomain is a group, which ENNReal is not.

Etienne Marion (Aug 13 2025 at 18:35):

You should use Summable.sum_add_tsum_nat_add' instead.

Matthias Liesenfeld (Aug 13 2025 at 19:25):

Now its working :)

lemma aux3 {f :   0} (n : ) :
    ∑' k, {k | k  n}.indicator f k = ∑' k, f (k+n) := by
  have h : Summable (fun k  {m | m  n}.indicator f (k + n)) := by simp
  rw [ h.sum_add_tsum_nat_add', Finset.sum_eq_zero (by simp_all), zero_add]
  congr! 2 with k
  simp

Last updated: Dec 20 2025 at 21:32 UTC