fbpx
Wikipedia

Fermat's theorem on sums of two squares

In additive number theory, Fermat's theorem on sums of two squares states that an odd prime p can be expressed as:

with x and y integers, if and only if

The prime numbers for which this is true are called Pythagorean primes. For example, the primes 5, 13, 17, 29, 37 and 41 are all congruent to 1 modulo 4, and they can be expressed as sums of two squares in the following ways:

On the other hand, the primes 3, 7, 11, 19, 23 and 31 are all congruent to 3 modulo 4, and none of them can be expressed as the sum of two squares. This is the easier part of the theorem, and follows immediately from the observation that all squares are congruent to 0 or 1 modulo 4.

Since the Diophantus identity implies that the product of two integers each of which can be written as the sum of two squares is itself expressible as the sum of two squares, by applying Fermat's theorem to the prime factorization of any positive integer n, we see that if all the prime factors of n congruent to 3 modulo 4 occur to an even exponent, then n is expressible as a sum of two squares. The converse also holds.[1] This generalization of Fermat's theorem is known as the sum of two squares theorem.

History edit

Albert Girard was the first to make the observation, characterizing the positive integers (not necessarily primes) that are expressible as the sum of two squares of positive integers; this was published in 1625.[2][3] The statement that every prime p of the form 4n+1 is the sum of two squares is sometimes called Girard's theorem.[4] For his part, Fermat wrote an elaborate version of the statement (in which he also gave the number of possible expressions of the powers of p as a sum of two squares) in a letter to Marin Mersenne dated December 25, 1640: for this reason this version of the theorem is sometimes called Fermat's Christmas theorem.

Gaussian primes edit

Fermat's theorem on sums of two squares is strongly related with the theory of Gaussian primes.

A Gaussian integer is a complex number   such that a and b are integers. The norm   of a Gaussian integer is an integer equal to the square of the absolute value of the Gaussian integer. The norm of a product of Gaussian integers is the product of their norms. This is the Diophantus identity, which results immediately from the similar property of the absolute value.

Gaussian integers form a principal ideal domain. This implies that Gaussian primes can be defined similarly as primes numbers, that is as those Gaussian integers that are not the product of two non-units (here the units are 1, −1, i and i).

The multiplicative property of the norm implies that a prime number p is either a Gaussian prime or the norm of a Gaussian prime. Fermat's theorem asserts that the first case occurs when   and that the second case occurs when   and   The last case is not considered in Fermat's statement, but is trivial, as  

Related results edit

Above point of view on Fermat's theorem is a special case of the theory of factorization of ideals in rings of quadratic integers. In summary, if   is the ring of algebraic integers in the quadratic field, then an odd prime number p, not dividing d, is either a prime element in   or the ideal norm of an ideal of   which is necessarily prime. Moreover, the law of quadratic reciprocity allows distinguishing the two cases in terms of congruences. If   is a principal ideal domain, then p is an ideal norm if and only

 

with a and b both integers.

In a letter to Blaise Pascal dated September 25, 1654 Fermat announced the following two results that are essentially the special cases   and   If p is an odd prime, then

 
 

Fermat wrote also:

If two primes which end in 3 or 7 and surpass by 3 a multiple of 4 are multiplied, then their product will be composed of a square and the quintuple of another square.

In other words, if p, q are of the form 20k + 3 or 20k + 7, then pq = x2 + 5y2. Euler later extended this to the conjecture that

 
 

Both Fermat's assertion and Euler's conjecture were established by Joseph-Louis Lagrange. This more complicated formulation relies on the fact that   is not a principal ideal domain, unlike   and  

Algorithm edit

There is a trivial algorithm for decomposing a prime of the form   into a sum of two squares: For all n such  , test whether the square root of   is an integer. If this the case, one has got the decomposition.

However the input size of the algorithm is   the number of digits of p (up to a constant factor that depends on the numeral base). The number of needed tests is of the order of   and thus exponential in the input size. So the computational complexity of this algorithm is exponential.

An algorithm with a polynomial complexity has been described by Stan Wagon in 1990, based on work by Serret and Hermite (1848), and Cornacchia (1908).[5]

Description edit

Given an odd prime   in the form  , first find   such that  . This can be done by finding a Quadratic non-residue modulo  , say  , and letting  .

Such an   will satisfy the condition since quadratic non-residues satisfy  .

Once   is determined, one can apply the Euclidean algorithm with   and  . Denote the first two remainders that are less than the square root of   as   and  . Then it will be the case that  .

Example edit

Take  . A possible quadratic non-residue for 97 is 13, since  . so we let  . The Euclidean algorithm applied to 97 and 22 yields:

 
 
 
 
The first two remainders smaller than the square root of 97 are 9 and 4; and indeed we have  , as expected.

Proofs edit

Fermat usually did not write down proofs of his claims, and he did not provide a proof of this statement. The first proof was found by Euler after much effort and is based on infinite descent. He announced it in two letters to Goldbach, on May 6, 1747 and on April 12, 1749; he published the detailed proof in two articles (between 1752 and 1755).[6][7] Lagrange gave a proof in 1775 that was based on his study of quadratic forms. This proof was simplified by Gauss in his Disquisitiones Arithmeticae (art. 182). Dedekind gave at least two proofs based on the arithmetic of the Gaussian integers. There is an elegant proof using Minkowski's theorem about convex sets. Simplifying an earlier short proof due to Heath-Brown (who was inspired by Liouville's idea), Zagier presented a non-constructive one-sentence proof in 1990.[8] And more recently Christopher gave a partition-theoretic proof.[9]

Euler's proof by infinite descent edit

Euler succeeded in proving Fermat's theorem on sums of two squares in 1749, when he was forty-two years old. He communicated this in a letter to Goldbach dated 12 April 1749.[10] The proof relies on infinite descent, and is only briefly sketched in the letter. The full proof consists in five steps and is published in two papers. The first four steps are Propositions 1 to 4 of the first paper[11] and do not correspond exactly to the four steps below. The fifth step below is from the second paper.[12][13]

For the avoidance of ambiguity, zero will always be a valid possible constituent of "sums of two squares", so for example every square of an integer is trivially expressible as the sum of two squares by setting one of them to be zero.

1. The product of two numbers, each of which is a sum of two squares, is itself a sum of two squares.

This is a well-known property, based on the identity
 
due to Diophantus.

2. If a number which is a sum of two squares is divisible by a prime which is a sum of two squares, then the quotient is a sum of two squares. (This is Euler's first Proposition).

Indeed, suppose for example that   is divisible by   and that this latter is a prime. Then   divides
 
Since   is a prime, it divides one of the two factors. Suppose that it divides  . Since
 
(Diophantus's identity) it follows that   must divide  . So the equation can be divided by the square of  . Dividing the expression by   yields:
 
and thus expresses the quotient as a sum of two squares, as claimed.
On the other hand if   divides  , a similar argument holds by using the following variant of Diophantus's identity:
 

3. If a number which can be written as a sum of two squares is divisible by a number which is not a sum of two squares, then the quotient has a factor which is not a sum of two squares. (This is Euler's second Proposition).

Suppose   is a number not expressible as a sum of two squares, which divides  . Write the quotient, factored into its (possibly repeated) prime factors, as   so that  . If all factors   can be written as sums of two squares, then we can divide   successively by  ,  , etc., and applying step (2.) above we deduce that each successive, smaller, quotient is a sum of two squares. If we get all the way down to   then   itself would have to be equal to the sum of two squares, which is a contradiction. So at least one of the primes   is not the sum of two squares.

4. If   and   are relatively prime positive integers then every factor of   is a sum of two squares. (This is the step that uses step (3.) to produce an 'infinite descent' and was Euler's Proposition 4. The proof sketched below also includes the proof of his Proposition 3).

Let   be relatively prime positive integers: without loss of generality   is not itself prime, otherwise there is nothing to prove. Let   therefore be a proper factor of  , not necessarily prime: we wish to show that   is a sum of two squares. Again, we lose nothing by assuming   since the case   is obvious.
Let   be non-negative integers such that   are the closest multiples of   (in absolute value) to   respectively. Notice that the differences   and   are integers of absolute value strictly less than  : indeed, when   is even, gcd ; otherwise since gcd , we would also have gcd .
Multiplying out we obtain
 
uniquely defining a non-negative integer  . Since   divides both ends of this equation sequence it follows that   must also be divisible by  : say  . Let   be the gcd of   and   which by the co-primeness of   is relatively prime to  . Thus   divides  , so writing  ,   and  , we obtain the expression   for relatively prime   and  , and with  , since
 
Now finally, the descent step: if   is not the sum of two squares, then by step (3.) there must be a factor   say of   which is not the sum of two squares. But   and so repeating these steps (initially with   in place of  , and so on ad infinitum) we shall be able to find a strictly decreasing infinite sequence   of positive integers which are not themselves the sums of two squares but which divide into a sum of two relatively prime squares. Since such an infinite descent is impossible, we conclude that   must be expressible as a sum of two squares, as claimed.

5. Every prime of the form   is a sum of two squares. (This is the main result of Euler's second paper).

If  , then by Fermat's Little Theorem each of the numbers   is congruent to one modulo  . The differences   are therefore all divisible by  . Each of these differences can be factored as
 
Since   is prime, it must divide one of the two factors. If in any of the   cases it divides the first factor, then by the previous step we conclude that   is itself a sum of two squares (since   and   differ by  , they are relatively prime). So it is enough to show that   cannot always divide the second factor. If it divides all   differences  , then it would divide all   differences of successive terms, all   differences of the differences, and so forth. Since the  th differences of the sequence   are all equal to   (Finite difference), the  th differences would all be constant and equal to  , which is certainly not divisible by  . Therefore,   cannot divide all the second factors which proves that   is indeed the sum of two squares.

Lagrange's proof through quadratic forms edit

Lagrange completed a proof in 1775[14] based on his general theory of integral quadratic forms. The following presentation incorporates a slight simplification of his argument, due to Gauss, which appears in article 182 of the Disquisitiones Arithmeticae.

An (integral binary) quadratic form is an expression of the form   with   integers. A number   is said to be represented by the form if there exist integers   such that  . Fermat's theorem on sums of two squares is then equivalent to the statement that a prime   is represented by the form   (i.e.,  ,  ) exactly when   is congruent to   modulo  .

The discriminant of the quadratic form is defined to be  . The discriminant of   is then equal to  .

Two forms   and   are equivalent if and only if there exist substitutions with integer coefficients

 
 

with   such that, when substituted into the first form, yield the second. Equivalent forms are readily seen to have the same discriminant, and hence also the same parity for the middle coefficient  , which coincides with the parity of the discriminant. Moreover, it is clear that equivalent forms will represent exactly the same integers, because these kind of substitutions can be reversed by substitutions of the same kind.

Lagrange proved that all positive definite forms of discriminant −4 are equivalent. Thus, to prove Fermat's theorem it is enough to find any positive definite form of discriminant −4 that represents  . For example, one can use a form

 

where the first coefficient a =   was chosen so that the form represents   by setting x = 1, and y = 0, the coefficient b = 2m is an arbitrary even number (as it must be, to get an even discriminant), and finally   is chosen so that the discriminant   is equal to −4, which guarantees that the form is indeed equivalent to  . Of course, the coefficient   must be an integer, so the problem is reduced to finding some integer m such that   divides  : or in other words, a 'square root of -1 modulo  ' .

We claim such a square root of   is given by  . Firstly it follows from Euclid's Fundamental Theorem of Arithmetic that  . Consequently,  : that is,   are their own inverses modulo   and this property is unique to them. It then follows from the validity of Euclidean division in the integers, and the fact that   is prime, that for every   the gcd of   and   may be expressed via the Euclidean algorithm yielding a unique and distinct inverse   of   modulo  . In particular therefore the product of all non-zero residues modulo   is  . Let  : from what has just been observed,  . But by definition, since each term in   may be paired with its negative in  ,  , which since   is odd shows that  , as required.

Dedekind's two proofs using Gaussian integers edit

Richard Dedekind gave at least two proofs of Fermat's theorem on sums of two squares, both using the arithmetical properties of the Gaussian integers, which are numbers of the form a + bi, where a and b are integers, and i is the square root of −1. One appears in section 27 of his exposition of ideals published in 1877; the second appeared in Supplement XI to Peter Gustav Lejeune Dirichlet's Vorlesungen über Zahlentheorie, and was published in 1894.

1. First proof. If   is an odd prime number, then we have   in the Gaussian integers. Consequently, writing a Gaussian integer ω = x + iy with x,y ∈ Z and applying the Frobenius automorphism in Z[i]/(p), one finds

 

since the automorphism fixes the elements of Z/(p). In the current case,   for some integer n, and so in the above expression for ωp, the exponent (p-1)/2 of -1 is even. Hence the right hand side equals ω, so in this case the Frobenius endomorphism of Z[i]/(p) is the identity.

Kummer had already established that if f ∈ {1,2} is the order of the Frobenius automorphism of Z[i]/(p), then the ideal   in Z[i] would be a product of 2/f distinct prime ideals. (In fact, Kummer had established a much more general result for any extension of Z obtained by adjoining a primitive m-th root of unity, where m was any positive integer; this is the case m = 4 of that result.) Therefore, the ideal (p) is the product of two different prime ideals in Z[i]. Since the Gaussian integers are a Euclidean domain for the norm function  , every ideal is principal and generated by a nonzero element of the ideal of minimal norm. Since the norm is multiplicative, the norm of a generator   of one of the ideal factors of (p) must be a strict divisor of  , so that we must have  , which gives Fermat's theorem.

2. Second proof. This proof builds on Lagrange's result that if   is a prime number, then there must be an integer m such that   is divisible by p (we can also see this by Euler's criterion); it also uses the fact that the Gaussian integers are a unique factorization domain (because they are a Euclidean domain). Since pZ does not divide either of the Gaussian integers   and   (as it does not divide their imaginary parts), but it does divide their product  , it follows that   cannot be a prime element in the Gaussian integers. We must therefore have a nontrivial factorization of p in the Gaussian integers, which in view of the norm can have only two factors (since the norm is multiplicative, and  , there can only be up to two factors of p), so it must be of the form   for some integers   and  . This immediately yields that  .

Proof by Minkowski's Theorem edit

For   congruent to   mod   a prime,   is a quadratic residue mod   by Euler's criterion. Therefore, there exists an integer   such that   divides  . Let   be the standard basis elements for the vector space   and set   and  . Consider the lattice  . If   then  . Thus   divides   for any  .

The area of the fundamental parallelogram of the lattice is  . The area of the open disk,  , of radius   centered around the origin is  . Furthermore,   is convex and symmetrical about the origin. Therefore, by Minkowski's theorem there exists a nonzero vector   such that  . Both   and   so  . Hence   is the sum of the squares of the components of  .

Zagier's "one-sentence proof" edit

Let   be prime, let   denote the natural numbers (with or without zero), and consider the finite set   of triples of numbers. Then   has two involutions: an obvious one   whose fixed points   correspond to representations of   as a sum of two squares, and a more complicated one,

 

which has exactly one fixed point  . This proves that the cardinality of   is odd. Hence,   has also a fixed point with respect to the obvious involution.

This proof, due to Zagier, is a simplification of an earlier proof by Heath-Brown, which in turn was inspired by a proof of Liouville. The technique of the proof is a combinatorial analogue of the topological principle that the Euler characteristics of a topological space with an involution and of its fixed-point set have the same parity and is reminiscent of the use of sign-reversing involutions in the proofs of combinatorial bijections.

This proof is equivalent to a geometric or "visual" proof using "windmill" figures, given by Alexander Spivak in 2006 and described in this MathOverflow post and this Mathologer YouTube video Why was this visual proof missed for 400 years? (Fermat's two square theorem) on YouTube.

Proof with partition theory edit

In 2016, A. David Christopher gave a partition-theoretic proof by considering partitions of the odd prime   having exactly two sizes  , each occurring exactly   times, and by showing that at least one such partition exists if   is congruent to 1 modulo 4.[15]

See also edit

References edit

  • D. A. Cox (1989). Primes of the Form x2 + ny2. Wiley-Interscience. ISBN 0-471-50654-0.*Richard Dedekind, The theory of algebraic integers.
  • L. E. Dickson. History of the Theory of Numbers Vol. 2. Chelsea Publishing Co., New York 1920
  • Harold M. Edwards, Fermat's Last Theorem. A genetic introduction to algebraic number theory. Graduate Texts in Mathematics no. 50, Springer-Verlag, NY, 1977.
  • C. F. Gauss, Disquisitiones Arithmeticae (English Edition). Transl. by Arthur A. Clarke. Springer-Verlag, 1986.
  • Goldman, Jay R. (1998), The Queen of Mathematics: A historically motivated guide to Number Theory, A K Peters, ISBN 1-56881-006-7
  • D. R. Heath-Brown, Fermat's two squares theorem. Invariant, 11 (1984) pp. 3–5.
  • John Stillwell, Introduction to Theory of Algebraic Integers by Richard Dedekind. Cambridge Mathematical Library, Cambridge University Press, 1996. ISBN 0-521-56518-9
  • Don Zagier, A one-sentence proof that every prime p ≡ 1 mod 4 is a sum of two squares. Amer. Math. Monthly 97 (1990), no. 2, 144, doi:10.2307/2323918

Notes edit

  1. ^ For a proof of the converse see for instance 20.1, Theorems 367 and 368, in: G.H. Hardy and E.M. Wright. An introduction to the theory of numbers, Oxford 1938.
  2. ^ Simon Stevin. l'Arithmétique de Simon Stevin de Bruges, annotated by Albert Girard, Leyde 1625, p. 622.
  3. ^ L. E. Dickson, History of the Theory of Numbers, Vol. II, Ch. VI, p. 227. "A. Girard ... had already made a determination of the numbers expressible as a sum of two integral squares: every square, every prime 4n+1, a product formed of such numbers, and the double of the foregoing"
  4. ^ L. E. Dickson, History of the Theory of Numbers, Vol. II, Ch. VI, p. 228.
  5. ^ Wagon, Stan (1990), "Editor's Corner: The Euclidean Algorithm Strikes Again", American Mathematical Monthly, 97 (2): 125, doi:10.2307/2323912, MR 1041889.
  6. ^ De numerus qui sunt aggregata quorum quadratorum. (Novi commentarii academiae scientiarum Petropolitanae 4 (1752/3), 1758, 3-40)
  7. ^ Demonstratio theorematis FERMATIANI omnem numerum primum formae 4n+1 esse summam duorum quadratorum. (Novi commentarii academiae scientiarum Petropolitanae 5 (1754/5), 1760, 3-13)
  8. ^ Zagier, D. (1990), "A one-sentence proof that every prime p ≡ 1 (mod 4) is a sum of two squares", American Mathematical Monthly, 97 (2): 144, doi:10.2307/2323918, MR 1041893.
  9. ^ A. David Christopher. "A partition-theoretic proof of Fermat's Two Squares Theorem", Discrete Mathematics 339:4:1410–1411 (6 April 2016) doi:10.1016/j.disc.2015.12.002
  10. ^ Euler à Goldbach, lettre CXXV
  11. ^ De numerus qui sunt aggregata duorum quadratorum. (Novi commentarii academiae scientiarum Petropolitanae 4 (1752/3), 1758, 3-40) [1]
  12. ^ Demonstratio theorematis FERMATIANI omnem numerum primum formae 4n+1 esse summam duorum quadratorum. (Novi commentarii academiae scientiarum Petropolitanae 5 (1754/5), 1760, 3-13) [2]
  13. ^ The summary is based on Edwards book, pages 45-48.
  14. ^ Nouv. Mém. Acad. Berlin, année 1771, 125; ibid. année 1773, 275; ibid année 1775, 351.
  15. ^ A. David Christopher, A partition-theoretic proof of Fermat's Two Squares Theorem", Discrete Mathematics, 339 (2016) 1410–1411.

External links edit

  • . Archived from the original on 5 February 2012.{{cite web}}: CS1 maint: unfit URL (link)
  • Fermat's two squares theorem, D. R. Heath-Brown, 1984.
  • Polster, Burkard (2019) "Fermat's Christmas theorem: Visualising the hidden circle in π/4 = 1 − 1/3 + 1/5 − 1/7 + ..." (Video). Mathologer.


fermat, theorem, sums, squares, other, theorems, named, after, pierre, fermat, fermat, theorem, additive, number, theory, states, that, prime, expressed, displaystyle, with, integers, only, displaystyle, equiv, pmod, prime, numbers, which, this, true, called, . For other theorems named after Pierre de Fermat see Fermat s theorem In additive number theory Fermat s theorem on sums of two squares states that an odd prime p can be expressed as p x 2 y 2 displaystyle p x 2 y 2 with x and y integers if and only if p 1 mod 4 displaystyle p equiv 1 pmod 4 The prime numbers for which this is true are called Pythagorean primes For example the primes 5 13 17 29 37 and 41 are all congruent to 1 modulo 4 and they can be expressed as sums of two squares in the following ways 5 1 2 2 2 13 2 2 3 2 17 1 2 4 2 29 2 2 5 2 37 1 2 6 2 41 4 2 5 2 displaystyle 5 1 2 2 2 quad 13 2 2 3 2 quad 17 1 2 4 2 quad 29 2 2 5 2 quad 37 1 2 6 2 quad 41 4 2 5 2 On the other hand the primes 3 7 11 19 23 and 31 are all congruent to 3 modulo 4 and none of them can be expressed as the sum of two squares This is the easier part of the theorem and follows immediately from the observation that all squares are congruent to 0 or 1 modulo 4 Since the Diophantus identity implies that the product of two integers each of which can be written as the sum of two squares is itself expressible as the sum of two squares by applying Fermat s theorem to the prime factorization of any positive integer n we see that if all the prime factors of n congruent to 3 modulo 4 occur to an even exponent then n is expressible as a sum of two squares The converse also holds 1 This generalization of Fermat s theorem is known as the sum of two squares theorem Contents 1 History 2 Gaussian primes 3 Related results 4 Algorithm 4 1 Description 4 2 Example 5 Proofs 5 1 Euler s proof by infinite descent 5 2 Lagrange s proof through quadratic forms 5 3 Dedekind s two proofs using Gaussian integers 5 4 Proof by Minkowski s Theorem 5 5 Zagier s one sentence proof 5 6 Proof with partition theory 6 See also 7 References 8 Notes 9 External linksHistory editAlbert Girard was the first to make the observation characterizing the positive integers not necessarily primes that are expressible as the sum of two squares of positive integers this was published in 1625 2 3 The statement that every prime p of the form 4n 1 is the sum of two squares is sometimes called Girard s theorem 4 For his part Fermat wrote an elaborate version of the statement in which he also gave the number of possible expressions of the powers of p as a sum of two squares in a letter to Marin Mersenne dated December 25 1640 for this reason this version of the theorem is sometimes called Fermat s Christmas theorem Gaussian primes editFermat s theorem on sums of two squares is strongly related with the theory of Gaussian primes A Gaussian integer is a complex number a i b displaystyle a ib nbsp such that a and b are integers The norm N a i b a 2 b 2 displaystyle N a ib a 2 b 2 nbsp of a Gaussian integer is an integer equal to the square of the absolute value of the Gaussian integer The norm of a product of Gaussian integers is the product of their norms This is the Diophantus identity which results immediately from the similar property of the absolute value Gaussian integers form a principal ideal domain This implies that Gaussian primes can be defined similarly as primes numbers that is as those Gaussian integers that are not the product of two non units here the units are 1 1 i and i The multiplicative property of the norm implies that a prime number p is either a Gaussian prime or the norm of a Gaussian prime Fermat s theorem asserts that the first case occurs when p 4 k 3 displaystyle p 4k 3 nbsp and that the second case occurs when p 4 k 1 displaystyle p 4k 1 nbsp and p 2 displaystyle p 2 nbsp The last case is not considered in Fermat s statement but is trivial as 2 1 2 1 2 N 1 i displaystyle 2 1 2 1 2 N 1 i nbsp Related results editAbove point of view on Fermat s theorem is a special case of the theory of factorization of ideals in rings of quadratic integers In summary if O d displaystyle mathcal O sqrt d nbsp is the ring of algebraic integers in the quadratic field then an odd prime number p not dividing d is either a prime element in O d displaystyle mathcal O sqrt d nbsp or the ideal norm of an ideal of O d displaystyle mathcal O sqrt d nbsp which is necessarily prime Moreover the law of quadratic reciprocity allows distinguishing the two cases in terms of congruences If O d displaystyle mathcal O sqrt d nbsp is a principal ideal domain then p is an ideal norm if and only 4 p a 2 d b 2 displaystyle 4p a 2 db 2 nbsp with a and b both integers In a letter to Blaise Pascal dated September 25 1654 Fermat announced the following two results that are essentially the special cases d 2 displaystyle d 2 nbsp and d 3 displaystyle d 3 nbsp If p is an odd prime then p x 2 2 y 2 p 1 or p 3 mod 8 displaystyle p x 2 2y 2 iff p equiv 1 mbox or p equiv 3 pmod 8 nbsp p x 2 3 y 2 p 1 mod 3 displaystyle p x 2 3y 2 iff p equiv 1 pmod 3 nbsp Fermat wrote also If two primes which end in 3 or 7 and surpass by 3 a multiple of 4 are multiplied then their product will be composed of a square and the quintuple of another square In other words if p q are of the form 20k 3 or 20k 7 then pq x2 5y2 Euler later extended this to the conjecture that p x 2 5 y 2 p 1 or p 9 mod 20 displaystyle p x 2 5y 2 iff p equiv 1 mbox or p equiv 9 pmod 20 nbsp 2 p x 2 5 y 2 p 3 or p 7 mod 20 displaystyle 2p x 2 5y 2 iff p equiv 3 mbox or p equiv 7 pmod 20 nbsp Both Fermat s assertion and Euler s conjecture were established by Joseph Louis Lagrange This more complicated formulation relies on the fact that O 5 displaystyle mathcal O sqrt 5 nbsp is not a principal ideal domain unlike O 2 displaystyle mathcal O sqrt 2 nbsp and O 3 displaystyle mathcal O sqrt 3 nbsp Algorithm editThere is a trivial algorithm for decomposing a prime of the form p 4 k 1 displaystyle p 4k 1 nbsp into a sum of two squares For all n such 1 n lt p displaystyle 1 leq n lt sqrt p nbsp test whether the square root of p n 2 displaystyle p n 2 nbsp is an integer If this the case one has got the decomposition However the input size of the algorithm is log p displaystyle log p nbsp the number of digits of p up to a constant factor that depends on the numeral base The number of needed tests is of the order of p exp log p 2 displaystyle sqrt p exp left frac log p 2 right nbsp and thus exponential in the input size So the computational complexity of this algorithm is exponential An algorithm with a polynomial complexity has been described by Stan Wagon in 1990 based on work by Serret and Hermite 1848 and Cornacchia 1908 5 Description edit Given an odd prime p displaystyle p nbsp in the form 4 k 1 displaystyle 4k 1 nbsp first find x displaystyle x nbsp such that x 2 1 mod p displaystyle x 2 equiv 1 pmod p nbsp This can be done by finding a Quadratic non residue modulo p displaystyle p nbsp say q displaystyle q nbsp and letting x q p 1 4 mod p displaystyle x q frac p 1 4 pmod p nbsp Such an x displaystyle x nbsp will satisfy the condition since quadratic non residues satisfy q p 1 2 1 mod p displaystyle q frac p 1 2 equiv 1 pmod p nbsp Once x displaystyle x nbsp is determined one can apply the Euclidean algorithm with p displaystyle p nbsp and x displaystyle x nbsp Denote the first two remainders that are less than the square root of p displaystyle p nbsp as a displaystyle a nbsp and b displaystyle b nbsp Then it will be the case that a 2 b 2 p displaystyle a 2 b 2 p nbsp Example edit Take p 97 displaystyle p 97 nbsp A possible quadratic non residue for 97 is 13 since 13 97 1 2 1 mod 97 displaystyle 13 frac 97 1 2 equiv 1 pmod 97 nbsp so we let x 13 97 1 4 22 mod 97 displaystyle x 13 frac 97 1 4 22 pmod 97 nbsp The Euclidean algorithm applied to 97 and 22 yields 97 22 4 9 displaystyle 97 22 4 9 nbsp 22 9 2 4 displaystyle 22 9 2 4 nbsp 9 4 2 1 displaystyle 9 4 2 1 nbsp 4 1 4 displaystyle 4 1 4 nbsp The first two remainders smaller than the square root of 97 are 9 and 4 and indeed we have 97 9 2 4 2 displaystyle 97 9 2 4 2 nbsp as expected Proofs editFermat usually did not write down proofs of his claims and he did not provide a proof of this statement The first proof was found by Euler after much effort and is based on infinite descent He announced it in two letters to Goldbach on May 6 1747 and on April 12 1749 he published the detailed proof in two articles between 1752 and 1755 6 7 Lagrange gave a proof in 1775 that was based on his study of quadratic forms This proof was simplified by Gauss in his Disquisitiones Arithmeticae art 182 Dedekind gave at least two proofs based on the arithmetic of the Gaussian integers There is an elegant proof using Minkowski s theorem about convex sets Simplifying an earlier short proof due to Heath Brown who was inspired by Liouville s idea Zagier presented a non constructive one sentence proof in 1990 8 And more recently Christopher gave a partition theoretic proof 9 Euler s proof by infinite descent edit Euler succeeded in proving Fermat s theorem on sums of two squares in 1749 when he was forty two years old He communicated this in a letter to Goldbach dated 12 April 1749 10 The proof relies on infinite descent and is only briefly sketched in the letter The full proof consists in five steps and is published in two papers The first four steps are Propositions 1 to 4 of the first paper 11 and do not correspond exactly to the four steps below The fifth step below is from the second paper 12 13 For the avoidance of ambiguity zero will always be a valid possible constituent of sums of two squares so for example every square of an integer is trivially expressible as the sum of two squares by setting one of them to be zero 1 The product of two numbers each of which is a sum of two squares is itself a sum of two squares This is a well known property based on the identity a 2 b 2 p 2 q 2 a p b q 2 a q b p 2 displaystyle a 2 b 2 p 2 q 2 ap bq 2 aq bp 2 nbsp dd dd due to Diophantus dd 2 If a number which is a sum of two squares is divisible by a prime which is a sum of two squares then the quotient is a sum of two squares This is Euler s first Proposition Indeed suppose for example that a 2 b 2 displaystyle a 2 b 2 nbsp is divisible by p 2 q 2 displaystyle p 2 q 2 nbsp and that this latter is a prime Then p 2 q 2 displaystyle p 2 q 2 nbsp divides p b a q p b a q p 2 b 2 a 2 q 2 p 2 a 2 b 2 a 2 p 2 q 2 displaystyle pb aq pb aq p 2 b 2 a 2 q 2 p 2 a 2 b 2 a 2 p 2 q 2 nbsp dd dd Since p 2 q 2 displaystyle p 2 q 2 nbsp is a prime it divides one of the two factors Suppose that it divides p b a q displaystyle pb aq nbsp Since a 2 b 2 p 2 q 2 a p b q 2 a q b p 2 displaystyle a 2 b 2 p 2 q 2 ap bq 2 aq bp 2 nbsp dd dd Diophantus s identity it follows that p 2 q 2 displaystyle p 2 q 2 nbsp must divide a p b q 2 displaystyle ap bq 2 nbsp So the equation can be divided by the square of p 2 q 2 displaystyle p 2 q 2 nbsp Dividing the expression by p 2 q 2 2 displaystyle p 2 q 2 2 nbsp yields a 2 b 2 p 2 q 2 a p b q p 2 q 2 2 a q b p p 2 q 2 2 displaystyle frac a 2 b 2 p 2 q 2 left frac ap bq p 2 q 2 right 2 left frac aq bp p 2 q 2 right 2 nbsp dd dd and thus expresses the quotient as a sum of two squares as claimed dd On the other hand if p 2 q 2 displaystyle p 2 q 2 nbsp divides p b a q displaystyle pb aq nbsp a similar argument holds by using the following variant of Diophantus s identity a 2 b 2 q 2 p 2 a q b p 2 a p b q 2 displaystyle a 2 b 2 q 2 p 2 aq bp 2 ap bq 2 nbsp dd dd 3 If a number which can be written as a sum of two squares is divisible by a number which is not a sum of two squares then the quotient has a factor which is not a sum of two squares This is Euler s second Proposition Suppose q displaystyle q nbsp is a number not expressible as a sum of two squares which divides a 2 b 2 displaystyle a 2 b 2 nbsp Write the quotient factored into its possibly repeated prime factors as p 1 p 2 p n displaystyle p 1 p 2 cdots p n nbsp so that a 2 b 2 q p 1 p 2 p n displaystyle a 2 b 2 qp 1 p 2 cdots p n nbsp If all factors p i displaystyle p i nbsp can be written as sums of two squares then we can divide a 2 b 2 displaystyle a 2 b 2 nbsp successively by p 1 displaystyle p 1 nbsp p 2 displaystyle p 2 nbsp etc and applying step 2 above we deduce that each successive smaller quotient is a sum of two squares If we get all the way down to q displaystyle q nbsp then q displaystyle q nbsp itself would have to be equal to the sum of two squares which is a contradiction So at least one of the primes p i displaystyle p i nbsp is not the sum of two squares dd 4 If a displaystyle a nbsp and b displaystyle b nbsp are relatively prime positive integers then every factor of a 2 b 2 displaystyle a 2 b 2 nbsp is a sum of two squares This is the step that uses step 3 to produce an infinite descent and was Euler s Proposition 4 The proof sketched below also includes the proof of his Proposition 3 Let a b displaystyle a b nbsp be relatively prime positive integers without loss of generality a 2 b 2 displaystyle a 2 b 2 nbsp is not itself prime otherwise there is nothing to prove Let q displaystyle q nbsp therefore be a proper factor of a 2 b 2 displaystyle a 2 b 2 nbsp not necessarily prime we wish to show that q displaystyle q nbsp is a sum of two squares Again we lose nothing by assuming q gt 2 displaystyle q gt 2 nbsp since the case q 2 1 2 1 2 displaystyle q 2 1 2 1 2 nbsp is obvious dd Let m n displaystyle m n nbsp be non negative integers such that m q n q displaystyle mq nq nbsp are the closest multiples of q displaystyle q nbsp in absolute value to a b displaystyle a b nbsp respectively Notice that the differences c a m q displaystyle c a mq nbsp and d b n q displaystyle d b nq nbsp are integers of absolute value strictly less than q 2 displaystyle q 2 nbsp indeed when q gt 2 displaystyle q gt 2 nbsp is even gcd a q 2 1 displaystyle a q 2 1 nbsp otherwise since gcd a q 2 q 2 q a 2 b 2 displaystyle a q 2 mid q 2 mid q mid a 2 b 2 nbsp we would also have gcd a q 2 b displaystyle a q 2 mid b nbsp dd Multiplying out we obtaina 2 b 2 m 2 q 2 2 m q c c 2 n 2 q 2 2 n q d d 2 A q c 2 d 2 displaystyle a 2 b 2 m 2 q 2 2mqc c 2 n 2 q 2 2nqd d 2 Aq c 2 d 2 nbsp dd uniquely defining a non negative integer A displaystyle A nbsp Since q displaystyle q nbsp divides both ends of this equation sequence it follows that c 2 d 2 displaystyle c 2 d 2 nbsp must also be divisible by q displaystyle q nbsp say c 2 d 2 q r displaystyle c 2 d 2 qr nbsp Let g displaystyle g nbsp be the gcd of c displaystyle c nbsp and d displaystyle d nbsp which by the co primeness of a b displaystyle a b nbsp is relatively prime to q displaystyle q nbsp Thus g 2 displaystyle g 2 nbsp divides r displaystyle r nbsp so writing e c g displaystyle e c g nbsp f d g displaystyle f d g nbsp and s r g 2 displaystyle s r g 2 nbsp we obtain the expression e 2 f 2 q s displaystyle e 2 f 2 qs nbsp for relatively prime e displaystyle e nbsp and f displaystyle f nbsp and with s lt q 2 displaystyle s lt q 2 nbsp sinceq s e 2 f 2 c 2 d 2 lt q 2 2 q 2 2 q 2 2 displaystyle qs e 2 f 2 leq c 2 d 2 lt left frac q 2 right 2 left frac q 2 right 2 q 2 2 nbsp dd dd Now finally the descent step if q displaystyle q nbsp is not the sum of two squares then by step 3 there must be a factor q 1 displaystyle q 1 nbsp say of s displaystyle s nbsp which is not the sum of two squares But q 1 s lt q 2 lt q displaystyle q 1 leq s lt q 2 lt q nbsp and so repeating these steps initially with e f q 1 displaystyle e f q 1 nbsp in place of a b q displaystyle a b q nbsp and so on ad infinitum we shall be able to find a strictly decreasing infinite sequence q q 1 q 2 displaystyle q q 1 q 2 ldots nbsp of positive integers which are not themselves the sums of two squares but which divide into a sum of two relatively prime squares Since such an infinite descent is impossible we conclude that q displaystyle q nbsp must be expressible as a sum of two squares as claimed dd 5 Every prime of the form 4 n 1 displaystyle 4n 1 nbsp is a sum of two squares This is the main result of Euler s second paper If p 4 n 1 displaystyle p 4n 1 nbsp then by Fermat s Little Theorem each of the numbers 1 2 4 n 3 4 n 4 n 4 n displaystyle 1 2 4n 3 4n dots 4n 4n nbsp is congruent to one modulo p displaystyle p nbsp The differences 2 4 n 1 3 4 n 2 4 n 4 n 4 n 4 n 1 4 n displaystyle 2 4n 1 3 4n 2 4n dots 4n 4n 4n 1 4n nbsp are therefore all divisible by p displaystyle p nbsp Each of these differences can be factored asa 4 n b 4 n a 2 n b 2 n a 2 n b 2 n displaystyle a 4n b 4n left a 2n b 2n right left a 2n b 2n right nbsp dd Since p displaystyle p nbsp is prime it must divide one of the two factors If in any of the 4 n 1 displaystyle 4n 1 nbsp cases it divides the first factor then by the previous step we conclude that p displaystyle p nbsp is itself a sum of two squares since a displaystyle a nbsp and b displaystyle b nbsp differ by 1 displaystyle 1 nbsp they are relatively prime So it is enough to show that p displaystyle p nbsp cannot always divide the second factor If it divides all 4 n 1 displaystyle 4n 1 nbsp differences 2 2 n 1 3 2 n 2 2 n 4 n 2 n 4 n 1 2 n displaystyle 2 2n 1 3 2n 2 2n dots 4n 2n 4n 1 2n nbsp then it would divide all 4 n 2 displaystyle 4n 2 nbsp differences of successive terms all 4 n 3 displaystyle 4n 3 nbsp differences of the differences and so forth Since the k displaystyle k nbsp th differences of the sequence 1 k 2 k 3 k displaystyle 1 k 2 k 3 k dots nbsp are all equal to k displaystyle k nbsp Finite difference the 2 n displaystyle 2n nbsp th differences would all be constant and equal to 2 n displaystyle 2n nbsp which is certainly not divisible by p displaystyle p nbsp Therefore p displaystyle p nbsp cannot divide all the second factors which proves that p displaystyle p nbsp is indeed the sum of two squares dd Lagrange s proof through quadratic forms edit Lagrange completed a proof in 1775 14 based on his general theory of integral quadratic forms The following presentation incorporates a slight simplification of his argument due to Gauss which appears in article 182 of the Disquisitiones Arithmeticae An integral binary quadratic form is an expression of the form a x 2 b x y c y 2 displaystyle ax 2 bxy cy 2 nbsp with a b c displaystyle a b c nbsp integers A number n displaystyle n nbsp is said to be represented by the form if there exist integers x y displaystyle x y nbsp such that n a x 2 b x y c y 2 displaystyle n ax 2 bxy cy 2 nbsp Fermat s theorem on sums of two squares is then equivalent to the statement that a prime p displaystyle p nbsp is represented by the form x 2 y 2 displaystyle x 2 y 2 nbsp i e a c 1 displaystyle a c 1 nbsp b 0 displaystyle b 0 nbsp exactly when p displaystyle p nbsp is congruent to 1 displaystyle 1 nbsp modulo 4 displaystyle 4 nbsp The discriminant of the quadratic form is defined to be b 2 4 a c displaystyle b 2 4ac nbsp The discriminant of x 2 y 2 displaystyle x 2 y 2 nbsp is then equal to 4 displaystyle 4 nbsp Two forms a x 2 b x y c y 2 displaystyle ax 2 bxy cy 2 nbsp and a x 2 b x y c y 2 displaystyle a x 2 b x y c y 2 nbsp are equivalent if and only if there exist substitutions with integer coefficients x a x b y displaystyle x alpha x beta y nbsp y g x d y displaystyle y gamma x delta y nbsp with a d b g 1 displaystyle alpha delta beta gamma pm 1 nbsp such that when substituted into the first form yield the second Equivalent forms are readily seen to have the same discriminant and hence also the same parity for the middle coefficient b displaystyle b nbsp which coincides with the parity of the discriminant Moreover it is clear that equivalent forms will represent exactly the same integers because these kind of substitutions can be reversed by substitutions of the same kind Lagrange proved that all positive definite forms of discriminant 4 are equivalent Thus to prove Fermat s theorem it is enough to find any positive definite form of discriminant 4 that represents p displaystyle p nbsp For example one can use a form p x 2 2 m x y m 2 1 p y 2 displaystyle px 2 2mxy left frac m 2 1 p right y 2 nbsp where the first coefficient a p displaystyle p nbsp was chosen so that the form represents p displaystyle p nbsp by setting x 1 and y 0 the coefficient b 2m is an arbitrary even number as it must be to get an even discriminant and finally c m 2 1 p displaystyle c frac m 2 1 p nbsp is chosen so that the discriminant b 2 4 a c 4 m 2 4 p c displaystyle b 2 4ac 4m 2 4pc nbsp is equal to 4 which guarantees that the form is indeed equivalent to x 2 y 2 displaystyle x 2 y 2 nbsp Of course the coefficient c m 2 1 p displaystyle c frac m 2 1 p nbsp must be an integer so the problem is reduced to finding some integer m such that p displaystyle p nbsp divides m 2 1 displaystyle m 2 1 nbsp or in other words a square root of 1 modulo p displaystyle p nbsp We claim such a square root of 1 displaystyle 1 nbsp is given by K k 1 p 1 2 k displaystyle K prod k 1 frac p 1 2 k nbsp Firstly it follows from Euclid s Fundamental Theorem of Arithmetic that a b 0 mod p a 0 mod p or b 0 mod p displaystyle ab equiv 0 pmod p iff a equiv 0 pmod p hbox or b equiv 0 pmod p nbsp Consequently a 2 1 mod p a 1 mod p displaystyle a 2 equiv 1 pmod p iff a equiv pm 1 pmod p nbsp that is 1 displaystyle pm 1 nbsp are their own inverses modulo p displaystyle p nbsp and this property is unique to them It then follows from the validity of Euclidean division in the integers and the fact that p displaystyle p nbsp is prime that for every 2 a p 2 displaystyle 2 leq a leq p 2 nbsp the gcd of a displaystyle a nbsp and p displaystyle p nbsp may be expressed via the Euclidean algorithm yielding a unique and distinct inverse a 1 a displaystyle a 1 neq a nbsp of a displaystyle a nbsp modulo p displaystyle p nbsp In particular therefore the product of all non zero residues modulo p displaystyle p nbsp is 1 displaystyle 1 nbsp Let L l p 1 2 p 1 l displaystyle L prod l frac p 1 2 p 1 l nbsp from what has just been observed K L 1 mod p displaystyle KL equiv 1 pmod p nbsp But by definition since each term in K displaystyle K nbsp may be paired with its negative in L displaystyle L nbsp L 1 p 1 2 K displaystyle L 1 frac p 1 2 K nbsp which since p displaystyle p nbsp is odd shows that K 2 1 mod p p 1 mod 4 displaystyle K 2 equiv 1 pmod p iff p equiv 1 pmod 4 nbsp as required Dedekind s two proofs using Gaussian integers edit Richard Dedekind gave at least two proofs of Fermat s theorem on sums of two squares both using the arithmetical properties of the Gaussian integers which are numbers of the form a bi where a and b are integers and i is the square root of 1 One appears in section 27 of his exposition of ideals published in 1877 the second appeared in Supplement XI to Peter Gustav Lejeune Dirichlet s Vorlesungen uber Zahlentheorie and was published in 1894 1 First proof If p displaystyle p nbsp is an odd prime number then we have i p 1 1 p 1 2 displaystyle i p 1 1 frac p 1 2 nbsp in the Gaussian integers Consequently writing a Gaussian integer w x iy with x y Z and applying the Frobenius automorphism in Z i p one finds w p x y i p x p y p i p x 1 p 1 2 y i mod p displaystyle omega p x yi p equiv x p y p i p equiv x 1 frac p 1 2 yi pmod p nbsp since the automorphism fixes the elements of Z p In the current case p 4 n 1 displaystyle p 4n 1 nbsp for some integer n and so in the above expression for wp the exponent p 1 2 of 1 is even Hence the right hand side equals w so in this case the Frobenius endomorphism of Z i p is the identity Kummer had already established that if f 1 2 is the order of the Frobenius automorphism of Z i p then the ideal p displaystyle p nbsp in Z i would be a product of 2 f distinct prime ideals In fact Kummer had established a much more general result for any extension of Z obtained by adjoining a primitive m th root of unity where m was any positive integer this is the case m 4 of that result Therefore the ideal p is the product of two different prime ideals in Z i Since the Gaussian integers are a Euclidean domain for the norm function N x i y x 2 y 2 displaystyle N x iy x 2 y 2 nbsp every ideal is principal and generated by a nonzero element of the ideal of minimal norm Since the norm is multiplicative the norm of a generator a displaystyle alpha nbsp of one of the ideal factors of p must be a strict divisor of N p p 2 displaystyle N p p 2 nbsp so that we must have p N a N a b i a 2 b 2 displaystyle p N alpha N a bi a 2 b 2 nbsp which gives Fermat s theorem 2 Second proof This proof builds on Lagrange s result that if p 4 n 1 displaystyle p 4n 1 nbsp is a prime number then there must be an integer m such that m 2 1 displaystyle m 2 1 nbsp is divisible by p we can also see this by Euler s criterion it also uses the fact that the Gaussian integers are a unique factorization domain because they are a Euclidean domain Since p Z does not divide either of the Gaussian integers m i displaystyle m i nbsp and m i displaystyle m i nbsp as it does not divide their imaginary parts but it does divide their product m 2 1 displaystyle m 2 1 nbsp it follows that p displaystyle p nbsp cannot be a prime element in the Gaussian integers We must therefore have a nontrivial factorization of p in the Gaussian integers which in view of the norm can have only two factors since the norm is multiplicative and p 2 N p displaystyle p 2 N p nbsp there can only be up to two factors of p so it must be of the form p x y i x y i displaystyle p x yi x yi nbsp for some integers x displaystyle x nbsp and y displaystyle y nbsp This immediately yields that p x 2 y 2 displaystyle p x 2 y 2 nbsp Proof by Minkowski s Theorem edit For p displaystyle p nbsp congruent to 1 displaystyle 1 nbsp mod 4 displaystyle 4 nbsp a prime 1 displaystyle 1 nbsp is a quadratic residue mod p displaystyle p nbsp by Euler s criterion Therefore there exists an integer m displaystyle m nbsp such that p displaystyle p nbsp divides m 2 1 displaystyle m 2 1 nbsp Let i j displaystyle hat i hat j nbsp be the standard basis elements for the vector space R 2 displaystyle mathbb R 2 nbsp and set u i m j displaystyle vec u hat i m hat j nbsp and v 0 i p j displaystyle vec v 0 hat i p hat j nbsp Consider the lattice S a u b v a b Z displaystyle S a vec u b vec v mid a b in mathbb Z nbsp If w a u b v a i a m b p j S displaystyle vec w a vec u b vec v a hat i am bp hat j in S nbsp then w 2 a 2 a m b p 2 a 2 1 m 2 0 mod p displaystyle vec w 2 equiv a 2 am bp 2 equiv a 2 1 m 2 equiv 0 pmod p nbsp Thus p displaystyle p nbsp divides w 2 displaystyle vec w 2 nbsp for any w S displaystyle vec w in S nbsp The area of the fundamental parallelogram of the lattice is p displaystyle p nbsp The area of the open disk D displaystyle D nbsp of radius 2 p displaystyle sqrt 2p nbsp centered around the origin is 2 p p gt 4 p displaystyle 2 pi p gt 4p nbsp Furthermore D displaystyle D nbsp is convex and symmetrical about the origin Therefore by Minkowski s theorem there exists a nonzero vector w S displaystyle vec w in S nbsp such that w D displaystyle vec w in D nbsp Both w 2 lt 2 p displaystyle vec w 2 lt 2p nbsp and p w 2 displaystyle p mid vec w 2 nbsp so p w 2 displaystyle p vec w 2 nbsp Hence p displaystyle p nbsp is the sum of the squares of the components of w displaystyle vec w nbsp Zagier s one sentence proof edit Let p 4 k 1 displaystyle p 4k 1 nbsp be prime let N displaystyle mathbb N nbsp denote the natural numbers with or without zero and consider the finite set S x y z N 3 x 2 4 y z p displaystyle S x y z in mathbb N 3 x 2 4yz p nbsp of triples of numbers Then S displaystyle S nbsp has two involutions an obvious one x y z x z y displaystyle x y z mapsto x z y nbsp whose fixed points x y y displaystyle x y y nbsp correspond to representations of p displaystyle p nbsp as a sum of two squares and a more complicated one x y z x 2 z z y x z if x lt y z 2 y x y x y z if y z lt x lt 2 y x 2 y x y z y if x gt 2 y displaystyle x y z mapsto begin cases x 2z z y x z quad textrm if x lt y z 2y x y x y z quad textrm if y z lt x lt 2y x 2y x y z y quad textrm if x gt 2y end cases nbsp which has exactly one fixed point 1 1 k displaystyle 1 1 k nbsp This proves that the cardinality of S displaystyle S nbsp is odd Hence S displaystyle S nbsp has also a fixed point with respect to the obvious involution This proof due to Zagier is a simplification of an earlier proof by Heath Brown which in turn was inspired by a proof of Liouville The technique of the proof is a combinatorial analogue of the topological principle that the Euler characteristics of a topological space with an involution and of its fixed point set have the same parity and is reminiscent of the use of sign reversing involutions in the proofs of combinatorial bijections This proof is equivalent to a geometric or visual proof using windmill figures given by Alexander Spivak in 2006 and described in this MathOverflow post and this Mathologer YouTube video Why was this visual proof missed for 400 years Fermat s two square theorem on YouTube Proof with partition theory edit In 2016 A David Christopher gave a partition theoretic proof by considering partitions of the odd prime n displaystyle n nbsp having exactly two sizes a i i 1 2 displaystyle a i i 1 2 nbsp each occurring exactly a i displaystyle a i nbsp times and by showing that at least one such partition exists if n displaystyle n nbsp is congruent to 1 modulo 4 15 See also editLegendre s three square theorem Lagrange s four square theorem Landau Ramanujan constant Thue s lemma Friedlander Iwaniec theoremReferences editD A Cox 1989 Primes of the Form x2 ny2 Wiley Interscience ISBN 0 471 50654 0 Richard Dedekind The theory of algebraic integers L E Dickson History of the Theory of Numbers Vol 2 Chelsea Publishing Co New York 1920 Harold M Edwards Fermat s Last Theorem A genetic introduction to algebraic number theory Graduate Texts in Mathematics no 50 Springer Verlag NY 1977 C F Gauss Disquisitiones Arithmeticae English Edition Transl by Arthur A Clarke Springer Verlag 1986 Goldman Jay R 1998 The Queen of Mathematics A historically motivated guide to Number Theory A K Peters ISBN 1 56881 006 7 D R Heath Brown Fermat s two squares theorem Invariant 11 1984 pp 3 5 John Stillwell Introduction to Theory of Algebraic Integers by Richard Dedekind Cambridge Mathematical Library Cambridge University Press 1996 ISBN 0 521 56518 9 Don Zagier A one sentence proof that every prime p 1 mod 4 is a sum of two squares Amer Math Monthly 97 1990 no 2 144 doi 10 2307 2323918Notes edit For a proof of the converse see for instance 20 1 Theorems 367 and 368 in G H Hardy and E M Wright An introduction to the theory of numbers Oxford 1938 Simon Stevin l Arithmetique de Simon Stevin de Bruges annotated by Albert Girard Leyde 1625 p 622 L E Dickson History of the Theory of Numbers Vol II Ch VI p 227 A Girard had already made a determination of the numbers expressible as a sum of two integral squares every square every prime 4n 1 a product formed of such numbers and the double of the foregoing L E Dickson History of the Theory of Numbers Vol II Ch VI p 228 Wagon Stan 1990 Editor s Corner The Euclidean Algorithm Strikes Again American Mathematical Monthly 97 2 125 doi 10 2307 2323912 MR 1041889 De numerus qui sunt aggregata quorum quadratorum Novi commentarii academiae scientiarum Petropolitanae 4 1752 3 1758 3 40 Demonstratio theorematis FERMATIANI omnem numerum primum formae 4n 1 esse summam duorum quadratorum Novi commentarii academiae scientiarum Petropolitanae 5 1754 5 1760 3 13 Zagier D 1990 A one sentence proof that every prime p 1 mod 4 is a sum of two squares American Mathematical Monthly 97 2 144 doi 10 2307 2323918 MR 1041893 A David Christopher A partition theoretic proof of Fermat s Two Squares Theorem Discrete Mathematics 339 4 1410 1411 6 April 2016 doi 10 1016 j disc 2015 12 002 Euler a Goldbach lettre CXXV De numerus qui sunt aggregata duorum quadratorum Novi commentarii academiae scientiarum Petropolitanae 4 1752 3 1758 3 40 1 Demonstratio theorematis FERMATIANI omnem numerum primum formae 4n 1 esse summam duorum quadratorum Novi commentarii academiae scientiarum Petropolitanae 5 1754 5 1760 3 13 2 The summary is based on Edwards book pages 45 48 Nouv Mem Acad Berlin annee 1771 125 ibid annee 1773 275 ibid annee 1775 351 A David Christopher A partition theoretic proof of Fermat s Two Squares Theorem Discrete Mathematics 339 2016 1410 1411 External links editTwo more proofs at PlanetMath org A one sentence proof of the theorem Archived from the original on 5 February 2012 a href Template Cite web html title Template Cite web cite web a CS1 maint unfit URL link Fermat s two squares theorem D R Heath Brown 1984 Polster Burkard 2019 Fermat s Christmas theorem Visualising the hidden circle in p 4 1 1 3 1 5 1 7 Video Mathologer Retrieved from https en wikipedia org w index php title Fermat 27s theorem on sums of two squares amp oldid 1167103394, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.