# Proof

Let $$A$$ be a compact subset of a metric space $$(X,d)$$. * We have to show that $A$ is bounded. * Choose an arbitrary point $a\in X$. * Note that $X=\bigcup_{n=1}^\infty B(a,n)$, where $B(a,n)$ denotes the open ball with the center $$a$$ and radius $$n$$. * Thus, $\left(B(a,n)\right)_{n\ge 1}$ is an open cover of $A$. * Since $A$ is compact, there is a finite subcover with indices $$n_1,n_2,\ldots, n_k$$ such that $$A\subset\bigcup_{j=1}^k B(a,n_j).$$ * Take $n=\max(n_1,n_2,\ldots, n_k)$ and we have $A\subset B(a,n)$. * This means that $A$ is bounded. * We have to show that $A$ is closed. * Choose an arbitrary point $x\in X\setminus A$. * For $$n\ge 1$$ set $$U_n:=\left\{y\in X:~d(y,x) > \frac 1n\right\}.$$ * By definition, $U_n$ is open and we have $$\bigcup_{n=1}^\infty U_n=X\setminus \{x\}\supset A,$$ i.e. we have found an open cover of $A$. * Since $A$ is compact, there is a finite subcover with indices $$n_1,n_2,\ldots, n_k$$ such that $$A\subset\bigcup_{j=1}^k U_{n_j}.$$ * Take $n=\max(n_1,n_2,\ldots, n_k)$ and we have $$B\left(x,\frac 1n\right)\subset X\setminus A.$$ * This means that $X\setminus A$ is open. * It follows that $A$ is closed.

Github: ### References

#### Bibliography

1. Forster Otto: "Analysis 2, Differentialrechnung im $$\mathbb R^n$$, Gewöhnliche Differentialgleichungen", Vieweg Studium, 1984