# Closure of a connected set is connected

Let $(X,d)$ be a metric space and let $E \subseteq X$ connected. I want to show that $\overline E$ is connected.

How can I prove this in a nice way ?

• Without loss of generality, $\overline{E} = X$. Now suppose $X = U_1 \cup U_2$ with $U_1 \cap U_2 = \varnothing$, where $U_1$ and $U_2$ are open. Commented Jul 11, 2013 at 22:18
• I also started like that. I know that $E \subseteq \overline E$ and $E$ is connected so $E \subseteq U_1$ or $E \subseteq U_2$. How must I proceed ?
– user42761
Commented Jul 11, 2013 at 22:19
• @PeterTamaroff We're interested in the subspace topology of $\overline{E}$. Saves writing $A \cap B \cap \overline{E} = \varnothing$. Commented Jul 11, 2013 at 22:20
• @André Good. WLOG, $E \subset U_1$ (numbering is arbitrary). Now, $E$ is dense, hence its intersection with a nonempty open set ... Commented Jul 11, 2013 at 22:22
• is not trivial. So we have not $U_1 \cap U_2 = \emptyset$.
– user42761
Commented Jul 11, 2013 at 22:25

PROP Let $E\subseteq X$ be connected. Then $\overline E$ is connected.

P Let $f:\overline E\to\{0,1\}$ be continuous. Since $E$ is connected, $f\mid_E$ is constant. But $E$ is dense in $\overline E$, so $f$ is constant, since continuous functions are entirely determined on a dense subset of their domain whenever the codomain is Hausdorff. And $\{0,1\}$ with the discrete topology is metrizable, hence Hausdorff, the claim follows.

ADD There is a more general claim. Let $(X,\mathscr T)$ be a topological space. If $E$ is connected and $K$ is such that $E\subseteq K\subseteq \overline E$, then $K$ is connected.

P Consider $K$ as a subspace of $X$. Then $E$ is dense in the space $K$. Let $f:K\to\{0,1\}$ be continuous. Then $f\mid_E$ is constant. It follows $f$ is constant, so $K$ is connected.

Here is the proof of

PROP Let $X$, $Y$ be topological spaces, $Y$ Hausdorff. Suppose $D$ is dense in $X$ and $f,g:X\to Y$ are continuous. If $f$ and $g$ agree on $D$, then $f=g$.

P By contradiction. Thus, assume there exists $x\in X\smallsetminus D$ such that $f(x)\neq g(x)$. Then there exist open nbhds of $N_1$ of $f(x)$ and $N_2$ of $g(x)$ with $N_1\cap N_2=\varnothing$. By continuity, $M_1=f^{-1}(N_1)$ and $g^{-1}(N_2)=M_2$ are open. Then so is $M=M_1\cap M_2\neq \varnothing$ since $x\in M$. Thus, there exists $y\in M\cap D$, and $f(y)=g(y)$. But this is impossible, since this gives $f(y)\in f(M)\subset ff^{-1}(N_1)\subset N_1$ and $g(y)\in g(M)\subset gg^{-1}(N_2)\subseteq N_2$.

• $K$ doesn't have to be closed for that to hold, so this structure seems a bit odd. Commented Jul 11, 2013 at 22:32
• @dfeuer Will change it. It just makes things easier.
– Pedro
Commented Jul 11, 2013 at 22:33
• @julien Your bully? I changed the proof, which now is less general. Could you drop by the chat?
– Pedro
Commented Jul 11, 2013 at 22:37
• Nice. I was looking for sth. like that.
– user42761
Commented Jul 11, 2013 at 22:39
• But what you stated with $E\subseteq K\subseteq \overline{E}$ was true. Any such $K$ must be connected by the same argument. $k\in K$ belongs to$\overline{E}$. So $f(k)=\lim f(e_n)$. Commented Jul 11, 2013 at 22:41

Following Daniel Fischer's suggestion:

Suppose that $E$ is a connected subspace of $X$ and $E \subseteq K \subseteq \overline E$.

Consider $K$ as a subspace of $X$. Then $E$ is a dense, connected subspace of $K$.

Let $C$ and $D$ be open sets in $K$ that separate $K$.

Then $C$ and $D$ are nonempty, and thus each must contain an element of $E$, so $C\cap E$ and $D \cap E$ separate $E$.

Suppose that $X$ is a space and $E\subset X$ is a connected subset.

Let $A$ be a clopen subset of $\overline E$ such that $A\cap\overline E\not=\emptyset$.

Since $A$ is open in $\overline E$, $A\cap E\not=\emptyset$.

Note that $A\cap E$ is nonempty and clopen in $E$.

Since $E$ is connected, $E=A\cap E\subset A$.

Since $A$ is closed in $\overline E$, $\overline E\subset A$.

So $A=\overline E$, showing $\overline E$ to be connected.

Suppose $$E$$ is connected and its closure $$\bar E$$ is disconnected then there exists sets $$P$$ and $$Q$$ such that $$P \cup \bar Q = \bar P \cup Q = \phi$$ and $$P \cup Q = \bar E$$.

Now let $$P \cap E = M$$ and $$Q \cap E = N$$

$$M$$ and $$N$$ have the property of $$M \cup \bar N = \bar M \cup N = \phi$$ as they are subset of $$P$$ and $$Q$$. Also $$M \cup N = E$$ which shows that $$E$$ is disconnected and hence we have a contradiction.