Existence of points Be $X, Y$ two closed subspaces of $\mathbb{R}^n$ with $X$ bounded. Show the existence of points $x_0 \in X, y_0 \in Y$ such as $d(x_0,y_0) = d(X,Y)=\inf_{x \in X, y \in Y} d(x,y)$.
My idea so far: I want to start by showing that $X_r = \{ y \in  \mathbb{R}^n | d(y,X) \leq r\}$ is compact. With this subspace, without losing generality, I would replace $Y$ by $Y \cap X_r$ for $d(X,Y) \leq r$ where the intersection is nonempty.

If you can show / have shown that $d(x,y) : \mathbb{R}^n \times \mathbb{R}^n \to \mathbb{R}$ is continuous, then you can see this result follows from the fact that a continuous function on compact set attains its extreme values.
Simple case: Assume $X, Y$ are compact. Then $X \times Y$ is compact, and $d(x,y)$ is continuous on this subset. Thus, it attains a minimum at some $(x_0, y_0)$, i.e. there exists $x_0, y_0$ such that
$$d(x_0, y_0) = \inf_{x \in X, y \in Y} d(x,y).$$
Now, in your case $X$ is closed and bounded in $\mathbb{R}^n$, hence is compact. However, $Y$ is closed but might not be compact. We just need to replace $Y$ by a compact subset. Intuitively, we can disregard points in $Y$ that could not possibly help us attain the infimum. Thus, let $m = \inf_{x \in X, y \in Y} d(x,y)$, and define
$$ Y' = \{ y \in Y : d(X, y) \le m + 1 \} .$$
Taking closure of $Y'$ if necessary, we can assume that $Y'$ is closed.
Because $X$ is bounded, you can easily show $Y'$ is bounded.
Thus, $Y'$ is closed and bounded, hence compact.
Furthermore, note that $\inf_{x \in X, y \in Y} d(x,y) = \inf_{x \in X, y \in Y'} d(x,y)$. Thus, without loss of generality, we can replace $Y$ by $Y'$, and then apply the simple case.
