# Metric spaces, Heine-Cantor and boundness

Let $(X,d_X)$ and $(Y,d_Y)$ be two metric spaces and let $(D,d_X|D)$ be a metric subspace of $(X,d_X)$. Consider a function $f: D \to Y.$ If D is compact and f is continuous, then f is uniformly continuous.

I have to prove this, I know that this is the Heine-Cantor theorem. My question is: can I use the fact that in metric spaces the subset $D\subseteq X$ is compact and thus is closed and bounded or I do have to use the open cover and the finite subcover?

• closed and bounded is not enough. You will need full compactness, so finite covers. – Henno Brandsma Oct 9 '14 at 15:02

It is easiest with an open cover and a finite subcover. Given $\varepsilon > 0$, continuity gives you a ball of size $\delta(x,\varepsilon)$ around each $x \in D$. This is an open cover of $D$. Then compactness lets you extract a finite subcover. What does the subcover do for you?