Which says that $\mathbb R^n$ the distance between a point $b$ and a set $X$ defined by$$ \inf \left\{ d(b,x) \mid x \in X \right\} $$
The proposition:
If $X$ is closed, this distance is reached at some point in the set $X$.
To prove it I assumed without loss of generality that $X$ is also bounded, because if not, it intersected with (e.g.) $$ B_b (n) = \left\{ x \in \mathbb R^n \mid d(b,x) \leqslant n \right\}, $$ where $n$ for example, can be chosen as the first natural number such that the intersection is not empty, and obviously the rest of the points of $X$, are at a greater distance, and will not be candidates.
Then define $$ f(x) = \left| x - b \right| \quad \text{for }x \in X $$ and since the domain is compact we conclude the result, that reaches its minimum at some point in the set. This demonstration clearly not true for any metric space, because being closed and bounded is not enough to be compact in general, but anyway maybe it can be shown in a more general way. That is my question, is this true?