$Y$ is totally bounded and complete $\implies$ every sequence in $Y$ has a cluster point in $Y$ Good evening, I'm trying to prove this characterization of compact sets in metric spaces:

Let $X$ be a metric space and $Y\subseteq X$. If $Y$ is totally bounded and complete, then every sequence in $Y$ has a cluster point in $Y$.

The ideas are clear in my head, but I have trouble to write it down rigorously. I'm so sorry if it makes you confused at some point.
Could you please verify whether my attempt is fine or contains logical gaps/errors? Any suggestion is greatly appreciated!

My attempt:
Let $(y_n)$ be a sequence in $Y$. We define the sequences $(z_k),(I_k)$ and a subsequence $(y_{\varphi (n)})$ of $(y_n)$ recursively as follows:
The case $k=1$:


*

*Because $Y$ is totally bounded, $Y$ is covered by finitely many balls $B_i=\mathbb B(z_1^i,1)$ where $z_1^i \in Y$ for all $i= \overline{1,n_1}$.

*Then there exists $i$ such that infinitely many terms of $(y_n)$ belongs to $B_i$. If not, for all $i= \overline{1,n_1}$, $B_i$ contains at most finitely many terms of $(y_n)$, and so does $\cup_{i=1}^{n_1} B_i$. This contradicts the fact that $\cup_{i=1}^{n_1} B_i$ covers $Y$.

*Let $z_{1} = z^{n_0}_{1}$ where $n_0$ is the least $i$ such that infinitely many terms of $(y_n)$ belongs to $B_i$.

*Let $I_1 = \{n \in \mathbb N \mid y_n \in \mathbb B(z_1,1)\}$ and $\varphi (1) = \min \{n \in \mathbb N \mid y_n \in \mathbb B(z_1,1)\}$.
The case $k=2$:


*

*Because $Y$ is totally bounded, $Y$ is covered by finitely many balls $B_i=\mathbb B(z_2^i,1/2)$ where $z_2^i \in Y$ for all $i= \overline{1,n_2}$.

*Then there exists $i$ such that infinitely many terms of $(y_n)$ belongs to $B_i \cap \mathbb B(z_1,1)$. If not, for all $i= \overline{1,n_2}$, $B_i \cap  \mathbb B(z_1,1)$ contains at most finitely many terms of $(y_n)$, and so does $\cup_{i=1}^{n_1} [B_i \cap  \mathbb B(z_1,1)] = [\cup_{i=1}^{n_1} B_i] \cap \mathbb B(z_1,1) = \mathbb B(z_1,1)$. This contradicts the construction of $x_1$.

*Let $z_2 = z^{n_0}_2$ where $n_0$ is the least $i$ such that infinitely many terms of $(y_n)$ belongs to $B_i \cap \mathbb B(z_1,1)$.

*Let $I_2 = \{n \in \mathbb N \mid y_n \in \mathbb B(z_1,1) \cap B(z_2,1/2)\}$ and $\varphi (2) = \min (I_{2} \setminus \{\varphi (n) \mid n \le 1\})$.
The inductive case:


*

*We have $Y$ is covered by finitely many balls $B_i :=\mathbb B(z_{k+1}^i, 1/(k+1))$ where $z_{k+1}^i \in Y$ for all $i= \overline{1,n_{k+1}}$.

*There exists $i$ such that $B_i \cap  [\cap_{n=1}^k \mathbb B(z_n, 1/n)]$ contains infinitely many terms of $(y_n)$. If not, $\mathbb B_i \cap [\cap_{n=1}^k \mathbb B(z_n, 1/n)]$ contains at most finitely many terms of $(y_n)$ for all $i= \overline{1,n_{k+1}}$, and so does $\cup_{i=1}^{n_{k+1}}  \left [B_i \cap [\cap_{n=1}^k \mathbb B(z_n, 1/n)] \right] = [\cup_{i=1}^{n_{k+1}} B_i] \cap [\cap_{n=1}^k \mathbb B(z_n, 1/n)] =$ $Y \cap \mathbb [\cap_{n=1}^k \mathbb B(z_n, 1/n)]= \cap_{n=1}^k \mathbb B(z_n, 1/n)$. This contradicts the definition of $z_k$.

*Let $z_{k+1} = z^{n_0}_{k+1}$ where $n_0$ is the least $i$ such that infinitely many terms of $(y_n)$ belongs to $B_i \cap \mathbb B(z_k, 1/k)$.

*Let $I_{k+1} = \{m \in \mathbb N \mid y_m \in \cap_{n=1}^{k+1} \mathbb B(z_n, 1/n)\}$ and $\varphi (k+1) = \min (I_{k+1} \setminus \{\varphi (m) \mid m \le k\})$.
By construction, we have


*

*$\varphi$ is strictly increasing and thus $(y_{\varphi (k)})$ is a subsequence of $(y_n)$.

*$y_{\varphi(k)} \in \mathbb B(z_n, 1/n)$ for all $n = \overline{1,k}$.
Next we prove that $(y_{\varphi (k)})$ is a Cauchy sequence. Given $\epsilon >0$, there is $N \in \mathbb N$ such that $1/N < \epsilon/2$. For all $k \ge N$, we have $y_{\varphi(k)} \in \mathbb B(z_N, 1/N)$ and thus $\| y_{\varphi (k)} - z_{\varphi (N)}\| < 1/N$ and $\| z_{\varphi (N)} - y_{\varphi (N)}\| <1/N$. As such, $\| y_{\varphi (k)} - y_{\varphi (N)}\| \le \| y_{\varphi (k)} - z_{\varphi (N)}\| + \| z_{\varphi (N)} - y_{\varphi (N)}\| < 1/N +1/N < \epsilon$ for all $n > N$.
Because $Y$ is complete, $(y_{\varphi (k)})$ converges to some $\bar y \in Y$. Hence $\bar y$ is a cluster point of $(y_n)$.
 A: I think you can streamline your proof. Use a diagonal argument. Let $\{a_n\}$ be a sequence in $X$. Cover $X$ with finitely many balls of radius $r_1=1$. (At least) one of them, say $B_1$ contains infinitely many members of  $\{a_n\},$ which means that we get a subsequence $\{a(1,n)\}$ of $(a_n)$ contained in $B_1$. Now cover $X$ by finitely many balls of radius $r_2=1/2$. One of them, say $B_2$ must contain infinitely many members of $\{a(1,n)\}$, from which we get a subsequence $\{a(2,n)\}$ of $\{a(1,n)\}$ contained in $B_2$.
Inductively, we can choose sequences $\{a(k,n)\}\subseteq \{a(k-1,n)\}$ and balls $B_k\subseteq B_{k-1}$ such that $r_k=1/2^{k-1}$ and $\{a(k,n)\}\subseteq B_k.$ (Writing the sequences as a matrix will help in what follows). Now, the sequence $\{a(n,n)\}$ is Cauchy because if $m>n,$ then 
$d(a(m,m),a(n,n))\le d(a(m,m),a(m-1,m-1))+\cdots +d(a(n+1,n+1),a(n,n))\le$
$2\cdot 2^{-(m-1)}+\cdots +2\cdot 2^{-n}\le 2^{-m+1}$ 
and since $X$ is complete, it converges. That is, $\{a_n\}$ has an accumulation point. 
Remark: there is a "cleaner", if a bit more fiddly way to do this. It suffices to show that $X$ is compact (because compactness and sequential compactness are equivalent in metric spaces). So, suppose $X$ is not compact, so that there is a cover $\mathscr A$ of $X$ with no finite subcover. Now, cover $X$ with finitely many balls of radius $1$.One of them, say $B_1$ cannot be covered by finitely many members of $\mathscr A$ (why?). Now, cover $X$ with finitely many balls of radius $1/2$ and intersect them with $B_1$.  If all of these intersections were covered by a finite number of members of $\mathscr A$, then $B_1$ would be covered by a finite number of members of $\mathscr A$, which is impossible. So one of them, say $B_2$, cannot be covered by a finite number of elements of $\mathscr A$. And of course, $B_2\subseteq B_1$ by construction. 
Inductively, we get sets $B_i\subseteq B_{i-1}$ such that $\text{diam}\ B_i=1/i $ and no $B_i$ can be covered by finitely many members of $\mathscr A.$
All that remains now is to choose $x_i\in B_i$ and note that $x_i\to x\in X$ (why?). Of course, $x$ is contained in some member $U$ of $\mathscr A.$ But since $\text{diam}\ B_i=1/i \to 0$ and $U$ is open, for $i$ large enough, $B_i\subseteq U$ which is a contradiction.
