Fermat's margin note and the 358 years that followed Image: Diophantus, Arithmetica, 1670 edition (public domain)

Fermat's margin note and the 358 years that followed

Pierre de Fermat was a lawyer and judge in Toulouse who did mathematics in the evenings and almost never published any of it. He owned a copy of the 1621 Latin edition of the Arithmetica of Diophantus, the Greek text of the third century AD that asks for rational solutions of equations, and he wrote notes in its margins. Next to Problem 8 of Book II, which asks how to split a given square into two squares, he wrote that it is impossible to split a cube into two cubes, or a fourth power into two fourth powers, or in general any power beyond the second into two of the same power, and that he had found a truly marvellous proof of this, which the margin was too narrow to contain.

The note was written around 1637. Fermat died in 1665. His son Samuel published the Arithmetica with his father's notes in 1670, and from then on the claim was public. In modern notation: for every integer n greater than 2, the equation xⁿ + yⁿ = zⁿ has no solution in positive integers. It became known as Fermat's Last Theorem because, of his many unproved claims, it was the last one left standing.

What Fermat could actually prove

Nobody believes he had a general proof. He did have a proof for n = 4, and it survives, in another margin: the method of infinite descent. Suppose x⁴ + y⁴ = z² has a solution in positive integers. Fermat shows how to build from it a smaller solution, then a smaller one still, and since positive integers cannot decrease for ever, there was no solution to begin with. The argument uses the parametrization of Pythagorean triples twice, and it is written out in full in Unit 7 of the masterclass. Since any solution of x⁴ + y⁴ = z⁴ would give one of x⁴ + y⁴ = (z²)², the case n = 4 follows, and with it every exponent divisible by 4.

That reduces the problem to prime exponents. If xⁿ + yⁿ = zⁿ with n = pm, then (xᵐ)ᵖ + (yᵐ)ᵖ = (zᵐ)ᵖ, so it is enough to handle n = 4 and every odd prime n. Fermat's marvellous proof, if it existed, would have been for all odd primes at once, and the likeliest explanation is that he thought his descent would generalize and later saw that it did not, since he never again mentioned the general case in his letters, though he did mention the cases 3 and 4.

Euler, Germain, Kummer

Leonhard Euler handled n = 3 around 1770, with a proof that has a gap: he used numbers of the form a + b√-3 as if they factored uniquely, which they do, but he did not prove it. The gap was filled by others, and the idea, to factor xⁿ + yⁿ over a larger number system, became the main road.

Sophie Germain, around 1820, took a different direction. She proved that if p is a prime for which 2p + 1 is also prime, such as 5, 11, 23, and 29, then any solution of xᵖ + yᵖ = zᵖ must have p dividing one of x, y, z. This "first case" was the first result covering infinitely many exponents at once (if there are infinitely many such primes, which is still unproved), and it was the first general theorem on the problem by anyone. She had taught herself mathematics from books in her father's house in Paris, corresponded with Gauss under the name Monsieur LeBlanc, and was admitted to no university.

Ernst Kummer, in 1847, took Euler's road to its end. Factoring xᵖ + yᵖ as a product of p factors x + ζᵏy with ζ a complex p-th root of unity, he found that unique factorization fails in these systems for p = 23 and beyond, and invented "ideal numbers" to repair it. He proved the theorem for all "regular" primes, those for which a certain class number is not divisible by p, which covers every prime below 100 except 37, 59, and 67, and later handled those three by other means. His ideal numbers became the ideals of modern algebra, and the class number he needed is the one that Unit 11 of the masterclass introduces for quadratic forms.

After Kummer the problem stalled for a century, apart from computations: by the 1990s it was verified for every exponent below four million, which, as Unit 8 explains, proves nothing about the rest.

The road through elliptic curves

The proof came from a direction no one had expected. In 1983 Gerd Faltings proved that for each n greater than 2 the equation has at most finitely many coprime solutions, a consequence of his theorem on rational points on curves of high genus. Finitely many is not none, but it changed the problem's standing.

In 1984 Gerhard Frey observed that a solution aᵖ + bᵖ = cᵖ would give an elliptic curve, y² = x(x - aᵖ)(x + bᵖ), with properties so strange that it should not exist. Jean-Pierre Serre made the strangeness precise, and in 1986 Ken Ribet proved what Serre had conjectured: the Frey curve could not be modular. Modularity is a property that the Taniyama-Shimura conjecture, from the 1950s, said every elliptic curve over the rationals has. So Fermat's Last Theorem was reduced to that conjecture, at least for the curves of Frey's type, called semistable.

Andrew Wiles, who had read about the problem as a ten-year-old in Cambridge, decided in 1986 to prove the semistable case of Taniyama-Shimura and told almost no one. He worked for seven years, mostly alone, and announced the result in three lectures at the Isaac Newton Institute in Cambridge on 21 to 23 June 1993. At the end of the third lecture he wrote the theorem on the board and said he would stop there.

The gap and the repair

During refereeing, Nick Katz found a gap in one part of the argument, a bound on a certain group that had not been justified. By December 1993 Wiles had to admit publicly that the proof was incomplete. He spent most of 1994 trying to fix it, with his former student Richard Taylor from the spring onwards, and on 19 September 1994 he saw that a method he had abandoned three years earlier, combined with the one that had failed, would work. The two papers, Wiles's long one and a shorter one by Taylor and Wiles, were published in the Annals of Mathematics in May 1995. From the margin to the Annals is 358 years, counting from 1637.

The full modularity theorem, for all elliptic curves over the rationals, was finished in 2001 by Breuil, Conrad, Diamond, and Taylor. Since 2024 a project led by Kevin Buzzard at Imperial College London has been formalizing the proof in the Lean proof assistant, so that a computer can check every step; the research spotlight of Unit 1 of the masterclass is about what that means and how far it has got.

What was proved on the way

The famous question is whether Fermat had a proof, and the answer is almost certainly no: the tools of 1995 did not exist in 1637, and nothing in his papers suggests he had anything beyond descent. The better question is what the problem produced. Kummer's ideal numbers became algebraic number theory. The study of the Frey curve forced the development of modularity, which is now a central theme of the Langlands programme. The theorem itself is a curiosity; the mathematics built to reach it is a large part of the subject. Unit 8 of the masterclass tells the story with the mathematics at the level of the Foundation units, including one honest paragraph each on what an elliptic curve and a modular form are, and its first research spotlight is on Wiles's own account of the problem he names as the next one: the Birch and Swinnerton-Dyer conjecture.

Study the integers properly

The NT Masterclass: weekly units, quizzes, a final exam, and a certificate.
About the program