Show generalized distributivity law for sets I want to prove that $\cap_{i=1}^{\infty}\left(A_i \cap \left(\cup_{j=1}^{\infty}B_j\right)\right)=\cup_{j=1}^{\infty}\left(\left(\cap_{i=1}^{\infty}A_i\right) \cap B_j\right)$ for sets $A_i,B_j$ and natural numbers $i,j$. If an element $x$ belongs to the left hand side, then $x\in A_1$ and $x\in$ some of $B_j$ and $x\in A_2$ and $x\in$ some of $B_j$ and so forth. Then $x\in A_1$, $x\in A_2$, $x\in A_3$ etc so $x \in  \cap_{i=1}^{\infty}A_i$ but I don't see how I can proceed with the B:s and get to $x \in B_1$ and $x\in$ all $A_i$ or $x \in B_2$ and $x\in$ all $A_i$ or $x \in B_3$ and $x\in$ all $A_i$ and so forth.
 A: Here is a way to systematically calculate which elements $\;x\;$ are in both sides of this equality, just by expanding the definitions and simplifying.$
\newcommand{\calc}{\begin{align} \quad &}
\newcommand{\op}[1]{\\ #1 \quad & \quad \unicode{x201c}}
\newcommand{\hints}[1]{\mbox{#1} \\ \quad & \quad \phantom{\unicode{x201c}} }
\newcommand{\hint}[1]{\mbox{#1} \unicode{x201d} \\ \quad & }
\newcommand{\endcalc}{\end{align}}
\newcommand{\Ref}[1]{\text{(#1)}}
\newcommand{\then}{\Rightarrow}
\newcommand{\when}{\Leftarrow}
\newcommand{\true}{\text{true}}
\newcommand{\false}{\text{false}}
$
For the left hand side, we calculate as follows:
$$\calc
    x \in \bigcap_{i=1}^{\infty}\left(A_i \cap \left(\bigcup_{j=1}^{\infty}B_j\right)\right)
\op\equiv\hint{definition of $\;\bigcap\;$}
    \langle \forall i : i \ge 1 : x \in A_i \cap \left(\bigcup_{j=1}^{\infty}B_j\right) \rangle
\op\equiv\hint{definition of $\;\cap\;$}
    \langle \forall i : i \ge 1 : x \in A_i \;\land\; x \in \bigcup_{j=1}^{\infty}B_j \rangle
\op\equiv\hint{definition of $\;\bigcup\;$}
    \langle \forall i : i \ge 1 : x \in A_i \;\land\; \langle \exists j : j \ge 1 : x \in B_j \rangle \rangle
\op\equiv\hints{logic: $\;{}\land\phi\;$ distributes over $\;\forall i\;$, for $\;\phi\;$ not containing $\;i\;$}\hint{-- to separate unrelated parts}
    \langle \forall i : i \ge 1 : x \in A_i \rangle \;\land\; \langle \exists j : j \ge 1 : x \in B_j \rangle
    \tag{*}
\endcalc$$
Now do the same with the right hand side, and observe that the result is also $\Ref{*}$.
In other words, both sides contain exactly the same $\;x\;$, and therefore by set extensionality they are equal.
A: If $x$ is in the set on the left, then $x\in A_i$ for all indices $i$, and $x\in B_j$ for some index $j$.  That would imply that
$$x\in B_j \cap \bigcap_{i=1}^\infty A_i,$$
(again, just for a single index $j$.)
Fortunately, we only need it to be true for a single $j$, because that implies that
$$ x \in \bigcup_{j=1}^\infty( B_j \cap  \bigcap_{i=1}^\infty A_i).$$
All the statements are biconditional, so the sets are equal.
A: For any sets $I,J$ let $A=\cap_{i\in I}A_i,\; B=\cup_{j\in J}B_j,\;C=\cap_{i\in I}(A_i\cap B),\; D=\cup_{j\in J}(A\cap B_j).$
If $I\ne \emptyset$ then for any $x$ we have $$x\in C\iff \forall i\in I\;(x\in A_i\land x\in B)\iff$$  $$\exists j\in J\; (\;x\in B_j\land (\forall i\in I\;(x\in A_i))\;)\iff$$ $$ \exists j\in J\;(x\in B_j\land x\in A)\iff$$ $$  \exists j\in J\;(x\in A \cap B_j)\iff$$ $$  x\in \cup_{j\in J}(A\cap B_j)=D.$$
If $I=\emptyset$ then by def'n, $A= C=\emptyset$ and also $A\cap B_j=\emptyset$ for every $j\in J,$ so $D=\cup_{j\in J}\emptyset=\emptyset =C.$ 
Note: We cannot write $x\in \cap_{f\in F}\iff \forall f\in F\;(x\in f)$ when $F$ is empty, as then we would have $x\not \in \cap_{f\in F}\iff \exists f\in F\; (x\not \in f),$ but since there does not exist any $f\in F,$ this would imply that NO $x$ fails to belong to $\cap_{f\in F}f,$ which would be inconvenient. So we define $\cap_{f\in \emptyset}f=\emptyset.$
