= Compact subset of an open set has positive distance from its complement
{title2=$\varnothing\ne K\subset\Omega,\ K\text{ compact},\ \Omega\text{ open}\implies d(K,X\setminus\Omega)>0$}
In a <metric space> $X$, let the nonempty <compact set> $K$ lie in the <open set> $\Omega$. If $F=X\setminus\Omega$ is nonempty, the <distance to a set> $d(x,F)$ is a <continuous function> of $x$: the <triangle inequality> gives $|d(x,F)-d(y,F)|\leq d(x,y)$. Since $F$ is a <closed set>, this distance is strictly positive on $K$. The <extreme value theorem> attains its minimum on $K$, so
$$
d(K,F)=\min_{x\in K}d(x,F)>0.
$$
If $F$ is empty, the extended-real convention gives $d(K,F)=+\infty$. This result provides a single positive neighbourhood radius that stays inside $\Omega$ at every point of $K$. Compactness is essential: in the real line $K=\{1/n:n\geq1\}\subset(0,2)$ has zero <distance between two sets> from $(-\infty,0]\cup[2,\infty)$, although each point of $K$ has positive <distance to a set> from that <complement>.
Back to article page