This deck compares the sizes of infinite sets by means of bijections, covering equinumerosity, Dedekind-infinite sets, and countability. It builds explicit bijections for the naturals, the integers, pairs, and the rationals, proves that a countable union of countable sets stays countable, and uses the Schroeder-Bernstein theorem. It targets the misconceptions that a proper subset must be smaller, that the integers outnumber the naturals, and that countable means finite.
Subject: Foundations of Higher Mathematics · 114 slides · symbolic lesson
Open the interactive version of this deck · Homework for this lesson
Objectives
By the end of this deck you can:
1. Compare the sizes of two sets by building a bijection, not by counting.
2. Define countable and prove a set is countable by exhibiting an explicit enumeration.
3. Show the integers, the pairs of naturals, and the rationals are all countable.
4. Use the Schroeder-Bernstein theorem to get a bijection from two injections, and explain why a proper subset of an infinite set can have the same size.
Warm-up
Discussion prompt
Before we open Cardinality I: Countable Sets: without looking back, what was the main idea of Modular Arithmetic & Congruence, and what could you do by the end of it that you could not do before?
Hint: One sentence for the idea, one for the skill. If the second one is blank, that is the part to revisit.
Answer:
That deck presents congruence modulo n as an equivalence relation that is also compatible with addition and multiplication, which is what gives the ring Z/nZ. It covers units and the gcd, modular inverses via the extended Euclidean algorithm, the theorems of Fermat and Euler, fast exponentiation, the Chinese Remainder Theorem, and RSA. It targets the traps of cancelling by something that is not a unit, misapplying Fermat's theorem when the gcd is not 1, reducing "mod" to a bare remainder operator, and using the Chinese Remainder Theorem with moduli that are not coprime.
Concept
For finite sets, size is easy: count the elements. But you cannot count an infinite set to the end.
So we need a way to compare sizes that never mentions a number. The tool is matching: pair every element of one set with exactly one element of the other.
Two sets have the same size when such a perfect matching exists. This one idea powers the entire theory of infinite cardinality.
Counterexample
Discussion prompt
For finite sets, size is easy: count the elements. But you cannot count an infinite set to the end.
That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.
Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.
Answer:
Two sets have the same size when such a perfect matching exists. This one idea powers the entire theory of infinite cardinality.
Intuition
A shepherd with no numbers can still check whether every sheep came home: drop one pebble in a jar per sheep leaving, remove one per sheep returning. Empty jar means all present.
He never counted. He built a one-to-one correspondence between sheep and pebbles. Sameness of size is matching, and matching needs no numbers.
We will use exactly this move on infinite sets, where counting is impossible but matching still works.
Analogy
Discussion prompt
Explain Counting is really pairing by analogy to something with no Foundations of Higher Mathematics in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.
Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.
Answer:
A shepherd with no numbers can still check whether every sheep came home: drop one pebble in a jar per sheep leaving, remove one per sheep returning. Empty jar means all present.
Concept
An injection from A to B places every element of A into B with no collisions: different inputs get different outputs.
\[ f : A \to B \text{ injective} \iff \big(f(x)=f(y) \implies x=y\big) \]
If such an f exists, A fits inside B, so A has at most as many elements as B.
\[ |A| \le |B| \]
Explain it
Discussion prompt
Explain Injection: at most as many to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.
Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.
Answer:
An injection from A to B places every element of A into B with no collisions: different inputs get different outputs.
Concept
A bijection is an injection that is also onto: every element of B is hit exactly once. It is a perfect matching, reversible by an inverse.
equinumerous — Sets A and B are equinumerous when a bijection between them exists. We write that their cardinalities are equal. This is the definition of 'same size' for all sets, finite or infinite.
\[ |A| = |B| \iff \exists\, f : A \to B \text{ a bijection} \]
Ranking
Put in order
Put the moves of A warm-up bijection between finite sets into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Send a to 1, b to 2, c to 3. Any pairing that uses each target once will do; we just exhibit one.
Worked example
Show the letters and the numbers below have the same size.
\[ A = \{a, b, c\}, \qquad B = \{1, 2, 3\} \]
Propose a matching
Why: Send a to 1, b to 2, c to 3. Any pairing that uses each target once will do; we just exhibit one.
Check it is injective
Why: The three outputs 1, 2, 3 are distinct, so distinct inputs give distinct outputs.
Check it is onto
Why: Every element of B appears as an output, so nothing in B is missed.
Verify by counting the inverse pairs
Why: The inverse sends 1 to a, 2 to b, 3 to c, a genuine two-sided inverse. A bijection exists, so the sets are equinumerous.
Picture it
Animation
Shows: Each line of the worked example "A warm-up bijection between finite sets", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The three outputs 1, 2, 3 are distinct, so distinct inputs give distinct outputs.
Concept
Equinumerosity behaves like equality: it is reflexive, symmetric, and transitive.
\[ |A|=|A|, \quad |A|=|B|\implies|B|=|A|, \quad |A|=|B|\wedge|B|=|C|\implies|A|=|C| \]
So the collection of all sets splits into classes of equal size. A cardinal number is the name of one such class.
Intuition
Think of a cardinal number as the shared shape of every set you can match up. All three-element sets share one shape; we call it three.
Infinite sets have shapes too. The point of this deck is that many infinite sets you would guess are different sizes actually share one shape.
Step zero
Discussion prompt
Equinumerosity really is an equivalence relation — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Reflexive: the identity works
Answer:
Worked example
We check the three properties using only bijections.
Reflexive: the identity works
Why: The identity map on A is a bijection from A to A, so every set matches itself.
Symmetric: invert the bijection
Why: If f is a bijection from A to B, its inverse is a bijection from B to A, so the relation is symmetric.
Transitive: compose
Why: If f matches A to B and g matches B to C, then the composite matches A to C, because a composite of bijections is a bijection.
\[ g \circ f : A \to C \]
Verify closure of the argument
Why: Identity, inverse, and composite are all bijections, so all three axioms hold. Equinumerosity is an equivalence relation.
Picture it
Animation
Shows: Each line of the worked example "Equinumerosity really is an equivalence relation", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Identity, inverse, and composite are all bijections, so all three axioms hold. Equinumerosity is an equivalence relation.
Pattern
1. Name an explicit rule from A to B
Why: A formula or a described correspondence. Vague 'they feel the same' is not a proof.
2. Prove it is injective
Why: Assume two inputs share an output and force the inputs to be equal.
3. Prove it is onto
Why: Take an arbitrary target and produce an input that maps to it, often by writing the inverse.
4. Or invoke Schroeder-Bernstein
Why: If building a bijection directly is hard, two injections one each way also suffice, as we will see.
Concept
A set is finite when it matches an initial block of the counting numbers.
\[ A \text{ finite} \iff |A| = |\{1, 2, \dots, n\}| \text{ for some } n \ge 0 \]
For finite sets the old intuition holds: a proper subset is always strictly smaller. Remove an element and no rematching can recover the size.
A set is infinite when it is not finite. Everything surprising in this deck happens here.
Concept
Dedekind gave a definition of infinite that needs no numbers at all, using only matching.
Dedekind-infinite — A set is infinite exactly when it can be put in bijection with a proper subset of itself: you can throw elements away and still match what remains to the whole.
\[ A \text{ infinite} \iff \exists\, B \subsetneq A \text{ with } |A| = |B| \]
Definition probe
Sort into buckets
Every line below is part of the definition of equinumerous or of Dedekind-infinite — one or the other, never both. Put each where it belongs.
Intuition
A hotel has one room per counting number, all full. A new guest arrives. There is still room: ask every guest to move up one room.
The guest in room n moves to room n plus 1. Room 1 opens up, nobody is evicted, the new guest checks in.
A full infinite hotel absorbed one more. That is Dedekind-infinite in a bathrobe: the whole matched a proper part.
Estimation
Predict first
Make the hotel shift precise. Let the naturals start at zero.
Commit before you compute: what does The naturals match the naturals minus one room come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.
Correct: Verify with the inverse
Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. The map sending k to k minus 1 undoes f on the target, confirming a bijection.
Worked example
Make the hotel shift precise. Let the naturals start at zero.
\[ \mathbb{N} = \{0, 1, 2, \dots\}, \qquad f(n) = n + 1 \]
State the target set
Why: The image of f is every natural except 0, a proper subset of the naturals.
\[ f : \mathbb{N} \to \mathbb{N} \setminus \{0\} \]
Injective
Why: If n plus 1 equals m plus 1 then n equals m; adding one is cancellable.
Onto its target
Why: Any positive natural k equals f of (k minus 1), and k minus 1 is a natural, so every target is hit.
Verify with the inverse
Why: The map sending k to k minus 1 undoes f on the target, confirming a bijection. The naturals are equinumerous with a proper subset of themselves.
Picture it
Animation
Shows: Each line of the worked example "The naturals match the naturals minus one room", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The map sending k to k minus 1 undoes f on the target, confirming a bijection. The naturals are equinumerous with a proper subset of themselves.
Missing information
Discussion prompt
Even more striking: half the naturals is the same size as all of them.
What do you need to know — or decide — before the first line can be written? List everything the problem has to hand you.
Hint: Anything you would have to invent to get started is a thing the problem must supply.
Answer:
If 2n equals 2m then n equals m; doubling is cancellable over the naturals.
Worked example
Even more striking: half the naturals is the same size as all of them.
\[ g : \mathbb{N} \to E, \quad E = \{0, 2, 4, \dots\}, \quad g(n) = 2n \]
Injective
Why: If 2n equals 2m then n equals m; doubling is cancellable over the naturals.
Onto
Why: Every even number is 2 times some natural, namely half of it, so each even target is produced.
Tabulate the pairing
Why: The correspondence never runs out and never collides.
| n | g(n) = 2n |
|---|---|
| 0 | 0 |
| 1 | 2 |
| 2 | 4 |
| 3 | 6 |
Verify the inverse
Why: Sending an even number back to half itself undoes g. So the evens and the naturals are equinumerous, though the evens are a proper subset.
Picture it
Animation
Shows: Each line of the worked example "The naturals match only the even numbers", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Sending an even number back to half itself undoes g. So the evens and the naturals are equinumerous, though the evens are a proper subset.
Anomaly
Predict first
A student writes this, and it looks reasonable:
The finite reflex: the evens sit inside the naturals and skip every odd number, so surely there are fewer evens.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: 'Removing elements always shrinks a set' is imported from finite experience where it is true.
Size is decided by matching, not by containment. The doubling map matches them perfectly.
Why: 'Removing elements always shrinks a set' is imported from finite experience where it is true.
Trap
The finite reflex: the evens sit inside the naturals and skip every odd number, so surely there are fewer evens.
The false claim
Why: 'Removing elements always shrinks a set' is imported from finite experience where it is true.
\[ E \subsetneq \mathbb{N} \;\Rightarrow\; |E| < |\mathbb{N}| \quad (\text{WRONG}) \]
Size is decided by matching, not by containment. The doubling map matches them perfectly.
The correct conclusion
Why: A bijection exists, so the cardinalities are equal. For infinite sets, a proper subset can have the same size; that is exactly what infinite means.
\[ |E| = |\mathbb{N}| \]
Notation
Annotate
From Trap: a proper subset must be strictly smaller — read this one piece at a time. What is each part doing?
On: \( E \subsetneq \mathbb{N} \;\Rightarrow\; |E| < |\mathbb{N}| \quad (\text{WRONG}) \)
Elimination
Eliminate the wrong options
Is g a bijection from the naturals onto the even naturals?
3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.
Survives elimination: A
Why: Doubling is injective since 2n = 2m forces n = m, and it is onto E because every even number is twice its own half. A two-sided inverse exists (halving), so g is a bijection.
Check
Consider the doubling map from the naturals to the even naturals.
\[ g : \mathbb{N} \to E, \quad g(n) = 2n \]
Check your understanding
Is g a bijection from the naturals onto the even naturals?
Answer: A
Why: Doubling is injective since 2n = 2m forces n = m, and it is onto E because every even number is twice its own half. A two-sided inverse exists (halving), so g is a bijection.
Concept
The naturals are the yardstick for the smallest kind of infinity.
countable — A set is countable when it is finite or equinumerous with the natural numbers. If it is infinite and countable, we call it countably infinite.
\[ A \text{ countable} \iff A \text{ finite } \vee\; |A| = |\mathbb{N}| \]
Concept
The cardinality of the naturals gets its own name.
\[ |\mathbb{N}| = \aleph_0 \]
It is the smallest infinite cardinal: every infinite set contains a copy of the naturals, so nothing infinite is smaller. Later decks show larger infinities exist.
Intuition
A bijection with the naturals is exactly a way to write the set as an infinite list with a first entry, a second, a third, and so on, missing nothing and repeating nothing.
\[ A = \{\, a_0,\; a_1,\; a_2,\; a_3,\; \dots \,\} \]
To prove a set countable, the working move is: produce such a list, or a systematic recipe that reaches every element in finite time.
Concept
Often it is easier to allow a sloppy list that repeats. That still proves countability.
If there is a surjection from the naturals onto a nonempty set A, then A is countable: walk the list and delete anything already seen to recover a clean bijection.
\[ \exists\, s : \mathbb{N} \twoheadrightarrow A \;\implies\; A \text{ countable} \]
Worked example
The integers run off to infinity in two directions, yet they still form one list. Zig-zag out from zero.
\[ f : \mathbb{N} \to \mathbb{Z}, \quad f(n) = \begin{cases} n/2 & n \text{ even} \\ -(n+1)/2 & n \text{ odd} \end{cases} \]
List the first few values
Why: Even inputs give the non-negatives, odd inputs give the negatives; the two streams interleave.
| n | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| f(n) | 0 | -1 | 1 | -2 | 2 | -3 |
Injective
Why: Even inputs map to non-negative integers and odd inputs to negative integers, so the two cases never collide; within each case the map is one-to-one.
Onto
Why: A non-negative integer k is f(2k); a negative integer minus-m is f(2m minus 1). Every integer is reached.
Verify with a concrete inverse value
Why: Check that minus-2 is hit: minus-2 needs 2m minus 1 with m equal 2, giving n equal 3, and indeed f(3) equals minus-2. A bijection exists, so the integers are countable.
Picture it
Animation
Shows: Each line of the worked example "The integers are countable", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Check that minus-2 is hit: minus-2 needs 2m minus 1 with m equal 2, giving n equal 3, and indeed f(3) equals minus-2. A bijection exists, so the integers are countable.
Estimation
Predict first
To nail the bijection, write the inverse in closed form.
Commit before you compute: what does A closed-form inverse from the integers back to the naturals come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.
Correct: Verify the composite is the identity
Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. Compute f of h of minus-2: h(minus-2) equals 3 and f(3) equals minus-2, returning the input.
Worked example
To nail the bijection, write the inverse in closed form.
\[ h : \mathbb{Z} \to \mathbb{N}, \quad h(k) = \begin{cases} 2k & k \ge 0 \\ -2k - 1 & k < 0 \end{cases} \]
Check h on the non-negatives
Why: For k at least 0, h gives an even natural 2k, matching the even inputs of f.
\[ h(0)=0,\; h(1)=2,\; h(2)=4 \]
Check h on the negatives
Why: For k below 0, h gives an odd natural, matching the odd inputs of f.
\[ h(-1)=1,\; h(-2)=3,\; h(-3)=5 \]
Verify the composite is the identity
Why: Compute f of h of minus-2: h(minus-2) equals 3 and f(3) equals minus-2, returning the input. Since h inverts f, both are bijections and the count is confirmed.
\[ f(h(-2)) = f(3) = -2 \]
Picture it
Animation
Shows: Each line of the worked example "A closed-form inverse from the integers back to the naturals", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: For k at least 0, h gives an even natural 2k, matching the even inputs of f.
Anomaly
Predict first
A student writes this, and it looks reasonable:
The naturals sit inside the integers, and the integers add a whole negative half, so surely there are twice as many integers.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: Containment plus 'extra stuff' is read as strictly larger, again importing finite intuition.
The zig-zag list already threads every integer into a single sequence indexed by the naturals.
Why: Containment plus 'extra stuff' is read as strictly larger, again importing finite intuition.
Trap
The naturals sit inside the integers, and the integers add a whole negative half, so surely there are twice as many integers.
The false picture
Why: Containment plus 'extra stuff' is read as strictly larger, again importing finite intuition.
\[ \mathbb{N} \subsetneq \mathbb{Z} \;\Rightarrow\; |\mathbb{N}| < |\mathbb{Z}| \quad (\text{WRONG}) \]
The zig-zag list already threads every integer into a single sequence indexed by the naturals.
The correct conclusion
Why: The interleaving bijection matches the two sets exactly, so they share the cardinal aleph-null. Adding a countable pile to a countable set keeps it countable.
\[ |\mathbb{Z}| = |\mathbb{N}| = \aleph_0 \]
Prediction
Predict first
Which map is a bijection from the naturals onto the integers?
Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.
Correct: Even n go to n/2, odd n go to minus (n+1)/2.
Why: Splitting by parity sends the evens to the non-negative integers and the odds to the negative integers, covering every integer exactly once with no overlap, which is a bijection.
Check
We want a bijection from the naturals (starting at zero) onto all integers.
Check your understanding
Which map is a bijection from the naturals onto the integers?
Answer: A
Why: Splitting by parity sends the evens to the non-negative integers and the odds to the negative integers, covering every integer exactly once with no overlap, which is a bijection.
Concept
This is the workhorse fact of the whole subject: the grid of ordered pairs of naturals is countable.
\[ |\mathbb{N} \times \mathbb{N}| = |\mathbb{N}| = \aleph_0 \]
The naive listing fails, and seeing why sets up the fix. That failure is a trap we will make explicit shortly.
Intuition
Picture the pairs as an infinite grid, row m down and column n across. Do not scan a whole row: the first row alone never ends, so nothing below it is ever reached.
Instead sweep the finite anti-diagonals, the sets of pairs whose coordinates sum to a fixed value. Each diagonal has finitely many cells, so you finish it and move to the next.
Every pair sits on exactly one diagonal and gets reached in finite time. That is a genuine enumeration.
Picture it
Figure (svg): A grid of natural-number pairs with arrows sweeping successive anti-diagonals, numbering cells 0,1,2,3,4,5 in the order (0,0),(1,0),(0,1),(2,0),(1,1),(0,2).
Discussion prompt
Read the picture before the words. What is this showing, and what is the one thing it is built to make obvious? Commit to an answer, then read on.
Hint: Name the parts, then say what changes between them — and if nothing changes, say what is being held still.
Answer:
The circled numbers are the order the cells are visited. Cell zero is the origin pair, then the sum-one diagonal, then the sum-two diagonal, and so on.
Concept
Figure (svg): A grid of natural-number pairs with arrows sweeping successive anti-diagonals, numbering cells 0,1,2,3,4,5 in the order (0,0),(1,0),(0,1),(2,0),(1,1),(0,2).
The circled numbers are the order the cells are visited. Cell zero is the origin pair, then the sum-one diagonal, then the sum-two diagonal, and so on.
Step zero
Discussion prompt
The Cantor pairing function — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Read the two pieces
Answer:
Worked example
Turn the diagonal sweep into a formula on the naturals starting at zero.
\[ \pi(m, n) = \frac{(m+n)(m+n+1)}{2} + n \]
Read the two pieces
Why: The triangular term counts every cell on earlier diagonals; adding n walks along the current diagonal to the right cell.
Evaluate the first diagonals
Why: Plugging in reproduces exactly the picture's visiting order.
| (m,n) | (0,0) | (1,0) | (0,1) | (2,0) | (1,1) | (0,2) |
|---|---|---|---|---|---|---|
| pi | 0 | 1 | 2 | 3 | 4 | 5 |
Note it is onto with no gaps
Why: Each diagonal of length d+1 exactly fills the next block of outputs, so every natural is produced once as (m,n) ranges over the grid.
Verify a value by hand
Why: Check (1,1): sum is 2, triangular term is 2 times 3 over 2 equals 3, plus n equals 1 gives 4, matching the table. The pairing is a bijection, so the grid is countable.
Picture it
Animation
Shows: Each line of the worked example "The Cantor pairing function", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Check (1,1): sum is 2, triangular term is 2 times 3 over 2 equals 3, plus n equals 1 gives 4, matching the table. The pairing is a bijection, so the grid is countable.
Worked example
A bijection must be reversible: given an output, recover the pair. Take the value five.
Find the diagonal index w
Why: w is the largest triangular index not exceeding the value, computed from the standard floor formula.
\[ w = \left\lfloor \frac{\sqrt{8z+1} - 1}{2} \right\rfloor, \quad z = 5 \Rightarrow w = \left\lfloor \frac{\sqrt{41}-1}{2} \right\rfloor = 2 \]
Subtract the triangular offset
Why: The offset t is the count of cells before this diagonal; the remainder is the column n.
\[ t = \frac{w(w+1)}{2} = 3, \qquad n = z - t = 5 - 3 = 2 \]
Recover the row
Why: The row is the leftover of the diagonal after the column is fixed.
\[ m = w - n = 2 - 2 = 0 \]
Verify by re-pairing
Why: Feed (0,2) back into pi: sum 2, triangular term 3, plus 2 gives 5, the original value. The inverse is correct, confirming a genuine bijection.
Picture it
Animation
Shows: Each line of the worked example "Inverting the Cantor pairing", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Feed (0,2) back into pi: sum 2, triangular term 3, plus 2 gives 5, the original value. The inverse is correct, confirming a genuine bijection.
Concept
The pairing generalizes. If A and B can each be listed, their grid can be swept diagonally the same way.
\[ A, B \text{ countable} \;\implies\; A \times B \text{ countable} \]
By induction this extends to any fixed finite product: triples, quadruples, and beyond stay countable.
Ranking
Put in order
Put the moves of Pairs of integers are countable into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Apply the integer-to-natural map h to each slot, turning an integer pair into a natural pair without collisions since h is injective.
Worked example
Compose the tools we already built. We know each integer is coded by a natural, and each pair of naturals by a natural.
Code each coordinate
Why: Apply the integer-to-natural map h to each slot, turning an integer pair into a natural pair without collisions since h is injective.
\[ (a, b) \mapsto (h(a), h(b)) \in \mathbb{N} \times \mathbb{N} \]
Code the pair
Why: Apply the Cantor pairing to the natural pair, landing on a single natural, again injectively.
\[ (a, b) \mapsto \pi(h(a), h(b)) \in \mathbb{N} \]
Verify injectivity of the composite
Why: Both h-on-each-slot and pi are injective, so the composite is injective; an injection into the naturals makes the integer grid countable. Check that distinct pairs like (1,0) and (0,1) get distinct codes, which they do.
Picture it
Animation
Shows: Each line of the worked example "Pairs of integers are countable", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Both h-on-each-slot and pi are injective, so the composite is injective; an injection into the naturals makes the integer grid countable. Check that distinct pairs like (1,0) and (0,1) get distinct codes, which they do.
Anomaly
Predict first
A student writes this, and it looks reasonable:
It is tempting to list the pairs by finishing row zero, then row one, then row two.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: Row zero is the pairs (0,0), (0,1), (0,2), and so on forever.
Sweep the finite diagonals instead, so every cell is reached after finitely many steps.
Why: Row zero is the pairs (0,0), (0,1), (0,2), and so on forever. You never finish it, so (1,0) is never assigned an index.
Trap
It is tempting to list the pairs by finishing row zero, then row one, then row two.
Where it breaks
Why: Row zero is the pairs (0,0), (0,1), (0,2), and so on forever. You never finish it, so (1,0) is never assigned an index.
\[ 0 \mapsto (0,0),\; 1 \mapsto (0,1),\; 2 \mapsto (0,2),\; \dots \;(1,0)\ \text{unreached} \]
Sweep the finite diagonals instead, so every cell is reached after finitely many steps.
Why it works
Why: The diagonal through a pair has coordinate sum m plus n, a fixed finite number, and only finitely many cells precede it, so its index is finite.
\[ (1,0) \mapsto 1, \quad (0,1) \mapsto 2, \quad (2,0) \mapsto 3 \]
Translation
\( (1,0) \mapsto 1, \quad (0,1) \mapsto 2, \quad (2,0) \mapsto 3 \)
Draw it
Translate both ways. First write the expression above as a sentence with no symbols in it at all. Then cover it, and write your sentence back as notation. If the two versions disagree, the disagreement is the thing to fix.
Check
We want every pair of naturals to receive a finite index.
Check your understanding
Which strategy actually lists every pair of naturals in finite time?
Answer: A
Why: Each anti-diagonal holds finitely many pairs, so it is completed in finitely many steps, and every pair lies on exactly one diagonal, giving it a finite index. This is the Cantor pairing enumeration.
Concept
Countability passes down to subsets: you cannot escape countability by carving out a piece.
Given a listing of the whole set, walk it and keep only the entries that land in the subset. What survives is still a list, possibly finite.
\[ B \subseteq A, \; A \text{ countable} \;\implies\; B \text{ countable} \]
Hypothesis
Predict first
Every infinite subset of the naturals is countable is about to be worked. State your hypothesis first: which rule or definition decides this one, and what is the first move it forces? Then watch whether the example agrees with you.
Correct: Define the enumeration by least elements
Why: Well-ordering of the naturals guarantees a least element; peel it off, then repeat on the rest to get a strictly increasing list.
A hypothesis you wrote down is falsifiable; a vague sense of how it will go is not. If the example opens somewhere else, that gap is the thing worth chasing.
Worked example
Take any infinite set of naturals and list it in increasing order.
\[ S \subseteq \mathbb{N}, \; S \text{ infinite} \]
Define the enumeration by least elements
Why: Well-ordering of the naturals guarantees a least element; peel it off, then repeat on the rest to get a strictly increasing list.
\[ s_0 = \min S, \quad s_{k+1} = \min\big(S \setminus \{s_0, \dots, s_k\}\big) \]
Injective
Why: The sequence is strictly increasing, so all terms are distinct.
Onto S
Why: Any element x of S has only finitely many members of S below it, so it appears at some finite stage; the process never skips it.
Verify infinity is used
Why: Because S is infinite the minimum always exists at every stage, so the list never terminates. Check on the primes: this yields 2,3,5,7,..., matching each prime to its index. So S is countably infinite.
Picture it
Animation
Shows: Each line of the worked example "Every infinite subset of the naturals is countable", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Because S is infinite the minimum always exists at every stage, so the list never terminates. Check on the primes: this yields 2,3,5,7,..., matching each prime to its index. So S is countably infinite.
Concept
Stack countably many countable sets and the total is still countable.
\[ A_0, A_1, A_2, \dots \text{ each countable} \;\implies\; \bigcup_{i \in \mathbb{N}} A_i \text{ countable} \]
This step quietly uses the axiom of choice to pick one listing per set at once. With the listings chosen, the rest is pure grid-sweeping.
Intuition
Write set number i as its own horizontal list, and stack these lists vertically. Now the element in row i, column j is indexed by the pair (i, j).
That is exactly the grid of pairs, which we already know is countable by the diagonal sweep. Overlaps between the sets only shorten the final list, never lengthen it.
Step zero
Discussion prompt
Enumerating the positive rationals — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Place fractions on the grid and sweep diagonals
Answer:
Worked example
Each positive rational is a ratio of a numerator and a denominator, so it lives in the grid of positive pairs.
\[ \mathbb{Q}^{+} = \left\{ \tfrac{p}{q} : p, q \in \mathbb{N},\ p,q \ge 1 \right\} \]
Place fractions on the grid and sweep diagonals
Why: Row p, column q holds p over q. Sweeping by the sum p plus q visits finitely many fractions per diagonal, so every fraction is reached.
Skip non-reduced repeats
Why: Discard any fraction not in lowest terms so each rational value appears once; this is deleting duplicates from a surjection.
\[ \tfrac{1}{1},\ \tfrac{2}{1},\ \tfrac{1}{2},\ \tfrac{3}{1},\ \tfrac{1}{3},\ \tfrac{4}{1},\ \tfrac{3}{2},\ \tfrac{2}{3},\ \tfrac{1}{4}, \dots \]
Verify a duplicate was skipped
Why: On the sum-four diagonal, two over two equals one, already listed as one over one, so it is dropped. Every positive rational appears exactly once, so the positive rationals are countable.
Picture it
Animation
Shows: Each line of the worked example "Enumerating the positive rationals", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: On the sum-four diagonal, two over two equals one, already listed as one over one, so it is dropped. Every positive rational appears exactly once, so the positive rationals are countable.
Concept
Extend from the positives to everything.
The rationals are the union of the positive rationals, the negative rationals, and the single element zero. That is a union of three countable sets, hence countable.
\[ |\mathbb{Q}| = \aleph_0 \]
Anomaly
Predict first
A student writes this, and it looks reasonable:
Each rational fits between two others, the rationals feel dense and endless, so surely gluing infinitely many countable pieces breaks past countable.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: Confuses density on the line with cardinality.
The list-of-lists grid indexes the whole union by pairs of naturals.
Why: Confuses density on the line with cardinality. Being packed tightly says nothing about how many elements there are.
Trap
Each rational fits between two others, the rationals feel dense and endless, so surely gluing infinitely many countable pieces breaks past countable.
The false leap
Why: Confuses density on the line with cardinality. Being packed tightly says nothing about how many elements there are.
\[ \bigcup_{i} A_i \text{ (each countable)} \Rightarrow \text{uncountable} \quad (\text{WRONG}) \]
The list-of-lists grid indexes the whole union by pairs of naturals.
The correct conclusion
Why: A countable union of countable sets injects into the countable grid of pairs, so it stays countable. Density is irrelevant; the rationals are countable despite being dense.
\[ \bigcup_{i \in \mathbb{N}} A_i \hookrightarrow \mathbb{N} \times \mathbb{N} \]
Break the constraint
Discussion prompt
The rule this trap just fixed:
A countable union of countable sets injects into the countable grid of pairs, so it stays countable. Density is irrelevant; the rationals are countable despite being dense.
Now break it on purpose. Build a case that violates it and follow the consequences until something visibly fails. Where does the failure first show up — and would you have noticed it if you had not been looking?
Hint: The dangerous rules are the ones whose violation still produces an answer. If yours fails loudly, try to find one that fails quietly.
Answer:
Confuses density on the line with cardinality. Being packed tightly says nothing about how many elements there are.
Check
Recall how the enumeration of the rationals was built.
Check your understanding
What is the correct reason the rationals are countable?
Answer: A
Why: Writing a rational as a numerator over a denominator injects the rationals into the grid of integer pairs, which the diagonal sweep enumerates; deleting non-reduced repeats yields a clean listing.
Concept
Applying a function can only merge or relabel elements; it never creates new ones out of nothing.
If A is countable and f is any function on A, then the image of A under f is countable, because the listing of A pushes forward to a listing of the image.
\[ A \text{ countable} \;\implies\; f[A] \text{ countable} \]
Missing information
Discussion prompt
If A and B are each countable, their union is countable. The trick is to interleave.
What do you need to know — or decide — before the first line can be written? List everything the problem has to hand you.
Hint: Anything you would have to invent to get started is a thing the problem must supply.
Answer:
Alternate: even positions draw from A, odd positions from B, so both lists advance and neither is starved.
Worked example
If A and B are each countable, their union is countable. The trick is to interleave.
\[ A = \{a_0, a_1, \dots\}, \quad B = \{b_0, b_1, \dots\} \]
Zip the two lists together
Why: Alternate: even positions draw from A, odd positions from B, so both lists advance and neither is starved.
\[ c_{2k} = a_k, \qquad c_{2k+1} = b_k \]
Onto the union
Why: Any element of A is some a_k at position 2k, and any element of B is some b_k at position 2k plus 1, so every element appears.
Remove duplicates if the sets overlap
Why: Deleting repeats from a surjection still leaves a listing, so the union is countable even when A and B share elements.
Verify on a tiny case
Why: Take A the evens and B the odds; interleaving gives 0,1,2,3,... which is all of the naturals, exactly the union. The construction works.
Picture it
Animation
Shows: Each line of the worked example "Merging two lists into one", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Take A the evens and B the odds; interleaving gives 0,1,2,3,... which is all of the naturals, exactly the union. The construction works.
Concept
Numbers do not have to be simple fractions to be reachable by algebra.
algebraic number — A real or complex number that is a root of some nonzero polynomial with integer coefficients. Every rational qualifies, and so do many irrationals like the square root of two.
\[ \sqrt{2} \text{ is a root of } x^2 - 2 = 0 \]
Intuition
There are two finiteness levers. First, each polynomial of degree d has at most d roots, a finite haul. Second, the integer polynomials themselves can be listed.
So the algebraic numbers are a countable union, one finite batch of roots per polynomial. Sweep the polynomials, collect their roots, and you have listed every algebraic number.
Estimation
Predict first
Organize the integer polynomials by a size measure so each size gives only finitely many.
Commit before you compute: what does The algebraic numbers are countable come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.
Correct: Verify a specific algebraic number is captured
Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. The square root of two is a root of x squared minus two, whose height is 2 plus 1 plus 0 plus 2 equal to 5, so it appears at height five.
Worked example
Organize the integer polynomials by a size measure so each size gives only finitely many.
\[ H = n + |a_0| + |a_1| + \cdots + |a_n|, \quad \text{degree } n,\ \text{coefficients } a_i \in \mathbb{Z} \]
Each height value gives finitely many polynomials
Why: The degree and the absolute values of the coefficients are bounded by the fixed height, and there are only finitely many integer tuples under a bound.
Each polynomial gives finitely many roots
Why: A degree n polynomial has at most n roots, so each contributes a finite set of algebraic numbers.
Take the union over all heights
Why: Ranging the height over the naturals collects every algebraic number; this is a countable union of finite sets, hence countable.
\[ \overline{\mathbb{Q}} = \bigcup_{H \in \mathbb{N}} \{\text{roots of polynomials of height } H\} \]
Verify a specific algebraic number is captured
Why: The square root of two is a root of x squared minus two, whose height is 2 plus 1 plus 0 plus 2 equal to 5, so it appears at height five. The enumeration reaches it, confirming the algebraic numbers are countable.
Notation
Annotate
From The algebraic numbers are countable — read this one piece at a time. What is each part doing?
On: \( \overline{\mathbb{Q}} = \bigcup_{H \in \mathbb{N}} \{\text{roots of polynomials of height } H\} \)
Concept
Sometimes building a bijection outright is painful, but squeezing each set inside the other is easy.
Schroeder-Bernstein says two one-way injections are enough: if A embeds in B and B embeds in A, then A and B have exactly the same size.
\[ |A| \le |B| \;\wedge\; |B| \le |A| \;\implies\; |A| = |B| \]
Intuition
Each injection is a one-way fit. Chasing an element back and forth along the two injections carves the sets into matching chains and cycles.
On each chain there is a canonical way to pair the two sides. Assembling those local pairings is the actual bijection, so you never have to guess a global formula.
Step zero
Discussion prompt
The open and closed unit intervals have equal size — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Inject the open into the closed
Answer:
Worked example
Show the open interval and the closed interval are equinumerous. A direct bijection is fiddly; two injections are trivial.
\[ (0,1) \quad \text{versus} \quad [0,1] \]
Inject the open into the closed
Why: Inclusion works: the open interval is literally a subset of the closed one, and inclusion is injective.
\[ \iota(x) = x : (0,1) \hookrightarrow [0,1] \]
Inject the closed into the open
Why: Shrink and recenter so the endpoints move inside. This linear map is injective and its image avoids 0 and 1.
\[ g(x) = \tfrac{x}{2} + \tfrac{1}{4} : [0,1] \to \left[\tfrac14, \tfrac34\right] \subset (0,1) \]
Apply Schroeder-Bernstein
Why: Injections exist both ways, so the theorem hands us a bijection with no need to write it down.
Verify the second map lands strictly inside
Why: Check the endpoints: g of 0 is one quarter and g of 1 is three quarters, both strictly between 0 and 1, and g is injective since its slope is one half. Both injections are valid, so the two intervals have the same cardinality.
Picture it
Animation
Shows: Each line of the worked example "The open and closed unit intervals have equal size", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Check the endpoints: g of 0 is one quarter and g of 1 is three quarters, both strictly between 0 and 1, and g is injective since its slope is one half. Both injections are valid, so the two intervals have the same cardinality.
Anomaly
Predict first
A student writes this, and it looks reasonable:
A student insists that until you write a single clean formula matching every point of the open interval to a point of the closed one, the sizes are unproven.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: A direct piecewise bijection here exists but is annoying to construct, and the demand for it needlessly blocks the proof.
Schroeder-Bernstein exists precisely to remove this burden.
Why: A direct piecewise bijection here exists but is annoying to construct, and the demand for it needlessly blocks the proof.
Trap
A student insists that until you write a single clean formula matching every point of the open interval to a point of the closed one, the sizes are unproven.
Why this stalls
Why: A direct piecewise bijection here exists but is annoying to construct, and the demand for it needlessly blocks the proof.
Schroeder-Bernstein exists precisely to remove this burden.
The correct standard
Why: Two easy injections, one each way, already prove equal cardinality. The theorem guarantees the bijection abstractly; you never have to display it.
\[ |A|\le|B| \wedge |B|\le|A| \implies |A|=|B| \]
Two truths and a lie
Sort into buckets
Some of these hold up and some are the exact mistakes this lesson is built to prevent. Sort them.
Ranking
Put in order
Put the moves of Triples of naturals are countable too into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. The inner pairing turns (a, b) into a single natural injectively, since the Cantor pairing is a bijection.
Worked example
Nest the pairing to handle three coordinates instead of two.
\[ \tau(a, b, c) = \pi\big(\pi(a, b),\, c\big) \]
Pair the first two coordinates
Why: The inner pairing turns (a, b) into a single natural injectively, since the Cantor pairing is a bijection.
Pair the result with the third
Why: The outer pairing combines that natural with c into one natural, again injectively.
Conclude countability
Why: A composite of injections is an injection from the triples into the naturals, so the triples are countable; the same nesting handles any fixed number of coordinates.
Verify one triple decodes uniquely
Why: Encode (0, 0, 1): the inner pairing of (0,0) is 0, then the outer pairing of (0,1) is 2, and inverting the outer then inner pairing recovers (0,0,1). The code is reversible, so tau is a valid injection.
Picture it
Animation
Shows: Each line of the worked example "Triples of naturals are countable too", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: Encode (0, 0, 1): the inner pairing of (0,0) is 0, then the outer pairing of (0,1) is 2, and inverting the outer then inner pairing recovers (0,0,1). The code is reversible, so tau is a valid injection.
Concept
Aleph-null is the floor of the infinite. Any infinite set contains a listable copy of the naturals inside it.
So every set falls into one of three buckets: finite, countably infinite, or strictly larger than the naturals. There is no infinite size below aleph-null.
\[ A \text{ infinite} \;\implies\; \aleph_0 \le |A| \]
Explain it
Discussion prompt
Explain Countable or larger: no size in between the finite and aleph-null to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.
Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.
Answer:
Aleph-null is the floor of the infinite. Any infinite set contains a listable copy of the naturals inside it.
Concept
Everything we proved can be summarized as a strange arithmetic where the smallest infinity absorbs the usual operations.
\[ \aleph_0 + \aleph_0 = \aleph_0, \qquad \aleph_0 \cdot \aleph_0 = \aleph_0 \]
Doubling came from the integers, multiplying from the grid of pairs, and even a countable sum of copies stays put. Countable is a very sticky property.
Analogy
Discussion prompt
Explain The arithmetic of aleph-null by analogy to something with no Foundations of Higher Mathematics in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.
Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.
Answer:
Everything we proved can be summarized as a strange arithmetic where the smallest infinity absorbs the usual operations.
Concept
A listing of a set is exactly a program that, given an index, prints the corresponding element, and eventually prints each one.
So countable sets are the ones a machine can stream out completely. This is the same flavor as a semi-decidable set: you can enumerate its members, even if you cannot always decide non-membership.
It also foreshadows the sequel: there are only countably many programs, yet uncountably many real numbers, so most reals are not enumerable at all.
Counterexample
Discussion prompt
A listing of a set is exactly a program that, given an index, prints the corresponding element, and eventually prints each one.
That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.
Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.
Pattern
1. Try a direct listing or bijection with the naturals
Why: A formula or systematic sweep that reaches every element in finite time.
2. Or inject the set into a known countable set
Why: An injection into the naturals, the grid of pairs, or the rationals proves at-most-countable.
3. Or build it from countable pieces
Why: Subsets, finite products, and countable unions of countable sets are all countable; assemble your set from these.
4. Or squeeze both ways with Schroeder-Bernstein
Why: Injections into and out of a countable set pin the cardinality exactly.
Real world
Discussion prompt
Outside this lesson: where does Cardinality I: Countable Sets actually turn up? Name one concrete situation — a job, a piece of software someone ships, a decision somebody has to make — and say which part of Recipe: proving a set is countable is doing the work in it.
Hint: Vague is the failure mode here. "Engineering" is not a situation; "deciding whether this build is fast enough to ship" is.
Answer:
Comparing infinite sizes by bijection: equinumerosity, Dedekind-infinite sets, and countability. We build explicit bijections for the naturals, integers, pairs, and rationals, prove countable unions stay countable, and use Schroeder-Bernstein.
Commit first
Predict first
Which conclusion about the union is justified?
Commit to an answer, then rate it — certain, fairly sure, or guessing — and write the rating down before you turn the page.
Correct: The union is countable, whether or not the sets overlap.
Why: Indexing element j of set i by the pair (i, j) injects the union into the countable grid of pairs, so the union is countable; overlaps only delete duplicates and shorten the list.
The rating matters as much as the answer: confident-and-wrong is the combination that survives revision, because nothing about it feels like it needs revisiting.
Check
Suppose each set in a countable family is countable.
Check your understanding
Which conclusion about the union is justified?
Answer: A
Why: Indexing element j of set i by the pair (i, j) injects the union into the countable grid of pairs, so the union is countable; overlaps only delete duplicates and shorten the list.
Check
You have an injection from A into B and an injection from B into A.
Check your understanding
What does the Schroeder-Bernstein theorem let you conclude?
Answer: A
Why: Injections each way give at-most-as-many in both directions, and Schroeder-Bernstein promotes that to a genuine bijection, so the two sets have exactly the same cardinality.
Prediction
Predict first
Can every current guest and every new passenger get a room?
Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.
Correct: Yes: guests plus passengers form a countable union of countable sets, still countable, so they fit in the countable rooms.
Why: The guests and all bus passengers together are a countable union of countable sets, hence countable, so a bijection with the room numbers exists and everyone is assigned a room.
Check
The countably infinite hotel is full. Countably many buses arrive, each carrying countably many passengers.
Check your understanding
Can every current guest and every new passenger get a room?
Answer: A
Why: The guests and all bus passengers together are a countable union of countable sets, hence countable, so a bijection with the room numbers exists and everyone is assigned a room.
Elimination
Eliminate the wrong options
What is the value of the pairing at row 0, column 2?
3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.
Survives elimination: A
Why: The coordinate sum is 2, so the triangular term is 2 times 3 divided by 2, which is 3, and adding the column value 2 gives 5. That matches the diagonal enumeration order.
Check
Use the Cantor pairing on the naturals starting at zero.
\[ \pi(m, n) = \frac{(m+n)(m+n+1)}{2} + n \]
Check your understanding
What is the value of the pairing at row 0, column 2?
Answer: A
Why: The coordinate sum is 2, so the triangular term is 2 times 3 divided by 2, which is 3, and adding the column value 2 gives 5. That matches the diagonal enumeration order.
Connect it up
Draw it
One page, no notation unless you need it: draw how these connect — Recipe: proving two sets have the same size · Recipe: proving a set is countable · How big is a set, really? · Counting is really pairing · Injection: at most as many. Put an arrow wherever one of them is what makes another possible, and label the arrow with why.
Recap
Size for infinite sets is decided by bijection, never by counting or by containment. A proper subset of an infinite set can match the whole.
Countable means finite or matchable with the naturals, equivalently listable as a sequence. The integers, the grid of pairs, the rationals, and the algebraic numbers are all countable.
| Tool | What it proves |
|---|---|
| Explicit bijection | same size as the naturals |
| Diagonal sweep | pairs and products stay countable |
| Countable union | gluing countable pieces stays countable |
| Schroeder-Bernstein | two injections give equal size |
Next: not every infinite set is countable. Cantor's diagonal argument shows the reals are strictly larger, opening an endless tower of infinities.
Want this taught 1-on-1? Alexander tutors Foundations of Higher Mathematics — $55/session, free consultation.