Distance between compact sets Let $K$ and $L$ be nonempty compact sets, and define 
$$d = inf\{\lvert x-y \rvert : x \in K, y \in L\}$$
If $K$ and $L$ are disjoint, show $d \gt 0$ and that $d = \lvert x_{0}-y_{0} \rvert $ for some $x_{0}$ in $K$ and $y_{0}$ in $L$.

By definition of infimum there are sequences $(x_n)_{n\in\mathbb{N}}\subseteq K, (y_n)_{n\in\mathbb{N}}\subseteq L$ with $\lim_{n\to\infty}|x_n-y_n|=d$. From compactness we have convergent subsequences $x_{n_k}, y_{n_k}$ (it's possible to take the same indices $n_k$!), so there are $x_0\in K, y_0\in L$ with $\lim_{k\to\infty}x_{n_k}=x_0$ and $\lim_{k\to\infty}y_{n_k}=y_0$.
So form continuity of $|\cdot|$ we get
$$|x_0-y_0|=|\lim_{k\to\infty} (x_{n_k}-y_{n_k})|=\lim_{k\to\infty}| (x_{n_k}-y_{n_k})|=d.$$
For $K, L$ disjoint, $d=0$ we get the contradiction $x_0=y_0\in K\cap L=\emptyset$.
