Countability
Countability is a fundamental concept in set theory and mathematics that deals with the size and nature of sets. The idea that there are different kinds of infinities can be quite counterintuitive at first. However, understanding these distinctions is crucial. It helps us determine whether a set is finite, countably infinite, or countably infinite, providing insight into concepts like discrete and continuous (after all this course is called discrete mathematics). This understanding significantly influences how we can classify and think about different problems, particularly in computer science.
This chapter is one where you can truly get creative with proofs, and sometimes you have to. That's what makes proofs so rewarding — sometimes it's just about finding that neat idea. It requires a lot of practice to build up intuition and ideas that you can adapt to different cases. But this is what makes it so enjoyable - really, trust us :). Every problem is more or less unique. That's what makes proofs really rewarding - sometimes it's just this neat idea. Oftentimes people think this makes this chapter harder because, after all, there is no recipe to approach every problem. It's just a lot of practice that builds up some intuition and ideas you might be able to use and alter in different cases. But this really makes it super fun. Because every problem is really different. Not unlike the basics of set theory, where proofs always go by showing double-sided inclusion.
Definition 3.42:
- Two sets and are equinumerous, denoted , if there exists a bijection .
- The set dominates the set , denotes , if for some subset or, equivalently if there exists an injective function .
- A set is called countable if , and uncountable otherwise.
The central aspect of this chapter is to decide whether a given set is countable or uncountable. More precisely you need to find an injection/bijection or find some other way to show that there is none.
Theory
The proofs for the following theorems can be found in the script and won't be recited here.
Lemma 3.15:
- The relation is an equivalence relation.
- The relation is transitive: .
- .
The first point provides us with major intuition about countability. The proof follows quite immediately from composing two bijections and obtaining a new one. This is a central idea. These properties can be combined with proof-patterns to prove uncountability or countability.
Theorem 3.16: If and , then .
This is a rather extra theorem. Though, it's sort of intuitive. It somehow captures a notion of antisymmetry (however not in the sense that , but only ). It will probably be rarely or might never be the case in this course that it is easier to show that these two injections exist than that a bijection exists.
Theorem 3.17: A set is countable if and only if it is finite or if . This implies there is no cardinality level between finite and countably infinite sets.
Important Countable Sets
Theorem 3.18: The set , defined as of finite binary sequences, is countable.
This is a goto set to prove countability. Finding an injection to is often the base of a proof and combining this with Lemma 3.15 (Transitivity), we quickly obtain countability.
Theorem 3.19: The set of ordered pairs of natural numbers is countable.
Corollary 3.20: The Cartesian product of two countable sets and is countable, i.e., .
Corollary 3.21: The set of rational numbers is countable.
Theorem 3.22: Let and for be countable sets.
- For any , the set of -tuples over is countable.
- The union of a countable list of countable sets is countable.
- The set of finite sequences of elements from is countable.
This is another very central theorem and in the case of certain involved set operations, should be considered as a starting point for proving that some complicated set is countable.
Definition 3.43: Let denote the set of semi-infinite binary sequences or, equivalently, the set of functions .
Just in case you are wondering: Why are they called semi-infinite? This is because they go on infinitely in one direction. This is often super useful. We can think about functions as infinite
There is a major difference between the set of semi-infinite bitstrings and .
The set represents all finite sequences (or strings) of bits, including the empty string. Each string in has a finite length, and the set is countably infinite because we can list all possible finite bitstrings in a sequence.
On the other hand, the set of semi-infinite bitstrings consists of all sequences of bits that extend infinitely in one direction. Each bitstring in this set has an infinite length, and the set is uncountably infinite.
For example we have but . But (the semi-infinite string of 's).
Theorem 3.23: The set is uncountable.
This theorem is central and a thought about the uncountability of should be a possible starting point for any uncountability proof.
Computability
Definition 3.44: A function is called computable if there is a program that, for every , when given as input, outputs .
Corollary 3.24: There are uncomputable functions
How to approach problems?
Countable or Uncountable
Determine whether the set you have is countable or uncountable. This requires you to first really understand what's going on in your set. Think about similar examples and similarities to known sets (often finding these similarities will directly lead you to the injection, which you have to find anyway).
Uncountablility Proofs
You can only start once you more or less understand what's going on in your set.
The following pattern is a common pattern and surely cannot be used in every case. However, oftentimes when having an uncountable set, you can find an injection from the set , which is known to be uncountable. You could of course also use something like or , which might be easier sometimes. Also, the order below is not fixed and the proofs can look way different than the form below and still be correct. The purpose of these steps below is more to give you a structure of how one could approach problems involving proofs of uncountability.
Let be the set you want to prove to be uncountable.
1. Finding the injection
The first and probably most difficult step is to find an injection:
The intuition here is that you somehow have to encode all the information of a bitstring in its image . We want to sort of be able to reconstruct from uniquely. More formally this is exactly the definition of an injection. Namely, for arbitrary we want to have:
This is just the definition of injectivity. You have to carefully think about this when choosing , to then later prove that it is indeed the case. In this first step, the most important thing is, that you really precisely write down the definition of your function and how it maps the bitstring to elements of .
2. Proving that your function is a function
Now that you thought about your function it should be clear to you that you have constructed something that is indeed a function. However you still have to prove or at least write some justification for why the following properties are fulfilled, because this is not obvious in many cases:
-
Does your function actually map to elements from and not something else? You defined your function to be a map from however, is it actually the case that for each , ?
-
Is your function actually a function? Argue why it is well-defined and totally-defined (definition of a function).
This step can in some cases already be quite demanding, in other cases it can also be quite short.
3. Proving injectivity
This is more or less the central part of your proof. Here you have to show that what you defined is actually injective. To do this, the definition of injectivity is basically everything we have to show. Two common ways are:
- Let be arbitrary such that . Then we have
Therefore, is injective.
As you can see, this is just the direct method of proving that fulfills the definition.
- Let be arbitrary such that . Then we have
Therefore, we have proven indirectly that is injective.
As you can see, this is just the contraposition of the definition of the injectivity of (see proof pattern of indirect proof).
The difficulty in this step is to provide precise and detailed justifications.
4. Punchline
Now we can actually apply definition 3.42 to obtain . However, it is not immediate how this implies that is uncountable, as we need to show that not . There are multiple ways how one could argue this. An easy way is to assume that is countable () and that . Then we obtain with Lemma 3.15 (Transitivity) that , which is false as proven in lecture via Cantor's diagonalization argument (we obtain a contradiction). Therefore, must be uncountable.
See the exercise "This seems odd" for an application of this pattern.
Tricks
Often you can try out some handy tricks when tackling countability exercises. Many students think that you should skip countability problems in the exam, but if you have a good overview over the theorems, lemmas and corollaries, equipped with some techniques, experience and tricks, the idea to some of those problems can get to you pretty fast. Often you can combine those with constructing a specific injection.
The Complement Trick
To prove that a given set is uncountable, find an uncountable set such that and prove that is countable.
Intuitively this corresponds to, instead of directly proving that a set is uncountable, proving that it is part of a huge set, in which the complement of is very small (countable). Then this means is very big, because if it was not would not be very big. Translating this into a more formal language:
In the following we prove the validity of this pattern: Assume towards a contradiction that is countable. is countable by Theorem 3.22. But notice that . Hence we have that is countable, a contradiction.
For a simple application of this pattern we prove that is uncountable. Consider (which we know is uncountable). By definition we have . We have that . Now we know that and by Lemma 3.15 (iii) hence and by transitivity of we have that which means that is countable. Now we can directly use the complement trick (which you would have to prove in an exam) to conclude that is uncountable.
If you see a countability problem where a direct proof of uncountability doesn't come to mind, you can think about the complement, at many times this is much easier :)
Fundamental Theorem of Arithmetic
Often when working with natural numbers, one can apply the fundamental theorem of arithmetic (i.e. that every natural number can be uniquely factored into a product of prime powers).
For example, one can very easily create an injection . If we have , then . Since for every number the exponents of primes in the prime factorization are unique we have that which means that is injective.
This can expedite many injection constructions, but can also lead to some problems if applied incorrectly as shown in the following:
One could allege that the following is an injection: where where where corresponds to the 'th prime. Now we could "prove" the same way as above that this is an injection. But this would mean that is countable which is not the case, right? The issue here is that does not necessarily converge. If for distinctly infinite the product will be infinity which is not in , so is not a function. Often this can constitute a trap when using the fundamental theorem of arithmetic to construct an injection to .
Exercises
Points in the PlaneDifficulty: 1/5Relevance: 🎓🎓🎓Source: Tobias Steinbrecher
Prove that the set of all points in the plane with rational coordinates is countable.
This seems oddDifficulty: 2/5Relevance: 🎓🎓🎓🎓Source: Tobias Steinbrecher
Prove or disprove that the following set is uncountable
Classy CountingDifficulty: 2/5Relevance: 🎓🎓🎓🎓Source: Philipp Barski
Prove the following. Let be an uncountable set. Let be an equivalence relation over . Prove that or for some are uncountable.