Different ways to prove there are infinitely many primes?

24k Views Asked by At

This is just a curiosity. I have come across multiple proofs of the fact that there are infinitely many primes, some of them were quite trivial, but some others were really, really fancy. I'll show you what proofs I have and I'd like to know more because I think it's cool to see that something can be proved in so many different ways.

Proof 1 : Euclid's. If there are finitely many primes then $p_1 p_2 ... p_n + 1$ is coprime to all of these guys. This is the basic idea in most proofs : generate a number coprime to all previous primes.

Proof 2 : Consider the sequence $a_n = 2^{2^n} + 1$. We have that $$ 2^{2^n}-1 = (2^{2^1} - 1) \prod_{m=1}^{n-1} (2^{2^m}+1), $$ so that for $m < n$, $(2^{2^m} + 1, 2^{2^n} + 1) \, | \, (2^{2^n}-1, 2^{2^n} +1) = 1$. Since we have an infinite sequence of numbers coprime in pairs, at least one prime number must divide each one of them and they are all distinct primes, thus giving an infinity of them.

Proof 3 : (Note : I particularly like this one.) Define a topology on $\mathbb Z$ in the following way : a set $\mathscr N$ of integers is said to be open if for every $n \in \mathscr N$ there is an arithmetic progression $\mathscr A$ such that $n \in \mathscr A \subseteq \mathscr N$. This can easily be proven to define a topology on $\mathbb Z$. Note that under this topology arithmetic progressions are open and closed. Supposing there are finitely many primes, notice that this means that the set $$ \mathscr U \,\,\,\, \overset{def}{=} \,\,\, \bigcup_{p} \,\, p \mathbb Z $$ should be open and closed, but by the fundamental theorem of arithmetic, its complement in $\mathbb Z$ is the set $\{ -1, 1 \}$, which is not open, thus giving a contradiction.

Proof 4 : Let $a,b$ be coprime integers and $c > 0$. There exists $x$ such that $(a+bx, c) = 1$. To see this, choose $x$ such that $a+bx \not\equiv 0 \, \mathrm{mod}$ $p_i$ for all primes $p_i$ dividing $c$. If $a \equiv 0 \, \mathrm{mod}$ $p_i$, since $a$ and $b$ are coprime, $b$ has an inverse mod $p_i$, call it $\overline{b}$. Choosing $x \equiv \overline{b} \, \mathrm{mod}$ $p_i$, you are done. If $a \not\equiv 0 \, \mathrm{mod}$ $p_i$, then choosing $x \equiv 0 \, \mathrm{mod}$ $p_i$ works fine. Find $x$ using the Chinese Remainder Theorem.

Now assuming there are finitely many primes, let $c$ be the product of all of them. Our construction generates an integer coprime to $c$, giving a contradiction to the fundamental theorem of arithmetic.

Proof 5 : Dirichlet's theorem on arithmetic progressions (just so that you not bring it up as an example...)

Do you have any other nice proofs?

17

There are 17 best solutions below

3
On BEST ANSWER

When I taught undergraduate number theory I subjected my students to a barrage of proofs of the infinitude of the prime numbers: see these lecture notes. I gave eight proofs altogether. Of course by now the list which has been currently compiled has a large overlap with mine, but one proof which has not yet been mentioned is Washington's algebraic number theory proof:

Proposition: Let $R$ be a Dedekind domain with fraction field $K$. If $R$ has only finitely many prime ideals, then for every finite degree field extension $L/K$, the integral closure $S$ of $R$ in $L$ is a PID.

(The proof boils down to two facts: (i) a Dedekind domain with finitely many prime ideals is a PID. (ii) with notation as above, the map $\operatorname{Spec S} \rightarrow \operatorname{Spec R}$ is surjective and at most $[L:K]$-to-one, so $R$ has infinitely many prime ideals iff $S$ has infinitely many prime ideals.)

Corollary: There are infinitely many primes.

Proof: Applying the Proposition with $R = \mathbb{Z}$, if there were only finitely many primes, then for every number field $K$, the ring $\mathbb{Z}_K$ of integers in $K$ would be a PID, hence a UFD. But for instance this fails for $K = \mathbb{Q}(\sqrt{-5})$, as $2 \cdot 3 = (1+\sqrt{-5})(1-\sqrt{-5})$ is a nonunique factorization into ireducible elements (since there are no elements of norm $2$ or $3$) in $\mathbb{Z}_K = \mathbb{Z}[\sqrt{-5}]$.

1
On

There's a collection at https://primes.utm.edu/notes/proofs/infinite/ (Proofs that there are infinitely many primes)

7
On

Proof 3 is due to Fürstenberg (see also the Wikipedia page) and is honestly not that different from Euclid's proof. See this MO question and the corresponding links for an extended discussion.

I give a counting proof here that I think should be better-known. Briefly, let $\pi(n)$ denote the number of primes less than or equal to $n$. The prime factorization of any positive integer less than or equal to $n$ has the form $\prod p_k^{e_k}$ where

$$\sum_{k=1}^{\pi(n)} e_k \log p_k \le \log n$$

so it follows that $e_k \le \log_2 n$ for all $k$, hence that $n \le \left( \log_2 n + 1 \right)^{\pi(n)}$. This gives the following extremely weak version of the PNT:

$$\pi(n) \ge \frac{\log n}{\log (\log_2 n + 1)}.$$

One can use the same idea to prove that any strictly increasing sequence of positive integers which is polynomially bounded has the property that infinitely many primes divide one of its terms, which is stronger than what can be achieved using Euclid's proof (which only gets you this result for polynomials).

Edit: According to Pete Clark's notes, the above proof was in some form given by (but does not seem to be originally due to) Chaitin. In his formulation it can be summarized using the following slogan: if there were finitely many primes, then the prime factorization of a number would be too efficient a way of representing it. This is quite a nice slogan in that it immediately suggests the generalization to polynomially bounded sequences.

2
On

The following proof is due to Euler. We have

$$\prod_{p \text{ prime}, p \le m} \left( \frac{1}{1 - \frac{1}{p}} \right) \ge \sum_{n=1}^m \frac{1}{n}.$$

The RHS diverges as $m \to \infty$, so the LHS must have an unbounded number of factors.

5
On

The following proof is morally due to Euler. We have

$$\prod_{p \text{ prime}} \left( \frac{1}{1 - \frac{1}{p^2}} \right) = \zeta(2) = \frac{\pi^2}{6}.$$

The RHS is irrational, so the LHS must have infinitely many factors.

0
On

The following proof can be extracted from Erdős' proof of Bertrand's postulate (although perhaps this argument should be credited to Chebyshev). We need the following two lemmas from that page.

Lemma 1: ${2n \choose n} > \frac{4^n}{2n+1}$.

Lemma 2: The greatest power $R(p, n)$ of a prime $p$ dividing ${2n \choose n}$ satisfies $p^{R(p, n)} \le 2n$.

From these two lemmas it follows that

$$\frac{4^n}{2n+1} < {2n \choose n} \le (2n)^{\pi(2n)}$$

which is a contradiction for large $n$ if $\pi(2n)$ is bounded. This gets us within a constant of the PNT:

$$\pi(2n) \ge \frac{n \log 4 - \log (2n+1)}{\log 2n}.$$

18
On

Source : Proofs from the Book, by Martin Aigner and Günter M. Ziegler.


Here is one more proof. I don't really know who discovered it.

Let $\pi(x) = \# \bigl\{ \text{No of primes} \ \leq x \bigr\}$. Suppose $p$ is the largest element. We consider the Mersenne number $2^{p}-1$, and show that for any prime factor $q$ of $2^{p}-1$ is bigger than $p$. So let $p$ be a prime dividing $2^{p}-1$. So we have $2^{p} \equiv 1 \ (\text{mod} \ q)$. Since $p$ is prime, his means that, the element $2$ has order $p$ in the multiplicative group $\mathbb{Z}_{q}\setminus \{0\}$ of the field $\mathbb{Z}_{q}$. This group has $q-1$ elements, so by Lagrange's theorem, we know that the order of every element divides the order of the group. Hence $p \mid (q-1)$, which shows that $p < q$.

$\text{Added.}$

1
On

One proof approach is to construct an infinite set of numbers, any two of which are relatively prime. The proof using Fermat numbers/Euclid's proof can be considered to follow that approach (so I am not sure if I should even be adding this answer!).

We construct a set explicitly as follows.

Start with $3$. Now if we already have $\{x_1, x_2, \dots, x_n\}$ so far, whose prime divisors are $\{p_1, p_2, \dots, p_r\}$, take $x_{n+1} = 2^{(p_1 -1)(p_2 - 1) \dots (p_r - 1)} + 1$

By Fermat's little theorem, $x_{n+1} = 1 \mod p_i$ and thus is relative prime to each $x_i$.

Incidentally the Fermat numbers are relative co-prime can also be proved as follows:

If $x = 2^{2^m}$ and $2^{2^m} + 1 = 0 \mod p$, (i.e. $x = -1 \mod p$) then since $2^{2^{n}}$ is an even power of $x$, we have that $2^{2^n} + 1 = 2 \mod p$.

4
On

Another well-known proof which is somewhat related to two of the proofs by Qiaochu above is to note that for every prime $p \leq n$, the power of $p$ dividing $n!$ is at most $p^{\frac{n-1}{p-1}}$. Since certainly $p^{\frac{1}{p-1}} \leq 2$, we obtain that $2^{n \pi(n)} > n!$, where $\pi(n)$ is the number of primes less than or equal to $n$. Using Stirling's formula shows that $\pi(n) \to \infty$ as $n \to \infty$. A more careful version of this argument goes back to Chebyshev.

In an AMM paper (around 1954) called "A Method for finding primes", John Thompson came up with a simple, but very nice, variant of Euclid's argument: if we list a set of distinct primes, $\{p_1,p_2,\ldots, p_n\}$, not necessarily in increasing order, then for any $k \leq n$, the integer $p_1 \ldots p_k - p_{k+1}\ldots p_n$ is not divisible by any of the given $p_i$. This may be $\pm 1$, of course, but in that case you can interchange various $p_i$'s. The point is that you get lots more primes not in your original list this way, and they are divisors of numbers not necessarily so much larger than the primes you start with.

4
On

Let $p_1,...,p_n$ be the primes less or equal $N$. Any integer less or equal $N$ can be written as $p_1^{e_1}\cdot...\cdot p_n^{e_n}\cdot m^2$ with $e_i\in\{0,1\}$ and $m\leq\sqrt{N}$. So there are at most $2^n\sqrt{N}$ integers less or equal $N$, i.e. $N\leq2^n\sqrt{N}$. Simplifying and taking logarithms gives $(1/2)\log N\leq n\log2$. Since $N$ is unbounded, so is $n$. (Due to Erdős, taken from the book Gamma by Julian Havil, a book on Euler's constant.)

1
On

This is taken from Section 1.4 of Andrew Granville's notes on Prime numbers:

We finish this section by proving that for any $f(t) \in \mathbb Z[t]$ of degree $\ge1$ there are infinitely many distinct primes $p$ for which $p$ divides $f(n)$ for some integer $n$. We may assume that $f(n) \ne 0$ for all $n \in \mathbb Z$ else we are done. Now suppose that $p_1,\ldots,p_k$ are the only primes which divide values of $f$ and let $m = p_1 \cdots p_k$. Then $f(nmf(0)) \equiv f(0) \pmod{mf(0)}$ for every integer $n$, by exercise 1.2a.a, so that $f(nmf(0))/f(0) \equiv 1 \pmod m$. Therefore $f(nmf(0))$ has prime divisors other than those dividing $m$ for all $n$ but the finitely many $n$ which are roots of $(f(tmf(0)) - f(0))(f(tmf(0)) + f(0))$, a contradiction.

Exercise 1.2a.a is: Prove that if $f(t) \in \mathbb Z[t]$ and $r,s\in\mathbb Z$ then $r-s$ divides $f(r)-f(s)$.

Other parts of his course notes might be interesting in connection with this question, too.

1
On

The following proof use the Euler's totient function and relies on the fact that $\phi(m) > 1$ for all $m \geq 3$.

Assume that there are only a finite number of primes say $p_1,p_2,\ldots,p_k$. Look at the product of these finite primes i.e. $$m = p_1 p_2 \cdots p_k$$ Now consider any number $n > 1$. Since there are only finite primes, one of the $p_j$'s must divide $n$. Hence, $\gcd(m,n) > 1$. Hence, $\phi(m) = 1$ contradicting the fact that $\phi(m) > 1$ for all $m \geq 3$.

0
On

Maybe you wanna use the sum of reciprocal prime numbers. The argument for the fact that
the series diverges you may find here in one of Apostol's exercise.

0
On

One can prove directly that the Sieve of Eratosthenes produces an infinite sequence of primes (and produces every prime). This is a worthwhile proof to record since, while it lacks much novel content, it is reassuring that the first method one learns to find primes actually works and that one may prove its correctness without any terribly clever tricks - not even appealing to the fact that every number has a prime divisor. This proof also has the advantage of being constructive.


We define, recursively, an ascending sequence of positive integers $p_1,p_2,p_3,\ldots$ by the following rule: to determine $p_n$, form the set $S_n$ of natural numbers greater than $1$ not divided by any previous term of the sequence; formally, this set is: $$S_n=\{k\in\mathbb N: k>1\text{ and for all }n' < n\text{ we have }p_{n'} \text{ does not divide } k\}$$ Let $p_n=\min S_n$.

Claim 1: This sequence is well-defined.

The only obstacle here is to see that every $S_n$ actually has a minimum since, aside from this possible issue of non-existence, this is a perfectly good recursive definition. Since $S_n$ is a set of natural numbers, is the same as showing that it is non-empty. We can use the main idea of Euclid's proof here and note that $1+\prod_{n'<n}p_{n'}$ is in $S_n$ to see this (or exhibit an element of $S_n$ in any other of the numerous ways one might).

Claim 2: Every term in this sequence is prime.

To prove this, suppose that $p_n=xy$ for some $n\in \mathbb N$ and some $x,y\in \mathbb N$ both greater than $1$. Note that $x<p_n$, which implies that $x\not\in S_n$ by the minimality of $p_n$ in $S_n$. Therefore, there must be some $n'<n$ such that $p_{n'}$ divides $x$. Then $p_{n'}$ would also divide $p_n$, contradicting that $p_n\in S_n$.

Claim 3: This sequence is strictly increasing.

Note that $S_{n+1}$ is a subset of $S_n$, since the condition for inclusion is more strict. Therefore, $p_n$ is a lower bound for $S_{n+1}$ and since $p_n$ cannot be in $S_{n+1}$ by definition, it is a strict lower bound. Thus $p_n < p_{n+1}$ since $p_{n+1}\in S_{n+1}$.

Combined, these three claims show that $p_1,p_2,p_3,\ldots$ is an enumeration of infinitely many distinct prime numbers.


Since we're so close to it, one might as well show one more thing, even if it's not strictly needed:

Bonus claim: Every prime is in this sequence.

For this, let $q$ be a prime and let $n$ be the smallest natural number so that $p_n \geq q$. We claim that $p_n=q$. Note that $q$ must be in $S_n$ because it has no divisors $d$ with $1<d<q$ - in particular, no $p_{n'}$ with $n'<n$ can divide it. Minimality of $p_n$ therefore gives $p_n \leq q$ - but, our choice of $n$ then gives $p_n=q$ by antisymmetry.

0
On

Here is a proof which essentially is in the same spirit as that of Euclid, but I have not seen this written up somewhere. So I mention it here.

Let $p_1,p_2,\ldots p_n$ be the only prime numbers. Then consider the number $$s=p_2p_3\cdots p_n+p_1p_3\cdots p_n+ \ldots + p_1p_2\ldots p_{n-1}.$$ Then $p_i$ does not divide $s$ for $1\leq i\leq n$.

Thus the number $s$ has a new prime factor other than $p_i$, contradicting our assumption that $p_i$ are the only primes.

0
On

Let $P$ be your currently known primes (or more precisely, currently known coprime integers).

Find an $n$ such that $n+P_i$ is not divisible by $P_i$ for each $P_i \in P$. In other words, find a derangement of the original primes.

For example, if $P=\{2,3,7\}$, then you might use $n=5$, where $n+P=\{7, 8, 12\}$, where $2 \nmid 7 \land 3 \nmid 8 \land 7 \nmid 12$. And since $P_i \nmid (n+P_i) \iff P_i \nmid n$, it means $n$ is coprime to all $P_i$ and can be added to $P$.

Repeat as desired; derangements are plentiful and there will be increasingly many in a full permutation of $\prod P$.

0
On

There is an older post from 2011 that you should check out: Is there an intuitionist (i.e., constructive) proof of the infinitude of primes?.

Also you should have a look at a proof (attributed to Filip Saidak) that runs as follows:

Let $n \gt 1$ be a positive integer. Since $n$ and $n+1$ are consecutive integers, they must be coprime, and hence the number $n_2 = n(n + 1)$ must have at least two different prime factors. Similarly, the integers $n(n+1)$ and $n(n+1)+1$ are consecutive, therefore coprime, hence the number $n_3 = n(n + 1)(n(n + 1) + 1)$ must have at least three different prime factors. Now continue this process indefinitely.