$f:X \to Y $ is continuous on $X$ and $(X, d_1) $ is compact. Then $f:X\to Y$ is uniformly continuous on $X$

$(X, d_1) $ and $(Y, d_2) $be two metric spaces.

$f:X \to Y $ is continuous on $X$ and $(X, d_1) $ is compact.

Claim: $f:X\to Y$ is uniformly continuous on $X$.

My attempt:

Suppose $f$ is not uniformly continuous.

Then, $\exists (x_n) \text { and } (y_n) $ two sequence of points in $X$ with $$d_1(x_n , y_n) \to 0$$ but $$d_2 (f(x_n) , f(y_n) ) \nrightarrow 0$$

Now, since $(X,d_1)$ is compact $(x_n) $has a convergent subsequence $(x_{n_{k}}) $ and suppose converges to $x$ in the space $(X, d_1) $.

Then, for the increasing sequence $(n_k) \subset {\mathbb{N}}$,

\begin{align}d_1(y_{n_k}, x) &\le d_1(y_{n_k}, x_{n_k})+ d_1(x_{n_k}, x)\\ &\rightarrow 0 [ k \to \infty]\end{align}

Hence, $(x_{n_k}) \text { and } (y_{n_k})$ be two sequence in $X$ and both converges to $x$ in $(X, d_1) $

Since,$f$ is continuous at $x\in X$, $f(x_{n_k}) \rightarrow f(x) \leftarrow f(y_{n_k})$

Hence, $d_2(f(x_{n_k}), f(y_{n_k})\to 0$

Now, choosing the positive integer $ n =n_k $ then there doesn't exists any $\epsilon >0 $ and $k>n$ such that $d_2(f(x_{k}), f(y_{k}))\ge \epsilon > 0$

Hence, it is a contradiction.

Is the proof correct?

Is there any logical mistake?

Please add some details to clarify more. Thanks.


Solution 1:

Looking into the proof, it looks correct. I would expand a bit the triangle inequality that allows you to say $d_2(x_{n_k}, y_{n_k}) \rightarrow 0$.

Just a side note. What you are exploiting is actually sequential compactness, which is equivalent to compactness (the open cover definition) in metric spaces: I would justify a bit this passage.