Chapter 6 begins with a change of viewpoint. Earlier chapters built and studied particular number systems. Here the question is broader: how can we compare the sizes of sets, especially when the sets are infinite?
For finite sets, counting elements is enough. For infinite sets, the useful notion is not ordinary counting but the existence of carefully chosen functions. A bijection says that two sets have exactly matching elements. An injection says that one set can be faithfully coded inside another.
Same cardinality
Definition
Same cardinality
Let and be sets. We say that and have the same cardinality, and write
if there exists a bijection .
This definition deliberately avoids saying that the elements have to look similar. The two sets may have very different kinds of elements. What matters is whether every element of can be paired with exactly one element of , and every element of is paired with exactly one element of .
For finite sets this agrees with ordinary counting. If a set can be put in
bijection with a set of n labels, then it has n elements.
Definition
Finite set
A set is finite if
for some natural number n.
In that case we usually write simply .
The notation |X| is therefore not a number in the usual sense for every set.
It is a symbol for the size, or cardinality, of . For finite sets this size
is represented by a natural number. For infinite sets, we compare sizes through
maps.
Countable and uncountable sets
Definition
Countable and uncountable
A set is countable if it is finite or if
A set which is not countable is called uncountable.
Thus a countably infinite set is one whose elements can be listed in a sequence without omission and without repetition:
depending on the indexing convention for . The exact starting index is not important. What matters is that there is a bijection from the natural numbers to the set.
Common mistake
Countable does not mean finite
In this chapter, countable includes finite sets and sets with the same cardinality as . The word "countable" is therefore broader than "finite".
The integers are countable
A useful exercise is to prove that
The key idea is that the integers can be arranged in a single infinite list.
Worked example
Enumerating the integers
One convenient ordering is
This list reaches every integer exactly once. It therefore gives a bijection from to after choosing the corresponding indexing convention.
For example, with , define
for . Then is bijective.
Proof
Why this proves countability
The example is important because it shows the first surprise about infinite sets: a proper-looking enlargement of can still have the same cardinality as .
The rationals are countable
Theorem
The rationals are countable
The set of rational numbers is countable.
The proof first treats the positive rationals. It is enough to enumerate , because then one may interleave positive rationals, negative rationals, and zero.
The positive rational numbers can be organized by numerator and denominator. A positive rational in lowest terms has the form
where are positive and share no common factor greater than 1.
Place this rational at row p and column q in an infinite grid. Then traverse
the grid by diagonals:
and record the reduced fractions encountered along the way.
Worked example
The first few positive rationals by diagonals
Following the diagonals and keeping only fractions in lowest terms gives a list beginning like
The exact displayed beginning is less important than the mechanism: every
positive rational p/q in lowest terms appears on the diagonal , and that
diagonal is reached after finitely many previous diagonals.

Figure. The diagonal scan is not a decorative picture; it is the mechanism that turns a two-dimensional grid of positive rationals into one sequence.
Why does this produce a bijection with ?
- It is surjective because every positive rational has a lowest-term
representative
p/q, hence occurs somewhere in the grid. - It is injective because using lowest terms prevents repetitions such as
1/1,2/2, and3/3from all being recorded as the same rational.
Once is listed, the full set can be listed by alternating signs and including zero:
So is countable.
Common mistake
A dense set can still be countable
The rationals are dense in the real line, but density is not cardinality. The diagonal enumeration shows that the rationals can still be placed into one sequence.
Comparing cardinalities by injections
Bijections decide equality of cardinality. To compare unequal sizes, we use injections.
Definition
Cardinal inequality
Let and be sets. We write
if there exists an injection .
We write
if and .
An injection from to means that has enough room to store a distinct code for every element of . This is why it is the correct analogue of "less than or equal to" for cardinalities.
Worked example
A simple cardinal inequality
The inclusion map
is injective. Therefore .
This alone does not prove equality. Equality requires a bijection, or two opposite injections together with Cantor-Bernstein.
Cardinal inequality behaves like a partial order
Theorem
Cardinal inequalities form a partial-order pattern
The relation on cardinalities is reflexive, antisymmetric, and transitive. Consequently is irreflexive and transitive.
Here is the proof structure.
Reflexivity. The identity map
is injective, so .
Transitivity. If and are injections, then
is also an injection. Thus and imply .
Antisymmetry. This is exactly the Cantor-Bernstein theorem.
Common mistake
There is no set of all sets
Strictly speaking, is not a relation on one giant set of all sets, because there is no such set. The point is that the partial-order properties hold for any collection of cardinalities that one is comparing.
Cantor-Bernstein theorem
Theorem
Cantor-Bernstein theorem
Let and be sets. If
then
In words: if injects into and injects into , then the two sets actually have the same cardinality. This looks intuitively obvious, but the proof is more delicate than the finite case.
Here is the standard sketch. Suppose
are injections. Since g embeds into , the image g(Y) is a copy of
sitting inside . The proof builds nested subsets
of by
and
The map carries each difference layer
bijectively onto the next difference layer
The desired bijection is then assembled by using f on the layers
where f should be used, and using on the remaining part:
The point of the construction is not that one can guess the bijection by inspection. The point is that the two injections provide enough structure to divide into pieces and define a genuine bijection piece by piece.
Proof
Why the piecewise definition is plausible
A supporting comparison lab
The widget below is secondary to the proof language. Use it as a way to compare what bijections, injections, and two-sided injections are saying before reading the formal statements again.
Read and try
Compare set sizes by maps
The lab compares equality of cardinality, injection-only comparison, and countable enumeration using concrete maps.
Key relation
|X| = |Y|
Points to
a -> 1, b -> 2, c -> 3
Why it works
Every element of X is used once and every element of Y is hit once, so the displayed function is a bijection.
Common mistakes and subtle points
Common mistake
Do not prove equality from one injection
An injection proves . It does not by itself prove . Equality requires a bijection, or injections in both directions plus Cantor-Bernstein.
Common mistake
Do not count unreduced fractions as different rationals
The symbols 1/1, 2/2, and 3/3 describe the same rational number. The
countability proof for avoids duplicates by using lowest terms.
Common mistake
A surjection points in the opposite comparison direction
If is surjective, it is tempting to conclude immediately that . That conclusion is true with the axiom of choice, but the argument postpone the proof until choice functions are introduced.
Quick checks
Quick check
What kind of function proves that two sets have the same cardinality?
Name the function property and say what it does to elements.
Solution
Answer
Quick check
Why does the diagonal argument for Q+ not get stuck on any particular positive rational p/q?
Think about the diagonal containing that fraction.
Solution
Answer
Quick check
If there are injections X to Y and Y to X, what theorem lets us conclude same cardinality?
This is the antisymmetry part of cardinal comparison.
Solution
Answer
Exercises
Quick check
Give an explicit enumeration of Z and explain why it has no repetitions.
Start with 0, then alternate positive and negative integers.
Solution
Guided solution
Quick check
Explain why the composition of two injections is injective.
Use the definition of injective twice.
Solution
Guided solution
Quick check
Why does countability of Q+ imply countability of Q?
Account for zero and negative rationals.
Solution
Guided solution
Related notes
Read this after 2.2 Functions and relations, especially the sections on injections, surjections, bijections, and partial orders. Then continue to 6.1.2-6.3 Cantor's theorem, continuum, and choice.