Complete Riemannian manifold $M,$ $C$ closed subset of $M.$ Then for $p\in M$ there is $p^{'}\in C$ that is as close to $p$

I'm trying to prove the next:

If $C$ is a closed subset of a complete Riemannian manifold $M,$ then for each $p\in M,$ there is a point $p^{'}\in C$ that is as close to $p$ as possible.

So I'd like to prove that there is $p^{'}\in C$ such that $d(p,p^{'})=d(p,C):=\displaystyle\inf_{q\in C}d(p,q).$

I'm stuck proving this. If $C$ were bounded, the Hopf-Rinow theorem would imply the compactness of $C$ and we can get such point utilizing the sequence criteria of compactness.

However, $C$ only is closed. Then, since $(M,d)$ is metric space, then the distance from $p$ to $C$ is a continuous function. If we consider the boundary of $C,$ $d(p,C)$ attains a minimum in such set, but, what about the rest of $C?$

Is there another easier way to proof this?

Any kind of help is thanked in advanced

• Pick $q$ in $C$ and consider only the points $p'$ in $C$ with $d(p,p') \leq d(p,q)$. – Catalin Zara May 30 '18 at 2:06
• Thanks to answer @CatalinZara. Let $A:=\{p^{'}\in C:d(p,p^{'})\leq d(p,q)\}$ where $q\in C$ and $p\in M$ fixed point. Such set is closed because of continuity of Riemannian metric, and is bounded because $d(p,q)$ is fixed positive number with $q$ fixed, right? Then $A$ is compact for Hopf-Rinow and we have the case mentioned above. But why this is enogh to finish the proof? – Squird37 May 30 '18 at 2:19
• Or I don't understand your idea @CatalinZara? – Squird37 May 30 '18 at 2:26

$$C_R = C\cap B_R(p).$$
For $R$ large enough, $C_R$ is nonempty. Since $M$ is complete, the Hopf-Rinow theorem implies that $B_R(p)$ (and thus $C_R$) is compact. Thus there is $p' \in C_R$ so that $$d(p,p') = \inf_{s\in C_R} d(p,s).$$
Since $d(p, p')\le R$, we also have
$$d(p,p') = \inf_{s\in C} d(p,s).$$