Heine-Cantor Theorem/Proof 2

Theorem
Let $M_1 = \left({A_1, d_1}\right)$ and $M_2 = \left({A_2, d_2}\right)$ be metric spaces.

Let $M_1$ be compact.

Let $f: A_1 \to A_2$ be a continuous mapping.

Then $f$ is uniformly continuous.

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

Suppose $f: M_1 \to M_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 M_1$ such that $ d_1 \left({x_n, y_n}\right) < \dfrac 1 n$ but $d_2 \left({f \left({x_n}\right), f \left({y_n}\right)}\right) \ge \epsilon$.

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

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

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

But this contradicts the fact that we chose $f \left({x_n}\right)$ and $f \left({y_n}\right)$ to always be at least $\epsilon$ apart.