Cardinality
Cardinality
Cardinality
...it’s very much like your trying to reach Infinity. You know that it’s there, but you
just don’t know where—but just because you can never reach it doesn’t mean that it’s
not worth looking for. Norton Juster, The Phantom Tollbooth
In the very first chapter of this book, we defined the cardinality of a finite set to
equal the number of its elements. Thus, for instance, the sets {a, b, c} and {1, 2, 3}
have the same cardinality, which is 3. For infinite sets we cannot define the cardinality
to be the number of elements, because such sets do not have any (finite) number of
elements.
However, there is a reason we do not just define the cardinality of an infinite set
to be the symbol ∞; there is a better way to measure the size of sets! This came as
a shock to mathematicians in the late 1800’s, who expected all infinite sets to have
the same size. This theory was developed by Cantor, who showed that the set of real
numbers R has bigger cardinality than N. In this chapter, we develop Cantor’s theory
of cardinality, which has become an important part of modern mathematics.
215
216 CHAPTER VIII. CARDINALITY
Definition 28.1. Let S and T be sets. We say that S and T have the same
cardinality if there exists a bijection f : S → T . If this holds, we write |S| = |T |.
If there is no bijection from S to T , we say that they have different cardinal-
ities and write |S| =6 |T |.
Remark 28.2. We will prove, shortly, that this relation is an equivalence relation,
which will justify our use of an equality sign for the relation. N
The following are some examples and nonexamples of sets with the same cardi-
nality.
Example 28.3. (1) Consider the three sets A = {a, b, c, d, e, f }, B = {1, 2, 3, 4, 5, 6},
and C = {0, 1, 2, 3, 4, 5}. It is easy to construct a bijection from A to B (since both
sets have exactly six elements). So |A| = |B|. There are also bijections from A to C,
and from B to C (since C also has six elements), so |A| = |C|, and |B| = |C|.
(2) Let S = {1, 2, 3} and T = N. There is no bijection from S to T (since T has
more than 3 elements). Thus |S| = 6 |T |.
(3) It can be tricky when working with infinite sets to tell whether they have the
same cardinality. For instance, does N have the same cardinality as 2N? The answer
is yes! There is a bijection f : N → 2N, given by f (n) = 2n. In other words,
f (1) = 2, f (2) = 4, f (3) = 6, f (4) = 8, . . .
is a bijection from N to 2N. Thus, we do have
|N| = |2N|. △
The following example is so important that we’ll call it a theorem.
28. DEFINITIONS REGARDING CARDINALITY 217
n 1 2 3 4 5 6 7 8 9 10
f (n) 0 1 −1 2 −2 3 −3 4 −4 5
which yields the needed bijection between N and Z.
Remark 28.5. The previous proof was very informal. First, we didn’t prove that
the function f is injective and surjective. We’ll leave that as an exercise to be verified
later.
Second, the definition of the function f is sloppy. To be more precise we should
define f as a piecewise function on n ∈ N by the rule
(
n/2 if n is even,
f (n) =
−(n − 1)/2 if n is odd.
Amazingly, it turns out that this function can be expressed by a (somewhat com-
plicated) single formula
1 + (−1)n (2n − 1)
f (n) = .
4
(It is not expected that a student would be able to come up with this formula without
a lot of help!) Note that the inverse of this function is given in Example 27.12. N
Advice 28.6. To prove that two sets have the same cardinality you are required
to find a bijection between the two sets. In general there are usually lots of
different bijections. Try to look for a simple one.
Example 28.7. We will prove that the open interval A = (0, 1) and the open interval
B = (1, 4) have the same cardinality. We thus want to construct a bijection between
these two sets. The most obvious option would be to stretch by a factor of 3 and
then shift right by 1. So we define g : (0, 1) → (1, 4) by the rule
g(x) = 1 + 3x.
Theorem 28.8. The relation of “having the same cardinality” as given in Def-
inition 28.1 is an equivalence relation on the collection of sets.
Proof. We first prove this relation is reflexive. Let X be any set. The identity function
idX : X → X is a bijection. Thus X is related to X.
Next, we prove this relation is symmetric. Let X and Y be any sets, and assume
X relates to Y . In other words, assume there is a bijection f : X → Y . Then f has
an inverse function f −1 : Y → X which is also a bijection. Hence Y relates to X.
Finally, we prove transitivity. Let X, Y , and Z be any sets, and assume there
are bijections f : X → Y and g : Y → Z. The composite function g ◦ f : X → Z is a
bijection, as needed.
The equivalence classes of this equivalence relation are precisely the collections of
sets with the same cardinality.
The observant reader will have noticed that we defined when two sets S and T have
the same cardinality, |S| = |T |, but that we have not defined what the cardinality
of an individual set is. Mathematicians solve this problem by choosing a (special)
transversal of this equivalence relation; the representatives in the transversal are the
cardinal numbers. Thus, the cardinality of a set, denoted |S|, is a special element of
the equivalence class of S under the relation “having the same cardinality.” There
are specific symbols used to represent the cardinality of a set. For finite sets, that
symbol is just the actual size of the set. Thus, we still have |{2, 79, −4}| = 3.
For infinite sets things are much more complicated. (Did you expect otherwise?)
The smallest infinite cardinal |N| is written as ℵ0 (read as “aleph-nought”). The next
infinite cardinal is ℵ1 , and so forth. The diagram below gives some perspective to this
chain. (We put question marks in places where we do not yet have any examples.)
The following are some examples and nonexamples involving these definitions.
28. DEFINITIONS REGARDING CARDINALITY 219
Example 28.10. (1) The empty set is countable, since it is finite. It is not countably
infinite (since it isn’t infinite).
(2) The set {1, 2, 93828283928} is countable and finite, but not infinite, and hence
not countably infinite.
(3) Theorem 28.4 tells us that the integers are a countably infinite set. Similarly,
Example 28.3 tells us that 2N is a countably infinite set.
(4) The set {n2 : n ∈ Z} is infinite. We will see shortly that it is countably
infinite.
(5) Are there any sets which are infinite but not countably infinite? These would
be sets which occur strictly above ℵ0 in the diagram below. We will prove in Section 30
that, yes, there are such sets! △
Cardinalities Examples
.. ..
. .
ℵ2 ?
Infinite
ℵ1 ?
ℵ0 N, 2N, Z, . . .
.. ..
. .
2 {1, 2}, {1, 3}, . . .
Finite
1 {1}, {2}, . . .
0 ∅
Advice 28.11. To show that a set A is countably infinite, you just need to
arrange its elements in a nonrepeating, infinite list
A = {a1 , a2 , a3 , . . .}.
This is precisely what we did when we proved that Z is countably infinite, we put
its elements in the list 0, 1, −1, 2, −2, 3, −3, . . ..
Warning 28.12. If you are proving that a set is countably infinite by putting
its elements into a list, then do not skip elements and do not repeat elements.
Otherwise, you didn’t really create a bijection.
Answer: Only (c) works. The list in (a) skips the negative integers. (However,
it does prove that the nonnegative integers are countably infinite.) The list in (b)
repeats 0. Of the choices, only (c) lists every integer exactly once, hence gives the
bijection with N.
Proof. Let A be a countably infinite set. We can write the elements of A in an infinite
list a1 , a2 , a3 , . . .. Let B be an infinite subset of A.
Let n1 be the smallest natural number with an1 ∈ B, which exists since B 6= ∅ as
B is infinite. Put b1 = an1 .
Next let n2 be the smallest natural number with n2 > n1 and an2 ∈ B, which
exists since B − {b1 } = 6 ∅ as B is infinite. Put b2 = an2 .
Repeating this process (by induction) we create an infinite list b1 , b2 , . . .. Clearly
there are no repetitions in this list. This new list covers every element of B because
we can also prove (by induction) that ni ≥ i for each i ∈ N; hence, we have worked
all the way through the list of elements of A.
Example 28.15. Not every subset of N is countably infinite. For instance {3, 7, 19}
is a subset but not countably infinite.
However, every infinite subset of N is countably infinite by Theorem 28.13. For
instance, since there are infinitely many primes (by Theorem 19.14), then we know
that the set of all primes
{2, 3, 5, 7, 11, 13, 17, . . .}
is countably infinite.
Is S = {x3 : x ∈ Z} = {. . . , −27, −8, −1, 0, 1, 8, 27, 64, . . .} countably infinite?
Yes! First, it is an infinite set since f (x) = x3 is a strictly increasing function. As S
is an infinite subset of the countably infinite set Z, we know S is countably infinite
by Theorem 28.13. △
1 + (−1)n (2n − 1)
f (n) = . △
2
28.E Exercises
Exercise 28.1. Declare whether the following statements are true or false, with
proof/reason or counterexample:
(a) All finite sets have the same cardinality.
(b) If f : A → B is a function between two sets, then |f | = |A| (thinking of f as a
set of ordered pairs).
(c) Every subset of N is countably infinite.
(d) Every subset of an infinite set has cardinality ℵ0 .
(e) If f : A → B is a surjective function then |f | = |B| (thinking of f as a set of
ordered pairs).
Exercise 28.3. Prove that the set of those natural numbers with exactly one digit
equal to 7 is countably infinite. For instance, the number 103792 has exactly one of
its digits equal to 7, while 8772 has two digits equal to seven.
Exercise 28.5. Prove that the function in Theorem 28.4 is a bijection. (See the
remark following the theorem for a formal definition of the function. The Pasting
Together Theorem might be helpful.)
Exercise 28.6. Prove that |R| = |(0, 1)|. (Hint: Consider the tangent function.
Alternatively, use Exercise 28.2 in pieces.)
29.A Unions
Advice 29.2. The type of argument used in the first paragraph of the proof
above is referred to as reducing to a simpler situation. For instance, in the proof
above we could say there that we reduced to the case where the two sets are
disjoint.
After a reduction, mathematicians will simply assert that they now need
only consider the simpler situation. For example, after the first paragraph of
the proof above, we could simply say “We thus may assume S ∩ T = ∅.” This is
because we would recognize that, after replacing T by T ′ , this situation actually
occurs.
29.B Products
Taking a union is not the only operation we can do with two sets. Another operation
is intersection. When we intersect two sets, the cardinality can get much smaller.
There is a third operation: the Cartesian product. Cantor came up with a very
clever method for showing that the product of two countably infinite sets is still
countably infinite. Thus we have:
29. MORE EXAMPLES OF COUNTABLE SETS 223
Travel along each arrow, starting at the smallest arrow, and passing to the next
smallest arrow. This allows us to list the elements of N × N as
(1, 1), (2, 1), (1, 2), (3, 1), (2, 2), (1, 3), . . . ,
according to when we pass through each ordered pair. We will hit each ordered pair
exactly once.
(m + n − 1)(m + n − 2)
f (m, n) = + n.
2
is also a bijection. (Proving that g is a bijection requires the lemma that every natural
number can be written as a unique power of 2 times a unique odd integer.)
There are many other options. For instance, we could have used arrows pointing
down and to the left, instead of up and to the right. Alternatively, we could have
“snaked” back and forth along each finite diagonal. N
Proof. Put the elements of Q+ into a diagram as below. (We put fractions which are
not in lowest terms as light gray.)
1 2 3 4
1 1 1 1
···
1 2 3 4
2 2 2 2
···
1 2 3 4
3 3 3 3
···
1 2 3 4
4 4 4 4
···
.. .. .. .. ..
. . . . .
Now, we just list the elements as before, skipping over the elements in light gray,
since they will be counted when they are in lowest terms. This counting procedure
never repeats elements (since we skip those fractions not in lowest terms), and con-
tinues forever since Q+ is infinite (since N is a subset; in other words, the top row of
the diagram is infinite).
We finish with one more example of how to show a set is countably infinite.
First, the set S is infinite, since the left column is infinite. Since S ⊆ N × N and
N × N is countably infinite, we know that S is countably infinite by Theorem 28.13.
Alternatively, we can list the elements of S by using the “up arrow” argument
from earlier. (We can’t list the elements of S by going down columns, but could we
list the elements of S by traveling across the successive rows?) △
29.D Exercises
Exercise 29.1. Finish the proof of Theorem 29.1.
(Hint: There are two unfinished cases: (a) both S and T ′ are finite, or (b) one of
them is finite and the other infinite.)
Exercise 29.2. Prove that {0, 1} × N is countably infinite. (Hint: Use theorems in
the section.)
Exercise 29.3. Let A and B be countable sets. Prove that A × B is countable. (How
is this different from what was proved in Theorem 29.3?)
Exercise 29.7. Prove that the set of all finite subsets of N is countably infinite.
226 CHAPTER VIII. CARDINALITY
30 Uncountable sets
The results of this section will be centered around the following definition.
We can think of the uncountable sets as those sets which are bigger than the
countably infinite sets, as in the following figure.
Cardinalities Examples
..
.
Uncountable ℵ2
Infinite
ℵ1
..
.
0 ∅
As is evident from this diagram, we still don’t have any examples of uncountable
sets. In this section we will see that there are many examples.
1 = 1.00000 . . .
√
2 = 1.41421 . . .
π
− = −0.24166 . . .
13
6 24
e − = −3.42609 . . .
7
However, real numbers do not always have unique infinite decimal expansions. If a
30. UNCOUNTABLE SETS 227
number ends in repeating 9’s, we can shift up and end in repeating 0’s. For example,
0.99999 . . . = 1.00000 . . .
8.3929999 . . . = 8.3930000 . . .
−3928.83829999 . . . = −3928.83830000 . . .
To avoid nonuniqueness issues, we will always avoid writing decimal expansions which
end in repeating 9’s.
Our goal now is to show that R is uncountable. From a previous homework
problem we know that |(0, 1)| = |R|, so it suffices to show that (0, 1) is uncountable.
(This set is easier to work with.) We know that (0, 1) is infinite, so to prove that it
is uncountable we must show that there does not exist any bijection f : N → (0, 1).
Cantor’s trick to do this is to show that every function f : N → (0, 1) is not surjective,
using what is now commonly called a “diagonalization argument.” Before we give the
technical proof, we demonstrate the idea with an example.
Suppose f : N → (0, 1) is the function
f (1) = 0.29838293 . . .
f (2) = 0.43828183 . . .
f (3) = 0.73826261 . . .
f (4) = 0.20030000 . . .
f (5) = 0.73724892 . . .
..
.
Our goal is to prove that f is not surjective. Thus, we must find some element
x ∈ (0, 1) that f does not map to. We will construct x digit by digit, so that it
doesn’t match any of the numbers on our list.
First, we want x to be different from f (1) = 0.29838293 . . .. We can make sure this
is true by guaranteeing that the first digit (past the decimal point) of x is different
from the first digit of f (1). So, let’s change that first 2 to a 4, and put
x = 0.4 . . . .
Notice that no matter what we do with the rest of the digits of x, it will not match
f (1).
Second, we want x to be different from f (2) = 0.43828183 . . .. They do match on
their first digit, but we can make their second digits different by changing the 3 to a
4. So we put
x = 0.44 . . .
and it will not equal f (1) or f (2).
Third, we want x to be different from f (3) = 0.73826261 . . .. It already is different
because of our choice of the first two digits, but we probably should continue the
pattern we’ve already come up with, to make sure that the third digit is different. So
we change the 8 to a 4, and put
x = 0.444 . . .
228 CHAPTER VIII. CARDINALITY
x = 0.4444 . . .
Remark 30.2. If we start with a different list of numbers, the number x we construct
will be different (depending on that list). N
To make this work more easily, define the digit change function
by the rule (
4 if i 6= 4
dig(i) =
7 if i = 4.
Note that because the digit change function does not use 9’s, we don’t need to worry
about x ending in repeating 9’s.
Remark 30.3. There are many other digit change functions we could have used. This
is just one option. Because there are so many different options, you should always tell
your reader which digit change function you are using by giving the definition. N
We are now prepared to give the formal proof that (0, 1) is uncountable. As
discussed above, the technique used in this proof is known as Cantor’s diagonalization
argument.
Proof. Let f : N → (0, 1) be any function. We will show that f is not surjective.
Write f (n) using a decimal expansion f (n) = 0.d1,n d2,n d3,n . . . (which doesn’t
end in repeating 9’s). Let x ∈ (0, 1) be the number with decimal expansion x =
0.x1 x2 x3 . . . where xn = dig(dn,n ). In other words, the nth digit of x is the digit
change of the nth digit of f (n). Hence x 6= f (n) for each n ∈ N. Therefore f is not
surjective, as x is not in the image.
30. UNCOUNTABLE SETS 229
The cardinality of R is called the continuum, and we write |R| = c. You might
ask: Where does c fit in the chain of cardinalities? Is it just one step up from ℵ0 ?
The answer is strange. It depends on the axioms you use! Some mathemati-
cians do assume c = ℵ1 ; this assumption is called the continuum hypothesis. Most
mathematicians simply do not worry about this question.
We have already seen that |(0, 1)| = |R|, so (0, 1) also has continuum cardinality.
Here are some more examples of sets with continuum cardinality.
(1) Any open interval (a, b) with a, b ∈ R. (We can also replace a with −∞, or b
with ∞.)
(2) Any half-open interval [a, b) with a, b ∈ R. (We can replace b with ∞.)
(3) Any half-open interval (a, b] with a, b ∈ R. (We can replace a with −∞.)
(4) Any closed interval [a, b] with a, b ∈ R.
To give the idea behind how to prove these facts, we will show that (0, 1] has
continuum cardinality.
It is easy to see that f is a bijection from (0, 1] − S to the set (0, 1) − S (as it is
essentially the identity function on this set). It is also a bijection from S → (0, 1) ∩ S.
By pasting together, we have a bijection.
We end this section with one last result which can be used to tell whether a set is
uncountable.
Proof. This is the contrapositive of Theorem 28.13, after noting that A and B must
be infinite.
30.B Exercises
Exercise 30.1. Let a, b ∈ R with a < b. Construct a bijection f : (0, 1) → (a, b), and
prove it is a bijection. (This shows that bounded open intervals all have the same
cardinality.)
Exercise 30.2. Prove that the interval [0, 1) has continuum cardinality, by creating
a bijection [0, 1) → (0, 1).
Exercise 30.3. Prove that the interval [0, 1] has continuum cardinality.
Exercise 30.4. Prove that the irrational numbers are uncountable. (Hint: Theorem
29.1 may be useful, along with contradiction.) Find a subset of the irrational numbers
which is countably infinite.
Advice 31.3. We can think of injections as giving only “half” of the information
needed to construct a bijection, which is why we only get an inequality ≤.
You might recall that in our tower of cardinalities (found at the beginning of the
previous section) we had an infinite list of infinite cardinalities ℵ0 < ℵ1 < ℵ2 < . . ..
But so far, we have only found two types of infinite cardinalities; the countably infinite
sets, and the sets of continuum size. In our next theorem we will prove that for any
set S we have |S| < |P(S)|. Thus, we have an infinite chain of increasing infinite
cardinalities
|N| < |P(N)| < |P(P(N))| < . . . .
232 CHAPTER VIII. CARDINALITY
When S is a finite set, say |S| = n, then we know |S| < |P(S)| because n < 2n .
But how does this process work when S is an infinite set? In that situation we
cannot simply count elements. Rather, we must prove that there is no bijection
g : S → P(S). Our approach will be similar to how we showed R is not countable.
Start with an arbitrary function g : S → P(S), and show that g is not surjective
by finding some set B ∈ P(S) which is not in the image of g. The hardest part is
constructing B. We will give an explicit example (using finite sets), and then give
the formal proof for arbitrary sets.
Fix S = {1, 2, 3}. Hence
P(S) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.
Consider the function g : S → P(S) given by g(1) = {2}, g(2) = ∅, and g(3) =
{1, 2, 3}. We want to find a set B ∈ P(S) that we can prove is not equal to g(1),
g(2), or g(3). Of course, we could just pick one of the other five sets not in the image
of g in this case; but we want to come up with a method that will work for any set S.
So, we ask the question: Is x ∈ g(x)?
• Is 1 ∈ g(1) = {2}? The answer is no.
• Is 2 ∈ g(2) = ∅? The answer is no.
• Is 3 ∈ g(3) = {1, 2, 3}? The answer is yes.
We construct B ∈ P(S) by the following rule: If the answer to the question “Is
x ∈ g(x)?” is no then we put x ∈ B, but if the answer is yes then we leave x out of
B. Using the answers we had above, we see that B = {1, 2}.
Notice that B will not equal g(x) because if x ∈ g(x) then x ∈ / B, and vice versa.
Indeed, we see that
• 1∈ / g(1) but 1 ∈ B.
• 2∈ / g(2) but 2 ∈ B.
• 3 ∈ g(3) but 3 ∈ / B.
This forces B to be different from any element in the image.
One more example is in order, to test our understanding. Suppose that S =
{1, 2, 3} as above, and suppose h : S → P(S) is the function defined by the rule
h(1) = {2, 3}, h(2) = {2}, h(3) = {2, 3}. If we follow the same pattern as above,
asking the question “Is x ∈ h(x)?” and using the answers to define B, what set B do
we get? (Before looking at the answer, try this construction yourself.)
Answer: The set is {1}.
Remark 31.4. The set B is sometimes called the barber set. This is because there
is some connection with the following paradox: There lives a barber in a small town
who always obeys the rule that he will shave everyone in town who doesn’t shave
themselves, but if they shave themselves he will not shave them.
Does the barber shave himself? If he does, then he cannot shave himself by his
own rule. But if he doesn’t, then he must shave himself by his rule.
One way to resolve the paradox is to assume instead the barber does not live in
the town. This corresponds, roughly, to the fact that B is not in the image of the
function. N
We are now ready to prove the theorem in general.
31. INJECTIONS AND CARDINALITIES 233
Proof. Let S be any set. First, we prove that |S| ≤ |P(S)|, so we need to find an
injective function f : S → P(S). Define f by the rule f (s) = {s}. To prove that f
is injective, let a, b ∈ S and assume f (a) = f (b). Hence {a} = {b}. Therefore a = b,
since sets are equal exactly when they have the same elements.
Next, let g : S → P(S) be an arbitrary function. We will show that g is never
surjective, and hence there is no bijection between S and P(S). Define the (barber)
set as
B = {x ∈ S : x ∈ / g(x)}.
This is a subset of S, hence an element of P(S). We will show that B is not in the
image of g.
Let s ∈ S be arbitrary. There are two cases.
Case 1: Assume s ∈ g(s). In this case s ∈/ B, hence g(s) 6= B.
Case 2: Assume s ∈ / g(s). Then s ∈ B, hence g(s) 6= B.
In every case B 6= g(s). Since s ∈ S was arbitrary, this means B cannot be in the
image (since it does not equal any element of the image).
Proof. We must construct a bijection between the two sets P(S) and F(S). The
map is this: send a subset A ⊆ S to its characteristic function, χA : S → {0, 1}. In
other words, we define f : P(S) → F(S) by the rule
f (A) = χA .
We first show that f is injective. Let A, B ∈ P(S) and assume f (A) = f (B). We
then have χA = χB . Plugging in an arbitrary element s ∈ S, we have χA (s) = χB (s).
The left-hand side is 1 when s ∈ A and 0 otherwise, and similarly for the right-hand
side. Thus, s ∈ A if and only if s ∈ B. In other words A = B.
Finally, we show that f is surjective. Let ϕ : S → {0, 1} be any function. Put
A = {s ∈ S : ϕ(s) = 1}. We then check directly that ϕ = χA . (They have the same
domain and codomain, and the same rule.) Hence ϕ = f (A), so f is surjective.
234 CHAPTER VIII. CARDINALITY
Proof. The equality |P(N)| = |F(N)| follows from the previous theorem. We also
know |N| < |P(N)|, hence F(N) is uncountable.
31.C Exercises
Exercise 31.1. Answer each of the following true or false problems, proving your
answer.
(a) Every uncountable set has the same cardinality as (0, 1).
(b) Let A and B be sets. If A ⊆ B, then |A| ≤ |B|.
(c) For sets A and B, if A ( B, then |A| < |B|.
(d) Given sets A, B, and C, if A ⊆ B ⊆ C and both A and C are countably infinite,
then B is countably infinite.
(e) No subset of R has smaller cardinality than R.
(f) For sets S and T , if |S| < |T | and S is finite, then T is infinite.
(g) For sets S and T , if |S| < |T | and S is countable, then T is uncountable.
(h) For sets S and T , if |S| < |T | and S is countably infinite, then T is uncountable.
(i) For any set S, there exists another set T such that |S| < |T |.
Exercise 31.2. Let S = {a, b, c, d, e} and let g : S → P(S) be defined by the rule
g(a) = {b, d}, g(b) = {a, c, e}, g(c) = {a, c, d, e}, g(d) = ∅, g(e) = {e}. List the
elements of the barber set B = {s ∈ S : s ∈/ g(s)}. Why is it not in the image of g?
Exercise 31.3. Find a set with cardinality bigger than that of R. Then find a set
with cardinality bigger than that.
Exercise 31.4. Theorem 27.5 says that for finite sets A and B, if |A| = |B| and
f : A → B is a function, then f is injective if and only if f is surjective. Prove that
this fails for infinite sets, by proving the following:
(a) Find an infinite set S and a function f : S → S that is injective but not surjec-
tive.
(b) Find an infinite set S and a function g : S → S that is surjective but not
injective.
In both parts prove that the function you construct has the requisite properties.
Exercise 31.5. Let A and B be sets with f : A → B a bijection. Define a new map
g : P(A) → P(B) by the rule g(S) = {f (s) : s ∈ S}, where S ⊆ A is an arbitrary
element of P(A). Prove that g is a bijection.
Conclude that if |A| = |B| then |P(A)| = |P(B)|.
31. INJECTIONS AND CARDINALITIES 235
f (x) = {q ∈ Q : q ≤ x}.
Prove that f is injective. (Hint: For any two real numbers x < y, there is a rational
number strictly between them. See Exercise 11.6.)
Using this injection, in conjunction with the previous exercise, derive the inequal-
ity |R| ≤ |P(N)|.
Exercise 31.7. Let A and B be nonempty sets. Prove that there exists an injection
f : A → B if and only if there exists a surjection g : B → A. (Hint: For the backwards
direction, given a surjection g : B → A define a function f : A → B by the rule f (a) =
one of the elements which mapped to a.)
236 CHAPTER VIII. CARDINALITY
Remark 32.2. The story of how this theorem came to be is long and somewhat
convoluted. Cantor was the first to state the theorem, but apparently he had no
proof. The first proof (that we know of) was found by Dedekind, but he did not
publish his work at the time.
Schröder announced a proof, which was later shown to have an error. Finally, in
1897, Bernstein (who was only 19 years old, and a student of Cantor) presented a
proof. At nearly the same time Schröder independently found an error free proof as
well. Hence, these two mathematicians have their names attached to the theorem. N
A=A1 ∪ A2 ∪ A3 ∪ A4
h h h h
yh y 1 y 2 y 3 y 4
B=B1 ∪ B2 ∪ B3 ∪B4 .
The only information we have available comes from the two maps f and g that
we have given to us. We must somehow use the maps f and g to make any progress
on this problem. We might ask how these maps behave. Fix some element a0 ∈ A.
Applying f , we have a new element f (a0 ) ∈ B. We call this new element b0 . We can
think of a0 as the parent of b0 , because a0 gives rise to b0 (through the function f ).
We also call b0 the child of a0 .
32. THE SCHRÖDER–BERNSTEIN THEOREM 237
A B
a0 b0
There are some very important facts we need to know about this parent-child
relationship. First, every element in A is the parent of exactly one child in B because
f is a function. Second, it may be the case that some element of B is parentless,
because f may not be surjective. Third, every element in B which actually is a child
has exactly one parent in A, because f is injective.
We can also talk about elements of B having children, using the function g, and
the same facts we mentioned in the previous paragraph are still true.
Does b0 have a child? Yes! We can pass back over to A by applying the map g to
b0 . Set a1 = g(b0 ) ∈ A, which is the child of b0 . There are two cases.
Case 1: a0 = a1 .
A B
a0 b0
In this case, the maps f and g just send a0 and b0 back and forth to each other. Note
that a0 is its own grandparent! It seems very natural that in this case we would want
a0 and b0 to correspond under h.
Case 2: a0 6= a1 .
A B
a0
a1 b0
We can now repeat the parent-to-child process. Let b1 = f (a1 ) ∈ B which is the child
of a1 . Is it possible that b1 = b0 ? No! We have b0 = f (a0 ) 6= f (a1 ) = b1 , because f is
injective and a0 6= a1 .
Similarly, let a2 = g(b1 ) ∈ A which is the child of b1 . We see that a1 = g(b0 ) 6=
g(b1 ) = a2 , because g is injective and b0 6= b1 . However, we cannot tell whether a0 and
a2 are the same or different, so we again have two cases. We will separately consider
when a0 = a2 and when a0 6= a2 .
Case 2A: a0 = a2 . We picture this situation as follows:
238 CHAPTER VIII. CARDINALITY
A B
a0
a1 b0
b1
In this case, applying f and g sends the points a0 , b0 , a1 , b1 in a loop. (Here, each
element in the loop is its own great-great-grandparent.) It seems natural for a0 and
b0 to correspond, and for a1 and b1 to correspond, under h.
Case 2B: a0 6= a2 .
A B
a0
a1 b0
a2 b1
At this point it is recommended that the readers work out for themselves that if
we let b2 = f (a2 ), then b2 is different from b0 and b1 (by injectivity of f ). Similarly,
if we let a3 = g(b2 ), then the readers should show that a3 is different from a1 and a2
(by injectivity of g). Again we have two cases: a3 could equal a0 and we have a loop,
or it is a new element.
In general, for n ≥ 0, define bn = f (an ) to be the child of an , and define an+1 =
g(bn ) to be the child of bn . Working by induction one can prove that there are exactly
two options. First, these elements can end up in a loop with an+1 = a0 , where
a0 , a1 , a2 , . . . , an are distinct elements of A and b0 , b1 , b2 , . . . , bn are distinct elements
of B. The second option is that there is no loop, and so we have an infinite chain
of descendants: a0 , a1 , a2 , . . . are distinct elements of A and b0 , b1 , b2 , . . . are distinct
elements of B.
A B
a0
a1 b0
a2 b1
.. b2
. .. ..
. .
Our discussion has concentrated on passing from a parent to a child, but we can,
sometimes, reverse the process. Remember that elements can have at most one parent
(because f and g are injective). So, if our chain of descendants ends in a loop, then
when we go “backwards” up through the ancestors, we just cycle backwards through
the loop.
What happens in the case where an element a0 had a nonlooping chain of descen-
dants? If a0 has no parent, we can say that a0 is an ultimate ancestor, and we have
the entire chain of descendants and ancestors.
32. THE SCHRÖDER–BERNSTEIN THEOREM 239
However, if a0 does have a parent b−1 ∈ B, then our chain can be extended:
A B
a0 b−1
a1 b0
a2 b1
.. b2
. .. ..
. .
In this case, b−1 6= bn for any n ≥ 0, as depicted in the picture above. This is because
g(b−1 ) = a0 6= an+1 = g(bn ) and g is injective.
It is possible that b−1 has no parent, and hence is the ultimate ancestor at which
the chain stops. On the other hand b−1 could have a parent a−1 , and a similar
argument shows that a−1 does not equal any of a0 , a1 , a2 , . . ..
In total, we see that there are four types for the chain of descendants and ancestors
of an element:
(1) The chain forms a finite loop (of the type described above).
(2) The chain never loops and has an ultimate ancestor in A.
(3) The chain never loops and has an ultimate ancestor in B.
(4) The chain never loops and has no ultimate ancestor. (Thus, it is doubly infinite.)
We are now ready to describe a partition of A. We put A = A1 ∪ A2 ∪ A3 ∪ A4 where
a0 7→ b0 7→ a1 7→ b1 7→ · · · 7→ an 7→ bn 7→ a0 .
The element b0 = f (a0 ) belongs to the same loop, and hence b0 ∈ B1 . We define
h 1 = f | A 1 : A1 → B 1 .
240 CHAPTER VIII. CARDINALITY
32.C Examples
The Schröder–Bernstein theorem is not only beautiful symbolically, but also quite
useful because it is sometimes very easy to describe injections back-and-forth between
two sets A and B, yet it may be difficult to describe a bijection. Here are some
standard examples.
Example 32.3. We will prove that the closed interval [3, 10] has the same cardinality
as (0, 1).
Define f : [3, 10] → (0, 1) by the rule f (x) = (x − 2)/10. This is a linear function
with f (3) = 1/10 and f (10) = 8/10. So it maps [3, 10] into the interval [1/10, 8/10] ⊆
(0, 1) injectively.
On the other hand, the map g : (0, 1) → [3, 10] given by g(x) = x + 3 is also an
injection.
By the Schröder–Bernstein theorem, we are done. △
This next example is so important that we will call it a theorem.
Proof. In Exercise 31.6, we proved that |R| ≤ |P(N)|. (For an alternate proof of this
inequality, see Exercise 32.5 below.) By the Schröder–Bernstein theorem, it suffices
to now prove |P(N)| ≤ |R|.
Define f : P(N) → R by the rule f (A) = 0.χA (1)χA (2)χA (3) . . .. (For instance, if
A = {1, 3, 4, 7, 9, . . .} then f (A) = 0.101100101 . . . ∈ R.) It just remains to show that
this function is injective. Let A, B ⊆ N be arbitrary, and assume f (A) = f (B). Thus
0.χA (1)χA (2)χA (3) . . . = 0.χB (1)χB (2)χB (3) . . . .
32. THE SCHRÖDER–BERNSTEIN THEOREM 241
Since neither decimal expansion involves repeating 9’s, the two expansions are equal.
Hence χA (n) = χB (n) for each n ∈ N. This means that A and B have exactly the
same elements so A = B, which finishes showing that f is an injective function.
32.D Exercises
Exercise 32.1. Let X, Y , and Z be sets. Prove that if X ⊆ Y ⊆ Z and |X| = |Z|,
then |X| = |Y | as well.
Exercise 32.2. Prove that [5, 16) and (0, ∞) have the same cardinalities.
Exercise 32.4. Complete the proof in case 2 (of Subsection 32.B) of the Schröder–
Bernstein theorem, by showing that f |A2 is a function from A2 to B2 , and also that
it is bijective.
Exercise 32.5. In Exercise 31.6 we showed that |R| ≤ |P(N)|. Here is another way
to do that.
Define a function f : (0, 1) → P(N), by sending (the decimal expansion of) a real
number 0.a1 a2 a3 . . . (not ending in repeating 9’s) to the set
(For instance, 0.03193 . . . maps to {0, 30, 100, 9000, 30000, . . .} − {0}.) Prove that this
is an injective function.
242 CHAPTER VIII. CARDINALITY