Infimum of distance between two sets I have come across one little snippet in my Real Analysis book and I can not get it through. It generally says:
$E\subset [0,1] \subset G$ and $E$ is closed $G$ is open. Define $\delta=\inf\{|x-y|,x\in E \text{ and }y\in G^c \}$, then $\delta>0$.
I know $\delta\ge 0$, but I do not know how to prove $\delta$ could not be $0$.
Thanks.  
 A: As $G$ is open and $[0,1] \subset G$, there exists a connected component  of $G$, say $G_1$, containing the unit interval. Then we have $G_1=(a,b)$ with $a<0 <1 <b$ (as connected open subsets of the real line are open intervals). You should be able to conclude from here.

Note (after an edit): my original answer ("As $G$ is open and $E=\overline{E} \subset G$, around every point of $E$  there's a ball of positive radius all contained in $G$.") is incorrect as the radii can have infimum $0$, as pointed out by the OP in the comments.
A: Although, the requirement is that $E$ be a proper subset of the unit interval, it is easy to see this by assuming $E=[0,1]$. Since if it is true for this latter set, it must be true for the smaller set.
Now, $[0,1] \subset G \implies \exists x \in G, x \not \in [0, 1].$ It is clear that the distance from any such element to any element of $E$ must be non-zero. And since any such point in $G$ satisfies this property, the complement, $G^c$, here must also since it will contain points farther away.
A: If $G$ is open, then for the points $0, 1$ exist $r(0), r(1)$ such that $B(x, r(x)) \subseteq G$, where $x = 0, 1$. Let $r = \min (r(0), r(1))$. Then $B(0, r), B(1, r) \subseteq G$. But by this, it follows that $(- r, 1 + r) \subseteq G$. But then $[ - r / 2, 1 + r / 2] \subseteq G$. So if $t \not \in G$, then either $t > 1 + (r / 2)$, or $t < - r / 2$. In either case, $d(t, x) \geq r / 2 > 0$, where $x \in E$, concluding the proof.
A: Assuming $E$ not empty (so $\delta$ exists).
$E$ and $G$ are disjoint closed sets,but $E$ is also compact. If $\delta = 0$ then there is a sequence $(x_n)_n$ in $E$ and  a sequence $(y_n)_n$ in $G$ with  $\lim_{n\to \infty}|x_n-y_n|=0.$ But since $E$ is compact,there would be a subsequence $(x_{f(n)})_n$ of $(x_n)_n$ converging to a point $x,$ and since $E$ is closed, $x\in E.$ Then $\lim_{n\to \infty}|x-y_{f(n)}|=0,$ implying $x\in \bar G=G,$ a contradiction ( because $x\in E$ and $E\cap G=\phi).$
Note.If $E$ and $G$ are closed,non-compact subsets of $R$, it is possible that $\delta=0.$ E.g. $E=N$ and $G=\{n+2^{-n}:n\in N\}.$
