I want to prove that for nonemptyset $A, B\subset \mathbb R^n$, if $A$ is compact and $B$ is closed, then there exists $u\in A,v\in B$ s.t. $\inf\{\|a-b\| \mid a\in A, b\in B\}=\|u-v\|$. (i.e., the minumum of $\{\|a-b\| \mid a\in A, b\in B\}$ is exists.)
The outline is given:
we may assume $B$ is compact by embedding $A$ inside a big enough ball that interacts $B$. Then, $A\times B$ is compact so the function $(a,b)\mapsto \|a-b\|$ maps onto a compact set and reaches its bounds.
I want to complete the proof.
Since $B$ is not empty, there exists $b_0\in B.$
And since $A$ is bounded, there exists $r>0$ s.t. $A\subset \overline{B_r(b_0)}$.
Let $B':=B\cap \overline{B_r(b_0)}.$ This is bounded and closed thus compact.
Then, $A\times B'$ is compact.
The mapping $f:A\times B' \to \mathbb R$ given by $(a,b)\mapsto \|a-b\|$ is continuous so $f(A\times B')$ is compact.
Now, $f(A\times B')=\{\|a-b\| \mid a\in A, b\in B'\}$
I cannot proceed from here. I don't understand the expression "the function $(a,b)\mapsto \|a-b\|$ maps onto a compact set and reaches its bounds" in the outline.
How should I do to complete the proof ? Thanks for your help.