I have 2 questions, one each for $d(x,A)$ and $\operatorname{diam}(A)$, where $A$ is a nonempty subset of a metric space $(X,d)$. Both of them are somewhat related to each other. The first one is about the following statement.
There exists $y\in\bar{A}$ such that $d(x,A)=d(x,y)$.
I figured that this is the case when $X=\mathbb{R}^n$, but my proof relies heavily on the Bolzano-Weierstrass theorem (every bounded sequence has a convergent subsequence) and I can't figure out how I should generalize this to general metric spaces. If this is not true for general metric spaces, how further can we generalize?
The second one is about $\operatorname{diam}(A)$:
If $\operatorname{diam}(A)<\infty$, then there exist $x,y\in\bar{A}$ such that $\operatorname{diam}(A)=d(x,y)$.
Again, my proof relies heavily on the B-W theorem (and the fact that the function $d:X\times X\rightarrow\mathbb{R}$ is continous) and I can't figure out a way to avoid B-W in the argument. Is this not true in general? If so, can someone provide me illustrative counterexamples?