The Weil bound for hyperelliptic curves via Stepanov's method
ProvedWeilStepanov.weil_stepanovThe Weil bound for hyperelliptic curves, by Stepanov's elementary method.
Let be a finite field with odd, and let be a polynomial of degree with which is not a square in . Write
for the number of affine points on the hyperelliptic curve . Then deviates from the trivial main term by at most ; explicitly, whenever ,
Fibring over and counting solutions of with the quadratic character (a point contributes solutions) turns the estimate into a character sum bound, , so the theorem is equivalently the statement that this character sum exhibits square-root cancellation.
This is the special case of the Hasse–Weil bound that Stepanov proved by an elementary argument, avoiding the Riemann hypothesis for curves over finite fields and the machinery of algebraic geometry. The method constructs an auxiliary polynomial vanishing to high order at the points of interest, and bounds the number of such points by a degree count. The squarefree hypothesis is essential: if were a square then would be constant and no cancellation could occur.
Formalization note. The point count is written directly as
Nat.card {p : F × F // p.2 ^ 2 = f.eval p.1}, the non-squareness hypothesis is stated over
AlgebraicClosure F, and is Lean's Nat.sqrt.
import Mathlib
namespace WeilStepanov
open Polynomial in
theorem weil_stepanov {F : Type*} [Field F] [Fintype F] (f : Polynomial F)
(hqodd : Odd (Fintype.card F)) (hm : 1 ≤ f.natDegree) (hf0 : f.coeff 0 ≠ 0)
(hns : ¬ ∃ g : (AlgebraicClosure F)[X],
f.map (algebraMap F (AlgebraicClosure F)) = g ^ 2)
(hq : 16 * f.natDegree ^ 2 ≤ Fintype.card F) :
|(Nat.card {p : F × F // p.2 ^ 2 = f.eval p.1} : ℤ) - Fintype.card F|
≤ 8 * f.natDegree * (Nat.sqrt (Fintype.card F) + 1) := by sorry
end WeilStepanov