# Finding a condition to relate union of infinite cartesian products and infinite cartesian products of unions

Let $A = A_1\times A_2 \times \cdots$ and $B = B_1\times B_2 \times \cdots$. I've been trying to find an if and only if condition for equality of the sets $$\prod_{Z}A_i\cup B_i$$ and $$A\cup B.$$ Intuitively, I can imagine it as being if one of the 'cross terms', where a cross term is any cartesian product involving both $A_i$s and $B_j$s, is not contained in $A$ or $B$. I feel as though there's a simpler way to express this though. One idea is that the condition is, for any $i\neq j$, $A_i\times B_j \subseteq (A_i\times A_j) \cup (B_i \times B_j)$. Is there an easier one? Thanks for your help everyone!

Look at a simple case first.

If $(x,y) \in (A_1 \cup B_1) \times (A_2 \cup B_2)$ then $x \in A_1$ or $B_1$ and $y \in A_2$ or $B_2$, and there is no dependence between $x$ and $y$. Thus $$(A_1 \cup B_1) \times (A_2 \cup B_2) = (A_1 \times A_2) \cup (A_1 \times B_2) \cup (B_1 \times A_2) \cup (B_1 \times B_2)$$

Can you spot a pattern here? Can you guess what an expression for $$\prod_{i=1}^n (A_i \cup B_i)$$ might look like? How about an infinite product?

[For the sake of finding a general expression, you might find it convenient to write something like $A_i^1 \cup A_i^2$ instead of $A_i \cup B_i$.]