Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Quadratic twist: #E(Fp)+#Ed(Fp)=2p+2\#E(\mathbb{F}_p)+\#E^d(\mathbb{F}_p)=2p+2#E(Fp​)+#Ed(Fp​)=2p+2

Proved
PrescribedPointCount.natCard_point_add_natCard_point_quadraticTwist_eq

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

elliptic-curvesfinite-fieldsnumber-theory

Let ppp be an odd prime, let a,b∈Fpa,b\in\mathbb{F}_pa,b∈Fp​ be such that the short Weierstrass curve E:y2=x3+ax+bE:y^2=x^3+ax+bE:y2=x3+ax+b is nonsingular, and let d∈Fpd\in\mathbb{F}_pd∈Fp​ be a quadratic nonresidue (in particular d≠0d\neq 0d=0). The quadratic twist of EEE by ddd, the curve Ed:y2=x3+d2ax+d3bE^d:y^2=x^3+d^2ax+d^3bEd:y2=x3+d2ax+d3b, then satisfies

#E(Fp)+#Ed(Fp)=2p+2.\#E(\mathbb{F}_p)+\#E^d(\mathbb{F}_p)=2p+2.#E(Fp​)+#Ed(Fp​)=2p+2.

Equivalently, the Frobenius traces satisfy tEd=−tEt_{E^d}=-t_EtEd​=−tE​, where tE=p+1−#E(Fp)t_E=p+1-\#E(\mathbb{F}_p)tE​=p+1−#E(Fp​). This identity is the sign-correction step of the complex multiplication method: a construction that produces a curve of trace −t-t−t is converted into one of trace ttt by twisting, and it reduces existence questions for prescribed traces to one sign at a time.

Formalization Note. Both curves are built with WeierstrassCurve.mk 0 0 0 · ·, i.e. a1=a2=a3=0a_1=a_2=a_3=0a1​=a2​=a3​=0. Nonsingularity of the twist is not assumed: it follows from Δ(Ed)=d6 Δ(E)\Delta(E^d)=d^6\,\Delta(E)Δ(Ed)=d6Δ(E). The hypothesis ¬ IsSquare d already excludes d=0d=0d=0, since 000 is a square. Point counts are Nat.card ·.toAffine.Point, affine rational points plus the point at infinity.

Preamble
import Mathlib
Formal statement
namespace PrescribedPointCount

theorem natCard_point_add_natCard_point_quadraticTwist_eq (p : ℕ) [Fact p.Prime] (hp : p ≠ 2)
    (a b d : ZMod p) (hd : ¬ IsSquare d)
    (hE : (WeierstrassCurve.mk 0 0 0 a b).IsElliptic) :
    Nat.card (WeierstrassCurve.mk 0 0 0 a b).toAffine.Point +
        Nat.card (WeierstrassCurve.mk 0 0 0 (d ^ 2 * a) (d ^ 3 * b)).toAffine.Point =
      2 * (p + 1) := by sorry

end PrescribedPointCount
Source
Wikipedia, 'Twists of elliptic curves', § Quadratic twist over finite fields, https://en.wikipedia.org/wiki/Twists_of_elliptic_curves#Quadratic_twist_over_finite_fields (statement |E(K)|+|E^d(K)|=2q+2, twist y^2=x^3+d a_2 x^2+d^2 a_4 x+d^3 a_6); textbook treatment: S. Galbraith, Mathematics of Public Key Cryptography, Cambridge University Press, 2012, Chapter 9, https://www.math.auckland.ac.nz/~sgal018/crypto-book/ch9.pdf
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