# Fermat's right triangle theorem

Fermat's right triangle theorem is a non-existence proof in number theory, published in 1670 among the works of Pierre de Fermat, soon after his death. It is the only complete proof given by Fermat. It has many equivalent formulations, one of which was stated (but not proved) in 1225 by Fibonacci. In its geometric forms, it states:
* A right triangle in the Euclidean plane for which all three side lengths are rational numbers cannot have an area that is the square of a rational number. The area of a rational-sided right triangle is called a congruent number, so no congruent number can be square.
* A right triangle and a square with equal areas cannot have all sides commensurate with each other.
* There do not exist two integer-sided right triangles in which the two legs of one triangle are the leg and hypotenuse of the other triangle.
More abstractly, as a result about Diophantine equations (integer or rational-number solutions to polynomial equations), it is equivalent to the statements that:
* If three square numbers form an arithmetic progression, then the gap between consecutive numbers in the progression (called a congruum) cannot itself be square.
* The only rational points on the elliptic curve $y^{2}=x(x-1)(x+1)$ are the three trivial points with $x\in \{-1,0,1\}$ and $y=0$.
* The quartic equation $x^{4}-y^{4}=z^{2}$ has no nonzero integer solution.
An immediate consequence of the last of these formulations is that Fermat's Last Theorem is true in the special case that its exponent is 4.

## Formulation
### Squares in arithmetic progression

In 1225, Emperor Frederick II challenged the mathematician Fibonacci to take part in a mathematical contest against several other mathematicians, with three problems set by his court philosopher John of Palermo. The first of these problems asked for three rational numbers whose squares were equally spaced five units apart, solved by Fibonacci with the three numbers ${\tfrac {31}{12}}$, ${\tfrac {41}{12}}$, and ${\tfrac {49}{12}}$. In The Book of Squares, published later the same year by Fibonacci, he solved the more general problem of finding triples of square numbers that are equally spaced from each other, forming an arithmetic progression. Fibonacci called the gap between these numbers a congruum. One way of describing Fibonacci's solution is that the numbers to be squared are the difference of legs, hypotenuse, and sum of legs of a Pythagorean triangle, and that the congruum is four times the area of the same triangle. Fibonacci observed that it is impossible for a congruum to be a square number itself, but did not present a satisfactory proof of this fact.
If three squares $a^{2}$, $b^{2}$, and $c^{2}$ could form an arithmetic progression whose congruum was also a square $d^{2}$, then these numbers would satisfy the Diophantine equations ${\begin{aligned}a^{2}+d^{2}&=b^{2},\\b^{2}+d^{2}&=c^{2}.\\\end{aligned}}$ That is, by the Pythagorean theorem, they would form two integer-sided right triangles in which the pair $(d,b)$ gives one leg and the hypotenuse of the smaller triangle and the same pair also forms the two legs of the larger triangle. But if (as Fibonacci asserted) no square congruum can exist, then there can be no two integer right triangles that share two sides in this way.

### Areas of right triangles

Because the congrua are exactly the numbers that are four times the area of a Pythagorean triangle, and multiplication by four does not change whether a number is square, the existence of a square congruum is equivalent to the existence of a Pythagorean triangle with a square area. It is this variant of the problem that Fermat's proof concerns: he shows that there is no such triangle. In considering this problem, Fermat was inspired not by Fibonacci but by an edition of Arithmetica by Diophantus, published in a translation into French in 1621 by Claude Gaspar Bachet de Méziriac. This book described various special right triangles whose areas had forms related to squares, but did not consider the case of areas that were themselves square.
By rearranging the equations for the two Pythagorean triangles above, and then multiplying them together, one obtains the single Diophantine equation $b^{4}-d^{4}=(b^{2}-d^{2})(b^{2}+d^{2})=a^{2}c^{2}$ which can be simplified by introducing a new variable $e=ac$ to $b^{4}-d^{4}=e^{2}.$ Conversely, any three positive integers obeying the equation $b^{4}-d^{4}=e^{2}$ lead to a square congruum: for these numbers, the squares $(b^{4}-d^{4}-2b^{2}d^{2})^{2}$, $(b^{4}+d^{4})^{2}$, and $(b^{4}-d^{4}+2b^{2}d^{2})^{2}$ form an arithmetic progression with congruum $4b^{2}d^{2}(b^{4}-d^{4})=(2bde)^{2}$, which is a square itself. Thus, the solvability of $b^{4}-d^{4}=e^{2}$ is equivalent to the existence of a square congruum. But, if Fermat's Last Theorem had a counterexample for the exponent $4$, an integer solution to the equation $x^{4}+y^{4}=z^{4}$, then squaring one of the three numbers in the counterexample would give three numbers that solve the equation $b^{4}-d^{4}=e^{2}$. Therefore, Fermat's proof that no Pythagorean triangle has a square area implies the truth of the exponent-$4$ case of Fermat's Last Theorem.
Another equivalent formulation of the same problem involves congruent numbers, the numbers that are areas of right triangles whose three sides are all rational numbers. By multiplying the sides by a common denominator, any congruent number may be transformed into the area of a Pythagorean triangle, from which it follows that the congruent numbers are exactly the numbers formed by multiplying a congruum by the square of a rational number. Therefore, the existence of a square congruum is equivalent to the statement that the number 1 is not a congruent number. Another more geometric way of stating this formulation is that it is impossible for a square (the geometric shape) and a right triangle to have both equal areas and all sides commensurate with each other.

### Elliptic curve

Yet another equivalent form of Fermat's theorem involves the elliptic curve consisting of the points whose Cartesian coordinates $(x,y)$ satisfy the equation $y^{2}=x(x+1)(x-1).$ The points (−1,0), (0,0), and (1,0), provide obvious solutions to this equation. Fermat's theorem is equivalent to the statement that these are the only points on the curve for which both $x$ and $y$ are rational. More generally, the right triangles with rational sides and area $n$ correspond one-for-one with the rational points with positive $y$-coordinate on the elliptic curve $y^{2}=x(x+n)(x-n)$.

## Fermat's proof

During his lifetime, Fermat challenged several other mathematicians to prove the non-existence of a Pythagorean triangle with square area, but did not publish the proof himself. However, he wrote a proof in his copy of Diophantus's Arithmetica, the same copy in which he wrote that he could prove Fermat's Last Theorem. Fermat's son Clement-Samuel published an edition of this book, including Fermat's marginal notes with the proof of the right triangle theorem, in 1670.
Fermat's proof is a proof by infinite descent. It shows that, from any example of a Pythagorean triangle with square area, one can derive a smaller example. Since Pythagorean triangles have positive integer areas, and there does not exist an infinite descending sequence of positive integers, there also cannot exist a Pythagorean triangle with square area.
In more detail, suppose that $x$, $y$, and $z$ are the integer sides of a right triangle with square area. By dividing by any common factors, one can assume that this triangle is primitive and from the known form of all primitive Pythagorean triples, one can set $x=2pq$, $y=p^{2}-q^{2}$, and $z=p^{2}+q^{2}$, by which the problem is transformed into finding relatively prime integers $p$ and $q$ (one of which is even) such that the area $pq(p^{2}-q^{2})$ is square. For this number to be a square, its four linear factors $p$, $q$, $p+q$, and $p-q$ (which are relatively prime) must themselves be squares; let $p+q=r^{2}$ and $p-q=s^{2}$. Both $r$ and $s$ must be odd since exactly one of $p$ or $q$ is even and the other is odd. Therefore, both $r-s$ and $r+s$ are even, and one of them is divisible by 4. Dividing them by two produces two more integers $u=(r-s)/2$ and $v=(r+s)/2$, one of which is even by the previous sentence. Because $u^{2}+v^{2}=(r^{2}+s^{2})/2=p$ is a square, $u$ and $v$ are the legs of another primitive Pythagorean triangle whose area is $uv/2=q/4$. Since $q$ is itself a square and since $uv$ is even, $q/4$ is a square. Thus, any Pythagorean triangle with square area leads to a smaller Pythagorean triangle with square area, completing the proof.