Proof that the Rationals are Countable
One of the most surprising results in set theory is that the rational numbers , despite being dense in the real line, have the same cardinality as the natural numbers. This stands in stark contrast to the real numbers, which are uncountable. The proof illustrates powerful techniques for showing countability.
The set of rational numbers is countably infinite, i.e., .
We will construct an explicit bijection between and , though showing that is countable only requires an injection into or a surjection from .
Method 1: Cantor's Enumeration
Every rational number can be written uniquely in lowest terms as where and . We arrange the positive rationals in an infinite array:
where row and column contains . We enumerate by following diagonal paths (Cantor's diagonal argument):
Skipping duplicates (like ), we get an enumeration of all positive rationals. Including and negative rationals (by interleaving), we obtain an enumeration of all of .
Method 2: Pairing Function
Define the height of a rational in lowest terms (with ) as . For each finite height , there are only finitely many rationals of height . List all rationals in order of increasing height, breaking ties arbitrarily:
- Height 1:
- Height 2:
- Height 3:
- Height 4:
- ...
This produces an enumeration , giving a bijection from to .
Method 3: Using Cantor Pairing
The Cantor pairing function is a bijection defined by:
This function is bijective, showing .
Now, the positive rationals are in bijection with via (not injective, but surjective). Since there is a surjection from onto , and , we have . Combined with the obvious injection , Schröder-Bernstein gives .
The key insight is that can be organized into a sequence of finite layers (by height or diagonal), allowing systematic enumeration. This strategy works for any countable union of countable sets—a general theorem we prove next.
If is a countable collection of countable sets, then is countable.
For each , since is countable, there is an enumeration (possibly finite). Arrange these in an array:
Enumerate by diagonals as before. This gives a surjection , proving the union is countable.
Using the theorem that countable unions of countable sets are countable:
-
Algebraic numbers: The set of roots of polynomials with rational coefficients is countable (countable union over degree, each degree is countable)
-
Finite sequences: The set of all finite sequences of natural numbers is countable: is countable
-
Computable reals: The set of Turing-computable real numbers is countable (countable number of Turing machines)
-
Rational points: The set (n times) is countable for any finite
The proof that countable unions of countable sets are countable requires the axiom of countable choice, a weak form of the axiom of choice. Without it, we cannot guarantee that each countable set has an enumeration simultaneously. This shows that even seemingly elementary results in set theory can depend on choice principles.
In contrast to , the real numbers are uncountable: . In fact, .
Cantor's diagonal argument: Suppose were countable with enumeration . Write each in decimal expansion. Construct a new real by ensuring its -th decimal digit differs from the -th digit of . Then for all , contradicting completeness of the enumeration.
We now have an infinite hierarchy of cardinalities:
The continuum hypothesis (CH) conjectures that there is no cardinality strictly between and , i.e., . Kurt Gödel and Paul Cohen showed that CH is independent of ZFC: it can neither be proved nor disproved from the standard axioms.
The countability of and uncountability of reveal the subtle and counterintuitive nature of infinity. Despite being dense in , it has "measure zero" from the perspective of cardinality. These results form the foundation for modern analysis and topology.