Countable Set
BasisPrerequisites
set_intro showed you that the cardinality of a finite set counts its elements. But what does “size” even mean for , , or — sets that go on forever? Remarkably, not all infinite sets are the same size. Countability is the first — and most concrete — tool for measuring and comparing infinite sets.
Comparing sizes with bijections
To compare two sets you need a way to match their elements up — without counting. That idea is captured by two special kinds of maps. (A full treatment of maps lives in Maps; here we introduce just enough to get started.)
A map assigns each element exactly one element . A map is injective (or one-to-one, written ) when distinct inputs always yield distinct outputs:
Think of an injection as an embedding: every element of gets its own unique slot in , with no two elements of sharing a slot.
A map is bijective when it is injective and every element of is the image of exactly one element of . A bijection is a perfect one-to-one pairing between and , with nothing left over on either side.
Bijections give us a definition of equal cardinality that works for any two sets, finite or infinite:
For finite sets, agrees with ordinary counting. The surprise is that can produce genuinely counterintuitive results for infinite sets — results you’ll unpack in the rest of this article.
What it means to be countable
Recall from Peano axioms that the natural numbers are built from a successor function. We use as the yardstick for infinite sets.
A set is finite with cardinality (for some ) when there is a bijection . This matches the cardinality from set_intro.
A set is countably infinite when there exists a bijection
A bijection is exactly a complete, non-repeating listing of every element of :
Every element appears exactly once. So countably infinite literally means: you can arrange all elements into an infinite sequence indexed by .
A set is countable if it is either finite or countably infinite. A set that is not countable is uncountable — you’ll meet the first concrete example in Uncountable Sets.
There is a convenient equivalent formulation that is often easier to apply:
Proposition. A non-empty set is countable if and only if there exists an injection .
Why this works. If is countably infinite, the inverse of the bijection is itself a bijection — and in particular an injection — . If is finite with cardinality , compose the bijection with the inclusion . Conversely, given any injection , list the elements of in increasing order; that ordering produces a bijection from (or a finite initial segment) to .
Examples of countable sets
itself
The identity map , , is trivially a bijection. So is countably infinite by definition — the baseline case.
The integers
At first glance looks “twice as big” as because it stretches in both directions. Define the interleaving map
This weaves through the non-negative and negative integers alternately:
Every integer appears exactly once, so is a bijection and . The set of integers, despite spanning the whole number line in both directions, is no larger than the natural numbers.
The product
The set forms an infinite two-dimensional grid of pairs. A diagonal traversal visits every cell by grouping pairs along anti-diagonals where :
The Cantor pairing function encodes this traversal in a closed formula:
The triangular-number term counts all pairs on strictly earlier diagonals; adding gives the offset of within its own diagonal. You can verify that is a bijection, so . Infinitely many infinite rows collapse into a single sequence.
The rationals
Arrange every positive fraction (with ) in a grid: along one axis, along the other. Apply the same diagonal traversal as above, but skip any entry where so that each rational appears in reduced form exactly once. Then prepend and interleave the negatives using the same trick as for . Every rational number eventually appears in this listing, so is countably infinite — despite appearing far denser than on the number line.
Two key closure properties
Subsets of countable sets are countable
Theorem. If is countable and , then is countable.
Intuition. The inclusion map is an injection. Composing it with the injection (which exists because is countable) gives an injection , so is countable by the proposition above.
This theorem means that whenever you find a countable “container”, every sub-collection inside it is automatically countable too.
Countable unions of countable sets are countable
Theorem. If is a countable family of countable sets, then is also countable.
Intuition. List the elements of each in a row (padding finite rows if needed). The result is an infinite grid — one row per set — just like . Apply the diagonal traversal, skipping any element already seen to avoid repetition. Every element of gets visited, so the union is countable.
A striking application: the algebraic numbers — roots of polynomials with integer coefficients — form a countable set. There are countably many such polynomials (each polynomial is a finite list of integer coefficients, and repeated application of the Cantor pairing function shows that finite lists of integers are countable), and each polynomial has only finitely many roots. So the algebraic numbers are a countable union of finite sets, hence countable.
Summary
- The cardinality equality is defined by the existence of a bijection ; this definition extends naturally from finite to infinite sets — see equation .
- A map is injective () when distinct inputs give distinct outputs, and bijective when it is injective and every element of is hit exactly once. The full theory is in Maps.
- A set is countably infinite when a bijection exists — equivalently, when its elements can be listed as with no omissions and no repetitions.
- A set is countable if it is finite or countably infinite; it is uncountable otherwise.
- Equivalent test: a non-empty set is countable if and only if there exists an injection .
- Canonical countable sets: (trivial), (interleaving bijection ), (Cantor pairing function ), and (diagonal traversal with skipping).
- Subsets of countable sets are countable; countable unions of countable sets are countable — the algebraic numbers are a notable consequence.
- Not every infinite set is countable. Head to Uncountable Sets to see why is strictly larger than .