Download The Sum of Two Squares

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Location arithmetic wikipedia , lookup

Mathematical proof wikipedia , lookup

List of important publications in mathematics wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Theorem wikipedia , lookup

Arithmetic wikipedia , lookup

Factorization wikipedia , lookup

Elementary mathematics wikipedia , lookup

Collatz conjecture wikipedia , lookup

Wiles's proof of Fermat's Last Theorem wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Fermat's Last Theorem wikipedia , lookup

Addition wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Quadratic reciprocity wikipedia , lookup

List of prime numbers wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
The Sum of Two Squares
Sean Li
Cornell University
[email protected]
Jan. 30, 2013
1
Introduction
The sum of two squares problem is an old but nonetheless interesting problem. I first learned about it in an algebraic number theory course. The problem
asks which positive integers can be written as the sum of two squares. For instance, 1 = 12 + 02 , but 3 cannot be written as the sum of two squares as the
lowest squares are 1 and 4. Below is a table for the first 20 integers:
n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Sum of two squares?
12 + 02
12 + 12
No
2
4 + 02
42 + 12
No
No
22 + 22
32 + 02
32 + 12
No
No
32 + 22
No
No
2
4 + 02
42 + 12
32 + 32
No
42 + 22
1
At first, there appears to be little pattern to which numbers can be written as
the sum of two primes. Moreover, even if we could find a pattern for a larger
set of numbers, say all the numbers below 100, how would we know the pattern
holds for much larger numbers?
This document is devoted to the sum of two squares problem and its solution.
It is written as an accessible introduction on the problem as well as introduction
to some concepts in number theory and algebra. My math documents are stored
on a math blog at www.epicmath.org.
2
Notation, Terminology, and Background
A standard notation is used whenever possible. Let C denote the complex
numbers, R the real numbers, Z the integers, and N the natural numbers.
Let Z[i] denote the Gaussian
numbers a + bi
√ integers, i.e. the set of complex
√
where a, b ∈ Z and i = −1. And in general, let Z[ −n] denote complex
numbers of the form
√
a + b −n
where a, b ∈ Z.
An element a divides an element b if b = ma for some element m. We write “a
divides b” as a|b.
We use the terms group, ring, and field as usual. A unit u ∈ R is an element of
a ring with an inverse also in R. A prime p is a non-zero, non-unit element of a
ring R such that if a, b ∈ R and p|ab, then p|a or p|b. An irreducible element q is
a non-zero, non-unit element of a ring R such that if q = ab, where a, b ∈ R, then
a or b must be a unit. In any ring, an element is prime implies it is irreducible,
but the converse is not always true.
A domain is a ring R with no zero divisors, i.e. for all a, b ∈ R, a, b 6= 0, we have
ab 6= 0. A unique factorization domain (UFD) is a domain where factorization
into primes is unique up to units. In a UFD, irreducible implies prime, so that
prime and irreducible are equivalent.
An ideal is a subset I ⊂ R of a ring such that for any elements a ∈ I and
x ∈ R, ax ∈ I. A principal ideal is an ideal that is generated by one element.
For example, in Z, the even numbers form a principal ideal generated by the
element 2. A principal ideal domain (PID) is a domain such that every ideal
is principal. Every PID is a UFD. Hence in a PID, prime and irreducible are
equivalent.
2
A euclidean domain R is a domain with a function f : R → N such that for all
z, z 0 ∈ R such that z, z 0 6= 0, there exist q, r ∈ R such that z 0 = qz + r with
f (z) > f (r). Every euclidean domain is a PID, so every euclidean domain is
also a UFD. The integers Z form a euclidean domain, and consequently, they
form a PID and a UFD.
We say that a is congruent to b modulo m if m|(a − b) or, equivalently, there
is some element n such that mn = a − b. If a is congruent to b modulo m, we
write this as a ≡ b (mod m).
3
The Brahmagupta-Fibonacci Identity
Often the best way to approach a complicated problem is to simplify it. It was
realized early on that if two numbers are each the sum of two squares, then their
product is again the sum of two squares.
Identity (Brahmagupta-Fibonacci).
(a2 + b2 )(c2 + d2 ) = (ac − bd)2 + (ad + bc)2 = (ac + bd)2 + (ad − bc)2 .
Proof. Expanding out each expression gives a2 c2 + a2 d2 + b2 c2 + b2 d2 . Since every composite number is the product of primes, this reduces the problem
of finding which positive integers n satisfy n = a2 + b2 to finding which primes
p satisfy p = a2 + b2 .
4
Fermat’s Theorem on Sums of Two Squares
Fermat was among the first to state a solution to this problem. Although he
did not give a proof (perhaps it could not fit in the margin), the theorem is
generally named after him. The first to give a proof was Euler, but his proof is
very complicated. The following proof is in the style of Dedekind.
Theorem (Fermat). Let p be an odd prime number. Then p can be expressed
as
p = a 2 + b2
if and only if p ≡ 1 (mod 4).
Proof. One direction ( =⇒ ) is easy. Suppose there is some prime p such that
p ≡ 3 (mod 4) and p = a2 + b2 . But a square is always congruent to either
3
0 or 1 (mod 4). Hence a2 + b2 ≡ 0, 1, or 2 (mod 4). The case 3 (mod 4) is
impossible.
The other direction is significantly harder. We invoke Z[i], the ring of Gaussian
integers. Given the behavior of complex numbers, this might seem natural as
(a − bi)(a + bi) = a2 + b2 .
Lemma 1. The ring Z[i] is a UFD.
Proof of Lemma. We prove that Z[i] is a euclidean domain, which is a stronger
condition than being a PID, which is in turn stronger than being a UFD. Let | |
be the standard complex absolute value function. Then in C, let q0 be such that
z 0 = q0 z, which is possible because every non-zero element in C has an inverse.
Let q be the element of Z[i] closest in absolute value to q0 . Since the points of
Z[i] lie on a square lattice one apart, the maximum distance an element of C
can be from the lattice is if it is exactly in the middle of a lattice square, with
distance
√
|q − q0 | ≤ 2/2 < 1.
Then
|r| = |q − q0 ||z| < |z|,
so that Z[i] is a euclidean domain. Thus it is also a PID and a UFD. Proof of Theorem, cont’d. Let p be a prime with p ≡ 1 (mod 4). We want to
show p = a2 + b2 for some a, b ∈ Z.
Consider the multiplicative group (also a finite field) F∗p = (Z /p Z)∗ . Since
p ≡ 1 (mod 4), F∗p has order is divisible by 4. Now by a theorem on fields, F∗p
is a cyclic group, and so there exists an element x ∈ F∗p of order 4. Thus in Fp ,
we have
x4 = 1,
or x2 = −1. Moving back into Z, this implies there exists x ∈ Z such that
x2 + 1 ≡ 0
(mod p),
so x2 + 1 = mp for some m ∈ Z.
Now we use the unique factorization in Z[i].
Case 1: p is a prime in Z[i]. Then p|x2 + 1 implies
p|x − i or p|x + i,
which would imply p(a + bi) = x ± i, and hence pb = 1. Since p is a prime and
a prime does not have an inverse, this is a contradiction.
4
Case 2: p is not a prime in Z[i]. Then p = z1 z2 , where z1 and z2 are non-units
of R. Write z1 = a + bi and z2 = c + di, so that p = (a + bi)(c + di). The norm
k k of a + bi is given by
ka + bik = a2 + b2 ,
and the norm is a multiplicative function. That is, kxyk = kxk · kyk. We take
the norm of p to obtain
kpk = p2 = (a2 + b2 )(c2 + d2 ).
Now p is a prime in Z, so this implies a2 + b2 = c2 + d2 . Hence p = a2 + b2 . Remark. Since p = (a + bi)(c + di) in Z[i], which has unique factorization,
and since a2 + b2 = c2 + d2 , the a and b are actually unique, up to units and
symmetry.
With this theorem along with the Brahmagupta-Fibonacci identity, we see that
any number whose prime factors congruent to 3 (mod 4) are all at even powers
can be written as the sum of two squares.
5
Other Rings
√
It turns out we can use a similar argument for the ring Z[ −2]. Note that we
still have unique factorization
in this ring, as we can use the proof in Lemma
√
1 to show
that
Z[
−2]
is
a
euclidean
domain. This time, the key inequality is
√
< 1, as √
the maximum distance between a point in C and a lattice
that 3/2 √
point of Z[ −2] is 3/2.
√
√
√
In Z[ √
−3] and Z[ −5], however, the method to show euclidean fails as 4/2 6<
1 and 6/2 6< 1. In fact, we do not have unique factorization as
√
√
4 = (2)(2) = (1 + −3)(1 − −3)
√
in Z[ −3] and
√
√
6 = (2)(3) = (1 + −5)(1 − −5)
√
in Z[ −5].
h √ i
√
The ring Z[ −3] can actually be “fixed” by enlarging it to the ring Z 1+ 2 −3 ,
√
which does have unique factorization. Z[ −5] cannot be fixed in this manner.
5
6
Arithmetic Progressions
Which p satisfy p = a2 +qb2 ? We give descriptions and examples for q = 1, 2, 3, 5
below.
• p = a2 + b2 ⇐⇒ p ≡ 1 (mod 4). Examples: 5, 13, 17, 29.
• p = a2 + 2b2 ⇐⇒ p ≡ 1, 3 (mod 8). Examples: 3, 11, 17, 19.
• p = a2 + 3b2 ⇐⇒ p ≡ 1 (mod 3). Examples: 7, 13, 19, 31.
• p = a2 + 5b2 ⇐⇒ p ≡ 1, 9 (mod 20). Examples: 29, 41, 61, 89.
Here is another famous result, which is stated here without proof.
Theorem on Primes in an Arithmetic Progression (Dirichlet). Suppose
gcd(a, m) = 1, that is, a and m are relatively prime. Then the sequence
a, a + m, a + 2m, . . .
contains infinitely many primes. Moreover, the proportion of primes this sequence contains out of the total number of primes is
1
ϕ(m)
where ϕ(m) is the Euler totient function, which counts the positive integers less
than or equal to m but which are relatively prime to m.
How is this related? Let a = 1 and m = 4. This grants that the primes satisfying
p ≡ 1 (mod 4) are exactly 1/2 the total primes as ϕ(4) = 2. Also, the primes
for which p ≡ 3 (mod 4) are also exactly 1/2 the total primes. Then we can say
that p = a2 + b2 for 1/2 the primes.
Now let a = 1, 3, 5, 7 and m = 8. The primes satisfying p ≡ 1 (mod 8) and
p ≡ 3 (mod 8) are each one quarter of the primes, and together they make one
half. So we say that p = a2 + 2b2 for 1/2 the primes.
Does this trend continue? Indeed it does. p 6≡ 0 (mod 3), so it must be congruent to 1, 2 (mod 3). But p = a2 + 3b2 is true only for the primes p ≡ 1 (mod 3),
and ϕ(3) = 2, so we say that p = a2 + 3b2 for 1/2 the primes.
This pattern breaks at 5. Note that ϕ(20) = 8, but the solution for a2 + 5b2
only runs through two congruence
√ classes: 1, 9 (mod 20). This is related to the
non-unique√factorization for Z[ −5] and the fact that it cannot be “fixed” in
the way Z[ −3] can. So, p = a2 + 5b2 has a solution for 1/4 the primes.
6
References
[P1] J. Pahikkala. “Sums of two squares” (version 26). PlanetMath.org. Freely
available at http://planetmath.org/SumsOfTwoSquares.html.
[S1] Samuel, Pierre, Algebraic Theory of Numbers, Dover Publications, Mineola,
NY, 1970.
[S2] Sen, Shankar. Lectures on Algebraic Number Theory, Cornell University,
Ithaca, NY, 2013.
7