HOME

TheInfoList



OR:

In
additive number theory Additive number theory is the subfield of number theory concerning the study of subsets of integers and their behavior under addition. More abstractly, the field of additive number theory includes the study of abelian groups and commutative semigr ...
,
Fermat Pierre de Fermat (; between 31 October and 6 December 1607 – 12 January 1665) was a French mathematician who is given credit for early developments that led to infinitesimal calculus, including his technique of adequality. In particular, he is ...
's theorem on sums of two squares states that an
odd Odd means unpaired, occasional, strange or unusual, or a person who is viewed as eccentric. Odd may also refer to: Acronym * ODD (Text Encoding Initiative) ("One Document Does it all"), an abstracted literate-programming format for describing X ...
prime A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
''p'' can be expressed as: :p = x^2 + y^2, with ''x'' and ''y'' integers,
if and only if In logic and related fields such as mathematics and philosophy, "if and only if" (shortened as "iff") is a biconditional logical connective between statements, where either both statements are true or both are false. The connective is b ...
:p \equiv 1 \pmod. The prime numbers for which this is true are called
Pythagorean prime A Pythagorean prime is a prime number of the Pythagorean primes are exactly the odd prime numbers that are the sum of two squares; this characterization is Fermat's theorem on sums of two squares. Equivalently, by the Pythagorean theorem, they ...
s. For example, the primes 5, 13, 17, 29, 37 and 41 are all
congruent Congruence may refer to: Mathematics * Congruence (geometry), being the same size and shape * Congruence or congruence relation, in abstract algebra, an equivalence relation on an algebraic structure that is compatible with the structure * In mod ...
to 1 modulo 4, and they can be expressed as sums of two squares in the following ways: :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. This generalization of Fermat's theorem is known as the sum of two squares theorem.


History

Albert Girard Albert Girard () (11 October 1595 in Saint-Mihiel, France − 8 December 1632 in Leiden, The Netherlands) was a French-born mathematician. He studied at the University of Leiden. He "had early thoughts on the fundamental theorem of algebra" and g ...
was the first to make the observation, describing all positive integer numbers (not necessarily primes) expressible as the sum of two squares of positive integers; this was published in 1625. The statement that every prime ''p'' of the form ''4n+1'' is the sum of two squares is sometimes called ''Girard's theorem''. 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

Fermat's theorem on sums of two squares is strongly related with the theory of
Gaussian prime In number theory, a Gaussian integer is a complex number whose real and imaginary parts are both integers. The Gaussian integers, with ordinary addition and multiplication of complex numbers, form an integral domain, usually written as \mathbf /ma ...
s. A
Gaussian integer In number theory, a Gaussian integer is a complex number whose real and imaginary parts are both integers. The Gaussian integers, with ordinary addition and multiplication of complex numbers, form an integral domain, usually written as \mathbf /ma ...
is a
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the fo ...
a+ib such that and are integers. The ''norm'' N(a+ib)=a^2+b^2 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 prime In number theory, a Gaussian integer is a complex number whose real and imaginary parts are both integers. The Gaussian integers, with ordinary addition and multiplication of complex numbers, form an integral domain, usually written as \mathbf /ma ...
s 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 and ). The multiplicative property of the norm implies that a prime number is either a Gaussian prime or the norm of a Gaussian prime. Fermat's theorem asserts that the first case occurs when p=4k+3, and that the second case occurs when p=4k+1 and p=2. The last case is not considered in Fermat's statement, but is trivial, as 2 = 1^2+1^2 =N(1+i).


Related results

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 \mathcal O_\sqrt is the ring of
algebraic integer In algebraic number theory, an algebraic integer is a complex number which is integral over the integers. That is, an algebraic integer is a complex root of some monic polynomial (a polynomial whose leading coefficient is 1) whose coefficients ...
s in the
quadratic field In algebraic number theory, a quadratic field is an algebraic number field of degree two over \mathbf, the rational numbers. Every such quadratic field is some \mathbf(\sqrt) where d is a (uniquely defined) square-free integer different from 0 a ...
, then an odd prime number , not dividing , is either a prime element in \mathcal O_\sqrt, or the
ideal norm In commutative algebra, the norm of an ideal is a generalization of a norm of an element in the field extension. It is particularly important in number theory since it measures the size of an ideal of a complicated number ring in terms of an ideal ...
of an ideal of \mathcal O_\sqrt, which is necessarily prime. Moreover, the
law of quadratic reciprocity In number theory, the law of quadratic reciprocity is a theorem about modular arithmetic that gives conditions for the solvability of quadratic equations modulo prime numbers. Due to its subtlety, it has many formulations, but the most standard st ...
allows distinguishing the two cases in terms of congruences. If \mathcal O_\sqrt is a principal ideal domain, then is an ideal norm if and only :4p=a^2-db^2, with and 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 and d=-3. If is an odd prime, then :p = x^2 + 2y^2 \iff p\equiv 1\mboxp\equiv 3\pmod, :p= x^2 + 3y^2 \iff p\equiv 1 \pmod. 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 are of the form or , then . Euler later extended this to the conjecture that :p = x^2 + 5y^2 \iff p\equiv 1\mboxp\equiv 9\pmod, :2p = x^2 + 5y^2 \iff p\equiv 3\mboxp\equiv 7\pmod. Both Fermat's assertion and Euler's conjecture were established by Joseph-Louis Lagrange. This more complicated formulation relies on the fact that \mathcal O_\sqrt is not a principal ideal domain, unlike \mathcal O_\sqrt and \mathcal O_\sqrt.


Algorithm

There is a trivial
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
for decomposing a prime of the form p=4k+1 into a sum of two squares: For all such 1\le n<\sqrt p , test whether the square root of p-n^2 is an integer. If this the case, one has got the decomposition. However the input size of the algorithm is \log p, the number of digits of (up to a constant factor that depends on the
numeral base In a positional numeral system, the radix or base is the number of unique numerical digit, digits, including the digit zero, used to represent numbers. For example, for the decimal/denary system (the most common system in use today) the radix (b ...
). The number of needed tests is of the order of \sqrt p = \exp \left (\frac 2\right), and thus
exponential Exponential may refer to any of several mathematical topics related to exponentiation, including: *Exponential function, also: **Matrix exponential, the matrix analogue to the above *Exponential decay, decrease at a rate proportional to value *Expo ...
in the input size. So the computational complexity of this algorithm is
exponential Exponential may refer to any of several mathematical topics related to exponentiation, including: *Exponential function, also: **Matrix exponential, the matrix analogue to the above *Exponential decay, decrease at a rate proportional to value *Expo ...
. An algorithm with a
polynomial complexity In computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by t ...
has been described by Stan Wagon in 1990, based on work by Serret and Hermite (1848), and Cornacchia (1908).


Description

Given an odd prime p in the form 4k+1, first find x such that x^2\equiv-1 \pmod. This can be done by finding a
Quadratic non-residue In number theory, an integer ''q'' is called a quadratic residue modulo ''n'' if it is congruent to a perfect square modulo ''n''; i.e., if there exists an integer ''x'' such that: :x^2\equiv q \pmod. Otherwise, ''q'' is called a quadratic no ...
modulo p, say q, and letting x=q^\frac \pmod. Such an x will satisfy the condition since quadratic non-residues satisfy q^\frac\equiv -1 \pmod. Once x is determined, one can apply the Euclidean algorithm with p and x. Denote the first two remainders that are less than the square root of p as a and b. Then it will be the case that a^2+b^2=p.


Example

Take p = 97. A possible quadratic non-residue for 97 is 13, since 13^\frac\equiv-1 \pmod. so we let x=13^\frac=22 \pmod. The Euclidean algorithm applied to 97 and 22 yields: 97 = 22(4) + 9, 22 = 9(2) + 4, 9 = 4(2) + 1, 4 = 1(4). The first two remainders smaller than the square root of 97 are 9 and 4; and indeed we have 97 = 9^2 + 4^2, as expected.


Proofs

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 In mathematics, a proof by infinite descent, also known as Fermat's method of descent, is a particular kind of proof by contradiction used to show that a statement cannot possibly hold for any number, by showing that if the statement were to hold f ...
. 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). Lagrange gave a proof in 1775 that was based on his study of
quadratic forms In mathematics, a quadratic form is a polynomial with terms all of degree two ("form" is another name for a homogeneous polynomial). For example, :4x^2 + 2xy - 3y^2 is a quadratic form in the variables and . The coefficients usually belong to ...
. This proof was simplified by
Gauss Johann Carl Friedrich Gauss (; german: Gauß ; la, Carolus Fridericus Gauss; 30 April 177723 February 1855) was a German mathematician and physicist who made significant contributions to many fields in mathematics and science. Sometimes refer ...
in his ''
Disquisitiones Arithmeticae The (Latin for "Arithmetical Investigations") is a textbook of number theory written in Latin by Carl Friedrich Gauss in 1798 when Gauss was 21 and first published in 1801 when he was 24. It is notable for having had a revolutionary impact on th ...
'' (art. 182).
Dedekind Julius Wilhelm Richard Dedekind (6 October 1831 – 12 February 1916) was a German mathematician who made important contributions to number theory, abstract algebra (particularly ring theory), and the axiomatic foundations of arithmetic. His ...
gave at least two proofs based on the arithmetic of the
Gaussian integer In number theory, a Gaussian integer is a complex number whose real and imaginary parts are both integers. The Gaussian integers, with ordinary addition and multiplication of complex numbers, form an integral domain, usually written as \mathbf /ma ...
s. There is an elegant proof using
Minkowski's theorem In mathematics, Minkowski's theorem is the statement that every convex set in \mathbb^n which is symmetric with respect to the origin and which has volume greater than 2^n contains a non-zero integer point (meaning a point in \Z^n that is not t ...
about convex sets. Simplifying an earlier short proof due to
Heath-Brown David Rodney "Roger" Heath-Brown FRS (born 12 October 1952), is a British mathematician working in the field of analytic number theory. Education He was an undergraduate and graduate student of Trinity College, Cambridge; his research supervis ...
(who was inspired by
Liouville Joseph Liouville (; ; 24 March 1809 – 8 September 1882) was a French mathematician and engineer. Life and work He was born in Saint-Omer in France on 24 March 1809. His parents were Claude-Joseph Liouville (an army officer) and Thérèse ...
's idea), Zagier presented a non-constructive one-sentence proof in 1990. And more recently Christopher gave a partition-theoretic proof.


Euler's proof by infinite descent

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. The proof relies on
infinite descent In mathematics, a proof by infinite descent, also known as Fermat's method of descent, is a particular kind of proof by contradiction used to show that a statement cannot possibly hold for any number, by showing that if the statement were to hold f ...
, 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 and do not correspond exactly to the four steps below. The fifth step below is from the second paper. 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) = (ap+bq)^2 + (aq-bp)^2 ::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 a^2 + b^2 is divisible by p^2+q^2 and that this latter is a prime. Then p^2 + q^2 divides :::(pb-aq)(pb+aq) = p^2b^2 - a^2q^2 = p^2(a^2+b^2) - a^2(p^2+q^2). ::Since p^2+q^2 is a prime, it divides one of the two factors. Suppose that it divides pb-aq. Since :::(a^2+b^2)(p^2+q^2) = (ap+bq)^2 + (aq-bp)^2 ::(Diophantus's identity) it follows that p^2+q^2 must divide (ap+bq)^2. So the equation can be divided by the square of p^2+q^2. Dividing the expression by (p^2+q^2)^2 yields: :::\frac = \left(\frac\right)^2 + \left(\frac\right)^2 ::and thus expresses the quotient as a sum of two squares, as claimed. ::On the other hand if p^2+q^2 divides pb+aq, a similar argument holds by using the following variant of Diophantus's identity: :::(a^2+b^2)(q^2+p^2) = (aq+bp)^2 + (ap-bq)^2 . 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 is a number not expressible as a sum of two squares, which divides a^2+b^2. Write the quotient, factored into its (possibly repeated) prime factors, as p_1p_2\cdots p_n so that a^2+b^2 = q p_1p_2\cdots p_n. If all factors p_i can be written as sums of two squares, then we can divide a^2+b^2 successively by p_1, p_2, 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 then q 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 is not the sum of two squares. 4. ''If a and b are relatively prime positive integers then every factor of a^2 + b^2 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 be relatively prime positive integers:
without loss of generality ''Without loss of generality'' (often abbreviated to WOLOG, WLOG or w.l.o.g.; less commonly stated as ''without any loss of generality'' or ''with no loss of generality'') is a frequently used expression in mathematics. The term is used to indicat ...
a^2+b^2 is not itself prime, otherwise there is nothing to prove. Let q therefore be a ''proper'' factor of a^2+b^2, not necessarily prime: we wish to show that q is a sum of two squares. Again, we lose nothing by assuming q > 2 since the case q = 2 = 1^2 + 1^2 is obvious. ::Let m,n be non-negative integers such that mq,nq are the closest multiples of q (in absolute value) to a,b respectively. Notice that the differences c = a-mq and d = b-nq are integers of absolute value strictly less than q/2: indeed, when q > 2 is even, gcd(a,q/2)=1; otherwise since gcd(a,q/2) \mid q/2 \mid q \mid a^2+b^2, we would also have gcd(a,q/2) \mid b. ::Multiplying out we obtain :::a^2 + b^2 = m^2q^2 + 2mqc + c^2 + n^2q^2 + 2nqd + d^2 = Aq + (c^2+d^2) ::uniquely defining a non-negative integer A. Since q divides both ends of this equation sequence it follows that c^2+d^2 must also be divisible by q: say c^2+d^2 = qr. Let g be the gcd of c and d which by the co-primeness of a,b is relatively prime to q. Thus g^2 divides r, so writing e = c/g, f = d/g and s = r/g^2, we obtain the expression e^2+f^2 = qs for relatively prime e and f, and with s < q/2 , since :::qs = e^2 + f^2 \leq c^2+d^2 < \left(\frac\right)^2 + \left(\frac\right)^2 = q^2/2. ::Now finally, the ''descent'' step: if q is not the sum of two squares, then by step (3.) there must be a factor q_1 say of s which is not the sum of two squares. But q_1 \leq s < q/2 < q and so repeating these steps (initially with e,f;q_1 in place of a,b;q, and so on ''ad infinitum'') we shall be able to find a strictly decreasing infinite sequence q, q_1, q_2, \ldots 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 must be expressible as a sum of two squares, as claimed. 5. ''Every prime of the form 4n+1 is a sum of two squares.'' (This is the main result of Euler's second paper). ::If p=4n+1, then by Fermat's Little Theorem each of the numbers 1, 2^, 3^,\dots, (4n)^ is congruent to one modulo p. The differences 2^-1, 3^-2^,\dots,(4n)^-(4n-1)^ are therefore all divisible by p. Each of these differences can be factored as :::a^-b^ = \left(a^+b^\right)\left(a^-b^\right). ::Since p is prime, it must divide one of the two factors. If in any of the 4n-1 cases it divides the first factor, then by the previous step we conclude that p is itself a sum of two squares (since a and b differ by 1, they are relatively prime). So it is enough to show that p cannot always divide the second factor. If it divides all 4n-1 differences 2^-1, 3^-2^,\dots,(4n)^-(4n-1)^, then it would divide all 4n-2 differences of successive terms, all 4n-3 differences of the differences, and so forth. Since the kth differences of the sequence 1^k, 2^k, 3^k,\dots are all equal to k! (
Finite difference A finite difference is a mathematical expression of the form . If a finite difference is divided by , one gets a difference quotient. The approximation of derivatives by finite differences plays a central role in finite difference methods for t ...
), the 2nth differences would all be constant and equal to (2n)!, which is certainly not divisible by p. Therefore, p cannot divide all the second factors which proves that p is indeed the sum of two squares.


Lagrange's proof through quadratic forms

Lagrange completed a proof in 1775 based on his general theory of integral quadratic forms. The following presentation incorporates a slight simplification of his argument, due to
Gauss Johann Carl Friedrich Gauss (; german: Gauß ; la, Carolus Fridericus Gauss; 30 April 177723 February 1855) was a German mathematician and physicist who made significant contributions to many fields in mathematics and science. Sometimes refer ...
, which appears in article 182 of the
Disquisitiones Arithmeticae The (Latin for "Arithmetical Investigations") is a textbook of number theory written in Latin by Carl Friedrich Gauss in 1798 when Gauss was 21 and first published in 1801 when he was 24. It is notable for having had a revolutionary impact on th ...
. An (integral binary) quadratic form is an expression of the form ax^2 + bxy + cy^2 with a,b,c integers. A number n is said to be ''represented by the form'' if there exist integers x,y such that n = ax^2 + bxy + cy^2. Fermat's theorem on sums of two squares is then equivalent to the statement that a prime p is represented by the form x^2 + y^2 (i.e., a=c=1, b=0) exactly when p is congruent to 1 modulo 4. The discriminant of the quadratic form is defined to be b^2 - 4ac. The discriminant of x^2 + y^2 is then equal to -4. Two forms ax^2 + bxy + cy^2 and a'x'^2 + b'x'y' + c'y'^2 are ''equivalent'' if and only if there exist substitutions with integer coefficients : x = \alpha x' + \beta y' : y = \gamma x' + \delta y' with \alpha\delta - \beta\gamma = \pm 1 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 , 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. For example, one can use a form : px^2 + 2mxy + \left(\frac\right)y^2, where the first coefficient ''a'' = p was chosen so that the form represents p by setting ''x'' = 1, and ''y'' = 0, the coefficient ''b'' = 2''m'' is an arbitrary even number (as it must be, to get an even discriminant), and finally c=\frac is chosen so that the discriminant b^2-4ac=4m^2-4pc is equal to −4, which guarantees that the form is indeed equivalent to x^2+y^2 . Of course, the coefficient c=\frac must be an integer, so the problem is reduced to finding some integer ''m'' such that p divides m^2+1: or in other words, a '' 'square root of -1 modulo p' ''. We claim such a square root of -1 is given by K = \prod_^\frac k . Firstly it follows from Euclid's
Fundamental Theorem of Arithmetic In mathematics, the fundamental theorem of arithmetic, also called the unique factorization theorem and prime factorization theorem, states that every integer greater than 1 can be represented uniquely as a product of prime numbers, up to the ord ...
that ab \equiv 0 \pmod p \iff a \equiv 0 \pmod p \ \ \hbox\ \ b \equiv 0 \pmod p . Consequently, a^2 \equiv 1 \pmod p \iff a \equiv \pm 1 \pmod p : that is, \pm 1 are their own inverses modulo p and this property is unique to them. It then follows from the validity of
Euclidean division In arithmetic, Euclidean division – or division with remainder – is the process of dividing one integer (the dividend) by another (the divisor), in a way that produces an integer quotient and a natural number remainder strictly smaller than ...
in the integers, and the fact that p is prime, that for every 2 \leq a \leq p-2 the gcd of a and p may be expressed via the Euclidean algorithm yielding a unique and ''distinct'' inverse a^ \neq a of a modulo p. In particular therefore the product of ''all'' non-zero residues modulo p is -1. Let L = \prod_^ l : from what has just been observed, KL \equiv -1 \pmod p . But by definition, since each term in K may be paired with its negative in L, L = (-1)^\fracK , which since p is odd shows that K^2 \equiv -1 \pmod p \iff p \equiv 1 \pmod 4 , as required.


Dedekind's two proofs using Gaussian integers

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 In number theory, a Gaussian integer is a complex number whose real and imaginary parts are both integers. The Gaussian integers, with ordinary addition and multiplication of complex numbers, form an integral domain, usually written as \mathbf /ma ...
, 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 Johann Peter Gustav Lejeune Dirichlet (; 13 February 1805 – 5 May 1859) was a German mathematician who made deep contributions to number theory (including creating the field of analytic number theory), and to the theory of Fourier series and ...
's ''
Vorlesungen über Zahlentheorie (German for ''Lectures on Number Theory'') is the name of several different textbooks of number theory. The best known was written by Peter Gustav Lejeune Dirichlet and Richard Dedekind, and published in 1863. Others were written by Leopold Krone ...
'', and was published in 1894. 1. First proof. If p is an odd
prime number A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
, then we have i^ = (-1)^ in the Gaussian integers. Consequently, writing a Gaussian integer ω = ''x'' + ''iy'' with ''x,y'' ∈ Z and applying the
Frobenius automorphism In commutative algebra and field theory, the Frobenius endomorphism (after Ferdinand Georg Frobenius) is a special endomorphism of commutative rings with prime characteristic , an important class which includes finite fields. The endomorphism m ...
in Z 'i''(''p''), one finds :\omega^p = (x+yi)^p \equiv x^p+y^pi^p \equiv x + (-1)^yi \pmod, since the automorphism fixes the elements of Z/(''p''). In the current case, p=4n+1 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 is the order of the Frobenius automorphism of Z 'i''(''p''), then the
ideal Ideal may refer to: Philosophy * Ideal (ethics), values that one actively pursues as goals * Platonic ideal, a philosophical idea of trueness of form, associated with Plato Mathematics * Ideal (ring theory), special subsets of a ring considere ...
(p) 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 In mathematics, a root of unity, occasionally called a de Moivre number, is any complex number that yields 1 when raised to some positive integer power . Roots of unity are used in many branches of mathematics, and are especially important ...
, where ''m'' was any positive integer; this is the case 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 + iy)=x^2+y^2, 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 \alpha of one of the ideal factors of (''p'') must be a strict divisor of N(p) = p^2, so that we must have p = N(\alpha) = N(a+bi) = a^2 + b^2, which gives Fermat's theorem. 2. Second proof. This proof builds on Lagrange's result that if p=4n+1 is a prime number, then there must be an integer ''m'' such that m^2 + 1 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 In mathematics, a unique factorization domain (UFD) (also sometimes called a factorial ring following the terminology of Bourbaki) is a ring in which a statement analogous to the fundamental theorem of arithmetic holds. Specifically, a UFD is ...
(because they are a Euclidean domain). Since does not divide either of the Gaussian integers m + i and m-i (as it does not divide their
imaginary part In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the form ...
s), but it does divide their product m^2 + 1, it follows that p cannot be a
prime A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
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), there can only be up to two factors of p), so it must be of the form p = (x+yi)(x-yi) for some integers x and y. This immediately yields that p = x^2 + y^2.


Proof by Minkowski's Theorem

For p congruent to 1 mod 4 a prime, -1 is a quadratic residue mod p by Euler's criterion. Therefore, there exists an integer m such that p divides m^2+1. Let \hat, \hat be the standard basis elements for the
vector space In mathematics and physics, a vector space (also called a linear space) is a set whose elements, often called '' vectors'', may be added together and multiplied ("scaled") by numbers called ''scalars''. Scalars are often real numbers, but can ...
\mathbb^2 and set \vec = \hat + m\hat and \vec = 0\hat + p\hat. Consider the
lattice Lattice may refer to: Arts and design * Latticework, an ornamental criss-crossed framework, an arrangement of crossing laths or other thin strips of material * Lattice (music), an organized grid model of pitch ratios * Lattice (pastry), an orna ...
S = \. If \vec = a\vec + b\vec = a \hat + (am + bp)\hat \in S then \, \vec\, ^2 \equiv a^2 + (am+bp)^2 \equiv a^2(1 + m^2) \equiv 0\pmod. Thus p divides \, \vec\, ^2 for any \vec \in S. The area of the fundamental parallelogram of the lattice is p. The area of the open disk, D, of radius \sqrt centered around the origin is 2 \pi p > 4p. Furthermore, D is convex and symmetrical about the origin. Therefore, by
Minkowski's theorem In mathematics, Minkowski's theorem is the statement that every convex set in \mathbb^n which is symmetric with respect to the origin and which has volume greater than 2^n contains a non-zero integer point (meaning a point in \Z^n that is not t ...
there exists a nonzero vector \vec \in S such that \vec \in D. Both \, \vec\, ^2 < 2p and p \mid \, \vec\, ^2 so p = \, \vec\, ^2. Hence p is the sum of the squares of the components of \vec.


Zagier's "one-sentence proof"

Let p=4k+1 be prime, let \mathbb denote the
natural number In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country"). Numbers used for counting are called ''cardinal ...
s (with or without zero), and consider the finite set S=\ of triples of numbers. Then S has two involutions: an obvious one (x,y,z)\mapsto (x,z,y) whose fixed points (x,y,y) correspond to representations of p as a sum of two squares, and a more complicated one, : (x,y,z)\mapsto \begin (x+2z,~z,~y-x-z),\quad \textrm\,\,\, x < y-z \\ (2y-x,~y,~x-y+z),\quad \textrm\,\,\, y-z < x < 2y\\ (x-2y,~x-y+z,~y),\quad \textrm\,\,\, x > 2y \end which has exactly one fixed point (1,1,k). This proves that the cardinality of S is odd. Hence, S 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 David Rodney "Roger" Heath-Brown FRS (born 12 October 1952), is a British mathematician working in the field of analytic number theory. Education He was an undergraduate and graduate student of Trinity College, Cambridge; his research supervis ...
, which in turn was inspired by a proof of
Liouville Joseph Liouville (; ; 24 March 1809 – 8 September 1882) was a French mathematician and engineer. Life and work He was born in Saint-Omer in France on 24 March 1809. His parents were Claude-Joseph Liouville (an army officer) and Thérèse ...
. The technique of the proof is a combinatorial analogue of the topological principle that the Euler characteristics of a
topological space In mathematics, a topological space is, roughly speaking, a geometrical space in which closeness is defined but cannot necessarily be measured by a numeric distance. More specifically, a topological space is a set whose elements are called po ...
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 thi
MathOverflow post
and this Mathologer YouTube video .


Proof with partition theory

In 2016, A. David Christopher gave a partition-theoretic proof by considering partitions of the odd prime n having exactly two sizes a_i (i=1,2), each occurring exactly a_i times, and by showing that at least one such partition exists if n is congruent to 1 modulo 4.A. David Christopher, A partition-theoretic proof of Fermat's Two Squares Theorem", Discrete Mathematics, 339 (2016) 1410–1411.


See also

*
Legendre's three-square theorem In mathematics, Legendre's three-square theorem states that a natural number can be represented as the sum of three squares of integers :n = x^2 + y^2 + z^2 if and only if is not of the form n = 4^a(8b + 7) for nonnegative integers and . The ...
*
Lagrange's four-square theorem Lagrange's four-square theorem, also known as Bachet's conjecture, states that every natural number can be represented as the sum of four integer squares. That is, the squares form an additive basis of order four. p = a_0^2 + a_1^2 + a_2^2 + a_ ...
*
Landau–Ramanujan constant In mathematics and the field of number theory, the Landau–Ramanujan constant is the positive real number ''b'' that occurs in a theorem proved by Edmund Landau in 1908, stating that for large x, the number of positive integers below x that are t ...
* Thue's lemma *
Friedlander–Iwaniec theorem In analytic number theory the Friedlander–Iwaniec theorem states that there are infinitely many prime numbers of the form a^2 + b^4. The first few such primes are :2, 5, 17, 37, 41, 97, 101, 137, 181, 197, 241, 257, 277, 281, 337, 401, 457, 57 ...


References

**Richard Dedekind, ''The theory of algebraic integers''. *
L. E. Dickson Leonard Eugene Dickson (January 22, 1874 – January 17, 1954) was an American mathematician. He was one of the first American researchers in abstract algebra, in particular the theory of finite fields and classical groups, and is also reme ...
. ''
History of the Theory of Numbers ''History of the Theory of Numbers'' is a three-volume work by L. E. Dickson summarizing work in number theory up to about 1920. The style is unusual in that Dickson mostly just lists results by various authors, with little further discussion. T ...
'' 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 The (Latin for "Arithmetical Investigations") is a textbook of number theory written in Latin by Carl Friedrich Gauss in 1798 when Gauss was 21 and first published in 1801 when he was 24. It is notable for having had a revolutionary impact on th ...
'' (English Edition). Transl. by Arthur A. Clarke. Springer-Verlag, 1986. * *D. R. Heath-Brown, ''Fermat's two squares theorem''. Invariant, 11 (1984) pp. 3–5. *
John Stillwell John Colin Stillwell (born 1942) is an Australian mathematician on the faculties of the University of San Francisco and Monash University. Biography He was born in Melbourne, Australia and lived there until he went to the Massachusetts Institu ...
, Introduction to ''Theory of Algebraic Integers'' by Richard Dedekind. Cambridge Mathematical Library, Cambridge University Press, 1996. *
Don Zagier Don Bernard Zagier (born 29 June 1951) is an American-German mathematician whose main area of work is number theory. He is currently one of the directors of the Max Planck Institute for Mathematics in Bonn, Germany. He was a professor at the ''Co ...
, ''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,


Notes


External links


Two more proofs at PlanetMath.org
*
Fermat's two squares theorem
D. R. Heath-Brown, 1984. {{Pierre de Fermat Additive number theory Squares in number theory Theorems in number theory