finding counterexample for identity of sets Let $A_i,B_i,C_j,D_j$ be sets.
I am wondering if the equation $$\bigcup_{i\in I}(A_i\times B_i) \cap \bigcup_{j\in J}(C_j\times D_j)=\bigcup_{i\in I,j\in J}(A_i\cap C_j)\times (B_i\cap D_j) $$ holds.
I am looking for a counterexample for $I=\{1,2\}$ and $J=\{1,2\}$ but having troubles to find one in e.g. $\mathbb R^2$.
Anybody an idea?
 A: The identity always holds. In fact, consider the identity:

$$\bigcup_{i\in I} X_i\cap\bigcup_{j\in J} Y_j=\bigcup\limits_{i\in I,j\in J} X_i\cap Y_j$$

Proof:
$$\bigcup_{i\in I} X_i\cap\bigcup_{j\in J} Y_j=\left\{u\,:\, (\exists i\in I\,\ u\in X_i)\wedge (\exists j\in J\,\ u\in Y_j)\right\}$$
So $\bigcup\limits_{i\in I} X_i\cap\bigcup\limits_{j\in J} Y_j\subseteq \bigcup\limits_{i\in I,j\in J} X_i\cap Y_j$
But clearly $\bigcup\limits_{i\in I,j\in J} X_i\cap Y_j\subseteq \bigcup\limits_{i\in I} X_i\cap\bigcup\limits_{j\in J} Y_j$ because the LHS is clearly contained in both the sets you are intersecting.

Moreover, this identiy holds

$$(A\times B)\cap (C\times D)=(A\cap C)\times (B\cap D)$$

Setting $X_i=A_i\times B_i$ and $Y_j=C_j\times B_j$ you obtain the equality.
A: If a pair $(x,y)$ belongs to the left-hand side set, then $(x,y)\in A_i\times B_i$ and $(x,y)\in C_j\times D_j$, for some $i$ and $j$.
In particular $x\in A_i\cap C_j$ and $y\in B_i\cap D_j$, so the pair also belongs to the right-hand side set.
Suppose $(x,y)$ belongs to the right-hand side set. Then, for some $i$ and $j$, $(x,y)\in (A_i\cap C_j)\times(B_i\cap D_j)$. In particular, $x\in A_i\cap C_j$ and $y\in B_i\cap D_j$. Therefore 
$$
(x,y)\in (A_i\times B_i)\cap(C_j\times D_j)
$$
