The closest point to $x_0$ exists in a compact subset $K$

compactnessgeneral-topologymetric-spaces

Let $K$ be a compact subset of the metric space $(X, \rho)$ and $x_0$ belong to $X$. Show that there is
a point $z \in K$ for which
$\rho(x, x_0) \ge \rho (z, x_0)$ for all $x\in K$.

I've tried above question in following way:

Since $X$ is totally bounded, for radius $r_1$ let $B(x_i,r)_{i=0}^m$ covers $X$.
Let for some value of $r$ we can draw $B(x_0,r)$ such that it contains every element of $K$.

Now as $r$ tends to zero, for every $r$ if $B(x_0,r)$ contain some $x$ element of $K$ we can find some other element $z\in K$ such that $\rho (x, x_0) \ge \rho(z, x_0) $

I've managed to gather only this much idea to some how approach this question.

Best Answer

The function $x \mapsto \rho(x,x_0)$ is a continuous function from $X$ to $\mathbb{R}$ (exercise). Continuous functions have minimizers and maximizers on compact sets, so use one of these extreme values to get the desired conclusion.

Related Question