What's wrong in this proof of $\partial(A\times B)=(\partial A\times\overline B)\cup (\overline A\times \partial B)$? I'm trying to prove the well-known identity
$$ \partial(A\times B)=(\partial A\times\overline B)\cup (\overline A\times \partial B), $$
where $A\subset X$ and $B\subset Y$. I have already shown the inclusion '$\supset$'. For the other inclusion, I have written the following:

Let $(x,y)\in \partial(A\times B)$ and assume to the contrary that $(x,y)\notin \partial A\times \overline B$ and $(x,y)\notin \overline A\times \partial B$. Since $(x,y)$ is a boundary point, $(U\times V)\cap (A\times B)\neq\emptyset$ for every open neighborhood $U\times V\ni (x,y)$. However, this means that $U\cap A\neq\emptyset$ for every open $U\ni x$. This implies that $x\in\overline A$, which is a contradiction, since $(x,y)\notin \overline A\times\partial B$.

The problem here is that I only used part of the antithesis, namely that $(x,y)\notin \overline A\times\partial B$. I could replicate the above "proof" to show that $\partial(A\times B)\subset \overline A\times\partial B$, which is simply not true. Something's amiss here, but I can't figure out what. All I can think of is that the antithesis is wrong, that there should be an 'or' instead of an 'and', but I can't see why this should be so.
 A: The mistake is that $x \in \overline{A}$ does not contradict $(x,y) \notin \overline{A} \times \partial B$.  However, from $x \in \overline{A}$ and $(x,y) \notin \overline{A} \times \partial B$ you can conclude that $y \notin \partial B$.  Can you continue from there?
A: Using the fact that

*

*$\overline{A\times B}^{X\times Y}=\overline{A}^X\times\overline{B}^Y$ (we remove the superscript for convenience),

*$\overline{U\cup V}=\overline{U}\cup \overline{V}$ for any sets $U$, $V$ in a topological space,

*$(X\times Y)\setminus(A\times B)= ((X\setminus A)\times B)\cup (A\times(Y\setminus B))\cup ((X\setminus A)\times(Y\setminus B)$ (we will use the complement operator $c$ for convenience), and

*$(A\times B)\cap (C\times D)=(A\cap C)\times (B\cap D)$ for all sets $A,C\subset X$ and $B,D\subset Y$,

one can develop a direct proof of the statement from the definition of boundary:
$$\begin{align}
\partial(A\times B)&=\overline{A\times B}\cap \overline{(X\times Y) \setminus (A\times B)}\\
&=\big(\overline{A}\times \overline{B}\big)\cap\overline{\big(((X\setminus A)\times B)\cup (A\times (Y\setminus B)) \cup ((X\setminus A) \times (Y\setminus B))\big)}\\
&=(\overline{A}\times \overline{B}) \cap \big((\overline{A^c}\times \overline{B}) \cup(\overline{A}\times \overline{B^c})\cup(\overline{A^c}\times\overline{B^c}\big)\\
&=((\overline{A}\cap\overline{A^c})\times\overline{B})\cup(\overline{A}\times(\overline{B}\cap\overline{B^c}))\cup((\overline{A}\cap\overline{A^c})\times(\overline{B}\cap\overline{B^c}))\\
&=(\partial A\times\overline{B})\cup(\overline{A}\times\partial{B})\cup(\partial{A}\times\partial{B})=(\partial A\times\overline{B})\cup(\overline{A}\times\partial{B})
\end{align}
$$
