Skip to main content

MATH 308 — Lec 18 — Cardinality: Countable

Math 308 · November 14, 2026

Lecture 18 — Cardinality: Finite and Countable Sets
MATH 308  Bridge to Advanced Mathematics  Chartrand §11.1–11.2

Goals for today. By the end of this lecture you should be able to:

  • say precisely what it means for two sets to have the same cardinality — a bijection between them — and connect this to Lecture 16;

  • distinguish finite, denumerable (countably infinite), countable, and uncountable sets;

  • prove a set is denumerable by listing its elements a1,a2,a3,…a_1, a_2, a_3, \dotsa1​,a2​,a3​,… with no repeats;

  • show that Z\mathbb{Z}Z, N×N\mathbb{N}\times \mathbb{N}N×N, and Q\mathbb{Q}Q are countable, using the pairing and zig-zag arguments.

When do two sets have the same size? (§11.1)

For a finite set we already have a notion of size: recall from Lecture 1 that ∣A∣\left\lvert A \right\rvert∣A∣ is the number of elements of AAA. The sets A={a,b,c}A = \{a,b,c\}A={a,b,c} and B={x,y,z}B = \{x,y,z\}B={x,y,z} “have the same size” because each has three elements. But there is a second way to see this that never counts: we can pair off their elements,

a↔x,b↔y,c↔z.a \leftrightarrow x, \qquad b \leftrightarrow y, \qquad c \leftrightarrow z.a↔x,b↔y,c↔z.

This pairing is exactly a bijective function f ⁣:A→Bf\colon A \to Bf:A→B (Lecture 16): one that is injective (no two elements of AAA are sent to the same place) and surjective (nothing in BBB is missed). The counting method needs finiteness; the pairing method does not. That is the whole idea of this chapter.

Definition 1 (Same cardinality). Two sets AAA and BBB (finite or infinite) have the same cardinality, written ∣A∣=∣B∣\left\lvert A \right\rvert = \left\lvert B \right\rvert∣A∣=∣B∣, if either both are empty or there exists a bijection f ⁣:A→Bf\colon A \to Bf:A→B. In this case we call AAA and BBB numerically equivalent.

A bijection f A to B pairs off elements one-to-one, with none left over on either side. This — not counting — is our definition of “same size.”

A bijection f ⁣:A→Bf\colon A \to Bf:A→B pairs off elements one-to-one, with none left over on either side. This — not counting — is our definition of “same size.”

Example 1. ∣{a,b,c}∣=∣{x,y,z}∣\left\lvert \{a,b,c\} \right\rvert = \left\lvert \{x,y,z\} \right\rvert∣{a,b,c}∣=∣{x,y,z}∣, witnessed by f={(a,x),(b,y),(c,z)}f = \{(a,x),(b,y),(c,z)\}f={(a,x),(b,y),(c,z)}. Two finite sets are numerically equivalent precisely when they have the same number of elements; for finite sets the new definition agrees with plain counting.

Remark 1. Numerical equivalence is an equivalence relation (Lecture 14) on any collection of sets: ∣A∣=∣A∣\left\lvert A \right\rvert=\left\lvert A \right\rvert∣A∣=∣A∣ via the identity (reflexive); a bijection f ⁣:A→Bf\colon A\to Bf:A→B has a bijective inverse f−1 ⁣:B→Af^{-1}\colon B \to Af−1:B→A (Lecture 17), giving symmetry; and a composition of bijections is a bijection (Lecture 17), giving transitivity. So “same cardinality” genuinely sorts sets into size-classes.

Definition 2 (Finite and infinite). A set SSS is finite if S=∅S = \varnothingS=∅ or ∣S∣=n\left\lvert S \right\rvert = n∣S∣=n for some n∈Nn \in \mathbb{N}n∈N. A set is infinite if it is not finite. We are about to give “∣S∣\left\lvert S \right\rvert∣S∣” a meaning even when SSS is infinite — and the surprise is that not all infinities are the same size (Lecture 19).

Countably infinite (denumerable) sets (§11.2)

The simplest infinite set is N={1,2,3,… }\mathbb{N}= \{1,2,3,\dots\}N={1,2,3,…}. We take it as the yardstick for the smallest kind of infinity.

Definition 3 (Denumerable, countable). A set AAA is denumerable (or countably infinite) if ∣A∣=∣N∣\left\lvert A \right\rvert = \left\lvert \mathbb{N} \right\rvert∣A∣=∣N∣, i.e. there is a bijection f ⁣:N→Af\colon \mathbb{N}\to Af:N→A. A set is countable if it is finite or denumerable, and uncountable otherwise.

A bijection f ⁣:N→Af\colon \mathbb{N}\to Af:N→A does something concrete: it hands us a list. Writing an=f(n)a_n = f(n)an​=f(n), we get A={a1,a2,a3,… }A = \{a_1, a_2, a_3, \dots\}A={a1​,a2​,a3​,…} in which every element of AAA appears exactly once. Conversely, any such repetition-free list a1,a2,a3,…a_1, a_2, a_3, \dotsa1​,a2​,a3​,… defines a bijection g(n)=ang(n) = a_ng(n)=an​. This gives our working test.

Proposition 1 (The listing test). *A set AAA is denumerable if and only if its elements can be arranged in a list

A={a1,a2,a3,… }A = \{a_1, a_2, a_3, \dots\}A={a1​,a2​,a3​,…}

in which every element of AAA occurs once and only once.*

Certainly N\mathbb{N}N itself is denumerable (list it as 1,2,3,…1,2,3,\dots1,2,3,…; the bijection is the identity). The first real surprise is that a strictly larger-looking set is no bigger.

Theorem 2. The set Z\mathbb{Z}Z of integers is denumerable.

Proof. List the integers by alternating outward from 000:

0, 1, −1, 2, −2, 3, −3, …0,\ 1,\ -1,\ 2,\ -2,\ 3,\ -3,\ \dots0, 1, −1, 2, −2, 3, −3, …

Every integer appears exactly once, so by the listing test Z\mathbb{Z}Z is denumerable. Explicitly, the bijection f ⁣:N→Zf\colon \mathbb{N}\to \mathbb{Z}f:N→Z is

f(n)={n2,n even,−n−12,n odd,f(1)=0, f(2)=1, f(3)=−1, f(4)=2, f(5)=−2, …f(n) = \begin{cases} \dfrac{n}{2}, & n \text{ even},\\[4pt] -\dfrac{n-1}{2}, & n \text{ odd}, \end{cases} \qquad f(1)=0,\ f(2)=1,\ f(3)=-1,\ f(4)=2,\ f(5)=-2,\ \dotsf(n)=⎩⎨⎧​2n​,−2n−1​,​n even,n odd,​f(1)=0, f(2)=1, f(3)=−1, f(4)=2, f(5)=−2, …

 ◻

The bijection fN to Z: sweep outward from 0 so each integer is caught exactly once. Here N Z yet |N|=|Z|.

The bijection f ⁣:N→Zf\colon\mathbb{N}\to\mathbb{Z}f:N→Z: sweep outward from 000 so each integer is caught exactly once. Here N⊊Z\mathbb{N}\subsetneq \mathbb{Z}N⊊Z yet ∣N∣=∣Z∣\left\lvert \mathbb{N} \right\rvert=\left\lvert \mathbb{Z} \right\rvert∣N∣=∣Z∣.

Remark 2 (Galileo’s paradox). Note N⊊Z\mathbb{N}\subsetneq \mathbb{Z}N⊊Z, yet ∣N∣=∣Z∣\left\lvert \mathbb{N} \right\rvert = \left\lvert \mathbb{Z} \right\rvert∣N∣=∣Z∣: a set can be numerically equivalent to a proper subset of itself. This can never happen for finite sets — and it is essentially the defining feature of an infinite set. We revisit it in the framed box below.

A convenient tool (which we will not prove in full) records that “N\mathbb{N}N is the smallest infinity”:

Lemma 3 (Subsets of countable sets). Every subset of a countable set is countable. In particular, an infinite subset of a denumerable set is again denumerable.

Idea: if A={a1,a2,a3,… }A = \{a_1, a_2, a_3, \dots\}A={a1​,a2​,a3​,…} and B⊆AB \subseteq AB⊆A is infinite, walk down the list of AAA and record the elements that land in BBB; the Well-Ordering Principle (Lecture 12) guarantees this produces a repetition-free list b1,b2,b3,…b_1, b_2, b_3, \dotsb1​,b2​,b3​,… of all of BBB. For example, the even integers 2Z⊆Z2\mathbb{Z}\subseteq \mathbb{Z}2Z⊆Z are denumerable, since 2Z2\mathbb{Z}2Z is an infinite subset of the denumerable set Z\mathbb{Z}Z.

Products and Q\mathbb{Q}Q: the zig-zag (§11.2)

To reach Q\mathbb{Q}Q we first handle a grid. The key move — Cantor’s zig-zag — is to sweep a two-dimensional array along its finite diagonals.

Theorem 4. N×N\mathbb{N}\times \mathbb{N}N×N is denumerable.

Proof. Arrange the pairs (i,j)(i,j)(i,j) in an infinite grid, with (i,j)(i,j)(i,j) in row iii and column jjj. Each anti-diagonal {(i,j):i+j=k}\{(i,j) : i+j = k\}{(i,j):i+j=k} is finite. Traverse diagonal k=2k=2k=2, then k=3k=3k=3, then k=4k=4k=4, and so on, listing the finitely many pairs on each before moving to the next:

(1,1), (1,2),(2,1), (1,3),(2,2),(3,1), (1,4),(2,3),(3,2),(4,1), …(1,1),\ (1,2),(2,1),\ (1,3),(2,2),(3,1),\ (1,4),(2,3),(3,2),(4,1),\ \dots(1,1), (1,2),(2,1), (1,3),(2,2),(3,1), (1,4),(2,3),(3,2),(4,1), …

Every pair (i,j)(i,j)(i,j) sits on exactly one diagonal and so is reached exactly once. By the listing test, N×N\mathbb{N}\times \mathbb{N}N×N is denumerable. ◻

Cantor’s zig-zag through N cross N: each anti-diagonal (i+j constant) holds finitely many pairs, so sweeping diagonal by diagonal lists every pair exactly once.

Cantor’s zig-zag through N×N\mathbb{N}\times\mathbb{N}N×N: each anti-diagonal (i+ji+ji+j constant) holds finitely many pairs, so sweeping diagonal by diagonal lists every pair exactly once.

Corollary 5. The set Q\mathbb{Q}Q of rational numbers is denumerable.

Proof. First take the positive rationals Q+\mathbb{Q}^{+}Q+. Every q∈Q+q \in \mathbb{Q}^{+}q∈Q+ is q=j/iq = j/iq=j/i for some i,j∈Ni,j \in \mathbb{N}i,j∈N, so the map (i,j)↦j/i(i,j) \mapsto j/i(i,j)↦j/i sends N×N\mathbb{N}\times \mathbb{N}N×N onto Q+\mathbb{Q}^{+}Q+. Walk the zig-zag list of N×N\mathbb{N}\times\mathbb{N}N×N from Theorem 4 and write down each value j/ij/ij/i the first time it appears, skipping any fraction already listed (e.g. skip 2/22/22/2 since 1/11/11/1 came first). This produces a repetition-free list of all of Q+\mathbb{Q}^{+}Q+:

11, 21, 12, 31, 13, 41, 32, 23, 14, …\tfrac11,\ \tfrac21,\ \tfrac12,\ \tfrac31,\ \tfrac13,\ \tfrac41,\ \tfrac32,\ \tfrac23,\ \tfrac14,\ \dots11​, 12​, 21​, 13​, 31​, 14​, 23​, 32​, 41​, …

So Q+\mathbb{Q}^{+}Q+ is denumerable (it is infinite, and we have listed it). Now list all of Q\mathbb{Q}Q by interleaving, exactly as we did for Z\mathbb{Z}Z: put 000 first, then alternate each positive rational with its negative,

0, q1, −q1, q2, −q2, q3, −q3, …,0,\ q_1,\ -q_1,\ q_2,\ -q_2,\ q_3,\ -q_3,\ \dots,0, q1​, −q1​, q2​, −q2​, q3​, −q3​, …,

where q1,q2,q3,…q_1, q_2, q_3, \dotsq1​,q2​,q3​,… is the list of Q+\mathbb{Q}^{+}Q+. Every rational appears exactly once, so Q\mathbb{Q}Q is denumerable. ◻

This is genuinely startling. The rationals are dense — between any two of them lies another (Lecture 8) — so on the number line they seem to leave no gaps. Yet as a set they can be lined up q1,q2,q3,…q_1, q_2, q_3, \dotsq1​,q2​,q3​,… just like N\mathbb{N}N. Density and cardinality are different questions. In Lecture 19 we prove that R\mathbb{R}R cannot be listed this way: R\mathbb{R}R is uncountable, a strictly larger infinity.

Homework problems

  1. Exhibit an explicit bijection N→{2,4,6,8,… }\mathbb{N}\to \{2,4,6,8,\dots\}N→{2,4,6,8,…} and one N→{5,6,7,8,… }\mathbb{N}\to \{5,6,7,8,\dots\}N→{5,6,7,8,…}. Conclude each set is denumerable.

  2. Using the formula f(n)f(n)f(n) from Theorem 2.2, compute f(6)f(6)f(6), f(7)f(7)f(7), and f(8)f(8)f(8). Which integer maps to −4-4−4?

  3. Write out the first ten terms of the zig-zag list of N×N\mathbb{N}\times \mathbb{N}N×N. On which diagonal (i+j=?i+j = ?i+j=?) does the pair (3,4)(3,4)(3,4) first appear?

  4. List the first eight distinct values in the Q+\mathbb{Q}^{+}Q+ enumeration, being careful to skip repeats (e.g. 2/22/22/2, 2/42/42/4).

  5. True or false, with a one-line reason: (a) every subset of Q\mathbb{Q}Q is countable;  (b) N×N×N\mathbb{N}\times \mathbb{N}\times \mathbb{N}N×N×N is denumerable;  (c) if AAA is uncountable and A⊆BA \subseteq BA⊆B, then BBB is uncountable.

  6. Explain in one or two sentences why the “list all fractions” idea does not immediately list R\mathbb{R}R. (What goes wrong that Lecture 19 will make precise?)

Suggested textbook exercises (Chartrand §11.1–11.2): 11.2, 11.4, 11.8, 11.10, 11.14, 11.18.

← Back to Math 308