The Polya-Vinogradov inequality for primitive Dirichlet characters
ProvedCharacterSums.polya_vinogradovThe Pólya–Vinogradov inequality bounds the partial sums of a primitive Dirichlet character, uniformly in the length of the sum.
Here is a primitive Dirichlet character modulo , taking values in , and is an arbitrary nonnegative integer. The essential point is that the bound does not depend on : although the sum has terms each of modulus , the cancellation among the character values keeps every partial sum below , which is regardless of how long the range is.
The inequality is one of the basic tools of analytic number theory. It gives the classical bound on the least quadratic non-residue, underlies character-sum estimates in the circle method, and is the standard input wherever a character sum over an interval must be controlled. The proof is the classical one: expand each character value by Gauss-sum inversion, exchange the order of summation, and estimate the resulting geometric sums against the distance to the nearest integer.
Formalization note. The statement is written against Mathlib's DirichletCharacter, with
χ.IsPrimitive the primitivity hypothesis and the sum taken over Finset.range t with the argument
cast into ZMod f. No auxiliary definitions are required beyond Mathlib.
import Mathlib
namespace CharacterSums
/-- The Pólya–Vinogradov inequality: for a primitive Dirichlet character `χ` modulo `f ≥ 2`,
the partial character sums are bounded uniformly in the length `t`. -/
theorem polya_vinogradov {f : ℕ} [NeZero f] (χ : DirichletCharacter ℂ f)
(hχ : χ.IsPrimitive) (hf : 2 ≤ f) (t : ℕ) :
‖∑ m ∈ Finset.range t, χ (m : ZMod f)‖ ≤ Real.sqrt f * (1 + Real.log f) := by
sorry
end CharacterSums