Counting infinity

Equipotence and countable sets

Counting without counting

How do you decide that two sets have "as many" elements when they are infinite? In 1874 Cantor proposed an answer that involves no counting at all: two sets EE and FF are equipotent (have the same cardinality) if there exists a bijection from EE onto FF.

E∼F  ⟺  ∃ f:E→F bijectiveE \sim F \iff \exists\, f : E \to F \ \text{bijective}

For finite sets, this gives back equality of cardinalities. For infinite sets, it holds some surprises.

Countable sets

A set is countable if it is equipotent to N\mathbb{N}: its elements can then be numbered x0,x1,x2,…x_0, x_1, x_2, \ldots without missing or repeating any. It is the smallest infinity.

The first shock is that you can remove elements from an infinite set without changing its size. The map n↦n+1n \mapsto n + 1 is a bijection from N\mathbb{N} onto N∗\mathbb{N}^*: the set of nonzero integers is as large as the set of all integers. This is Hilbert's hotel, full yet still able to take in one more guest by moving everyone up one room.

The catalog of countable sets

Set Bijection with N\mathbb{N} Countable?
N∗\mathbb{N}^* n↦n+1n \mapsto n + 1 yes
even integers n↦2nn \mapsto 2n yes
Z\mathbb{Z} alternating 0,1,−1,2,−2,…0, 1, -1, 2, -2, \ldots yes
N2\mathbb{N}^2 traversal along diagonals yes
Q\mathbb{Q} see the next lesson yes
algebraic numbers countable union of finite subsets yes

Let's look at Z\mathbb{Z} in detail. The bijection is written explicitly as

f(n)={n2if n is even−n+12if n is oddf(n) = \begin{cases} \dfrac{n}{2} & \text{if } n \text{ is even} \\[2mm] -\dfrac{n+1}{2} & \text{if } n \text{ is odd} \end{cases}

which lists 0,−1,1,−2,2,…0, -1, 1, -2, 2, \ldots and reaches every integer exactly once.

Two stability rules

They are used constantly, and both follow from the diagonal traversal of N2\mathbb{N}^2:

A countable union of countable sets is countable. A finite product of countable sets is countable.

On the other hand, an infinite product of two-element sets is not: the set {0,1}N\{0, 1\}^{\mathbb{N}} of binary sequences is the first uncountable set one encounters, and it is the one that Cantor's diagonal will catch out.

Classic pitfall

Believing that a "richer" set is necessarily larger. Intuition says that Q\mathbb{Q} contains many more elements than N\mathbb{N}, since there are infinitely many of them between two consecutive integers. This is false in the sense of equipotence: density and cardinality are two independent notions. The set Q\mathbb{Q} is dense in R\mathbb{R} and yet countable.