Tutorials › Real Analysis › Countable Unions

Sets and Functions · Tutorial 79 of 1000

Countable Unions

See how enumerations of individual sets can be combined to show that their union is countable, even when the sets overlap.

Beginner 9 min read

What You'll Learn

  • State the countable union theorem using enumerations of the sets.
  • Combine enumerations by indexing their entries with pairs of natural numbers.
  • Remove repetitions by assigning each element its first occurrence.
  • Apply the theorem to countable unions of finite sets.
  • Distinguish a sequence of sets from the union of its members.
  • Recognize the role of choosing enumerations in the usual theorem.

Combining Countable Sets

A countable set can be listed using natural-number labels. The next question is what happens when we have a sequence of countable sets: can all their elements be collected into one countable set? The answer is yes in the usual setting of real analysis. The basic idea is to arrange the lists in rows, use pairs of natural numbers to index all the entries, and then discard any repetitions.

The rows may overlap, and some may be empty or finite. These possibilities do not prevent a countable union. They do mean that a proof should not assume that every element appears in only one row, or that every row has infinitely many distinct elements.

Definition (Countable Union). Given sets \(A_1,A_2,\ldots\), their union is \(\bigcup_{n=1}^{\infty} A_n=\{x:x\in A_n\text{ for at least one }n\in\mathbb N\}\). It is called a countable union because the sets are indexed by the natural numbers.

The union collects the elements, not the sets themselves. For example, if \(A_1=\{a,b\}\) and \(A_2=\{b,c\}\), then \(A_1\cup A_2=\{a,b,c\}\): the shared element \(b\) occurs just once in the union. In an infinite family, elements can likewise occur in several rows.

The Countable Union Theorem

Suppose first that each nonempty set \(A_n\) comes with a surjective enumeration \(e_n:\mathbb N\to A_n\). If \(A_n\) is countably infinite, its bijection with \(\mathbb N\) is such an enumeration. If \(A_n\) is finite and nonempty, its finite list can be repeated to give a surjection from \(\mathbb N\). Empty sets need no enumeration.

Theorem (Countable Union Theorem). Let \((A_n)_{n\in\mathbb N}\) be a sequence of sets. Suppose that for each nonempty \(A_n\), a surjection \(e_n:\mathbb N\to A_n\) is given. Then \(\bigcup_{n=1}^{\infty} A_n\) is countable.

Proof. Write \(U=\bigcup_{n=1}^{\infty}A_n\). If \(U=\varnothing\), then \(U\) is finite and therefore countable. Suppose instead that \(U\ne\varnothing\). By the theorem from “Countable Sets” that \(\mathbb N\times\mathbb N\) is countable, fix a bijection \(q:\mathbb N\to\mathbb N\times\mathbb N\).

For each \(x\in U\), define a set of indices

$$ J_x=\{j\in\mathbb N:q(j)=(n,k)\text{ for some }n,k\in\mathbb N \text{ with }x\in A_n\text{ and }e_n(k)=x\}. $$

This set is nonempty. Since \(x\in U\), there is an \(n\) such that \(x\in A_n\). The set \(A_n\) is nonempty, and the surjectivity of \(e_n\) gives a \(k\in\mathbb N\) with \(e_n(k)=x\). The pair \((n,k)\) equals \(q(j)\) for some \(j\), because \(q\) is onto. That \(j\) belongs to \(J_x\).

Every nonempty subset of \(\mathbb N\) has a least element. Define \(i:U\to\mathbb N\) by letting \(i(x)\) be the least element of \(J_x\). We show that \(i\) is injective. Suppose \(i(x)=i(y)=j\). Since \(q\) is a function, there is one pair \((n,k)=q(j)\). The definition of \(J_x\) gives \(e_n(k)=x\), and the definition of \(J_y\) gives \(e_n(k)=y\). Therefore \(x=y\). Thus \(i\) is injective. By the Injection Criterion for Countability, \(U\) is countable. \(\square\)

The proof first allows entries to appear repeatedly in the combined arrangement: an element may occur in several sets, or several times in an enumeration. It then assigns that element its least index in the arrangement. This “first occurrence” rule produces distinct natural-number labels, which is exactly what the injection criterion requires.

There is a small set-theoretic point behind the theorem’s hypothesis. If we are told only that every \(A_n\) is countable, choosing one enumeration for every set in an infinite sequence is an instance of countable choice. In the usual real-analysis setting this choice is accepted. The theorem above states the proof precisely when the enumerations are given; in applications, they are often constructed explicitly.

Worked Example: A Union of Finite Sets Gives the Natural Numbers

For each \(n\in\mathbb N\), let \(A_n=\{2n-1,2n\}\). Each \(A_n\) is finite, and the sets are disjoint. Their union is \(\mathbb N\). Indeed, every element of \(A_n\) is a natural number, so \(\bigcup_{n=1}^{\infty}A_n\subseteq\mathbb N\). Conversely, every \(m\in\mathbb N\) is either even or odd. If \(m=2n\), then \(m\in A_n\); if \(m\) is odd, write \(m=2n-1\) for some \(n\in\mathbb N\), and again \(m\in A_n\). Hence \(\mathbb N\subseteq\bigcup_{n=1}^{\infty}A_n\), proving equality.

An enumeration of each row is \(e_n(1)=2n-1\), \(e_n(2)=2n\), and \(e_n(k)=2n\) for \(k\geq3\). This repeats an element after listing both members of \(A_n\), so it is a surjection from \(\mathbb N\) onto \(A_n\). The Countable Union Theorem applies, as expected.

Worked Example: Increasing Finite Sets Cover the Integers

For each \(n\in\mathbb N\), set \(F_n=\{-n,-n+1,\ldots,n\}\). The set \(F_n\) has \(2n+1\) elements, so it is finite. Every integer \(z\) belongs to some \(F_n\): choose \(n\in\mathbb N\) with \(n\geq |z|\); then \(-n\leq z\leq n\). Thus \(\mathbb Z\subseteq\bigcup_{n=1}^{\infty}F_n\). Each \(F_n\) is a subset of \(\mathbb Z\), so the reverse inclusion holds as well. Therefore

$$ \mathbb Z=\bigcup_{n=1}^{\infty}F_n. $$

This gives another route to the countability of \(\mathbb Z\), using the result on countable unions. The sets are not disjoint: for example, \(F_1=\{-1,0,1\}\) is a subset of \(F_2=\{-2,-1,0,1,2\}\). Repetition across rows causes no difficulty, because the union includes each integer only once.

Rows, Pairs, and Repeated Elements

The proof of the theorem uses the pairs \((n,k)\) to keep track of two choices: the row number \(n\), and the position \(k\) within that row. The earlier theorem that \(\mathbb N\times\mathbb N\) is countable tells us that these pairs can all be placed in a single sequence. The first-occurrence rule then turns this sequence of possible entries into distinct labels for the elements of the union.

Worked Example: The Rows of the Natural-Number Grid

For each \(n\in\mathbb N\), let \(R_n=\{(n,k):k\in\mathbb N\}\). The map \(e_n(k)=(n,k)\) is a bijection from \(\mathbb N\) to \(R_n\), so every row is countably infinite. Their union is \(\mathbb N\times\mathbb N\): each pair \((a,b)\) belongs to \(R_a\), and every member of every \(R_n\) is a pair of natural numbers. Consequently,

$$ \bigcup_{n=1}^{\infty}R_n=\mathbb N\times\mathbb N. $$

For instance, the diagonal listing from “Countable Sets” begins \((1,1),(1,2),(2,1),(1,3),(2,2),(3,1),\ldots\). It moves through more than one row rather than attempting to finish an infinite row before starting the next. In this example no pair occurs in two different rows, but the Countable Union Theorem also applies when rows overlap.

The indexing in the theorem is important. A sequence of sets means that each set has a natural-number index. The sets themselves may be finite, countably infinite, empty, or repeated. If only finitely many sets are being united, the result follows, by induction on the number of sets, from the theorem on the union of two finite sets when all of those sets are finite, or from the countable union theorem by appending empty sets when they are countable.

Worked Example: Overlapping Sets Still Have a Countable Union

Let \(B_n=\{1,2,\ldots,n\}\) for \(n\in\mathbb N\). Every \(B_n\) is finite, and \(B_n\subseteq B_{n+1}\), so the rows overlap and grow. Their union is \(\mathbb N\). Each \(m\in\mathbb N\) belongs to \(B_m\), while every element in any \(B_n\) is a natural number. Therefore \(\bigcup_{n=1}^{\infty}B_n=\mathbb N\).

A surjection \(e_n:\mathbb N\to B_n\) can list \(1,2,\ldots,n\) and repeat \(n\) thereafter: set \(e_n(k)=k\) when \(1\leq k\leq n\), and \(e_n(k)=n\) when \(k>n\). In particular, when \(n=3\), the first values are \(1,2,3,3,3,\ldots\), all of which lie in \(B_3\), and each element of \(B_3\) occurs. Repetition within a row and overlap between rows are both permitted.

A Useful Consequence and a Common Pitfall

Corollary (A Countable Union of Finite Sets Is Countable). If every \(A_n\) is finite, then \(\bigcup_{n=1}^{\infty}A_n\) is countable.

Proof. For each nonempty finite \(A_n\), choose a listing of its finitely many elements and repeat the last element forever to obtain a surjection \(e_n:\mathbb N\to A_n\). Choosing a listing for every \(n\) is again an instance of countable choice, as in the theorem; if the listings are given in advance, no choice is needed. If \(A_n=\varnothing\), no enumeration is needed. The Countable Union Theorem now applies and shows that \(\bigcup_{n=1}^{\infty}A_n\) is countable. \(\square\)

This result is useful because an infinite set can be built up from finite pieces. The integers in the preceding example are obtained as the union of the finite sets \(\{-n,\ldots,n\}\). The conclusion does not say that the union is finite; it says that its elements can be assigned distinct labels from \(\mathbb N\).

A common pitfall is to argue that a union is countable merely because every one of its members belongs to some countable set, without accounting for the infinitely many sets. The theorem supplies the missing organization: pair each set index with a position in that set’s enumeration, use the countability of \(\mathbb N\times\mathbb N\), and handle repetitions. Another pitfall is assuming that a row-by-row listing must finish a row before moving on. An infinite row has no last entry, so the diagonal or paired indexing method is what ensures progress through all rows.

Key takeaway. A sequence of countable sets has a countable union when their enumerations can be chosen: pair each row with a position, then label each element by its first occurrence. The sets may overlap, be finite, or be empty.

Check Your Understanding

Use the theorem and examples to answer the following questions.

  1. In the Countable Union Theorem, what do the two coordinates of a pair \((n,k)\) represent?
  2. Why is the set \(J_x\) nonempty for every \(x\) in the union?
  3. How does choosing the least index in \(J_x\) help prove that the union is countable?
  4. Why does overlap between the sets \(A_n\) not invalidate the theorem?
  5. How can a nonempty finite set be given a surjective enumeration from \(\mathbb N\)?
  6. What choice is involved when each set in a sequence is known to be countable but its enumeration has not been specified?