If $K$ is a nonempty compact subset of $M$, and $A$ is any nonempty subset of $M$, I have to prove that there is a point $y$, an element of $K$ such that $\textrm{dist}(x, A) \leq \textrm{dist}(y, A)$ (where $\textrm{dist}(q, A) = \inf\{d(q, z) : z \in A\}$) for every $x \in K$, using the compactness in terms of open coverings.
I was trying to prove by contradiction, and it basically comes down the proving that the set of all distances from a point in $K$ to the set $A$ does not attain its supremum.
Any thoughts on how to proceed?