# Prove $E \subset X$ is not connected (definition: $Cl(A) \cup B = A \cap Cl(B) = \emptyset$) iff there exists open sets

I know there is a duplicate answer here, but I'm having a lot of trouble following it. I apologize if I'm not supposed to set up a new question for this. Please flag me if this violates any of the rules. The proof from the link is as follows:

If there are disjoint sets A,B which intersect E and such that $A\cup B\subseteq E$, then $A\cap E$ and $B\cap E$ form a disconnection of E, so E is disconnected. Conversely, suppose that A' and B' are open sets such that $A'\cup B'\subseteq E$ and $A'\cap E\ne\emptyset$, $B'\cap E\ne\emptyset, A'\cap B'\cap E=\emptyset$ (by definition of disconnected). Then setting

$A=\{x:d(x,A'\cap E)<d(x,B'\cap E)\}$
$B=\{x:d(x,A'\cap E)>d(x,B'\cap E)\}$

We have that A and B are open sets (since $d(x,A'\cap E)-d(x,B'\cap E$) is a continuous function), disjoint, and for any $x\in A'\cap E$, letting r be such that $B(r,x)\subseteq A'$, we have $d(x,A'\cap E)=0$ (of course) and $d(x,B'\cap E)\ge r$ (since $A'\cap B'\cap E=\emptyset$), so $A\ne\emptyset$, and similarly $B\ne\emptyset$.

I understand the first proof (which I assume is the $\leftarrow$ direction). I don't understand the proof in the other direction. My questions are :

1. Is it correct to say that we set $A=\{x:d(x,A'\cap E)<d(x,B'\cap E)\}$ and $B=\{x:d(x,A'\cap E)>d(x,B'\cap E)\}$ so that this makes A,B disjoint? At least that's the way I'm visualizing it.
2. How did we get $d(x,A'\cap E)=0$ and $d(x,B'\cap E)\ge r$ and how does this give us that $A \neq \emptyset$ and $B \neq \emptyset$?
• Where did you get that definition of disconnected? I'm having trouble with it,for instance take $E=[1,2],A=[1,\sqrt2),B=(\sqrt2,2]$ then it fits the definition but $E$ is not disconnected,maybe the inclusion shoulde be an equal instead or maybe E is contained in the union? I hope you can enlighten me,good work so far. – AHandsomeAlien Oct 21 '16 at 3:14
• I'm assuming,at my comment,the topology induced by the usual metric over the real line,sorry for not mentioning it. – AHandsomeAlien Oct 21 '16 at 3:19