© 2026 NeckPinch · www.neckpinch.com · All rights reserved.
Course 2Book 2A: Numbers, Limits and the IntegralChapter 8
Infinite Sets
Countable and uncountable sets, the diagonal argument, and where the axiom of choice will be needed.
Read with Tao, Analysis I, chapter "Infinite sets" (countability, summation on infinite sets, uncountable sets, the axiom of choice, ordered sets), together with the last section of "Set theory" (cardinality of sets).
The last two chapters measured infinity in one way: how big an infinite sum is. This chapter measures it in another: how many elements an infinite set has. The answer, found by Georg Cantor in the 1870s and 1880s, is that there are different sizes of infinity. The rationals and the natural numbers have the same size, even though the rationals seem far more numerous. The real numbers have strictly more.
This is the lightest chapter of Book 2A in terms of what later courses use directly, and it is honest to say so. Three things from it do matter. Countability is what makes the measure theory of 3A.1 The Problem of Measure work: countably many small sets can be ignored, uncountably many can't. Uncountability of explains why almost every real number can't be computed. And the axiom of choice is the silent assumption behind several theorems of functional analysis and topology, so it is worth knowing where it enters.
By the end of this chapter you will be able to:
- compare the sizes of sets with bijections, and use the pigeonhole principle;
- prove that , and are countable;
- prove, by Cantor's diagonal argument, that is uncountable;
- explain what the axiom of choice says, and recognise where later theorems depend on it.
Same size means a bijection
How do you know two collections have the same size without counting them? Match them up. If every seat in a theatre is taken and nobody is standing, there are as many people as seats, and no number needs to be known. Cantor took this as the definition of equal size, and applied it to infinite sets as well.
Two sets and have equal cardinality if there is a bijection (2A.2 Sets, Functions and Equivalence). A set has cardinality , for a natural number , if it has equal cardinality with . It is finite if it has cardinality for some , and infinite otherwise.
For finite sets this agrees with counting, and Tao proves carefully that a finite set has exactly one cardinality. The proof rests on a principle so obvious it is easy to overlook.
If , there is no injective function from a set of cardinality to a set of cardinality . Equivalently, if objects are placed in boxes with , some box contains at least two.
The proof is an induction on (Exercise 8.11).
A lossless compression program, such as the one inside every ZIP file, must be injective: two different files must compress to different outputs, or decompression couldn't tell them apart. The pigeonhole principle shows that no such program can make every file smaller. There are different files of exactly bits, but only files shorter than bits. So at least one file of length cannot be shortened, and if some files get shorter, others must get longer. Compressors work in practice because real data (text, images, audio) is highly non-random, and they are designed to shrink the files people actually have, at the cost of slightly enlarging random-looking ones.
Infinite sets are different
For infinite sets the matching definition produces results that defy intuition. Galileo noticed one in 1638, in his Two New Sciences: the squares can be matched one-to-one with the natural numbers (), although most natural numbers are not squares. Galileo concluded that "equal", "greater" and "less" do not apply to infinite collections. Cantor concluded instead that an infinite set can have the same size as a proper part of itself, and that this is what being infinite means.
Countable sets
A set is countably infinite if it has the same cardinality as , and countable if it is finite or countably infinite. Otherwise it is uncountable.
A set is countable exactly when its elements can be listed as a sequence (possibly with repeats, if the set is finite) that eventually reaches every element. That reformulation makes the next results easy to see.
- Every subset of a countable set is countable.
- is countable.
- is countable.
- is countable.
Proof. (1) List the elements of the big set and keep only those in the subset. (2) List . (3) List the pairs by increasing , and within each diagonal by increasing : ; ; ; … (Figure 8.3). Each pair is reached after finitely many steps. An explicit formula is Cantor's pairing , a bijection from to . (4) Every rational is for some integers and , so is the image of a subset of , which is countable by (2) and (3). An image of a countable set is countable (list the images, skip repeats).
That is countable is the most surprising statement here. The rationals are dense (2A.3 Integers and Rationals): between any two there are infinitely many more, yet they can all be put in a single list.
Summing over a countable set
2A.7 Series showed that the value of an infinite sum can depend on the order of its terms, unless the sum converges absolutely. That makes it possible to sum over a countable set with no given order.
Let be countably infinite and . If for some (equivalently, every) bijection the series converges absolutely, then the sum doesn't depend on . It is written .
This is the rearrangement theorem of 2A.7 Series in different words. It gives meaning to sums like , with no preferred order of the pairs. For absolutely summable double sums, adding by rows, by columns, or along any listing gives the same answer, the infinite version of the double-sum swap (Exercise 8.16).
Uncountable sets
Is every infinite set countable? Cantor's answer, first published in 1874 and in its best-known form in 1891, was no. The 1891 argument is short enough to give in full.
The interval , and hence , is uncountable.
Proof (Cantor's diagonal argument). Suppose, for contradiction, that the numbers in could be listed as . Write each in decimal, choosing the expansion that doesn't end in an infinite string of $9$s:
Now build a new number digit by digit, changing the diagonal: let if , and if . Then , its expansion has no $9$s, and it differs from each in the -th decimal place. So is not on the list, contradicting the assumption that the list contained every number in .
The careful choice of digits ( and , never or ) avoids the one subtlety of decimals, that (2A.4 The Real Numbers), so that "different digits" really does mean "different numbers".
The same idea proves a much more general theorem, with no decimals in sight.
For every set , there is no surjection from onto its power set , the set of all subsets of . So is strictly larger than .
Proof. Let be any function. Consider . If for some , then exactly when , a contradiction. So is not in the image of .
This is the diagonal argument with the table hidden. Row is the set , and is built to disagree with row about the element . It also echoes Russell's paradox from 2A.2 Sets, Functions and Equivalence, which has the same self-referential shape. Applying the theorem repeatedly gives an unending ladder of infinite sizes: , , , …, each strictly bigger than the last. The set has the same cardinality as (Exercise 8.14).
If there are injections and , then and have equal cardinality.
The theorem is intuitively obvious ("each is at most as big as the other"), but its proof requires a genuine construction, building a bijection out of pieces of the two injections; Tao gives it as an exercise with hints. It is the practical tool for comparing cardinalities: to show and have the same size, for instance, it is enough to inject each into the other (Exercise 8.15).
In 1936 Alan Turing defined a real number to be computable if some machine following a finite program can print its decimal expansion, digit after digit, forever. Every computer program is a finite string of symbols from a finite alphabet, and the set of all finite strings is countable (list them by length, and alphabetically within each length). So there are only countably many programs, and hence only countably many computable numbers. Turing observed exactly this in his paper. Since is uncountable, almost all real numbers, in the sense of cardinality and, as 3A.2 Lebesgue Measure will show, also in the sense of measure, are not computable. Every number you will ever compute with, including , , and the outputs of every simulation of Ricci flow, belongs to a countable set.
The axiom of choice
Many arguments involve making choices: "pick an element from each nonempty set ". Finitely many choices are justified by induction. For infinitely many, the other axioms of set theory don't suffice, and an extra axiom is needed.
For every family of nonempty sets, there is a function that assigns to each index an element (a choice function).
It sounds harmless, and for most purposes it is. But its consequences include some genuinely strange results, which is why mathematicians keep track of where it is used.
Ernst Zermelo formulated the axiom explicitly in 1904, to prove that every set can be well-ordered, that is, given an ordering in which every nonempty subset has a least element, like (2A.1 The Natural Numbers). Nobody can write down such an ordering of , and the proof didn't provide one, which many mathematicians found unacceptable. The axiom also implies the Banach–Tarski paradox (1924): a solid ball in space can be cut into finitely many pieces that can be moved rigidly and reassembled into two balls of the same size as the first. The pieces are so irregular that they have no volume at all (no well-defined measure), which is how volume fails to be conserved. Kurt Gödel (1938) and Paul Cohen (1963) showed that the axiom can neither be proved nor disproved from the other axioms of set theory. Most of mathematics, including all of this guidebook, assumes it.
A form of the axiom that is easier to apply in practice concerns partially ordered sets.
A partial order on a set is a relation that is reflexive, antisymmetric and transitive. A chain is a subset in which any two elements are comparable. An upper bound of a subset is an with for every . A maximal element is an with no .
If is a nonempty partially ordered set in which every chain has an upper bound, then has a maximal element.
Zorn's lemma is equivalent to the axiom of choice. A typical use is to prove that every vector space has a basis: order the linearly independent subsets by inclusion; a chain has its union as an upper bound; a maximal independent set is a basis. For regarded as a vector space over , such a basis exists but cannot be written down.
- 3A.1 The Problem of Measure: with the axiom of choice one can build a subset of , Vitali's set, that has no reasonable length. This is why measure theory must restrict which sets are measured. Countability is also built into the axioms of measure: lengths add over countably many disjoint pieces, never uncountably many (a line segment is an uncountable union of points of length zero).
- 3A.2 Lebesgue Measure: every countable set has length zero, so is "negligible" inside , even though it is dense.
- 4A.3 Hahn–Banach and Duality: the Hahn–Banach theorem, which supplies the linear functionals of functional analysis, uses Zorn's lemma.
- 4A.6 Weak Convergence and the Direct Method, 7A.2 Compactness and Compactification: the general Banach–Alaoglu and Tychonoff theorems use choice. In the separable spaces used for PDE, the guidebook proves the needed cases with a diagonal argument instead, which needs only countable choices.
- 2B.5 Uniform Convergence and Arzelà–Ascoli: the diagonal argument itself returns, in the proof of Arzelà–Ascoli, to extract a subsequence that converges at countably many points at once.
Size is measured by bijections. , , and are countable; is not; and every set is strictly smaller than its power set. The axiom of choice allows infinitely many arbitrary choices and is equivalent to Zorn's lemma. The next chapter, 2A.9 Continuous Functions, returns to the real line and to functions on it: continuity, and the first maximum principle.
Exercises
Prove Proposition 8.2 by induction on . Then use it to show that among any people, two share a birthday. (Unlike the "birthday paradox", which says that people have a better than even chance of a shared birthday, this is a certainty.)
Show that a union of countably many countable sets is countable. Where does your proof make infinitely many choices? (You must pick a listing of each set.)
Hint
Choose a listing of the -th set. Then maps onto the union. The listings are the infinitely many choices: this is a use of the (countable) axiom of choice.
A real number is algebraic if it is a root of a nonzero polynomial with integer coefficients ( is a root of ). Show that the algebraic numbers are countable, and deduce that transcendental (non-algebraic) numbers exist. This was Cantor's own application in 1874.
Solution
For each and each bound , there are finitely many integer polynomials of degree with coefficients bounded by in absolute value, and each has at most roots. So the algebraic numbers are a countable union of finite sets, hence countable. Since is uncountable, some real numbers are not algebraic.
Show that and have the same cardinality, using Schröder–Bernstein: send a subset to (injective, because base-3 digits and only, with no ambiguity), and send to a set built from its binary expansion.
Show that and have the same cardinality, by interleaving decimal digits: . Explain why this map is injective but not surjective, and how Schröder–Bernstein finishes the proof. (Cantor was astonished by this result.)
Compute , justifying any reordering. Compare with the double sum in 2A.7 Series, where the two orders disagreed, and say which hypothesis holds here and failed there.
Solution
The terms are positive, so the sum is absolutely convergent and may be computed in any order: . In 2A.7 Series's example the terms were and the sum of absolute values was infinite.
Let be a sequence of sequences, all bounded: for all . Show that there is a subsequence such that converges as for every . (Use Bolzano–Weierstrass (2A.6 Sequences) for , then on that subsequence for , and so on; then take the "diagonal" subsequence: the -th term of the -th subsequence.) This is the same diagonal idea as Cantor's, put to constructive use. It is the key step of the Arzelà–Ascoli theorem (2B.5 Uniform Convergence and Arzelà–Ascoli), and through it of every compactness theorem for spaces of functions, metrics and Ricci flows later in the route.
© 2026 NeckPinch (www.neckpinch.com). All content in the guidebook (text, mathematics, figures and exercises) is protected by copyright. All rights reserved. No part may be copied, republished or redistributed without written permission.