I know that the following statement can be proved with relative ease:
Let $ K \subset \mathbb{R}^n $ be a compact (closed and bounded) set in real Euclidean space. Assume also that $ K \subset U $ where $ U \subset \mathbb{R}^n $ is an open set. Then the distance from $ K $ to the complement of $ U $ is positive, meaning $ d = \text{inf} \{ \lVert x-y \rVert \ : x\in K ; y \notin U\} > 0 $.
This is easy to prove using Bolzano-Weierstrass, but I am trying to visualize it: why visually speaking are closedness and boundedness of $ K $ both necessary. I can see why boundedness is necessary as I can come up with an example in $ \mathbb{R}^2 $ where the boundary of an unbounded $ U $ approaches the boundary of the subset $ K $ arbitrarily closely. But visually speaking (using a visual example): what if $ K $ is bounded and open and $ U $ containing it were bounded and open. How can the distance in this case not be strictly positive (how can it be zero)? Can someone please provide a visual example? It seems that all the "nice"/"intuitive" open bounded sets $ K \subset U $ satisfy the conclusion of the statement. Maybe the lemma requirements can be a bit relaxed but I cannot rigorously prove it without $ K $ being compact. Any explanation and visual examples/counterexamples of $ K,U $ open and bounded satisfying the conclusion of the lemma are appreciated.
******** The case of $K=U$ gives zero distance but is trivial. I was hoping for a proper subset $ K \subset U $ where the distance $d$ is zero.
A simple example is $K=(0,1)$ and $U=(0,1)$. If $K$ is not closed, we could e.g. take it equal to $U$ and then there is no room at all between $K$ and $U^\complement$.. Or $K=[0,1)$ and $U=(-2,1)$ as another example: at the "open end" at $x=1$ we also have no distance to the complement of $U$.