.
You mistakenly attribute authorship of this statement to Pierre Fermat .
This statement is "VERY plain Math" (= "trivial"), which every student can easily prove in one line
(well, every student who attends a Math circle or has the corresponding level).
Let p = 2n+1 is prime number. Then p = (n+1)^2 - n^2 is the presentation you are talking about.
Pierre Fermat was great mathematician of his time and all times.
He was one of founders of the Number theory and some other branches of Math.
Becide beeing a great mathematician, he was a great communicator exchanging by Math letters and Math manuscripts
with many contemporary European mathematicians of his time, his colleagues.
He knew very well the scale of his talents and the scale of his personality,
so he would NEVER announced authorship of such plain statement.
What he REALLY proved, was TOTALLY DIFFERENT statement:
Every prime number of the form p = 4n+1 is the sum of two squares.
See this Wikipedia article https://en.wikipedia.org/wiki/Fermat%27s_theorem_on_sums_of_two_squares
This statement is FAR from to be trivial and is the part of any contemporary textbook in Number theory.