# How did Fermat come up with his Last Theorem?

It's usually believed that Fermat's claim that he had a proof for the Last Theorem is false, and that it might have been more of a conjecture. Or considering it took many centuries and advanced mathematics to prove it, Fermat may have been mistaken in thinking he did have a proof.

But how did he come up with that theorem in the first place?

• What is known is described in Wikipedia. The original motivation came from trying to generalize Pythagorean triples in Diophantus. A common speculation is that he originally thought that his method of infinite descent that worked for $n=4$ would work for all $n$, but later realized his mistake. He never stated the general case after the famous original note on the margins. Sep 4 at 23:08
• As @Conifold said: Fermat never mentioned his claim to the public, so it is to be assumed he quickly realized that his reputed proof was faulty. Sep 4 at 23:39
• He was evidently thinking about $x^2+y^2=z^2$ which he saw in the book of Diophantus. Sep 4 at 23:39
• It cannot be true that "It's usually believed that Fermat's claim that he had a proof for the Last Theorem is false" since the theorem is provably false. Sep 5 at 21:38
• @JeremyBoden To the best of our current knowledge, FLT has been proved (true) and has never been proved false. Sep 6 at 17:03