Thanks to a complicated week-end, I ended up reading a book called Fermat's Last Theorem. It's a terrible book, wrong on the historical, and on the mathematical side, which is no small feat.
Everywhere in it, it's written that Fermat was known to not write complete proofs (or proofs at all) for his theorems, challenging his colleagues to prove them. This was of course getting on everyone's nerve. At some point, I stumbled upon this line:
Fermat shown that 26 is the only number sandwiched between a perfect square number ($$25 = 5^2$$) and a perfect cubic one ($$27 = 3^3$$) The proof is interesting but non-trivial.
And then the book moves on to something else. I was a tad pissed off, so I decided to find the proof by myself. But because I didn't want to get stuck, I ask a more mathematics-versed friend of mine about this project, and he answered me that albeit this is a complex problem, he knew that I was capable of doing it.
Like almost every post on this blog, this article will be detailed enough so everyone, even with a light background, can understand what's going on. The obvious hint in our pocket, here we go! We can rewrite the theorem as:
%% 5^2 < 26 < 3^3 %%
or
%% \forall x \in \mathbb{N}^{*}; x-1 = a^2; x+1 = b^3 \Rightarrow x = 26; a = 5; b = 3 %%
If we subtract the two equalities ($$x - 1 = a^2$$ and $$x + 1 = b^3$$), we obtain $$-2 = a^2 - b^3$$ This type of equation is called a diophantine equation (and this one is a Mordell curve). Unfortunately for us, Yuri Matiyasevich proved that there is no general algorithm to solve them. This is the 10th Hilbert problem by the way. There is some modern research about how to solve them, but I'm quite sure that Fermat managed to find an easier way.
That being said, time to use our hint: a complex problem. If you don't know what a complex number is, you should go read about them, but if you're lazy, all you need to know to understand this article is that $$i^2 = -1$$, so we can factorise the first equation:
%% \begin{aligned} -2 &= x^2 - y^3\\ y^3 &= x^2 + 2\\ y^3 &= (x + i\sqrt{2})(x - i\sqrt{2}) \end{aligned} %%
Now, we've got two interestingly similar part in our equation: $$(x + i\sqrt{2})$$ and $$(x - i\sqrt{2})$$. One way to have a better understanding on how two numbers are related is to try to find their GCD, because if they are mutual primes (numbers that don't share factors except the number $$1$$) we'll likely be able to simplify a bit our equation.
An algebraic integer of the form $$a+b\sqrt(D)$$ where $$D$$ is square-free is called a quadratic field, meaning that we're now playing in the imaginary quadratic field $$\mathbb{Z}[\sqrt{-2}]$$. Square-free means that its prime decomposition contains no repeated factors. This means that the numbers that we're going to manipulate are of the form $$a + bi\sqrt{2}$$.
Anyway, what is important here, is that $$2$$ is a Heegner number, meaning that numbers in our field have unique factorization. This is also the case on our usual domain $$\mathbb{N}$$ also known as the naturals ring, thanks to the fundamental theorem of arithmetic . But this is not the case, for example in $$\mathbb{Z}[i\sqrt{5}]$$ where you can write $$6 = 2\cdot{}3$$ but also $$6 = (1 + i\sqrt{5})(1 - i\sqrt{5})$$.
Ok, back to business, computing the GCD of $$x+i\sqrt{2}$$ and $$x-i\sqrt{2}$$ in $$\mathbb{Z}[i\sqrt{2}]$$:
%% \begin{aligned} gcd(x+i\sqrt{2}, x-i\sqrt{2}) &= gcd(x+i\sqrt{2}, (x+i\sqrt{2})-(x-i\sqrt{2}))\\ &= gcd(x+i\sqrt{2}, 2i\sqrt{2})\\ &= gcd(x+i\sqrt{2}, \sqrt{2}^{2}i\sqrt{2})\\ &= gcd(x+i\sqrt{2}, i\sqrt{2}^3)\\ &= 1, \text{since } x\in\mathbb{N} \end{aligned} %%
The trick used in the first line is that when you compute $$gcd(A, B)$$ you can add as many $$A$$ as you want to $$B$$, it doesn't change the result: $$gcd(A, B) = gcd(A, B+NA)$$.
Now that we proved that $$x-i\sqrt{2}$$ and $$x+i\sqrt{2}$$ are relative primes, time to go back to our original equation : $$y^3 = (x + i\sqrt{2})(x - i\sqrt{2})$$. We can express $$y$$ as a unique decomposition of prime factors $$p_1, p_2, p_3, ...$$, like $$y = p_1^{a_1} \cdot p_2^{a_2} \cdot ...$$ properly written as $$\prod_{i \in I}p_i^{a_i}$$, meaning that $$y^3 = \prod_{i \in I}p_i^{3a_i}$$
Since $$x + i\sqrt{2}$$ and $$x - i\sqrt{2}$$ are relative primes, there is a non-empty set $$J \subset I$$ so that $$x \pm i\sqrt{2} = (\prod_{j \in J}p_j^{\alpha{}_j})^3$$, so $$x \pm i\sqrt{2}$$ is a cube in $$\mathbb{Z}[i\sqrt{2}]$$.
%% \begin{aligned} x + i\sqrt{2} &= (a + bi\sqrt{2})^3\\ &= a^3 + 3a^2bi\sqrt{2} - 6ab^2 - 2b^3i\sqrt{2}\\ &= (a^3 - 6ab^2) + (3a^2b - 2b^3)i\sqrt{2}\\ &= (a^3 - 6ab^2) + b(3a^2 - 2b^2)i\sqrt{2} \end{aligned} %%
Since $$x \in \mathbb{N}$$, we can now split the equality in two part:
%% \begin{cases} x = a^3 - 6ab^2 \\ 1 = b(3a^2 - 2b^2) \end{cases} %%
- From the second one, we can deduce that $$b = \pm 1$$ and $$3a^2 - 2b^2 = \pm 1$$. Because $$b = \pm 1$$, $$b^2 = 1$$, so $$3a^2 = 2 \pm 1$$, and since $$3a^2 = 1$$ is impossible, the only solution is $$a = \pm 1$$
- From the first one, we can now write that $$x = a^3 -6ab^2 = 5$$ and the only positive outcome possible is $$x = 5$$.
Back to our initial equation $$x^2 + 2 = y^3$$ we can now replace $$x$$ with $$5$$, giving us $$25 + 2 = y^3 \Leftrightarrow y = \sqrt[3]{27} \Leftrightarrow y = 3$$
And we just proved that the only solution to $$y^3 = x^2 + 2$$ is $$x = 5$$ and $$y = 3$$. ■
Now I don't know if I should thank or hate Fermat
for keeping me busy my whole week-end, but this article was also a great excuse
to give a try to mathjax
KaTeX to write some fancy-looking maths
anyway.
edit: Thanks to Armavica for spotting some (now fixed) mistakes