[step:Prove that a complete totally bounded metric space is compact]We use the following elementary compactness criterion.
[claim:Every complete totally bounded metric space is compact]
Let $(M,\rho)$ be a complete totally bounded [metric space](/page/Metric%20Space). Then $M$ is compact.
[/claim]
[proof]
Let $\mathcal U$ be an [open cover](/page/Open%20Cover) of $M$. Suppose, for contradiction, that no finite subcollection of $\mathcal U$ covers $M$.
Since $M$ is totally bounded, finitely many open $\rho$-balls of radius $1$ cover $M$. At least one of these balls has closure in $M$ which cannot be covered by finitely many members of $\mathcal U$; call that closed set $F_1$. Inductively, once a nonempty closed set $F_m\subset M$ has no finite subcover from $\mathcal U$, choose points $z_1,\dots,z_N\in M$ such that the open $\rho$-balls $B_\rho(z_1,2^{-m}),\dots,B_\rho(z_N,2^{-m})$ cover $F_m$. At least one of the closed intersections
\begin{align*}
F_m\cap \overline{B}_\rho(z_\ell,2^{-m})
\end{align*}
for $\ell\in\{1,\dots,N\}$ has no finite subcover from $\mathcal U$; define $F_{m+1}$ to be one such closed intersection. This constructs a nested sequence of nonempty closed sets
\begin{align*}
F_1\supset F_2\supset F_3\supset \cdots
\end{align*}
such that each $F_m$ has no finite subcover from $\mathcal U$ and
\begin{align*}
\operatorname{diam}(F_m)\le 2^{2-m}
\end{align*}
for every $m\ge 2$.
For each $m\in\mathbb N$, choose $p_m\in F_m$. If $r\ge m$, then $p_r,p_m\in F_m$, so
\begin{align*}
\rho(p_r,p_m)\le \operatorname{diam}(F_m).
\end{align*}
Since $\operatorname{diam}(F_m)\to 0$, the sequence $(p_m)_{m=1}^{\infty}$ is Cauchy. Completeness of $M$ gives a point $p\in M$ such that $p_m\to p$ in $(M,\rho)$.
Because $\mathcal U$ covers $M$, choose $U\in\mathcal U$ with $p\in U$. Since $U$ is open, there exists $\delta>0$ such that
\begin{align*}
B_\rho(p,\delta)\subset U.
\end{align*}
Choose $m$ so large that $p_m\in B_\rho(p,\delta/2)$ and $\operatorname{diam}(F_m)<\delta/2$. For every $q\in F_m$,
\begin{align*}
\rho(q,p)\le \rho(q,p_m)+\rho(p_m,p)<\delta/2+\delta/2=\delta.
\end{align*}
Thus $F_m\subset U$, so $F_m$ is covered by the single member $U$ of $\mathcal U$. This contradicts the construction of $F_m$ as a set with no finite subcover. Therefore every open cover of $M$ has a finite subcover, and $M$ is compact.
[/proof]
Now return to
\begin{align*}
K=\overline{i(A)}^{\,\widehat X}.
\end{align*}
The set $K$ is closed in $\widehat X$ by definition of closure. Since $\widehat X$ is complete, every [Cauchy sequence](/page/Cauchy%20Sequence) in $K$ converges in $\widehat X$, and closedness of $K$ forces the limit to belong to $K$; hence $K$ is complete with the restricted metric. From the previous step, $K$ is totally bounded. Applying the claim to the metric space $(K,\widehat d|_{K\times K})$, we conclude that $K$ is compact.[/step]