Real Analysis: Metric Topology

Open and Closed Sets

The interior, boundary, closure, and exterior describe different regions of a metric space $X$ in relation to a subset $S$. We now describe $S$ itself based on these related sets as either open, closed, both, or neither.

Open and Closed Sets

A subset $S$ is open if all of its points are interior points. A subset $S$ is closed if its complement is open. Sets that are both open and closed are called clopen (yes, really).

As we'll prove below, closed sets are also those that include all of their boundary points. Closed sets serve as an important foundation for later subjects in analysis, largely due to this fact, and open sets are of complementary importance for the opposite reason. Clopen sets are just fun to say.

Balls and K-Cells in $\mathbb{R}^n$

An open ball is a subset of $\mathbb{R}^n$ under the Euclidean metric that includes all points less than $r$ from its center at $\textbf{x}$. Formally, a open ball is a set $B_{r}(\textbf{x}) = \{ \textbf{y} : \|\textbf{x} - \textbf{y}\|_2 < r \}$. In order words, a ball is a special case of a neighborhood $N_{r}(\textbf{x})$. A closed ball is the set $\overline{B}_{r}(\textbf{x}) = \{ \textbf{y} : \|\textbf{x} - \textbf{y}\|_2 \leq r \}$. In $\mathbb{R}$, balls are intervals, in $\mathbb{R}^2$ they are disks, and in $\mathbb{R}^3$ they are spheres.

An open k-cell is a subset of $\mathbb{R}^n$ that includes all points $\textbf{x}$ where $|x_i - y_i| < z_i$ for some $\textbf{y}$ and $\textbf{z}$, where all the components of $\textbf{z}$ are positive. Open k-cells are intervals in $\mathbb{R}$, rectangles in $\mathbb{R}^2$, and rectangular prisms in $\mathbb{R}^3$. The point $\textbf{y}$ is the center of the k-cell, and the components of $\textbf{z}$ are half the length of each side. A closed k-cell is identical to an open k-cell except that $|x_i - y_i| \leq z_i$.

Relatively Open and Relatively Closed Sets

Let $Y$ be a subset of $X$. A subset $A \subseteq Y$ is said to be relatively open in $Y$ if for each point $x \in A$, there is a distance $r > 0$ such that for every $b \in Y$ where $d(a,b) < r$, $b \in Y$. This definition is identical to the normal definition of open, except the superset in which we consider other points for the neighborhoods of $x$ is $Y$ instead of $X$. Likewise, $A$ is relatively closed in $Y$ if its complement in $Y$ is relatively open in $Y$. Again, this definition is identical to the normal definition of closed, except that we consider $A$ as a subset of $Y$ and ignore everything else in $X$.


  1. Show that for any metric space $(X, d)$, the sets $X$ and $\varnothing$ are both clopen.

    For any $x \in X$ and any $r > 0$, $N_{r}(x) \subseteq X$, so $X$ is open. Therefore $X^c = \varnothing$ is closed. Likewise, because $\varnothing$ has no points, it is vacuously true that it contains all of its interior points, such $\varnothing$ is open and therefore $\varnothing^c = X$ is closed.

    Show Answer
  2. Show that every neighborhood is an open set.

    Let $N_{r}(x)$ be a neighborhood of some point $x \in X$. Consider some point $y \in N_{r}(x)$, and consider $p = \dfrac{r - d(x, y)}{2}$. Then for any $z \in N_{p}(y)$, it follows that

    $ d(x, z) \leq d(x, y) + d(y, z) \\ d(x, z) \leq d(x, y) + p \\ d(x, z) \leq d(x,y) + \dfrac{r -d(x,y)}{2} \\ d(x, z) \leq \dfrac{d(x,y) + r}{2} \\ d(x, z) \leq \dfrac{r + r}{2} \\ d(x, z) \leq r$

    Therefore $N_{p}(y) \subseteq N_{r}(x)$, so $y$ is an interior point of $N_{r}(x)$. Therefore $N_{r}(x)$ is open.

    Show Answer
  3. Let $(X, d)$ be a metric space where $d$ is the discrete metric. Show that every subset of $X$ is both open and closed.

    Let $A \subseteq X,$ and let $x \in A.$ Take $r = \frac{1}{2}.$ It follows that $N_{r}(x) = \{x\} \subseteq A.$ Therefore $A$ is open. The same logic shows that $A^c$ is open: Given $y \in A^c,$ it follows that $N_{r}(y) = \{y\} \subseteq A^c,$ and so $A^c$ is also open, and therefore $A$ is also closed.

    Show Answer
  4. Show that the closure of a set is closed.

    Let $S$ be a subset of some metric space $(X, d)$. Since $\text{Ext}(S) = \left(S^c\right)^{\circ}$, and the interior of a set is open by definition, it follows that complement of the exterior $\overline{S}$ is closed.

    Show Answer
  5. Equivalent definition of open: Show that a subset $S$ is open if and only if $S \cap \partial S = \varnothing$.

    Assume $S$ is open. Then $S \cap \partial S = S^{\circ} \cap \partial S = \varnothing$. Conversely, assume $S \cap \partial S = \varnothing$. Then $S^{\circ} = S - \partial S = S$.

    Show Answer
  6. Equivalent definition of closed: Show that a subset $S$ is closed if and only if it $\partial S \subseteq S$.

    Assume $S$ is closed. Then $S^c$ is open and $(S^c)^{\circ} = S^c$. Then $\partial (S^c) \cap S^c = \varnothing$. Therefore $\partial S = \partial (S^c) \subseteq (S^c)^c = S$.

    Conversely, assume $\partial S \subseteq S$. Then $\partial S = \partial (S^c) \not\subseteq S^c$, and so $(S^c)^{\circ} = S^c - \partial (S^c) = S^c$. Therefore $S^c$ is open, so $S$ is closed.

    Show Answer
  7. Show that every finite subset of $\mathbb{R}$ is closed.

    Let $A = \{a_1, \ldots, a_n\}$ be a subset of $\mathbb{R}$. For each $a_i \in A$, consider $r = \dfrac{1}{2} \min\limits_{j \neq i}(d(a_i, a_j))$, or half the distance to the other nearest point in $A$. Then $N_{r}(a_i)$ contains $a_i$ and infinitely many other points of $\mathbb{R}$ that are not in $A$, and so $a_i$ is a boundary point. Therefore $\partial A = A$, so $\partial A \subseteq A$, so $A$ is closed.

    Show Answer
  8. Is $\mathbb{Q}$ open, closed, both, or neither in $\mathbb{R}$?

    Recall that $\partial \, \mathbb{Q} = \mathbb{R}$ and $\mathbb{Q}^{\circ} = \varnothing$, so $\mathbb{Q}$ is neither open nor closed.

    Show Answer
  9. Show that for any collection of open sets $\{B_{\alpha}\}$, their union $\bigcup B_{\alpha}$ is open.

    Let $x \in \bigcup B_{\alpha}$. Then $x \in B_{\alpha}$ for some $\alpha$. Since $B_{\alpha}$ is open, there is a neighborhood $N_{r}(x) \subseteq B_{\alpha}$. By transitivity of subsets, $N_{r}(x) \subseteq \bigcup B_{\alpha}$. Therefore $\bigcup B_{\alpha}$ is open.

    Show Answer
  10. Show that for any collection of closed sets $\{C_{\alpha}\}$, their intersection $\bigcap C_{\alpha}$ is closed.

    Since each $C_{\alpha}$ is closed, it follows that each $C_{\alpha}^c$ is open. By De Morgan's Law, $\left(\bigcap\limits_{\alpha} C_{\alpha}\right)^c = \bigcup\limits_{\alpha} C_{\alpha}^c$. The righthand side is a union of open sets, so by the preceding proof is open. It follows that its complement, $\bigcap\limits_{\alpha} C_{\alpha}$, is closed.

    Show Answer
  11. Counterexample: Show that the intersection of an arbitrary collection of open sets is not necessarily open.

    Consider the infinite collection of intervals $C = \left\{\left(-\frac{1}{n}, \frac{1}{n}\right) : n \in \mathbb{N} \right\}$. Then $\bigcap C = \{0\}$, which is finite and therefore closed.

    To prove that $C = \{0\}$, consider the counterfactual where there is some nonzero $c \in C$. Then between $0$ and $c$ there is some rational number $\frac{a}{b}$, which we can assume is in simplest terms. Because $\left|\frac{1}{2b}\right| \leq \left|\frac{a}{2b}\right| \leq \left|\frac{a}{b}\right|$, it follows that $c \notin \left(-\left|\frac{1}{2b}\right|, \left|\frac{1}{2b}\right|\right)$. Therefore $c \notin \bigcap C$. But $0$ is in every interval in $C$. Thus $C = \{0\}$.

    Show Answer
  12. Counterexample: Show that the union of an arbitrary collection of closed sets is not necessarily closed.

    Consider the set of closed intervals $C = \{ [-1 + \frac{1}{n}, 1 - \frac{1}{n}] \subset \mathbb{R} : n \in \mathbb{N} \}$. Each element of $C$ is closed, but we can show that $\bigcup C = (-1,1)$ and is therefore open.

    Consider $x \in \bigcup C$. Then there is some $n \in \mathbb{N}$ such that $x \in \left[-1 + \frac{1}{n}, 1 - \frac{1}{n} \right]$. But $\left[-1 + \frac{1}{n}, 1 - \frac{1}{n} \right] \subset (-1,1)$. Therefore $x \in (-1,1)$.

    Conversely, consider $x \in (-1,1)$, and assume that $0 < x < 1$. Let $r = \frac{1 - x}{2}$. Then $x < 1 - r < 1$. By the Archimedean property, there is some $n$ such that $rn > 1$, and thus $\frac{1}{n} < r$. Therefore $1 - r < 1 - \frac{1}{n} < 1$, so $x \in \left[-1 + \frac{1}{n}, 1 - \frac{1}{n}\right]$, and so $x \in C$. An identical argument holds when $-1< x < 0$, and when $x = 0$ it is in every set in $C$. Therefore $(-1, 1) \subseteq C$.

    Thus $\bigcup C = (-1, 1)$ and is open. This is the desired counterexample.

    Show Answer
  13. Show that for any finite collection of subsets $\{S_n\}$, their intersection $\bigcap\limits_{i=1}^n S_i$ is open.

    Let $x \in \bigcap\limits_{i=1}^n S_{i}$. Then consider the collection of neighborhoods $N_{r_1}(x), \ldots, N_{r_n}(x)$ where $N_{r_i}(x) \subseteq S_{i}$. Select $i$ such that $r_i = \text{min}(r_1, \ldots, r_n)$. Then $N_{r_i}(x) \subseteq N_{r_j}$ for all $j \in (1, \ldots, n)$, and so by transitivity $N_{r_i} \subseteq S_j$ as well. Therefore $N_{r_i} \subseteq \bigcap\limits_{i=1}^n S_{i}$, so $\bigcap\limits_{i=1}^n S_{i}$ is open.

    Show Answer
  14. Show that for any finite collection of closed sets $\{C_n\}$, their union $\bigcup\limits_{i=1}^n C_i$ is closed.

    Since each $C_i$ is closed, its complement $C_i^c$ is open. Therefore by the preceding theorem, $\bigcap\limits_{i=1}^n C_i^c$ is open. By De Morgan's Law, $\bigcap\limits_{i=1}^n C_i^c = \left(\bigcup\limits_{i=1}^n C_i\right)^c$. Since the righthand side of the equation is open, its complement, $\bigcup\limits_{i=1}^n C_i$, is closed.

    Show Answer
  15. Consider the open ball $B_{1}(\textbf{0})$ and the closed ball $\overline{B}_{2}(\textbf{0})$ in $\mathbb{R}^2$.

    1. Is $B_1$ open relative to $\overline{B}_2$?

    2. Is $\overline{B}_2$ open relative to $\overline{B}_2$?

    3. Is $B_1$ closed relative to $\overline{B}_2$?

    4. Is $\overline{B}_2$ closed relative to $\overline{B}_2$?

    5. Is $\overline{B}_2$ open relative to $\mathbb{R}^2$?

    6. Is $\overline{B}_2$ closed relative to $\mathbb{R}^2$?

    1. Yes. $B_1 = B_1^{\circ}$, so $B_1$ is open relative to $\overline{B}_2$.

    2. Yes. Since every set is open relative to itself, as every point is an interior point, so $\overline{B}_2$ is open relative to $\overline{B}_2$.

    3. No. $\partial B_1 = C_1$, the unit circle, and $C_1 \subset \overline{B}_2$. $B_1 \cap C_1 = \varnothing$, so $\partial C_1 \not\subseteq B_1$,

    4. Yes. Every set is closed relative to itself, as its boundary is the empty set, so $\overline{B}_2$ is closed relative to $\overline{B}_2$. 

    5. No. $\partial \overline{B}_2$ is the circle of radius 2, and for each point $x \in \partial \overline{B}_2$ there is a neighborhood containing a point outside of $\overline{B}_2$, so $x \notin \overline{B}_2^{\circ}$, thus $B \neq B^{\circ}$.

    6. Yes. For the same reason above, $\partial \overline{B}_2 \subseteq \overline{B}_2$, thus $\overline{B}_2$ is closed.

    Show Answer
  16. Counterexample: Show that the closure of an open ball is not always the closed ball of the same radius.

    Let $(X, d)$ be a metric space with at least two elements under the discrete metric. Then $B_1(x) = \{x\}$ for all $x \in X$. From this same fact it follows that $\partial B_1(x) = \varnothing$, so $\overline{B_1(x)} = \{x\}$. However, $\overline{B}_1(x) = X$.

    Show Answer
  17. Let $Z \subseteq Y \subseteq X$. Show that $Z$ is open relative to $Y$ if and only if $Z = Y \cap G$ for some open subset $G$ of $X$.

    Assume $Z$ is open relative to $Y$. Then for $x \in Z$ there is some $r_x > 0$ such that $d(x, y) < r_x$ for all $y \in Y$ implies that $y \in Z$. Consider $C = \bigcup\limits_{x \in Z} N_{r_x}(x)$. Then $C$ is a union of open sets and is therefore open. Since $p \in N_{r_x}(x)$ for all $p \in Z$, it follows that $Z \subseteq C \cap Y$. Likewise, by our construction of $N_{r_x}(x)$, it follows that $N_{r_x}(x) \cap Y \subseteq C$, and therefore that $C \cap Y \subseteq Z$. Therefore $Z = C \cap Y$.

    Conversely, assume $Z = Y \cap G$ for some open subset $G$ of $X$. Since $G$ is open, for each point $x \in G$ there is a neighborhood $N_{r}(x)$ such that $N_{r}(x) \subseteq G$. Therefore $N_{r}(x) \cap Y \subseteq Z$. Therefore $Z$ is open relative to $Y$.

    Show Answer