Let $E,F \in \mathbb{R}$ be two non-empty closed sets, with $E$ bounded. Show that there are points $x \in E, y \in F$ such that $\text{dist}(E,F) = \lvert x - y\rvert\cdot\text{dist}(E,F)$ is defined as $\inf\{\lvert x - y \rvert: x \in E, y \in F\}$
I know that $E$ bounded implies that it is compact, and intuitively we should have $x$ on the "boundary" of $E$ and similarly for $y$, but I'm struggling to find a way to say everything precisely. I've looked at some of the other similar questions but none of them have been that helpful for me. I've also read that a point has a minimum distance from a compact set, and this sounds like it could be useful.
Since \begin{align} \operatorname{dist}(E, F) = \inf\{|x-y| : x \in E, y \in F\}, \end{align} then there exists a sequence of pairs $(x_n , y_n) \in E\times F$ such that $|x_n-y_n| \rightarrow \operatorname{dist}(E, F)$.
Now, since $\{x_n\}\subset E$ is bounded then it contains a convergent subsequence say $\{x_{n_k}\}$, i.e. $x_{n_k} \rightarrow x \in E$. Moreover, since \begin{align} |x_{n_k}-y_{n_k}| \rightarrow \operatorname{dist}(E, F) \end{align} then it follows \begin{align} |y_{n_k}| \leq \operatorname{dist}(E, F)+|x_{n_k}| \leq \operatorname{dist}(E, F)+M. \end{align} where $M$ is a bound on $E$, i.e. $|x|\leq M$ for all $x \in E$.
Thus, it follows $y_{n_k}$ is also bounded which means it has a subsequence that converges to some $y \in F$.