In a Metric Space, Compact Implies Closed and Bounded
Theorem
A compact subset $K$ of a metric space $(X, d)$ is bounded and a closed set.
Description
The converse does not generally hold. In Euclidean spaces, the converse holds.
Proof
Boundedness1
By contradiction, assume that $K$ is not bounded. Since being compact in a metric space is equivalent to being sequentially compact, $K$ is sequentially compact.
A metric space $X$ being sequentially compact means that for every sequence $\left\{ x_{n} \right\}$ in $X$, there exists a convergent subsequence $\left\{ x_{n_{k}} \right\}$ that converges to a point in $X$.
Since $K$ is unbounded, there exists an unbounded sequence $\left\{ y_{n} \in M \right\}$ satisfying $d(y_{n}, b) \gt n$ for a fixed $b \in X$. As $K$ is sequentially compact, this sequence has a converging subsequence, which also must be unbounded due to the property $\left\{ y_{n} \right\}$. However, in a metric space, a converging sequence is bounded, which leads to a contradiction. Thus, the assumption is wrong, and $K$ is bounded.
Closedness2
Let $K$ be a compact subset of the metric space $X$. To show that $K^{c}$ is open, it suffices to prove that every point in $K^{c}$ is an interior point. Let us now consider $p \in K^{c}$. And let $V_{q}$ and $W_{q}$ respectively be neighborhoods of radius smaller than ${\textstyle \frac{1}{2}}d(p,q)$ for $p$ and $q$. $V$ is a neighborhood of $p$, but we use the index $q$ because the radius of $p$ is determined by the distance to $q$ whenever a particular $q\in K$ is given for a fixed $p\in K^{c}$. If the text is not clear, see the diagram below.
Now consider $\left\{ W_{q} \right\}_{q\in K}$. This forms an open cover of $K$. By assumption, since $K$ is compact, there exists some $q_{1},\cdots,q_{n}$ that satisfies the equation below.
$$ K \subset W_{q_{1}}\cup \cdots \cup W_{q_{n}}=W $$
And let’s call it $V=V_{q_{1}}\cap \cdots \cap V_{q_{n}}$. Then, $V$ is still a neighborhood of $p$. Also, because we initially chose the distances $V_{q}$, $W_{q}$ carefully, we know that $V\cap W=\varnothing$ holds. Therefore, since $W$ is an open cover of $K$, the following is true.
$$ V \subset K^{c} $$
Since every $p\in K^{c}$ always has a neighborhood contained in $K^{c}$, every $p \in K^{c}$ is an interior point of $K^{c}$. Therefore, $K^{c}$ is an open set, and $K$ is a closed set.
■