Range reindexing for finite sums #
Generic identities for sums indexed by Finset.range and Finset.Ioo. These are used by
coderivation/Taylor expansions, which reindex a cut-and-collapse double sum over a triangle to a
square and enlarge a vanishing-off-the-block range, and by divided-power exponential calculations,
which reindex a sum over antidiagonals to a rectangle.
Main results #
sum_Ioo_eq_sum_range: a sum overIoo 0 nequals the sum overrange nwhen the summand at0vanishes.sum_range_triangle: summing over pairs(c, p - c)withc ≤ p < Kequals the squarerange K × range Kwhen the family vanishes off the triangle.sum_range_add_antidiagonal_of_support: a sum over antidiagonals belowk + lequals the rectanglerange k × range lwhen the summand vanishes outside that rectangle.sum_sum_range_eq_of_eq_zero_right: enlarging both ranges of a double sum that vanishes outside a rectangle.sum_range_eq_of_eq_zero_off_pairandsum_range_eq_of_eq_zero_off_triple: convenient specializations to supports of size two and three.sum_range_add_add: splitting arange nsum into a prefix, a block, and a suffix.sum_range_min_add_two: the two-step recurrence satisfied by the sums∑_{i ≤ min j r} c^i a (j + r − 2i).sum_range_min_zero: the base casej = 0of that recurrence, which itsj + 1cannot state.two_mul_sum_range_pair: twice the sum of the products over the pairsi < j < kis the square of the sum minus the sum of the squares.
Replacing a summation over Finset.Ioo 0 n by one over Finset.range n, provided the
summand at 0 vanishes.
Summing a two-variable family over the pairs (c, p - c) with c ≤ p < K is the same as
summing it over the square range K × range K, when the family vanishes off the triangle.
A sum over all antidiagonals below k + l equals the sum over the rectangle
range k × range l, provided the summand vanishes whenever the first coordinate is at least
k or the second coordinate is at least l.
Enlarging both ranges of a double sum that vanishes for b ≤ p or b < d.
A sum over Finset.range t whose terms vanish outside two distinct positions is the sum of
the terms at those positions.
A sum over Finset.range t whose terms vanish outside three pairwise distinct positions is
the sum of the terms at those positions.
Splitting a sum over range n into a prefix of length p, a block of length d, and the
remaining suffix.
The two-step recurrence of the sums ∑_{i ≤ min j r} c^i a (j + r − 2i) #
A two-step recurrence for the sums S j r = ∑_{i ≤ min j r} c^i a (j + r − 2i):
S (j+2) (r+1) + c · S j (r+1) = S (j+1) (r+2) + c · S (j+1) r.
This is the identity the Fourier coefficients of the Hecke operators at a prime power satisfy
(TauCeti/NumberTheory/ModularForms/HeckeSlash/Nebentypus/Prime/Power.lean), with a t the
coefficient at p^t m and c = χ(p) p^{k−1}; the min is what makes it hold with no relation
between j and r.
The base case of the two-step recurrence, at j = 0. S 0 (r+2) + c · S 0 r = S 1 (r+1)
for S j r = ∑_{i ≤ min j r} c^i a (j + r − 2i).
sum_range_min_add_two states the recurrence only from j + 1 upwards — its second index is
j + 1, never 0 — so the degenerate case where the min pins two of the sums to a single term
is stated separately here. Together the two cover every j.
Twice the sum over pairs i < j < k is the square of the sum minus the sum of squares.