Tutorials › Topology (Undergraduate) › Constructing A Countable Dense Set From A Base

Countability Axioms and Sequences · Tutorial 364 of 799

Constructing A Countable Dense Set From A Base

Learn how to turn a countable base into a countable dense set and verify the construction directly from the definitions.

Intermediate 9 min read

What You'll Learn

  • Define second countability and separability precisely.
  • Construct a countable subset by choosing a point from each nonempty basis element.
  • Prove that the constructed subset meets every nonempty open set.
  • Apply the construction to the real line and to spaces with simpler topologies.
  • Recognize why basis elements are sets, not points, and how the choice of representatives affects the result.

From a Countable Base to a Countable Set of Points

A base for a topology records open sets by smaller, simpler open sets. If there are only countably many basis elements, one can select a point from each nonempty one. The resulting collection of points is countable, and the defining property of a base ensures that it meets every nonempty open set. This gives a general way to prove that a space is separable without first guessing a dense subset.

Throughout, \((X,\mathcal{T})\) is a topological space. A family \(\mathcal{B}\subseteq\mathcal{T}\) is a base if, for every open set \(U\in\mathcal{T}\) and every \(x\in U\), there is \(B\in\mathcal{B}\) such that \(x\in B\subseteq U\). The empty set may belong to a base, but it contains no point and will not contribute to our construction.

Definition: A space is second-countable if it has a finite or countably infinite base. A subset \(D\subseteq X\) is dense in \(X\) if \(\overline{D}=X\). A space is separable if it has a countable dense subset; here, “countable” includes finite sets and the empty set.

We will use the open-set test for density: \(D\) is dense in \(X\) if and only if every nonempty open set intersects \(D\). Indeed, by the neighborhood test for closure, a point \(x\) belongs to \(\overline{D}\) exactly when every open neighborhood of \(x\) intersects \(D\). Thus \(\overline{D}=X\) implies the open-set test. Conversely, if every nonempty open set meets \(D\), then every open neighborhood of every \(x\in X\) meets \(D\), so every \(x\in X\) belongs to \(\overline{D}\).

The Construction and Its Proof

Theorem: Every second-countable space is separable. More precisely, if \(\mathcal{B}\) is a finite or countable base for \(X\), one can choose one point from each nonempty member of \(\mathcal{B}\); the set of chosen points is countable and dense in \(X\).

Proof. Let \(\mathcal{B}_+=\{B\in\mathcal{B}:B\ne\varnothing\}\). For each \(B\in\mathcal{B}_+\), choose a point \(x_B\in B\), and let \(D=\{x_B:B\in\mathcal{B}_+\}\). The selection uses only countable choice when the family is countably infinite; in the usual set-theoretic setting for undergraduate mathematics this choice is available. If \(\mathcal{B}_+\) is finite, only finitely many choices are needed. Since \(D\) is the image of a finite or countable family under the assignment \(B\mapsto x_B\), it is finite or countable.

To prove density, let \(U\) be any nonempty open set. Choose \(x\in U\). Since \(\mathcal{B}\) is a base, there is \(B\in\mathcal{B}\) with \(x\in B\subseteq U\). The membership \(x\in B\) implies \(B\ne\varnothing\), so \(B\in\mathcal{B}_+\). By construction \(x_B\in B\), and therefore \(x_B\in U\). Since \(x_B\in D\), we have \(U\cap D\ne\varnothing\). Thus every nonempty open set meets \(D\), and the open-set test for density gives \(\overline{D}=X\). Hence \(D\) is a countable dense subset.

If \(X=\varnothing\), the empty family is a base and the construction produces \(D=\varnothing\). The density condition still holds: there are no nonempty open sets to test, and \(\overline{\varnothing}=\varnothing=X\). So the theorem includes the empty space. \(\square\)

The proof depends on two separate facts. Countability of the base controls the number of selected points. The base property guarantees that at least one selected point lies in each nonempty open set. Neither fact alone would establish the conclusion.

Worked Example: The Standard Real Line

Let \(\mathbb{R}\) have its standard topology, and take as a base all intervals \((a,b)\) with \(a,b\in\mathbb{Q}\) and \(a<b\). This family is countable because \(\mathbb{Q}\) is countable and the family is indexed by a subset of \(\mathbb{Q}\times\mathbb{Q}\). It is a base: if \(x\in U\) with \(U\) open, there is \(\varepsilon>0\) such that \((x-\varepsilon,x+\varepsilon)\subseteq U\). The density of \(\mathbb{Q}\) in \(\mathbb{R}\) gives rationals \(a,b\) with \(x-\varepsilon<a<x<b<x+\varepsilon\), so \(x\in(a,b)\subseteq U\).

For each basis interval \((a,b)\), choose its midpoint \(m_{a,b}=(a+b)/2\). Since \(a,b\) are rational, \(m_{a,b}\) is rational. The set of all chosen midpoints is exactly \(\mathbb{Q}\): every chosen midpoint is rational, and if \(q\in\mathbb{Q}\), then the basis interval \((q-1,q+1)\) has midpoint \((q-1+q+1)/2=2q/2=q\). Thus this particular choice produces \(D=\mathbb{Q}\).

Check: Let \(U\) be any nonempty open subset of \(\mathbb{R}\). Choose \(x\in U\), and then choose \(\varepsilon>0\) with \((x-\varepsilon,x+\varepsilon)\subseteq U\). There is a rational \(q\) with \(x-\varepsilon<q<x+\varepsilon\), so \(q\in U\cap\mathbb{Q}\). The constructed set is therefore dense, as required.

Worked Example: An Uncountable Indiscrete Space

Let \(X=\mathbb{R}\) as a set, but give it the indiscrete topology \(\mathcal{T}=\{\varnothing,X\}\). The one-element family \(\mathcal{B}=\{X\}\) is a base: the only nonempty open set is \(X\), and for every \(x\in X\) we have \(x\in X\subseteq X\). Choose \(p=0\) from its sole nonempty basis element. The construction gives \(D=\{0\}\), a countable set.

To check density directly, the only nonempty open set is \(X\), and \(X\cap\{0\}=\{0\}\ne\varnothing\). Hence \(D\) meets every nonempty open set and is dense. Equivalently, the only closed sets are \(\varnothing\) and \(X\); the only closed set containing \(\{0\}\) is \(X\), so \(\overline{\{0\}}=X\). This example shows that a space can be uncountable and still have a one-point dense subset when its topology is sufficiently coarse.

Check: Choosing a different point \(p\in X\) gives \(D=\{p\}\). The same open-set check applies, since the only nonempty open set \(X\) contains \(p\).

Worked Example: Two Valid Choices in the Sierpinski Space

Let \(X=\{a,b\}\) with topology \(\mathcal{T}=\{\varnothing,\{a\},X\}\). The family \(\mathcal{B}=\{\{a\},X\}\) is a base: each nonempty open set is itself in \(\mathcal{B}\), so each of its points lies in a basis element contained in that open set.

First choose \(a\) from \(\{a\}\) and \(a\) from \(X\). The resulting set is \(D_1=\{a\}\). The nonempty open sets are \(\{a\}\) and \(X\); both intersect \(D_1\), so \(D_1\) is dense. Now instead choose \(a\) from \(\{a\}\) and \(b\) from \(X\). This gives \(D_2=\{a,b\}=X\), which is dense because every nonempty open subset of \(X\) intersects \(X\).

Thus the selected set need not be unique. The proof does not require distinct points for distinct basis elements: it only requires the chosen point \(x_B\) to belong to its corresponding \(B\). Repeated choices may make the resulting set smaller, but cannot invalidate the density argument.

Check: The closed sets are \(\varnothing,\{b\},X\). The only closed set containing \(D_1=\{a\}\) is \(X\), so \(\overline{D_1}=X\). Also \(\overline{D_2}=X\) because \(D_2=X\) is itself closed. Both closure computations agree with the open-set test.

What the Construction Does—and Does Not—Say

The method gives a recipe once a countable base is known: ignore empty basis elements, choose a representative point from each remaining element, and take the set of representatives. A dense set may have fewer points than the base has elements, because different basis elements can contribute the same point. It may also be much smaller than the space, as the indiscrete example demonstrates.

A common mistake is to treat the basis itself as the dense set. In \(\mathbb{R}\), for example, a basis element such as \((0,1)\) is a set of real numbers, not a point to be placed into a subset \(D\subseteq\mathbb{R}\). The instruction “choose a point from \((0,1)\)” gives a real number, such as \(1/2\), whereas placing \((0,1)\) itself into \(D\) does not construct a subset of \(\mathbb{R}\) whose elements are points. The correction is to distinguish the family \(\mathcal{B}\) of open sets from the selected point set \(D\). The proof of density then uses \(x_B\in B\subseteq U\), not \(B\in D\).

There is also a quantifier to keep in view. Density must be checked against every nonempty open set \(U\), not just against the basis elements listed in the construction. The base property supplies the link: inside any such \(U\), around any chosen \(x\in U\), there is a basis element \(B\subseteq U\). The representative selected from that \(B\) then lies in \(U\). This is why the same construction works even when the open sets are not themselves basis elements.

Takeaway: A countable base provides countably many open sets that refine every open neighborhood. Choosing one point from each nonempty basis element produces a countable set that intersects every nonempty open set, and therefore is dense.

Check Your Understanding

Use the definition of a base and the open-set test for density to justify each answer.

  1. In the indiscrete topology on a nonempty set \(X\), explain why any singleton is dense.
  2. For the standard topology on \(\mathbb{R}\), choose one point from each rational-endpoint interval by taking its midpoint. Why does the selected set equal \(\mathbb{Q}\)?
  3. In the Sierpinski space with open sets \(\varnothing,\{a\},\{a,b\}\), which singleton is dense? Verify the answer using the nonempty open sets.
  4. Explain why choosing one point from each member of a countable base produces a countable set even if some chosen points repeat.
  5. In the proof of the theorem, identify the step that uses the base property and the step that uses countability.