Although there is little evidence concerning Pierre Fermat's school education, it must have been at the local Franciscan monastery. He attended the University of Toulouse before moving to Bordeaux in the second half of the 1620's. In Bordeaux he began his first serious mathematical researches. During this time he produced important work on maxima and minima. From there Fermat went to Orléans where he studied law at the University. He received a degree in civil law and he purchased the offices of councillor at the parliament in Toulouse. So by 1631, Fermat was a lawyer and government official in Toulouse and because of the office he now held he became entitled to change his name from Pierre Fermat to Pierre de Fermat.

For the remainder of his life Fermat lived in Toulouse. He received many promotions at the criminal court, partly due to the plague. He had a poor reputation as a lawyer. Of course Fermat was preoccupied with mathematics. He corresponded with many of the leading mathematicians of the day, including Mersenne, Pascal, Desargues, and Huygens. He had a large rivalry with Descartes over comments he made about Descartes' work.

His reputation as one of the leading mathematicians in the world came quickly, but attempts to get his work published failed mainly because Fermat never
really wanted to put his work into a polished form. Also, he adhered to the system of mathematical symbols devised by François Viète, notations that Descartes' *Géométrie* had rendered largely obsolete. The handicap imposed by the awkward notations operated less severely in Fermat's favorite field of study, the theory of numbers, but here unfortunately, he found no correspondent to share his enthusiasm.

Fermat is best remembered for this work in number theory, in particular for Fermat's Last Theorem. This theorem states that x^{n} + y^{n} = z^{n}
has no non-zero integer solutions for x, y and z when n>2. Fermat wrote in a margin "I have discovered a truly remarkable proof which this margin is too small to contain".
It is now believed that Fermat's "proof" was wrong although it is impossible to be completely certain. The truth of Fermat's assertion was recently proved in 1994
by the British mathematician Andrew Wiles. Unsuccessful attempts to prove the theorem over a 300-year period led to the discovery of commutative ring theory and a wealth of other mathematical discoveries.

Fermat's short correspondence with Pascal in 1654 set up the theory of probability and from this they are now regarded as joint founders of the subject. In 1656, he continued the discussion with Huygens.

Fermat is also known for his "method of infinite descent". He used this to prove, for example, that every positive integer equal to 1 modulo 4 was the sum of 2 squares.

He was fond of posing problems, and he always tried to steer his correspondences to number theory. These problems did not prompt too much interest as most mathematicians seemed to think that number theory was not an important topic. Everyone failed to see that Fermat had been hoping his specific problems would lead them to discover, as he had done, deeper theoretical results.

One problem, namely to find all solutions of N x^{2} + 1 = y^{2} for N not a square number, was however solved by Wallis and Brouncker and they developed continued
fractions in their solution. Fermat also conjectured that there are exactly 2 integer solutions of x^{2} + 4 = y^{3} and that the equation x^{2} + 2
= y^{3} has only 1 integer solution.