26-01-2023

Problem: Let $A$ and $B$ be two connected subspaces of a topological space $X$, such that $A\cap B \neq \emptyset$. Prove that $A\cup B$ is connected. What about intersection of two connected spaces if they have non-empty intersection?

Solution: We will prove a theorem, which will be useful.

Let $(X,\mathcal{T} )$ be a topological space. Then $X$ is connected if and only if whenever the function $f:(X,\mathcal{T})\to \left(\{0,1\},\mathcal{T}_d\right)$ is continuous, it is constant, where $\mathcal{T} _d$ denotes the discrete topology.

Proof: Let us suppose that whenever $f:X\to \{0,1\}$ is continuous, it is constant. We need to show that $X$ is connected. To the contrary, suppose that $X$ is not connected, so we can find two non-empty proper open subsets $A$ and $B$ of $X$ such that \[ X = A\cup B \text{ and } A\cap B \neq \emptyset. \]

Consider the function \[ f:X\to \{0,1\},~x \mapsto \begin{cases} 1, &\text{ if } x\in A ;\\ 0, &\text{ if } x\in B. \end{cases} \] Then, $f$ is continuous as $f^{-1}(U)$ is open for any open subset of $\{0,1\}$, but $f$ is not constant ant and hence we arrived to a contradiction. Hence, $X$ is connected.

Now we assume that $X$ is connected. Then we need to show that if $f:X\to \{0,1\}$ is continuous, then it must be constant. Suppose that there exists a continuous function $f:X\to \{0,1\}$ such that $f$ is not constant. Define \[ A = f^{-1}\left( \{0\} \right),~\text{ and } ~ B = f^{-1}\left( \{1\} \right). \] Since, $f$ is not constant, so both the sets $A$ and $B$ are non-empty set. Moreover, both are open sets and \[ X = A \cup B, \] which proves that $X$ is not connected, a contradiction. Hence, every continuous function $f:X\to \{0,1\}$ is constant.


Let $A$ and $B$ be connected and $A\cap B \neq \emptyset$. We need to show that $A\cup B$ is connected. If not, then there exists a non-constant continuous function $f:A\cup B\to \{0,1\}$. Since, $f$ is not constant, there must be elements, say $x\neq y$ such that $f(x) \neq f(y)$. Let $f(x) = 0$ and $f(y)=1$. If $x\in A$, abs as $A$ is connected, $f(A)=0$, similarly, if $x\in B$, then $f(B)=0$. So, without loss of generality, we assume that $f(A) = 0$ and $f(B) = 1$. As, $A\cap B\neq \emptyset$, let $x\in A\cap B$. This means $f(x)=0$ and $f(x)=1$, which is absurd. Hence, $A\cup B$ is connected.


The intersection of two connected spaces need not be connected. For example, take $X=\mathbb{R} ^2$ with the Euclidean topology and \[ A = \mathbb{S} ^1,~\text{ and } B = [-2,2]. \] Both the spaces are connected, but the intersection which is $\{-1,1\}$ is not connected.

intersection of circle and an interval