Three Theorems in Number Theory
In this post, I would like to discuss three elementary theorems in number theory that I first learned in my middle school. It has been really ages since then, and I only vaguely remember their proofs.
During a rather boring midnight coach ride to the airport, I found myself with nothing to do but share some random mathematical thoughts with my wife. As the journey went on, the proofs gradually became clearer in my mind—and, meanwhile, she happily fell asleep.
Let’s start with Fermat’s little theorem.
Theorem 1 (Fermat). Let be a prime number. For any coprime to , we have .
Proof. Let . We notice that the set coincides with , since and are coprime. We immediately get
After canceling out on both sides of the equation, we derive .∎
The next theorem also involves a double counting technique.
Theorem 2 (Wilson). Let be a prime number. We have .
Proof. The elements in can be grouped into pairs , where is the unique element such that . There are only two special cases where , namely or . So, when we compute , almost all the terms in the same pair cancel out and only leave 1 and . Therefore, we derive
∎
The last theorem is also named after Fermat. But, as usual, he did not write down the proof. The first proof was given by Euler using infinite descent. Here, I present a more constructive proof.
Theorem 3 (Sum of two squares). A prime number can be represented as a sum of two squares if and only if .
Proof. The necessity is obvious. Now, we assume that . By Wilson’s theorem, we have . In particular, it yields
Therefore, there exists such that .
Let and we consider the set . Since , by pigeonhole principle, there must be two elements in such that for some . We notice that
Moreover, by our choice of ,
We deduce that .
∎