Tutorials › Real Analysis › Closed Sets in Metric Spaces

Metric Spaces · Tutorial 658 of 1000

Closed Sets in Metric Spaces

Learn to recognize closed sets by their complements and by the limits of sequences, and see how closedness behaves under basic set operations and restriction to a subspace.

Advanced 10 min read

What You'll Learn

  • Define closed sets through openness of their complements
  • Characterize closed sets using limits of convergent sequences
  • Prove that arbitrary intersections and finite unions of closed sets are closed
  • Show that closed metric balls are closed using the reverse triangle inequality
  • Distinguish closedness in a metric space from closedness in a subspace

From Open Sets to Closed Sets

In the previous tutorial, openness was defined by a local condition: every point of an open set has a ball around it contained in the set. Closedness is introduced by looking at the complement. A set is closed when everything outside it forms an open set. This definition applies in every metric space, whether or not the space resembles the real line.

Closedness also has a useful sequential interpretation. A closed set cannot lose the limit of a convergent sequence whose terms all lie in the set. We will prove that this property characterizes closed sets, then use it alongside the complement definition to study set operations and examples.

Definition: Let \((X,d)\) be a metric space. A set \(F\subseteq X\) is closed in \(X\) if its complement \(X\setminus F\) is open in \(X\).

As with openness, the space matters: closedness is always understood relative to a specified metric space. The empty set and \(X\) itself are both closed, because their complements \(X\) and \(\varnothing\) are open, respectively. A set can also be both open and closed; the discrete metric provides examples of this later.

Closed Sets and Limits of Sequences

A sequence in a set may converge to a point that is not in the set. Closedness rules out exactly that possibility. The following theorem gives a test for closedness that uses only convergent sequences and their limits.

Theorem (Sequential Characterization of Closed Sets): Let \(F\) be a subset of a metric space \((X,d)\). Then \(F\) is closed in \(X\) if and only if, whenever a sequence \((x_n)\) in \(F\) converges in \(X\) to \(x\), the limit \(x\) belongs to \(F\).

Proof. First suppose that \(F\) is closed, and let \((x_n)\) be a sequence in \(F\) with \(x_n\to x\). If \(x\notin F\), then \(x\in X\setminus F\). Since the complement is open, there is an \(r>0\) such that \(B_r(x)\subseteq X\setminus F\). Convergence gives an index \(N\) such that \(d(x_n,x)<r\) for all \(n\geq N\). Thus \(x_n\in B_r(x)\subseteq X\setminus F\) for \(n\geq N\), contradicting \(x_n\in F\). Therefore \(x\in F\).

Conversely, suppose every convergent sequence in \(F\) has its limit in \(F\). We prove that \(X\setminus F\) is open. Take any \(x\in X\setminus F\). If no positive-radius ball around \(x\) were contained in \(X\setminus F\), then for every positive integer \(n\) there would be a point \(x_n\in F\cap B_{1/n}(x)\). For each \(n\), this gives $$ d(x_n,x)<\frac{1}{n}. $$ Since \(1/n\to0\), the sequence \((x_n)\) converges to \(x\). By the assumed property, \(x\in F\), contradicting the choice \(x\in X\setminus F\). Hence some ball around \(x\) lies in \(X\setminus F\). This holds for every \(x\) in the complement, so the complement is open and \(F\) is closed. If \(X\setminus F\) is empty, it is open by the definition, and the conclusion holds as well. \(\square\)

The proof of the converse is a useful method: if a point outside a set has no ball avoiding that set, choose points of the set closer and closer to it. This constructs a sequence that converges to the outside point. The sequential characterization makes such an argument precise without requiring any special geometric picture.

Worked Example: A Closed Ball in Any Metric Space

For \(x\in X\) and \(r\geq0\), define the closed ball $$ \overline{B}_r(x)=\{y\in X:d(x,y)\leq r\}. $$ We show that this set is closed. Suppose a sequence \((y_n)\) in \(\overline{B}_r(x)\) converges to \(y\). The reverse triangle inequality for a metric gives $$ |d(x,y_n)-d(x,y)|\leq d(y_n,y). $$ The right-hand side tends to zero, so \(d(x,y_n)\to d(x,y)\). Since each \(d(x,y_n)\leq r\), it follows that \(d(x,y)\leq r\): if \(d(x,y)>r\), convergence would force \(d(x,y_n)>r\) for all sufficiently large \(n\), a contradiction. Thus \(y\in\overline{B}_r(x)\). The sequential characterization proves that \(\overline{B}_r(x)\) is closed.

The distinction between this set and the open ball \(B_r(x)\) is the inequality at the boundary. The closed ball includes points at distance exactly \(r\); the argument shows that limits of points whose distances are at most \(r\) still satisfy that bound.

Worked Example: A Closed Interval by the Sequential Test

Consider \(F=[2,5]\) in \(\mathbb{R}\) with the usual metric. Suppose \(x_n\in[2,5]\) for every \(n\), and \(x_n\to x\). We verify that \(2\leq x\leq5\). If \(x<2\), set \(\varepsilon=(2-x)/2>0\). Convergence would give \(x_n<x+\varepsilon=(x+2)/2<2\) for all sufficiently large \(n\), contradicting \(x_n\geq2\). If \(x>5\), set \(\varepsilon=(x-5)/2>0\). Eventually \(x_n>x-\varepsilon=(x+5)/2>5\), contradicting \(x_n\leq5\). Neither case is possible, so \(x\in[2,5]\). The sequential characterization shows that \([2,5]\) is closed.

This argument also handles the endpoints: a sequence in the interval may converge to \(2\) or \(5\), and both limits remain in the set. Closedness does not mean that every point has a positive-radius ball contained in the set; that is the condition for openness, not closedness.

Unions and Intersections of Closed Sets

The rules for closed sets follow from the corresponding rules for open sets by taking complements. De Morgan’s laws turn intersections into unions of complements and unions into intersections of complements. Consequently, the operation that preserves closedness for an arbitrary collection is intersection, while union is guaranteed to preserve closedness for a finite collection.

Theorem (Unions and Intersections of Closed Sets): In a metric space, the intersection of any collection of closed sets is closed, and the union of finitely many closed sets is closed. In particular, \(\varnothing\) and \(X\) are closed.

Proof. Let \(\{F_i:i\in I\}\) be a collection of closed subsets of \(X\). By De Morgan’s law, $$ X\setminus\bigcap_{i\in I}F_i=\bigcup_{i\in I}(X\setminus F_i). $$ Each complement \(X\setminus F_i\) is open. Arbitrary unions of open sets are open by the theorem on unions and finite intersections of open sets from the previous tutorial. Therefore the complement of \(\bigcap_{i\in I}F_i\) is open, so the intersection is closed. If the collection is empty, its intersection is understood to be \(X\), which is closed.

Now let \(F_1,\ldots,F_n\) be closed sets, where \(n\geq1\). Then $$ X\setminus\bigcup_{j=1}^nF_j=\bigcap_{j=1}^n(X\setminus F_j). $$ Each set on the right is open, and a finite intersection of open sets is open. Thus the complement of the union is open, proving that the finite union is closed. The empty set is closed because its complement \(X\) is open; \(X\) is closed because its complement \(\varnothing\) is open. \(\square\)

The difference between arbitrary intersections and finite unions is important. It is not a claim that every infinite union of closed sets fails to be closed; some are closed. Rather, the general guarantee for unions applies only to finitely many sets. For instance, in \(\mathbb{R}\), every singleton \(\{1/n\}\) is closed, but their union \(\{1/n:n\geq1\}\) is not closed: the sequence \(1/n\) lies in the union and converges to \(0\), which is not in it.

Worked Example: A Relative Closed Set

Let \(A=(0,1)\subseteq\mathbb{R}\), equipped with the restricted metric, and let \(F=(0,1/2]\subseteq A\). The complement of \(F\) within \(A\) is $$ A\setminus F=(1/2,1). $$ This is open in \(A\): it is the intersection \(A\cap(1/2,2)\), where \((1/2,2)\) is open in \(\mathbb{R}\). By the theorem on open sets in a restricted metric, that intersection is open in \(A\). Therefore \(F\) is closed in \(A\).

It is not closed in \(\mathbb{R}\). Indeed, the sequence \(x_n=1/(n+2)\) lies in \(F\), because \(0<1/(n+2)\leq1/3\leq1/2\), and it converges to \(0\notin F\). This illustrates why the space must be specified: a subset can be closed relative to \(A\) without being closed in the larger space.

Worked Example: Closedness in the Discrete Metric

Let \(X\) carry the discrete metric, in which distinct points have distance \(1\). Every subset \(S\subseteq X\) is closed. To see this from the definition, the previous tutorial showed that every subset of a discrete metric space is open. In particular, \(X\setminus S\) is open, so \(S\) is closed.

The sequential test gives the same conclusion. If a sequence in \(S\) converges to \(x\), convergence in the discrete metric implies that the sequence is eventually equal to \(x\). Since its eventual terms belong to \(S\), we have \(x\in S\). Thus every limit of a convergent sequence in \(S\) remains in \(S\). In this metric, every subset is both open and closed.

Closedness in a Restricted Metric

The relative example can be expressed as a general rule. Just as sets open in a subset are intersections with open sets of the larger space, sets closed in a subset are intersections with closed sets of the larger space. This follows by applying the open-set result to the relative complement.

Theorem (Closed Sets in a Restricted Metric): Let \(A\) be a nonempty subset of a metric space \((X,d)\), equipped with the restricted metric. A set \(F\subseteq A\) is closed in \(A\) if and only if there is a closed set \(C\subseteq X\) such that \(F=A\cap C\).

Proof. Suppose first that \(F\) is closed in \(A\). Then \(A\setminus F\) is open in \(A\). By the theorem on open sets in a restricted metric, there is an open set \(U\subseteq X\) such that $$ A\setminus F=A\cap U. $$ Set \(C=X\setminus U\), which is closed in \(X\). Taking complements relative to \(A\) gives $$ F=A\setminus(A\setminus F)=A\setminus(A\cap U)=A\cap(X\setminus U)=A\cap C. $$ Thus \(F\) has the required form.

Conversely, suppose \(F=A\cap C\) for some closed \(C\subseteq X\). Then $$ A\setminus F=A\setminus(A\cap C)=A\cap(X\setminus C). $$ The set \(X\setminus C\) is open in \(X\). By the restricted-metric theorem for open sets, \(A\cap(X\setminus C)\) is open in \(A\). Hence \(A\setminus F\) is open in \(A\), so \(F\) is closed in \(A\). \(\square\)

Why the Sequential Test Matters

The complement definition is concise, but the sequential characterization is often easier to apply. To prove a set closed, one can start with an arbitrary convergent sequence in it and show that its limit remains in the set. This method was used for closed balls and intervals, and it applies even when the space has no coordinates or familiar geometry.

A common pitfall is to confuse closedness with a claim that every point of the set has a ball contained in it. That condition describes openness. A closed set may have boundary points that have no such ball: in \(\mathbb{R}\), every ball around \(2\) contains points outside \([2,5]\), although \([2,5]\) is closed. The sequential condition gives the appropriate alternative: limits of sequences from the set cannot escape it.

Another pitfall is to omit the ambient space. The same subset can be closed in one metric space and not in another, as the relative interval example shows. When using either the complement definition or the sequential test, specify where the complement is taken or where convergence is measured.

Takeaway: A set in a metric space is closed exactly when it contains the limits of all its convergent sequences. Arbitrary intersections and finite unions of closed sets are closed, and closedness may change when the ambient space is restricted.

Check Your Understanding

Use the definitions and results above to answer the following questions.

  1. Why does a convergent sequence in a closed set have to have its limit in that set?
  2. How can failure of the complement to be open be used to construct a sequence in a set converging to a point outside it?
  3. Which arbitrary set operation preserves closedness for any collection, and which is guaranteed only for finite collections?
  4. Why is a closed ball \(\overline{B}_r(x)\) closed in every metric space?
  5. What does it mean for a set to be closed in a subset \(A\), and how can it be represented using a closed set of the larger space?