In Bert Mendelson's Introduction to Topology, the first exercise of Ch. 1 Sec. 5 states:
Let $X\subset A$ and $Y\subset B$. Prove that $$C(X\times Y)=A\times C(Y)\cup C(X) \times B.$$
I have seen a "proof" of this, but I remain unsatisfied with the result. As support, I offer the following as a counterexample.
Let $A=\{-1,0,1\}=B$. Also let $X=\{0,1\}$ and $Y=\{-1,0\}$. These satisfy the preconditions. Now, is it true that
$$(\{0,1\}\times \{-1,0\})^C=\{-1,0,1\}\times \{-1,0\} \cup \{0,1\}^C\times \{-1,0,1\}.$$
It is easy enough to see that $X\times Y=\{(0,0),(0,-1),(1,0),(1,-1)\}$. The complement* would then be anything not in this set, for example $(2,2)$. However, certainly $(2,2)$ is in neither $\{-1,0,1\}\times \{-1,0\}$ nor $\{0,1\}^C\times \{-1,0,1\}$.
(*Is this definition of complement correct?)
Is there some underlying assumption of which I should be aware? Is staying within the bounds of the parent sets a standard practice? Is my counterexample unreasonable? Please advise.
In this context it is understood that the complement of $Y$ is taken with respect to the containing set $A$, the complement of $X$ is taken with respect to the containing set $B$, and the complement of $X\times Y$ is taken with respect to the containing set $A\times B$. Thus, the complement of $X$ is $\{-1\}$, the complement of $Y$ is $\{1\}$, and the complement of $X\times Y$ is
$$\{\langle -1,-1\rangle,\langle -1,0\rangle,\langle -1,1\rangle,\langle 0,1\rangle,\langle 1,1\rangle\}\;,$$
which is indeed equal to
$$\big(\{-1,0,1\}\times\{1\}\big)\cup\big(\{-1\}\times\{-1,0,1\}\big)\;.$$