Countable Sets

How many integers are there, compared to natural numbers? A first instinct says "twice as many." Yet a careful pairing shows the two collections match up perfectly, element for element. This surprising fact — that an infinite set can be placed in exact correspondence with a proper subset of itself — is the gateway to the modern theory of cardinality. Countable sets are the infinite sets that are, in a precise sense, the smallest kind of infinite: no bigger than the natural numbers ℕ. The idea matters because it draws a sharp, provable line inside the world of infinite collections. Not all infinities behave alike. Some sets, as later results show, are strictly larger than ℕ. But a remarkably wide class of familiar sets, including ℤ and ℚ, turn out to be exactly the same size as ℕ. This is not a philosophical opinion; it is a theorem. It is proved by exhibiting explicit bijections or injections. The big picture is a toolkit: once you know ℕ is countable, you get ℤ, ℚ, finite unions of countable sets, countable unions of countable sets, and finite products of countable sets all "for free." This happens via a handful of closure theorems. These closure properties are the engine behind an enormous amount of downstream mathematics. They range from the enumerability of algebraic numbers to the countability of the set of finite-length strings over a finite alphabet, which underlies computability theory. This article gives the precise definition of countability, and proves the central closure theorems with full rigor. It works through nontrivial examples (including the classical Cantor pairing enumeration of ℚ). It also shows exactly where the argument breaks if a hypothesis is dropped. This sets the stage for the discovery, via Uncountable Sets and Cantors Diagonal Argument, that not every infinite set is countable.

Key takeaways
  • A set is countable if it is finite or admits a bijection with ℕ; countably infinite means the latter.
  • Equivalently, a nonempty set AA is countable iff there is a surjection N→A\mathbb{N} \to A, or (for infinite AA) an injection A→NA \to \mathbb{N}.
  • ℤ and ℚ are countably infinite, despite naive intuition suggesting they are "bigger" than ℕ.
  • Countable unions of countable sets are countable (using the Axiom of Countable Choice, or an explicit enumeration when one is given).
  • Finite (and countable) Cartesian products of countable sets are countable, proved via the Cantor pairing function.
  • Key idea: infinite size is measured by bijections, not by subset inclusion — a set can be in bijection with a proper subset of itself.

Where this lives today

Countability underlies computability theory: the set of all finite strings over a finite alphabet is countable (a countable union, over string lengths n∈Nn\in\mathbb{N}, of the finite sets of length-nn strings), which is why Turing machines, programs, and provable theorems can all be Gödel-numbered — assigned distinct natural number codes — a fact essential to the undecidability results of Turing and the incompleteness results of Gödel. In algebra and number theory, the countability of the algebraic numbers (roots of polynomials with integer coefficients) versus the uncountability of the reals gives, non-constructively, the existence of transcendental numbers without exhibiting a single one. In probability and measure theory, countable additivity of measures depends on countable (not arbitrary) unions of events being well-behaved, directly paralleling the closure theorem's index-set hypothesis. In topology and analysis, countable dense subsets (like Q⊂R\mathbb{Q} \subset \mathbb{R}) underlie the notion of separability, used throughout functional analysis. In cryptography and coding theory, the countability of the set of finite bit-strings guarantees that any countable message space can be injectively encoded into natural numbers, a prerequisite for hashing and enumeration schemes.

Ask the tutor: Why does the diagonal argument fail to show N×N\mathbb{N}\times\mathbb{N} is uncountable, yet succeed for {0,1}N\{0,1\}^{\mathbb{N}}?

DefinitionCountable Set

Let AA be a set.

  • AA is finite if A=∅A = \emptyset or there is a bijection A→{1,2,…,n}A \to \{1, 2, \dots, n\} for some n∈N+n \in \mathbb{N}^+.
  • AA is countably infinite (or denumerable) if there is a bijection f:N→Af : \mathbb{N} \to A.
  • AA is countable if AA is finite or countably infinite.
  • AA is uncountable if AA is not countable.

Here N={0,1,2,3,… }\mathbb{N} = \{0, 1, 2, 3, \dots\}. Equivalently (and this equivalence is proved as Lemma: Injection Characterization below), AA is countable if and only if there exists an injection A↪NA \hookrightarrow \mathbb{N}; and a nonempty set AA is countable if and only if there exists a surjection N↠A\mathbb{N} \twoheadrightarrow A. This is a special case of the general notion of Comparing Cardinalities: AA is countable exactly when ∣A∣≤∣N∣=ℵ0|A| \le |\mathbb{N}| = \aleph_0.

Intuition

The naive way to compare two infinite collections is to check whether one contains the other. By that measure N⊊Z\mathbb{N} \subsetneq \mathbb{Z}, so Z\mathbb{Z} "should" be bigger. But cardinality compares sets by matching, not by containment: if every element of AA can be paired with exactly one element of BB and vice versa, with nothing left over on either side, then AA and BB have the same size, full stop — regardless of whether one happens to sit inside the other as a subset. This is exactly what happens with Z\mathbb{Z}. Send 0↦00 \mapsto 0, and then alternate: 1↦11 \mapsto 1, 2↦−12 \mapsto -1, 3↦23 \mapsto 2, 4↦−24 \mapsto -2, and so on, zig-zagging outward from 00. Every integer gets hit exactly once. The set "Z\mathbb{Z}," despite stretching infinitely in two directions, is not too big for a single one-directional list to capture. Q\mathbb{Q} is more surprising still, since between any two rationals there are infinitely many others — Q\mathbb{Q} is dense, while N\mathbb{N} is not. Cantor's trick is to stop thinking of Q\mathbb{Q} as an ordered line and instead arrange all pairs (p,q)(p, q) on a two-dimensional grid, then snake through the grid diagonal by diagonal. Density is irrelevant to counting; only the existence of some systematic listing matters.

Figure
Enumerating ℤ by zig-zagging outward from 0, matched against ℕ
ℕ ℤ 012 345 67 01−1 2−23 −34 f(n) = (−1)^n ⌈n/2⌉ is a bijection ℕ → ℤ

Central results

LemmaInjection Characterization

Let AA be a set. Then AA is countable if and only if there is an injective function ι:A→N\iota : A \to \mathbb{N}.

Proof

(⇒\Rightarrow) Suppose AA is countable. If AA is finite, either A=∅A = \emptyset, in which case the empty function is (vacuously) an injection A→NA \to \mathbb{N}, or there is a bijection g:A→{1,…,n}g : A \to \{1, \dots, n\}; composing gg with the inclusion {1,…,n}↪N\{1,\dots,n\} \hookrightarrow \mathbb{N} gives an injection A→NA \to \mathbb{N}. If AA is countably infinite, by definition there is a bijection f:N→Af : \mathbb{N} \to A; its inverse f−1:A→Nf^{-1} : A \to \mathbb{N} is a bijection, hence in particular an injection.

(⇐\Leftarrow) Suppose ι:A→N\iota : A \to \mathbb{N} is injective. If AA is finite, AA is countable by definition, and we are done. So assume AA is infinite. The image ι(A)⊆N\iota(A) \subseteq \mathbb{N} is then an infinite subset of N\mathbb{N} (since ι\iota is injective, ι(A)\iota(A) is in bijection with AA, hence infinite). We first show:

Claim. Every infinite subset S⊆NS \subseteq \mathbb{N} is countably infinite. Proof of claim. Define h:N→Sh : \mathbb{N} \to S recursively using well-ordering of N\mathbb{N}: let h(0)=min⁡Sh(0) = \min S, and having defined h(0)<h(1)<⋯<h(k)h(0) < h(1) < \dots < h(k), let

h(k+1)=min⁡(S∖{h(0),…,h(k)}),h(k+1) = \min\bigl(S \setminus \{h(0), \dots, h(k)\}\bigr),

which exists because SS is infinite, so S∖{h(0),…,h(k)}S \setminus \{h(0),\dots,h(k)\} is nonempty, and every nonempty subset of N\mathbb{N} has a least element (well-ordering of N\mathbb{N}). By construction hh is strictly increasing, hence injective (if i<ji < j then h(i)<h(j)h(i) < h(j) by an easy induction on j−ij - i using strict monotonicity at each step, so h(i)≠h(j)h(i) \ne h(j)). For surjectivity, suppose toward a contradiction some s∈Ss \in S is never hit. Since hh is strictly increasing, h(k)≥kh(k) \geq k for all kk (proved by induction: h(0)≥0h(0) \ge 0 trivially; if h(k)≥kh(k) \ge k then h(k+1)>h(k)≥kh(k+1) > h(k) \ge k, so h(k+1)≥k+1h(k+1) \ge k+1). Hence for k=s+1k = s+1, h(k)≥s+1>sh(k) \ge s+1 > s, so h(k)∉{0,…,s}h(k) \notin \{0,\dots,s\}; more precisely, since hh is increasing and h(k)>sh(k) > s for all k>sk > s, the only candidates for h(j)=sh(j) = s are j≤sj \le s. There are only finitely many such jj (j=0,…,sj = 0,\dots,s), and by construction each h(j)h(j) for j≤sj \le s was chosen as a minimum of a set excluding all previously chosen elements; if none of h(0),…,h(s)h(0),\dots,h(s) equals ss, consider that s∈S∖{h(0),…,h(s−1)}s \in S \setminus \{h(0),\dots,h(s-1)\} (since s≠h(0),…,h(s−1)s \ne h(0),\dots,h(s-1) by assumption), so h(s)=min⁡(S∖{h(0),…,h(s−1)})≤sh(s) = \min(S\setminus\{h(0),\dots,h(s-1)\}) \le s. Combined with h(s)≥sh(s) \ge s from the previous paragraph, h(s)=sh(s) = s, contradicting the assumption that ss is never hit. Hence hh is surjective, and being also injective, hh is a bijection N→S\mathbb{N} \to S. This proves the claim. ■\blacksquare (claim) Now, by the claim, ι(A)\iota(A) is countably infinite, so there is a bijection g:N→ι(A)g : \mathbb{N} \to \iota(A). Since ι:A→ι(A)\iota : A \to \iota(A) is a bijection (injective by hypothesis, surjective onto its own image by definition), ι−1∘g:N→A\iota^{-1} \circ g : \mathbb{N} \to A is a composition of bijections, hence a bijection. Thus AA is countably infinite, in particular countable. ■\blacksquare

∎
CorollarySurjection Characterization

A nonempty set AA is countable if and only if there exists a surjection σ:N→A\sigma : \mathbb{N} \to A.

Proof

(⇒\Rightarrow) If AA is countable and nonempty, either AA is finite nonempty, say with bijection g:{1,…,n}→Ag:\{1,\dots,n\}\to A; extend to σ:N→A\sigma:\mathbb{N}\to A by σ(k)=g(k)\sigma(k) = g(k) for 1≤k≤n1\le k\le n and σ(k)=g(1)\sigma(k) = g(1) otherwise — this is a surjection since gg already hits everything. Or AA is countably infinite with bijection f:N→Af:\mathbb{N}\to A, and ff itself is a surjection.

(⇐\Leftarrow) Suppose σ:N→A\sigma : \mathbb{N} \to A is surjective and A≠∅A \ne \emptyset. Define ι:A→N\iota : A \to \mathbb{N} by

ι(a)=min⁡ σ−1({a})=min⁡{n∈N:σ(n)=a},\iota(a) = \min\, \sigma^{-1}(\{a\}) = \min\{n \in \mathbb{N} : \sigma(n) = a\},

which exists by well-ordering of N\mathbb{N} since σ−1({a})\sigma^{-1}(\{a\}) is nonempty (as σ\sigma is surjective). This ι\iota is injective: if ι(a)=ι(a′)=n\iota(a) = \iota(a')= n, then σ(n)=a\sigma(n) = a and σ(n)=a′\sigma(n) = a' since nn was chosen as an element of both preimages, forcing a=a′a = a'. By Lemma: Injection Characterization, AA is countable. ■\blacksquare

∎
TheoremClosure of Countability

1. (Subsets) If AA is countable and B⊆AB \subseteq A, then BB is countable. 2. (Finite unions) If A1,…,AnA_1, \dots, A_n are each countable, then ⋃i=1nAi\bigcup_{i=1}^n A_i is countable. 3. (Countable unions) If II is a countable index set and {Ai}i∈I\{A_i\}_{i \in I} is a family of countable sets, then ⋃i∈IAi\bigcup_{i \in I} A_i is countable. 4. (Finite products) If AA and BB are countable, then A×BA \times B is countable. Consequently, A1×⋯×AnA_1 \times \cdots \times A_n is countable whenever each AiA_i is countable.

Proof

We use the technique of explicit encoding into N\mathbb{N}, combined with the Lemma: Injection Characterization and its corollary, throughout.

(1) Subsets. If AA is countable there is an injection ι:A→N\iota : A \to \mathbb{N} (Lemma). Restricting ι\iota to B⊆AB \subseteq A gives an injection ι∣B:B→N\iota|_B : B \to \mathbb{N} (a restriction of an injective function is injective, since injectivity is a universally quantified statement about pairs of inputs, and restricting the domain only removes potential pairs to check). By the Lemma, BB is countable.

(2) Finite unions. By induction on nn it suffices to prove the case n=2n = 2; the general case follows by writing ⋃i=1nAi=(⋃i=1n−1Ai)∪An\bigcup_{i=1}^n A_i = \left(\bigcup_{i=1}^{n-1} A_i\right) \cup A_n and applying the n=2n=2 case repeatedly. If A1=∅A_1 = \emptyset or A2=∅A_2 = \emptyset the claim is immediate from countability of the other set (a union with ∅\emptyset doesn't change the set), so assume both nonempty. By the Corollary there are surjections σ1:N→A1\sigma_1 : \mathbb{N} \to A_1 and σ2:N→A2\sigma_2 : \mathbb{N} \to A_2. Define τ:N→A1∪A2\tau : \mathbb{N} \to A_1 \cup A_2 by

τ(2k)=σ1(k),τ(2k+1)=σ2(k)(k∈N).\tau(2k) = \sigma_1(k), \qquad \tau(2k+1) = \sigma_2(k) \quad (k \in \mathbb{N}).

This τ\tau is surjective: given x∈A1∪A2x \in A_1 \cup A_2, either x∈A1x \in A_1, so x=σ1(k)=τ(2k)x = \sigma_1(k) = \tau(2k) for some kk, or x∈A2x \in A_2, so x=σ2(k)=τ(2k+1)x = \sigma_2(k) = \tau(2k+1) for some kk; either way x∈ran⁡(τ)x \in \operatorname{ran}(\tau). By the Corollary, A1∪A2A_1 \cup A_2 is countable.

(3) Countable unions. Let II be countable and, for each i∈Ii \in I, let AiA_i be countable. If I=∅I = \emptyset the union is ∅\emptyset, countable trivially. Otherwise, since II is countable and nonempty, fix a surjection ρ:N→I\rho : \mathbb{N} \to I (Corollary). We may discard indices ii with Ai=∅A_i = \emptyset, since they contribute nothing to the union; so assume without loss of generality Ai≠∅A_i \ne \emptyset for every i∈Ii \in I under consideration (formally, replace II by I′={i∈I:Ai≠∅}I' = \{i \in I : A_i \ne \emptyset\}, which is a subset of a countable set, hence countable by (1); if I′=∅I' = \emptyset the union is empty and we are done, otherwise proceed with I′I' in place of II). For each i∈Ii \in I choose, using the Corollary, a surjection σi:N→Ai\sigma_i : \mathbb{N} \to A_i. (This selection of one surjection for each i∈Ii \in I simultaneously is exactly an application of the Axiom of Countable Choice: for each ii the set of surjections N→Ai\mathbb{N} \to A_i is nonempty, and we choose one from each of countably many such nonempty sets.) Now define Σ:N×N→⋃i∈IAi\Sigma : \mathbb{N} \times \mathbb{N} \to \bigcup_{i \in I} A_i by

Σ(m,n)=σρ(m)(n).\Sigma(m, n) = \sigma_{\rho(m)}(n).

This is well-defined since ρ(m)∈I\rho(m) \in I and σρ(m):N→Aρ(m)\sigma_{\rho(m)} : \mathbb{N} \to A_{\rho(m)}. It is surjective onto ⋃i∈IAi\bigcup_{i\in I} A_i: given xx in the union, x∈Aix \in A_i for some i∈Ii \in I; since ρ\rho is surjective, i=ρ(m)i = \rho(m) for some mm; since σi\sigma_i is surjective onto AiA_i, x=σi(n)=σρ(m)(n)=Σ(m,n)x = \sigma_i(n) = \sigma_{\rho(m)}(n) = \Sigma(m,n) for some nn. Finally, compose with a bijection N×N→N\mathbb{N} \times \mathbb{N} \to \mathbb{N} — the Cantor pairing function

π(m,n)=(m+n)(m+n+1)2+n,\pi(m,n) = \frac{(m+n)(m+n+1)}{2} + n,

which is a bijection (verified explicitly in part (4) below) — to get Σ∘π−1:N→⋃iAi\Sigma \circ \pi^{-1} : \mathbb{N} \to \bigcup_i A_i, a surjection N→⋃i∈IAi\mathbb{N} \to \bigcup_{i \in I} A_i (composition of a bijection followed by a surjection is a surjection). By the Corollary, ⋃i∈IAi\bigcup_{i \in I} A_i is countable.

(4) Finite products. First we handle N×N\mathbb{N} \times \mathbb{N} itself, then transfer to general countable A,BA, B via injections. Step 1: π:N×N→N\pi : \mathbb{N} \times \mathbb{N} \to \mathbb{N}, π(m,n)=(m+n+12)+n=(m+n)(m+n+1)2+n\pi(m,n) = \binom{m+n+1}{2} + n = \frac{(m+n)(m+n+1)}{2}+n, is a bijection. Group pairs by their "antidiagonal index" s=m+ns = m+n. For fixed s≥0s \ge 0, the pairs (m,n)(m,n) with m+n=sm + n = s are exactly (s,0),(s−1,1),…,(0,s)(s,0), (s-1,1), \dots, (0,s), a total of s+1s+1 pairs. Order all pairs first by increasing ss, and within each antidiagonal by increasing nn (equivalently decreasing mm). The number of pairs with antidiagonal index strictly less than ss is

∑t=0s−1(t+1)=s(s+1)2=(s+12).\sum_{t=0}^{s-1} (t+1) = \frac{s(s+1)}{2} = \binom{s+1}{2}.

So the pair (m,n)(m,n) with m+n=sm+n=s, sitting in position nn (0-indexed) within its antidiagonal, receives overall index

π(m,n)=(s+12)+n=(m+n)(m+n+1)2+n,\pi(m,n) = \binom{s+1}{2} + n = \frac{(m+n)(m+n+1)}{2} + n,

matching the formula. Since every natural number NN falls into a unique antidiagonal — there is a unique s≥0s \ge 0 with (s+12)≤N<(s+22)\binom{s+1}{2} \le N < \binom{s+2}{2}, because (s+12)\binom{s+1}{2} is strictly increasing in ss and these intervals partition N\mathbb{N} — and within that antidiagonal a unique position n=N−(s+12)n = N - \binom{s+1}{2} with 0≤n≤s0 \le n \le s, giving m=s−nm = s - n, the map π\pi has a well-defined inverse recoverable by this procedure. Hence π\pi is a bijection. Step 2: general countable A,BA, B. By Lemma: Injection Characterization, fix injections ιA:A→N\iota_A : A \to \mathbb{N} and ιB:B→N\iota_B : B \to \mathbb{N}. Define ι:A×B→N\iota : A \times B \to \mathbb{N} by

ι(a,b)=π(ιA(a),ιB(b)).\iota(a,b) = \pi(\iota_A(a), \iota_B(b)).

This is injective: if ι(a,b)=ι(a′,b′)\iota(a,b) = \iota(a',b'), then since π\pi is a bijection (in particular injective), (ιA(a),ιB(b))=(ιA(a′),ιB(b′))(\iota_A(a), \iota_B(b)) = (\iota_A(a'), \iota_B(b')), so ιA(a)=ιA(a′)\iota_A(a) = \iota_A(a') and ιB(b)=ιB(b′)\iota_B(b) = \iota_B(b'); since ιA,ιB\iota_A, \iota_B are injective, a=a′a = a' and b=b′b = b'. By the Lemma, A×BA \times B is countable. For nn factors, induct: A1×⋯×An≅(A1×⋯×An−1)×AnA_1 \times \cdots \times A_n \cong (A_1 \times \cdots \times A_{n-1}) \times A_n via the evident associativity bijection (a1,…,an−1,an)↔((a1,…,an−1),an)(a_1,\dots,a_{n-1},a_n) \leftrightarrow ((a_1,\dots,a_{n-1}), a_n), and if A1×⋯×An−1A_1\times\cdots\times A_{n-1} is countable by inductive hypothesis, then its product with the countable set AnA_n is countable by the n=2n=2 case just proved; a bijective image of a countable set is countable (transport the enumeration bijection through the associativity bijection). ■\blacksquare

∎

Worked examples

Example 1: Z\mathbb{Z} is countably infinite, via an explicit closed-form bijection. Define f:N→Zf : \mathbb{N} \to \mathbb{Z} by

f(n)={n2n even−n+12n odd.f(n) = \begin{cases} \dfrac{n}{2} & n \text{ even} \\[4pt] -\dfrac{n+1}{2} & n \text{ odd.} \end{cases}

So f(0)=0,f(1)=−1,f(2)=1,f(3)=−2,f(4)=2,…f(0)=0, f(1)=-1, f(2)=1, f(3)=-2, f(4)=2,\dots Injectivity. Suppose f(n)=f(n′)f(n) = f(n'). If n,n′n, n' are both even, n/2=n′/2n/2 = n'/2 gives n=n′n = n'. If both odd, −(n+1)/2=−(n′+1)/2-(n+1)/2 = -(n'+1)/2 gives n=n′n=n'. If nn even and n′n' odd, then f(n)=n/2≥0f(n) = n/2 \ge 0 while f(n′)=−(n′+1)/2≤−1/2<0f(n') = -(n'+1)/2 \le -1/2 < 0 (since n′≥1n' \ge 1 when odd and ≥0\ge 0), so f(n)≠f(n′)f(n) \ne f(n'), contradiction — this case cannot occur. Hence n,n′n, n' have the same parity and n=n′n = n'. Surjectivity. Given k∈Zk \in \mathbb{Z}: if k≥0k \ge 0, take n=2kn = 2k (even, and n/2=kn/2 = k); if k<0k < 0, take n=−2k−1n = -2k - 1 (check parity: −2k-2k is even so −2k−1-2k-1 is odd, and n≥0n \ge 0 since k≤−1k \le -1 gives −2k−1≥1-2k-1 \ge 1; then f(n)=−(n+1)/2=−(−2k)/2=kf(n) = -(n+1)/2 = -(-2k)/2 = k). So every integer is hit. Hence ff is a bijection, and Z\mathbb{Z} is countably infinite. Notice this also illustrates part (2) of the closure theorem directly: Z=N∪{−1,−2,−3,… }\mathbb{Z} = \mathbb{N} \cup \{-1,-2,-3,\dots\}, a union of two countably infinite sets, so countability of Z\mathbb{Z} also follows abstractly from the closure theorem — the explicit ff above is one concrete instantiation of that abstract argument.

Example 2: Q\mathbb{Q} is countably infinite, via Cantor's grid argument, done carefully with signs. We show Q\mathbb{Q} is countable using the closure theorem rather than reinventing an ad hoc bijection. Step 1. Z+×Z+\mathbb{Z}^+ \times \mathbb{Z}^+ (positive integers) is countable, being in bijection with N×N\mathbb{N} \times \mathbb{N} via (m,n)↦(m−1,n−1)(m,n) \mapsto (m-1,n-1), and N×N\mathbb{N}\times\mathbb{N} is countable by part (4) of the closure theorem (via the pairing function π\pi). Step 2. Define σ:Z+×Z+→Q+\sigma : \mathbb{Z}^+ \times \mathbb{Z}^+ \to \mathbb{Q}^+ (positive rationals) by σ(p,q)=p/q\sigma(p,q) = p/q. This is surjective: every positive rational equals p/qp/q for some positive integers p,qp, q (by definition of Q\mathbb{Q} as ratios of integers). It is far from injective (σ(2,4)=σ(1,2)\sigma(2,4) = \sigma(1,2)), but surjectivity alone suffices: by the Corollary, since there is a surjection N→Z+×Z+\mathbb{N} \to \mathbb{Z}^+\times\mathbb{Z}^+ (Step 1, composed appropriately) and then a surjection Z+×Z+→Q+\mathbb{Z}^+\times\mathbb{Z}^+ \to \mathbb{Q}^+, the composite is a surjection N→Q+\mathbb{N} \to \mathbb{Q}^+. Hence Q+\mathbb{Q}^+ is countable. Step 3. Q−={−q:q∈Q+}\mathbb{Q}^- = \{-q : q \in \mathbb{Q}^+\} is countable, being the image of the countable set Q+\mathbb{Q}^+ under the bijection q↦−qq \mapsto -q (a bijective image of a countable set is countable — restrict the enumerating bijection of Q+\mathbb{Q}^+ and post-compose with negation). Step 4. Q=Q+∪{0}∪Q−\mathbb{Q} = \mathbb{Q}^+ \cup \{0\} \cup \mathbb{Q}^- is a union of three countable sets ({0}\{0\} finite, hence countable), so by part (2) of the closure theorem (extended trivially from 2 to 3 sets by associativity), Q\mathbb{Q} is countable. Since Q\mathbb{Q} is visibly infinite (it contains the infinite set N\mathbb{N}), Q\mathbb{Q} is countably infinite: there exists a bijection N→Q\mathbb{N} \to \mathbb{Q}. (Existence of some bijection follows abstractly: we exhibited an injection Q→N\mathbb{Q}\to\mathbb{N} via the surjection-to-injection construction in the Corollary's proof, and combined with the trivial injection N→Q\mathbb{N} \to \mathbb{Q}, a Schwarz–Cantor–Bernstein-style argument — the content of Comparing Cardinalities — upgrades the pair of injections to a genuine bijection.)

CounterexampleWhy "countable union" needs a countable index set, and why arbitrary unions can fail

The closure theorem requires the index set II itself to be countable. Drop that hypothesis and the conclusion can fail. Let I=RI = \mathbb{R} (uncountable — a fact established via Uncountable Sets and Cantors Diagonal Argument), and for each r∈Ir \in I let Ar={r}⊆RA_r = \{r\} \subseteq \mathbb{R}, a single-point set, certainly countable (indeed finite). Then

⋃r∈RAr=R,\bigcup_{r \in \mathbb{R}} A_r = \mathbb{R},

which is uncountable. So a union of countably many — here, even a union of finite — sets indexed by an uncountable set need not be countable. The proof of part (3) of the closure theorem crucially used a surjection ρ:N→I\rho : \mathbb{N} \to I to enumerate the index set; no such surjection exists when I=RI = \mathbb{R}, and the entire construction of Σ:N×N→⋃iAi\Sigma : \mathbb{N}\times\mathbb{N} \to \bigcup_i A_i collapses at that step. This shows the hypothesis "II countable" in part (3) is not a technical nicety but load-bearing.

Scope, edge cases & common traps

SituationStatusWhy
∅\emptysetCountable (finite)Vacuously satisfies the finite case of the definition
N,Z,Q\mathbb{N}, \mathbb{Z}, \mathbb{Q}Countably infiniteExplicit bijections/surjections constructed above
R\mathbb{R}, P(N)\mathcal{P}(\mathbb{N})UncountableDiagonal argument — see Uncountable Sets and Cantors Diagonal Argument
Countable union of countable sets, countable indexCountable[[Central resultsClosure Theorem]] part 3
Uncountable union of nonempty (even singleton) setsCan be uncountableCounterexample above
Finite product of countable setsCountableClosure Theorem part 4, via Cantor pairing
Countably infinite product (ANA^{\mathbb{N}}) of countable sets, ∣A∣≥2|A|\ge2Generally uncountableDiagonal argument applies; this is not covered by the theorem, which is stated only for finite products

The mathematician behind it

Origins · 1 minGeorg Cantor and how this was discovered
GC
Georg Cantor
1845–1918 · Founder of set theory, Halle, Germany

Georg Cantor developed the theory of transfinite cardinal numbers in the 1870s–1880s, against considerable resistance from contemporaries such as Leopold Kronecker. His 1874 paper proving that the algebraic numbers are countable while the real numbers are not — the seed of the diagonal argument — marked the beginning of set theory as a mathematical discipline in its own right, rather than a mere convenience of language.

History
- 1874 — Cantor proves the algebraic numbers are countable and the reals are not, in his first paper on transfinite set theory.
- 1878 — Cantor defines cardinal equivalence via bijection and introduces the notion that infinite sets can have different "sizes."
- 1891 — Cantor publishes the diagonal argument in its modern, general form.
- 1895–1897 — Cantor's Beiträge zur Begründung der transfiniten Mengenlehre systematizes cardinal and ordinal arithmetic, including the countable/uncountable distinction used today.
- 1908–1922 — Zermelo and Fraenkel axiomatize set theory (ZF, later ZFC), placing Cantor's countability arguments — including the Axiom of Choice used implicitly in closure under countable unions — on a fully formal footing.
Is every infinite subset of a countable set countably infinite?

Yes, and this is exactly the key claim proved inside the Lemma: Injection Characterization: every infinite subset of N\mathbb{N} is countably infinite, constructed via the strictly increasing "take the next smallest unused element" function. Since any countable set injects into N\mathbb{N}, an infinite subset of a countable set injects into an infinite subset of N\mathbb{N}, hence is countably infinite by the same reasoning transported across the injection. This is part of why "countable" is such a robust, easy-to-use notion — subsets never cause surprises, unlike with uncountable sets where subsets can be countable, uncountable, or anything in between.

Does ℕ have the same cardinality as a proper subset of itself, and is that a contradiction?

Yes, and no — this is a defining feature of infinite sets, not a paradox. The even numbers 2N={0,2,4,… }2\mathbb{N} = \{0,2,4,\dots\} are a proper subset of N\mathbb{N}, yet n↦2nn \mapsto 2n is a bijection N→2N\mathbb{N} \to 2\mathbb{N}. Richard Dedekind in fact defined infinite sets as precisely those that can be placed in bijection with a proper subset of themselves — finite sets can never do this, since a bijection between a finite set and a proper subset would force the subset to have both fewer and equally many elements, which contradicts basic counting. So this "paradox" is really the theorem that distinguishes infinite from finite.

If A and B are both countably infinite, must A ∪ B be countably infinite, or could it be finite?

If AA and BB are both countably infinite, A∪BA \cup B is always countably infinite (never finite), because A⊆A∪BA \subseteq A \cup B and a set containing an infinite subset is itself infinite; combined with the closure theorem showing A∪BA \cup B is countable, and infinite plus countable forces countably infinite by definition. The only way to get something finite from a union is if both original sets were finite to begin with.

Why does the Cantor pairing function need to be a bijection, rather than just a surjection or injection, for the product theorem?

Technically the full closure theorem only strictly needs π:N×N→N\pi:\mathbb{N}\times\mathbb{N}\to\mathbb{N} to be injective (to build an injection A×B→NA\times B \to \mathbb{N} by composing with injections A→NA\to\mathbb{N}, B→NB\to\mathbb{N}). Proving it is a full bijection is slightly more work but gives a stronger, cleaner, and independently useful fact: it shows N×N\mathbb{N}\times\mathbb{N} and N\mathbb{N} are not just comparable in size but exactly the same size, which is needed elsewhere, e.g. when one wants an actual enumeration (not just an injective code) of pairs, as in explicitly listing rational numbers or Turing machine configurations.

Is the set of all finite subsets of ℕ countable?

Yes. For each n∈Nn \in \mathbb{N}, the set [N]n[\mathbb{N}]^n of nn-element subsets of N\mathbb{N} injects into Nn\mathbb{N}^n (list the elements in increasing order to get an nn-tuple), and Nn\mathbb{N}^n is countable by finite products (Closure Theorem, part 4, extended to nn factors). So each [N]n[\mathbb{N}]^n is countable. The set of all finite subsets of N\mathbb{N} is ⋃n∈N[N]n\bigcup_{n\in\mathbb{N}} [\mathbb{N}]^n, a countable union (indexed by N\mathbb{N}, which is countable) of countable sets, hence countable by part (3) of the Closure Theorem. Note this is a genuinely different, much smaller set than P(N)\mathcal{P}(\mathbb{N}), the set of all subsets (finite and infinite), which is uncountable.

Does this article's closure theorem tell us anything about ℝ or 𝒫(ℕ)?

Only indirectly, by contrast. Nothing in the Closure Theorem produces uncountable sets — quite the opposite, it shows how surprisingly hard it is to escape countability using unions and finite products of countable pieces. The existence of uncountable sets like R\mathbb{R} or P(N)\mathcal{P}(\mathbb{N}) requires a fundamentally different argument, the diagonal argument, covered in Uncountable Sets and Cantors Diagonal Argument. That article shows no surjection N→P(N)\mathbb{N} \to \mathcal{P}(\mathbb{N}) can exist, which is precisely the failure of the Corollary's condition for countability.

How does countability connect to cardinal arithmetic more generally?

Countability is the arithmetic statement ∣A∣≤ℵ0|A| \le \aleph_0, where ℵ0=∣N∣\aleph_0 = |\mathbb{N}| is the smallest infinite cardinal. The closure theorems proved here are special cases of general cardinal arithmetic facts: ℵ0+ℵ0=ℵ0\aleph_0 + \aleph_0 = \aleph_0 (finite unions), ℵ0⋅ℵ0=ℵ0\aleph_0 \cdot \aleph_0 = \aleph_0 (finite products via pairing), and n⋅ℵ0=ℵ0n \cdot \aleph_0 = \aleph_0 for any countable index set (countable unions). These identities look bizarre compared to finite arithmetic — doubling or squaring an infinite quantity leaves it unchanged — and they are explored more systematically, alongside operations like 2ℵ02^{\aleph_0}, in Cardinal Arithmetic.

Before this