Elliptic curves

Elliptic curves

A cubic curve whose points can be added. Over the rationals the sum of two points with fraction coordinates is again one, exactly, and the questions become: which points come back to zero, how fast do the others grow, and what does the curve look like modulo each prime.

A curve and its points

A curve is given by a Weierstrass equation y2+a1xy+a3y=x3+a2x2+a4x+a6y^2 + a_1xy + a_3y = x^3 + a_2x^2 + a_4x + a_6, written [a1, a2, a3, a4, a6], or by the short form y2=x3+ax+by^2 = x^3 + ax + b, written [a, b]. The discriminant must not be zero: a cubic with a node or a cusp is refused.

import { ellipticCurve } from "@ratmath/numtheory";

const E = ellipticCurve([0, 0, 1, -1, 0]);
String(E);            // "y² + y = x³ − x"
E.discriminant;       // 37
E.j;                  // 110592/37

const P = E.point(0, 0);          // checked to lie on the curve
E.add(P, P);                      // (1, 0)
E.mul(5, P);                      // (1/4, -5/8)
E.mul(7, P);                      // (-5/9, 8/27)
E.add(E.mul(5, P), E.mul(-5, P)); // { infinity: true }, the zero of the group

Points are { x, y } with Core Rational coordinates; the point at infinity, which is the zero of the group, is E.infinity. Wherever a point is expected, [x, y] works too.

The group law

A line meets a cubic in three points, counted properly. Declare that three points on a line add up to zero, with the point at infinity as zero. Then the negative of (x,y)(x, y) is the other point on the vertical line through it, (x,−y−a1x−a3)(x, -y - a_1x - a_3), and P+QP + Q is the negative of the third point on the line through PP and QQ (the tangent line, when P=QP = Q). With λ\lambda the slope of that line and ν\nu its intercept,

x3=λ2+a1λ−a2−x1−x2,y3=−(λ+a1)x3−ν−a3. x_3 = \lambda^2 + a_1\lambda - a_2 - x_1 - x_2, \qquad y_3 = -(\lambda + a_1)x_3 - \nu - a_3.

That this is associative is not obvious and is a theorem; the tests check it on thousands of triples. mul(k, P) uses doubling and adding, so the millionth multiple takes about forty steps, though its coordinates are enormous: the number of digits of kPkP grows like k2k^2, which is what the height measures.

Torsion

A point of finite order is a torsion point. Two theorems make the torsion of a curve over Q\mathbb{Q} computable. Nagell–Lutz: on a model y2=x3+Ax+By^2 = x^3 + Ax + B with whole A,BA, B, a torsion point has whole coordinates and either y=0y = 0 or y2y^2 divides 4A3+27B24A^3 + 27B^2. Mazur: the torsion group is one of fifteen, Z/n\mathbb{Z}/n for n=1,…,10,12n = 1, \dots, 10, 12 or Z/2×Z/2n\mathbb{Z}/2 \times \mathbb{Z}/2n for n=1,…,4n = 1, \dots, 4; in particular no point has finite order above 12.

const T = ellipticCurve([1, 0, 1, -19, 26]);   // y² + xy + y = x³ − 19x + 26
T.torsion().structure;    // [2, 6]: the group is Z/2 × Z/6
T.torsion().points;       // O, (-5, 2), (-2, -7), (-2, 8), (1, -4), (1, 2), (7/4, -11/8), (3, -2), (4, -7), (4, 2), (13, -52), (13, 38)
T.torsion().generators;   // [(-5, 2), (-2, 8)], of orders 2 and 6

const S = ellipticCurve([-43, 166]);           // y² = x³ − 43x + 166
S.order(S.point(3, 8));   // 7n
E.order(P);               // Infinity: (0, 0) on y² + y = x³ − x never returns

torsion() moves to a short integral model, lists the candidate yy from the divisors of 4A3+27B24A^3 + 27B^2, finds the whole roots xx of each cubic, and keeps a candidate only if one of its first twelve multiples is zero. Note (7/4,−11/8)(7/4, -11/8) above: on the long model torsion points need not have whole coordinates; on the short model they do. The tests compare every answer with the curve modulo primes, since torsion embeds in E(Fp)E(\mathbb{F}_p) at each odd prime of good reduction.

Minimal models and reduction

The same curve has many equations: x=u2x′+r, y=u3y′+u2sx′+tx = u^2x' + r,\ y = u^3y' + u^2sx' + t gives another, with discriminant divided by u12u^{12}. Among the equations with whole coefficients there is one with the smallest discriminant, and it is unique once a1,a3∈{0,1}a_1, a_3 \in \{0, 1\} and a2∈{−1,0,1}a_2 \in \{-1, 0, 1\}.

const M = ellipticCurve([-432, 8208]);     // y² = x³ − 432x + 8208
M.discriminant;                            // -23944605696 = −2¹² · 3¹² · 11
const min = M.minimalModel();
String(min.curve);                         // "y² + y = x³ − x²"
min.curve.discriminant;                    // -11
min.u;                                     // 6
min.to(M.point(-12, 108));                 // (0, 0): points are carried along

Modulo a prime pp, the minimal model is either still an elliptic curve (good reduction, when pp does not divide the minimal discriminant), or it gets a node (multiplicative reduction) or a cusp (additive). A node is split when its two tangent directions are defined over Fp\mathbb{F}_p.

M.badPrimes();       // [11n]
M.reduction(11);     // { prime: 11n, type: "multiplicative", split: true, discriminantValuation: 1, conductorExponent: 1 }
M.conductor();       // 11n: this is the curve of smallest conductor
E.reduction(37);     // multiplicative, split: false
ellipticCurve([-1, 0]).reduction(2);   // additive; conductorExponent: null

The conductor multiplies pp for each multiplicative prime and p2p^2 for each additive prime p≥5p \ge 5. At 2 and 3 an additive prime can have a larger exponent, which takes Tate's algorithm to find; that is not here, so the exponent is reported as null and conductor() refuses rather than guess. Kodaira symbols and Tamagawa numbers are likewise not computed.

How the minimal model is found: at each prime the largest possible uu is tried, and the candidate invariants (c4,c6)(c_4, c_6) either belong to an equation with whole coefficients, which is then written down and checked, or they do not. Nothing is taken from a table of conditions.

Heights

The naive height of a point is H(P)=max⁡(∣p∣,∣q∣)H(P) = \max(|p|, |q|) for x(P)=p/qx(P) = p/q. Doubling a point roughly raises HH to the fourth power, and the canonical height makes that exact:

h^(P)=lim⁡n→∞log⁡H(2nP)4n,h^(kP)=k2 h^(P),h^(P)=0  ⟺  P is torsion. \hat h(P) = \lim_{n \to \infty} \frac{\log H(2^nP)}{4^n}, \qquad \hat h(kP) = k^2\,\hat h(P), \qquad \hat h(P) = 0 \iff P \text{ is torsion}.

It is a quadratic form on the group, and it is how independence of points is measured. (This normalisation is the one used in the Birch and Swinnerton-Dyer conjecture and in the tables; Silverman's book uses half of it.)

E.naiveHeight(E.mul(7, P));         // 9n: x = -5/9
E.height(P);                        // { lower: 0.05021…, upper: 0.05193…, exact: false }
E.height(P, { doublings: 8 });      // { lower: 0.051052…, upper: 0.051160… }
T.height(T.point(1, 2));            // { lower: 0, upper: 0, exact: true }: a torsion point

The bounds are Rationals and they are proved, for the curve at hand. On the short model y2=x3+Ax+By^2 = x^3 + Ax + B, with x=p/qx = p/q,

x(2Q)=Φ(p,q)Ψ(p,q),Φ=p4−2Ap2q2−8Bpq3+A2q4,Ψ=4q(p3+Apq2+Bq3). x(2Q) = \frac{\Phi(p, q)}{\Psi(p, q)}, \qquad \Phi = p^4 - 2Ap^2q^2 - 8Bpq^3 + A^2q^4, \quad \Psi = 4q(p^3 + Apq^2 + Bq^3).

So H(2Q)≤κ H(Q)4H(2Q) \le \kappa\,H(Q)^4 with κ\kappa the larger coefficient sum. The other direction needs to know that Φ\Phi and Ψ\Psi cannot both be small or share a large factor. Because they have no common root, there are cubic forms with FΦ+GΨ=c p7F\Phi + G\Psi = c\,p^7 and F′Φ+G′Ψ=c′ q7F'\Phi + G'\Psi = c'\,q^7; the library finds them by solving an 8 by 8 linear system exactly. They show that gcd⁡(Φ,Ψ)\gcd(\Phi, \Psi) divides lcm⁡(c,c′)\operatorname{lcm}(c, c') and that max⁡(∣Φ∣,∣Ψ∣)≥ρ H(Q)4\max(|\Phi|, |\Psi|) \ge \rho\,H(Q)^4 for an explicit ρ\rho. Hence log⁡ρ≤log⁡H(2Q)−4log⁡H(Q)≤log⁡κ\log\rho \le \log H(2Q) - 4\log H(Q) \le \log\kappa for every point, and summing the geometric series,

13log⁡ρ  ≤  h^(Q)−log⁡H(Q)  ≤  13log⁡κ. \tfrac13\log\rho \;\le\; \hat h(Q) - \log H(Q) \;\le\; \tfrac13\log\kappa.

Applied to Q=2nPQ = 2^nP and divided by 4n4^n, this encloses h^(P)\hat h(P) in an interval whose width shrinks by 4 with each doubling. The logarithms of the large whole numbers are themselves enclosed between Rationals. For the point above, the known value is 0.0511114082…0.0511114082\ldots, the regulator of this curve.

Searching for points, and what is not here

rationalPoints(bound) lists the points whose x-coordinate has small height on the short model, by trying every candidate. It is a search: it shows points, and it proves nothing about the ones it did not reach. The rank of a curve, the number of independent points of infinite order, is not computed; no algorithm is known that always finds it.

E.rationalPoints(10);   // (-1, -1), (-1, 0), (0, -1), (0, 0), (1/4, -5/8), (1/4, -3/8), (1, -1), (1, 0), (2, -3), (2, 2), …

For curves over finite fields, see Counting points; for what curves do for factoring and primality, see The elliptic curve method and Elliptic curve certificates.

Try itEdit the code and run it with @ratmath/numtheory and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs