Cardinality
Cardinality
Cardinality
In this chapter, we will explore the notion of cardinality, which formalizes what it means
for two sets to be the same “size”.
Definition 8.1. Let A and B be sets. We say that A and B have the same cardinality i↵
there exists a one-to-one correspondence between A and B. If A and B have the same
cardinality, then we write card(A) = card(B) .
Problem 8.2. Prove each of the following. In each case, you should create a bijection
between the two sets. Briefly justify that your functions are in fact bijections.
(b) Let O denote the set of odd natural numbers. Then card(N) = card(O).
59
CHAPTER 8. CARDINALITY
(d) Let a, b, c, d 2 R with a < b and c < d. Then card((a, b)) = card((c, d)).1
(f) Let F be the set of functions from N to {0, 1}. Then card(F ) = card(P (N)).2
In light of the previous theorem, the next result should not be surprising.
Corollary 8.4. If X is a set, then “has the same cardinality as” is an equivalence relation
on P (X).
Theorem 8.5. Let A, B, C, and D be sets such that card(A) = card(C) and card(B) =
card(D).
(a) If A and B are disjoint and C and D are disjoint, then card(A [ B) = card(C [ D).
Given two finite sets, it makes sense to say that one set is “larger than” another pro-
vided one set contains more elements than the other. We would like to generalize this
idea to handle both finite and infinite sets.
Definition 8.6. Let A and B be sets. If there is a one-to-one function (i.e., injection) from
A to B, then we say that the cardinality of A is less than or equal to the cardinality of B.
In this case, we write card(A) card(B) .
It might be tempting to think that the existence of a one-to-one function from a set
A to a set B that is not onto would verify that card(A) card(B) and card(A) , card(B).
While this is true for finite sets, it is not true for infinite sets as the next exercise asks you
to verify.
1 Hint: Try creating a linear function f : (a, b) ! (c, d). Drawing a picture should help.
2 Hint: Define : F ! P (N) so that (f ) outputs a subset of N determined by when f outputs a 1.
CHAPTER 8. CARDINALITY
Exercise 8.8. Provide an example of sets A and B such that card(A) = card(B) despite the
fact that there exists a one-to-one function from A to B that is not onto.
Definition 8.9. Let A and B be sets. We write card(A) < card(B) provided card(A)
card(B) and card(A) , card(B).
It is important to point out that the statements card(A) = card(B) and card(A)
card(B) are symbolic ways of asserting the existence of certain types of functions from
A to B. When we write card(A) < card(B), we are saying something much stronger than
“There exists a function f : A ! B that is one-to-one but not onto.” The statement card(A) <
card(B) is asserting that every one-to-one function from A to B is not onto. In general, it
is difficult to prove statements like card(A) , card(B) or card(A) < card(B).
For example, [5] = {1, 2, 3, 4, 5}. Notice that our notation looks just like that for the
set of relatives given a relation on some set (see Definition 6.33), which is an equivalence
class if the relation happens to be an equivalence relation. However, despite the similar
notation, these concepts are unrelated. We will have to rely on context to keep them
straight.
The next definition should coincide with your intuition about what it means for a set
to be finite.
Theorem 8.13. If A has cardinality n 2 N [ {0} and x < A, then A [ {x} is finite and has
cardinality n + 1.
Theorem 8.13 shows that adding a single element to a finite set increases the cardi-
nality by 1. As you would expect, removing one element from a finite set decreases the
cardinality by 1.
3 Don’t forget to consider the case when A = ;.
4 Hint: Use induction.
CHAPTER 8. CARDINALITY
Theorem 8.15. If A has cardinality n 2 N, then for all x 2 A, A \ {x} is finite and has
cardinality n 1.
The next result will not come as a surprise. The proof is not complicated, but is not
immediate either. It is a consequence of Theorems 8.13 and 8.14.
The next theorem, called the Pigeonhole Principle, is surprisingly useful. It puts re-
strictions on when we may have a one-to-one function. The name of the theorem is in-
spired by the following idea: If n pigeons wish to roost in a house with k pigeonholes and
n > k, then it must be the case that at least one hole contains more than one pigeon.
Theorem 8.18 (Pigeonhole Principle). If n, k 2 N and f : [n] ! [k] with n > k, then f is not
one-to-one.6
The last theorem of this section tells us that the cardinality of a proper subset of a
finite set is never the same as the cardinality of the original set. It turns out that this
theorem does not hold for infinite sets.
Theorem 8.19. If A is a finite set, then card(B) < card(A) for all proper subsets B of A.
Let’s see if we can utilize this definition to prove that the set of natural numbers is
infinite.
The next theorem is analogous to Theorem 8.12, but for infinite sets. As we shall see
later, the converse of this theorem is not generally true.
card(N), which implies that there exists a bijection f : [n] ! N. What can you say about the number
m := max(f (1), f (2), . . . , f (n)) + 1?
8 Hint: Try a proof by contradiction. You should end up composing two bijections, say f : A ! B and
Exercise 8.23. Quickly verify that the following sets are infinite by appealing to Theo-
rem 8.21, Theorem 8.22, and Problem 8.2.
(a) The set of odd natural numbers.
(iii) A can be put in one-to-one correspondence with a proper subset of A (i.e., there
exists a proper subset B of A such that card(B) = card(A)).
9 The Hilbert Hotel is named after mathematician David Hilbert (1862–1942).
10 Hint: Prove (i) i↵ (ii) and (ii) i↵ (iii). For (i) implies (ii), construct f recursively. For (ii) implies (i), try
a proof by contradiction. For (ii) implies (iii), let B = A \ {f (1), f (2), . . .} and show that A can be put in
bijection with B [ {f (2), f (3), . . .}. Lastly, for (iii) implies (ii), suppose g : A ! C is a bijection for some
proper subset C of A. Let a 2 A \ C. Define f : N ! A via f (n) = g n (a), where g n means compose g with
itself n times.
CHAPTER 8. CARDINALITY
It is worth mentioning that for the previous theorem, (iii) implies (i) following imme-
diately from the contrapositive of Theorem 8.19.
Problem 8.28. Find a new proof of Theorem 8.21 that uses (iii) implies (i) from Theo-
rem 8.25.
Exercise 8.29. Quickly verify that the following sets are infinite by appealing to either
Theorem 8.25 (use (ii) implies (i)) or Corollary 8.26.
Definition 8.30. If A is a set such that card(A) = card(N), then we say that A is denumer-
able and has cardinality @0 (read “aleph naught”).
Exercise 8.32. Quickly justify that each of the following sets is countable. Feel free to
appeal to previous problems.
CHAPTER 8. CARDINALITY
heading m and a row has heading n, then the corresponding entry in the table is given by the fraction
m/n. Find a way to zig-zag through the table making sure to hit every entry in the table (not including
column and row headings) exactly once. This justifies that there is a bijection between N and the entries
in the table. Do you see why? Now, we aren’t done yet because every rational number appears an infinite
number of times in the table. Appeal to Theorem 8.34.
CHAPTER 8. CARDINALITY
Theorem 8.42. The set of all finite sequences of 0’s and 1’s (e.g., 0110010 is a finite se-
quence of 0’s and 1’) is countable.
Problem 8.43. For sake of a contradiction, assume the interval (0, 1) is countable. Then
there exists a bijection f : N ! (0, 1). For each n 2 N, its image under f is some number
in (0, 1). Let f (n) := 0.a1n a2n a3n . . ., where a1n is the first digit in the decimal form for the
image of n, a2n is the second digit, and so on. If f (n) terminates after k digits, then our
convention will be to continue the decimal form with 0’s. Now, define b = 0.b1 b2 b3 . . .,
where 8
>
<2, if aii , 2
>
bi = >
>
:3, if aii = 2.
(a) Prove that the decimal expansion that defines b above is in standard form.
13 Hint: A countable union is a union of countably many sets. Recall that a countable set may be finite or
infinite. Consider three cases: (1) finite union of countable sets (use induction with base case n = 2), (2)
countably infinite union of finite sets, (3) countably infinite union of countably infinite sets.
CHAPTER 8. CARDINALITY
(e) Explain why it follows that the open interval (0, 1) cannot be countable.
The steps above prove the following theorem.
Theorem 8.44. The open interval (0, 1) is uncountable.
Loosely speaking, what Theorem 8.44 says is that the open interval (0, 1) is “bigger”
in terms of the number of elements it contains than the natural numbers and even the
rational numbers. This shows that there are infinite sets of di↵erent sizes!
One consequence of Theorem 8.44 is that we know there is at least one uncountable
set. The next three results are useful for finding other uncountable sets.
Theorem 8.45. If A and B are sets such that A ✓ B and A is uncountable, then B is un-
countable.14
Corollary 8.46. If A and B are sets such that A is uncountable and B is countable, then
A \ B is uncountable.
Theorem 8.47. If f : A ! B is a one-to-one function and A is uncountable, then B is
uncountable.
Theorem 8.48. The set R of real numbers is uncountable. Moreover, card((0, 1)) = card(R).15
Theorem 8.49. If a, b 2 R with a < b, then (a, b), [a, b], (a, b], and [a, b) are all uncountable.
Theorem 8.50. The set of irrational numbers is uncountable.
Theorem 8.51. The set C of complex numbers is uncountable.
Problem 8.52. Determine whether each of the following statements is true or false. If a
statement is true, prove it. If a statement is false, provide a counterexample.
(a) If A and B are sets such that A is uncountable, then A [ B is uncountable.
It turns out that the two uncountable sets may or may not have the same cardinality.
Perhaps surprisingly, there are sets that are even “bigger” than the set of real numbers.
Given any set, we can always increase the cardinality by considering its power set.
Recall that cardinality provides a way for talking about “how big” a set is. The fact
that the natural numbers and the real numbers have di↵erent cardinality (one countable,
the other uncountable), tells us that there are at least two di↵erent “sizes of infinity”.
Theorem 8.54 tells us that there are infinitely many “sizes of infinity.”
Theorem 8.55. Consider the set S from Problem 8.53. Then card(P (N)) = card(S).
16 Hint: Mimic Cantor’s Diagonalization Argument for showing that the interval (0, 1) is uncountable.