proof of Lagrange’s four-square theorem

proof of Lagrange’s four-square theorem

The following proof is essentially Lagrange’s original, from around 1770. First, we need three lemmas.

Lemma 1

.

For any

integers

a

,

b

,

c

,

d

,

w

,

x

,

y

,

z

,

(

a

2

+

b

2

+

c

2

+

d

2

)

⁢

(

w

2

+

x

2

+

y

2

+

z

2

)

=

(

a

⁢

w

+

b

⁢

x

+

c

⁢

y

+

d

⁢

z

)

2

+

(

a

⁢

x

-

b

⁢

w

-

c

⁢

z

+

d

⁢

y

)

2

+

(

a

⁢

y

+

b

⁢

z

-

c

⁢

w

-

d

⁢

x

)

2

+

(

a

⁢

z

-

b

⁢

y

+

c

⁢

x

-

d

⁢

w

)

2

.

This is the

Euler four-square identity

, q.v., with different notation.

Lemma 2

.

If

2

⁢

m

is a

sum of two squares

, then so is

m

.

Proof.

Say

2

⁢

m

=

x

2

+

y

2

. Then

x

and

y

are both even or both odd.
Therefore, in the

identity

m

=

(

x

-

y

2

)

2

+

(

x

+

y

2

)

2

,

both

fractions

on the right side are integers. ∎

Lemma 3

.

If

p

is an

odd prime

,
then

a

2

+

b

2

+

1

=

k

⁢

p

for some integers

a

,

b

,

k

with

0

<

k

<

p

.

Proof.

Let

p

=

2

⁢

n

+

1

. Consider the sets

A

:=

{

a

2

∣

a

=

0

,

1

,

…

,

n

}

and

B

:=

{

-

b

2

-

1

∣

b

=

0

,

1

,

…

,

n

}

.

We have the following facts:

1.

No two

elements

in

A

are

congruent

mod

p

, for if

a

2

≡

c

2

(

mod

p

)

, then either

p

∣

(

a

-

c

)

or

p

∣

(

a

+

c

)

by unique factorization of primes. Since

a

-

c

,

a

+

c

≤

2

⁢

n

<

p

, and

0

≤

a

,

c

, we must have

a

=

c

.

2.

Similarly, no two elements in

B

are congruent mod

p

.

3.

Furthermore,

A

∩

B

=

∅

since elements of

A

are all non-negative, while elements of

B

are all

negative

.

4.

Therefore,

C

:=

A

∪

B

has

2

⁢

n

+

2

, or

p

+

1

elements.

Therefore, by the

pigeonhole principle

, two elements in

C

must be congruent mod

p

. In

addition

, by the first two facts, the two elements must come from different sets. As a result, we have the following equation:

a

2

+

b

2

+

1

=

k

⁢

p

for some

k

. Clearly

k

is positive. Also,

p

2

=

(

2

⁢

n

+

1

)

2

>

2

⁢

n

2

+

1

≥

a

2

+

b

2

+

1

=

k

⁢

p

, so

p

>

k

.
∎

Basically, Lemma 3 says that for any prime

p

, some

multiple

0

<

m

<

p

of

p

is a sum of four squares, since

a

2

+

b

2

+

1

=

a

2

+

b

2

+

1

2

+

0

2

.

Proof of Theorem.

By Lemma 1 we need only show that an arbitrary prime

p

is a sum of
four squares. Since that is

trivial

for

p

=

2

, suppose

p

is odd. By Lemma 3, we know

m

⁢

p

=

a

2

+

b

2

+

c

2

+

d

2

for some

m

,

a

,

b

,

c

,

d

with

0

<

m

<

p

. If

m

=

1

, then we are done. To

complete

the proof, we will show that if

m

>

1

then

n

⁢

p

is a sum of four squares for some

n

with

1

≤

n

<

m

.

If

m

is even, then none, two, or all four of

a

,

b

,

c

,

d

are even; in any of those cases, we may break up

a

,

b

,

c

,

d

into two groups, each group containing elements of the same parity. Then Lemma 2 allows us to take

n

=

m

/

2

.

Now assume

m

is odd but

>

1

. Write

w

≡

a

(

mod

m

)

x

≡

b

(

mod

m

)

y

≡

c

(

mod

m

)

z

≡

d

(

mod

m

)

where

w

,

x

,

y

,

z

are all in the interval

(

-

m

/

2

,

m

/

2

)

. We have

w

2

+

x

2

+

y

2

+

z

2

<

4

⋅

m

2

4

=

m

2

w

2

+

x

2

+

y

2

+

z

2

≡

0

(

mod

m

)

.

So

w

2

+

x

2

+

y

2

+

z

2

=

n

⁢

m

for some integer non-negative

n

. Since

w

2

+

x

2

+

y

2

+

z

2

<

m

2

,

n

<

m

. In addition, if

n

=

0

, then

w

=

x

=

y

=

z

=

0

, so that

a

≡

b

≡

c

≡

d

≡

0

(

mod

m

)

, which implies

m

⁢

p

=

a

2

+

b

2

+

c

2

+

d

2

=

m

2

⁢

q

, or that

m

|

p

. But

p

is prime,

forcing

m

=

p

, and contradicting

m

<

p

. So

0

<

n

<

m

. Look at the

product

(

a

2

+

b

2

+

c

2

+

d

2

)

⁢

(

w

2

+

x

2

+

y

2

+

z

2

)

and examine Lemma 1. On the left is

n

⁢

m

2

⁢

p

. One the right, we have a sum of four squares. Evidently three of them

a

⁢

x

-

b

⁢

w

-

c

⁢

z

+

d

⁢

y

=

(

a

⁢

x

-

b

⁢

w

)

+

(

d

⁢

y

-

c

⁢

z

)

a

⁢

y

+

b

⁢

z

-

c

⁢

w

-

d

⁢

x

=

(

a

⁢

y

-

c

⁢

w

)

+

(

b

⁢

z

-

d

⁢

x

)

a

⁢

z

-

b

⁢

y

+

c

⁢

x

-

d

⁢

w

=

(

a

⁢

z

-

d

⁢

w

)

+

(

c

⁢

x

-

b

⁢

y

)

are multiples of

m

. The same is true of the other sum on the
right in Lemma 1:

a

⁢

w

+

b

⁢

x

+

c

⁢

y

+

d

⁢

z

≡

w

2

+

x

2

+

y

2

+

z

2

≡

0

(

mod

m

)

.

The equation in Lemma 1 can therefore be divided through by

m

2

.
The result is an

expression

for

n

⁢

p

as a sum of four squares.
Since

0

<

n

<

m

, the proof is complete.
∎

Remark:

Lemma 3 can be improved: it is enough for

p

to be an

odd number

, not necessarily prime.
But that stronger statement requires a longer proof.

Title

proof of Lagrange’s four-square theorem

Canonical

name

ProofOfLagrangesFoursquareTheorem

Date of creation

2013-03-22 13:21:07

Last modified on

2013-03-22 13:21:07

Owner

CWoo (3771)

Last modified by

CWoo (3771)

Numerical id

13

Author

CWoo (3771)

Entry type

Proof

Classification

msc 11P05

Generated on Fri Feb 9 15:40:23 2018 by

LaTeXML