Closed Sets and Their Complements
In “Examples of Open Sets,” we saw that open sets can consist of many separate pieces and that removing finitely many points from the real line leaves an open set. Closed sets provide a complementary way to describe subsets of \(\mathbb{R}\): instead of checking what happens around every point in the set, we can check whether the points outside it form an open set.
This definition connects directly to earlier results about sequences and limit points. In particular, the Sequential Characterization of Closed Sets says that a set is closed precisely when it contains the limit of every convergent sequence of its points. We will use that result rather than prove it again. We will also introduce distance to a set, which gives a useful numerical test for closedness.
The equivalence follows from the definition of an open set: the complement is open exactly when every one of its points has a ball contained in that complement. Thus, at points outside a closed set, there is some positive distance one can move without entering the set. The radius may depend on the point outside the set.
Closed does not mean that a set must be an interval, bounded, or made up of its endpoints. For example, the real line itself is closed because its complement is empty, and the empty set is closed because its complement, \(\mathbb{R}\), is open. The next examples use complements to verify more informative cases.
Intervals and Rays That Are Closed
For \(a\leq b\), the complement of the closed interval \([a,b]\) is the union of the two open rays to its left and right. Since open rays are open and arbitrary unions of open sets are open, this gives a direct proof that \([a,b]\) is closed. The same reasoning applies to closed rays, which have just one open ray as their complement.
Proof. The complement of \([a,b]\) is
Both rays on the right are open, so their union is open by the Arbitrary Unions of Open Sets theorem. Therefore \([a,b]\) is closed. Likewise, \(\mathbb{R}\setminus[a,\infty)=(-\infty,a)\) and \(\mathbb{R}\setminus(-\infty,b]= (b,\infty)\), both of which are open. Hence the two closed rays are closed. \(\square\)
Worked Example: A Closed Interval and Its Complement
Consider \(E=[-2,3]\). Its complement is
Both pieces are open, so the complement is open and \(E\) is closed. The endpoints belong to \(E\), but that is not the reason the set is closed: the defining test concerns the points outside \(E\). For instance, at \(x=4\), the ball \(B_{1/2}(4)=(7/2,9/2)\) lies entirely outside \([-2,3]\). At \(x=-3\), the ball \(B_{1/2}(-3)=(-7/2,-5/2)\) does too. Points farther from the interval can use larger radii; points nearer an endpoint need a smaller one.
Worked Example: A Closed Ray
Let \(E=[5,\infty)\). Its complement is \((-\infty,5)\), an open ray, so \(E\) is closed. To check the local condition at a particular point outside \(E\), take \(x=4\). The distance from \(4\) to the endpoint \(5\) is \(1\), and \(B_{1/2}(4)=(7/2,9/2)\subseteq(-\infty,5)\). Thus this ball avoids \(E\). This illustrates why the endpoint belongs to the closed ray: points outside the ray have room around them to remain outside, whereas a point just to the left of \(5\) still has a positive gap to the ray.
Sequences Can Detect Missing Limit Points
The complement definition is not always the easiest test to apply. The Sequential Characterization of Closed Sets, established earlier in the course, gives a second method: a set is closed if and only if every convergent sequence of points in it has its limit in it. This helps explain what closedness rules out. A set cannot omit a real number that is the limit of a sequence of its own points.
Worked Example: Adding the Limit Point of a Sequence
Consider \(E=\{0\}\cup\{1/n:n\text{ is a positive integer}\}\). We verify that \(E\) is closed using the sequential characterization. Let \((x_k)\) be a convergent sequence with every \(x_k\in E\), and write \(x_k\to x\). If \(0\) occurs for infinitely many indices, the corresponding subsequence is constantly \(0\), so it converges to \(0\). Since every subsequence of a convergent sequence has the same limit, \(x=0\in E\).
Otherwise, after discarding finitely many terms if necessary, each \(x_k\) has the form \(1/n_k\), where \(n_k\) is a positive integer. If some fixed value \(1/n\) occurs infinitely often, the constant subsequence with that value converges to \(1/n\); uniqueness of limits gives \(x=1/n\in E\). If no such value occurs infinitely often, then for every positive integer \(M\), only finitely many of the indices \(k\) have \(n_k\leq M\): there are only finitely many possible values \(1,2,\ldots,M\), and each occurs only finitely often. Thus \(n_k\to\infty\). For every \(\varepsilon>0\), choose a positive integer \(M\) with \(1/M<\varepsilon\). Eventually \(n_k>M\), and hence \(|x_k|=1/n_k<1/M<\varepsilon\). Therefore \(x_k\to0\), so \(x=0\in E\). In every case, the limit belongs to \(E\). The Sequential Characterization of Closed Sets now gives that \(E\) is closed.
The point \(0\) is important: the sequence \(1,1/2,1/3,\ldots\) consists of points of the set and converges to \(0\). If \(0\) were omitted, the set would fail the sequential test. Including this one limit point is enough here; the argument also shows that there are no other limits of sequences from \(E\) outside \(E\).
Worked Example: A Half-Open Interval Is Not Closed
The set \([0,1)\) is not closed. The sequence \(x_n=1-1/n\), for positive integers \(n\geq2\), belongs to \([0,1)\) and converges to \(1\), but \(1\notin[0,1)\). Thus the set fails the Sequential Characterization of Closed Sets. In complement terms, \(1\) belongs to the complement, but every ball around \(1\) contains points less than \(1\) that lie in \([0,1)\). Consequently, the complement is not open.
Distance to a Set
For a nonempty set \(E\subseteq\mathbb{R}\), define the distance from \(x\) to \(E\) as the infimum of the distances from \(x\) to the points of \(E\). The infimum exists because those distances form a nonempty set of nonnegative real numbers. It need not be attained: there may be no point of \(E\) that is closest to \(x\).
Proof. Suppose first that \(E\) is closed and \(d(x,E)=0\). For each positive integer \(n\), the infimum property gives a point \(y_n\in E\) such that \(|x-y_n|<1/n\). Therefore \(y_n\to x\). By the Sequential Characterization of Closed Sets, \(x\in E\).
Conversely, suppose that whenever \(d(x,E)=0\), we have \(x\in E\). Take any \(x\notin E\). The contrapositive gives \(d(x,E)\neq0\), and since distances are nonnegative, \(d(x,E)>0\). Set \(r=d(x,E)/2\). If \(z\in B_r(x)\) belonged to \(E\), then the definition of infimum would give \(d(x,E)\leq|x-z|<r=d(x,E)/2\), a contradiction. Hence \(B_r(x)\subseteq\mathbb{R}\setminus E\). This holds for every \(x\notin E\), so the complement is open and \(E\) is closed. \(\square\)
This criterion describes closedness in terms of points whose distance from the set is zero. For a closed set, distance zero cannot occur at a point outside it. The criterion does not say that every point of a closed set must be separated from the other points by a positive distance. For example, the points \(1/n\) in the previous example get arbitrarily close to \(0\), which is itself in the set.
Worked Example: Distance to a Closed Interval
Let \(E=[a,b]\), where \(a\leq b\). For \(x\in[a,b]\), \(d(x,E)=0\), since \(x\) itself belongs to \(E\). If \(x<a\), then every \(y\in E\) satisfies \(y\geq a\), so \(|x-y|=y-x\geq a-x\). Equality holds for \(y=a\), giving \(d(x,E)=a-x\). If \(x>b\), then every \(y\in E\) satisfies \(y\leq b\), so \(|x-y|=x-y\geq x-b\), with equality at \(y=b\). Therefore
In particular, this distance is zero exactly when \(x\in[a,b]\), in agreement with the Distance Test for Closedness. Notice that the infimum is attained in each case: outside the interval, the nearest point is the corresponding endpoint.
Distance Changes Continuously
Distance to a set also has a useful stability property. Moving the point \(x\) a small amount cannot change its distance to \(E\) by more than that amount. This statement holds for every nonempty set, whether or not it is closed.
Proof. For any \(y\in E\), the triangle inequality gives \(|x-y|\leq|x-z|+|z-y|\). Taking the infimum over \(y\in E\) yields \(d(x,E)\leq|x-z|+d(z,E)\). Interchanging \(x\) and \(z\) gives \(d(z,E)\leq|x-z|+d(x,E)\). Together, these inequalities say \(-|x-z|\leq d(x,E)-d(z,E)\leq|x-z|\), which is equivalent to the claimed absolute-value bound. \(\square\)
In particular, distance to a nonempty set is a continuous function: if \(x\) is close to \(z\), the inequality forces \(d(x,E)\) to be close to \(d(z,E)\). The theorem does not require a closest point in \(E\); the infimum estimates work even when no distance is attained.
Choosing a Closedness Test
There are several ways to establish that a set is closed, and the simplest one depends on how the set is described. If its complement is an easily recognized open set, use the definition. If the set is given by a sequence or its potential limit points are apparent, use the Sequential Characterization of Closed Sets. For a nonempty set and a distance calculation, the Distance Test for Closedness may be more direct.
A common pitfall is to think that a set is closed merely because it contains some endpoints, or that it is not closed merely because it is unbounded. Closedness concerns whether all limits of convergent sequences from the set remain in it, equivalently whether the complement is open. The ray \([5,\infty)\) is unbounded and closed; \([0,1)\) is bounded but not closed. These properties are separate.
Check Your Understanding
Use the definition and results in this tutorial to answer the following questions.
- Why does showing that \(\mathbb{R}\setminus E\) is open prove that \(E\) is closed?
- What sequence shows that \([0,1)\) is not closed, and what limit does that sequence have?
- For \(E=[2,6]\), what is \(d(8,E)\), and which point of \(E\) realizes that distance?
- Why does the Distance Test for Closedness require the set \(E\) to be nonempty as stated?
- What bound does the 1-Lipschitz theorem give for \(\lvert d(x,E)-d(z,E)\rvert\) when \(|x-z|<1/10\)?