Lecture 4 supplement: detailed proof

Here are the details of the proof we gave today that if A∣ ≤ ∣B and if B∣ ≤ ∣A that A∣ = ∣B. This is called the Cantor-Schröder-Bernstein Theorem.

See Wikipedia for another writeup.


First a reminder of some relevant definitions:

The proof

We will do a direct proof. Assume that A∣ ≤ ∣B and B∣ ≤ ∣A. By definition, this means that there exists functions f: AB and g: BA that are both one-to-one.

Our goal is to piece these together to form a function h: AB which is both one-to-one and onto.


To build the function h, we need to give its output on every input. To define it, we need to consider chains of elements that are formed by repeatedly applying f and g.

The chain of an element x ∈ A contains x, f(x), g(f(x)), f(g(f(x))), g(f(g(f(x)))) and so on. It also contains any elements that can be reached by going backwards along the chain. That is, if there happens to be some y such that g(y) = x, then y is in the chain.

There need not be such a y because g is not onto. However, if there is a y, it must be unique, because g is one-to-one. If such a y exists, we will call it g − 1(y). This discussion shows that g − 1 is a partial function.

Similarly, the chain of x will include f − 1(g − 1(x)), g − 1(f − 1(g − 1(x))) and so on.

We want to distinguish between various types of chains, based on what happens as you walk backwards along them (that is, if we consider x, g − 1(x), f − 1(g − 1(x)), ... as defined above). There are 4 types:

  1. The chain forms a loop
  2. Chains that go "backwards" forever without repeating.
  3. Chains that stop in A. That is, they end on some x with g − 1(x) undefined.
  4. Chains that stop in B.

Note that every element of both A and B is part of exactly one chain.

Constructing h

We define h as follows. If x is in a chain of type 1, 2, or 3, then we define h(x) = f(x). If x is in a chain of type 4, then we define h(x) = g − 1(x). g − 1(x) is defined, because if it wasn't, then x would be in a chain of type 3.

What's left is to show that h is one-to-one and onto.

Proof that h is one-to-one

We must show that whenever h(x1) = h(x2), that x1 = x2. We will prove this directly: assume that h(x1) = h(x2). Notice that h(x) is always part of the same chain as x. Therefore, x1 and x2 must be in the same chain.

Let's consider the possible types of chains:

In any case, we have shown that x1 = x2, so we conclude that h is one-to-one.

Proof that h is onto

Given an arbitrary y ∈ B, we must find some x ∈ A with h(x) = y. We consider the chain containing y.

In either case, we have found an element that maps to y, so h is onto.


We have defined a function h: AB and shown that it is both one-to-one and onto. Therefore (by definition) A∣ = ∣B.