Proving a complete and totally bounded metric space is compact. I'm having trouble writing down the details of this proof formally.

Statement: Suppose $(X, d)$ is a metric space that is complete, and totally bounded (i.e., for every $\epsilon > 0$, $\exists$ finitely many points $x_{i} \in X$, $i = 1, \dots, n$ such that $X = B(x_{1}, \epsilon) \cup \dots \cup B(x_{n},\epsilon) )$.  Prove that $X$ is sequentially compact.

Here is the idea of the proof:
Let $\{ y_{n} \}_{n=1}^{\infty}$ be a sequence in $X$.  We want to show we can find a convergent subsequence.  But the space is totally bounded, so for $\epsilon = \frac{1}{2}$, we can find finitely many $x_{i} \in X$ ($i = 1, \dots, n $) such that $X = B(x_{1}, \frac{1}{2}) \cup \dots \cup B(x_{n},\frac{1}{2}) $.  Then infinitely many terms of $\{y_{n} \}$ appear in some $B(x_{i}, \frac{1}{2})$.
If we look at the subsequence of infinitely many terms from $\{y_{n} \}$ that appear in $B(x_{i}, 1)$, it's clear the distance between each two terms in this subsequence is less than $1$.  I'll call this subsequence $\{y_{n}^{(1)} \}$.
We can repeat this process with $\epsilon = \frac{1}{2^{2}}$, that is, find finitely many open balls the union of which equals $X$, and one of these balls contains infinitely many terms of $\{ y_{n}^{(1)} \}$.  I'll call this subsequence $\{ y_{n}^{(2)} \}$, and clearly the distance between every two terms in this sequence is less than $\frac{1}{2}$.
Doing this iteratively, I can then pick an element from each of these subsequences I am finding, and this will construct my Cauchy subsequence of the original sequence, which will converge by the completeness of the space.
It's clear that from this subsequence, the distance between two terms, say, $y_{n}^{(m)}$ and $y_{n}^{(p)}$ is less than $\frac{1}{2^{p}}$ if $p < m$.
So for each $\epsilon > 0$, all I need to do is find $N$ such that $\frac{1}{2^{N-1}} < \epsilon$.  Then $t, s \geq N$ implies $d(y_{n}^{(t)}, y_{n}^{(s)})< d(y_{n}^{(t)}, y_{n}^{(N)})+ d(y_{n}^{(N)}, y_{n}^{(s)}) < \frac{1}{2^{N}} + \frac{1}{2^{N}} < \frac{1}{2^{N - 1}} < \epsilon $.
Did I manage to keep all of the details straight?  Thanks for any help.
 A: You're proof seems mostly all right, though I find it hard to follow towards the end.  If I were to write a proof along the same lines, I would write it as follows:

Let $\{ y_{n} \}_{n=1}^{\infty}$ be a sequence in $X$.  $X$ is totally bounded, so we can find finitely many $x_{i} \in X$ ($i = 1, \dots, n $) such that $X = B(x_{1}, \frac{1}{2}) \cup \dots \cup B(x_{n},\frac{1}{2})$.  
We note that infinitely many terms of $\{y_{n} \}$ must appear in some ball $B(x_{i}, \frac{1}{2})$.  Define $\{y_{n}^{(1)}\}$ to be the subsequence of terms that appear in this ball.
If we look at the subsequence of infinitely many terms from $\{y_{n} \}$ that appear in $B(x_{i}, 1)$, it's clear the distance between each two terms in this subsequence is less than $1$.  I'll call this subsequence $\{y_{n}^{(1)} \}$.
In fact, we can repeat this process in the following way: for any integer $k > 1$, we may select a ball $B$ of radius $1/2^k$ containing infinitely many elements of $\{y^{(k-1)}\}$.  Define $\{y_{n}^{(k)}\}$ to be the subsequence whose elements are the elements of $\{y_{n}^{(k-1)}\}$ that fall in $B$.
Now, consider the subsequence of $y_n$ given by $x_n = y_n^{(n)}$.  We note that for any $\epsilon > 0$, we may select an $N$ such that $1/2^{N} < \epsilon$.  For $n>m>N$, we note that $x_n,x_m$ are both elements of the sequence $\{y_n^{(N)}\}$, which means that both are elements of a ball of radius $1/2^N$.  Thus, we may state that
$$
d(x_n,x_m) < 1/2^N < \epsilon
$$
Thus, $\{x_n\}$ is a Cauchy subsequence of $\{y_n\}$.  Since $X$ is compact, $\{x\}_n$ converges.
Thus, every sequence in $X$ has a convergent subsequence, which is to say that $X$ is sequentially compact.
A: The basic idea is entirely correct, but it’s a bit sloppy in spots. I would do something like this.

Since $X$ is totally bounded, there are an $x_0\in X$ and an infinite $N_0\subseteq\Bbb N$ such that $y_n\in B(x_0,1)$ for all $n\in N_0$. Given an infinite $N_k\subseteq\Bbb N$ and an $x_k\in X$ such that $y_n\in B(x_k,2^{-k})$ for all $n\in N_k$, total boundedness of $X$ implies that there are an $x_{k+1}\in X$ and an infinite $N_{k+1}\subseteq N_k$ such that $y_n\in B(x_{k+1},2^{-(k+1)})$ for all $n\in N_{k+1}$. Now let $\langle n_k:k\in\Bbb N\rangle$ be an increasing sequence in $\Bbb N$ such that $n_k\in N_k$ for each $k\in\Bbb N$. Then $\langle y_{n_k}:k\in\Bbb N\rangle$ is a subsequence of $\langle y_n:n\in\Bbb N\rangle$, and $y_{n_k}\in B(x_\ell,2^{-\ell})$ whenever $\ell\le k$. In particular, whenever $k,\ell>m$ we have $$d(y_{n_k},y_{n_\ell})\le d(y_{n_k},x_{m+1})+d(x_{m+1},y_{n_\ell})<2\cdot2^{-(m+1)}=2^{-m}\;,$$ so $\langle y_{n_k}:k\in\Bbb N\rangle$ is Cauchy and therefore converges, since $X$ is complete. $\dashv$

You can add more detail to the application of total boundedness if you feel that it’s necessary.
