Documentation

CslibFrontier.Foundations.Analysis.SpecialFunctions.RpowAbsSum

Sums of powers of the distance to a real number #

For 0 < q ≤ 1 / 2 and a real x between the integers i₀ and i₀ + 1, the sum of q ^ |i - x| over the natural numbers i < N is two geometric sums, one on each side of x. It is therefore at most (1 + 2 q) (q ^ (x - i₀) + q ^ (i₀ + 1 - x)). This is the nearest-integer bound of OpenAI, §3.

Main results #

References #

theorem Real.sum_range_rpow_abs_sub_le {q x : ℝ} (hq : 0 < q) (hq' : q ≤ 1 / 2) (N : ℕ) {i₀ : ℕ} (h₀ : ↑i₀ ≤ x) (h₁ : x ≤ ↑i₀ + 1) :
∑ i ∈ Finset.range N, q ^ |↑i - x| ≤ (1 + 2 * q) * (q ^ (x - ↑i₀) + q ^ (↑i₀ + 1 - x))

The sum of q ^ |i - x| over i < N is at most 1 + 2 q times the sum of the two terms on either side of x.