Counting Points on Curves

An elliptic curve modulo p is a finite scatter of points that still add like a group. Count them, and the error ap = p + 1 − N never strays past 2√p

Counting Points on Curves

An elliptic curve is a cubic equation in two variables. Over the real numbers its solutions form a smooth curve; modulo a prime p they shatter into a finite scatter of points, which, remarkably, still add up like a group. Count the points and you get about p + 1. The error, written ap, is the single most important number in this module.

A Curve Modulo p

Step through the primes and watch the same equation scatter over a p × p grid. Then tap two amber points to add them, or tap one point again and again to walk it back to the point at infinity.

10
points modulo 13, counting the one at infinity (Np)
4
ap = p + 1 − Np = 14 − 10
Z/10
the group these points form
10
largest order of any point
Modulo 13 the equation has 9 solutions on the grid, plus the point at infinity: N13 = 10, so a13 = 14 − 10 = 4. Tap an amber point to call it P, then tap a second one to add them.

Amber is the arithmetic side: the real curve on the left, and on the right every pair (x, y) of residues that satisfies the same equation modulo p. Replay the reduction to see where they come from: a grid point is a solution when the two sides of the equation differ by a multiple of p, so the solutions are the grid points on the real curve (amber) and on the curves where the two sides differ by exactly p, 2p, 3p, … (grey), taken in that order. Violet rings are the points you chose, the dashed white line is the line through them modulo p (it leaves one edge and re-enters at the opposite one), R is the third point of the curve on that line, and pink is the sum.

Go deeper:Why Points Still Add, and What Goes Wrong at a Bad Prime

Every curve here has an equation of the form y² + a₁xy + a₃y = x³ + a₂x² + a₄x + a₆ with whole-number coefficients. Its points modulo p are the pairs (x, y) of residues that satisfy it, together with one extra point at infinity, written O, where all vertical lines meet. The number of points is Np, and ap = p + 1 − Np.

The chord and tangent rule works over any field because it is algebra, not geometry. Substituting the equation of a line into a cubic gives a cubic equation in one variable; if two of its roots lie in the field then so does the third, so a line through two points of the curve meets it in exactly one more point, counted with multiplicity. Calling that third point R, the sum P + Q is the reflection of R in its vertical line, and O is the identity. Modulo p a “line” is the set of p grid points satisfying a linear equation, which is why it appears to wrap around the edges of the grid.

The resulting group E(Fp) is always a product of at most two cyclic groups, Z/m × Z/n with m dividing n. Here n is the largest order of any point, and m also divides p − 1. Often m = 1 and a single point generates everything.

When p divides the discriminant of the equation, the reduced curve has a singular point, either a node where it crosses itself or a cusp, and the group law degenerates there. These are the bad primes. The equations in this module’s catalogue are minimal ones, so their bad primes are exactly the primes dividing the conductor, the number in each curve’s label. See also the lesson on elliptic curves and the group law in the Algebraic Geometry module.

Hasse’s Interval

Each dot is one prime, at height ap. Slide the limit up and try to find a dot outside the dashed curves ±2√p; then compare 11a with 27a or 32a, where half the dots sit on the axis.

Curve (amber)
Compare with (pink)
Counting points: 0 of 669 primes done…
—
largest |ap| / 2√p
0
of 0 good primes outside the parabola
0 (—)
primes with ap = 0 for 11a
—
bad primes (rose)
Move over the plot, or tap it, to read off one prime. 11a has no complex multiplication: ap = 0 only now and then, and the dots fill the region between the two dashed curves without ever crossing them.
Counting points on every curve modulo 37: 0 done…
0
curves y² = x³ + ax + b modulo 37 counted (p² − p in all)
26 … 50
whole numbers within 2√p ≈ 12.17 of p + 1
0 of 25
of those numbers occur as a point count
0
curves outside the interval

Amber dots are point counts, the arithmetic side: one dot per prime at height ap = p + 1 − Np. The dashed white curves are Hasse’s bound ±2√p, and rose marks a bad prime. The lower chart fixes one prime and counts the points on every curve y² = x³ + ax + b modulo p (all p² pairs a, b, leaving out the p singular ones): a bar at N is the number of curves with exactly N points; the violet bar is where 11a itself lands, with 35 points. For every prime on offer here, each whole number between the dashed lines is hit by some curve and none falls outside. That every number in the interval occurs is a theorem of Deuring for prime fields.

Go deeper:Hasse’s Theorem and Supersingular Primes

Hasse’s theorem, proved by Helmut Hasse in the 1930s, says that |ap| ≤ 2√p for every elliptic curve at every prime of good reduction. Equivalently, the polynomial T² − apT + p has two complex-conjugate roots α and β, each of absolute value exactly √p. That statement is known as the Riemann hypothesis for the curve over Fp, for a reason the next demo makes visible.

Since the roots lie on a circle one can write ap = 2√p cos θp. Hasse’s theorem says only that the angle θp exists; how the angles are spread between 0 and π as p varies is a much deeper question, taken up in the lesson on the Sato–Tate law.

A prime p ≥ 5 of good reduction with ap = 0 is called supersingular. For the curves 27a, 32a and 36a, which have complex multiplication, half of all primes are supersingular: ap = 0 whenever p ≡ 2 mod 3 for 27a and 36a, and whenever p ≡ 3 mod 4 for 32a. For a curve without complex multiplication the supersingular primes have density zero, yet Noam Elkies proved in 1987 that every elliptic curve over the rational numbers has infinitely many of them.

The lower chart shows the bound from the other direction: fix the prime and vary the curve. Hasse’s theorem confines every count to the interval, and a theorem of Deuring says that over a field of prime size every whole number in the interval really is the point count of some curve. Point counts of curves modulo p are also the basis of elliptic curve cryptography, proposed independently by Neal Koblitz and Victor Miller in 1985, in which the group E(Fp) replaces the multiplicative group of a finite field.

One Number Predicts a Tower

The field with p elements sits inside larger fields with p², p³, … elements, and the curve has more points over each. Pick a curve and a prime, press Play, and watch a brute-force count land on the number predicted from ap alone.

Prediction from ap alone
Brute force: try every pair (x, y)
kfield sizepredictedcounted
171010agree
272 = 4960waiting0%
373 = 343310waiting0%
474 = 2,4012,400—too big
575 = 16,80717,050—too big
676 = 117,649117,180—too big
777 = 823,543822,790—too big
878 = 5,764,8015,769,600—too big
Scanning the field with 72 = 49 elements: one cell per value of x, 0 of 2,401 pairs tried
Prime p
−2
ap for p = 7: the only input to the prediction
−1 + 2.449i
α, a root of T² − apT + p (β is its mirror image)
2.6458
|α| = |β|, and √7 = 2.6458
1 of 3
brute-force counts finished, each equal to the prediction
Over the field with 72 elements the prediction is 72 + 1 − (α2 + β2) = 49 + 1 − (−10) = 60 points. The brute-force count for this field has not finished: press Play.
The zeta function, as a power series in T: the coefficient of Tn for n = 0 to 8
n012345678
exp(Σ NkTk/k)110805704,00028,010196,0801,372,5709,608,000
(1 − apT + pT²) / ((1 − T)(1 − pT))110805704,00028,010196,0801,372,5709,608,000
equal?=========

Sky and violet are the prediction: α and β are the two roots of T² − apT + p, and their k-th powers sit on a circle of radius pk/2, which is drawn here with evenly spaced circles because the true radii grow too fast to fit. Amber is the check, which never looks at α: the field with pk elements is built as polynomials modulo an irreducible one, and every pair (x, y) is tried in the equation. In the scan, each cell is a value of x, bright when two values of y work, dim for one, grey for none; the violet box marks the p values of x that were already in the original field. In the zeta table, the bright amber coefficients use only counts that were made by brute force (the coefficient of Tn needs N1 to Nn); the faded ones borrow predicted counts, so their agreement is algebra rather than evidence.

Go deeper:Frobenius, and the Zeta Function of a Curve

For every k there is exactly one field with pk elements, written Fq with q = pk, and it contains Fp. The claim checked in the demo is that the number of points of the curve over it is Nk = pk + 1 − (αk + βk), where α + β = ap and αβ = p. So the count over Fp determines the count over every field in the tower. The demo verifies this by exhaustive search for k = 2 and k = 3 only; the formula itself is a theorem for every k.

The reason is the Frobenius map (x, y) → (xp, yp). Raising to the p-th power respects addition and multiplication in characteristic p and fixes the coefficients of the equation, so it sends the curve to itself. Its fixed points are exactly the points with coordinates in Fp, and the fixed points of its k-th power are the points over the field with pk elements. As an endomorphism of the curve, Frobenius satisfies φ² − apφ + p = 0. That quadratic is where the formula comes from, and it is why ap is called the trace of Frobenius.

All the counts fit into one generating function, the zeta function of the curve over Fp: Z(T) = exp(Σ NkTk/k). For an elliptic curve it equals the rational function (1 − apT + pT²) / ((1 − T)(1 − pT)), which is what the table checks coefficient by coefficient. Substituting T = p−s, the zeros of Z are the points where ps equals α or β, and since both have absolute value √p, every zero lies on the line Re s = ½. Hasse’s bound and this Riemann hypothesis are the same statement.

Zeta functions of curves over finite fields were introduced by Emil Artin in the 1920s, and F. K. Schmidt proved that they are rational functions. André Weil proved the Riemann hypothesis for curves of every genus in the 1940s, and in 1949 conjectured the same pattern for varieties of every dimension. The last and hardest of these Weil conjectures was settled by Pierre Deligne in 1974. See also The Rosetta Stone.

Key Takeaways

  • Modulo p an elliptic curve is a finite group, a product of at most two cyclic groups.
  • Its size is Np = p + 1 − ap, and Hasse’s theorem says |ap| ≤ 2√p.
  • The roots α, β of T² − apT + p have absolute value √p and give the count over every larger field.
  • The zeta function packs all those counts into one rational function whose zeros lie on a line.

Spot a mistake or have an idea?

Search