# Union of intersecting connected sets is connected

$A$ and $B$ are connected sets. If the intersection of $A$ and $B$ is not empty, prove that the subspace $A \cup B$ is connected.

My proof: Assume that the union of $A$ and $B$ is not connected, then there exists a clopen set $U$ of the union of $A$ and $B.$ As $U$ is open, $M = U \cap A$ is open in $A,$ so the complement of $M$ is closed in $A.$

As $U$ is closed in $A \cup B$, the complement of (A u is open. So the complement of $M$ is open. So $M$ is a clopen subset and complement of $M$ is a clopen subset in $A.$ So $A$ is not connected. A contradiction. So $A \cup B$ must be connected.

• It is a one-liner if you can use: a space $X$ is connected iff every continuous map $f:X\longrightarrow \{0,1\}$ is constant. – Julien Dec 9 '13 at 12:12
Your proof is wrong. Now if you follow it step by step then it may seem that every step is correct. But it is easy to see that the proof has to be wrong if you take a step back. Which of the prerequisites do you use at which step? If you look at the proof you will see that you only use that $A$ is connected, you use neither that $A\cap B\ne\emptyset$ nor that $B$ is connected. So if your proof was correct, then it would also prove that whenever $A$ is connected that so is $A\cup B$, no matter what $B$ is. This is obviously false. So now you only need to take a counterexample to that stronger (false) claim and work through your proof with that example in mind. A possible counterexamples is $A=[0,1]$, $B=[2,3]$. Here, $A$ and $B$ are connected, but $A\cup B$ is not. Of course, $A\cap B$ is empty. Now in your proof you would start with a set $U$ which is clopen in $A\cup B$. This could be $A$. Now you consider $M=U \cap A$. So in this example $M$ is just $A$. Now according to your proof, $M$ should be clopen in $A$. Is it? And if so, this should show that $A$ is not connected. Does it?