Countable sets [00AQ]
- March 12, 2026
Definition Matching set cardinalities [00AR]
- March 12, 2026
Let A, B be sets. If there exists a bijection f : A \to B then we say A and B have the same cardinality, and write |A| = |B|.
If there is an injection f : A \to B then we say |A| \leq |B|.
Remark [00AS]
- March 12, 2026
Note that this definition makes sense for finite sets and the intuition we already have for what the cardinality of a finite set is. If there is a bijection between two finite sets, then they definitely have the same (natural number) size; if there is an injection from A to B, then B definitely has to be at least as big as A.
Definition Countable and countably infinite sets [00AT]
- March 12, 2026
A set A is countable if it has the same cardinality as (i.e. can be put into bijection with) a subset of \mathbb {N}. Note that \mathbb {N} is a subset of itself: in particular, we say A is countably infinite if |A| = |\mathbb {N}|.
Remark Finite sets are countable [00AU]
- March 12, 2026
Clearly every finite set is countable, since we can match up the elements of a finite set with, say, some finite prefix of the natural numbers \{0, 1, 2, 3, \dots , n\}.
\begin {array}{ccccccc} A: & a_0 & a_1 & a_2 & a_3 & \dots & a_n \\ & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \updownarrow \\ \mathbb {N}: & 0 & 1 & 2 & 3 & \dots & n \end {array}Example Shapes are countable [00AW]
- March 12, 2026
The set of shapes \{\triangle , \square , \diamond \} is countable since we can make a bijection to the set \{0,1,2\}: \begin {array}{ccc} \triangle & \square & \diamond \\ \updownarrow & \updownarrow & \updownarrow \\ 0 & 1 & 2 \end {array}
Remark Countably infinite sets [00AV]
- March 12, 2026
For countably infinite sets, the situation looks the same, but there is no endpoint:
\begin {array}{cccccc} A: & a_0 & a_1 & a_2 & a_3 & \dots \\ & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \updownarrow \\ \mathbb {N}: & 0 & 1 & 2 & 3 & \dots \end {array}We can think of this scenario in several equivalent ways:
A is countable if it has a bijection to (a subset of) \mathbb {N}. (definition)
A is countable if all its elements can be put in a list. (We can always number the elements of a list 0, 1, 2, \dots .)
A is countable if we can write (or imagine) a program that prints the elements of A one after another, in such a way that any given element of A will eventually be printed after some finite amount of time (if we are willing to wait long enough).
Example Even integers are countable [00AX]
- March 12, 2026
The set 2\mathbb {N} of all even natural numbers is countably infinite, since f(n) = 2n is a bijection between \mathbb {N} and 2\mathbb {N}: \begin {array}{cccccc} \mathbb {N}: & 0 & 1 & 2 & 3 & \dots \\ & \updownarrow & \updownarrow & \updownarrow & \updownarrow \\ 2\mathbb {N}: & 0 & 2 & 4 & 6 & \dots \end {array}
Example The integers are countable [00AY]
- March 12, 2026
Is the set of integers \Z countable? At first glance it might seem like it’s not, since it is infinite in two directions and \mathbb {N} is only infinite in one direction. And indeed, if we try to list all the elements of \Z in a naive way, it fails: “First list 0, then all the positive integers, then all the negative integers” is not a valid list, since it would take infinitely long to list all the positive integers and we would never get around to any of the negative integers.
But \Z is countable, which we can show by reordering the elements in a clever way, for example: \begin {array}{ccccccccc} \mathbb {N}: & 0 & 1 & 2 & 3 & 4 & 5 & 6 & \dots \\ & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \\ \Z : & 0 & 1 & -1 & 2 & -2 & 3 & -3 & \dots \end {array} This will eventually get to any integer we want after some finite amount of time, whether positive or negative. We could figure out an explicit formula for a bijection following this pattern, something like f(n) = \begin {cases} -(n/2) & \text {if $n$ is even} \\ (n+1)/2 & \text {if $n$ is odd} \end {cases} but we don’t necessarily need to; just demonstrating the pattern and arguing why it will reach every integer is enough.
Example \N \times \N is countable [00AZ]
- March 12, 2026
Is \mathbb {N} \times \mathbb {N} countable?
The elements of \mathbb {N} \times \mathbb {N} are ordered pairs of two natural numbers, for example, (3,5). We can imagine them in a 2D grid: \begin {array}{cccc} \vdots & & & ⋰ \\ (2,0) & (2,1) & (2,2) & \\ (1,0) & (1,1) & (1,2) & \\ (0,0) & (0,1) & (0,2) & \dots \end {array}
At first it seems like the answer should be no. Each row of the 2D grid is the same size as a complete copy of \mathbb {N}; and we have infinitely many rows! How could infinitely many copies of \mathbb {N} be the same size as \mathbb {N}?
And indeed, if we try listing the elements by row or column it definitely doesn’t work. “First, list all the elements in row 0; then, list all the elements in row 1; then row 2; and so on”—we will spend an infinitely long time just listing elements of the form (0,n) and never even get around to pairs starting with anything other than 0.
However, surprisingly, \mathbb {N} \times \mathbb {N} is countable! Again, we can show this by listing the pairs in a clever order that guarantees we will reach any specific pair in a finite amount of time. The key idea is to list them by diagonals, that is, we list the pairs (x,y) in order of the sum x+y. First we list all the pairs with sum 0 (there’s only one, (0,0)), then all the pairs with sum 1 (there are two of them, (1,0) and (0,1)), then the pairs with sum 2, and so on. We end up with a list that looks like this: \begin {array}{ccccccccc} \mathbb {N}: & 0 & 1 & 2 & 3 & 4 & 5 & 6 & \dots \\ & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \updownarrow & \\ \mathbb {N} \times \mathbb {N}: & (0,0) & (1,0) & (0,1) & (2,0) & (1,1) & (0,2) & (3,0) & \dots \end {array}
\N \times \N \times \N is countable [00HV]
- July 16, 2026
Once we have this idea, we can see that \mathbb {N} \times \mathbb {N} \times \mathbb {N} must also be countable: we can either explicitly list them by “diagonal slices” through the corner of the infinite 3D cube; or we can just observe that we can do the \mathbb {N} \times \mathbb {N} \to \mathbb {N} bijection twice to get a bijection (\mathbb {N} \times \mathbb {N}) \times \mathbb {N} \to \mathbb {N} \times \mathbb {N} \to \mathbb {N}.
Challenge [00HW]
- July 16, 2026
Work out the details of showing that this is valid. For example, we need to know that if f : A \to B is a bijection then we can use it to make a bijection between A \times C and B \times C; we also need to know that chaining two bijections together will give another bijection.
Likewise, \mathbb {N}^4, \mathbb {N}^5, and any finite Cartesian product of \mathbb {N} with itself is also countable.