# One-sentence proof of Fermat's theorem on sums of two squares

> An annotated edition of this paper on Fermat's Library, where scientists and readers explain its ideas, equations and history in the margins. Annotated edition: https://fermatslibrary.com/s/a-one-sentence-proof-of-fermats-theorem-on-sums-of-two-squares

- **Authors:** D. Zagier
- **Topic:** Mathematics
- **Original:** https://s3-us-west-1.amazonaws.com/fermatslibrary/uploads%2F1467442784165-o7jfjbce77lw782i-46dea10c8951be40601df814f7624837%2FZagierOneSentence.pdf
- **Pages:** 1
- **Annotations:** 10 comments in 7 threads
- **Featured:** Fermat's Library Journal Club
- **Annotated edition:** https://fermatslibrary.com/s/a-one-sentence-proof-of-fermats-theorem-on-sums-of-two-squares

## Annotations

### Annotation 1 (page 1)

Beside the passage: “A One-Sentence Proof That Every Prime p 1 (mod 4) Is a Sum of Two Squares”

**Annotation** by Luís Batalha (2016-07-17):

> In this paper Don Zagier constructs a really short proof of the very famous Fermat's theorem on sums of two squares.
>
> Fermat's theorem on sums of two squares says that an odd prime $p$ is expressible as
>
> $$p = x^2 + y^2$$
>
> with $x$ and $y$ integers, if and only if
> $$
> p \equiv 1 \pmod{4}
> $$
>
> which is the same thing as saying if and only if $p=4k+1$, where $k \in \mathbb{N}$.
>
> 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 \\
> \quad 13 = 2^2 + 3^2\\
> \quad 17 = 1^2 + 4^2
> $$
>
> Fermat himself claimed to have proven the theorem in a letter to Marin Mersenne in 1640, but didn't provide any proof. The theorem was later solved by several mathematicians including Euler, Gauss, Heath-Brown and Don Zagier.

### Annotation 2 (page 1)

Beside the passage: “D. ZAGIER Departmenit of Mathematics, University of Maryland, College Park, MD 20742”

**Annotation** by Luís Batalha (2016-07-17):

> Don Zagier, born in 1951, is an American mathematician whose main area of work is number theory. He was a child prodigy and got a bachelor's and master's degree from MIT at the age of 16 and a PhD from the University of Bonn at the age of 20.
>
> ![](http://opc.mfo.de/photoNormal?id=4629)

### Annotation 3 (page 1)

Beside the passage: “The involution on the finite set S = {(x,y,z) E rkJ3: X2 + 4yz = p } defined by”

**Annotation** by Luís Batalha (2016-07-17):

> First we should recall what is an involution. An involution is a function $f$ that is its own inverse:
>
> $$
> f(f(x))=x
> $$
>
> for all x in the domain of $f$.
>
> A fixed point of a function is an element of the function's domain that is mapped to itself by the function
>
> $$
> f(c)=c
> $$
>
> From a visual perspective a fixed point is the point where the function intersects the line $y=x$.
> Here is an example of a function with 3 fixed points
>
> ![](https://upload.wikimedia.org/wikipedia/commons/2/20/Fixed_point_example.svg)

**Reply** by Sebastian Bensusan (2016-09-07):

> \(c\) is called a "fixed point" of \(f\) because if you start a recursive sequence:
>
> \[a_{n+1}=f(a_{n})\]
> \[a_{n+2}=f(a_{n+1})\]
>
> and it reaches \(c\) the sequence will stay fixed at \[a_n = c = f(c)\]

### Annotation 4 (page 1)

Beside the passage: “has exactly one fixed point, so ISI is odd and the involution defined by (x,y,z) - (x,z,y) also has a fixed point. O”

**Annotation** by Luís Batalha (2016-07-17):

> Zagier starts by defining two involutions
>
> $$f(x,y,z) = (x,z,y)$$
>
> $$
> g(x,y,z)=\begin{cases}
> (x+2z,~z,~y-x-z),\quad \textrm{if}\,\,\, x < y-z \\
> (2y-x,~y,~x-y+z),\quad \textrm{if}\,\,\, y-z < x < 2y\\
> (x-2y,~x-y+z,~y),\quad \textrm{if}\,\,\, x > 2y
> \end{cases}
> $$
>
> It's easy to see that $f$ is an involution because
>
> $$
> f(f(x,y,z))=f(x,z,y)=(x,y,z)
> $$
>
> It's a little more cumbersome to prove that $g(x,y,z)$ is an involution. To do that we first should note that $g$ divides $S$ in 3 regions: $$S_1 = \{(x,y,z) ∈ S : x < y−z \}$$
> $$S_2 = \{ (x,y,z) ∈ S : y−z < x <
> 2y \}$$  $$S_3 = \{ (x,y,z) ∈ S : x > 2y \}$$
>
> such that $S=S_1 \cup S_2 \cup S_3 $.
>
> An interesting property about $g$ is that $g(S_1)=S_3$, $g(S_1)=S_3$, $g(S_2)=S_2$. In other words the solutions of $S_1$ are mapped to $S_3$ and vice-versa and the solutions of $S_2$ are mapped to $S_2$
>
> ![](http://i.imgur.com/v2FvNBx.png)
>
> Let's now prove this for every region:
>
> For $S_1$
>
> $$
> g(x,y,z)=(x+2z,z,y-x-z)
> $$
>
> To check that $g(S_1)=S_3$ we need to see if the condition $x>2y$ is satisfied. In this case $x>2y \rightarrow x+2z>2z \equiv x>0 $ which is always true since $x \in \mathbb{N}$.
>
> We do the same for $S_3$
>
>
> $$
> g(x,y,z)=(x-2y,x-y+z,y)
> $$
>
> To check that $g(S_3)=S_1$ we need to see if the condition $x<y-z$ is satisfied. In this case $x<y-z \rightarrow x-2y<x-y+z-y \equiv z>0 $ which is always true since $z \in \mathbb{N}$.
>
> Finally for $S_2$
>
> $$
> g(x,y,z)=(2y-x,y,x-y+z)
> $$
>
> To check that $g(S_2)=S_2$ we need to see if the conditions $y-z<x$ and $x<2y$ are satisfied. In this case $y-z<x \rightarrow y-x+y-z<2y-x \equiv z>0 $ and $x<2y \rightarrow 2y-x<2y \equiv x>0 $ which are both true since $z,x \in \mathbb{N}$.
>
>
> It's now easy to see that $g$ is an involution since:
>
> $$
> g(g(S_1))=g(S_3)=S_1
> $$
> $$
> g(g(S_3))=g(S_1)=S_3
> $$
> $$
> g(g(S_2))=g(S_2)=S_2
> $$
>
> We should also verify that $g$ maps $S$ into itself, in other words that the image will also satisfy $x^2+4xy = p$. I'm just going to verify that for $S_1$ (for $S_2$ and $S_3$ is exactly the same procedure)
>
> $$
> (x+2z)^2+4y(y-x-z)=x^2+4z^2+4xz+4zy-4xz-4z^2=\\
> =x^2+4zy \in S
> $$

**Reply** by Braxton Boren (2016-07-26):

> I think you mean $g(S_1) = S_3, g(S_3) =S_1$, right?

### Annotation 5 (page 1)

Beside the passage: “This proof is a simplification of one due to Heath-Brown [1] (inspired, in turn, by a proof given by Liouville). The verifications of the implicitly made assertions-that S is finite and that the map is well-defined and involutory (i.e., equal to its own inverse) and has exactly one fixed point-are immediate and have …”

**Annotation** by Luís Batalha (2016-07-17):

> To calculate the fixed points of $g$ we'll have to solve the equation
>
> $$
> g(c)=c
> $$
>
> Since $g(S_1)=S_3$,$g(S_3)=S_1$ and $g(S_2)=S_2$ the only fixed points of $g$ must lie in $S_2$.
> $$
> g(x,y,z) = (2y-x,y,x-y+z)=  (x,y,z)
> $$
>
> holds if $y=x$, but at the same time $p=x^2+4yz=x(x+4z)$ and so if $p$ is prime the only option is $y=x=1$ and $p=4z+1$. Note that if $x\neq 1$, $p$ would be a product of 2 numbers thus not a prime.

### Annotation 6 (page 1)

Beside the passage: “This proof is a simplification of one due to Heath-Brown [1] (inspired, in turn, by a proof given by Liouville). The verifications of the implicitly made assertions-that S is finite and that the map is well-defined and involutory (i.e., equal to its own inverse) and has exactly one fixed point-are immediate and have …”

**Annotation** by Luís Batalha (2016-07-17):

> Lemma: The  cardinalities of a finite set and of its fixed-point set under any  involution have the same parity.
>
> Proof: Let $S=\{s_1,...,s_n\}$ be the finite set in question. If $s_i$ is not a fixed point then there exists an $s_j$ such that $f(s_i)=s_j$. Note that this forces $f(s_j)=s_i$, so if we delete $s_i$ and $s_j$ from $S$ we obtain a new set $S'$ such that f is an involution in this set, and we have $|S|\equiv |S'|\mod{2}$, in such a manner delete all the non-fixed points, so the result follows.
>
> Using the lemma above and the fact that g has a unique fixed point (so in particular has odd parity), implies that $|S|$ has odd parity, so the number of fixed points of $f$ has odd parity, which means that there is at least one fixed point of $f$.
>
> For $f$, the fixed point equation
>
> $$
> f(x,y,z) = (x,z,y)=  (x,y,z)
> $$
>
> holds if $y=z$ and so $p=x^2+(2z)^2$. We finally proved that $p$ is a sum of 2 squares!

### Annotation 7 (page 1)

Beside the passage: “This proof is a simplification of one due to Heath-Brown [1] (inspired, in turn, by a proof given by Liouville). The verifications of the implicitly made assertions-that S is finite and that the map is well-defined and involutory (i.e., equal to its own inverse) and has exactly one fixed point-are immediate and have …”

**Annotation** by Luís Batalha (2016-07-17):

> To sum up:
>
> Zagier starts by creating a function $g$ which is an involution in $S$. He finds that $g$ has a fixed point which implies that $p=4z+1$, $z\in \mathbb{N}$. He then uses the lemma about the cardinalities to prove that the other involution $f(x,y,z)=(x,z,y)$ has at least one fixed point. Calculating the fixed point of $f$ we finally get to the result $p=x^2+(2z)^2$, $z,x\in \mathbb{N}$. In other words $p$ is a sum of 2 squares!

**Reply** by Luís Batalha (2016-07-20):

> There's also a really well done video by the Numberphile team about this paper
>
> [![Numberphile Video](https://slack-imgs.com/?c=1&o1=wi400.he300&url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FSyJlRUBoVp0%2Fhqdefault.jpg)](https://www.youtube.com/watch?v=SyJlRUBoVp0)

## Full text

Extracted from the PDF. [Annotation N] marks where each annotation above sits.

#### Page 1

THE TEACHING OF MATHEMATICS

EDITED BY MELVIN HENRIKSEN AND STAN WAGON

A One-Sentence Proof [Annotation 1] That Every Prime p 1 (mod 4) Is a Sum of Two Squares

D. ZAGIER [Annotation 2] Departmenit of Mathematics, University of Maryland, College Park, MD 20742

The involution on the finite set S = {(x,y,z) [Annotation 3] E rkJ3: X2 + 4yz = p } defined by

((x + 2z, z, y-x-z) if x <y-z (x,y,z) |->4 (2y - x, y, x - y + z) if y - z < x < 2y I(x - 2y, x -y + z, y) if x > 2y

has exactly one fixed point, so ISI is odd and the involution defined by (x,y,z) - (x,z,y) also has a fixed [Annotation 4] point. O

This proof is a simplification of one due to Heath-Brown [1] (inspired, in turn, by a proof given by Liouville). The verifications of the implicitly made assertions-that S is finite and that the map is well-defined and involutory (i.e., equal to its own inverse) and has exactly one fixed point-are immediate and have been left to the reader. [Annotation 5] Only the last requires that p be a prime of the form 4k + 1, the fixed point then being (1,1,k). Note that the proof is not constructive: it does not give a method to actually find the representation of p as a sum of two squares. A similar phenomenon occurs with results in topology and analysis that are proved using fixed-point theorems. Indeed, the basic [Annotation 6] principle we used: "The cardinalities of a finite set and of its fixed-point set under any involution have the same parity," is a combinatorial analogue and special case of the corresponding topological result: "The Euler characteristics of a topological space and of its fixed-point set under any continuous involution have the same parity." For a discussion [Annotation 7] of constructive proofs of the two-squares theorem, see the Editor's Corner elsewhere in this issue.

REFERENCE

1. D. R. Heath-Brown, Fermat's two-squares theorem, Invariant (1984) 3-5.

Inverse Functions and their Derivatives

ERNST SNAPPER Department of Mathematics and Computer Science, Dartmouth College, Hanover, NH 03755

If the concept of inverse function is introduced correctly, the usual rule for its derivative is visually so obvious, it barely needs a proof. The reason why the standard, somewhat tedious proofs are given is that the inverse of a function f(x) is

144

This content downloaded from 128.120.194.195 on Sun, 21 Jun 2015 04:13:03 UTC

All use subject to JSTOR Terms and Conditions

---

Source: [Fermat's Library](https://fermatslibrary.com/) — https://fermatslibrary.com/s/a-one-sentence-proof-of-fermats-theorem-on-sums-of-two-squares. More annotated papers: https://fermatslibrary.com/llms.txt
