AFTD Auto-Formalizing Theoretical Domains

energy_filter_step_sum_integral

theoremverified

For a finite set of integers, real weights w, and positive h, the integral of the sum of w(i) times the indicator of [i/h,(i+1)/h) equals the sum of the weights divided by h.

Statement

theorem energy_filter_step_sum_integral
    (s : Finset ℤ) (w : ℤ → ℝ) (h : ℝ) (hh : 0 < h) :
    (∫ x : ℝ, ∑ i ∈ s,
      (Set.Ico ((i:ℝ)/h) (((i:ℝ)+1)/h)).indicator (fun _ : ℝ => w i) x) =
      (∑ i ∈ s, w i) / h
Source
OP-892: centered binomial fourth-mass asymptotic via rescaled step functions and dominated convergence.
Verified
14 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 3

The proof, explained

The proof exchanges the integral and the finite sum, which is justified by showing that each indicator summand is integrable. It then evaluates each integral individually: since the interval $[i/h, (i+1)/h)$ has length $1/h$, integrating the constant weight $w(i)$ over it produces $w(i)/h$. Finally, distributing the division by $h$ across the sum matches the two sides term by term.

  1. For each integer $i$, the summand $x \mapsto \mathbf{1}_{[i/h, (i+1)/h)}(x) w(i)$ is integrable on $\mathbb{R}$.

    An indicator function of an integrable function on a measurable set is integrable on the whole space (`MeasureTheory.IntegrableOn.integrable_indicator`). The half-open interval $[i/h, (i+1)/h)$ is measurable (`measurableSet_Ico`), and any constant function is integrable on a set of finite measure (`MeasureTheory.integrableOn_const`), which applies here because bounded intervals have finite Lebesgue measure (`Real.volume_Ico`).

    lines 6–9

    uses MeasureTheory.IntegrableOn.integrable_indicator, measurableSet_Ico, MeasureTheory.integrableOn_const, Real.volume_Ico

      have hf (i : ℤ) : MeasureTheory.Integrable (fun x : ℝ =>
          (Set.Ico ((i:ℝ)/h) (((i:ℝ)+1)/h)).indicator (fun _ : ℝ => w i) x) := by
        apply MeasureTheory.IntegrableOn.integrable_indicator _ measurableSet_Ico
        exact MeasureTheory.integrableOn_const (by simp [Real.volume_Ico])
  2. The integral of the sum equals the sum of the integrals, and dividing by $h$ distributes across the sum.

    Because each summand is integrable, the integral and the finite sum can be interchanged (`MeasureTheory.integral_finsetSum`). On the right-hand side, dividing the sum by $h$ distributes across each summand (`Finset.sum_div`).

    line 10

    uses MeasureTheory.integral_finsetSum, Finset.sum_div

      rw [MeasureTheory.integral_finsetSum s (fun i hi => hf i), Finset.sum_div]
  3. It suffices to show that for each $i \in s$, the integral of the $i$-th term equals $w(i)/h$.

    By sum congruence (`Finset.sum_congr`), two finite sums over the same set agree if their summands agree for each index $i \in s$.

    lines 11–12

    uses Finset.sum_congr

      apply Finset.sum_congr rfl
      intro i hi
  4. The interval endpoints satisfy $i/h \le (i+1)/h$.

    Since $h > 0$, dividing by $h$ preserves the inequality $i \le i + 1$.

    line 13

      have hab : (i:ℝ)/h ≤ ((i:ℝ)+1)/h := by gcongr; linarith
  5. For each $i \in s$, the integral of the indicator term equals $w(i)/h$.

    The integral of the constant $w(i)$ over the measurable interval $[i/h, (i+1)/h)$ is the product of its Lebesgue measure and $w(i)$ (`MeasureTheory.integral_indicator_const`, `measurableSet_Ico`). Since $i/h \le (i+1)/h$, this measure is $((i+1)/h - i/h)$ (`Real.volume_real_Ico_of_le`). Replacing scalar multiplication with real multiplication (`smul_eq_mul`), clearing denominators (`field_simp`), and simplifying the polynomial expression (`ring`) reduces $((i+1)/h - i/h) \cdot w(i)$ to $w(i)/h$.

    lines 14–17

    uses MeasureTheory.integral_indicator_const, measurableSet_Ico, Real.volume_real_Ico_of_le, smul_eq_mul

      rw [MeasureTheory.integral_indicator_const _ measurableSet_Ico, Real.volume_real_Ico_of_le hab]
      simp only [smul_eq_mul]
      field_simp
      ring
MeasureTheory.IntegrableOn.integrable_indicator
If a function is integrable on a measurable set $s$, then its indicator function on $s$ is integrable on the whole space.
MeasureTheory.integral_indicator_const
The integral of a constant $c$ on a measurable set $s$ is the real measure of $s$ multiplied by $c$.
MeasureTheory.integrableOn_const
A constant function is integrable on any set of finite measure.
MeasureTheory.integral_finsetSum
The integral of a finite sum of integrable functions equals the sum of their integrals.
measurableSet_Ico
A half-open interval $[a, b)$ is a measurable set.
Real.volume_Ico
The Lebesgue measure of a half-open interval $[a, b)$ is $\max(b - a, 0)$ as an extended non-negative real.
Real.volume_real_Ico_of_le
If $a \le b$, the real-valued Lebesgue measure of $[a, b)$ is $b - a$.
Finset.sum_div
Dividing a finite sum by a scalar distributes across each term of the sum: $(\sum_{i \in s} f(i)) / a = \sum_{i \in s} (f(i) / a)$.
Finset.sum_congr
Two finite sums over the same index set are equal if their summands are equal at every index.
smul_eq_mul
Scalar multiplication of real numbers is standard real multiplication: $a \bullet b = a * b$.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem energy_filter_step_sum_integral    (s : Finset ℤ) (w : ℤ → ℝ) (h : ℝ) (hh : 0 < h) :    (∫ x : ℝ, ∑ i ∈ s,      (Set.Ico ((i:ℝ)/h) (((i:ℝ)+1)/h)).indicator (fun _ : ℝ => w i) x) =      (∑ i ∈ s, w i) / h := by  have hf (i : ℤ) : MeasureTheory.Integrable (fun x : ℝ =>      (Set.Ico ((i:ℝ)/h) (((i:ℝ)+1)/h)).indicator (fun _ : ℝ => w i) x) := by    apply MeasureTheory.IntegrableOn.integrable_indicator _ measurableSet_Ico    exact MeasureTheory.integrableOn_const (by simp [Real.volume_Ico])  rw [MeasureTheory.integral_finsetSum s (fun i hi => hf i), Finset.sum_div]  apply Finset.sum_congr rfl  intro i hi  have hab : (i:ℝ)/h ≤ ((i:ℝ)+1)/h := by gcongr; linarith  rw [MeasureTheory.integral_indicator_const _ measurableSet_Ico, Real.volume_real_Ico_of_le hab]  simp only [smul_eq_mul]  field_simp  ring
See it in the graphDiscuss this resultChallenge it