Cite

This course has no released version yet: the text at this address may change. Cite a released version when one exists.

/courses/countability/continuum
@misc{countability-continuum,
  title = {{The cardinality of the continuum}},
  howpublished = {Lesson 5 of \emph{Countability and diagonalization}, Computability Theory course notes},
  url = {/courses/countability/continuum},
  note = {Unreleased working version}
}

To cite a single statement, use the # link that appears next to its heading.

Lesson 5 of 6

The cardinality of the continuum

The sets of binary sequences, of integer sequences, of real numbers and of real sequences are equipotent; removing a countable set does not change their cardinality; the continuum hypothesis.

35 min4 questions
Before this lesson:The diagonal argument
Countability and diagonalization · lesson 5 of 6
  1. Equipotence and subpotence
  2. The Cantor–Bernstein theorem
  3. Countable sets
  4. The diagonal argument
  5. The cardinality of the continuum
  6. Diagonalization and computation

The previous lesson exhibited several uncountable sets: Cantor space 2N\cs, Baire space NN\nat^\nat, the power set P(N)\mathcal P(\nat) and the real line R\mathbb R. This lesson shows that they all have the same cardinality, called the cardinality of the continuum. The proofs are applications of the Cantor–Bernstein theorem: in each case, two injections are easy to write down, while an explicit bijection would be cumbersome. Along the way, we introduce two codings used throughout computability theory: the join of two sequences, and the coding of a sequence of sequences by a single one.

Definition 5.1.#

A set AA has the cardinality of the continuum if ∣A∣=∣R∣|A| = |\mathbb R|.

5.1 Codings inside Cantor space

Proposition 5.2.#

∣NN∣=∣2N∣|\nat^\nat| = |\cs|.

The inclusion 2N⊆NN\cs \subseteq \nat^\nat gives one injection. For the other, a function f:N→Nf : \nat \to \nat is coded by writing each value in unary, f(n)f(n) ones, followed by a zero as a separator.

110f(0) = 20f(1) = 01110f(2) = 310f(3) = 1⋯

The coding of Baire space into Cantor space. Each value f(n)f(n) is written as a block of f(n)f(n) ones, closed by a zero.
Proof of Proposition 5.2.

To f∈NNf \in \nat^\nat, associate the sequence

c(f)=1f(0) 0 1f(1) 0 1f(2) 0⋯∈2N,c(f) = 1^{f(0)}\, 0\, 1^{f(1)}\, 0\, 1^{f(2)}\, 0 \cdots \in \cs,

where 1k1^k is the string of kk ones. Formally, c(f)(m)=0c(f)(m) = 0 if and only if m=znm = z_n for some nn, where zn=n+∑i≤nf(i)z_n = n + \sum_{i \leq n} f(i) is the position of the nn-th zero. The sequence c(f)c(f) has infinitely many zeros, at the positions z0<z1<⋯z_0 < z_1 < \cdots, and ff is recovered from it: f(0)=z0f(0) = z_0 and f(n+1)=zn+1−zn−1f(n+1) = z_{n+1} - z_n - 1 is the number of ones between two consecutive zeros. So cc is injective, and Theorem 2.3 applies.

The map cc is a bijection from NN\nat^\nat onto the set of sequences with infinitely many zeros, but it is not surjective onto 2N\cs: the sequences with finitely many zeros, such as 0111⋯0111\cdots, are not codes. This is why Cantor–Bernstein is used.

Definition 5.3.#
  1. The join of X,Y∈2NX, Y \in \cs is the sequence X⊕YX \oplus Y defined by (X⊕Y)(2n)=X(n)(X \oplus Y)(2n) = X(n) and (X⊕Y)(2n+1)=Y(n)(X \oplus Y)(2n+1) = Y(n).
  2. The coding of a sequence (Xn)n∈N(X_n)_{n \in \nat} of elements of 2N\cs is the sequence ⨁nXn\bigoplus_n X_n defined by (⨁nXn)(⟨n,m⟩)=Xn(m)\big(\bigoplus_n X_n\big)(\langle n, m \rangle) = X_n(m), where ⟨⋅,⋅⟩\langle \cdot, \cdot \rangle is Cantor’s pairing function.
Proposition 5.4.#

The maps (X,Y)↦X⊕Y(X, Y) \mapsto X \oplus Y and (Xn)n↦⨁nXn(X_n)_n \mapsto \bigoplus_n X_n are bijections from 2N×2N\cs \times \cs and from (2N)N(\cs)^\nat onto 2N\cs. Hence ∣2N×2N∣=∣(2N)N∣=∣2N∣|\cs \times \cs| = |(\cs)^\nat| = |\cs|.

Proof of Proposition 5.4.

Every Z∈2NZ \in \cs is X⊕YX \oplus Y for exactly one pair, namely X(n)=Z(2n)X(n) = Z(2n) and Y(n)=Z(2n+1)Y(n) = Z(2n+1), since every integer is even or odd, and not both. Similarly, since ⟨⋅,⋅⟩\langle \cdot, \cdot \rangle is a bijection N2→N\nat^2 \to \nat (Proposition 3.7), every ZZ is ⨁nXn\bigoplus_n X_n for exactly one sequence, namely Xn(m)=Z(⟨n,m⟩)X_n(m) = Z(\langle n, m \rangle).

In computability theory, X⊕YX \oplus Y is the canonical way of giving two sets as a single oracle, and ⨁nXn\bigoplus_n X_n the way of giving a sequence of sets; the set XnX_n is the nn-th column of ⨁nXn\bigoplus_n X_n.

5.2 The real line

Theorem 5.5.#

The sets 2N\cs, P(N)\mathcal P(\nat), NN\nat^\nat, [0,1][0, 1] and R\mathbb R are pairwise equipotent.

Proof of Theorem 5.5.

We have ∣P(N)∣=∣2N∣|\mathcal P(\nat)| = |\cs| by characteristic functions, ∣NN∣=∣2N∣|\nat^\nat| = |\cs| by Proposition 5.2, and [0,1)[0,1), [0,1][0,1] and R\mathbb R are pairwise equipotent by Exercise 2.7. It remains to show ∣2N∣=∣[0,1)∣|\cs| = |[0, 1)|, and we give two injections.

From 2N\cs to [0,1)[0, 1). Let t(X)=∑nX(n) 3−(n+1)t(X) = \sum_{n} X(n)\, 3^{-(n+1)}, which lies in [0,12][0, \tfrac12]. If X≠YX \neq Y, let nn be the least position where they differ, say X(n)=0X(n) = 0 and Y(n)=1Y(n) = 1. Then

t(Y)−t(X)  ≥  3−(n+1)−∑k>n3−(k+1)  =  3−(n+1)−12 3−(n+1)  >  0,t(Y) - t(X) \;\geq\; 3^{-(n+1)} - \sum_{k > n} 3^{-(k+1)} \;=\; 3^{-(n+1)} - \tfrac12\, 3^{-(n+1)} \;>\; 0,

since the terms at positions k>nk > n contribute at most 3−(k+1)3^{-(k+1)} each to the difference. So tt is injective.

From [0,1)[0, 1) to 2N\cs. For x∈[0,1)x \in [0, 1), let b(x)(k)=⌊2k+1x⌋−2⌊2kx⌋b(x)(k) = \lfloor 2^{k+1} x \rfloor - 2 \lfloor 2^k x \rfloor, which is 00 or 11. By induction on nn, ⌊2nx⌋=∑k<nb(x)(k) 2n−1−k\lfloor 2^n x \rfloor = \sum_{k < n} b(x)(k)\, 2^{n-1-k}: this holds for n=0n = 0 since ⌊x⌋=0\lfloor x \rfloor = 0, and the inductive step is the definition of b(x)(n)b(x)(n). Hence the bits b(x)b(x) determine every ⌊2nx⌋\lfloor 2^n x \rfloor, and therefore x=lim⁡n2−n⌊2nx⌋x = \lim_n 2^{-n} \lfloor 2^n x \rfloor, since 0≤x−2−n⌊2nx⌋<2−n0 \leq x - 2^{-n} \lfloor 2^n x \rfloor < 2^{-n}. So bb is injective.

By Theorem 2.3, ∣2N∣=∣[0,1)∣|\cs| = |[0, 1)|.

The sequence b(x)b(x) is the binary expansion of xx that does not end with infinitely many ones. The map bb is not surjective: the sequences ending with infinitely many ones are missed. The map tt uses base 33 so that distinct sequences cannot produce the same number, which would happen in base 22, where 0111⋯0111\cdots and 1000⋯1000\cdots both represent 12\tfrac12.

Corollary 5.6.#

∣R×R∣=∣RN∣=∣R∣|\mathbb R \times \mathbb R| = |\mathbb R^\nat| = |\mathbb R|, and ∣C∣=∣R∣|\mathbb C| = |\mathbb R|.

Proof of Corollary 5.6.

Fix a bijection β:R→2N\beta : \mathbb R \to \cs, given by the theorem. Then (x,y)↦β(x)⊕β(y)(x, y) \mapsto \beta(x) \oplus \beta(y) and (xn)n↦⨁nβ(xn)(x_n)_n \mapsto \bigoplus_n \beta(x_n) are bijections onto 2N\cs, by Proposition 5.4. Finally C\mathbb C is in bijection with R×R\mathbb R \times \mathbb R.

Cantor found this result in 1877, and wrote to Dedekind that he could see it but did not believe it: the plane has no more points than the line. No such bijection is a homeomorphism, by Brouwer’s theorem on the invariance of dimension (1911), which we admit; cardinality ignores topology.

5.3 Removing a countable set

Proposition 5.7.#

If M⊆2NM \subseteq \cs is countable, then ∣2N∖M∣=∣2N∣|\cs \setminus M| = |\cs|. The same holds for R\mathbb R and every set of the cardinality of the continuum.

Proof of Proposition 5.7.

Through the bijection of Proposition 5.4, we may work in 2N×2N\cs \times \cs, with MM a countable subset of it. The set M0={X:(X,Y)∈M for some Y}M_0 = \{ X : (X, Y) \in M \text{ for some } Y \} of first coordinates is countable, as an image of MM (Corollary 3.4). By Theorem 4.2, there is X0∉M0X_0 \notin M_0. Then Y↦(X0,Y)Y \mapsto (X_0, Y) is an injection of 2N\cs into (2N×2N)∖M(\cs \times \cs) \setminus M. The inclusion is an injection in the other direction, and Theorem 2.3 concludes. The last sentence follows by transporting through a bijection.

Corollary 5.8.#

The sets of irrational numbers and of transcendental numbers have the cardinality of the continuum.

Proof of Corollary 5.8.

They are the complements in R\mathbb R of the countable sets Q\mathbb Q and of the algebraic numbers (Example 3.13).

5.4 Cantor space and the Cantor set

Cantor space and the real line have the same cardinality, but they are different as ordered or topological spaces. In the lexicographic order on 2N\cs, defined by X<lexYX <_{\mathrm{lex}} Y if X(n)<Y(n)X(n) < Y(n) at the first position nn where XX and YY differ, the sequences 0111⋯0111\cdots and 1000⋯1000\cdots have nothing strictly between them, whereas between two real numbers there is always a third. The relevant geometric picture of 2N\cs is a subset of the line.

A0A101A200011011A300000101001110010111011101

The first stages of the construction of the Cantor set. Each interval of AnA_n is labeled by the binary string of length nn recording the left or right choices that lead to it.
The Cantor set

Let A0=[0,1]A_0 = [0, 1], and let An+1A_{n+1} be obtained from AnA_n by removing the open middle third of each of its intervals, so that A1=[0,13]∪[23,1]A_1 = [0, \tfrac13] \cup [\tfrac23, 1] and AnA_n is a union of 2n2^n closed intervals of length 3−n3^{-n}. The Cantor set is C=⋂nAn\mathcal C = \bigcap_n A_n. It is the set of real numbers of [0,1][0, 1] having a ternary expansion with digits 00 and 22 only, and the map X↦∑n2X(n) 3−(n+1)X \mapsto \sum_n 2X(n)\, 3^{-(n+1)} is a bijection from 2N\cs onto C\mathcal C, which preserves the lexicographic order. With the product topology on 2N\cs, it is a homeomorphism; this explains the name of Cantor space. We admit these facts, which belong to a course on topology.

5.5 The continuum hypothesis

By Proposition 3.5, every infinite set has cardinality at least ∣N∣|\nat|, and ∣N∣<∣R∣|\nat| < |\mathbb R|. Cantor conjectured that there is nothing in between.

Definition 5.9.#

The continuum hypothesis is the statement: every infinite subset of R\mathbb R is either countable or of the cardinality of the continuum.

The question remained open for decades, and was the first of the problems listed by Hilbert in 1900. Its status is now known, and we admit it.

Remark 5.10.#

The continuum hypothesis can be neither proved nor refuted from the axioms of ZFC, provided these axioms are consistent. Gödel showed in 1938 that it holds in the constructible universe LL, so that it cannot be refuted; Cohen showed in 1963, by the method of forcing, that it cannot be proved. Forcing has since become a central tool of set theory, and effective versions of it are used in computability theory to build sets with prescribed properties.

For sets of reals with a simple definition, the question has a positive answer. Cantor and Bendixson showed that every uncountable closed subset of R\mathbb R contains a copy of the Cantor set, hence has the cardinality of the continuum; this was extended to Borel sets by Alexandrov and Hausdorff, and to analytic sets by Suslin. We admit these results; they are proved in Kechris’ book.

5.6 Exercises

Exercise 5.11 ★.

Show that ∣P(N×N)∣=∣P(N)∣|\mathcal P(\nat \times \nat)| = |\mathcal P(\nat)|, and that the set of all binary relations on N\nat has the cardinality of the continuum.

Solution

A bijection N×N→N\nat \times \nat \to \nat induces a bijection between the power sets, by taking images. A binary relation on N\nat is a subset of N×N\nat \times \nat, so the set of relations is P(N×N)\mathcal P(\nat \times \nat), equipotent to P(N)\mathcal P(\nat) and hence to R\mathbb R by Theorem 5.5.

Exercise 5.12 ★★.

Show that the set of continuous functions R→R\mathbb R \to \mathbb R has the cardinality of the continuum.

Solution

Constant functions give an injection of R\mathbb R. Conversely, a continuous function is determined by its values on Q\mathbb Q, since every real number is a limit of rational numbers. Fixing a bijection q:N→Qq : \nat \to \mathbb Q, the map f↦(f(q(n)))nf \mapsto (f(q(n)))_n is therefore an injection into RN\mathbb R^\nat, which has the cardinality of the continuum by Corollary 5.6. Conclude by Theorem 2.3.

Exercise 5.13 ★★.

Show that the set of all functions R→R\mathbb R \to \mathbb R has a cardinality strictly greater than that of R\mathbb R.

Solution

The characteristic functions of subsets of R\mathbb R give an injection of P(R)\mathcal P(\mathbb R) into the set RR\mathbb R^{\mathbb R} of all functions. By Theorem 4.6, ∣R∣<∣P(R)∣≤∣RR∣|\mathbb R| < |\mathcal P(\mathbb R)| \leq |\mathbb R^{\mathbb R}|. (In fact ∣RR∣=∣P(R)∣|\mathbb R^{\mathbb R}| = |\mathcal P(\mathbb R)|, since a function is a subset of R×R\mathbb R \times \mathbb R, which is equipotent to R\mathbb R.)

Exercise 5.14 ★★.

Give an explicit bijection between 2N\cs and the set of sequences with infinitely many zeros, using the coding cc of Proposition 5.2. Deduce another proof that ∣NN∣=∣2N∣|\nat^\nat| = |\cs|.

Solution

The set MM of sequences with finitely many zeros is countably infinite: each of them is σ111⋯\sigma 111\cdots for a finite binary string σ\sigma, and there are infinitely many. Let M0,M1,…M_0, M_1, \dots be an enumeration of MM without repetition. The sequences Ek=0k1000⋯E_k = 0^k 1 0 0 0 \cdots, for k∈Nk \in \nat, are pairwise distinct and have infinitely many zeros. Define φ:2N→2N∖M\varphi : \cs \to \cs \setminus M by φ(Mk)=E2k+1\varphi(M_k) = E_{2k+1}, φ(Ek)=E2k\varphi(E_k) = E_{2k}, and φ(X)=X\varphi(X) = X for the other sequences. It is injective on each of the three pieces, whose images {E2k+1}\{E_{2k+1}\}, {E2k}\{E_{2k}\} and 2N∖(M∪{Ek})\cs \setminus (M \cup \{E_k\}) are disjoint and cover 2N∖M\cs \setminus M; so φ\varphi is a bijection onto the set of sequences with infinitely many zeros. Then c−1∘φc^{-1} \circ \varphi is a bijection from 2N\cs onto NN\nat^\nat.

5.7 Notes and references

The equipotence of the line and the plane is in Cantor’s paper of 1878, after an exchange of letters with Dedekind in 1877. The continuum hypothesis is formulated in the same paper. Gödel’s and Cohen’s results are presented in Kunen’s and Jech’s textbooks on set theory; the perfect set property for closed, Borel and analytic sets is in Kechris’ book.

  • G. Cantor, Ein Beitrag zur Mannigfaltigkeitslehre, Journal für die reine und angewandte Mathematik 84 (1878), 242–258.
  • K. Gödel, The consistency of the axiom of choice and of the generalized continuum-hypothesis, Proceedings of the National Academy of Sciences 24 (1938), 556–557.
  • P. J. Cohen, The independence of the continuum hypothesis, Proceedings of the National Academy of Sciences 50 (1963), 1143–1148.
  • K. Kunen, Set Theory: An Introduction to Independence Proofs, North-Holland, 1980.
  • T. Jech, Set Theory, 3rd millennium edition, Springer, 2003.
  • A. S. Kechris, Classical Descriptive Set Theory, Graduate Texts in Mathematics 156, Springer, 1995.