# Show that if a subset $E$ of a compact metric space $X$ is compact in $X$, then it is closed in $X$.

I am self-studying Royden's Real Analysis; Exercise 58 of Section 9.5, "Compact Metric Spaces", asks:

Let $E$ be a subset of the compact metric space $X$. Show that the subspace $E$ is compact if and only if $E$ is a closed subset of $X$.

The reverse implication is easy: if $E$ is closed, given an open cover $\mathcal{O}$ of $E$, $\mathcal{O} \cup \{X \setminus E\}$ is an open cover of $X$, which, by compactness of $X$, contains a finite subcover $\mathcal{O}'$ of $X$; removing $X \setminus E$ from $\mathcal{O}'$ if necessary, we arrive at a finite subcover of $\mathcal{O}$ of $E$, so $E$ is compact. (In fact, the same argument holds in general for any topological space, not just metric spaces.)

However, I am stumped in trying to prove the forward implication, namely that $E$ being compact in the compact metric space $X$ implies that $E$ is closed in $X$.

This section of the text does contain what it calls the Characterization of Compactness for Metric Spaces, which states:

For a metric space $X$, the following three assertions are equivalent:

(i) $X$ is complete and totally bounded;

(ii) $X$ is compact;

(iii) $X$ is sequentially compact.

I had the thought of using this to say that if $E$ is compact in $X$, then it is complete and totally bounded in $X$, and to show that $E$ being complete implies that $E$ is closed in $X$. However, using the definition of "complete", all we can say is that every Cauchy sequence in $E$ converges in $E$. In contrast to the case of $\mathbb{R}^n$, (according to my understanding) in a general metric space not every convergent sequence is Cauchy, so we cannot use completeness of $E$ to say that $E$ contains all of it limit points in order to prove it to be closed.

I feel as though I am missing something obvious here. Direction would be appreciated.

• A set is closed in a metric space if for any sequence $x_n \in E$ and $x_n \to x$, we have $x\in E$. Now $\{ x_n\}$ is a Cauchy sequence in $E$ .... – user99914 Feb 11 '15 at 5:08
• My mistake was in getting confused as to the relation between convergent and Cauchy sequences in a general metric space as compared to in $\mathbb{R}^n$. As per your comment, once one notes that in a general metric space a convergent sequence is Cauchy, the proof is obvious. Thank you for your comment; +1. – user169845 Feb 11 '15 at 5:34
• You are wellcome! – user99914 Feb 11 '15 at 5:35

Assume that $E$ is a compact set. Assume that $(x_n)$ be a sequence in $E$ such that $x_n\to x\in X$. In order to prove that $E$ is closed set, we need to prove $x\in E$. In fact, since $(x_n)\subset E\subset X$, there is a sub-sequence $(x_{n_{k}})$ such that $x_{n_k}\to y\in X$ as $k\to\infty$. On the other hand, we also have $x_{n_k}\to x$ as $k\to\infty$. So $x=y$ from the uniquely of the limitations. Since $y\in E$, we deduce $x\in E$.

Let $E$ be a compact subset of a compact metric space $X$. Then, to prove that $E$ is closed we will prove that $E^C$ is open. So, let $p\in E^C$. We need to show that $p$ has a neighborhood completely contained in $E^C$. We construct that neighborhood as below.

Let $q\in E$, and take $r_q<1/2 d(q,p)$. Let $V_q$ denotes the open ball around $q$ with radius $r_q$ and $W_q$ denotes the open ball around $p$ with radius $r_p$. Clearly $V_q\cap W_q=\phi$. Then it is clear that $$\bigcup_{q\in E}V_q$$ is an open cover of $E$. Since $E$ is compact, there exists a finite subcover $V_{q_1},\cdots,\ V_{q_n}$. Consider the corresponding sets $W_{q_1,\ \cdots,\ W_{q_n}}$. Then, $p$ has this neighborhood $W$ of radius $\max_{1\le i\le n}r_{q_i}$ which is disjoint with $V_{q_1},\cdots,\ V_{q_n}$ and hence is contained completely in $E^C$. Thus, $E^C$ is open.

As I suspected, it was obvious (actually, even worse than that, since I had already proven the necessary lemma for an exercise in the preceding section of the text).

As asked to prove in Exercise 37 of Section 9.4 of the same text, in a metric space, every convergent sequence is Cauchy. Using this, any sequence $\{x_n\}$ in $E$ that converges to some $x$ in $X$ is also Cauchy; since $E$ is compact, it is, by the theorem cited in the original question, complete, and a set is complete if it contains the limits of its Cauchy sequences, so $x \in E$. Therefore, $E$ contains its limit points and is thus closed.

For thoroughness, a proof that every convergent sequence is Cauchy:

Given a sequence $\{x_n\}$ in a metric space $(X,d)$ that converges to $x \in X$, pick $\varepsilon > 0$; by convergence of $\{x_n\}$, $\exists N > 0$ such that $\forall n \geq N$, $d(x_n,x) < \varepsilon/2$. Now, for $n,m \geq N$, the triangle inequality for a metric gives that $d(a_n,a_m)\leq d(a_n, a) + d(a, a_m) < \varepsilon/2 + \varepsilon/2 = \varepsilon$, so $\{x_n\}$ is Cauchy.