Tutorials › Topology (Undergraduate) › Examples and Nonexamples of Nowhere Dense Sets

Closed Sets, Closure, Interior and Boundary · Tutorial 123 of 799

Examples and Nonexamples of Nowhere Dense Sets

Use closure and interior to decide which familiar subsets of the usual real line are nowhere dense, and identify the role of density in the contrasting case of the rationals.

Intermediate 10 min read

What You'll Learn

  • Apply the definition of nowhere dense using the interior of a set’s closure.
  • Prove that every finite subset of the usual real line is nowhere dense.
  • Verify that the integers are closed and have empty interior.
  • Show that the rationals are dense but have empty interior.
  • Distinguish empty interior from nowhere denseness with a concrete example.

Closure, Interior, and the Test for Nowhere Denseness

A set can be small in one sense and large in another. The integers are spread through the real line but leave open intervals between their points; the rationals meet every open interval, even though they do not contain any open interval. To classify such sets, we must inspect not just a set’s interior, but the interior of its closure.

Throughout, \(\mathbb{R}\) has its usual topology, whose open neighborhoods contain open intervals around each of their points. For \(A\subseteq\mathbb{R}\), \(\overline{A}\) denotes its closure and \(\operatorname{int}A\) its interior. Recall that \(x\in\overline{A}\) exactly when every open neighborhood of \(x\) meets \(A\), and that \(\operatorname{int}A\) is the union of all open sets contained in \(A\).

Definition: A set \(A\subseteq\mathbb{R}\) is nowhere dense if \(\operatorname{int}\overline{A}=\varnothing\). Thus the test is applied to the closure of \(A\), not just to \(A\) itself. A set with empty interior need not be nowhere dense.

This definition immediately gives a useful distinction. If \(A\) is closed, then \(\overline{A}=A\), so \(A\) is nowhere dense exactly when \(\operatorname{int}A=\varnothing\). If \(A\) is not closed, its closure may have a nonempty interior even when \(A\) itself has none.

Singletons and Finite Sets

Proposition: Every finite subset of \(\mathbb{R}\), including the empty set, is nowhere dense.

Proof. Let \(F\subseteq\mathbb{R}\) be finite. If \(F=\varnothing\), it is closed and has empty interior, so it is nowhere dense. Now suppose \(F\ne\varnothing\), and write \(m\) for its number of elements. To show \(F\) is closed, take any \(y\in\mathbb{R}\setminus F\). For each \(f\in F\), the distance \(|y-f|\) is positive. The minimum \(d=\min_{f\in F}|y-f|\) exists because \(F\) is finite, and \(d>0\). The interval \((y-d/2,y+d/2)\) contains \(y\) and misses \(F\), since every \(f\in F\) is at distance at least \(d\) from \(y\). Thus every point of \(\mathbb{R}\setminus F\) has an open neighborhood in \(\mathbb{R}\setminus F\), so the complement is open and \(F\) is closed. Hence \(\overline{F}=F\).

To show that \(F\) has empty interior, suppose an open interval \((x-r,x+r)\), with \(r>0\), were contained in \(F\). The \(m+1\) numbers \(x+r/(j+2)\), for \(j=1,\ldots,m+1\), are distinct and all lie in \((x,x+r)\subseteq(x-r,x+r)\). A set with \(m\) elements cannot contain \(m+1\) distinct numbers, a contradiction. No nonempty open interval is contained in \(F\), so \(\operatorname{int}F=\varnothing\). Because \(F\) is closed, \(\operatorname{int}\overline{F}=\operatorname{int}F=\varnothing\). Therefore \(F\) is nowhere dense. \(\square\)

Worked Example: A Singleton

Take \(A=\{3\}\). The finite-set result shows that \(A\) is closed, so \(\overline{A}=\{3\}\). Its interior is empty: every open neighborhood of \(3\) contains points other than \(3\), and therefore cannot be a subset of \(\{3\}\). It follows that \(\operatorname{int}\overline{A}=\varnothing\), so \(\{3\}\) is nowhere dense.

Check: the interval \((2,4)\) is a neighborhood of \(3\), and it contains \(5/2\), which is not in \(\{3\}\). This confirms that \(\{3\}\) contains no neighborhood of its point. Its closure is still exactly \(\{3\}\) because the set is closed.

Worked Example: A Finite Set with Several Points

Let \(F=\{-2,0,5\}\). The finite-set result gives \(\overline{F}=F\) and \(\operatorname{int}\overline{F}=\varnothing\), so \(F\) is nowhere dense. For a direct check that it is closed, take \(y=1\). Its distances to the three points are \(|1-(-2)|=3\), \(|1-0|=1\), and \(|1-5|=4\). The minimum is \(1\), so \((1-1/2,1+1/2)=(1/2,3/2)\) contains \(1\) and misses \(F\).

For a direct check that the interior is empty, \((-1,1)\) contains \(1/2\notin F\), and \((4,6)\) contains \(9/2\notin F\). More generally, the proposition proves that no open interval can be contained in this three-point set. Thus both parts of the nowhere-dense test hold: the closure is \(F\), and that closure contains no open interval.

The Integers: Closed but with Empty Interior

Proposition: The set \(\mathbb{Z}\subseteq\mathbb{R}\) is nowhere dense.

Proof. First we show that \(\mathbb{Z}\) is closed. If \(y\notin\mathbb{Z}\), there is an integer \(k\) with \(k<y<k+1\). Both \(y-k\) and \(k+1-y\) are positive, so let \(r=\frac12\min(y-k,k+1-y)>0\). Then \((y-r,y+r)\subset(k,k+1)\), which contains no integers. Thus every point outside \(\mathbb{Z}\) has a neighborhood disjoint from \(\mathbb{Z}\), and \(\mathbb{R}\setminus\mathbb{Z}\) is open. Hence \(\mathbb{Z}\) is closed and \(\overline{\mathbb{Z}}=\mathbb{Z}\).

Next, no nonempty open interval is contained in \(\mathbb{Z}\). Indeed, any open interval contains a bounded open subinterval, which contains infinitely many distinct real numbers. Only finitely many integers can lie in a bounded interval: if the interval is contained in \((a,b)\), its integers must lie between two fixed integers that bound \(a\) and \(b\). Therefore the subinterval contains a point not in \(\mathbb{Z}\). This proves \(\operatorname{int}\mathbb{Z}=\varnothing\). Since \(\mathbb{Z}\) is closed, \(\operatorname{int}\overline{\mathbb{Z}}=\varnothing\), as required. \(\square\)

Worked Example: Testing an Integer and a Noninteger

Consider the interval \((2.8,3.2)\) around the integer \(3\). It contains no integer other than \(3\): the neighboring integers are \(2\) and \(4\), and \(2<2.8\) while \(4>3.2\). This kind of gap does not remove \(3\) from the closure of \(\mathbb{Z}\), because \(3\) itself belongs to \(\mathbb{Z}\). The set is closed, so its closure contains exactly its integer points.

Now take the noninteger \(y=3.4\). The adjacent integers are \(3\) and \(4\), with distances \(3.4-3=0.4\) and \(4-3.4=0.6\). The proof’s choice gives \(r=\frac12\min(0.4,0.6)=0.2\), so the neighborhood \((3.2,3.6)\) contains \(3.4\) and no integer. This confirms directly that \(3.4\notin\overline{\mathbb{Z}}\).

Check: every integer has arbitrarily small neighborhoods, but none of those neighborhoods is a subset of \(\mathbb{Z}\); for example, \((3-0.1,3+0.1)\) contains \(3.05\), which is not an integer. The closure is \(\mathbb{Z}\), whose interior is empty, so the set is nowhere dense.

The Rationals: Dense but Not Nowhere Dense

The rationals provide the contrasting case. We will verify both relevant facts: every nonempty open interval contains a rational, so the closure is all of \(\mathbb{R}\); but every nonempty open interval also contains an irrational, so the rationals themselves have empty interior.

Proposition: In the usual topology on \(\mathbb{R}\), \(\overline{\mathbb{Q}}=\mathbb{R}\), \(\operatorname{int}\mathbb{Q}=\varnothing\), and \(\mathbb{Q}\) is not nowhere dense.

Proof. Let \((a,b)\) be any nonempty open interval, so \(a<b\). Choose a positive integer \(n\) with \(n(b-a)>2\), using the Archimedean property of \(\mathbb{R}\). Let \(m=\lfloor na\rfloor+1\), where \(\lfloor na\rfloor\) is the greatest integer not exceeding \(na\). Then \(na<m\le na+1<nb\), because \(nb-na>2\). Dividing by \(n>0\) gives \(a<m/n<b\). Thus every nonempty open interval contains a rational number. Every neighborhood of every real number contains such an interval, so every neighborhood meets \(\mathbb{Q}\). By the neighborhood test for closure, \(\overline{\mathbb{Q}}=\mathbb{R}\).

To show \(\operatorname{int}\mathbb{Q}=\varnothing\), take any nonempty open interval \((a,b)\). By the result just proved, choose \(q\in\mathbb{Q}\cap(a,b)\). Choose a positive integer \(n\) large enough that \(\sqrt{2}/n<b-q\). Then \(q+\sqrt{2}/n\) is still in \((a,b)\), since it is greater than \(q>a\) and less than \(b\). It is irrational: if it were rational, subtracting the rational number \(q\) and multiplying by the integer \(n\) would make \(\sqrt{2}\) rational. To recall why this is impossible, if \(\sqrt{2}=p/s\) in lowest terms with positive integers \(p,s\), then \(p^2=2s^2\), so \(p\) is even; writing \(p=2t\) gives \(s^2=2t^2\), so \(s\) is even too, contradicting that \(p/s\) was in lowest terms. Thus every nonempty open interval contains a point outside \(\mathbb{Q}\), and \(\operatorname{int}\mathbb{Q}=\varnothing\).

Finally, \(\operatorname{int}\overline{\mathbb{Q}}=\operatorname{int}\mathbb{R}=\mathbb{R}\), which is not empty. By definition, \(\mathbb{Q}\) is therefore not nowhere dense. \(\square\)

Worked Example: Rationals and Irrationals in an Interval

Consider \((1/3,2/3)\). The rational \(1/2\) lies in this interval because \(1/3<1/2<2/3\). The number \(1/2+\sqrt{2}/100\) lies there too: it is greater than \(1/2>1/3\), and \(\sqrt{2}<2\) gives \(1/2+\sqrt{2}/100<1/2+2/100=52/100<2/3\). It is irrational, since a rational value for \(1/2+\sqrt{2}/100\) would imply a rational value for \(\sqrt{2}\).

This interval illustrates the two different claims. It contains a rational, as every nonempty open interval does, and it also contains an irrational, so it is not a subset of \(\mathbb{Q}\). In fact, the rationals meet every neighborhood in \(\mathbb{R}\), making their closure all of \(\mathbb{R}\). The closure has nonempty interior, which is why \(\mathbb{Q}\) fails the nowhere-dense test.

Check: the inequalities above place \(1/2\) and \(1/2+\sqrt{2}/100\) strictly between the endpoints. The first belongs to \(\mathbb{Q}\); the second does not. Thus an empty interior for \(\mathbb{Q}\) does not imply that its closure has empty interior.

A Common Pitfall: Checking the Wrong Set

A frequent error is to reason, “\(\operatorname{int}\mathbb{Q}=\varnothing\), so \(\mathbb{Q}\) is nowhere dense.” The first statement is correct, but it checks only whether \(\mathbb{Q}\) contains an open interval. The definition asks whether \(\overline{\mathbb{Q}}\) contains an open interval. Since \(\overline{\mathbb{Q}}=\mathbb{R}\), its interior is \(\mathbb{R}\), not the empty set. Therefore the rationals are not nowhere dense.

The comparison can be summarized as follows. The closure of a finite set is itself and has empty interior; the closure of \(\mathbb{Z}\) is itself and has empty interior; but the closure of \(\mathbb{Q}\) is the whole real line. The closure step is essential, especially when the set under consideration is not closed.

Check Your Understanding

For each question, use the closure-and-interior definition rather than checking only the set’s own interior.

  1. Is \(\{0,1,2\}\) nowhere dense in \(\mathbb{R}\)? State its closure and the interior of that closure.
  2. Explain why the empty set is nowhere dense using the definition.
  3. Why does the fact that \(\operatorname{int}\mathbb{Q}=\varnothing\) not make \(\mathbb{Q}\) nowhere dense?
  4. Give a neighborhood of \(7/2\) that misses \(\mathbb{Z}\), and explain what this shows about the closure of \(\mathbb{Z}\).
  5. Which part of the nowhere-dense test changes when a set is not closed?