Heine-Cantor Theorem/Proof 2

Theorem
Let $M_1$ and $M_2$ be metric spaces.

Let $f: M_1 \to M_2$ be a continuous mapping.

If $M_1$ is compact, then $f$ is uniformly continuous on $M_1$.

Proof
By Sequence of Implications of Metric Space Compactness Properties, we can assume that $M_1$ is sequentially compact.

Suppose $f:A_1 \to A_2$ is continuous but not uniformly continuous.

Then for some $\epsilon > 0$ and each number $\dfrac 1 n$, we can select points $x_n, y_n \in A_1$ such that $ d_1(x_n, y_n) < \dfrac 1 n$ but $d_2(f(x_n), f(y_n)) \geq \epsilon$.

Since $A_1$ is sequentially compact, some subsequence $x_{\phi(n)}$ of $x_n$ converges to a point $x$.

Since $d_1(y_{\phi(n)}, x) \leq d_1 (y_{\phi(n)}, x_{\phi(n)}) + d_1 (x_{\phi(n)}, x) \to 0$, we see that $y_{\phi(n)}$ converges to x as well.

Since continuous functions send convergent sequences to convergent sequences (see: Limit of Image of Sequence), both $f(x_{\phi(n)})$ and $f(y_{\phi(n)})$ both converge to $f(x)$, hence they must grow arbitrarily close to each other.

But this contradicts the fact that we chose $x_n$ and $y_n$ to always be at least $\epsilon$ apart.