Montgomery curve as a Weierstrass curve (Option B) #
The Montgomery equation y² = x³ + A x² + x (with B = 1) is literally
a Weierstrass equation with a₁ = 0, a₂ = A, a₃ = 0, a₄ = 1, a₆ = 0.
We instantiate Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass
directly and reuse its proved AddCommGroup structure on affine points.
This closes the full MontyCurveGroup specification without needing a
separate Montgomery-form group-law port:
- Definition
montgomeryW A : WeierstrassCurve F— trivial - Group instance
(montgomeryW A).toAffine.Point— free from Mathlib - xProjW — projective x-coordinate map (zero ↦ (1, 0); affine (x, _) ↦ (x, 1))
xdbl_spec_W— x-only doubling formula matchesP + P's x-coord, covering the point at infinity, 2-torsion, and generic casesxdadd_spec_W— x-only differential addition matchesP + Q's x-coord, coveringP = 0,Q = 0,P = ±Q, and generic cases (xp ≠ xq)montgomeryW_MontyCurveGroup— packages the above into aMontyCurveGroupinstance, modulo the hypotheses2 ≠ 0and4 · a24 = A + 2.
The proof reduces everything to two polynomial identities over the
base field (xdbl_affine_numerator_identity and xdadd_affine_identity),
both of which are provable by linear_combination using only the two
curve equations for P, Q.
References #
- Costello, Smith, "Montgomery curves and the Montgomery ladder", IACR eprint 2017/212, §4.
- Mathlib,
AlgebraicGeometry/EllipticCurve/Affine/Formula.lean.
Montgomery curve as a Weierstrass curve #
The Montgomery equation y² = x³ + A x² + x expressed as a
Weierstrass curve with (a₁, a₂, a₃, a₄, a₆) = (0, A, 0, 1, 0).
Equations
- CatCrypt.Crypto.ECC.montgomeryW A = { a₁ := 0, a₂ := A, a₃ := 0, a₄ := 1, a₆ := 0 }
Instances For
Affine-doubling x-coordinate matches xdbl ratio #
The affine slope for doubling a Montgomery point:
ℓ = (3x² + 2Ax + 1) / (2y). This is Mathlib's slope specialised to
the doubling case (x₁ = x₂, y₁ = y₂) on montgomeryW A.
Instances For
The x-coordinate of 2P via the affine formula, specialised to
montgomeryW A. Mathlib's addX x x ℓ = ℓ² + a₁·ℓ − a₂ − 2x, which
for Montgomery (a₁=0, a₂=A) reduces to ℓ² − A − 2x.
Instances For
Core identity — affine doubling x-coord matches xdbl's ratio.
Given a point (x, y) on Montgomery y² = x³ + A x² + x with y ≠ 0
(not a 2-torsion point), and 4 · a24 = A + 2, the affine-formula
x-coordinate of 2 · (x, y) equals the projective ratio X' / Z' of
xdbl a24 (x, 1), expressed as X' = montyDoublingX · Z'.
Projective x-coordinate map and MontyCurveGroup specs #
Projective x-coordinate of a Weierstrass affine point on the Montgomery
curve. The point at infinity projects to (1, 0) (representing the
"point at infinity" in the projective line); a finite affine point
(x, y) projects to (x, 1).
Equations
Instances For
The Mathlib negY for Montgomery is -y (since a₁ = a₃ = 0).
The Mathlib doubling slope on Montgomery is (3x² + 2Ax + 1) / (2y).
The Mathlib addX on doubling reduces to montyDoublingX.
xdbl_spec on (montgomeryW A).toAffine.Point. The x-only doubling
formula xdbl computes the projective x-coordinate of P + P for any
point P on the Montgomery curve as a Weierstrass curve.
xdadd correspondence #
Core polynomial identity for differential addition (Costello–Smith §4).
Given two points (xp, yp) and (xq, yq) on the Montgomery curve
y² = x³ + A x² + x, the product of the affine "plus" and "minus"
x-numerators equals (xp · xq − 1)² · (xq − xp)². Proof is purely
polynomial, using only the two curve equations.
Differential-addition x-coordinate identity. Combines the two
affine secant x-coordinates (for P+Q and P-Q) into the product
form (xp · xq − 1)². This is the form needed by xdadd_spec_W.
Mathlib's secant slope specialised to Montgomery with x₁ ≠ x₂.
xdadd_spec on (montgomeryW A).toAffine.Point. The x-only
differential-addition formula xdadd computes the projective
x-coordinate of P + Q, given the difference P - Q. Covers
all cases including P = 0, Q = 0, P = ±Q, and generic.
MontyCurveGroup instance for WeierstrassCurve.Affine.Point #
Main packaging. The Weierstrass-curve group on (montgomeryW A).toAffine.Point,
together with the x-coordinate map xProjW A, satisfies the
MontyCurveGroup specification for the Montgomery x-only formulas.
Hypotheses are h2 : (2 : F) ≠ 0 (excludes char-2 fields, where Montgomery
form is degenerate) and h24 : 4 * a24 = A + 2 (definition of a24).
Equations
- CatCrypt.Crypto.ECC.montgomeryW_MontyCurveGroup h2 A a24 h24 = { xProj := CatCrypt.Crypto.ECC.xProjW A, xdbl_spec := ⋯, xdadd_spec := ⋯ }