The Modularity Theorem

Two machines, one output: point counts of y² + y = x³ − x² and the coefficients of η(z)²η(11z)². The theorem behind Fermat’s Last Theorem, checked prime by prime

The Modularity Theorem

Take an elliptic curve and count its points modulo each prime. Separately, take a modular form of weight 2 and read off its coefficients. The modularity theorem says the first list is always one of the second kind. It was the missing step in the proof of Fermat’s Last Theorem, and it is the Langlands correspondence for the group GL₂ over the rational numbers.

Two Machines

Press Step to send the next prime through both machines: one counts points on the curve, the other multiplies out a product. Then press Play fast to check every prime below 10,000, and try the bad prime 11.

Machine 1: count points
y² + y = x³ − x² (mod 13)
9 on the grid + 1 at infinity
N13 = 10, so a13 = 13 + 1 − 10 = 4
4
=
4
agree
Machine 2: multiply out
q ∏ (1 − qⁿ)²(1 − q¹¹ⁿ)² = η(z)² η(11z)²
brackets multiplied out: n ≤ 12; nothing later can reach this tile
coefficient of q13 = 4
… 10,000
0 of 0
primes checked so far agree
1,229
primes up to 10,000 still to check
11
conductor of the curve = level of the form
11
bad primes, where the curve is singular modulo p
Modulo 13 the curve has 10 points, so a13 = 4. The coefficient of q13 in the product is 4. Two unrelated computations, one number.

Amber is the arithmetic side: each lit cell is a pair (x, y) satisfying the curve equation modulo p, found by trying all p² pairs. Sky is the automorphic side: each tile is a coefficient of the product, pale while later brackets can still change it. The strip of numbers is the conveyor; tap one to send it through both machines. Emerald means the two outputs are equal, rose marks a bad prime (or would mark a mismatch). Only a few curves have a form this simple; for most, the form exists but has no product formula.

Go deeper:The Statement, and Who Proved It

For a prime p, let Np be the number of points of the curve E modulo p, counting the point at infinity, and put ap(E) = p + 1 − Np. The modularity theorem says: for every elliptic curve E over the rational numbers, of conductor N, there is a newform f of weight 2 and level N, with whole-number coefficients, such that ap(E) equals the coefficient of qp in f for every prime p. The conductor is a whole number built from the primes where the curve goes bad. At those primes the coefficient is +1, −1 or 0 according to the kind of singularity, and the demo shows that this matches too.

The statement was conjectured in stages, by Taniyama (1955), Shimura, and Weil (1967). Wiles, with Taylor, proved it for semistable curves, those whose bad primes all give a simple crossing; the proof was announced in 1993, completed in 1994 and published in 1995. Breuil, Conrad, Diamond and Taylor proved it for every elliptic curve over the rationals in 2001. The other direction, from a weight 2 newform with whole-number coefficients to an elliptic curve, is older: it is due to Eichler and Shimura in the 1950s, and the third demo carries it out.

What the demo checks is evidence, not the proof: finitely many primes for eight curves. And these eight are special. Their newforms happen to be products of the eta function η(z) = q1/24 ∏ (1 − qⁿ), which is what lets machine 2 be so simple. Only a handful of curves have a newform like that (Martin and Ono listed them in 1997). In general the form exists, by the theorem, but has no product formula, and its coefficients have to be found another way.

With “Composite n too” switched on, machine 1 extends its list from primes to all whole numbers by the rule a(mn) = a(m)a(n) for coprime m and n, together with a recurrence for prime powers. Machine 2 simply keeps reading coefficients. That the form’s coefficients obey the same multiplication rule is the mark of a Hecke eigenform; see also the lesson on Hecke operators.

The Curve That Cannot Exist

Pick a sum A + B = C and compare the size of the curve’s discriminant with its conductor. Then flip the Fermat switch, and drag across the chart to see how many modular forms each level has.

The Frey curve of A + B = C
5 + 3³ = 2⁵
Discriminant Δ = 16 (ABC)²
2¹⁴ · 3⁶ · 5²
Odd part of the conductor
3 · 5 = 15
Odd primes: power in Δ, shape modulo p, and whether 5 divides the power
3⁶: node, 5 does not divide 65²: node, 5 does not divide 2
Ratio: log (odd part of Δ) ÷ log (odd part of the conductor)3.62
4812162024
How many weight 2 cusp forms of level N are there?
N = 2: μ = 3, ν₂ = 1, ν₃ = 0, ν∞ = 2, so dimension = 1 + 3/12 − 1/4 − 0/3 − 2/2 = 0
A =
B =
with n =
≈ 108.5
size of the discriminant Δ
15
odd part of the conductor: each odd prime once
3.62
ratio of the two logarithms
0
weight 2 cusp forms of level 2 (dimension)
5 + 27 = 32: the discriminant has 9 digits, but each odd prime enters the conductor only once, giving 15. The ratio is 3.62. High powers in A, B and C push the ratio up; a Fermat solution would push it past 10. Press the Fermat switch to see.

Amber is the curve and its arithmetic; sky is the supply of modular forms. A chip turns emerald when the power of that prime in Δ is a multiple of n, the condition under which Ribet’s theorem can remove the prime from the level. The prime 2 is left out of the conductor and of the ratio: its contribution depends on how A and B sit modulo powers of 2. Drag across the chart to read the formula for any level.

Go deeper:From Fermat to Modularity: Frey, Serre, Ribet, Wiles

Given whole numbers A + B = C with no common factor, the Frey curve is y² = x(x − A)(x + B). Its discriminant is 16(ABC)². At each odd prime dividing ABC, two of the three roots 0, A, −B collide modulo p and the third stays apart, so the curve acquires a simple crossing, a node. For such primes the conductor contains p exactly once, however high the power of p in A, B or C. That part is elementary, and the demo verifies it by counting points.

In 1984 Frey suggested that a solution of aⁿ + bⁿ = cⁿ, fed into this construction, would give a curve too strange to be modular. Serre made the missing step precise (it became known as the epsilon conjecture), and Ribet proved it in 1986; his paper appeared in 1990. Ribet’s theorem is a statement about lowering the level: if the curve is modular, then the piece of it seen by its n-torsion points also comes from a weight 2 form whose level has lost every odd prime p for which the power of p in the discriminant is a multiple of n. For a Fermat solution with n ≥ 5 prime that is every odd prime, leaving level 2. There are no cusp forms of weight 2 and level 2. So modularity of semistable curves implies Fermat’s Last Theorem, and that is what Wiles proved.

The demo uses Ribet’s theorem as a black box, and it leaves the prime 2 out. For a Fermat solution one can arrange that A ≡ −1 mod 4 and B is divisible by 32, and then the Frey curve is semistable with conductor the product of all the primes dividing ABC. For a general sum the behaviour at 2 is more complicated, so the conductor and the ratio shown here use odd primes only. The dimension in the chart is the genus of the modular curve X₀(N), computed from g = 1 + μ/12 − ν₂/4 − ν₃/3 − ν∞/2, where μ is the index of the group Γ₀(N), ν₂ and ν₃ count its elliptic points and ν∞ its cusps.

The ratio in the gauge is a version of Szpiro’s ratio, log |Δ| divided by the log of the conductor. Szpiro’s conjecture says this ratio is bounded over all elliptic curves over the rationals. It is closely related to the abc conjecture, and it is open. Fermat’s Last Theorem did not need it: the argument above rules the Frey curve out by other means.

Building the Curve from the Form

Press Play to integrate the form along one path after another and watch where the answers land. Then drag the terms slider down and up: two decimals settle on whole numbers, and those numbers are a curve.

1. A path in the upper half-plane
γ =54119
2. Where the integrals land
3. The curve of that lattice
ω₁ = 1.2692 + 0.0000i
ω₂ = 0.6346 + 1.4588i
c₄ = 496.00000000
c₆ = 20008.00000000
rounded: y² = x³ − 13,392x − 1,080,432
This is the curve y² + y = x³ − x² − 10x − 20, after a change of variables that removes the y and x² terms. The curve of the first demo, y² + y = x³ − x², has c₄ = 16 and c₆ = −152: a different curve with the same point counts.
prime p5713171923293137414347
recovered curve: p + 1 − points1−24−20−1073−8−68
form: coefficient of qp1−24−20−1073−8−68
9 of 40
paths integrated
−1·ω₁ + 0·ω₂
where this path’s integral lands
2 × 10⁻¹²
distance of c₄ from a whole number
8 × 10⁻¹¹
distance of c₆ from a whole number
With 150 terms, c₄ and c₆ are within 8 × 10⁻¹¹ of the whole numbers 496 and 20008. Nothing about a curve went in: only the coefficients of the form. Counting points on the curve that came out gives back those same coefficients at all 12 primes in the table.

Sky is everything computed from the form: the path, the integral 2πi ∫ f(z) dz growing along it, and one dot for each finished path. Grey rings are the lattice spanned by ω₁ and ω₂ (violet), found by reducing all 40 integrals to a basis. Amber is the curve recovered from the lattice, written as y² = x³ − 27c₄x − 54c₆ and checked at primes other than 2, 3 and those dividing the level. The paths use matrices with lower-left entry 11, 22 and 33.

Go deeper:Periods, Lattices, and the Eichler–Shimura Construction

A weight 2 cusp form f of level N is the same thing as a holomorphic differential f(z) dz on the modular curve X₀(N), the surface obtained from the upper half-plane by gluing each point z to γz for every matrix γ in Γ₀(N). A path from τ to γτ is therefore a closed loop on that surface, and the integral 2πi ∫ f(z) dz along it is a period. It depends on γ but not on τ, and the period of a product of two matrices is the sum of their periods.

When f is a newform with whole-number coefficients, the periods form a lattice Λ in the complex plane, and the quotient of the plane by Λ is an elliptic curve defined over the rational numbers. This is Eichler and Shimura’s construction. The demo computes it directly: the series Σ a(n)/n · e2πinz is an antiderivative of 2πi f, so each period is a difference of two values of it; the base point τ = (−d + i)/c is chosen so that both ends sit at height 1/c, where the series converges quickly. The curve of a lattice with basis ω₁, ω₂ has invariants c₄ = (2π/ω₁)⁴ E₄(τ) and c₆ = (2π/ω₁)⁶ E₆(τ), with τ = ω₂/ω₁ and E₄, E₆ the Eisenstein series.

That c₄ and c₆ come out as whole numbers is the remarkable part, and here it is numerical evidence to about ten decimal places, not a proof. The demo samples matrices with lower-left entry N, 2N and 3N rather than a full set of generators of Γ₀(N); for these eight levels that is enough to reach the whole lattice, which the tests check against known curves. For level 11 the result is c₄ = 496, c₆ = 20008, the curve y² + y = x³ − x² − 10x − 20. It is not the curve y² + y = x³ − x² of the first demo, but the two are isogenous, joined by a map with finite kernel, and isogenous curves have the same point counts.

The modularity theorem says every elliptic curve over the rationals arises this way, up to isogeny. Equivalently, there is a non-constant map from X₀(N) onto the curve, the modular parametrisation. For N = 11 the modular curve has genus 1, so X₀(11) is itself the elliptic curve.

Key Takeaways

  • Every elliptic curve over the rationals has a weight 2 newform whose coefficients are its ap: a theorem since 2001.
  • A Fermat solution would give a Frey curve whose form, by Ribet’s theorem, would have level 2, where there are none.
  • The number of weight 2 cusp forms of level N is the genus of X₀(N): zero for N = 2, one for N = 11.
  • Integrating a newform with whole-number coefficients gives a lattice, and the lattice gives back an elliptic curve.

Spot a mistake or have an idea?

Search