Countability and Cardinal Numbers

Chapter 10, Foundations, Cardinality, Choice, and Incompleteness

Learning objectives

  • Define countable and uncountable via bijections with β„•\mathbb{N}
  • Construct explicit bijections ℕ↔℀\mathbb{N} \leftrightarrow \mathbb{Z} and β„•β†”β„š\mathbb{N} \leftrightarrow \mathbb{Q}
  • Apply Cantor's diagonal argument to show ℝ\mathbb{R} is uncountable
  • State Cantor's theorem (∣A∣<βˆ£π’«(A)∣|A| < |\mathcal{P}(A)|) and its consequences for cardinal arithmetic

There is more than one size of infinity. This single, counterintuitive fact, established by Cantor in 1874, is the gateway to all of modern set theory. The integers and the rationals are countable; despite being densely packed in the real line, they can be listed in a single infinite sequence. The reals are not countable: no enumeration can hit them all. The gap between these two infinities is the source of an entire mathematical universe, and its precise quantification (the continuum hypothesis) is famously independent of the standard axioms.

Bijections measure size

Two sets AA and BB have the same cardinality, written ∣A∣=∣B∣|A| = |B|, when there exists a bijection (one-to-one correspondence) f:Aβ†’Bf: A \to B. For finite sets this matches the everyday notion of size. For infinite sets it is the definition: two infinite sets are "the same size" iff their elements can be paired off perfectly.

A set AA is countable if ∣Aβˆ£β‰€βˆ£β„•βˆ£|A| \leq |\mathbb{N}|, i.e. there exists an injection Aβ†’β„•A \to \mathbb{N}, equivalently, AA is finite or there is a bijection β„•β†’A\mathbb{N} \to A (one can list its elements as a1,a2,a3,…a_1, a_2, a_3, \ldots). Otherwise AA is uncountable.

Bijection: |A| = |B| (one-to-one + onto)AB1234abcd

The widget above lets you explore explicit bijections between standard sets. Try ℕ↔℀\mathbb{N} \leftrightarrow \mathbb{Z}: list β„€\mathbb{Z} as 0,1,βˆ’1,2,βˆ’2,3,βˆ’3,…0, 1, -1, 2, -2, 3, -3, \ldots, this is the bijection f(0)=0,f(2kβˆ’1)=k,f(2k)=βˆ’kf(0) = 0, f(2k - 1) = k, f(2k) = -k for kβ‰₯1k \geq 1. Then try the Cantor pairing ℕ×ℕ↔ℕ\mathbb{N} \times \mathbb{N} \leftrightarrow \mathbb{N}: enumerate the lattice diagonals (0,0),(0,1),(1,0),(0,2),(1,1),(2,0),…(0, 0), (0, 1), (1, 0), (0, 2), (1, 1), (2, 0), \ldots. The formula Ο€(m,n)=(m+n)(m+n+1)/2+m\pi(m, n) = (m + n)(m + n + 1)/2 + m gives an explicit invertible coding.

The rationals are countable

Even though β„š\mathbb{Q} is dense in ℝ\mathbb{R} (every interval contains rationals), there are no more rationals than natural numbers. Proof sketch: arrange positive rationals p/qp/q in a 2D grid with pp along rows and qq along columns. Traverse the grid diagonally, skipping fractions that are not in lowest terms: 1/1,1/2,2/1,1/3,3/1,1/4,2/3,3/2,4/1,…1/1, 1/2, 2/1, 1/3, 3/1, 1/4, 2/3, 3/2, 4/1, \ldots. This is a bijection between β„•\mathbb{N} and β„š+\mathbb{Q}^+. Combine with the zero and negatives by interleaving: 0,1/1,βˆ’1/1,1/2,βˆ’1/2,2/1,βˆ’2/1,…0, 1/1, -1/1, 1/2, -1/2, 2/1, -2/1, \ldots. Hence βˆ£β„šβˆ£=β„΅0|\mathbb{Q}| = \aleph_0, the smallest infinite cardinal.

The reals are uncountable: Cantor's diagonal argument

Suppose for contradiction that the reals in [0,1)[0, 1) can be listed as r1,r2,r3,…r_1, r_2, r_3, \ldots. Write each in decimal: rk=0.dk1dk2dk3…r_k = 0.d_{k1} d_{k2} d_{k3} \ldots. Define a new number s=0.s1s2s3…s = 0.s_1 s_2 s_3 \ldots by choosing each sns_n to differ from dnnd_{nn} (and to avoid the digits 00 and 99 to dodge the ambiguity 0.999…=1.000…0.999\ldots = 1.000\ldots). Then ss differs from every rnr_n at the nn-th decimal place, so ss is not in the list. Contradiction. Hence ℝ\mathbb{R} is uncountable.

The cardinality of ℝ\mathbb{R} is denoted 𝔠=2β„΅0\mathfrak{c} = 2^{\aleph_0} (the "cardinality of the continuum"). Whether there is a cardinal strictly between β„΅0\aleph_0 and 𝔠\mathfrak{c} is the continuum hypothesis, which Godel and Cohen proved is independent of ZFC.

Cantor's theorem: there is no largest cardinal

For any set AA, the power set 𝒫(A)={S:SβŠ†A}\mathcal{P}(A) = \{S : S \subseteq A\} has strictly larger cardinality than AA. Proof: suppose f:A→𝒫(A)f: A \to \mathcal{P}(A) is any function. Define D={a∈A:aβˆ‰f(a)}βˆˆπ’«(A)D = \{a \in A : a \notin f(a)\} \in \mathcal{P}(A). Then no a∈Aa \in A satisfies f(a)=Df(a) = D: if a∈Da \in D then by definition aβˆ‰f(a)=Da \notin f(a) = D (contradiction); if aβˆ‰Da \notin D then a∈f(a)=Da \in f(a) = D (contradiction). So ff is not surjective, hence not a bijection. There are infinitely many infinite cardinals: βˆ£β„•βˆ£<βˆ£π’«(β„•)∣<βˆ£π’«(𝒫(β„•))∣<…|\mathbb{N}| < |\mathcal{P}(\mathbb{N})| < |\mathcal{P}(\mathcal{P}(\mathbb{N}))| < \ldots.

Where this shows up
  • Computer science (computable functions): The set of Turing machines is countable (each one is a finite description), but the set of all functions β„•β†’{0,1}\mathbb{N} \to \{0, 1\} is uncountable (in bijection with 𝒫(β„•)\mathcal{P}(\mathbb{N})). Therefore most functions are uncomputable, this is the foundational reason there is no universal algorithm.
  • Number theory (algebraic vs transcendental): The algebraic numbers form a countable set (each is a root of a polynomial with rational coefficients, and there are countably many such polynomials). Since ℝ\mathbb{R} is uncountable, most reals are transcendental. Cantor used this counting argument to prove transcendentals exist before Hermite's explicit proof for ee in 1873.
  • Measure theory: Countable sets in ℝ\mathbb{R} have Lebesgue measure zero, so β„šβŠ‚β„\mathbb{Q} \subset \mathbb{R} has measure zero. "Almost every real is irrational" is a precise probabilistic statement coming directly out of countability.
  • Statistical mechanics: The state space of a finite-dimensional quantum system is countable when truncated to a basis, but the continuous Hilbert space of operators on an infinite-dimensional separable Hilbert space has cardinality 𝔠\mathfrak{c}. The gap matters for entropy and microstate counting.

Pause and think: Use the cardinality widget to find a bijection between (0,1)(0, 1) and ℝ\mathbb{R}. (Hint: the map x↦tan⁑(Ο€(xβˆ’1/2))x \mapsto \tan(\pi(x - 1/2)) is one explicit example. There are uncountably many.) Why does this prove ∣(0,1)∣=βˆ£β„βˆ£=𝔠|(0, 1)| = |\mathbb{R}| = \mathfrak{c}?

Try it

  • Use the cardinality widget to verify the ℕ↔℀\mathbb{N} \leftrightarrow \mathbb{Z} bijection. List the first ten values of the inverse map and check no integer is missed.
  • Apply the diagonal argument to the list r1=0.1357…,r2=0.2468…,r3=0.9090…,r4=0.1234…r_1 = 0.1357\ldots, r_2 = 0.2468\ldots, r_3 = 0.9090\ldots, r_4 = 0.1234\ldots. Construct a real number not in the list.
  • Predict first: is the set of finite subsets of β„•\mathbb{N} countable or uncountable? (Hint: a finite subset of β„•\mathbb{N} can be encoded as a finite binary string, and the set of finite binary strings is countable.)
  • True or false: the set of all sequences of zeros and ones (functions β„•β†’{0,1}\mathbb{N} \to \{0, 1\}) is countable. (Hint: this set is in bijection with 𝒫(β„•)\mathcal{P}(\mathbb{N}).)

A trap to watch for

"Countable" does NOT mean "you can finish counting it." A countable set may be infinite, the integers are countable, but the counting process 0,1,βˆ’1,2,βˆ’2,…0, 1, -1, 2, -2, \ldots never ends. The technical definition is: there exists an injection into β„•\mathbb{N}, equivalently a listing as a1,a2,a3,…a_1, a_2, a_3, \ldots. Some authors use "countable" to mean "denumerable / countably infinite" only (excluding finite sets); others use it to include finite. Velleman and Garrity use the inclusive convention, finite sets are countable too, which is the more common modern usage. Always check the convention before drawing conclusions about "the smallest uncountable set."

What you now know

You can distinguish countable and uncountable sets via bijections with β„•\mathbb{N}, prove β„š\mathbb{Q} is countable and ℝ\mathbb{R} is not, and recognize that cardinal arithmetic produces an infinite ladder of larger and larger infinities via the power-set operation. The next section confronts the paradoxes that lurked in 19th-century "naive" set theory, where unrestricted set comprehension led to outright contradictions.

Mark section complete β†’

References

  • Garrity, T. (2002). All the Mathematics You Missed: But Need to Know for Graduate School. Cambridge University Press, Sections 10.1-10.2.
  • Halmos, P. R. (1960). Naive Set Theory. Springer, Sections 22-24 (Cardinal Numbers).
  • Enderton, H. B. (1977). Elements of Set Theory. Academic Press, ch. 6.
  • Hrbacek, K., Jech, T. (1999). Introduction to Set Theory (3rd ed.). CRC Press, ch. 4.
  • Cantor, G. (1874). "Uber eine Eigenschaft des Inbegriffes aller reellen algebraischen Zahlen." Crelle's Journal, 77, 258-262 (original diagonal-argument paper).

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.