17th-century conjecture proved by Andrew Wiles in 1994
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 infinitely many solutions.
The proposition was first stated as a theorem by Pierre de Fermat around 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. Although other statements claimed by Fermat without proof were subsequently proven by others and credited as theorems of Fermat (for example, Fermat's theorem on sums of two squares), Fermat's Last Theorem resisted proof, leading to doubt that Fermat ever had a correct proof. Consequently, the proposition became known as a conjecture rather than a theorem. 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. It also proved much of the Taniyama–Shimura conjecture, subsequently known as 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 and 20th centuries. 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.
 ;templatestyles src="Template:TOC limit/styles.css" / ;
Overview.
Pythagorean origins.
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 being 3, 4, 5). Around 1637, Fermat wrote in the margin of a book that the more general equation "a""n" + "b""n" = "c""n" 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 none 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.
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.
Subsequent developments and solution.
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. 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"). These papers by Frey, Serre and Ribet showed that if the Taniyama–Shimura conjecture 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 Taniyama–Shimura conjecture. So if the modularity theorem were found to be true, then by definition, no solution contradicting Fermat's Last Theorem could exist, meaning that Fermat's Last Theorem must also be true.
Although both problems were daunting and widely considered to be "completely inaccessible" to proof at the time, 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. Unlike Fermat's Last Theorem, the Taniyama–Shimura conjecture was a major active research area and viewed as more within reach of contemporary mathematics. However, general opinion was that this simply showed the impracticality of proving the Taniyama–Shimura conjecture. Mathematician John Coates' quoted reaction was a common one:
 ;templatestyles src="Template:Blockquote/styles.css" / ;I myself was very sceptical that the beautiful link between Fermat's Last Theorem and the Taniyama–Shimura conjecture would actually lead to anything, because I must confess I did not think that the Taniyama–Shimura conjecture was accessible to proof. Beautiful though this problem was, it seemed impossible to actually prove. I must confess I thought I probably wouldn't see it proved in my lifetime.
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.
Equivalent statements of the theorem.
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 the following notations: 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 Z with "b" ≠ 0. In what follows we will call a solution to "x""n" + "y""n" 
 "z""n" where one or more of x, y, or z is zero a "trivial solution". A solution where all three are nonzero will be called a "non-trivial" solution.
For comparison's sake we start with the original formulation.
 "z""n" has no solutions.
Most popular treatments of the subject state it this way. It is also commonly stated over Z:
 "z""n", 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" + "y""n" 
 (−"x")"n" resulting in a solution in 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 (−"x")"n" + "z""n" 
 "y""n" 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.
 "z""n", where integer "n" ≥ 3, has no non-trivial solutions "x", "y", "z" ∈ Q.
This is because the exponents 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.
 1, where integer "n" ≥ 3, has no non-trivial solutions "x", "y" ∈ Q.
A non-trivial solution a, b, c ∈ Z to "x""n" + "y""n" 
 "z""n" yields the non-trivial solution "a"/"c", "b"/"c" ∈ Q for "v""n" + "w""n" 
 1. Conversely, a solution "a"/"b", "c"/"d" ∈ Q to "v""n" + "w""n" 
 1 yields the non-trivial solution "ad", "cb", "bd" for "x""n" + "y""n" 
 "z""n".
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.
 "c""p", p odd prime, then "y""2" 
 "x"("x" − "a""p")("x" + "b""p") (Frey curve) will be an elliptic curve without a modular form.
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 "y""2" 
 "x"("x" − "a""n")("x" + "b""n") does have a modular form. Any non-trivial solution to (with p an odd prime) would therefore create a contradiction, which in turn proves that no non-trivial solutions exist.
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.
Pythagoras and Diophantus.
Pythagorean triples.
In ancient times it was known that a triangle whose sides were in the ratio 3:4:5 would have a right angle as one of its angles. This was used in construction and later in early geometry. It was also known to be one example of a general rule that any triangle where the length of two sides, each squared and then added together (32 + 42 = 9 + 16 = 25), equals the square of the length of the third side (52 = 25), would also be a right angle triangle. This is now known as the Pythagorean theorem, and a triple of numbers that meets this condition is called a Pythagorean triple; both are named after the ancient Greek Pythagoras. Examples include (3, 4, 5) and (5, 12, 13). There are infinitely many such triples, and methods for generating such triples have been studied in many cultures, beginning with the Babylonians and later ancient Greek, Chinese, and Indian mathematicians. Mathematically, the definition of a Pythagorean triple is a set of three integers ("a", "b", "c") that satisfy the equation "a"2 + "b"2 = "c"2.
Diophantine equations.
Fermat's equation, "x""n" + "y""n" = "z""n" with positive