Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 2 of 3

Build a bijection from two injections

Construct the Cantor–Schroeder–Bernstein bijection and prove its domain, cross-branch injectivity and full coverage.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

Imagine two catalogs, A and B, each containing one entry for every nonnegative integer. You can assign each A entry to a distinct B entry using f(n)=n+1. You can also assign each B entry to a distinct A entry using g(n)=n+1. Neither assignment reaches entry zero in its target catalog. Can these two incomplete assignments produce a complete one-to-one pairing?

The answer is yes, but simply choosing f does not work: zero is missing. Simply trying to reverse g everywhere also fails: g has no inverse value at zero. We need to decide which entries use f and which use the reverse of g. That decision must prevent collisions between the two branches, not just within each branch.

Predict

Entry zero in A has no incoming g arrow, so send it forward by f to entry one in B. That B entry has a g arrow to entry two in A. If we sent two backward by g, it would also land at entry one in B. To avoid the collision, send two forward instead. Continue this reasoning. Which A entries are forced into the forward branch?

They are 0, 2, 4, and so on. The resulting map sends each even n to n+1, and each odd n to n−1. It swaps consecutive pairs. Before proceeding, check that every output occurs exactly once. The finite trace below illustrates a construction whose general proof must still handle arbitrary sets.

Experiment

A input nBranchB output h(n)Reason
0f1No incoming g arrow
1g inverse0Outside the even chain
2f3Reached by g after f from 0
3g inverse2Outside the even chain
4f5Next forward-chain entry
5g inverse4Outside the even chain

Draw alternating arrows A→B→A for the first three forward steps. Then deliberately use the forward branch only at zero. Inputs zero and two now collide at output one. Both component maps are injective, yet their arbitrary mixture is not. The set selecting the branch needs a proof of its own.

Understand

Now let f:A→B and g:B→A be any injections. Define A₀=A∖g(B), the elements with no incoming g arrow. Define A_(n+1)=g(f(A_n)) for every nonnegative integer n, and let C be the union of all A_n. These are subsets of A. The stages need not exhaust A; C contains exactly the elements reached after finitely many forward pairs of arrows starting in A₀.

Images preserve unions, so C=A₀∪g(f(C)). Define h:A→B as follows: use h(a)=f(a) when a belongs to C, and h(a)=g⁻¹(a) otherwise. Here g⁻¹ means the inverse on the image g(B), not on all of A.

First prove this definition is valid. If a is outside C, it is outside A₀, so it belongs to g(B). There is therefore a preimage under g, and injectivity of g makes it unique. The forward branch is valid because f is already a function on A. Both branches produce elements of B.

Next prove injectivity. Two inputs in C cannot collide because f is injective. Two inputs outside C cannot collide because applying g to their equal inverse values recovers equal inputs. For the crucial cross-case, suppose a lies in C, a′ lies outside C, and f(a)=g⁻¹(a′). Applying g gives a′=g(f(a)), which belongs to g(f(C)) and hence C. This contradicts the branch choice. All cases are covered.

Finally prove surjectivity. Fix any b in B. If g(b) is outside C, its inverse-branch image is b. If g(b) is inside C, it cannot be in A₀, since it is in g(B). The union identity then gives g(b)=g(f(a)) for some a in C. Injectivity of g implies b=f(a)=h(a). Thus every element of B has a preimage. This proves the Cantor–Schroeder–Bernstein theorem by constructing a bijection rather than quoting it.

The boundary cases belong to the argument. If A₀ is empty, every stage is empty, g is onto A, and h is simply g⁻¹. If C=A, only the forward branch is used, and the preceding proof shows f is onto. If A is empty, existence of g:B→A forces B empty too. The unique empty map is then the required bijection.

Apply

Change the countable example to f(n)=n and g(n)=n+2. The initial missing entries are zero and one. Repeated application of g∘f adds two, so the generated set contains every nonnegative integer. The resulting bijection is h(n)=n. Explain why the unused inverse branch causes no problem and why this example differs from the alternating branches in the worked table.

For the endpoint-sensitive application, let K=[0,1) and I=(0,1]. Suppose the separate canonical-digit argument has proved an injection J:K×K→K. Reflection ρ(t)=1−t bijects I with K: the included endpoint 1 maps to the included endpoint 0, and the excluded endpoint 0 would map to the excluded endpoint 1. Reflect both coordinates, apply J, then reflect its output. This gives the injection G(x,y)=1−J(1−x,1−y) from I×I into I. Its output is positive and at most 1, as required.

The reverse-direction injection is f(t)=(t,1), whose second coordinate is allowed in I. Apply the proved theorem with A=I, B=I×I and g=G. It produces a bijection I→I×I, so the actual endpoint choice (0,1] is respected. The practice requires the generated sets and both branches, not just the theorem name. Neither J nor G is assumed onto.

The assumption about J matters: an ambiguous digit encoding is not automatically an injection. Conversely, the theorem does not require the supplied injection to be a surjection. Nor does this proof promise a finite algorithm deciding membership in C. An infinite union defines a set even when an effective membership procedure has not been established.

Continue

For each use of two injections, record their domains and codomains, justify both injections independently, then verify inverse existence, same-branch and cross-branch injectivity, and coverage. Finite diagrams help reveal the branch rule; the set identity and general case arguments establish the theorem. A saved explanation is practice evidence, not an automatic certification of the proof.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

Take A=B=N₀, f(n)=n+2 and g(n)=n+1. Compute A₀=A∖g(B), the stages A_j, their union C and the resulting h. List h(0),…,h(8), and verify coverage using residue classes modulo three.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For injections f:A→B and g:B→A define A₀=A∖g(B), A_(n+1)=g(f(A_n)), C=∪ₙ≥₀A_n. Prove C=A₀∪g(f(C)) and show that h(a)=f(a) on C and g⁻¹(a) outside C is a well-defined map A→B. Do not assume the stages exhaust A.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Prove h is injective in the general construction. Include both same-branch cases and a possible equality between outputs from different branches.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Prove h is onto B. Then analyze A₀=∅, C=A and A=∅ under the original injection assumptions. Does A₀=∅ force f to be onto?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

A proposed proof chooses h(a)=f(a) for an arbitrary subset D⊆A and h(a)=g⁻¹(a) elsewhere. Refute it using f(n)=g(n)=n+1 on N₀ and D={0}. Identify which properties of C the general construction supplies that this shortcut lacks.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Let K=[0,1) and I=(0,1]. Suppose a separate canonical-digit proof supplies an injection J:K×K→K. Use reflection to build an injection I×I→I, checking endpoints. Then construct a bijection I→I×I using the theorem proved here: state both injections, the generated sets and both branches. Explain what has and has not been made algorithmic.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.