# Show f is continuous

## Main Question or Discussion Point

A problem on the final exam is to show for a metric space (X,d) and a compact subset C in X prove that the function $$f(x) = min_{y \in C} d(x,y)$$ is continuous.

Now, there are two approches you can take. One is to go to the episolon delta definition of continuous, and the other is to use open sets.

Seeing as how C is compact, I think the better approach is to use open sets. That is, to show that for a point y = f(x), make a neighborhood around it, call it U. Then $$f^{-1}(U)$$ must be shown to be open somehow.

Taking the second approach, I can see that for any point p in $$f^{-1}(U)$$ we can construct a neighborhood V around it, so that $$p \subset V \subset f^{-1}(U)$$. Um.. let me think... I know I can cover $$f^{-1}(U)$$ with finitely many open sets, due to the compactness of C, but I really am stuck. And the thing is, I have no idea where to begin to use the definition of f, $$f(x) = min_{y \in C} d(x,y)$$. I'm pretty sure I'm appraoching this totally wrong but I can't think of anything else to do. Any help is greatly appreciated.

I think the epsilon-delta approach may be better. In fact, for this function show you can use delta=epsilon. That is, prove $$|f(x)-f(x')| \le d(x,x')$$

That question is somewhat odd - by using "min" rather than infinum they must be trying to give a hint. Here's how to make use of that:

Supposing $$f^{-1}(U)$$ is not empty for some open set $$U$$ (otherwise we are done), fix some point $$x_0 \in f^{-1}(U)$$.

As $$U$$ open, there exists $$r > 0$$ such that the interval $$( f(x_0) - r, f(x_0) + r ) \subset U$$.

As $$C$$ is compact, there exists a $$y_0 \in C$$ such that $$d(x_0, y_0) = f(x_0)$$.

Let $$x \in B(x_0, r/2)$$.

Then, $$f(x) \leq d(x, y_0) \leq d(x, x_0) + d(x_0, y_0) \leq r/2 + f(x_0)$$.
Similarily, $$f(x) \geq f(x_0) - r/2$$, and so $$x \in f^{-1}(U)$$.

Therefore, $$B(x_0, r/2) \subset f^{-1}(U)$$, hence $$f^{-1}(U)$$ is open. It follows that $$f$$ is continuous.

Last edited: