Skip to main content

Section 1.2 Open and Closed Sets

Balls in Euclidean spaces are defined in terms of distances. This means that they have a natural generalisation to metric spaces. The concepts of open and closed sets are are closely related to this.

Definition 1.17.

Let \((X,d)\) be a metric space. Let \(x_0 \in X\) and \(r \gt 0\text{.}\) Then
\begin{equation*} B_r(x_0) = \set{x \in X}{d(x_0,x) \lt r} \end{equation*}
is called the open ball in \(X\) of radius \(r\) and centre \(x_0\text{.}\)

Definition 1.18.

Let \((X,d)\) be a metric space.
  1. A set \(U \subseteq X\) is called open if for every \(x \in U\) there exists \(r \gt 0\) such that \(B_r(x) \subseteq U\text{.}\)
  2. A set \(F \subseteq X\) is called closed if the complement \(X \setminus F\) is open.
Figure 1.4. The inclusions \(B_r(x) \subseteq U \subseteq X\) in Part i of Definition 1.18.
Figure 1.5. The inclusions \(B_r(x) \subseteq (X \setminus F) \subseteq X\) in Part ii of Definition 1.18.
This does not mean that ‘closed’ is the opposite of ‘open’. A set in a metric space can be neither open nor closed and some sets are open and closed at the same time.

Example 1.19.

Let \(a \lt b\text{.}\) The interval \((a,b)\) is open in \(\R\) and \([a,b]\) is closed (because \((-\infty,a) \cup (b,\infty)\) is open), but \((a,b]\) and \([a,b)\) are neither open nor closed.

Definition 1.20.

Let \((X,d)\) be a metric space and \(S \subseteq X\text{.}\)
  1. The interior \(S^\circ\) of \(S\) is the set of all \(s \in S\) with the property that there exists \(r \gt 0\) such that \(B_r(s) \subseteq S\text{.}\)
  2. The closure \(\overline S\) of \(S\) is the set of all \(x \in X\) such that \(B_r(x) \cap S \ne \varnothing\) for any \(r \gt 0\text{.}\)
  3. The boundary \(\partial S\) of \(S\) is the set of all \(x \in X\) such that \(B_r(x) \cap S \ne \varnothing\) and \(B_r(x) \setminus S \ne\varnothing\) for any \(r \gt 0\text{.}\)
Figure 1.6. The point \(x_1\) lies in the interior \(S^\circ\) because \(B_{r_1}(x_1) \subseteq S\) for some \(r_1 \gt 0\text{.}\) The point \(x_2\text{,}\) on the other hand, lies in \(\partial S\) because \(B_{r_2}(x_2)\) has nonempty intersections with both \(S\) and \(X \setminus S\) no matter how small the radius \(r_2 \gt 0\) is. Finally, there exists \(r_3 \gt 0\) such that \(B_{r_3}(x_3)\) does not intersect \(S\) at all, and so \(x_3 \in X \setminus \overline S\text{.}\)
It is clear that \(U \subseteq X\) is open if and only if it satisfies \(U = U^\circ\text{.}\) Not quite as obvious, but still true, is the corresponding statement for closed sets: a set \(F \subseteq X\) is closed if and only if it satisfies \(F = \overline{F}\text{.}\) This is proved in Exercise 1.2.3.

Proof.

Let \(x \in B_r(x_0)\text{.}\) Set \(s = r - d(x,x_0)\text{.}\) Then \(s \gt 0\text{.}\) Moreover, \(B_s(x) \subseteq B_r(x_0)\) (see Exercise 1.2.1). It follows that \(B_r(x_0)\) is open.
We can summarise this theorem as follows: the interior of \(S\) is the largest open set contained in \(S\text{.}\)

Proof.

Part ii.

Let \(U \subseteq S\) be open. If \(x \in U\) is an arbitrary point, then there exists \(r \gt 0\) such that \(B_r(x) \subseteq U \subseteq S\text{.}\) So \(x \in S^\circ\text{.}\)

Part i.

Let \(x \in S^\circ\text{.}\) Then there exists \(r \gt 0\) such that \(B_r(x) \subseteq S\text{.}\) By Lemma 1.21, we know that \(B_r(x)\) is open. Using (ii), we infer that \(B_r(x) \subseteq S^\circ\text{.}\) Hence \(S^\circ\) is open.
In other words, the closure \(\overline S\) is the smallest closed set containing \(S\text{.}\)

Proof.

Part ii.

Suppose that \(F \supseteq S\) is closed. Then \(X \setminus F\) is open. Thus any point \(x \in X \setminus F\) has some \(r \gt 0\) with \(B_r(x) \subseteq X \setminus F\) and hence \(B_r(x) \cap S = \varnothing\text{.}\) We conclude that \(x \not\in \overline S\text{.}\) Hence \(X \setminus F \subseteq X \setminus \overline S\text{,}\) which means that \(F \supseteq \overline S\text{.}\)

Part i.

Consider a point \(x \in X \setminus \overline S\text{.}\) Then by the definition of \(\overline S\text{,}\) there exists \(r \gt 0\) such that \(B_r(x) \cap S = \varnothing\text{.}\) By Lemma 1.21, the set \(B_r(x)\) is open; so \(X \setminus B_r(x)\) is closed. Since \(S \subseteq X \setminus B_r(x)\text{,}\) (ii) implies that \(\overline S \subseteq X \setminus B_r(x)\text{.}\)
That is, we have shown that \(B_r(x) \subseteq X \setminus \overline S\text{,}\) and it follows that \(X \setminus \overline S\) is open and \(\overline S\) is closed.

Proof.

Suppose that \(x \in X\text{.}\) We know that \(x \in \overline S\) if and only if \(B_r(x) \cap S \ne \varnothing\) for any \(r \gt 0\text{.}\) Furthermore, \(x \not\in S^\circ\) if and only if \(B_r(x) \not\subseteq S\) for any \(r \gt 0\text{,}\) which in turn means that \(B_r(x) \setminus S \ne \varnothing\) for any \(r \gt 0\text{.}\) Combining these two facts, we obtain the desired statement.

Proof.

Part i.

The condition for openness is trivial for the empty set. Moreover, for every \(x \in X\text{,}\) it is clear that \(B_1(x) \subseteq X\text{,}\) so \(X\) is open.

Part ii.

Let \(x \in \bigcup_{\lambda \in \Lambda} U_\lambda\text{.}\) Then there exists \(\lambda \in \Lambda\) such that \(x \in U_\lambda\text{.}\) As \(U_\lambda\) is open, there exists \(r \gt 0\) such that \(B_r(x) \subseteq U_\lambda\text{,}\) and then \(B_r(x) \subseteq\bigcup_{\lambda \in \Lambda} U_\lambda\text{.}\)

Part iii.

Let \(x \in \bigcap_{n=1}^N U_n\text{.}\) Since every \(U_n\) is open, there exist \(r_1,\dotsc,r_N \gt 0\) with \(B_{r_n}(x) \subseteq U_n\) for \(n=1, \dotsc, N\text{.}\) Define \(r = \min\{r_1,\dotsc,r_N\}\text{.}\) Then
\begin{equation*} B_r(x) \subseteq B_{r_n}(x) \subseteq U_n, \quad n=1,\dotsc,N\text{,} \end{equation*}
and hence \(B_r(x) \subseteq \bigcap_{n=1}^N U_n\text{.}\)

Proof.

This follows immediately from Theorem 1.25, as
\begin{equation*} X \setminus \bigg(\bigcap_{\lambda \in \Lambda} F_\lambda\bigg) = \bigcup_{\lambda \in \Lambda} (X \setminus F_\lambda) \quad \text{and} \quad X \setminus \bigg(\bigcup_{n=1}^N F_n\bigg) = \bigcap_{n=1}^N (X \setminus F_n)\text{.} \end{equation*}

Proof.

Any union of balls is automatically open by Theorem 1.25, so we only prove the other direction. Let \(U\) be an open set in a metric space \((X,d)\text{.}\) Then for any \(x \in U\) we can find \(r_x \gt 0\) such that \(B_{r_x}(x) \subseteq U\text{.}\) Thus the union \(\bigcup_{x \in U} B_{r_x}(x) \subseteq U\text{.}\) The reverse inclusion is clear, and so we conclude that \(\bigcup_{x \in U} B_{r_x}(x) = U\text{.}\)
The following lemma can be extremely useful when working in metric subspaces.
Figure 1.7. The intersection \(B_r'(y) = B_r(y) \cap Y\) appearing in the first part of Lemma 1.28.
Figure 1.8. The intersection \(V = U \cap Y\) appearing in the second part of Lemma 1.28.

Exercises Exercises

1. (PS3) Inclusions of balls.

Let \((X,d)\) be a metric space and let \(x_0, y_0 \in X\) and \(r, s \gt 0\text{.}\)
(a)
Show that \(B_s(y_0) \subseteq B_r(x_0)\) if \(s + d(x_0, y_0) \le r\text{.}\)
Solution.
If \(s + d(x_0, y_0) \le r\text{,}\) then for any \(y \in B_s(y_0)\text{,}\) the triangle inequality implies that
\begin{equation*} d(y, x_0) \le d(y, y_0) + d(y_0, x_0) \lt s + d(y_0, x_0) \le r\text{.} \end{equation*}
Hence \(y \in B_r(x_0)\text{.}\)
Comment.
Don’t forget that in Definition 1.17 the open ball \(B_r(x_0)\) is the set of points \(x \in X\) satisfying the strict inequality \(d(x,x_0) \lt r\text{.}\) A few students argued as if, either some of the time or all of the time, this was instead the non-strict inequality \(d(x,x_0) \le r\text{.}\) Please be careful about this seemingly-minor difference. While in this problem it turns out not to be a huge deal, in other problems it will be the entire point. Best to get in the habit of being careful.
(b)
Show that the converse is not true in general. That is, give an example of a metric space \((X,d)\) where there exist \(x_0, y_0 \in X\) and \(r, s \gt 0\) with \(B_s(y_0) \subseteq B_r(x_0)\) but \(s+ d(x_0, y_0) \gt r\text{.}\)
Hint.
To simply things, search for a counterexample with \(x_0=y_0\text{.}\)
Solution.
This is true, e.g., for \(X = \{0\}\text{.}\) If \(x_0 = y_0 = 0\) and \(r, s \gt 0\text{,}\) then \(B_r(x_0) = B_s(y_0) = X\) regardless of the values of \(r\) and \(s\text{.}\)
A slightly less extreme example is to take a bounded metric space, \(x_0=y_0\text{,}\) and \(s \gt r\) both larger than the diameter of \(X\text{.}\) This works for any non-empty discrete metric space, and also, e.g., for \(X=(0,2)\text{,}\) \(x_0=y_0=1\text{,}\) \(s=4\) and \(r=3\text{.}\)

2. (PS3) Open sets in metric subspaces.

(a)
Prove the first part of Lemma 1.28.
Hint.
Write down a detailed definition of the balls \(B_r(y)\) and \(B_r'(y)\text{.}\)
Solution.
Let \(y \in Y\) and \(r \gt 0\text{.}\) Using the definitions of open balls and the fact that \((Y,d')\) is a metric subspace, we have
\begin{align*} B_r'(y) \amp = \{ z \in Y : d'(z,y) \lt r \}\\ \amp = \{ z \in Y : d(z,y) \lt r \}\\ \amp = \{ z \in X : d(z,y) \lt r \} \cap Y\\ \amp = B_r(y) \cap Y\text{.} \end{align*}
(b)
Prove the second part of Lemma 1.28.
Hint 1.
Being open in \((X,d)\) or \((Y,d')\) is defined in terms of the balls \(B_r(y)\) and \(B_r'(y)\) from Part a, and so Part a is very useful.
Hint 2.
The reverse implication is not so bad once you unpack the definitions, but the forward direction requires some more thought. Given an open subset \(V\) of \((Y,d')\) you need to ‘cook up’ and appropriate open subset \(U\) of \((X,d)\text{.}\) Here you can look at the proof of Corollary 1.27 for some inspiration.
Solution.
Suppose that \(U\) is an open subset of \((X,d)\text{,}\) let \(V = U \cap Y\text{,}\) and fix \(y \in V\text{.}\) To show that \(V\) is open in \((Y,d')\text{,}\) we need to find \(r \gt 0\) such that the open ball \(B_r'(y) \subseteq V\text{.}\) Since \(U\) is open in \((X,d)\text{,}\) we can pick \(r \gt 0\) such that \(B_r(y) \subseteq U\text{.}\) Then by Part a, we have
\begin{gather*} B_r'(y) = B_r(y) \cap Y \subseteq U \cap Y = V \end{gather*}
as desired.
Conversely, suppose that \(V\) is an open subset of \((Y,d')\text{.}\) Then, as in Corollary 1.27, for every \(y \in V\) we can find \(r_y \gt 0\) such that \(B'_{r_y}(y) \subseteq V\text{,}\) and hence by Part a that
\begin{align*} V \amp = \bigcup_{y \in V} B'_{r_y}(y)\\ \amp = \bigcup_{y \in V} \Big( B_{r_y}(y) \cap Y \Big)\\ \amp = \Big(\bigcup_{y \in V} B_{r_y}(y)\Big) \cap Y\\ \amp = U \cap Y \end{align*}
where \(U = \bigcup_{v \in V} B_{r_y}(y)\) is open in \((X,d)\) as it is a union of open balls (in \((X,d)\)).
Comment 1.
Since this exercise involves two different metric spaces \((X,d)\) and \((Y,d')\text{,}\) we need to be clear which space we have in mind when we use metric space terminology like ‘open’. In particular, while in one implication we assume that \(U\) is an open subset of \((X,d)\text{,}\) and \(Y\) is always an open subset of \((Y,d')\text{,}\) this in no way allows us to use Theorem 1.25 (which applies to multiple open sets in the same metric space) to conclude that the intersection is open in \((X,d)\text{.}\)
Comment 2.
Suppose that \(V\) is open in \((Y,d')\text{.}\) Then for all \(y \in V\) there exists an \(r \gt 0\) such that \(B_r'(y) \subseteq V\text{.}\) So far so good. But if we go from this to writing something like
\begin{equation*} V = \bigcup_{y \in V} B_r'(y), \end{equation*}
then we’re being a bit sloppy in a way which could easily cause problems later on. This is because, in the above formula, it sure looks like \(r\) is some constant real number which isn’t going to change as we change \(y \in V\) to get all of the sets that we need to make up this union. This is why the official solutions are careful to introduce the symbol \(r_y\text{,}\) making the dependence of this radius on the centre of the ball clear. Alternatively, we could have introduced a symbol for the entire ball.
Comment 3.
That the word ‘union’ is not synonymous with ‘finite union’. In particular, Corollary 1.27 says ‘union of balls’ it means a set of the form
\begin{equation*} \bigcup_{\lambda \in \Lambda} B_\lambda, \end{equation*}
where each \(B_\lambda\) is a ball and \(\Lambda\) is some index set which could be uncountably infinite. For instance, in \(\R^2\) we could be talking about a union like
\begin{equation*} \bigcup_{x_1 \in \R} B_1((x_1,0)). \end{equation*}
In this problem the cardinality of the set \(\Lambda\) didn’t have much of an impact on the argument we wanted to run, but in other cases it cause things to be drastically different.
(c)
Consider the interval \(X=(0,3]\) as a metric subspace of \(\R\) (Convention 1.16). Show that, in this metric space, \((2,3]\) is open while \((0,1]\) is closed. (Notice that this differs from what we would get with \(X=\R\text{!}\))
Hint.
While it is not so hard to argue directly, using Lemma 1.28 is much faster.
Solution.
Since \(X\) is a metric subspace of \(\R\) with the Euclidean metric, we can use Lemma 1.28. The set \((2,3]\) is open since we can write it as \((2,3] = X \cap (2,4)\) where \((2,4)\) is an open subset of \(\R\text{.}\) Similarly the complement in \(X\) of \((0,1]\) is \(X \without (0,1] = (1,3]\text{,}\) which we can write as \(X \cap (1,4)\) where \((1,4)\) is an open subset of \(\R\text{.}\)
Comment 1.
Some students write this metric subspace as the pair \(\big((0,3],\abs\blank\big)\text{.}\) Technically this doesn’t quite work, because \(\abs\blank\) is a norm on the vector space \(\R\text{,}\) but neither a norm nor a metric on \((0,3]\text{.}\) What I assume these students meant is that they are equipping \((0,3]\) with the restriction of the metric on \(\R\) induced by the norm \(\abs\blank\text{.}\) When possible I avoid using the notation in lectures, but it okay for you to use it on problem sheets an exams, provided it does not confuse you!
Comment 2.
Note that \((0,3] \without (0,1] = (1,3]\text{,}\) not \((2,3]\) as many students claimed.
Comment 3.
Note that being able to write \((2,3]\) as \(S \cap X\) where \(S \subset \R\) is not open proves nothing. For instance here we have \((2,3] = (2,5] \cap X\) where \((2,5] \subset \R\) is not open, but nevertheless \((2,3] \subset X\) is open.

3. Closed vs. closure.

Suppose that \((X,d)\) is a metric space. Let \(S \subseteq X\) be a subset. Show that \(S\) is closed if and only if it satisfies \(\overline S = S\text{.}\)

4. Interior, closure, and set operations.

Consider a metric space \((X,d)\) and two subsets \(S, T \subseteq X\text{.}\) Prove the following statements.
(a)
If \(S \subseteq T\text{,}\) then \(S^\circ \subseteq T^\circ\) and \(\overline S \subseteq \overline T\text{.}\)
(b)
\((S \cap T)^\circ = S^\circ \cap T^\circ\) and \(\overline{S \cap T} \subseteq \overline S \cap \overline T\text{.}\)
(c)
\((S \cup T)^\circ \supseteq S^\circ \cup T^\circ\) and \(\overline{S \cup T} = \overline S \cup \overline T\text{.}\)

5. Open and closed sets in \(C^0([a,b])\).

Let \(a,b \in \R\) with \(a \lt b\text{,}\) and consider the normed space \(\big(C^0([a,b]),\n\blank_{\sup}\big)\) from Example 1.13 and the two subsets
\begin{align*} U \amp= \{ f \in C^0([a,b]) : f(t) \gt 0 \, \forall t \in [a,b] \},\\ F \amp= \{ f \in C^0([a,b]) : f(a) = 0 \}\text{.} \end{align*}
(a)
Show that for all \(f \in U\text{,}\) \(\inf_{t \in [a,b]} f(t) \gt 0\text{,}\) and use this to prove that \(U\) is open.
(b)
Show that \(F\) is closed.