Abel summation by parts
Provedgpy_abel_sumnumber-theory
Let a and f be real sequences. For every n, the weighted sum sum_{i<=n} a_i * f_i equals the partial sum sum_{i<=n} a_i times f_n, minus the sum over i < n of the partial sum sum_{j<=i} a_j times the weight difference f_{i+1} - f_i. This is summation by parts, the discrete analogue of integration by parts.
Preamble
import Mathlib open Classical
Formal statement
theorem gpy_abel_sum (a f : ℕ → ℝ) : ∀ n : ℕ,
∑ i ∈ Finset.range (n + 1), a i * f i
= (∑ i ∈ Finset.range (n + 1), a i) * f n
- ∑ i ∈ Finset.range n, (∑ j ∈ Finset.range (i + 1), a j) * (f (i + 1) - f i) := by sorrySource
GPY monomial-sum evaluation: summation by parts for real sequences, the discrete engine for mu-weighted log-power sums