In number theory, **Fermat's Last Theorem** (sometimes called **Fermat's conjecture**, especially in older texts) states that no three positive integers *a*, *b*, and *c* satisfy the equation *a**n* + *b**n* = *c**n* for any integer value of *n* greater than 2. The cases *n* = 1 and *n* = 2 have been known since antiquity to have an infinite number of solutions.^{[4]}

The proposition was first conjectured by Pierre de Fermat in 1637 in the margin of a copy of *Arithmetica*; Fermat added that he had a proof that was too large to fit in the margin. However, there were first doubts about it since the publication was done by his son without his consent, after Fermat's death.^{[5]} After 358 years of effort by mathematicians, the first successful proof was released in 1994 by Andrew Wiles, and formally published in 1995; it was described as a "stunning advance" in the citation for Wiles's Abel Prize award in 2016.^{[6]} It also proved much of the modularity theorem and opened up entire new approaches to numerous other problems and mathematically powerful modularity lifting techniques.

The unsolved problem stimulated the development of algebraic number theory in the 19th century and the proof of the modularity theorem in the 20th century. It is among the most notable theorems in the history of mathematics and prior to its proof was in the *Guinness Book of World Records* as the "most difficult mathematical problem" in part because the theorem has the largest number of unsuccessful proofs.^{[7]}

# Overview

The Pythagorean equation, x*2 + *y*2 = *z*2, has an infinite number of positive integer solutions for *x*, *y*, and *z*; these solutions are known as Pythagorean triples (with the simplest example 3,4,5). Around 1637, Fermat wrote in the margin of a book that the more general equation *an* + *bn* = *cn* had no solutions in positive integers if *n* is an integer greater than 2. Although he claimed to have a general proof of his conjecture, Fermat left no details of his proof, and no proof by him has ever been found. His claim was discovered some 30 years later, after his death. This claim, which came to be known as *Fermat's Last Theorem*, stood unsolved for the next three and a half centuries. ^{[5]}*

The claim eventually became one of the most notable unsolved problems of mathematics. Attempts to prove it prompted substantial development in number theory, and over time Fermat's Last Theorem gained prominence as an unsolved problem in mathematics.

*The special case *n* = 4, proved by Fermat himself, is sufficient to establish that if the theorem is false for some exponent *n* that is not a prime number, it must also be false for some smaller *n*, so only prime values of *n* need further investigation ^{[1]}. Over the next two centuries (1637–1839), the conjecture was proved for only the primes 3, 5, and 7, although Sophie Germain innovated and proved an approach that was relevant to an entire class of primes. In the mid-19th century, Ernst Kummer extended this and proved the theorem for all regular primes, leaving irregular primes to be analyzed individually. Building on Kummer's work and using sophisticated computer studies, other mathematicians were able to extend the proof to cover all prime exponents up to four million, but a proof for all exponents was inaccessible (meaning that mathematicians generally considered a proof impossible, exceedingly difficult, or unachievable with current knowledge).*

Separately, around 1955, Japanese mathematicians Goro Shimura and Yutaka Taniyama suspected a link might exist between elliptic curves and modular forms, two completely different areas of mathematics. Known at the time as the Taniyama–Shimura conjecture (eventually as the modularity theorem), it stood on its own, with no apparent connection to Fermat's Last Theorem. It was widely seen as significant and important in its own right, but was (like Fermat's theorem) widely considered completely inaccessible to proof.

*In 1984, Gerhard Frey noticed an apparent link between these two previously unrelated and unsolved problems. An outline suggesting this could be proved was given by Frey. The full proof that the two problems were closely linked was accomplished in 1986 by Ken Ribet, building on a partial proof by Jean-Pierre Serre, who proved all but one part known as the "epsilon conjecture" (see: *Ribet's Theorem* and *Frey curve*). ^{[6]} These papers by Frey, Serre and Ribet showed that if the Modularity Theorem could be proven for at least the semi-stable class of elliptic curves, a proof of Fermat's Last Theorem would also follow automatically. The connection is described below: any solution that could contradict Fermat's Last Theorem could also be used to contradict the Modularity Theorem. So if the modularity theorem were found to be true, then by definition no solution contradicting Fermat's Last Theorem could exist, which would therefore have to be true as well.*

Although both problems were daunting and widely considered to be "completely inaccessible" to proof at the time,^{[6]} this was the first suggestion of a route by which Fermat's Last Theorem could be extended and proved for all numbers, not just some numbers. Also important for researchers choosing a research topic was the fact that unlike Fermat's Last Theorem the Modularity Theorem was a major active research area for which a proof was widely desired and not just a historical oddity, so time spent working on it could be justified professionally.^{[8]} However, general opinion was that this simply showed the impracticality of proving the Taniyama–Shimura conjecture.^{[9]} Mathematician John Coates' quoted reaction was a common one:^{[9]}

On hearing that Ribet had proven Frey's link to be correct, English mathematician Andrew Wiles, who had a childhood fascination with Fermat's Last Theorem and had a background of working with elliptic curves and related fields, decided to try to prove the Taniyama–Shimura conjecture as a way to prove Fermat's Last Theorem. In 1993, after six years of working secretly on the problem, Wiles succeeded in proving enough of the conjecture to prove Fermat's Last Theorem. Wiles's paper was massive in size and scope. A flaw was discovered in one part of his original paper during peer review and required a further year and collaboration with a past student, Richard Taylor, to resolve. As a result, the final proof in 1995 was accompanied by a smaller joint paper showing that the fixed steps were valid. Wiles's achievement was reported widely in the popular press, and was popularized in books and television programs. The remaining parts of the Taniyama–Shimura–Weil conjecture, now proven and known as the Modularity theorem, were subsequently proved by other mathematicians, who built on Wiles's work between 1996 and 2001. For his proof, Wiles was honoured and received numerous awards, including the 2016 Abel Prize.^{[10]}^{[11]}^{[12]}

There are several alternative ways to state Fermat's Last Theorem that are mathematically equivalent to the original statement of the problem.

*In order to state them, we use mathematical notation: let N be the set of natural numbers 1, 2, 3, ..., let Z be the set of integers 0, ±1, ±2, ..., and let Q be the set of rational numbers *a

*/*b

*, where a and b are in*b

**Z**with*≠ 0. In what follows we will call a solution to*xn

*+*yn

*=*zn

*where one or more of x, y, or z is zero a*trivial solution

*. A solution where all three are non-zero will be called a*non-trivial

*solution.*

For comparison's sake we start with the original formulation.

n**Original statement.**With n, x, y, z ∈**N**(meaning that*,*x*,*y*,*z*are all positive whole numbers) and*n*> 2, the equation*xn*+*yn*=*zn*has no solutions.*

Most popular treatments of the subject state it this way. In contrast, almost all mathematics textbooks state it over **Z**:

xn**Equivalent statement 1:***+*yn*=*zn*, where integer n ≥ 3, has no non-trivial solutions x, y, z ∈***Z**.

*The equivalence is clear if n is even. If n is odd and all three of *x*, *y*, *z* are negative, then we can replace *x*, *y*, *z* with −*x*, −*y*, −*z* to obtain a solution in N. If two of them are negative, it must be x and z or y and z. If *x

*,*z

*are negative and y is positive, then we can rearrange to get (−*z

*)*n

*+*yn

*= (−*x

*)*n

*resulting in a solution in*x

**N**; the other case is dealt with analogously. Now if just one is negative, it must be x or y. If x is negative, and y and z are positive, then it can be rearranged to get (−*)*n

*+*zn

*=*yn

*again resulting in a solution in*

**N**; if y is negative, the result follows symmetrically. Thus in all cases a nontrivial solution in**Z**would also mean a solution exists in**N**, the original formulation of the problem.

xn**Equivalent statement 2:***+*yn*=*zn*, where integer n ≥ 3, has no non-trivial solutions x, y, z ∈***Q**.

*This is because the exponent of *x*, *y*, and z are equal (to n), so if there is a solution in Q, then it can be multiplied through by an appropriate common denominator to get a solution in Z, and hence in N.*

xn**Equivalent statement 3:***+*yn*= 1, where integer n ≥ 3, has no non-trivial solutions x, y ∈***Q**.

*A non-trivial solution a, b, c ∈ Z to *xn

*+*yn

*=*zn

*yields the non-trivial solution*a

*/*c

*,*b

*/*c

*∈*vn

**Q**for*+*wn

*= 1. Conversely, a solution*a

*/*b

*,*c

*/*d

*∈*vn

**Q**to*+*wn

*= 1 yields the non-trivial solution*ad

*,*cb

*,*bd

*for*xn

*+*yn

*=*zn

*.*

This last formulation is particularly fruitful, because it reduces the problem from a problem about surfaces in three dimensions to a problem about curves in two dimensions. Furthermore, it allows working over the field **Q**, rather than over the ring **Z**; fields exhibit more structure than rings, which allows for deeper analysis of their elements.

xp**Equivalent statement 4 – connection to elliptic curves:**If a, b, c is a non-trivial solution to*+*yp*=*zp*, p odd prime, then*y2*=*x*(*x*−*ap*)(*x*+*bp*) (Frey curve) will be an elliptic curve.*^{[13]}

*Examining this elliptic curve with Ribet's theorem shows that it does not have a modular form. However, the proof by Andrew Wiles proves that any equation of the form *y2* = *x*(*x* − *an*)(*x* + *bn*) does have a modular form. Any non-trivial solution to *xp* + *yp* = *zp* (with p an odd prime) would therefore create a contradiction, which in turn proves that no non-trivial solutions exist. ^{[14]}*

In other words, any solution that could contradict Fermat's Last Theorem could also be used to contradict the Modularity Theorem. So if the modularity theorem were found to be true, then it would follow that no contradiction to Fermat's Last Theorem could exist either. As described above, the discovery of this equivalent statement was crucial to the eventual solution of Fermat's Last Theorem, as it provided a means by which it could be "attacked" for all numbers at once.

# Mathematical history

*Fermat's equation, *xn* + *yn* = *zn* with positive integer solutions, is an example of a Diophantine equation, ^{[18]} named for the 3rd-century Alexandrian mathematician, Diophantus, who studied them and developed methods for the solution of some kinds of Diophantine equations. A typical Diophantine problem is to find two integers *x

*and*y

*such that their sum, and the sum of their squares, equal two given numbers*A

*and*B

*, respectively:*

*Diophantus's major work is the *Arithmetica*, of which only a portion has survived. ^{[19]} Fermat's conjecture of his Last Theorem was inspired while reading a new edition of the *Arithmetica

*,*

^{[20]}that was translated into Latin and published in 1621 by Claude Bachet.^{[21]}

*Diophantine equations have been studied for thousands of years. For example, the solutions to the quadratic Diophantine equation *x*2 + *y*2 = *z*2 are given by the Pythagorean triples, originally solved by the Babylonians (c. 1800 BC). ^{[22]} Solutions to linear Diophantine equations, such as 26*x

*+ 65*y

*= 13, may be found using the Euclidean algorithm (c. 5th century BC).*cross terms

^{[23]}Many Diophantine equations have a form similar to the equation of Fermat's Last Theorem from the point of view of algebra, in that they have no*mixing two letters, without sharing its particular properties. For example, it is known that there are infinitely many positive integers*x

*,*y

*, and*z

*such that*xn

*+*yn

*=*zm

*where*n

*and*m

*are relatively prime natural numbers.*

^{[2]}

*Problem II.8 of the *Arithmetica* asks how a given square number is split into two other squares; in other words, for a given rational number *k*, find rational numbers *u* and *v* such that *k*2 = *u*2 + *v*2. Diophantus shows how to solve this sum-of-squares problem for *k* = 4 (the solutions being *u* = 16/5 and *v* = 12/5). ^{[24]}*

*Around 1637, Fermat wrote his Last Theorem in the margin of his copy of the *Arithmetica* next to Diophantus's sum-of-squares problem: ^{[25]}*

*After Fermat’s death in 1665, his son Clément-Samuel Fermat produced a new edition of the book (1670) augmented with his father’s comments. ^{[28]} Although not actually a theorem at the time (meaning a mathematical statement for which proof exists), the margin note became known over time as *Fermat’s Last Theorem

*,*

^{[29]}as it was the last of Fermat’s asserted theorems to remain unproved.^{[30]}

*It is not known whether Fermat had actually found a valid proof for all exponents *n*, but it appears unlikely. Only one related proof by him has survived, namely for the case *n* = 4, as described in the section *Proofs for specific exponents*.
While Fermat posed the cases of *n* = 4 and of *n* = 3 as challenges to his mathematical correspondents, such as Marin Mersenne, Blaise Pascal, and John Wallis, ^{[31]} he never posed the general case.^{[32]} Moreover, in the last thirty years of his life, Fermat never again wrote of his "truly marvelous proof" of the general case, and never published it. Van der Poorten^{[33]} suggests that while the absence of a proof is insignificant, the lack of challenges means Fermat realised he did not have a proof; he quotes Weil^{[34]} as saying Fermat must have briefly deluded himself with an irretrievable idea.*

The techniques Fermat might have used in such a "marvelous proof" are unknown.

Taylor and Wiles's proof relies on 20th-century techniques.^{[35]} Fermat's proof would have had to be elementary by comparison, given the mathematical knowledge of his time.

While Harvey Friedman's grand conjecture implies that any provable theorem (including Fermat's last theorem) can be proved using only 'elementary function arithmetic', such a proof need be ‘elementary’ only in a technical sense and could involve millions of steps, and thus be far too long to have been Fermat’s proof.

Only one relevant proof by Fermat has survived, in which he uses the technique of infinite descent to show that the area of a right triangle with integer sides can never equal the square of an integer.^{[36]}^{[37]} His proof is equivalent to demonstrating that the equation

has no primitive solutions in integers (no pairwise coprime solutions). In turn, this proves Fermat's Last Theorem for the case *n* = 4, since the equation *a*4 + *b*4 = *c*4 can be written as *a*4 + *b*4 = (*c*2)2.

Alternative proofs of the case *n* = 4 were developed later^{[38]} by Frénicle de Bessy (1676),^{[39]} Leonhard Euler (1738),^{[40]} Kausler (1802),^{[41]} Peter Barlow (1811),^{[42]} Adrien-Marie Legendre (1830),^{[43]} Schopis (1825),^{[44]} Olry Terquem (1846),^{[45]} Joseph Bertrand (1851),^{[46]} Victor Lebesgue (1853, 1859, 1862),^{[47]} Théophile Pépin (1883),^{[48]} Tafelmacher (1893),^{[49]} David Hilbert (1897),^{[50]} Bendz (1901),^{[51]} Gambioli (1901),^{[52]} Leopold Kronecker (1901),^{[53]} Bang (1905),^{[54]} Sommer (1907),^{[55]} Bottari (1908),^{[56]} Karel Rychlík (1910),^{[57]} Nutzhorn (1912),^{[58]} Robert Carmichael (1913),^{[59]} Hancock (1931),^{[60]} Vrǎnceanu (1966),^{[61]} Grant and Perella (1999),^{[62]} Barbara (2007),^{[63]} and Dolan (2011).^{[64]}

After Fermat proved the special case *n* = 4, the general proof for all *n* required only that the theorem be established for all odd prime exponents.^{[65]} In other words, it was necessary to prove only that the equation *a**n* + *b**n* = *c**n* has no positive integer solutions (*a*, *b*, *c*) when *n* is an odd prime number. This follows because a solution (*a*, *b*, *c*) for a given *n* is equivalent to a solution for all the factors of *n*. For illustration, let *n* be factored into *d* and *e*, *n* = *de*. The general equation

implies that (*a**d*, *b**d*, *c**d*) is a solution for the exponent *e*

Thus, to prove that Fermat's equation has no solutions for *n* > 2, it would suffice to prove that it has no solutions for at least one prime factor of every *n*. Each integer *n* > 2 is divisible by 4 or by an odd prime number (or both). Therefore, Fermat's Last Theorem could be proved for all *n* if it could be proved for *n* = 4 and for all odd primes *p*.

In the two centuries following its conjecture (1637–1839), Fermat's Last Theorem was proved for three odd prime exponents *p* = 3, 5 and 7. The case *p* = 3 was first stated by Abu-Mahmud Khojandi (10th century), but his attempted proof of the theorem was incorrect.^{[66]} In 1770, Leonhard Euler gave a proof of *p* = 3,^{[67]} but his proof by infinite descent^{[68]} contained a major gap.^{[69]} However, since Euler himself had proved the lemma necessary to complete the proof in other work, he is generally credited with the first proof.^{[70]} Independent proofs were published^{[71]} by Kausler (1802),^{[41]} Legendre (1823, 1830),^{[43]}^{[72]} Calzolari (1855),^{[73]} Gabriel Lamé (1865),^{[74]} Peter Guthrie Tait (1872),^{[75]} Günther (1878),^{[76]} Gambioli (1901),^{[52]} Krey (1909),^{[77]} Rychlík (1910),^{[57]} Stockhaus (1910),^{[78]} Carmichael (1915),^{[79]} Johannes van der Corput (1915),^{[80]} Axel Thue (1917),^{[81]} and Duarte (1944).^{[82]}

The case *p* = 5 was proved^{[83]} independently by Legendre and Peter Gustav Lejeune Dirichlet around 1825.^{[84]} Alternative proofs were developed^{[85]} by Carl Friedrich Gauss (1875, posthumous),^{[86]} Lebesgue (1843),^{[87]} Lamé (1847),^{[88]} Gambioli (1901),^{[52]}^{[89]} Werebrusow (1905),^{[90]} Rychlík (1910),^{[91]} van der Corput (1915),^{[80]} and Guy Terjanian (1987).^{[92]}

*The case *p* = 7 was proved ^{[93]} by Lamé in 1839.^{[94]} His rather complicated proof was simplified in 1840 by Lebesgue,^{[95]} and still simpler proofs^{[96]} were published by Angelo Genocchi in 1864, 1874 and 1876.^{[97]} Alternative proofs were developed by Théophile Pépin (1876)^{[98]} and Edmond Maillet (1897).^{[99]}*

*Fermat's Last Theorem was also proved for the exponents *n* = 6, 10, and 14. Proofs for *n* = 6 were published by Kausler, ^{[41]} Thue,^{[100]} Tafelmacher,^{[101]} Lind,^{[102]} Kapferer,^{[103]} Swift,^{[104]} and Breusch.^{[105]} Similarly, Dirichlet^{[106]} and Terjanian^{[107]} each proved the case n = 14, while Kapferer^{[103]} and Breusch^{[105]} each proved the case n = 10. Strictly speaking, these proofs are unnecessary, since these cases follow from the proofs for n = 3, 5, and 7, respectively. Nevertheless, the reasoning of these even-exponent proofs differs from their odd-exponent counterparts. Dirichlet's proof for n = 14 was published in 1832, before Lamé's 1839 proof for n = 7.^{[108]}*

All proofs for specific exponents used Fermat's technique of infinite descent, either in its original form, or in the form of descent on elliptic curves or abelian varieties. The details and auxiliary arguments, however, were often *ad hoc* and tied to the individual exponent under consideration.^{[109]} Since they became ever more complicated as *p* increased, it seemed unlikely that the general case of Fermat's Last Theorem could be proved by building upon the proofs for individual exponents.^{[109]} Although some general results on Fermat's Last Theorem were published in the early 19th century by Niels Henrik Abel and Peter Barlow,^{[110]}^{[111]} the first significant work on the general theorem was done by Sophie Germain.^{[112]}

*In the early 19th century, Sophie Germain developed several novel approaches to prove Fermat's Last Theorem for all exponents. ^{[113]} First, she defined a set of auxiliary primes *θ

*constructed from the prime exponent*p

*by the equation*θ

*= 2*hp

*+ 1, where*h

*is any integer not divisible by three. She showed that, if no integers raised to the*p

*th power were adjacent modulo*θ

*(the*non-consecutivity condition

*), then*θ

*must divide the product*xyz

*. Her goal was to use mathematical induction to prove that, for any given*p

*, infinitely many auxiliary primes*θ

*satisfied the non-consecutivity condition and thus divided*xyz

*; since the product*xyz

*can have at most a finite number of prime factors, such a proof would have established Fermat's Last Theorem. Although she developed many techniques for establishing the non-consecutivity condition, she did not succeed in her strategic goal. She also worked to set lower limits on the size of solutions to Fermat's equation for a given exponent*p

*, a modified version of which was published by Adrien-Marie Legendre. As a byproduct of this latter work, she proved Sophie Germain's theorem, which verified the first case of Fermat's Last Theorem (namely, the case in which*p

*does not divide*xyz

*) for every odd prime exponent less than 270,*p

^{[113]}^{[114]}and for all primes*such that at least one of 2*p

*+1, 4*p

*+1, 8*p

*+1, 10*p

*+1, 14*p

*+1 and 16*p

*+1 is prime (specially, the primes*p

*such that 2*p

*+1 is prime are called Sophie Germain primes). Germain tried unsuccessfully to prove the first case of Fermat's Last Theorem for all even exponents, specifically for*n

*= 2*p

*, which was proved by Guy Terjanian in 1977.*

^{[115]}In 1985, Leonard Adleman, Roger Heath-Brown and Étienne Fouvry proved that the first case of Fermat's Last Theorem holds for infinitely many odd primes*p*.^{[116]}

In 1847, Gabriel Lamé outlined a proof of Fermat's Last Theorem based on factoring the equation *x**p* + *y**p* = *z**p* in complex numbers, specifically the cyclotomic field based on the roots of the number 1. His proof failed, however, because it assumed incorrectly that such complex numbers can be factored uniquely into primes, similar to integers. This gap was pointed out immediately by Joseph Liouville, who later read a paper that demonstrated this failure of unique factorisation, written by Ernst Kummer.

Kummer set himself the task of determining whether the cyclotomic field could be generalized to include new prime numbers such that unique factorisation was restored. He succeeded in that task by developing the ideal numbers.

(Note: It is often stated that Kummer was led to his "ideal complex numbers" by his interest in Fermat's Last Theorem; there is even a story often told that Kummer, like Lamé, believed he had proven Fermat's Last Theorem until Lejeune Dirichlet told him his argument relied on unique factorization; but the story was first told by Kurt Hensel in 1910 and the evidence indicates it likely derives from a confusion by one of Hensel's sources. Harold Edwards says the belief that Kummer was mainly interested in Fermat's Last Theorem "is surely mistaken".^{[117]} See the history of ideal numbers.)

Using the general approach outlined by Lamé, Kummer proved both cases of Fermat's Last Theorem for all regular prime numbers. However, he could not prove the theorem for the exceptional primes (irregular primes) that conjecturally occur approximately 39% of the time; the only irregular primes below 270 are 37, 59, 67, 101, 103, 131, 149, 157, 233, 257 and 263.

*In the 1920s, Louis Mordell posed a conjecture that implied that Fermat's equation has at most a finite number of nontrivial primitive integer solutions, if the exponent *n* is greater than two. ^{[118]} This conjecture was proved in 1983 by Gerd Faltings,^{[119]} and is now known as Faltings's theorem.*

In the latter half of the 20th century, computational methods were used to extend Kummer's approach to the irregular primes. In 1954, Harry Vandiver used a SWAC computer to prove Fermat's Last Theorem for all primes up to 2521.^{[120]} By 1978, Samuel Wagstaff had extended this to all primes less than 125,000.^{[121]} By 1993, Fermat's Last Theorem had been proved for all primes less than four million.^{[122]}

However despite these efforts and their results, no proof existed of Fermat's Last Theorem. Proofs of individual exponents by their nature could never prove the *general* case: even if all exponents were verified up to an extremely large number X, a higher exponent beyond X might still exist for which the claim was not true. (This had been the case with some other past conjectures, and it could not be ruled out in this conjecture.)^{[123]}

The strategy that ultimately led to a successful proof of Fermat's Last Theorem arose from the "astounding"^{[124]} ^{[]} Taniyama–Shimura–Weil conjecture, proposed around 1955—which many mathematicians believed would be near to impossible to prove,^{[124]} ^{[]} and was linked in the 1980s by Gerhard Frey, Jean-Pierre Serre and Ken Ribet to Fermat's equation. By accomplishing a partial proof of this conjecture in 1994, Andrew Wiles ultimately succeeded in proving Fermat's Last Theorem, as well as leading the way to a full proof by others of what is now the modularity theorem.

Around 1955, Japanese mathematicians Goro Shimura and Yutaka Taniyama observed a possible link between two apparently completely distinct branches of mathematics, elliptic curves and modular forms. The resulting modularity theorem (at the time known as the Taniyama–Shimura conjecture) states that every elliptic curve is modular, meaning that it can be associated with a unique modular form.

The link was initially dismissed as unlikely or highly speculative, but was taken more seriously when number theorist André Weil found evidence supporting it, though not proving it; as a result the conjecture was often known as the Taniyama–Shimura–Weil conjecture. It became a part of the Langlands programme, a list of important conjectures needing proof or disproof.^{[124]} ^{[]}

Even after gaining serious attention, the conjecture was seen by contemporary mathematicians as extraordinarily difficult or perhaps inaccessible to proof.^{[124]} ^{[]} For example, Wiles's doctoral supervisor John Coates states that it seemed "impossible to actually prove",^{[124]} ^{[]} and Ken Ribet considered himself "one of the vast majority of people who believed [it] was completely inaccessible", adding that "Andrew Wiles was probably one of the few people on earth who had the audacity to dream that you can actually go and prove [it]."^{[124]} ^{[]}

In 1984, Gerhard Frey noted a link between Fermat's equation and the modularity theorem, then still a conjecture. If Fermat's equation had any solution (*a*, *b*, *c*) for exponent *p* > 2, then it could be shown that the semi-stable elliptic curve (now known as a Frey-Hellegouarch^{[3]})

would have such unusual properties that it was unlikely to be modular.^{[125]} This would conflict with the modularity theorem, which asserted that all elliptic curves are modular. As such, Frey observed that a proof of the Taniyama–Shimura–Weil conjecture might also simultaneously prove Fermat's Last Theorem.^{[126]} By contraposition, a *disproof* or refutation of Fermat's Last Theorem would disprove the Taniyama–Shimura–Weil conjecture.

In plain English, Frey had shown that, if this intuition about his equation was correct, then any set of 4 numbers (a, b, c, n) capable of disproving Fermat's Last Theorem, could also be used to disprove the Taniyama–Shimura–Weil conjecture. Therefore if the latter were true, the former could not be disproven, and would also have to be true.

Following this strategy, a proof of Fermat's Last Theorem required two steps. First, it was necessary to prove the modularity theorem – or at least to prove it for the types of elliptical curves that included Frey's equation (known as semistable elliptic curves). This was widely believed inaccessible to proof by contemporary mathematicians.^{[124]} ^{[]} Second, it was necessary to show that Frey's intuition was correct: that if an elliptic curve were constructed in this way, using a set of numbers that were a solution of Fermat's equation, the resulting elliptic curve could not be modular. Frey showed that this was *plausible* but did not go as far as giving a full proof. The missing piece (the so-called "epsilon conjecture", now known as Ribet's theorem) was identified by Jean-Pierre Serre who also gave an almost-complete proof and the link suggested by Frey was finally proved in 1986 by Ken Ribet.^{[127]}

Following Frey, Serre and Ribet's work, this was where matters stood:

- Fermat's Last Theorem needed to be proven for all exponents
*n*that were prime numbers. - The modularity theorem – if proved for semi-stable elliptic curves – would mean that all semistable elliptic curves
*must*be modular. - Ribet's theorem showed that any solution to Fermat's equation for a prime number could be used to create a semistable elliptic curve that
*could not*be modular; - The only way that both of these statements could be true, was if
*no*solutions existed to Fermat's equation (because then no such curve could be created), which was what Fermat's Last Theorem said. As Ribet's Theorem was already proved, this meant that a proof of the Modularity Theorem would automatically prove Fermat's Last theorem was true as well.

Ribet's proof of the epsilon conjecture in 1986 accomplished the first of the two goals proposed by Frey. Upon hearing of Ribet's success, Andrew Wiles, an English mathematician with a childhood fascination with Fermat's Last Theorem, and who had worked on elliptic curves, decided to commit himself to accomplishing the second half: proving a special case of the modularity theorem (then known as the Taniyama–Shimura conjecture) for semistable elliptic curves.^{[128]}

Wiles worked on that task for six years in near-total secrecy, covering up his efforts by releasing prior work in small segments as separate papers and confiding only in his wife.^{[124]} ^{[]} His initial study suggested proof by induction,^{[124]} ^{[]} and he based his initial work and first significant breakthrough on Galois theory^{[124]} ^{[]} before switching to an attempt to extend horizontal Iwasawa theory for the inductive argument around 1990–91 when it seemed that there was no existing approach adequate to the problem.^{[124]} ^{[]} However, by the summer of 1991, Iwasawa theory also seemed to not be reaching the central issues in the problem.^{[124]} ^{[]} ^{[129]} In response, he approached colleagues to seek out any hints of cutting edge research and new techniques, and discovered an Euler system recently developed by Victor Kolyvagin and Matthias Flach that seemed "tailor made" for the inductive part of his proof.^{[124]} ^{[]} Wiles studied and extended this approach, which worked. Since his work relied extensively on this approach, which was new to mathematics and to Wiles, in January 1993 he asked his Princeton colleague, Nick Katz, to help him check his reasoning for subtle errors. Their conclusion at the time was that the techniques Wiles used seemed to work correctly.^{[124]} ^{[]} ^{[130]}

By mid-May 1993, Wiles felt able to tell his wife he thought he had solved the proof of Fermat's Last Theorem,^{[124]} ^{[]} and by June he felt sufficiently confident to present his results in three lectures delivered on 21–23 June 1993 at the Isaac Newton Institute for Mathematical Sciences.^{[131]} Specifically, Wiles presented his proof of the Taniyama–Shimura conjecture for semistable elliptic curves; together with Ribet's proof of the epsilon conjecture, this implied Fermat's Last Theorem. However, it became apparent during peer review that a critical point in the proof was incorrect. It contained an error in a bound on the order of a particular group. The error was caught by several mathematicians refereeing Wiles's manuscript including Katz (in his role as reviewer),^{[132]} who alerted Wiles on 23 August 1993.^{[133]}

The error would not have rendered his work worthless – each part of Wiles's work was highly significant and innovative by itself, as were the many developments and techniques he had created in the course of his work, and only one part was affected.^{[124]} ^{[]} However without this part proved, there was no actual proof of Fermat's Last Theorem. Wiles spent almost a year trying to repair his proof, initially by himself and then in collaboration with his former student Richard Taylor, without success.^{[134]}^{[135]}^{[136]} By the end of 1993, rumours had spread that under scrutiny, Wiles's proof had failed, but how seriously was not known. Mathematicians were beginning to pressure Wiles to disclose his work whether or not complete, so that the wider community could explore and use whatever he had managed to accomplish. But instead of being fixed, the problem, which had originally seemed minor, now seemed very significant, far more serious, and less easy to resolve.^{[137]}

Wiles states that on the morning of 19 September 1994, he was on the verge of giving up and was almost resigned to accepting that he had failed, and to publishing his work so that others could build on it and find the error. He adds that he was having a final look to try and understand the fundamental reasons for why his approach could not be made to work, when he had a sudden insight – that the specific reason why the Kolyvagin–Flach approach would not work directly *also* meant that his original attempts using Iwasawa theory could be made to work, if he strengthened it using his experience gained from the Kolyvagin–Flach approach. Fixing one approach with tools from the other approach would resolve the issue for all the cases that were not already proven by his refereed paper.^{[134]}^{[138]} He described later that Iwasawa theory and the Kolyvagin–Flach approach were each inadequate on their own, but together they could be made powerful enough to overcome this final hurdle.^{[134]}

On 24 October 1994, Wiles submitted two manuscripts, "Modular elliptic curves and Fermat's Last Theorem"^{[140]} and "Ring theoretic properties of certain Hecke algebras",^{[141]} the second of which was co-authored with Taylor and proved that certain conditions were met that were needed to justify the corrected step in the main paper. The two papers were vetted and published as the entirety of the May 1995 issue of the *Annals of Mathematics*. These papers established the modularity theorem for semistable elliptic curves, the last step in proving Fermat's Last Theorem, 358 years after it was conjectured.

The full Taniyama–Shimura–Weil conjecture was finally proved by Diamond (1996), Conrad, Diamond & Taylor (1999), and Breuil et al. (2001) who, building on Wiles's work, incrementally chipped away at the remaining cases until the full result was proved.^{[142]}^{[143]}^{[144]} The now fully proved conjecture became known as the modularity theorem.

Several other theorems in number theory similar to Fermat's Last Theorem also follow from the same reasoning, using the modularity theorem. For example: no cube can be written as a sum of two coprime *n*-th powers, *n* ≥ 3. (The case *n* = 3 was already known by Euler.)

# Relationship to other problems and generalizations

Fermat's Last Theorem considers solutions to the Fermat equation: *a**n* + *b**n* = *c**n* with positive integers *a*, *b*, and *c* and an integer *n* greater than 2. There are several generalizations of the Fermat equation to more general equations that allow the exponent *n* to be a negative integer or rational, or to consider three different exponents.

The generalized Fermat equation generalizes the statement of Fermat's last theorem by considering positive integer solutions *a, b, c, m, n, k* satisfying^{[145]}

In particular, the exponents *m*, *n*, *k* need not be equal, whereas Fermat's last theorem considers the case *m* = *n* = *k*.

*The Beal conjecture, also known as the Mauldin conjecture ^{[146]} and the Tijdeman-Zagier conjecture,^{[147]}^{[148]}^{[149]} states that there are no solutions to the generalized Fermat equation in positive integers *a

*,*b

*,*c

*,*m

*,*n

*,*k

*with*a

*,*b

*, and*c

*being pairwise coprime and all of*m

*,*n

*,*k

*being greater than 2.*

^{[150]}

*The Fermat–Catalan conjecture generalizes Fermat's last theorem with the ideas of the Catalan conjecture. ^{[151]}^{[152]} The conjecture states that the generalized Fermat equation has only *finitely many

*solutions (*a

*,*b

*,*c

*,*m

*,*n

*,*k

*) with distinct triplets of values (*am

*,*bn

*,*ck

*), where*a

*,*b

*,*c

*are positive coprime integers and*m

*,*n

*,*k

*are positive integers satisfying*

The statement is about the finiteness of the set of solutions because there are 10 known solutions.^{[145]}

*for positive integers *r, s, t* with *s* and *t* coprime.*

*for positive, coprime integers *m*, *k*.*

*for coprime integers *u*, *v* with *v* > *u*. The geometric interpretation is that *a* and *b* are the integer legs of a right triangle and *d* is the integer altitude to the hypotenuse. Then the hypotenuse itself is the integer*

*so (*a, b, c*) is a Pythagorean triple.*

*The abc conjecture roughly states that if three positive integers *a*, *b* and *c* (hence the name) are coprime and satisfy *a* + *b* = *c*, then the radical *d* of *abc* is usually not much smaller than *c*. In particular, the abc conjecture in its most standard formulation implies Fermat's last theorem for *n* that are sufficiently large. ^{[159]} The modified Szpiro conjecture is equivalent to the abc conjecture and therefore has the same implication.^{[160]} An effective version of the abc conjecture, or an effective version of the modified Szpiro conjecture, implies Fermat's Last Theorem outright.^{[161]}*

# Monetary prizes

In 1816, and again in 1850, the French Academy of Sciences offered a prize for a general proof of Fermat's Last Theorem.^{[162]} In 1857, the Academy awarded 3,000 francs and a gold medal to Kummer for his research on ideal numbers, although he had not submitted an entry for the prize.^{[163]} Another prize was offered in 1883 by the Academy of Brussels.^{[164]}

In 1908, the German industrialist and amateur mathematician Paul Wolfskehl bequeathed 100,000 gold marks—a large sum at the time—to the Göttingen Academy of Sciences to offer as a prize for a complete proof of Fermat's Last Theorem.^{[165]} On 27 June 1908, the Academy published nine rules for awarding the prize. Among other things, these rules required that the proof be published in a peer-reviewed journal; the prize would not be awarded until two years after the publication; and that no prize would be given after 13 September 2007, roughly a century after the competition was begun.^{[166]} Wiles collected the Wolfskehl prize money, then worth $50,000, on 27 June 1997.^{[167]} In March 2016, Wiles was awarded the Norwegian government's Abel prize worth €600,000 for "his stunning proof of Fermat’s Last Theorem by way of the modularity conjecture for semistable elliptic curves, opening a new era in number theory."^{[168]}

Prior to Wiles's proof, thousands of incorrect proofs were submitted to the Wolfskehl committee, amounting to roughly 10 feet (3 meters) of correspondence.^{[169]} In the first year alone (1907–1908), 621 attempted proofs were submitted, although by the 1970s, the rate of submission had decreased to roughly 3–4 attempted proofs per month. According to F. Schlichting, a Wolfskehl reviewer, most of the proofs were based on elementary methods taught in schools, and often submitted by "people with a technical education but a failed career".^{[170]} In the words of mathematical historian Howard Eves, "Fermat's Last Theorem has the peculiar distinction of being the mathematical problem for which the greatest number of incorrect proofs have been published."^{[164]}

# In popular culture

*In *The Simpsons* episode "The Wizard of Evergreen Terrace" Homer writes the equation*

on a blackboard, which appears to be a counterexample to Fermat's Last Theorem. The equation appears to be correct if entered in a calculator with 10 significant figures.^{[171]}

In "The Royale", a 1989 episode of the 24th-century-set TV series *Star Trek: The Next Generation*, Picard tells Commander Riker about his attempts to solve the theorem, "still unsolved" after 800 years. He concludes, "In our arrogance, we feel we are so advanced. And yet we cannot unravel a simple knot tied by a part-time French mathematician working alone without a computer."^{[172]} (Andrew Wiles's insight leading to his breakthrough proof happened four months after the series ended.^{[173]})

# See also

- abc conjecture
- Beal conjecture
- Diophantus II.VIII
- Euler's sum of powers conjecture
- Fermat–Catalan conjecture
- Modularity theorem
- Proof of impossibility
- Pythagorean triple
- Sophie Germain prime
- Sums of powers, a list of related conjectures and theorems
- Wall–Sun–Sun prime