Learning goals and conventions
Compare finite and infinite sets by functions rather than by visual size; enumerate products and rational numbers; write a complete diagonal contradiction. We use . A set is countable if it is finite or can be listed as a sequence with every element occurring. It is countably infinite if it is in bijection with . Repeated elements in a listing can be removed by retaining their first appearances; an infinite listed set then has an enumeration without repetition.
A subset of a countable set is countable: scan the enumeration and keep only members of the subset. For , order pairs by and then by within each diagonal. There are finitely many pairs before any fixed pair, and every pair appears. Hence a product of two countable sets is countable by applying their enumerations to this diagonal list. This argument extends to every fixed finite product, not to a countably infinite product.
Theorem: countable unions with specified enumerations
If for each a set has a specified listing (finite lists are allowed), then is countable.
Proof. List index pairs diagonally. At each pair, output the th element of if it exists, and otherwise skip that pair. Every element belongs to some and appears at a finite position in its list, so it appears in the output. Remove repeated appearances if needed. Empty sets contribute no elements. The statement explicitly supplies enumerations; selecting infinitely many unspecified enumerations involves additional foundational choice questions not needed here.
Thus is countable via , and is countable by listing numerator–positive-denominator pairs and outputting their fractions. Distinct pairs may represent the same rational; duplicates do not prevent countability.
Theorem: Cantor's diagonal theorem
No map is surjective, for any set .
Proof. Given such a map, form . If for some , then holds exactly when , a contradiction in either case. Thus is missing from the range. In particular cannot be listed by the natural numbers.
To connect this to real numbers without ambiguous decimals, map to
If first differ at , the leading difference has magnitude while all later terms together have magnitude at most . Therefore . This injects the uncountable power set into , so the interval and are uncountable. The argument avoids relying on uniqueness of decimal representations.
Worked examples
An infinite subset can have the same size. The map bijects with the even nonnegative integers. Infinite sets can be equinumerous with proper subsets; finite intuition about leftover elements is not a proof of smaller cardinality.
Algebraic real numbers are countable. Integer polynomials form a countable union of finite tuples of integers, one tuple length per degree. Each nonzero polynomial has finitely many real roots. Using a deterministic order on its finite real root set, the union theorem makes the collection of all algebraic real numbers countable. Since is uncountable, nonalgebraic (transcendental) real numbers exist; this proof does not identify a particular one.
Graded practice
- Foundation. Give a bijection from to the positive odd integers.
- Core. Prove that is countable.
- Core. Show that the set of finite binary strings is countable, but the set of infinite binary sequences is uncountable.
- Proof. If is uncountable and is countable, prove is uncountable.
Full solutions
- The map is injective, and every positive odd integer has exactly that form, so it is a bijection.
- Choose a listing of rationals. Feed its index pairs through a diagonal enumeration of and output the corresponding rational pairs. Every pair appears; repetitions may be removed.
- For each length there are strings. Listing by length, then lexicographically, enumerates all finite strings. An infinite binary sequence is the indicator of a subset of . Cantor's theorem shows that those subsets, hence those sequences, cannot be listed.
- If were countable, a listing of it interleaved with a listing of would list their union , contradicting uncountability. Therefore the complement cannot be countable.
Summary and term definitions
An enumeration lists every element; a bijection pairs elements uniquely in both directions. A diagonal argument constructs an object differing from the th proposed entry at a controlled th feature. Algebraic numbers solve nonzero integer polynomial equations. Countability is preserved by fixed finite products and by enumerated countable unions, but not by infinite binary products.