Can I apply the cartesian product definition in the following way? For instance, in the proof below I go from "$x\in A_i \cap B_j$, for some $(i,j)\in I\times J$" to "$x\in A_i \cap B_j$, for some $i\in I$ and $j\in J$", and vice versa.
"$\bigcup_{(i,j)\in I\times J} (A_i \cap B_j) = (\bigcup_{i\in I} A_i) \cap (\bigcup_{j\in J} B_j)$"
Proof.
"$\subseteq$" Let $x \in \bigcup_{(i,j)\in I\times J} (A_i \cap B_j)$, then $x\in A_i \cap B_j$, for some $(i,j)\in I\times J$. Therefore $x\in A_i \wedge x\in B_j$, for some $i\in I$ and $j\in J$. By definition of union, $x\in \bigcup_{i\in I} A_i \wedge x\in \bigcup_{j\in J} B_j$. Then $x\in \bigcup_{i\in I} A_i \cap \bigcup_{j\in J} B_j$.
"$\supseteq$" Suppose $x\in \bigcup_{i\in I} A_i \cap \bigcup_{j\in J} B_j$, then $x\in \bigcup_{i\in I} A_i \wedge x\in \bigcup_{j\in J} B_j \Rightarrow x\in A_i \wedge x\in B_j$, for some $i\in I$ and $j\in J$. Consequently, $x\in A_i \cap B_j$, for some $i\in I$ and $j\in J$. Thus, $x\in A_i \cap B_j$, for some $(i,j)\in I\times J$. Which implies that $x\in \bigcup_{(i,j)\in I\times J} (A_i \cap B_j). \Box$
Also, if you have any suggestion of improvement, or you catch an error in the proof, please let me know. Thank you.