Metric Space Compact iff Complete and Totally Bounded

Theorem
A metric space is compact if and only if it is complete and totally bounded.

Proof
We have that a Compact Metric Space is Complete.

We also have that a Compact Metric Space is Totally Bounded.

Now we assume that the metric space $M = \left({X, d}\right)$ is complete and totally bounded.

Let $\left \langle{a_k}\right \rangle$ be any infinite sequence in $X$.

Let $x_1, \ldots, x_n \in X$ be a finite set of points such that:


 * $\displaystyle X = \bigcup_{i=1}^n N_\epsilon \left({x_i}\right)$

where $N_\epsilon \left({x_i}\right)$ represents the open $\epsilon$-ball neighborhood of $x_i$.

This is known to exist as $M$ is totally bounded.

Then for every $k \in \N$, there is some $j_k \in \left\{{0, \dots, n}\right\}$ such that $d \left({a_k, x_{j_k}}\right) \le \epsilon$.

For some $j \in \left\{{0, \dots, n}\right\}$, we must have $j_k = j$ for infinitely many $k$, and it follows by setting $x := x_{j_k}$.

Setting $x := x_{j_k}$, we see that:
 * $(1): \quad$ There is some $x \in X$ such that $d \left({a_k, x}\right) \le \epsilon$ for infinitely many $k$.

Now let $\left \langle{a_k}\right \rangle$ be any infinite sequence in $X$.

By $(1)$, there is some $x_1 \in X$ such that $d \left({a_k, x_1}\right) \le 1/2$ for infinitely many $k$.

Now we can apply $(1)$ to the subsequence of $\left \langle{a_k}\right \rangle$ which consisting of those elements for which $d \left({a_k, x_1}\right) \le 1/2$.

Thus we can find $x_2 \in S$ such that infinitely many $k$ satisfy both $d \left({a_k, x_2}\right) \le 1/4$ and $d \left({a_k, x_2}\right) \le 1/2$.

Now we proceed inductively, to obtain a sequence $\left \langle {x_m}\right \rangle$ with the property that there exist infinitely many $k$ such that, for $1 \le j \le m$:
 * $(2) \quad d \left({a_k, x_j}\right) \le 2^{-j}$

Now define a subsequence $\left \langle {a_{k_m}}\right \rangle$ inductively by letting $k_0$ be arbitrary, and choosing $k_{m+1}$ minimal such that $k_{m+1} > k_m$ and such that $(2)$ holds for $k = k_m$ and all $1 \le j \le m$.

Let $\epsilon > 0$, and choose $n$ sufficiently large that $1/2^{n-1} < \epsilon$.

Then:
 * $d \left({a_{k_r}, a_{k_s}}\right) \le d \left({a_{k_r}, x_n}\right) + d \left({a_{k_s}, x_n}\right) \le 2 \cdot 2^{-n} < \epsilon$

whenever $r, s \ge n$.

So this subsequence is a Cauchy sequence and hence, because $M = \left({X, d}\right)$ is complete by assumption, it is convergent.

Thus we see that $\left \langle{a_k}\right \rangle$ has a convergent subsequence.

Hence, by definition, $M$ is sequentially compact.

The result follows from Sequentially Compact Metric Space is Compact.