Well-VersedLibraryCoverageAbout
2026-07-01 · Mathematics
Mathematics · Number Theory

Fermat’s Last Theorem

A magistrate scribbled a claim in the margin of a book around 1637, and it took the world three hundred and fifty-eight years to prove he was right.

Engraved portrait of Pierre de Fermat, seventeenth-century French mathematician.
Pierre de Fermat (1607–1665). Engraving after the seventeenth-century portrait. A lawyer by profession, he did mathematics as an amateur and changed number theory forever from the margins of other men’s books. Source: Wikimedia Commons, where the author and licence terms for this file are recorded.

Pierre de Fermat kept the day job of a magistrate in Toulouse and did his real work at night, as an amateur, trading problems by letter with the finest mathematicians in Europe and rarely bothering to write out his proofs. Sometime around 1637 he was reading his Latin copy of the Arithmetica, a thousand-year-old Greek problem book by Diophantus, when a question about squares set him thinking about higher powers. In the margin beside it he left a claim and a taunt: the thing could not be done, and he had found a truly marvellous proof of it, one the margin was too narrow to hold. He never produced the proof. The line became the most famous unfinished thought in mathematics.

The claim itself is short enough to state over dinner. Take the equation xn + yn = zn. When n is two it is the theorem of Pythagoras, and whole-number answers are everywhere: 32 + 42 = 52, five and twelve give thirteen, and there are infinitely many more. Raise the exponent by a single step, to cubes or fourth powers or any power above the second, and Fermat said the answers disappear completely, that no three positive whole numbers will ever satisfy it. One nudge to the exponent, and an ocean of solutions dries to nothing.

Page 61 of the 1670 edition of Diophantus's Arithmetica, printing Fermat's marginal note under the heading Observatio Domini Petri de Fermat.
The theorem in print for the first time: page sixty-one of the 1670 Arithmetica, edited by Fermat’s son. The block headed Observatio Domini Petri de Fermat carries the Latin claim and its closing line, Hanc marginis exiguitas non caperet: this margin is too narrow to contain it. Source: Wikimedia Commons, where the author and licence terms for this file are recorded.

Fermat died in 1665 with the note still unexplained, and it might have died with him had his son Clément-Samuel not gathered his father’s scattered marginalia and printed them in a new 1670 edition of the Arithmetica. Set under the heading Observatio Domini Petri de Fermat, the boast went out to the world, and for the next two centuries the best number theorists on the continent chipped at it one exponent at a time. Fermat himself had left a watertight proof for fourth powers. Euler settled the cubes around 1770. Sophie Germain, forced to correspond as a man named LeBlanc, opened a whole class of cases at once; Dirichlet and Legendre disposed of the fifth powers; Ernst Kummer invented entire new machinery to clear most of the rest. Still the general statement stood, and by 1908 it was celebrated enough that a German industrialist willed a fortune to whoever could settle it.

The break, when it came, had almost nothing to do with the equation. In 1955 two young Japanese mathematicians, Yutaka Taniyama and Goro Shimura, conjectured a deep and unlikely bridge between two subjects that looked wholly unrelated: elliptic curves on one side, and objects called modular forms on the other. Decades later, in 1982, Gerhard Frey noticed something strange. A solution to Fermat’s equation, if one existed, would build an elliptic curve so misshapen that it could not possibly sit on that bridge. Ken Ribet proved Frey right in 1986, and the consequence was electric: prove the Taniyama-Shimura conjecture, even a corner of it, and Fermat’s three-century riddle would come free with it.

Andrew Wiles had first met the theorem at the age of ten, in a library book in Cambridge, and never quite put it down. When Ribet’s result turned Fermat into a problem of modern geometry, Wiles saw his opening and did something almost unheard of in the field: he went silent. For seven years he worked in the attic study of his Princeton house, telling almost no one what he was chasing, releasing just enough unrelated work to allay suspicion. In June 1993 he gave three lectures at the Isaac Newton Institute in Cambridge under a title that gave nothing away, building toward a conclusion he never named in advance, and closed the final talk by writing the theorem on the board and saying he would stop there.

Andrew Wiles, British mathematician, photographed mid-lecture.
Sir Andrew Wiles (b. 1953), who proved the theorem in secret over seven years and then spent another year rescuing it. Photograph by C. J. Mozzochi, Princeton. Source: Wikimedia Commons, where the author and licence terms for this file are recorded.

The triumph nearly broke him. As the manuscript went through review, a referee’s question exposed a gap in one crucial step, and the proof stalled. Wiles spent more than a year trying to close it, coming to the edge of giving up, until on the nineteenth of September 1994, working with his former student Richard Taylor, he suddenly saw how two ideas he had already abandoned could be welded into one that held. The corrected argument ran past a hundred pages and appeared in the Annals of Mathematics in 1995, three hundred and fifty-eight years after the margin note. Wiles was knighted, and in 2016 he received the Abel Prize, mathematics’ nearest thing to a Nobel.

· · ·

One question hangs over the whole story: did Fermat really have the proof he boasted of? Almost certainly not. The mathematics Wiles needed did not exist for another three centuries, and every short argument scholars have tried to reconstruct from Fermat’s era has turned out to be flawed. What he actually left behind was worth more than a proof. He left the right question, pinned to a page and impossible to ignore, and a taunt that kept the sharpest minds in the world coming back for three and a half centuries until one of them made it true.

WatchNumberphile · with Simon Singh

Numberphile, “Fermat’s Last Theorem,” with Simon Singh, whose book on the proof is the standard popular account. Watch for the moment he traces the whole chain from a book margin to an elliptic curve.

Up next
The Four-Minute Mile
A medical student ran the distance experts had ruled beyond the body, and his record lasted six weeks.
Read →

Images on this page are reused from Wikimedia Commons. Each is linked to its file page, where the author and the licence terms for that file are recorded. Thumbnails in “Up next” are credited on the lesson they link to.