Skip to main content

Countable sets

From the two previous examples, we have seen that many sets have the same cardinality as N{\mathbb N}. We call those sets countable sets (they are infinite, but it's possible to count them ☺️).

Definition 2

A set XX is countable if it is finite or there is a bijection between XX and N{\mathbb N}.

In fact, when XX is infinite, we don't really need a bijection here. It suffices to show the onto mapping.

Exercise 80

A set XX is countable if and only if there is an onto mapping from N{\mathbb N} to XX.

One can say that this is the reason why such a set is called countable: We can actually list the elements of XX one-by-one based on the onto function f:NXf: {\mathbb N} \rightarrow X by just f(1),f(2),f(1), f(2),\ldots. The onto property guarantees that we will eventually list all the elements in XX (some elements might be listed more than once, but that's OK).

Theorem 31

The set Q{\mathbb Q} of rational numbers is countable.

Proof:

For simplicity, we will only deal with positive rational numbers (dealing with negative numbers only requires a small modification). We define an onto mapping f:NQ+f: {\mathbb N} \rightarrow {\mathbb Q}^+ as follows. When we write a positive rational number as p/qp/q (for positive integers p,qp,q) we can imagine dividing Q+{\mathbb Q}^+, into (overlapping) groups based on the value of p+qp+q. That is,

Q+=S2S3{\mathbb Q}^+ = \mathcal{S}_2 \cup \mathcal{S}_3 \cdots

where Sk={p/q:p,q1,p+q=k}\mathcal{S}_k = \{p/q: p,q \ge 1, p+q = k\}. Notice that Skk2|\mathcal{S}_k| \leq k^2, so each such set is finite. Intuitively, the function ff first lists the elements in S1\mathcal{S}_1, then the ones in S2\mathcal{S}_2, and so on.

Often, one would encounter an incorrect proof (from students) of the following form. List all rational numbers of the form 1/q1/q (for all qNq \in {\mathbb N}), then the ones of the form 2/q2/q, and so on. Let us call this mapping gg. At some point we would end up listing all of them. Do you know what goes wrong with such an argument? The problem with the above listing is that we cannot formally pinpoint when a given number would be listed, e.g., what is the value of xx for which g(x)=2/101g(x) = 2/101? This problem occurs because listing numbers of the form 1/q1/q alone is an infinite process.

In comparison, the proof of Theorem 31 makes it cleat that every number would be listed at some point. For instance, what is the value of xx for which f(x)=2/101f(x)= 2/101. Well, 2/101S1032/101 \in \mathcal{S}_{103}, so we know that it would be listed when all S1,,S102\mathcal{S}_1,\ldots, \mathcal{S}_{102} are finished. Although giving the exact position in the listing is technical, we know that x12+22++1032x \leq 1^2 + 2^2 + \ldots + 103^2.