Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It was proved by Euclid that there are infinitely many primes. But what is the cardinality of the set of prime numbers ?

Cantor showed that the sets $\mathbb{Q}$ and $\mathbb{Z}$ have the same cardinality as the natural numbers $\mathbb{N}$ by constructing a pairing of the two sets, or a bijective function $ \pi_{\mathbb{Z}} : \mathbb{N} \rightarrow \mathbb{Z}$ and $ \pi_{\mathbb{Q}} : \mathbb{N} \rightarrow \mathbb{Q}$.

Let $\mathbb{P}$ denote the set of prime numbers. Is it possible to construct such a pairing function, $ \pi_{\mathbb{P}} : \mathbb{N} \rightarrow \mathbb{P}$ ?

It's clear that $|\mathbb{P}| \leq |\mathbb{N}| = \aleph_0$ since $\mathbb{P} \subset \mathbb{N}$. Is it possible to show that $|\mathbb{P}| \geq |\mathbb{N}|$, or do we have $|\mathbb{P}| < |\mathbb{N}|$ ?

share|cite|improve this question
Your title should be «Cardinality of the set of prime numbers». Prime numbers do no thave cardinalities. – Mariano Suárez-Alvarez May 15 '13 at 7:20
@Mariano: Unless you think of them as sets... :-) – Asaf Karagila May 15 '13 at 7:22
Well, don't! :-) – Mariano Suárez-Alvarez May 15 '13 at 7:22
@MarianoSuárez-Alvarez: I very much agree, it's now changed. – Henrik Finsberg May 15 '13 at 7:54
up vote 16 down vote accepted

It is not hard to show that every infinite subset of $\Bbb N$ is in fact of cardinality $\aleph_0$. Let $A$ be such set, and define the following function: $$f(a)=\big|\{n\in A\mid n<a\}\big|.$$

It's not very hard to see that this is a bijection between $A$ and $\Bbb N$.

So we have that the cardinality of $\Bbb P$ is $\aleph_0$ just as well.

Another point worth mentioning is that if $|A|<\aleph_0$ then by definition $A$ is finite (because $\aleph_0$ is a minimal cardinal above the finite cardinals), so if $\Bbb P$ has cardinality smaller than $\aleph_0$ it is finite, in contradiction to all those proofs given that it's not.

share|cite|improve this answer
Am I right in understanding that in your function definition, $a \in A$? – LarsH May 15 '13 at 13:30
Lars, that's right. – Asaf Karagila May 15 '13 at 13:48
I think you mean $n < a$, otherwise $f(min(A)) = 0 \not\in \mathbb N$. – alexis May 15 '13 at 15:13
@alexis: In logic and set theory, the common convention is that $0\in\Bbb N$. – Asaf Karagila May 15 '13 at 15:19
Righto, should have allowed for that option. Thanks for clarifying. – alexis May 15 '13 at 15:22

Since $\Bbb P \subset \Bbb N$, we have a natural ordering inherited on $\Bbb P$. Since it is a subset of a well-ordering, the induced ordering is again a well-ordering.

Thus we have that $(\Bbb P, <)$ is an infinite well-ordering; it is clear that it contains no limits.

Therefore, the order-type of $(\Bbb P, <)$ must be $\omega$, meaning that it can be put in direct bijective correspondence with $\Bbb N$.

Effectively, this proof (which hinges on the theorem "every well-ordering is order-isomorphic to a unique ordinal") gives a bijection by the following recursive definition:

$$f: \Bbb N \to \Bbb P: f(n) := \begin{cases}\inf \Bbb P &: n = 0\\\inf(\Bbb P \setminus\{f(1)\ldots f(m)\}) &: n = m+1\end{cases}$$

That is, "$f(n)$ is the $n+1$st smallest prime number".

share|cite|improve this answer
+1 for avoiding Axiom-of-choice -strength principles in your answer. – Charles Stewart May 15 '13 at 7:14

$\aleph_0$ is the smallest infinite cardinal. Therefore, since $\mathbb{P}$ is infinite, $|\mathbb{P}| \geq \aleph_0$. Finally, $|\mathbb{P}|= \aleph_0$.

share|cite|improve this answer
You have to be careful here; without the Axiom of (Countable) Choice, it cannot be proven that every infinite set has a countably infinite subset, i.e. that $\kappa \ge \aleph_0$ for all infinite cardinals $\kappa$. – Lord_Farin May 15 '13 at 6:59
This is related. – user17762 May 15 '13 at 7:08
@Lord_Farin: That's not completely true. The assertion "$\aleph_0$ is the smallest infinite cardinal" is strictly weaker than the axiom of countable choice. So one can in fact prove that without using countable choice, but one still has to use some form of choice. – Asaf Karagila May 15 '13 at 7:29
@Asaf Thanks for that remark. Proves once again that one also has to be careful in formulating statements about choice principles, besides in using them. – Lord_Farin May 15 '13 at 7:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.