# let $K \subset U \subset X$, $(X,d)$ metric space $U$ open and $K$ compact, prove the exist an $r>0$ such that $d(x,K)\leq r \rightarrow x \in U$

I'm stuck... I would appreciate some help let $K \subset U \subset X$, $(X,d)$ metric space $U$ open and $K$ compact, prove there exists an $r>0$ such that $d(x,K) \leq r \rightarrow x \in U$

-

Hint: Since $U$ is open and $K\subseteq U,$ what can you say for each $x\in U$ (and in particular each $x\in K$)? Don't forget that $K$ is compact, so that any open cover can be reduced to a finite subcover.
so it gooes like this? U open and K a subset of U implies that for ever x in K there exist an $r_{x}$>0 such that B(x,$r_{x}$) is contained in U so we take the union of all the balls each centered in an x in K use compactness to get the finite subcover and take r= min of all $r_{x}$? –  user95277 Sep 17 '13 at 5:03
Almost: the statement asks for $r$ such that it works for $\leq$. Think of $U=B_1(0)$, $K=\{0\}$ and $(X,d) = \mathbb{R}^2$ with its usual metric. You could take $r_0=1$ but no point at distance $1$ of $0$ is in $U$. –  Pipicito Sep 17 '13 at 5:15
You have to reduce the size of $r$ to repair the problem. Make a drawing of the example above. –  Pipicito Sep 17 '13 at 5:22
Instead, try covering $K$ with balls of radius $$\frac{r_x}2,$$ find a finite subcover of that, and proceed from there. –  Cameron Buie Sep 17 '13 at 5:23