Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Hasse's bound on #E(Fp)\#E(\mathbb{F}_p)#E(Fp​) (foundation of ECM)

Open
PolyTimeFactorization.hasse_bound

by LG · Nov 16, 2026 · Mathlib 0df444a (Lean v4.33.1)

elliptic-curvesfactorizationnumber-theory

Hasse's theorem (the Hasse bound). Let ppp be prime and let WWW be a Weierstrass curve

Y2+a1XY+a3Y=X3+a2X2+a4X+a6Y^2+a_1XY+a_3Y=X^3+a_2X^2+a_4X+a_6Y2+a1​XY+a3​Y=X3+a2​X2+a4​X+a6​

over Fp\mathbb{F}_pFp​ with nonzero discriminant Δ\DeltaΔ (equivalently, nonsingular, hence an elliptic curve). Let NNN be the number of Fp\mathbb{F}_pFp​-rational points of the curve: the number of affine solutions (x,y)∈Fp2(x,y)\in\mathbb{F}_p^2(x,y)∈Fp2​ of the Weierstrass equation, plus the single point at infinity. Then

∣N−(p+1)∣≤2p.|N-(p+1)|\le 2\sqrt{p}.∣N−(p+1)∣≤2p​.

This bound is the theoretical foundation of Lenstra's elliptic curve method: it places the group order #E(Fp)\#E(\mathbb{F}_p)#E(Fp​) in the interval [p+1−2p, p+1+2p][p+1-2\sqrt{p},\,p+1+2\sqrt{p}][p+1−2p​,p+1+2p​], which is what makes ECM's smoothness heuristic plausible. It is a deep theorem — equivalent to the Riemann hypothesis for the curve's function field — and is not yet formalized in Mathlib.

Formalization Note. The curve is Mathlib's WeierstrassCurve (ZMod p); the affine solution set is counted with Nat.card over the subtype satisfying WeierstrassCurve.Affine.Equation, and the point at infinity contributes the explicit +1+1+1.

Preamble
import Mathlib
Formal statement
namespace PolyTimeFactorization

theorem hasse_bound (p : ℕ) [Fact p.Prime] (W : WeierstrassCurve (ZMod p)) (hW : W.Δ ≠ 0) :
    |((Nat.card {xy : ZMod p × ZMod p // WeierstrassCurve.Affine.Equation W xy.1 xy.2} : ℝ) + 1)
        - ((p : ℝ) + 1)| ≤ 2 * Real.sqrt (p : ℝ) := by sorry

end PolyTimeFactorization
Source
H. Hasse (1933-1936); standard reference: J. H. Silverman, The Arithmetic of Elliptic Curves, 2nd ed., Springer GTM 106 (2009), Theorem V.1.1, https://doi.org/10.1007/978-1-4757-1920-8 ; ECM application: H. W. Lenstra Jr., Factoring integers with elliptic curves, Ann. of Math. 126 (1987), 649-673, https://doi.org/10.2307/1971363
Human review
  • Endorsed by Shuze Chen · Nov 16, 2026

    Confirmed by the moderator at approval.

  • Endorsed by LG · Nov 16, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me