A quadratic character sum over two independent linear forms
ProvedCharacterSums.legendre_sum_two_forms_boundCancellation in a quadratic character sum over two linear forms.
Let be an odd prime and let be the Legendre symbol on . Given two linear forms and whose coefficient determinant is non-zero,
the character sum over the full residue system is bounded by an absolute constant:
The trivial bound is , so this is total cancellation: the sum does not grow with the modulus at all. The non-degeneracy condition is exactly what prevents the two forms from being proportional; if they were, the product would be of a perfect square times a constant, hence essentially constant, and the sum would be of size .
This is the simplest non-trivial instance of the Weil bound for character sums, and unlike the general case it admits a completely elementary proof: after a change of variable the sum reduces to with , which evaluates to exactly by writing for and summing the non-trivial character over the shifted residues.
Sums of this shape are the workhorse of elementary estimates for the number of points on conics over finite fields, and of the second-moment computations behind the large sieve and Pólya–Vinogradov-type inequalities.
Formalization note. quadraticChar (ZMod p) is Mathlib's quadratic character, taking
values in , so the sum and the absolute value are integer-valued and the bound
is an inequality in .
import Mathlib
namespace CharacterSums
theorem legendre_sum_two_forms_bound {p : ℕ} [Fact p.Prime] (hp : p ≠ 2)
{a b c d : ZMod p} (h : a * d - b * c ≠ 0) :
|∑ t : ZMod p, quadraticChar (ZMod p) (a * t + b) * quadraticChar (ZMod p) (c * t + d)|
≤ 2 := by sorry
end CharacterSums