Tutorials › Real Analysis › Complements of Closed Sets

Topology of the Real Line · Tutorial 241 of 1000

Complements of Closed Sets

Use closedness to locate nearest points and describe the maximal open intervals that make up a set’s complement.

Intermediate 9 min read

What You'll Learn

  • Prove that every point has a nearest point in a nonempty closed subset of the real line
  • Show that a point outside a closed set has positive distance from it
  • Construct the maximal open interval in the complement around any chosen point
  • Identify when the endpoints of complementary intervals belong to the closed set
  • Distinguish point-by-point positive distance from a uniform distance bound

What Lies Outside a Closed Set?

The previous tutorial showed that a set is closed exactly when its complement in \(\mathbb{R}\) is open. Here we use that fact to examine the complement more closely. A point outside a closed set does not merely fail to belong to the set: it has a whole interval around it that avoids the set. Moreover, the complement can be organized into maximal open intervals, whose finite endpoints lie in the closed set.

We will also establish a useful distance result. If \(F\) is a nonempty closed subset of \(\mathbb{R}\), then every real number has at least one nearest point in \(F\). This nearest point need not be unique, but its existence gives a precise way to measure how far a point outside \(F\) lies from the set.

A Nearest Point in a Closed Set

For a nonempty set \(F\subseteq\mathbb{R}\) and \(x\in\mathbb{R}\), the distance from \(x\) to \(F\) is the infimum of the distances from \(x\) to points of \(F\). The infimum is always a finite nonnegative real number: the distances are nonnegative, and choosing any one point of \(F\) gives a finite upper bound. The infimum need not be attained for an arbitrary set. Closedness is what ensures attainment.

Theorem (Nearest Point in a Closed Subset of \(\mathbb{R}\)): Let \(F\subseteq\mathbb{R}\) be nonempty and closed, and let \(x\in\mathbb{R}\). There exists \(p\in F\) such that \(|x-p|=d(x,F)\).

Proof. Put \(\delta=d(x,F)\). For each \(n\in\mathbb{N}_0\), the definition of infimum gives a point \(y_n\in F\) such that

$$ \delta\leq |x-y_n|<\delta+\frac{1}{n+1}. $$

The upper bound implies \(|x-y_n|<\delta+1\), so the triangle inequality gives \(|y_n|\leq |x|+|x-y_n|<|x|+\delta+1\). Thus \((y_n)\) is bounded. By the Bolzano-Weierstrass Theorem, it has a convergent subsequence \((y_{n_k})\), say \(y_{n_k}\to p\). Since every \(y_{n_k}\) belongs to \(F\) and \(F\) is closed, the Sequential Characterization of Closed Sets gives \(p\in F\).

The displayed bounds show that \(|x-y_n|\to\delta\), because \(0\leq |x-y_n|-\delta<1/(n+1)\). Also, \(y_{n_k}\to p\) implies \(|x-y_{n_k}|\to|x-p|\), by continuity of the absolute value (equivalently, by the reverse triangle inequality). The same subsequence therefore has distance limit both \(\delta\) and \(|x-p|\), so \(|x-p|=\delta=d(x,F)\). This proves the theorem. \(\square\)

If \(x\in F\), then \(d(x,F)=0\), and \(x\) itself is a nearest point. If \(x\notin F\), the complement characterization from the previous tutorial says that \(\mathbb{R}\setminus F\) is open. Hence some ball around \(x\) lies in the complement, so every point of \(F\) is at least that radius away from \(x\). In particular, \(d(x,F)>0\). The theorem then supplies a point of \(F\) exactly that positive distance away.

Worked Example: A Nearest Point Can Fail to Be Unique

Let \(F=\{-4,2,9\}\), a nonempty closed subset of \(\mathbb{R}\), and take \(x=-1\). The distances to the three points are

$$ |-1-(-4)|=3,\qquad |-1-2|=3,\qquad |-1-9|=10. $$

Consequently, \(d(-1,F)=3\), and both \(-4\) and \(2\) are nearest points. This example verifies that the nearest-point theorem promises existence, not uniqueness. The open ball \(B_3(-1)=(-4,2)\) contains no point of \(F\), while its boundary points \(-4\) and \(2\) are in \(F\). A ball of radius greater than \(3\), such as \(B_4(-1)=(-5,3)\), does meet \(F\).

Maximal Open Intervals in the Complement

An open subset of the real line can have many pieces, and those pieces may be bounded intervals, unbounded rays, or the whole line. For the complement of a closed set, we can describe each piece directly, without assuming in advance how many pieces there are. Fix a point \(x\notin F\). We will extend an interval around \(x\) as far as possible while keeping it inside \(\mathbb{R}\setminus F\).

Theorem (Maximal Intervals in the Complement): Let \(F\subseteq\mathbb{R}\) be closed, and put \(U=\mathbb{R}\setminus F\). For every \(x\in U\), there is a maximal open interval \(I_x=(a,b)\) containing \(x\) and contained in \(U\). Here \(a\) may be \(-\infty\) and \(b\) may be \(+\infty\). Every finite endpoint of \(I_x\) belongs to \(F\). These intervals cover \(U\), and any two are either equal or disjoint.

Proof. Since \(U\) is open, choose \(r>0\) such that \((x-r,x+r)\subseteq U\). Define

$$ A=\{t\leq x:[t,x]\subseteq U\},\qquad B=\{t\geq x:[x,t]\subseteq U\}. $$

The set \(A\) is nonempty because \(x-r/2\in A\), and \(B\) is nonempty because \(x+r/2\in B\). Let \(a=\inf A\), allowing \(a=-\infty\) if \(A\) is unbounded below, and let \(b=\sup B\), allowing \(b=+\infty\) if \(B\) is unbounded above. The ball around \(x\) ensures \(a<x<b\).

We first check that every point strictly between \(a\) and \(x\) lies in \(U\). If \(a<y\leq x\), the definition of infimum gives some \(t\in A\) with \(t<y\); otherwise \(y\) would be a lower bound for \(A\) larger than \(a\). Since \([t,x]\subseteq U\), it follows that \(y\in U\). This argument also applies when \(a=-\infty\), because \(A\) is then unbounded below. Likewise, every \(y\) with \(x\leq y<b\) lies in \(U\). Thus \((a,b)\subseteq U\), and this interval contains \(x\).

If \(a\) is finite, then \(a\notin U\). Indeed, if \(a\in U\), openness would give some \(s>0\) such that \((a-s,a+s)\subseteq U\). We already know that every point of \((a,x]\) lies in \(U\). Together these facts imply \([a-s/2,x]\subseteq U\), so \(a-s/2\in A\), contradicting that \(a\) is a lower bound for \(A\). Since \(a\notin U\), it belongs to \(F\). The same argument at the right endpoint shows that if \(b\) is finite, then \(b\in F\).

To verify maximality, let \(J\) be any open interval contained in \(U\) and containing \(x\). For each \(y\in J\), the interval property gives \([x,y]\subseteq J\) when \(y\geq x\), and \([y,x]\subseteq J\) when \(y\leq x\). Thus \(y\) belongs to \(B\) or \(A\), respectively, and so \(a\leq y\leq b\). Since \(J\) is open, it also contains a point \(y'\) beyond \(y\) on the same side of \(x\) (that is, \(y'>y\) if \(y\geq x\), or \(y'<y\) if \(y\leq x\)); the same argument puts \(y'\) in \(B\) or \(A\), so \(a<y<b\). Therefore \(J\subseteq(a,b)\). This proves that \((a,b)\) is maximal among open intervals in \(U\) containing \(x\).

Each point \(x\in U\) lies in its interval \(I_x\), so these intervals cover \(U\). Now suppose two such maximal intervals overlap. Their union is an open interval contained in \(U\): the overlap ensures that the union has no gap. It contains both original intervals, so maximality forces them to be equal. If they do not overlap, they are disjoint. This proves all the claims. \(\square\)

The result gives a concrete picture of the complement: it is partitioned into disjoint maximal open intervals, and every finite endpoint of any such interval is in the closed set. An endpoint cannot be missing from \(F\), because if it were in the open complement, the interval could be extended farther.

Worked Example: Gaps Around a Finite Closed Set

Let \(F=\{-3,1,4\}\). Removing these three points divides the real line into four maximal open intervals:

$$ \mathbb{R}\setminus F=(-\infty,-3)\cup(-3,1)\cup(1,4)\cup(4,\infty). $$

For example, \((-3,1)\) is contained in the complement, and it cannot be enlarged as an open interval within the complement: extending it to the left would include \(-3\), and extending it to the right would include \(1\). Both endpoints belong to \(F\). The outer intervals are maximal rays; each has one finite endpoint in \(F\) and extends without bound in the other direction.

Worked Example: A Bounded Gap and an Unbounded Ray

Take \(F=[-1,2]\cup[6,\infty)\), which is closed. Its complement is

$$ \mathbb{R}\setminus F=(-\infty,-1)\cup(2,6). $$

The point \(x=4\) lies in the bounded gap \((2,6)\), whose two endpoints belong to \(F\). The point \(x=-3\) lies in the unbounded interval \((-\infty,-1)\); its finite endpoint \(-1\) belongs to \(F\). Notice that \(6\) is the right endpoint of the gap \((2,6)\), and the gap cannot be extended past it because the set \(F\) includes every point at or to the right of \(6\). This checks why the interval to the left of that part of \(F\) stops at \(6\).

Pointwise Distance Is Not Uniform Distance

For a nonempty closed set \(F\), every point \(x\notin F\) has \(d(x,F)>0\). It is tempting to conclude that there is one positive number that works for every point outside \(F\). That conclusion is false: the distance can depend on \(x\) and can become arbitrarily small as \(x\) approaches an endpoint of a complementary interval.

Worked Example: Distances Can Shrink to Zero

Let \(F=[0,\infty)\), so \(F\) is closed and its complement is \((-\infty,0)\). For each positive integer \(n\), put \(x_n=-1/n\). Each \(x_n\) lies outside \(F\), and its nearest point in \(F\) is \(0\). Therefore

$$ d(x_n,F)=\left|-\frac{1}{n}-0\right|=\frac{1}{n}>0. $$

Every individual point \(x_n\) has positive distance from \(F\), but \(1/n\to0\). Thus there is no single positive lower bound for \(d(x,F)\) as \(x\) ranges over the entire complement. This is consistent with the interval description: the complementary ray has endpoint \(0\), and points in the ray can approach that endpoint as closely as desired.

A useful distinction is that closedness controls the boundary of each complementary interval, not a uniform gap between the whole set and all points outside it. The nearest-point theorem is pointwise: for each chosen \(x\), it identifies at least one point of \(F\) realizing \(d(x,F)\). The maximal-interval theorem is also local in this sense: each complementary interval has its own endpoints, and different intervals may have very different lengths.

Check Your Understanding

Use the nearest-point theorem and the maximal-interval description to answer these questions.

  1. Why does the proof of the nearest-point theorem produce a bounded sequence of points in \(F\)?
  2. Can a point outside a nonempty closed set have distance zero from that set? Explain using the open complement.
  3. Why must every finite endpoint of a maximal open interval in the complement belong to \(F\)?
  4. For \(F=[-2,1]\cup[5,\infty)\), identify the maximal open intervals in \(\mathbb{R}\setminus F\) and their finite endpoints.
  5. Why does positive distance for each point outside \(F\) not imply one positive lower bound that works for all such points?