Countability: 1 Motivation
Countability: 1 Motivation
Countability
1 Motivation
In topology as well as other areas of mathematics, we deal with a lot of infinite sets. However,
as we will gradually discover, some infinite sets are bigger than others. Countably infinite
sets, while infinite, are “small” in a very definite sense. In fact they are the “smallest infinite
sets”. Countable sets are convenient to work with because you can list their elements, making
it possible to do inductive proofs, for example.
In the previous section we learned that the set Q of rational numbers is dense in R. In this
section, we will learn that Q is countable. This is useful because despite the fact that R itself is
a large set (it is uncountable), there is a countable subset of it that is “close to everything”, at
least according to the usual topology. Similarly the usual topology on R contains a lot of sets
(uncountably many sets), but as you have already shown on a Big List question without exactly
saying so, this topology has a countable basis, meaning that essentially all of the information
about the topology can be specified by a “small” collection of open sets. This is not true of the
Sorgenfrey Line, for example, as you will later prove.
With regard to this course in particular, the notion of countability comes up quite often in
topology and so this set of notes is here to make sure students have a firm grasp of the concepts
involved before we start throwing around the words “countable” and “uncountable” all the time.
2 Counting
The subject of countability and uncountability is about the “sizes” of sets, and how we compare
those sizes. This is something you probably take for granted when dealing with finite sets.
For example, imagine we had a room with seven people in it, and a collection of seven hats.
How would you check that we had the same number of hats as people? The most likely answer
is that you would count the hats, then count the people. You would get an answer of 7 both
times, you would note that 7 = 7, and conclude that there are the same number of hats as there
are people. You would be correct, of course.
Now imagine I asked you to do this but you had never heard of “7” - that you were incapable
of describing the size of the collection of hats or the size of the group of people with a number.
Could you still prove that there are the same number of hats as people?
One thing you could do is simply start putting hats on people; take your collection of hats
and put one on each person’s head. After you finish doing this, you would check whether (a)
you have no unused hats remaining; and (b) everyone in the room is wearing precisely one hat.
If both of these things are true, you would be justified in concluding that there are the same
number of hats as there are people. You could even get more specific, and say that if after
putting one hat on each person’s head there are some left over hats, then there are more hats
2018–
c Ivan Khatchatourian 1
4. Countability 4.2. Counting
than people. On the other hand if after this some people still are not wearing hats, then there
are more people than hats.
Surely this all seems trivial, but notice that what we have described here is a way of checking
whether two collections of objects are the same size without counting them. Without even
knowing what numbers are, for that matter. This is the notion of comparing sizes of sets that
generalizes well to the infinite.
In particular, when dealing with infinite sets you cannot just count both sets and describe
their sizes with integers you then can compare. The way of comparing sets described in the
example above is the only strategy available to you in that situation.
To “mathematize” our above discussion a bit, notice that what you did with the people and
hats amounts to constructing a function from the set of people to the set of hats, defined by
If you made sure to put at most one hat on each person’s head, g is injective. If you put a
hat on every person, g is surjective. If g is both injective and surjective (ie. if g is bijective),
then we concluded that the set of hats and the set of people were the same size.
This is the idea that we use to compare the sizes of all sets.
Definition 2.1. Given two sets A and B, we say A has the same cardinality as B if there exists
a bijection f : A → B. This is usually denoted by |A| = |B|.
Those interested in fancy, old mathematical language might say that two sets of the same
cardinality are equipotent.
Definition 2.2. Given two sets A and B, we say that A has cardinality smaller than or equal to
B if there exists an injection f : A → B, or equivalently if there exists a surjection g : B → A.
This is usually denoted by |A| ≤ |B|.
If there is an injection f : A → B and there is no surjection from A to B, we say that A has
smaller cardinality than B, and write |A| < |B|.
We will not go too much further into the abstract notion of cardinality, but the following
theorem is somewhat satisfying.
This theorem is much less trivial than it looks. It says that if there is an injection f : A → B
and an injection g : B → A, then there is a bijection h : A → B. Try to prove it yourself, and
you will find that it tricky even for finite sets. You are encouraged to look into the proof of this
theorem, which is lovely, and the most basic example of a very useful proof technique called a
“back and forth argument”.
2018–
c Ivan Khatchatourian 2
4. Countability 4.4. Simple examples and facts
3 Countability
Definition 3.1. A set A is said to be countably infinite if |A| = |N|, and simply countable if
|A| ≤ |N|.
In words, a set is countable if it has the same cardinality as some subset of the natural
numbers. In practise we will often just say “countable” when we really mean “countably infinite”,
when it is clear that the set involved is infinite. Note that ∅ is countable, since the empty function
f : ∅ → N is vacuously an injection.
The prevailing intuition here should be that a set is countable provided that you can list its
elements. After all, an injection f : A → N is nothing more than a way of assigning a number
to each element of A in a reasonable way (ie. in a way such that each element of A gets one
number). In particular, a set A is countably infinite provided that you can construct a list
a1 , a2 , a3 , a4 , a5 , a6 , . . .
of its elements and prove (a) that no element of A appears on the list more than once; and (b)
that the list includes every element of A. (Given such a list, the function defined by f (n) = an
is a bijection N → A.) Many of our proofs that sets are countably infinite will just be given as
lists like this.
It should already be apparent that this way of comparing sizes produces some results that
feel unusual if one is only used to thinking about sizes of finite sets. For example, an obvious
fact about finite sets is that if A is a finite set and B is a proper subset of A, then B is smaller
than A. That is, if you start with a finite set A and take some things away, what iss left over is
smaller than A. This is not the case with infinite sets.
Example 3.2. Let E ⊆ N be the set of even numbers. Then |E| = |N|. Indeed:
Example 4.1. The set A = { n ∈ N : n > 7 } is countable. We can certainly list its elements
in a bijective way:
8, 9, 10, 11, 12, 13, . . .
2018–
c Ivan Khatchatourian 3
4. Countability 4.4. Simple examples and facts
It should be clear that nothing is special about the number 7 here. We started with a
countably infinite set, removed finitely many elements, and were left with something that was
still countably infinite. The fact that we removed the first seven elements allowed us to define f
in a pretty convenient way, but even this was not necessary. This leads us to the following fact:
Proof. This result is obvious if A is finite, so we will treat the case in which A is countably
infinite.
It is much easier to explain the idea of this proof than to write it down; to list the elements
of A \ B, start with a list of the elements of A (which we have by the assumption that A is
countable), delete the elements of B from the list, then squish everything down to fill the gaps
created by the deletions.
For example, we explicitly treat the case in which B has two elements. Let the bijection
f : N → A witness that A is countable, and suppose B = {f (17), f (2523)}. Then the following
function g : N → A \ B is a bijection:
f (n) n < 17
g(n) = f (n + 1) 17 ≤ n < 2522 .
f (n + 2) n ≥ 2522
Check that this is a bijection between N and A \ B, and convince yourself of how you would
write down a function like this for the general setting.
We can also use the same idea, but backwards. That is, if we start with a countable set and
add finitely many elements, the result is countable.
Proposition 4.4. Let A be a countable set, and B a finite set. Then A ∪ B is countable.
Proof. Again, this result is obvious if A is finite, so assume it is countably infinite. Furthermore
we may assume without loss of generality that A and B are disjoint, as any amount of overlap
would effectively shrink B and “help” our cause. More formally, A ∪ B = A ∪ (B \ A), and B \ A
must also be finite, so it suffices to consider disjoint sets A and B.
Let f : N → A witness that A is countable, and enumerate B = {b1 , b2 , . . . , bk } for some k.
We can do this since B is finite. Now define:
b
n n≤k
g(n) = .
f (n − k) n > k
2018–
c Ivan Khatchatourian 4
4. Countability 4.4. Simple examples and facts
In the language of lists, we are simply prepending the elements of B to the beginning of our
given list of elements of A, so that A ∪ B is listed as:
So adding or removing finitely many elements does not affect countability. However, in the
previous section (Example 4.1) we saw that at least in some cases you can remove infinitely
many elements of a countable set and still be left with a countable set. To reiterate:
Example 4.5. Let E ⊆ N be the set of even natural numbers. Then E is countable, as witnessed
by f (n) = 2n.
Again from this example, we can extract a pair of more general facts.
Proposition 4.6. Let A be a countably infinite set, and B an infinite subset of A. Then B is
countable.
Proof. The idea here is essentially the same as in Proposition 4.2; list the elements of A, delete
the elements not in B from your list, then squish everything down to fill the gaps. We will take
care to be a bit more rigorous with this proof though.
So let f : N → A be a bijection witnessing that A is countable. We want to construct a
bijection g : N → B.
What goes on in the proof that follows is essentially this: list the elements of A, then take
the element of B with the smallest index in this list, and call that g(1). Then take the element of
B with the next smallest index, and call that g(2). Repeat this process inductively, letting g(k)
equal the element of B with the k th –smallest index. Then we prove that g is a bijection.
Let k1 = min { k ∈ N : f (k) ∈ B } = min(f −1 (B)). That is, k1 is the smallest number that
gets mapped into B by f . Define g(1) := f (k1 ). We proceed inductively from here.
Assume we have defined g(1), g(2), . . . , g(n). Let
That is, kn+1 is the smallest number that f maps to an element of B that we have not hit with
g so far. (Note that since B is infinite, B \ {g(1), . . . , g(n)} is also infinite and in particular
nonempty, so this minimum actually exists.)
Then, define g(n + 1) = f (kn+1 ). Continuing in this way we construct a function g : N → B
which is clearly injective. To see that it is surjective, fix b ∈ B, and assume for the sake of
contradiction that b is not in the range of g. Define
That is, X is the set of indices (according to f ) of elements of B that are missed by g. Then X
is nonempty, since f −1 (b) ∈ X at least. Being a nonempty subset of the naturals, X must have
2018–
c Ivan Khatchatourian 5
4. Countability 4.4. Simple examples and facts
a minimal element, which we call n0 . But then n0 must be kN for some N ≤ n, by definition of
the ki .
To see this more carefully, note that at most n0 of the ki ’s can occur before n0 . Let M be
the number of them that occur. In other words:
M = |{1, 2, 3, . . . n0 } ∩ { ki : i ∈ N }|
This means k1 , k2 , . . . , kM are all ≤ n0 and there are no other ki ’s below n0 . But then:
One way to interpret this result is as a sort of dichotomy theorem. A subset of a countably
infinite set must be either finite or infinite, and this result says that if it is not finite, it must be
countably infinite. In other words, there are no sizes available for a set to be “between” finite
and countably infinite.
Just as in the two “matching” propositions we proved earlier, Proposition 4.6 leads to another
fact if we go backwards. That is, if we start with a countable set and add countably many
elements, the result is countable.
Proof. If A and B are finite, this is obvious. If just one of them is finite, this is Proposition 4.4.
So assume both are countably infinite. And again, without loss of generality, we may assume A
and B are disjoint. We can do this since A ∪ B = A ∪ (B \ A), and by the previous proposition
B \ A must be either finite or countably infinite.
Let f : N → A and g : N → B be bijections witnessing that A and B are countable. Define
h : N → A ∪ B by:
f (k) if n = 2k
h(n) =
g(k) if n = 2k − 1
In the language of lists, take the list of elements of A and the list of elements of B and
interweave them.
Convince yourself that h is a bijection.
2018–
c Ivan Khatchatourian 6
4. Countability 4.5. More interesting examples and facts
Exercise 4.10. Prove that any finite union of countable sets is countable. (Hint: Use the
previous Proposition, and induction.)
At this point we state a proposition that will free us up just a bit. Every proof that something
is countably infinite that we have done so far has involved bijections from N. Bijections are pretty
nice functions though, and in particular they have inverses which are also bijections, and the
composition of two bijections is again a bijection.
Proposition 4.11. Let A be an infinite set, and C a fixed countably infinite set. Then the
following are equivalent.
1. A is countable.
2. There exists a bijection f : N → A.
3. There exists a bijection g : A → N.
4. There exists a bijection h : A → C, or h : C → A.
5. There exists an injection i : A → N, or i : A → C.
6. There exists a surjection s : N → A, or s : C → A.
Proof. Exercise. (Just about everything here follows from elementary properties of functions
or the Propositions we have proved above. The only one that should require any work to show
is equivalent to the others is (6)).
Exercise 4.12. Later in this course we will learn about the Axiom of Choice. After we have
learned about it (or right now if you are already familiar with it) try to spot whether any of the
implications between these facts rely on some amount of Choice.
Proof. There are two ways to prove this. One is by drawing a picture and pointing at it, and
the other is by explicitly defining a bijection f : N × N → N. The former way is the best way.
Here is the picture:
2018–
c Ivan Khatchatourian 7
4. Countability 4.5. More interesting examples and facts
Figure 1: Convince yourself that this is a proof that N × N is countable. (Source: College Math Teaching, 10 April, 2015.)
f (n, m) = 2n 3m .
This function is injective by the uniqueness of prime decompositions, and so N×N is countable
by Proposition 4.11, part 5.
Proof. Exercise.
Exercise 5.3. Show that the Cartesian product of finitely many countable sets is countable in
two different ways. Take note of why each of your two proofs does not extend to even countable
products of countable sets.
From Corollary 5.2 follows one of the most important results of this section for our purposes.
Define a function f : Q → Z × N by f ( pq ) = (p, q). This map is an injection (check this!) and
therefore Q is countable by Proposition 4.11, part 5.
We will talk a great deal more about this fact throughout the course, in many different
contexts. For now, take a moment to come to terms with it. Thus far you have likely been
picturing countable sets as sparse collections of points, like N, Z, etc. Q on the other hand is
2018–
c Ivan Khatchatourian 8
4. Countability 4.6. Are all sets countable!?
very densely packed. Wherever you look in the real numbers, there are infinitely many rationals
there. Still, the set of all rationals is countable.
Another corollary of Theorem 5.1 is the following. At this point you should not be too
surprised by it, though it would have been surprising at the beginning of our discussion on
countability.
Corollary 5.5. A countable union of countable sets is countable. That is, if An , n ∈ N are
S
countable sets, then n∈N An is countable.
Proof. As before, we may assume that the An are all infinite and mutually disjoint.
Let fn : N → An be a bijection witnessing that An is countable, and define g : N × N →
S
n∈N An by g(n, i) = fn (i).
S
Exercise 5.6. Show that the function g defined above is a bijection, and conclude that n∈N An
is countable.
Exercise 5.7. Show that the set BQ = { (a, b) ⊆ R : a, b ∈ Q } is countable. This means that
Rusual has a countable basis (you showed in Big List 2.2 that BQ is a basis for Rusual ).
This property of having a countable basis is useful enough (and invariant enough, in senses
we will discuss later) to earn a name. We will do that at the end of this note.
Proof. Exercise.
2018–
c Ivan Khatchatourian 9
4. Countability 4.6. Are all sets countable!?
Fine, so what sets are actually uncountable? Lots of them, it turns out. We will give one
specific example and its consequences, and one method for producing as many uncountable sets
as you want.
The following is a very famous and lovely proof, first given by Cantor in the 1880s. It was
quite a surprise at the time. It is often called “Cantor’s Diagonalization Proof”.
Proof. This is a proof by contradiction. Certainly (0, 1) is not finite, so we begin by assuming
that (0, 1) is countably infinite, and fixing a bijection f : N → (0, 1) witnessing this. Every real
number between 0 and 1 has an infinite decimal expansion of the form:
0.a1 a2 a3 a4 a5 a6 a7 . . .
(where we imagine a tail of zeros on a real number with a terminating decimal expansion). In
this way, we will index every digit appearing in the decimal expansion of every real number on
our list (the list given by f ). That is, for x ∈ (0, 1), we have by assumption that there is a
unique n ∈ N such that f (n) = x. So we’re going to write:
In your head you should now be imagining that we have constructed an infinite table that
looks something like:
f (1) = 0. x11 x12 x13 x14 x15 ...
f (2) = 0. x21 x22 x23 x24 x25 ...
f (3) = 0. x31 x32 x33 x34 x35 ...
f (4) = 0. x41 x42 x43 x44 x45 ...
f (5) = 0. x51 x52 x53 x54 x55 ...
.. .. .. .. .. .. .. ..
. . . . . . . .
where I have coloured the diagonal elements in the interesting part of our table red to call
attention to them.
We will now construct a real number y = 0.y1 y2 y3 y4 y5 . . . that cannot be on our list (ie.
cannot be in the range of f ), contradicting the assumption that f is a bijection.
Indeed, let y1 = x11 − 1, unless x11 = 0, in which case let y1 = 9. The specifics of this are not
so important, but what is important is that we fix a concrete way of defining y1 to not equal x11 .
Now do the same for each yk . That is, let yk = xkk − 1, unless xkk = 0, in which case let yk = 9.
Also, at the end of this process, we have to make sure we did not construct y = 0 = 0.0000 . . .
or y = 1 = 0.9999 . . . . So at the end, we just make any change to one digit that ensures this.
I claim that y = 0, y1 y2 y3 y4 y5 . . . is not in the range of f .
To see this, suppose it was in the image of f . Then there would have to exist an n ∈ N such
that f (n) = y. But then by construction of y, the nth decimal place of y differs from the nth
decimal place of f (n).
2018–
c Ivan Khatchatourian 10
4. Countability 4.6. Are all sets countable!?
This is a contradiction, proving that y is not in the image of f , which in turn shows that f
was not a bijection. Since the f we started with was arbitrary, we conclude that there can be
no bijection between N and (0, 1).
Amazing! I hope some of the beauty of this result is apparent even to the most jaded math
specialists reading this. Both of N and (0, 1) are infinite, but (0, 1) is bigger !
Of course, this also means that R is uncountable.
Corollary 6.4. R is uncountable.
Proof. All we need to do is exhibit a bijection h : (0, 1) → R. f (x) = π(x − 21 ) is a bijection
between (0, 1) and (− π2 , π2 ) (check this!), and g(x) = tan(x), when restricted to (− π2 , π2 ), is a
bijection from this set to R. Their composition h := g ◦ f : (0, 1) → R is therefore a bijection,
as required.
The implications of this proof are far-reaching. Just for a taste, it implies that if you keep
iterating the power set operation, you get sets with strictly larger and larger cardinalities. That
is, for example:
|N| < |P(N)| < |P(P(N))| < |P(P(P(N)))| < · · ·
So there are infinitely many sizes of infinity! I love this stuff.
2018–
c Ivan Khatchatourian 11
4. Countability 4.7. Enough cool proofs, give me some definitions!
Definition 7.1. A topological space (X, T ) is called separable if there is a countable, dense
subset of X.
Definition 7.2. A topological space (X, T ) is called second countable if there is a countable
basis on X that generates T .
Finally, here is one more topological property that involves countability. We will not prove
anything with this property at the moment, but you will do a little bit in a Big List problem
for this section, and we will revisit this property several times throughout the course.
Definition 7.3. A topological space (X, T ) is said to have the countable chain condition if there
are no uncountable collections of mutually disjoint, nonempty, open subsets of X. Another way
2018–
c Ivan Khatchatourian 12
4. Countability 4.7. Enough cool proofs, give me some definitions!
to characterize this property is to say that every collection of mutually disjoint, nonempty, open
subsets of X is countable.
Remark 7.4. If (X, T ) has the countable chain condition, we will usually say “(X, T ) has the
ccc” or “(X, T ) is ccc”.
You proved that Rusual is ccc with a problem at the end of the first section of the Big List,
though of course you did not have this name at the time.
For now we will simply add this property to our growing catalogue of topological properties,
but we make special note that the relationships between this property, separability, and second
countability will be interesting to explore. Whenever we prove something about one of these
three properties, you should think about the other ones in the same context.
2018–
c Ivan Khatchatourian 13