Countable and Uncountable Sets
Learning objectives
- Prove is countable by exhibiting an enumeration
- State and apply Cantor's diagonal argument to show is uncountable
- Decide whether a given set is countable or uncountable
- Appreciate the philosophical and computational consequences of multiple sizes of infinity
Are there different sizes of infinity? Until 1874, mathematicians implicitly treated "infinite" as a single, undifferentiated label — an infinite set was simply "not finite," with no further structure. Then Georg Cantor proved that the set of real numbers cannot be put in bijection with the natural numbers, no matter how clever the proposed listing. His proof — the diagonal argument — is one of the most influential ideas in modern mathematics. It splits infinity into a hierarchy: for the countable infinities (, , ) and strictly larger cardinalities for sets like and . The same diagonal trick later powered Russell's paradox, Gödel's incompleteness theorems, and Turing's undecidability of the halting problem — arguably the three deepest results of 20th-century logic.
is countable
The rationals are dense in — between any two reals you can find infinitely many rationals — yet surprisingly they are still countable. The standard trick lists the positive rationals on a two-dimensional grid: cell holds . Then we traverse the grid diagonally:
Skipping duplicates (e.g., ), we obtain an enumeration of . Interleaving with negatives and zero gives an enumeration of . Therefore .
Cantor's diagonal argument: is uncountable
Theorem (Cantor, 1891). The open interval is uncountable; consequently so is .
Proof. Suppose for contradiction that some function is a surjection (enumerates every real in ). Write each in decimal:
(and so on, where is a decimal digit). Now construct the number by the diagonal rule: pick to be any digit different from — say if , otherwise (this also avoids the ambiguity).
Then , but for every , because and differ in the -th decimal place. So cannot be surjective — contradiction. Therefore no such enumeration exists, and is uncountable.
The cardinality of is denoted ("the continuum") and we have just proved . There is no biggest infinity either: Cantor's theorem says for every set , so the chain never terminates.
Closure properties of countability
A handful of facts together justify nearly all countability proofs in practice:
- Every subset of a countable set is countable.
- A countable union of countable sets is countable (use the same diagonal trick on a list of lists).
- is countable (Cantor's pairing function from the previous section).
- The set of finite strings over a finite alphabet is countable — the basis for "there are only countably many programs."
- The set of all infinite binary sequences is uncountable, by exactly the same diagonal argument.
Pause and think: The rationals are dense in — between any two reals there are infinitely many rationals. Yet . How can a dense subset be strictly smaller? (Hint: "dense" is about topological distribution, not about cardinality. The set has plenty of "room" between every pair of reals, but it skips over uncountably many irrationals at every point.)
Try it
- Before reading further: a friend hands you the "list" , , . Construct a real in not on the list by changing the diagonal digits. Then explain why your construction always works, no matter what list is presented.
- Predict first: is the set of algebraic real numbers (roots of polynomials with integer coefficients) countable or uncountable? Why?
- The set of all infinite binary sequences is uncountable. Adapt the diagonal argument from decimals to binary sequences.
- Prove that the irrationals are uncountable. (Hint: write and use that a countable union of countable sets is countable.)
- The set of finite subsets of is countable; the set of all subsets of is uncountable. Where does the boundary lie? (Think about the difference between finite descriptions and infinite ones.)
A trap to watch for
Beginners often mentally translate "uncountable" as "really really big finite." That is wrong on two levels. First, an uncountable set is not finite at all — it has infinitely many elements. Second, "uncountable" is a specific structural claim: there is no surjection at all, no matter how the elements are arranged. It is not that the listing would be "too long"; it is that every listing must miss something (and Cantor's diagonal explicitly produces the missing element). The right mental model is not "more numerous" but "structurally beyond enumeration." This is also why being dense in does not make uncountable: density is geometric, countability is combinatorial, and the two notions can disagree.
What you now know
You can prove countable by an explicit enumeration, prove uncountable via Cantor's diagonal argument, and apply the closure facts (subsets and countable unions of countable sets remain countable; always strictly exceeds ). In the final section we get the most powerful tool for comparing infinite cardinalities — the Cantor-Schröder-Bernstein theorem — which lets us conclude from a pair of injections without ever constructing a bijection explicitly.
References
- Velleman, D. J. (2019). How to Prove It: A Structured Approach (3rd ed.). Cambridge University Press, ch. 8.
- Cantor, G. (1891). "Über eine elementare Frage der Mannigfaltigkeitslehre." Jahresbericht der Deutschen Mathematiker-Vereinigung, 1, 75–78.
- Halmos, P. R. (1960). Naive Set Theory. Springer.
- Jech, T. (2003). Set Theory: The Third Millennium Edition. Springer.
- Aigner, M., Ziegler, G. M. (2018). Proofs from THE BOOK (6th ed.). Springer (Cantor diagonal chapter).