Given a metric space $(X,d)$ and $A \subset X, B \subset X$ with $B$ compact, show that there exists a $b \in B$ such that $d'(A, B) = d'(A, \{ b\})$, where $d'(A, B) = \inf_{a \in A, b \in B} d(a, b)$.
My attempt at solution
Consider a sequence $(b_n \in B)_{n \in \mathbb{N}}$, $b_n \to \bar{b}$ such that
$ \inf_{a \in A} d(a, b_n) \to \inf_{a \in A} d(a, \bar{b}) = \inf_{a \in A, b \in B} d(a, b)$. Since $B$ is compact, it is closed; hence, $b_n \to \bar{b} \in B$.
I usually struggle with notions of sequences, compactness, closed, etc so I am not sure whether this is right.
Form the definition of $d'(A,B)$ there exists sequences $(a_n),(b_n)$ such that $d(a_n,b_n) \to d'(A,B)$. Since $B$ is compact there is a subsequence $(n_k)$ such that $b_{n_k}$ converges to some point $b \in B$. Now let us show that $d'(A,B)=d'(A,b)$. For this let us first show that $d(A,b_{n_k}) \to d'(A,b)$. This can be proved using triangle inequality; in fact $|d'(A,b_{n_k}) - d'(A,b)| \leq d(b_{n_k},b)$. We have proved that $d'(A,b_{n_k}) \to d'(A,b)$. Now $d'(A,b)=\lim d'(A,b_{n_k})\leq \lim \inf d(a_{n_k},b_{n_k})=d'(A,B)$. The reverse inequality $d'(A,B) \leq d'(A,b)$ is obvious.