6.7 Finite, countable and uncountable sets
Recall the definition of cardinality that we saw in Block 2:
See 4.16
This definition tells us that sets and have the same cardinality if there exists a bijection between and . So functions can help us compare the size of sets!
Theorem 6.50.
Let and be finite sets and let be a function.
-
1.
If is injective, then .
-
2.
If is surjective, then .
-
3.
If is bijective, then .
Proof.
-
1.
Since is finite, we can list its elements as where . If is injective, then the elements are distinct, so there are exactly elements in the set . Since this is a subset of , the set must have at least as many elements as , so .
-
2.
Since is finite, we can list its elements as where . If is surjective, then for each , we can choose some such that . The elements of are distinct, since if then by the definition of a function i.e. , hence . Thus, has at least distinct elements, giving .
-
3.
This follows by combining (1) and (2).
As we can also define functions on infinite sets, we can generalise these ideas to infinite sets too.
Definition 6.51 (Countable and uncountable sets).
A set is said to be countable if it is finite or if there is a bijection from to .
An infinite countable set is said to be countably infinite.
A set that is not countable is said to be uncountable.
It follows almost immediately from the definition that the set itself is countably infinite. Indeed, the identity function is a bijection from to itself.
Proposition 6.52.
Every subset of is countable.
Proof.
Suppose is a subset of . If is finite then, by definition, it is countable and the proof is complete. If is an infinite proper subset of then the elements of can be listed in order starting with the smallest; write where . Then define by . The function is bijective.
Exercise 6.53.
Explain why as defined in the proof of Proposition 6.52 is bijective.
Solution (please try for yourself before looking)
The function defined by is injective because and so . That is, if then . We can see is surjective because and thus for every ,
It may seem intuitive to you that every subset of is countable. But less intuitively, it is also possible for sets that contain as a proper subset to be countable too!
Example 6.54.
We will show that is countable by defining a bijection between and .
Consider the function which is defined by:
Notice that , , and so on.
To prove that is bijective, we need to show that it is both injective and surjective.
To show that is injective, we need to show that if for , then .
So, suppose such that . Then, is either even or odd. If is even, then . Rearranging, we get as desired.
Alternatively, if is odd, then . Again, rearranging gives .
This completes the proof that is injective.
To show that is surjective, we need to show that for all , there is some such that .
Let . If is non-negative, then we can take . Note that is an odd natural number so as desired.
On the other hand, if is negative, then we can set . Then is an even positive number and hence a natural number. We have .
Therefore is surjective.
As is both surjective and injective, it is bijective.
Since such a bijection exists, this means that is countable.
In fact, as the next theorem states, if we want to show that an infinite set is countable, it turns out that proving there exists a surjection from to is enough because Proposition 6.52 does the rest of the work for us. We don’t have to go the extra mile to prove the existence of a bijection in this case.
Theorem 6.55.
Let be any infinite set. The following are equivalent:
-
(i)
is countably infinite;
-
(ii)
there is a surjection from to ;
-
(iii)
there is an injection from to .
Proof.
-
•
(i) (ii): If is countably infinite then, by definition, there is a bijection from to . This function is surjective.
-
•
(ii) (iii): Suppose is surjective. Then, for any , the set is nonempty and so has a unique smallest element, call it . Then defined by is injective. [Check that you understand why!]
-
•
(iii) (i): Suppose is injective. Then, since is an infinite set and no pair of elements in are mapped (under ) to the same natural number, is an infinite subset of and is therefore countable by Proposition 6.52.
Exercise 6.56.
Prove that any subset of a countable set is countable.
Solution (please try for yourself before looking)
Let be a countable set and suppose is subset.
If is finite then so is , and so is also countable.
If is countably infinite then, by Theorem 6.55, there exists an injection . We claim that the function such that for all is also an injection. Indeed, suppose such that . Then, and, since is an injection, this means that . Thus is an injection and, by Theorem 6.55 again, this means that is countable.
Exercise 6.57.
Let be any set and suppose is a countably set. Prove that if there is a bijection then is also countable.
Solution (please try for yourself before looking)
Suppose and are sets where is a countable set and suppose there exists a bijection . Since is countable. There exists a bijection . By Proposition 6.47, this means is a bijection and hence, is countable.
Countability is also preserved when we take the Cartesian product of two countable sets.
Proposition 6.58.
The set is countable.
Proof.
Let be defined by the following rule. Given , by the Fundamental Theorem of Arithmetic we can write where is as large as possible. (In other words, factorise as a power of multiplied by an odd integer.) Let be the function that maps to . Then is a bijection [As an exercise, you should prove this], and thus is countable.
Exercise 6.59.
Prove that the Cartesian product of two countable sets is countable.
Solution (please try for yourself before looking)
Suppose and are countable sets, with bijections and .
Let be defined by the following rule. Given , by the Fundamental Theorem of Arithmetic we can write where is as large as possible. (In other words, factorise as a power of multiplied by an odd integer.) Let be the function that maps to .
Let’s define the function where for every . We claim that is a bijection. Indeed, for every where , we have
which means that and , since and are injections. Hence, and thus, is an injection. Also, for every , the surjectivity of and means there exists some such that and . Thus, . Hence, is surjective.
Thus, is bijective and so, since is countable, 6.57 tells us that is also countable.
Exercise 6.60.
Prove that a set with an uncountable subset is uncountable.
6.7.1 The set of real numbers is uncountable
Theorem 6.61.
The set is uncountable.
Proof.
Suppose is a function. We know from Block 1 that every real number in has a non-terminating decimal representation. So we may write:
where for all .
We shall construct a real number in the interval that is not on this list, proving that is not surjective, and so cannot be a bijection.
Let be the real number with decimal representation ‘’ where
for every .
Then certainly because . Moreover, for every , because differs from .
Thus is not surjective and so cannot be a bijection.
The above proof uses a technique known as Cantor’s diagonal argument.
Corollary 6.62.
The set of real numbers is uncountable.
Proof.
For a contradiction, assume there is a bijection . We claim that the function defined by is a bijection.
Indeed, if such that , then we have
which means that since is injective. So is injective.
Also, if , then
and thus there exists some such that since is surjective. Thus,
and hence is surjective.
Therefore is a bijection by Proposition 6.47, and so is countable. This contradicts Theorem 6.61, and so no such function can exist.