Affine coordinates for Weierstrass curves #
This file defines the type of points on a Weierstrass curve as an inductive, consisting of the point
at infinity and affine points satisfying a Weierstrass equation with a nonsingular condition. This
file also defines the negation and addition operations of the group law for this type, and proves
that they respect the Weierstrass equation and the nonsingular condition. The fact that they form an
abelian group is proven in Mathlib/AlgebraicGeometry/EllipticCurve/Group.lean
.
Mathematical background #
Let W
be a Weierstrass curve over a field F
with coefficients aᵢ
. An affine point
on W
is a tuple (x, y)
of elements in R
satisfying the Weierstrass equation W(X, Y) = 0
in
affine coordinates, where W(X, Y) := Y² + a₁XY + a₃Y - (X³ + a₂X² + a₄X + a₆)
. It is
nonsingular if its partial derivatives W_X(x, y)
and W_Y(x, y)
do not vanish simultaneously.
The nonsingular affine points on W
can be given negation and addition operations defined by a
secant-and-tangent process.
Given a nonsingular affine point
P
, its negation-P
is defined to be the unique third nonsingular point of intersection betweenW
and the vertical line throughP
. Explicitly, ifP
is(x, y)
, then-P
is(x, -y - a₁x - a₃)
.Given two nonsingular affine points
P
andQ
, their additionP + Q
is defined to be the negation of the unique third nonsingular point of intersection betweenW
and the lineL
throughP
andQ
. Explicitly, letP
be(x₁, y₁)
and letQ
be(x₂, y₂)
.- If
x₁ = x₂
andy₁ = -y₂ - a₁x₂ - a₃
, thenL
is vertical. - If
x₁ = x₂
andy₁ ≠ -y₂ - a₁x₂ - a₃
, thenL
is the tangent ofW
atP = Q
, and has slopeℓ := (3x₁² + 2a₂x₁ + a₄ - a₁y₁) / (2y₁ + a₁x₁ + a₃)
. - Otherwise
x₁ ≠ x₂
, thenL
is the secant ofW
throughP
andQ
, and has slopeℓ := (y₁ - y₂) / (x₁ - x₂)
.
In the last two cases, the
X
-coordinate ofP + Q
is then the unique third solution of the equation obtained by substituting the lineY = ℓ(X - x₁) + y₁
into the Weierstrass equation, and can be written down explicitly asx := ℓ² + a₁ℓ - a₂ - x₁ - x₂
by inspecting the coefficients ofX²
. TheY
-coordinate ofP + Q
, after applying the final negation that mapsY
to-Y - a₁X - a₃
, is preciselyy := -(ℓ(x - x₁) + y₁) - a₁x - a₃
.- If
The type of nonsingular points W⟮F⟯
in affine coordinates is an inductive, consisting of the
unique point at infinity 𝓞
and nonsingular affine points (x, y)
. Then W⟮F⟯
can be endowed with
a group law, with 𝓞
as the identity nonsingular point, which is uniquely determined by these
formulae.
Main definitions #
WeierstrassCurve.Affine.Equation
: the Weierstrass equation of an affine Weierstrass curve.WeierstrassCurve.Affine.Nonsingular
: the nonsingular condition on an affine Weierstrass curve.WeierstrassCurve.Affine.Point
: a nonsingular rational point on an affine Weierstrass curve.WeierstrassCurve.Affine.Point.neg
: the negation operation on an affine Weierstrass curve.WeierstrassCurve.Affine.Point.add
: the addition operation on an affine Weierstrass curve.
Main statements #
WeierstrassCurve.Affine.equation_neg
: negation preserves the Weierstrass equation.WeierstrassCurve.Affine.equation_add
: addition preserves the Weierstrass equation.WeierstrassCurve.Affine.nonsingular_neg
: negation preserves the nonsingular condition.WeierstrassCurve.Affine.nonsingular_add
: addition preserves the nonsingular condition.WeierstrassCurve.Affine.nonsingular_of_Δ_ne_zero
: an affine Weierstrass curve is nonsingular at every point if its discriminant is non-zero.WeierstrassCurve.Affine.nonsingular
: an affine elliptic curve is nonsingular at every point.
Notations #
W⟮K⟯
: the group of nonsingular rational points onW
base changed toK
.
References #
[J Silverman, The Arithmetic of Elliptic Curves][silverman2009]
Tags #
elliptic curve, rational point, affine coordinates
Weierstrass curves #
An abbreviation for a Weierstrass curve in affine coordinates.
Equations
Instances For
The conversion from a Weierstrass curve to affine coordinates.
Instances For
Weierstrass equations #
The polynomial W(X, Y) := Y² + a₁XY + a₃Y - (X³ + a₂X² + a₄X + a₆)
associated to a Weierstrass
curve W
over a ring R
in affine coordinates.
For ease of polynomial manipulation, this is represented as a term of type R[X][X]
, where the
inner variable represents X
and the outer variable represents Y
. For clarity, the alternative
notations Y
and R[X][Y]
are provided in the Polynomial.Bivariate
scope to represent the outer
variable and the bivariate polynomial ring R[X][X]
respectively.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The proposition that an affine point (x, y)
lies in a Weierstrass curve W
.
In other words, it satisfies the Weierstrass equation W(X, Y) = 0
.
Equations
- W'.Equation x y = (Polynomial.evalEval x y W'.polynomial = 0)
Instances For
Nonsingular Weierstrass equations #
The partial derivative W_X(X, Y)
with respect to X
of the polynomial W(X, Y)
associated to
a Weierstrass curve W
in affine coordinates.
Equations
- W'.polynomialX = Polynomial.C (Polynomial.C W'.a₁) * Polynomial.X - Polynomial.C (Polynomial.C 3 * Polynomial.X ^ 2 + Polynomial.C (2 * W'.a₂) * Polynomial.X + Polynomial.C W'.a₄)
Instances For
The partial derivative W_Y(X, Y)
with respect to Y
of the polynomial W(X, Y)
associated to
a Weierstrass curve W
in affine coordinates.
Equations
- W'.polynomialY = Polynomial.C (Polynomial.C 2) * Polynomial.X + Polynomial.C (Polynomial.C W'.a₁ * Polynomial.X + Polynomial.C W'.a₃)
Instances For
The proposition that an affine point (x, y)
on a Weierstrass curve W
is nonsingular.
In other words, either W_X(x, y) ≠ 0
or W_Y(x, y) ≠ 0
.
Note that this definition is only mathematically accurate for fields.
Equations
- W'.Nonsingular x y = (W'.Equation x y ∧ (Polynomial.evalEval x y W'.polynomialX ≠ 0 ∨ Polynomial.evalEval x y W'.polynomialY ≠ 0))
Instances For
A Weierstrass curve is nonsingular at every point if its discriminant is non-zero.
Group operation polynomials over a ring #
The negation polynomial -Y - a₁X - a₃
associated to the negation of a nonsingular affine point
on a Weierstrass curve.
Equations
- W'.negPolynomial = -Polynomial.X - Polynomial.C (Polynomial.C W'.a₁ * Polynomial.X + Polynomial.C W'.a₃)
Instances For
The line polynomial ℓ(X - x) + y
associated to the line Y = ℓ(X - x) + y
that passes through
a nonsingular affine point (x, y)
on a Weierstrass curve W
with a slope of ℓ
.
This does not depend on W
, and has argument order: x
, y
, ℓ
.
Equations
Instances For
The addition polynomial obtained by substituting the line Y = ℓ(X - x) + y
into the polynomial
W(X, Y)
associated to a Weierstrass curve W
. If such a line intersects W
at another
nonsingular affine point (x', y')
on W
, then the roots of this polynomial are precisely x
,
x'
, and the X
-coordinate of the addition of (x, y)
and (x', y')
.
This depends on W
, and has argument order: x
, y
, ℓ
.
Equations
- W'.addPolynomial x y ℓ = Polynomial.eval (WeierstrassCurve.Affine.linePolynomial x y ℓ) W'.polynomial
Instances For
The X
-coordinate of (x₁, y₁) + (x₂, y₂)
for two nonsingular affine points (x₁, y₁)
and
(x₂, y₂)
on a Weierstrass curve W
, where the line through them has a slope of ℓ
.
This depends on W
, and has argument order: x₁
, x₂
, ℓ
.
Instances For
The Y
-coordinate of -((x₁, y₁) + (x₂, y₂))
for two nonsingular affine points (x₁, y₁)
and
(x₂, y₂)
on a Weierstrass curve W
, where the line through them has a slope of ℓ
.
This depends on W
, and has argument order: x₁
, x₂
, y₁
, ℓ
.
Instances For
The Y
-coordinate of (x₁, y₁) + (x₂, y₂)
for two nonsingular affine points (x₁, y₁)
and
(x₂, y₂)
on a Weierstrass curve W
, where the line through them has a slope of ℓ
.
This depends on W
, and has argument order: x₁
, x₂
, y₁
, ℓ
.
Instances For
The negation of a nonsingular affine point in W
is nonsingular.
Group operation polynomials over a field #
The slope of the line through two nonsingular affine points (x₁, y₁)
and (x₂, y₂)
on a
Weierstrass curve W
.
If x₁ ≠ x₂
, then this line is the secant of W
through (x₁, y₁)
and (x₂, y₂)
, and has slope
(y₁ - y₂) / (x₁ - x₂)
. Otherwise, if y₁ ≠ -y₁ - a₁x₁ - a₃
, then this line is the tangent of W
at (x₁, y₁) = (x₂, y₂)
, and has slope (3x₁² + 2a₂x₁ + a₄ - a₁y₁) / (2y₁ + a₁x₁ + a₃)
. Otherwise,
this line is vertical, in which case this returns the value 0
.
This depends on W
, and has argument order: x₁
, x₂
, y₁
, y₂
.
Equations
Instances For
The negated addition of two nonsingular affine points in W
on a sloped line is nonsingular.
The addition of two nonsingular affine points in W
on a sloped line is nonsingular.
The formula x(P₁ + P₂) = x(P₁ - P₂) - ψ(P₁)ψ(P₂) / (x(P₂) - x(P₁))²
,
where ψ(x,y) = 2y + a₁x + a₃
.
The formula y(P₁)(x(P₂) - x(P₃)) + y(P₂)(x(P₃) - x(P₁)) + y(P₃)(x(P₁) - x(P₂)) = 0
,
assuming that P₁ + P₂ + P₃ = O
.
The formula ψ(P₁ + P₂) = (ψ(P₂)(x(P₁) - x(P₃)) - ψ(P₁)(x(P₂) - x(P₃))) / (x(P₂) - x(P₁))
,
where ψ(x,y) = 2y + a₁x + a₃
.
Nonsingular points #
A nonsingular point on a Weierstrass curve W
in affine coordinates. This is either the unique
point at infinity WeierstrassCurve.Affine.Point.zero
or a nonsingular affine point
WeierstrassCurve.Affine.Point.some (x, y)
satisfying the Weierstrass equation of W
.
- zero {R : Type r} [CommRing R] {W' : Affine R} : W'.Point
- some {R : Type r} [CommRing R] {W' : Affine R} {x y : R} (h : W'.Nonsingular x y) : W'.Point
Instances For
Pretty printer defined by notation3
command.
Equations
- One or more equations did not get rendered due to their size.
Instances For
For an algebraic extension S
of a ring R
, the type of nonsingular S
-points on a
Weierstrass curve W
over R
in affine coordinates.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Group operations #
Equations
Equations
The negation of a nonsingular point on a Weierstrass curve in affine coordinates.
Given a nonsingular point P
in affine coordinates, use -P
instead of neg P
.
Equations
Instances For
Equations
The addition of two nonsingular points on a Weierstrass curve in affine coordinates.
Given two nonsingular points P
and Q
in affine coordinates, use P + Q
instead of add P Q
.
Equations
- WeierstrassCurve.Affine.Point.zero.add x✝ = x✝
- x✝.add WeierstrassCurve.Affine.Point.zero = x✝
- (WeierstrassCurve.Affine.Point.some h₁).add (WeierstrassCurve.Affine.Point.some h₂) = if hxy : x₁ = x₂ ∧ y₁ = W.negY x₂ y₂ then 0 else WeierstrassCurve.Affine.Point.some ⋯
Instances For
Equations
Alias of WeierstrassCurve.Affine.Point.add_some
.
Maps across ring homomorphisms #
Base changes across algebra homomorphisms #
The function from W⟮F⟯
to W⟮K⟯
induced by an algebra homomorphism f : F →ₐ[S] K
,
where W
is defined over a subring of a ring S
, and F
and K
are field extensions of S
.
Equations
Instances For
The group homomorphism from W⟮F⟯
to W⟮K⟯
induced by an algebra homomorphism f : F →ₐ[S] K
,
where W
is defined over a subring of a ring S
, and F
and K
are field extensions of S
.
Equations
- WeierstrassCurve.Affine.Point.map f = { toFun := WeierstrassCurve.Affine.Point.mapFun f, map_zero' := ⋯, map_add' := ⋯ }
Instances For
The group homomorphism from W⟮F⟯
to W⟮K⟯
induced by the base change from F
to K
, where
W
is defined over a subring of a ring S
, and F
and K
are field extensions of S
.