Nonsingular rational points on Weierstrass curves #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines the type of nonsingular rational points on a Weierstrass curve over a field and proves that it forms an abelian group under a geometric secant-and-tangent process.
Mathematical background #
Let W
be a Weierstrass curve over a field F
. A rational point on W
is simply a point
$[X:Y:Z]$ defined over F
in the projective plane satisfying the homogeneous cubic equation
$Y^2Z + a_1XYZ + a_3YZ^2 = X^3 + a_2X^2Z + a_4XZ^2 + a_6Z^3$. Any such point either lies in the
affine chart $Z \ne 0$ and satisfies the Weierstrass equation obtained by replacing $X/Z$ with $X$
and $Y/Z$ with $Y$, or is the unique point at infinity $0 := [0:1:0]$ when $Z = 0$. With this new
description, a nonsingular rational point on W
is either $0$ or an affine point $(x, y)$ where
the partial derivatives $W_X(X, Y)$ and $W_Y(X, Y)$ do not vanish simultaneously. For a field
extension K
of F
, a K
-rational point is simply a rational point on W
base changed to K
.
The set of nonsingular rational points forms an abelian group under a secant-and-tangent process.
- The identity rational point is
0
. - Given a nonsingular rational point
P
, its negation-P
is defined to be the unique third point of intersection betweenW
and the line through0
andP
. Explicitly, ifP
is $(x, y)$, then-P
is $(x, -y - a_1x - a_3)$. - Given two points
P
andQ
, their additionP + Q
is defined to be the negation of the unique third point of intersection betweenW
and the lineL
throughP
andQ
. Explicitly, letP
be $(x_1, y_1)$ and letQ
be $(x_2, y_2)$.- If $x_1 = x_2$ and $y_1 = -y_2 - a_1x_2 - a_3$, then
L
is vertical andP + Q
is0
. - If $x_1 = x_2$ and $y_1 \ne -y_2 - a_1x_2 - a_3$, then
L
is the tangent ofW
atP = Q
, and has slope $\ell := (3x_1^2 + 2a_2x_1 + a_4 - a_1y_1) / (2y_1 + a_1x_1 + a_3)$. - Otherwise $x_1 \ne x_2$, then
L
is the secant ofW
throughP
andQ
, and has slope $\ell := (y_1 - y_2) / (x_1 - x_2)$. In the latter two cases, the $X$-coordinate ofP + Q
is then the unique third solution of the equation obtained by substituting the line $Y = \ell(X - x_1) + y_1$ into the Weierstrass equation, and can be written down explicitly as $x := \ell^2 + a_1\ell - a_2 - x_1 - x_2$ by inspecting the $X^2$ terms. The $Y$-coordinate ofP + Q
, after applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is precisely $y := -(\ell(x - x_1) + y_1) - a_1x - a_3$. The group law on this set is then uniquely determined by these constructions.
- If $x_1 = x_2$ and $y_1 = -y_2 - a_1x_2 - a_3$, then
Main definitions #
weierstrass_curve.point
: the type of nonsingular rational points on a Weierstrass curveW
.weierstrass_curve.point.add
: the addition of two nonsingular rational points onW
.
Main statements #
weierstrass_curve.point.add_comm_group
: the type of nonsingular rational points onW
forms an abelian group under addition.
Notations #
W⟮K⟯
: the group of nonsingular rational points onW
base changed toK
.
References #
J Silverman, The Arithmetic of Elliptic Curves
Tags #
elliptic curve, rational point, group law
Polynomials associated to nonsingular rational points on a Weierstrass curve #
The polynomial $-Y - a_1X - a_3$ associated to negation.
Equations
The polynomial $L(X - x_1) + y_1$ associated to the line $Y = L(X - x_1) + y_1$, with a slope of $L$ that passes through an affine point $(x_1, y_1)$.
This does not depend on W
, and has argument order: $x_1$, $y_1$, $L$.
Equations
- weierstrass_curve.line_polynomial x₁ y₁ L = ⇑polynomial.C L * (polynomial.X - ⇑polynomial.C x₁) + ⇑polynomial.C y₁
The polynomial obtained by substituting the line $Y = L*(X - x_1) + y_1$, with a slope of $L$
that passes through an affine point $(x_1, y_1)$, into the polynomial $W(X, Y)$ associated to W
.
If such a line intersects W
at another point $(x_2, y_2)$, then the roots of this polynomial are
precisely $x_1$, $x_2$, and the $X$-coordinate of the addition of $(x_1, y_1)$ and $(x_2, y_2)$.
This depends on W
, and has argument order: $x_1$, $y_1$, $L$.
Equations
- W.add_polynomial x₁ y₁ L = polynomial.eval (weierstrass_curve.line_polynomial x₁ y₁ L) W.polynomial
The $X$-coordinate of the addition of two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in W
,
where the line through them is not vertical and has a slope of $L$.
This depends on W
, and has argument order: $x_1$, $x_2$, $L$.
The $Y$-coordinate, before applying the final negation, of the addition of two affine points $(x_1, y_1)$ and $(x_2, y_2)$, where the line through them is not vertical and has a slope of $L$.
This depends on W
, and has argument order: $x_1$, $x_2$, $y_1$, $L$.
The $Y$-coordinate of the addition of two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in W
,
where the line through them is not vertical and has a slope of $L$.
This depends on W
, and has argument order: $x_1$, $x_2$, $y_1$, $L$.
The type of nonsingular rational points on a Weierstrass curve #
- zero : Π {R : Type u} [_inst_1 : comm_ring R] {W : weierstrass_curve R}, W.point
- some : Π {R : Type u} [_inst_1 : comm_ring R] {W : weierstrass_curve R} {x y : R}, W.nonsingular x y → W.point
A nonsingular rational point on a Weierstrass curve W
over R
. This is either the point at
infinity weierstrass_curve.point.zero
or an affine point weierstrass_curve.point.some
$(x, y)$
satisfying the equation $y^2 + a_1xy + a_3y = x^3 + a_2x^2 + a_4x + a_6$ of W
. For an algebraic
extension S
of R
, the type of nonsingular S
-rational points on W
is denoted W⟮S⟯
.
Instances for weierstrass_curve.point
Equations
Equations
The negation of an affine point in W
lies in W
.
The negation of a nonsingular affine point in W
is nonsingular.
The negation of a nonsingular rational point.
Given a nonsingular rational point P
, use -P
instead of neg P
.
Equations
Equations
Equations
Slopes of lines through nonsingular rational points on a Weierstrass curve #
The slope of the line through two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in W
.
If $x_1 \ne x_2$, then this line is the secant of W
through $(x_1, y_1)$ and $(x_2, y_2)$,
and has slope $(y_1 - y_2) / (x_1 - x_2)$. Otherwise, if $y_1 \ne -y_1 - a_1x_1 - a_3$,
then this line is the tangent of W
at $(x_1, y_1) = (x_2, y_2)$, and has slope
$(3x_1^2 + 2a_2x_1 + a_4 - a_1y_1) / (2y_1 + a_1x_1 + a_3)$. Otherwise, this line is vertical,
and has undefined slope, in which case this function returns the value 0.
This depends on W
, and has argument order: $x_1$, $x_2$, $y_1$, $y_2$.
The addition law on nonsingular rational points on a Weierstrass curve #
The addition of two affine points in W
on a sloped line,
before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in W
.
The addition of two affine points in W
on a sloped line lies in W
.
The addition of two nonsingular affine points in W
on a sloped line,
before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular.
The addition of two nonsingular affine points in W
on a sloped line is nonsingular.
The addition of two nonsingular rational points.
Given two nonsingular rational points P
and Q
, use P + Q
instead of add P Q
.
Equations
- (weierstrass_curve.point.some h₁).add (weierstrass_curve.point.some h₂) = dite (x₁ = x₂) (λ (hx : x₁ = x₂), dite (y₁ = W.neg_Y x₂ y₂) (λ (hy : y₁ = W.neg_Y x₂ y₂), 0) (λ (hy : ¬y₁ = W.neg_Y x₂ y₂), weierstrass_curve.point.some _)) (λ (hx : ¬x₁ = x₂), weierstrass_curve.point.some _)
- (weierstrass_curve.point.some h).add 0 = weierstrass_curve.point.some h
- 0.add (weierstrass_curve.point.some h) = weierstrass_curve.point.some h
- 0.add weierstrass_curve.point.zero = weierstrass_curve.point.zero
Equations
Equations
- weierstrass_curve.point.add_zero_class = {zero := 0, add := has_add.add weierstrass_curve.point.has_add, zero_add := _, add_zero := _}
The axioms for nonsingular rational points on a Weierstrass curve #
The non-zero fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ for some $x, y \in F$.
Equations
- weierstrass_curve.XY_ideal' h₁ = units.mk_of_mul_eq_one ↑(weierstrass_curve.coordinate_ring.XY_ideal W x₁ (⇑polynomial.C y₁)) (↑(weierstrass_curve.coordinate_ring.XY_ideal W x₁ (⇑polynomial.C (W.neg_Y x₁ y₁))) * (↑(weierstrass_curve.coordinate_ring.X_ideal W x₁))⁻¹) _
The set function mapping an affine point $(x, y)$ of W
to the class of the non-zero fractional
ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$.
Equations
The group homomorphism mapping an affine point $(x, y)$ of W
to the class of the non-zero
fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$.
Equations
Equations
- weierstrass_curve.point.add_comm_group = {add := weierstrass_curve.point.add W, add_assoc := _, zero := weierstrass_curve.point.zero W, zero_add := _, add_zero := _, nsmul := add_group.nsmul._default weierstrass_curve.point.zero weierstrass_curve.point.add weierstrass_curve.point.add_comm_group._proof_3 weierstrass_curve.point.add_comm_group._proof_4, nsmul_zero' := _, nsmul_succ' := _, neg := weierstrass_curve.point.neg W, sub := add_group.sub._default weierstrass_curve.point.add weierstrass_curve.point.add_assoc weierstrass_curve.point.zero weierstrass_curve.point.add_comm_group._proof_7 weierstrass_curve.point.add_comm_group._proof_8 (add_group.nsmul._default weierstrass_curve.point.zero weierstrass_curve.point.add weierstrass_curve.point.add_comm_group._proof_3 weierstrass_curve.point.add_comm_group._proof_4) weierstrass_curve.point.add_comm_group._proof_9 weierstrass_curve.point.add_comm_group._proof_10 weierstrass_curve.point.neg, sub_eq_add_neg := _, zsmul := add_group.zsmul._default weierstrass_curve.point.add weierstrass_curve.point.add_assoc weierstrass_curve.point.zero weierstrass_curve.point.add_comm_group._proof_12 weierstrass_curve.point.add_comm_group._proof_13 (add_group.nsmul._default weierstrass_curve.point.zero weierstrass_curve.point.add weierstrass_curve.point.add_comm_group._proof_3 weierstrass_curve.point.add_comm_group._proof_4) weierstrass_curve.point.add_comm_group._proof_14 weierstrass_curve.point.add_comm_group._proof_15 weierstrass_curve.point.neg, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _}
Nonsingular rational points on a base changed Weierstrass curve #
The function from W⟮F⟯
to W⟮K⟯
induced by a base change from F
to K
.
Equations
The group homomorphism from W⟮F⟯
to W⟮K⟯
induced by a base change from F
to K
.
Equations
- weierstrass_curve.point.of_base_change W F K = {to_fun := weierstrass_curve.point.of_base_change_fun W F K _inst_7, map_zero' := _, map_add' := _}
Rational points on an elliptic curve #
An affine point on an elliptic curve E
over R
.