Cite

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

/courses/countability/cantor-bernstein
@misc{countability-cantor-bernstein,
  title = {{The Cantor–Bernstein theorem}},
  howpublished = {Lesson 2 of \emph{Countability and diagonalization}, Computability Theory course notes},
  url = {/courses/countability/cantor-bernstein},
  note = {Unreleased working version}
}

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

Lesson 2 of 6

The Cantor–Bernstein theorem

Two sets each injecting into the other are equipotent; explicit form of the bijection; the role of the axiom of choice.

35 min6 questions
Before this lesson:Equipotence and subpotence
Countability and diagonalization · lesson 2 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

Subpotence is reflexive and transitive (Proposition 1.12). This lesson proves that it is also antisymmetric: from an injection of AA into BB and an injection of BB into AA, one can build a bijection between AA and BB. The proof is constructive in the sense that it defines the bijection explicitly from the two injections, without any use of the axiom of choice. It is also a useful tool in practice: exhibiting two injections is often much easier than exhibiting a bijection.

2.1 The key lemma

The proof reduces to the case where one set is a subset of the other.

Lemma 2.1.#

Let B⊆AB \subseteq A be sets, and let f:A→Bf : A \to B be injective. Then there is a bijection h:A→Bh : A \to B.

The elements of A∖BA \setminus B must be sent into BB, so they are moved by ff. Their images may in turn be needed as images of other elements, so they are moved as well, and so on. Every other element can stay in place.

C0 = A ∖ BC1C2C3⋮elements of B never reached from A ∖ Bby iterating f: here h is the identityffffshaded: C = ⋃ Cₙ,where h = fBA

The sets CnC_n of the proof. The elements of A∖BA \setminus B and all their iterated images form the shaded set CC; the bijection hh applies ff on CC and is the identity elsewhere.
Proof of Lemma 2.1.

Define sets Cn⊆AC_n \subseteq A by induction:

C0=A∖B,Cn+1=f(Cn),C_0 = A \setminus B, \qquad C_{n+1} = f(C_n),

let C=⋃n∈NCnC = \bigcup_{n \in \nat} C_n, and define h:A→Ah : A \to A by

h(x)={f(x)if x∈C,xif x∉C.h(x) = \begin{cases} f(x) & \text{if } x \in C,\\ x & \text{if } x \notin C. \end{cases}

hh maps AA into BB. If x∈Cx \in C, then h(x)=f(x)∈Bh(x) = f(x) \in B. If x∉Cx \notin C, then in particular x∉C0=A∖Bx \notin C_0 = A \setminus B, so h(x)=x∈Bh(x) = x \in B.

hh is injective. Its restriction to CC is ff, which is injective, and its restriction to A∖CA \setminus C is the identity. The image of CC is ⋃nf(Cn)=⋃nCn+1⊆C\bigcup_n f(C_n) = \bigcup_n C_{n+1} \subseteq C, and the image of A∖CA \setminus C is A∖CA \setminus C. These images are disjoint, so two elements with the same image lie in the same piece, and are then equal.

hh is surjective onto BB. Let y∈By \in B. If y∉Cy \notin C, then h(y)=yh(y) = y. If y∈Cy \in C, then y∈Cny \in C_n for some nn, and n≠0n \neq 0 since y∈By \in B. So y∈Cm+1=f(Cm)y \in C_{m+1} = f(C_m) with m=n−1m = n - 1: there is x∈Cm⊆Cx \in C_m \subseteq C with h(x)=f(x)=yh(x) = f(x) = y.

Example 2.2.#

Let A=[0,1]A = [0, 1], B=[0,1)⊆AB = [0, 1) \subseteq A and f(x)=x/2f(x) = x/2, an injection of AA into [0,12]⊆B[0, \tfrac12] \subseteq B. Then C0={1}C_0 = \{1\} and Cn={2−n}C_n = \{2^{-n}\}, so C={1,12,14,… }C = \{1, \tfrac12, \tfrac14, \dots\}. The bijection of the lemma is

h(x)={x/2if x=2−n for some n∈N,xotherwise.h(x) = \begin{cases} x / 2 & \text{if } x = 2^{-n} \text{ for some } n \in \nat,\\ x & \text{otherwise.} \end{cases}

It shifts the sequence 1,12,14,…1, \tfrac12, \tfrac14, \dots by one step, which frees the point 11, and fixes every other point. This is the device of Exercise 1.14, applied to a copy of N\nat inside [0,1][0, 1].

2.2 The theorem

Theorem 2.3 (Cantor–Bernstein).#

If f:A→Bf : A \to B and g:B→Ag : B \to A are injections, then there is a bijection between AA and BB.

Proof of Theorem 2.3.

Let A′=g(B)⊆AA' = g(B) \subseteq A. The map g∘fg \circ f is an injection from AA into A′A', so by Lemma 2.1 there is a bijection h:A→A′h : A \to A'. The map gg, seen as a function from BB to A′A', is a bijection; so g−1∘h:A→Bg^{-1} \circ h : A \to B is a bijection.

Corollary 2.4.#

If ∣A∣≤∣B∣|A| \leq |B| and ∣B∣≤∣A∣|B| \leq |A|, then ∣A∣=∣B∣|A| = |B|. Consequently, if A⊆B⊆CA \subseteq B \subseteq C and ∣A∣=∣C∣|A| = |C|, then ∣A∣=∣B∣=∣C∣|A| = |B| = |C|.

Proof of Corollary 2.4.

The first statement is a reformulation of Theorem 2.3. For the second, the inclusion gives ∣B∣≤∣C∣|B| \leq |C|, and ∣C∣=∣A∣≤∣B∣|C| = |A| \leq |B| gives ∣C∣≤∣B∣|C| \leq |B|.

The second statement is often used in the following form: to show that a set BB has the same cardinality as a set CC, find a subset of BB equipotent to CC, and an injection of BB into CC.

2.3 The bijection, explicitly

Unfolding the two proofs gives a direct description of the bijection.

Proposition 2.5.#

Let f:A→Bf : A \to B and g:B→Ag : B \to A be injections, and let

C=⋃n∈N(g∘f)n(A∖g(B)).C = \bigcup_{n \in \nat} (g \circ f)^n\big(A \setminus g(B)\big).

Then the function φ:A→B\varphi : A \to B defined by φ(x)=f(x)\varphi(x) = f(x) for x∈Cx \in C, and φ(x)=g−1(x)\varphi(x) = g^{-1}(x) for x∉Cx \notin C, is a bijection.

Proof of Proposition 2.5.

In the proof of Theorem 2.3, the lemma is applied to A′=g(B)A' = g(B) and to the injection g∘fg \circ f. Its sets are C0=A∖g(B)C_0 = A \setminus g(B) and Cn+1=(g∘f)(Cn)C_{n+1} = (g \circ f)(C_n), so their union is the set CC of the statement, and the bijection is g−1∘hg^{-1} \circ h, where h(x)=g(f(x))h(x) = g(f(x)) for x∈Cx \in C and h(x)=xh(x) = x otherwise. For x∈Cx \in C, this gives g−1(g(f(x)))=f(x)g^{-1}(g(f(x))) = f(x). For x∉Cx \notin C, it gives g−1(x)g^{-1}(x), which is defined since x∉C0x \notin C_0 means x∈g(B)x \in g(B).

The set CC has a simple description. Assume for this paragraph that AA and BB are disjoint (otherwise, replace them by disjoint copies). Starting from x∈Ax \in A, one can try to go backwards: if x∈g(B)x \in g(B), its parent is the unique y∈By \in B with g(y)=xg(y) = x; if y∈f(A)y \in f(A), the parent of yy is the unique x′∈Ax' \in A with f(x′)=yf(x') = y; and so on. Every element thus has a unique sequence of ancestors, which either stops at an element of A∖g(B)A \setminus g(B), or stops at an element of B∖f(A)B \setminus f(A), or never stops. An element x∈Ax \in A lies in CC exactly when its ancestry stops in A∖g(B)A \setminus g(B): indeed, x∈(g∘f)n(A∖g(B))x \in (g \circ f)^n(A \setminus g(B)) means that the 2n2n-th ancestor of xx exists and lies in A∖g(B)A \setminus g(B).

So the elements of A∪BA \cup B split into chains under ff and gg, and the bijection pairs elements within each chain. On a chain starting in AA, it must use ff, since the first element has no preimage under gg. On a chain starting in BB, it must use g−1g^{-1}, since the first element is not in the image of ff. On a chain without a first element, which is either infinite in both directions or a finite cycle, both choices work, and the proof makes the choice g−1g^{-1}.

ABstarts in A ∖ g(B):every element of Agoes to its image by ffgfgfg⋯starts in B ∖ f(A):every element of Agoes to its preimage by gg⁻¹fg⁻¹fg⁻¹f⋯has no first element:preimage by g(the choice of the proof)fg⁻¹fg⁻¹fg⁻¹⋯⋯

The three kinds of chains, with elements of AA in the top row and elements of BB in the bottom row. The thick arrows are the pairs (x,φ(x))(x, \varphi(x)) of the bijection.

This is the proof of Cantor–Bernstein usually attributed to Julius König (1906). The proof above, by iteration of a single injection, is essentially Dedekind’s.

2.4 The role of the axiom of choice

The proof of Cantor–Bernstein uses only definitions by induction and set formation: it is a theorem of ZF, set theory without the axiom of choice. Two related statements behave differently.

  • Surjections in both directions. If there are surjections A→BA \to B and B→AB \to A, are AA and BB equipotent? With the axiom of choice, yes: each surjection has a right inverse, which is an injection in the opposite direction (Remark 1.3), and Cantor–Bernstein applies. Without choice, this is not provable in ZF, if ZF is consistent; we admit this independence result (see Jech’s monograph on the axiom of choice).
  • Comparability. For any two sets AA and BB, is ∣A∣≤∣B∣|A| \leq |B| or ∣B∣≤∣A∣|B| \leq |A|? Zermelo’s well-ordering theorem shows that this follows from the axiom of choice, and Hartogs showed in 1915 that, conversely, comparability implies the axiom of choice. We admit both results.

In this course, the sets compared are mostly sets of integers, finite objects, sequences and real numbers, for which explicit injections are available, and no use of choice is needed except where stated.

2.5 Exercises

Exercise 2.6 ★.

Use the Cantor–Bernstein theorem to show that N\nat and N×N\nat \times \nat are equipotent, without writing down an explicit bijection.

Solution

The map n↦(n,0)n \mapsto (n, 0) is an injection N→N×N\nat \to \nat \times \nat. Conversely, (a,b)↦2a3b(a, b) \mapsto 2^a 3^b is an injection N×N→N\nat \times \nat \to \nat, by uniqueness of prime factorization. By Theorem 2.3, the two sets are equipotent.

Exercise 2.7 ★.#

Show that [0,1][0, 1], [0,1)[0, 1), (0,1)(0, 1) and R\mathbb R are pairwise equipotent.

Solution

We have (0,1)⊆[0,1)⊆[0,1]⊆R(0, 1) \subseteq [0, 1) \subseteq [0, 1] \subseteq \mathbb R, and ∣(0,1)∣=∣R∣|(0, 1)| = |\mathbb R| by Example 1.6. By the second part of Corollary 2.4, applied twice, all four sets are equipotent.

Exercise 2.8 ★★.

Let EE be the set of even numbers, f:N→Ef : \nat \to E given by f(n)=4nf(n) = 4n, and g:E→Ng : E \to \nat the inclusion. Compute the bijection φ\varphi of Proposition 2.5.

Solution

Write v(x)v(x) for the exponent of 22 in x≥1x \geq 1. Here N∖g(E)\nat \setminus g(E) is the set of odd numbers and g∘f(n)=4ng \circ f(n) = 4n, so CC is the set of numbers 4km4^k m with mm odd, that is, the x≥1x \geq 1 with v(x)v(x) even. Hence φ(x)=4x\varphi(x) = 4x if x≥1x \geq 1 and v(x)v(x) is even, and φ(x)=x\varphi(x) = x otherwise, that is, for x=0x = 0 and for v(x)v(x) odd. One checks directly that φ\varphi is a bijection onto EE: the even numbers x≥2x \geq 2 with v(x)v(x) odd are fixed, together with 00, and those with v(x)≥2v(x) \geq 2 even are the images 4y4y of the yy with v(y)v(y) even.

Exercise 2.9 ★★.

In the proof of Lemma 2.1, show that the sets CnC_n are pairwise disjoint.

Solution

For n≥1n \geq 1, Cn⊆f(A)⊆BC_n \subseteq f(A) \subseteq B, so CnC_n is disjoint from C0=A∖BC_0 = A \setminus B. Suppose Cm∩Cn≠∅C_m \cap C_n \neq \emptyset with m<nm < n, and choose such a pair with mm minimal. Then m≥1m \geq 1 by the first remark. Let y∈Cm∩Cny \in C_m \cap C_n: there are x∈Cm−1x \in C_{m-1} and x′∈Cn−1x' \in C_{n-1} with f(x)=f(x′)=yf(x) = f(x') = y, hence x=x′x = x' by injectivity, and Cm−1∩Cn−1≠∅C_{m-1} \cap C_{n-1} \neq \emptyset, contradicting the minimality of mm.

2.6 Notes and references

The theorem was stated by Cantor, who could prove it only using the comparability of cardinals. Dedekind found a proof in 1887 but did not publish it. Schröder published a proof in 1898 that turned out to contain a gap, and the first published correct proof, by Felix Bernstein, appeared in Borel’s Leçons sur la théorie des fonctions (1898). The proof by chains is due to Julius König. Hartogs’ theorem on comparability is proved in Jech’s monograph.

  • E. Borel, Leçons sur la théorie des fonctions, Gauthier-Villars, Paris, 1898, Note I.
  • J. König, Sur la théorie des ensembles, Comptes rendus de l’Académie des sciences 143 (1906), 110–112.
  • F. Hartogs, Über das Problem der Wohlordnung, Mathematische Annalen 76 (1915), 438–443.
  • T. Jech, The Axiom of Choice, North-Holland, 1973.