# Prove a set is connected

Let $A$ be a proper subset of $X$ and $B$ be a proper subset of $Y$ where $X$ and $Y$ are connected and prove that $$X\times Y-A\times B$$ is connected.

Suppose $X\times Y-A\times B$ can be written as union of two disjoint open sets,$U\cup V$,I think we can derive that either $A$ or $B$ is improper which is contradiction. But I don't know how to approach that result.

• Are $X,Y$ connected? – b00n heT Oct 18 '16 at 11:37
• I'm sorry I made a mistake.$X$ and $Y$ are both connected. – mike Oct 18 '16 at 12:13

Let $f:X\times Y-A\times B\rightarrow \{0,1\}$ be a continuous function. Consider $x\in X-A$, the restriction of $f$ to $x\times Y$ is constant since $Y$ is connected. Suppose that this restriction is the constant function $0$. Let $y$ be an element of $Y-B$, $f((x,y))=0$. The restriction of $f$ to $X\times y$ is constant since $X$ is connected, we deduce that for every $x'\in X$, $f(x',y)=f(x,y)=0$. This implies that the restriction of $f$ to $X\times (Y-B)$ is $0$.
A similar argument shows that the restriction of $f$ to $(X-A)\times Y$ is constant. Since $A$ and $B$ are proper subsets, $((X-A)\times Y)\cap (X\times (Y-B))$ is not empty. This implies that the restriction of $f$ to $((X-A)\times Y)\bigcup (X\times (Y-B))=X\times Y-A\times B$ is constant. We deduce that $X\times Y-A\times B$ is connected.