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.
Why the ternary series and its tail estimates exist
Use the complete ordered real field of §4.1 and . For digits define the finite sums . The finite geometric identity
follows by multiplying the sum by three and subtracting. Hence and the are nondecreasing. Completeness gives . For every , some , and then for all . This proves convergence to directly from the supremum property; no unproved convergence theorem is being invoked.
For a fixed and , the finite tail is at most . The supremum of over is still , since all omitted partial sums are no larger than . Taking the supremum of the finite tails therefore shows that the infinite tail after digit lies in . Thus the difference between two such tails has absolute value at most , while a first differing digit contributes . This justifies the strict comparison below, including endpoint-valued sums.
For later short-cover estimates we also need when . Completeness implies that the natural numbers are unbounded: if they had supremum , a natural would give . Put . Induction gives , because the induction step adds the nonnegative term . Therefore , and unboundedness of the natural numbers makes the last bound smaller than any positive tolerance. In particular both and tend to zero.
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.
Proof X-ray
Why base three makes the injection work
The injection rests on one inequality: a first differing digit must outweigh everything after it. With digits and in base three, the first difference is , while two tails can differ by at most , so a gap always survives. In base two with digits and , the leading difference can be cancelled exactly by a tail: and both give the value . Completeness is used only to make each sum exist; the uncountability itself comes from the diagonal theorem.
Cantor's diagonal theorem above can be traced on a finite membership table. Each row records a listed subset , the diagonal entries record whether , and reversing them produces , which disagrees with row at column . Six rows illustrate the rule; the theorem is the statement that the same reversal defeats every row of every proposed listing.
Change the diagonal entry in every row
Step through the rows. In row k, T takes the opposite of the diagonal entry, so T and f(k) differ at k.
| f(k) | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| f(0) | 1 | 0 | 1 | 0 | 1 | 0 |
| f(1) | 1 | 1 | 0 | 1 | 0 | 1 |
| f(2) | 0 | 0 | 1 | 1 | 0 | 0 |
| f(3) | 1 | 0 | 0 | 0 | 1 | 0 |
| f(4) | 0 | 1 | 0 | 0 | 1 | 1 |
| f(5) | 0 | 0 | 0 | 0 | 0 | 0 |
| T | 0 | 0 | 0 | 1 | 0 | 1 |
1entries compared in this row0diagonal entry n = k
- Diagonal entry of f(k)
- :
- Entry of T at k
- :
, ; .
NoticeA 1 means membership and a 0 means non-membership. Define . For any row , its diagonal bit is opposite to the bit of at , hence . The six columns are only a finite illustration: the proof applies to every natural number, with no final row.
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.
Worked example 5.1.1
(A formula for the listing of the integers)
The listing is the function given by
So , , , . Every is of exactly one of the forms or with , so is a well-defined function.
Injective. Positive values come only from odd inputs, negative values only from even inputs , and only from . Within the odd inputs, gives ; likewise for even inputs. Surjective. A positive integer equals , a negative integer equals , and . Hence is a bijection and is countably infinite.
Worked example 5.1.2
(Positions in the diagonal listing of )
List by and, within each diagonal, by :
Number the positions from . The diagonals before diagonal contain pairs, and within diagonal the pair is preceded by the pairs with smaller first coordinate. Hence
For , and , matching the ninth entry of the list above. Conversely, to find the pair at position , take the largest with , namely (base ); the offset gives and , so the pair is . Since every position decodes to exactly one pair in this way, is a bijection : the claim that only finitely many pairs precede a given pair is now an explicit count.
Worked example 5.1.3
(The finite subsets of form a countable set)
For , let be the set of all subsets of . It is finite, with elements, and it can be listed explicitly, for example by the binary number of each subset . Every finite subset lies in for (and ). Hence the collection of finite subsets is , a countable union of sets with specified listings, and the union theorem makes it countable.
Combined with Cantor's theorem this gives more: is uncountable, its finite members form a countable part, and so, by the fourth practice problem below, the infinite subsets of already form an uncountable set.
History of an idea
From nested intervals to the diagonal
MacTutor's biography of Georg Cantor reports that in 1873 he proved the rational numbers countable, and also the algebraic numbers, the real roots of polynomial equations with integer coefficients; the biography adds, citing a historical study, that his proof did not acknowledge significant contributions from Dedekind. By December 1873 Cantor had proved that the real numbers are not countable, and he published this in 1874. MacTutor's history topic on the beginnings of set theory describes that 1874 proof as an argument with nested intervals, more complex than the one used today, and states that the argument used today is due to Cantor in a later paper of 1891. The same account reports that the 1878 paper introduced sets of the same "power", those that can be put in one-one correspondence, and that Cantor introduced the word "countable" in a paper of 1883.
The order of these steps matches the order of this note. Listings come first: products and rationals are counted by explicit enumerations. The contradiction comes second, and in its later form it needs no interval geometry at all: from any proposed listing one builds an object that differs from the th entry at the th place, which is exactly the set in Cantor's theorem above.
Quick check
(Let and , , . Compute Cantor's set and check that it is not a value of .)
Decide for each separately whether .
Solution · Answer
, and , so . The values of are , and , none equal to . As the proof predicts, differs from at , from at and from at .
Quick check
(Is the set of ordered triples of integers countable?)
Write a triple as a pair whose first entry is a pair.
Solution · Answer
Yes. Identify with , so corresponds to . Since is countable, is countable by the product argument, and applying it once more makes countable. This is the fixed finite product case.
Quick check
(In the diagonal listing of (positions numbered from ), which pair is at position , and at which position does appear?)
Use .
Solution · Answer
The largest with is , with base ; the offset gives , , so position holds . For , and .
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.