Let $X$, $Y$ be subsets of $\Bbb{R}$, with $X$ compact and $Y$ closed. Show that there exists $x\_0 \in X$, and $y\_0 \in Y$ such that $|x\_0-y\_0| \leq |x-y|$ for all $x \in X$, $y \in Y$.

If $Z = \{|x-y| : x\in X, y\in Y\}$, then $0$ is a lower bound of $Z$ so there exists $\alpha = \inf Z$. So there is a sequence of elements in $Z$ such that it converges to $\alpha$, this means that there are sequences $(x\_n)$ in $X$ and $(y\_n)$ in $Y$ such that $\lim |x\_n-y\_n| = \alpha$. Now, because $X$ is compact, then there is a convergent subsequence of $(x\_n)$, $(x\_{n\_k})$ and it could converge to an $x\_0$ in $X$ (because $X$ is closed). But I am stuck here, I think what I need is $(x\_n)$ to be convergent but that does not necessarily happen here.