Let $B \subseteq E \subseteq \mathbb{R}^n$ where $B$ is compact relative to $E$, $E$ is open relative to $\mathbb{R}^n$. Prove that there exists $\epsilon > 0$ such that $A:= \{v \in \mathbb{R}^n \mid d(v,B) \leq \epsilon\} \subseteq E$.
My attempt:
I must somehow be able to pick an $\epsilon$ such that $\inf_b d(v,b) \leq \epsilon \implies v \in E$
So, I took a covering $\{B_E(b,\epsilon_b) \mid b \in B\}$ of $B$ with $B_E(b, \epsilon_b) \subseteq B$
Then, by compactness, there is a finite subcover and I set $\epsilon$ to be the minimum of the radii of the balls in the subcover, but couldn't prove that this $\epsilon$ works.
Any ideas?
Let $f : B \to \mathbb{R}$ be given by $f(b) = d(b, E^c) = \inf\{d(b,x) : x \in E^c \}$, where $E^c$ is the complement of $E$ in $\mathbb{R}^n$. Show that (1) $f$ is continuous and (2) $f > 0$. Then, since $f$ is a continuous function on a compact set, by the extreme value theorem, it has a minimum, and by (2) the minimum is positive; call it $\varepsilon > 0$. Then show that (3) the $\varepsilon$-neighborhood of $B$ is contained in $E$.