Can I prove Heine-Borel theorem as this? I am self-learning general topology without any teacher who guides me. So I have to post my "homework" here, to check if my proof is correct.
Lemma
Let $(X, \rho)$ to be a totally bounded metric space. For any infinite sequence $u: I \to X$, there exists a subsequence $w: J \to X$ which is Cauchy.
Proof. Let $(M, \rho')$ to be a compact metric space, and let $(X, \rho)$ to be its subspace. As $M$ is compact, then for any infinite sequence $u: I \to A \subseteq M$, there exists an infinite subsequence $w: J \to A \subseteq M$ such that $w$ converges to a point $x \in M$. As $X \subseteq M$, we can suppose $u: I \to X$, then there must be a subsequence $w: J \to X$ converges to a point $x \in M$. Thus, $x$ is a limit point, in other words, for any $\varepsilon \in \mathbb R_{> 0}$, there exists $k \in J$ such that the image $w[I_{\ge k}] \subseteq B_{\rho'}(x, \varepsilon)$. Thus, for any $n, m \in J_{\ge k}$, $\rho(w(m), w(n)) < \varepsilon$.

Theorem: Heine-Borel theorem
A metric space is compact, if and only if it is totally bounded and complete.
Proof. Let $(X, \rho)$ be a complete and compact metric space, and let $(A, \rho_A)$ be its subspace.
First we prove $\Rightarrow$. If $A$ is compact, then $A$ is closed in $X$. Suppose $A$ is not complete. As $X$ is complete, let sequence $u: I \to A$ converges to $x \in X \setminus A$. As $x$ is a limit point of $A$ but it is not an element of $A$, $A$ is not closed. This is contradicted to the assumption we have. Thus $A$ must be complete.
Now we prove $\Leftarrow$. As $A$ is totally bounded, for any infinite sequence $u: I \to A$, there exists a subsequence $w: J \to A$ which is Cauchy. As $A$ is complete, then $w$ converges to a point $a \in A$. Thus $A$ is sequentially compact. As $(A, \rho_A)$ is a metric space, it is compact.
 A: First note that a compact metric space is complete and totally bounded (I assume you already know this); this takes care of one direction in your version of Heine-Borel. (The second is almost by definition, and the first uses that a Cauchy sequence which has a convergent subsequence (converging to some $p$) itself converges to $p$, and we use compact $\implies$ sequentially compact in metric spaces).
But in your lemma you use a result which gives the other direction quite directly: suppose that $(X,\rho)$ is totally bounded and complete. Then there is a compact metric space $(K, \rho’)$ such that $X \subseteq K$ and $\rho’ \restriction_{X \times X}= \rho$. But then by completeness $X$ is closed in $K$ and hence compact (if $X$ were not closed in $K$ we’d have some $p \in K\setminus X$ and a sequence $(x_n)_n \to p$ in $K$, but then $(x_n)_n$ is Cauchy in $(X,\rho)$ too (by the assumption on the metrics) and must converge in $X$ but this would contradict the unicity of limits in $(K,\rho’)$ QED).
That way I do not have to use that sequentially compact $\implies$ compact for metric spaces at all.
