Proof $(X×Y)-(A×B)$ is connected [Contradiction] Let $A$ be a proper subset of $X$, and let $B$ is a proper subset of $Y$. If $X$ and $Y$ are connected, show that
$$(X×Y)-(A×B)$$
is connected.
I know there's already a question answering this problem, but as I was working on this problem, I did it from another way and wanted to make sure is right.
Proof Idea:
Suppose by contradiction that $H=(X×Y)-(A×B)$ is not connected. Therefore There exist a separation of H from two opens $U,V$.
$$(X×Y)-(A×B)=U\cup V = U_1\times V_1 \cup U_2 \times V_2$$
Where $U_1,U_2$ are open in $X$ and $V_1,V_2$ are open in Y. This way
$U_1\times V_1 \cap U_2 \times V_2 = (U_1 \cap U_2) \times (V_1 \cap V_2) = \emptyset$. So there are two cases. I will work only on the first case, the second is similar.

*

*$U_1 \cap U_2 = \emptyset$, note that $U_1, U_2 \notin A$, as consequence $U_1 \cap U_2 \cap A = \emptyset$. Consider in particular $U_c=U_1 \cup U_2$. Observe that $U_c \cup A = X$, is a separation of $X$, but $X$ is connected. $\Rightarrow\!\Leftarrow$.

Let me know if there's any mistake, will help me prepare for my exam.
 A: An open set need not be of the form $U_1 \times V_1$, you can only say that $U = \cup_i (U_i \times V_i) - (A \times B)$, $U_i, V_i, i \in I$ are open in $X$, rep. $Y$. This doesn't help you for the proof, really.
A more direct appraoch is to write this difference $(X\times Y)- (A \times B)$ as a union of sets like $\{x\} \times Y, X \times \{y\}$, which are connected subspaces, and in such a way that there are intersections to ensure the connectedness of the union.
A: We adopt the following definition for connected topological space.
Let $X$ be a topological space. We say that $X$ is connected if
there does not exist non-empty open sets $U$, $V$ such that $U\cup V=X$
and $U\cap V=\emptyset$. Let $Y\subseteq X$ be a subset. We say
that $Y$ is a connected subset of $X$ if $Y$ is connected with
respect to the relative topology. Note that the emptyset $\emptyset$
is connected by definition.
Proposition 1: Let $X$, $Y$ be topolocal spaces. Let $f:X\rightarrow Y$
be a continuous function. If $X$ is connected, then $f(X)$ is a
connected subset of $Y$.
Proof of Propositon 1: Prove by contradiction. Suppose the contrary
that there exist open subsets $U$, $V$ of $Y$ such that $f(X)\cap U$,
$f(X)\cap V$ are non-empty, $[f(X)\cap U]\bigcup[f(X)\cap V]=f(X)$
and $[f(X)\cap U]\bigcap[f(X)\cap V]=\emptyset$. We have that
\begin{eqnarray*}
X & = & f^{-1}\left([f(X)\cap U]\bigcup[f(X)\cap V]\right)\\
 & = & f^{-1}\left(f(X)\cap U\right)\bigcup f^{-1}\left(f(X)\cap V\right)\\
 & = & f^{-1}(U)\bigcup f^{-1}(V).
\end{eqnarray*}
That $f(X)\cap U$ and $f(X)\cap V$ are non-empty implies that $f^{-1}(U)$
and $f^{-1}(V)$ are non-empty. Finally,
\begin{eqnarray*}
\emptyset & = & f^{-1}\left([f(X)\cap U]\bigcap[f(X)\cap V]\right)\\
 & = & f^{-1}(U)\bigcap f^{-1}(V).
\end{eqnarray*}
This shows that $X$ can be written as a disjoint union of two non-empty
open sets, which is a contradiction.

Proposition 2: Let $X$ be a topological space. Then the following
are equivalent:
(a) $X$ is connected.
(b) If $f:X\rightarrow\{0,1\}$ is continuous, then $f$ is a constant
function.
Proof of Proposition 2: $(a)\Rightarrow(b)$: Suppose that $X$ is
connected. Let $f:X\rightarrow\{0,1\}$ be a continuous function.
By Proposition 1, $f(X)$ is a non-empty connected set. Note that
non-empty connected subsets of $\{0,1\}$ are $\{0\}$ and $\{1\}$.
Hence, $f(X)=\{0\}$ or $f(X)=\{1\}$. In another word, $f$ is a
constant function.
$(b)\Rightarrow(a)$: Prove by contradiction. Suppose that $X$ is
disconnected. Choose non-empty open sets $U,V$ such that $U\cup V=X$
and $U\cap V=\emptyset$. Define $f:X\rightarrow\{0,1\}$ by $f(x)=\begin{cases}
0, & \mbox{ if }x\in U\\
1, & \mbox{ if }x\in V
\end{cases}.$ It is trivial to verify that $f$ is continuous but $f$ is not a
constant function. A contradiction!

Proposition 3: Let $X$ be a topological space. Let $\{A_{i}\mid i\in I\}$
be a family of connected sets such that for any $i_{1},i_{2}\in I$,
there exists a fintie sequence $(j_{k})_{k=1}^{n}$ in $I$ such that
$j_{0}=i_{1}$, $j_{n}=i_{2}$ and $A_{j_{k-1}}\cap A_{j_{k}}\neq\emptyset$
for $k=1,\ldots,n$. Then $A=\cup_{i\in I}A_{i}$ is connected.
Proof of Proposition 3: Let $f:A\rightarrow\{0,1\}$ be a continuous
function. For each $i\in I$, let $f_{i}=f\mid_{A_{i}}$, the restriction
of $f$ on $A_{i}$, which is continuous with respect to the relative
topology. By Proposition 2, $f_{i}$ is a constant function. Let $x,y\in A$
be arbitrary. Choose $i_{1},i_{2}\in I$ such that $x\in A_{i_{1}}$
and $y\in A_{i_{2}}$. By assumption, we may choose a sequence $(j_{k})_{k=0}^{n}$
such that $j_{0}=i_{1}$, $j_{n}=i_{2}$ and $A_{j_{k-1}}\cap A_{j_{k}}\neq\emptyset$
for $k=1,\ldots,n$. For each $k$, choose $z_{k}\in A_{j_{k-1}}\cap A_{j_{k}}.$
We have that
\begin{eqnarray*}
 &  & f(x)\\
 & = & f_{j_{0}}(x)\\
 & = & f_{j_{0}}(z_{1})\\
 & = & f_{j_{1}}(z_{1})\\
 & = & f_{j_{1}}(z_{2})\\
 & = & f_{j_{2}}(z_{2})\\
 & = & \cdots\\
 & = & f_{j_{k}}(z_{k})\\
 & = & f_{j_{k}}(y)\\
 & = & f(y).
\end{eqnarray*}
This shows that $f$ is a constant function. By Proposition 2, $A$
is connected.

Proposition 4: Let $X,Y$ be topological spaces. If $X$ and $Y$
are connected, then $X\times Y$ is connected (with respect to the
product topology).
Proof: Let $f:X\times Y\rightarrow\{0,1\}$ be a continuous function.
Let $(x_{1},y_{1}),(x_{2},y_{2})\in X\times Y$ be arbitrary. We go
to show that $f(x_{1,}y_{1})=f(x_{2},y_{2})$. Define function $\iota_{y_{2}}:X\rightarrow X\times Y$
by $\iota_{y_{2}}(x)=(x,y_{2})$. Define function $\iota^{x_{1}}:Y\rightarrow X\times Y$
by $\iota^{x_{1}}(y)=(x_{1},y)$. Clearly $\iota_{y_{2}}$ and $\iota^{x_{1}}$
are continuous. Therefore $f\circ\iota_{y_{2}}:X\rightarrow\{0,1\}$
and $f\circ\iota^{x_{1}}:Y\rightarrow\{0,1\}$ are continuous. Since
$X$ and $Y$ are connected, by Proposition 2, $f\circ\iota_{y_{2}}$
and $f\circ\iota^{x_{1}}$ are constant functions. Therefore
\begin{eqnarray*}
f(x_{2},y_{2}) & = & f\circ\iota_{y_{2}}(x_{2})\\
 & = & f\circ\iota_{y_{2}}(x_{1})\\
 & = & f(x_{1},y_{2})\\
 & = & f\circ\iota^{x_{1}}(y_{2})\\
 & = & f\circ\iota^{x_{1}}(y_{1})\\
 & = & f(x_{1},y_{1}).
\end{eqnarray*}
It follows that $f$ is a constant function. By Proposition 2, $X\times Y$
is connected.

Definition 5: Let $X$ be a topological space. We say that $A\subseteq X$
is a connected component of $X$ if:
(a) $A$ is connected.
(b) If $B\subseteq X$ is connected and $A\subseteq B$, then $A\subseteq B$.

Proposition 6: Let $X$ be a non-empty topological space. Let $\mathcal{C}$
be the collection of all connected components of $X$. Then
(a) $\mathcal{C}$ is a partition of $X$, i.e., $X=\cup\mathcal{C}$
and $A\cap B=\emptyset$ whenever $A,B\in\mathcal{C}$ and $A\neq B$.
(b) For each $A\in\mathcal{C}$, $A$ is closed.
Proof of Proposition 6: Let $x\in X$. We show that $x$ is contained
in a connected component. Let $\mathcal{F}=\{A\subseteq X\mid x\in A\mbox{ and }A\mbox{ is connected.}\}.$ Note that $\{x\}\in\mathcal{F}$, so $\mathcal{F}$ is non-empty.
Clearly the condition in Proposition 3 is satisfied, so $A=\cup\mathcal{F}$
is a connected set. If $B\subseteq X$ is a connected and $A\subseteq B$,
then $x\in B$ and hence $B\in\mathcal{F}$. Therefore $B\subseteq\cup\mathcal{F}=A$,
so $A=B$. This shows that $A$ is a connected component. In particular,
we have proven that $\cup\mathcal{C}=X$. Next, let $A,B\in\mathcal{C}$
with $A\neq B$. Suppose the contrary that $A\cap B\neq\emptyset$.
Then $\{A,B\}$ satisfies the condition in Proposition 3, so $A\cup B$
is also a connected set. Clearly $A\subseteq A\cup B$. By maximality
of $A$, we have $A=A\cup B$. Similarily, $B\subseteq A\cup B\Rightarrow B=A\cup B$.
Therefore $A=B$, which is a contradiction. Finally, we go to show
that for each $A\in\mathcal{C}$, $A$ is closed. Prove by contradiction.
Assume that $A\neq\bar{A}$, then there exists $x\in\bar{A}\setminus A$.
Since $\mathcal{C}$ is a partition of $X$, there exists $B\in\mathcal{C}$
such that $x\in B$. Note that $A$ is a proper subset of $A\cup B$,
by maximality of $A$, $A\cup B$ must be disconnected. Choose open
subsets $U,V$ of $X$ such that $U\cap\left(A\cup B\right),$ $V\cap\left(A\cup B\right)$
are non-empty, disjoint, and whose union is $A\cup B$. Without loss
of generality, assume that $x\in V\cap(A\cup B)$. Observe that $U\cap A$,
$V\cap A$ are open in $A$, disjoint, and $\left(U\cap A\right)\cup\left(V\cap A\right)=A$.
Since $A$ is connected, we must have $U\cap A=\emptyset$ or $V\cap A=\emptyset$.
Note that $x\in V$ and $x\in\bar{A}$, so $V\cap A\neq\emptyset$.
It follows that $U\cap A=\emptyset$ and $A\subseteq V$. Now, $U\cap\left(A\cup B\right)=U\cap B$
and $V\cap\left(A\cup B\right)=A\cup(V\cap B)$. Therefore,
\begin{eqnarray*}
B & = & B\cap\left(A\cup B\right)\\
 & = & B\cap\left\{ \left[U\cap\left(A\cup B\right)\right]\cup\left[V\cap\left(A\cup B\right)\right]\right\} \\
 & = & B\cap\left\{ \left[U\cap B\right]\cup\left[A\cup(V\cap B)\right]\right\} \\
 & = & \left[U\cap B\right]\cup\left[V\cap B\right].
\end{eqnarray*}
Note that $U\cap B=U\cap\left(A\cup B\right)$ is non-empty, $V\cap B$
is also non-empty because it contains $x$. $U\cap B$ and $V\cap B$
are disjoint because $U\cap\left(A\cup B\right)$ and $V\cap\left(A\cup B\right)$
are disjoint. We arrive a contradiction because $B$ is connected.

Proposition 7: Let $X$ and $Y$ be connected topological spaces.
Let $A\subset X$ and $B\subset Y$ be proper subsets. Let $H=(X\times Y)\setminus(A\times B)$,
then $H$ is connected.
Proof of Proposition 7: Note that $H=(X\times B^{c})\bigcup(A^{c}\times Y)$.
Let $\mathcal{F}_{X}=\{C_{i}\mid i\in I\}$ be the family of non-empty
connected components of $A^{c}$ and $\mathcal{F}_{Y}=\{D_{j}\mid j\in J\}$
be the family of non-empty connected components of $B^{c}$. These
families are non-empty because $A^{c}$ and $B^{c}$ are non-empty sets.
Then $A^{c}=\cup_{i}C_{i}$ and $B^{c}=\cup_{j}D_{j}$. It follows
that
\begin{eqnarray*}
H & = & (X\times B^{c})\bigcup(A^{c}\times Y)\\
 & = & \cup_{j}(X\times D_{j})\bigcup\cup_{i}(C_{i}\times Y)\\
 & = & \cup\mathcal{G},
\end{eqnarray*}
where $\mathcal{G}=\{X\times D_{j}\mid j\in J\}\cup\{C_{i}\times Y\mid i\in I\}$.
By Proposition 4, each element in $\mathcal{G}$ is connected. We
go to check that $\mathcal{G}$ satisfies the condition in Proposition
3. Let $E_{1},E_{2}\in\mathcal{G}$. Consider the following few cases.
Case 1: $E_{1}=X\times D_{j_{1}}$ and $E_{2}=X\times D_{j_{2}}$
for some $j_{1},j_{2}\in J$. Choose any $i\in I$. Note that $(X\times D_{j_{1}})\cap(C_{i}\times Y)=C_{i}\times D_{j_{1}}\neq\emptyset$
and $(C_{i}\times Y)\cap(X\times D_{j_{2}})=C_{i}\times D_{j_{2}}\neq\emptyset$.
Case 2: $E_{2}=C_{i_{1}}\times Y$ and $E_{2}=C_{i_{2}}\times Y$
for some $i_{1},i_{2}\in I$. This case can be treated similarly as
Case 1.
Case 3: $E_{1}=X\times D_{j}$ and $E_{2}=C_{i}\times Y$. Note that
$E_{1}\cap E_{2}=C_{i}\times D_{j}\neq\emptyset$.
By Proposition 3, $H=\mathcal{\cup G}$ is connected.

We remark that Proposition 4 can be generalized for arbitrary product.
Theorem 8: Let $I$ be a non-empty index set (which may be uncountable).
Let $\{X_{i}\mid i\in I\}$ be a family of connected topological spaces.
Let $X=\prod_{i\in I}X_{i}$, equipped with product topology. Then
$X$ is connected.
Proof of Theorem 8: Prove by contradiction. Suppose the contrary that
$X$ is disconnected. By Proposition 2, there exists a non-constant
continuous function $f:X\rightarrow\{0,1\}$. Let $U=f^{-1}(\{0\})$
and $V=f^{-1}(\{1\})$, which are non-empty, disjoint open subsets
of $X$. Choose non-empty open sets $U_{i}\subseteq X_{i}$ such that
$\prod_{i}U_{i}\subseteq U$ and $U_{i}=X_{i}$ except finitely many
$i$. Similarly, we can choose non-empty open sets $V_{i}\subseteq X_{i}$
such that $\prod_{i}V_{i}\subseteq V$ and $V_{i}=X_{i}$ except finitely
many $i$. Let $I_{0}\subseteq I$ be a finite set such that $U_{i}=V_{i}=X_{i}$
for all $i\in I\setminus I_{0}$. For each $i\in I\setminus I_{0}$, fix $a_{i}\in X_{i}$. Observe
that $\prod_{i\in I_{0}}U_{i}$ and $\prod_{i\in I_{0}}V_{i}$ are
non-empty. Choose $u'\in\prod_{i\in I_{0}}U_{i}$ and $v'\in\prod_{i\in I_{0}}V_{i}$.
Define $u\in X$ by $u(i)=\begin{cases}
u'(i), & \mbox{ if }i\in I_{0}\\
a_{i}, & \mbox{ if }i\in I\setminus I_{0}
\end{cases}.$ Define $v\in X$ by $v(i)=\begin{cases}
v'(i), & \mbox{if }i\in I_{0}\\
a_{i}, & \mbox{if }i\in I\setminus I_{0}
\end{cases}.$ Then, $u\in\prod_{i\in I}U_{i}$ and $v\in\prod_{i\in I}V_{i}$.
In particular $f(u)=0$ and $f(v)=1$. Define $X'=\prod_{i\in I_{0}}X_{i}$.
Define a map $\theta:X'\rightarrow X$ by $\theta(x')(i)=\begin{cases}
x'(i), & \mbox{if }i\in I_{0}\\
a_{i}, & \mbox{if }i\in I\setminus I_{0}
\end{cases},$ $x'\in X'$. Note that $\theta$ is continuous because for each $i\in I$, $\pi_{i}\circ\theta=\begin{cases}
\pi'_{i}, & \mbox{if }i\in I_{0}\\
\bar{a}_{i}, & \mbox{if }i\in I\setminus I_{0}
\end{cases}$ is continuous, where $\pi_{i}:X\rightarrow X_{i}$, $\pi_{i}':X'\rightarrow X_{i}$
are canonical projections while $\bar{a}_i:X'\rightarrow X_{i}$
is the constant function: $x'\mapsto a_{i}$, $x'\in X'$. Therefore
$f\circ\theta:X'\rightarrow\{0,1\}$ is continuous. Note that $X'$,
being a finite product of connected spaces, is connected. Therefore
$f\circ\theta$ is a constant function. On the other hand, $0=f(u)=f\circ\theta(u')=f\circ\theta(v')=f(v)=1$,
which is a contradiction.
