[Math] Prove that $(X \cap Y) \cup Z = (X \cup Z) \cap (Y \cup Z)$

elementary-set-theory

I've only the definition of union, intersection, subset, and complement available to me.

$$(X \cap Y) \cup Z = (X \cup Z) \cap (Y \cup Z)$$

$(X \cap Y) = \left\{a: a \in X, ~ a \in Y\right\}$

$$\begin{eqnarray}
(X \cap Y) \cup Z &=& \left\{a: a \in X ~ \text{or} ~ a \in Y\right\} \cup \left\{a: a \in Z\right\}\\
&=& \left\{a: a \in X ~ \text{or} ~ a \in Y, ~ \text{and} ~ a \in Z \right\} \tag1 \\
&=& \left\{a: a \in X~ \text{and} ~ a \in Z, ~ \text{or}, ~ a \in Y ~ \text{and} ~ a \in Z \right\} \tag2\\
&=&\left\{a: a \in X~ \text{and} ~ a \in Z\right\} \cap \left\{a: ~ a \in Y ~ \text{and} ~ a \in Z \right\}\tag3\\
&=& (X \cup Z) \cap (Y \cup Z)\tag4
\end{eqnarray}$$

I numbered those last few lines to make it easier to point out my blunders. I've never proven anything with sets before, so it probably doesn't make any sense. Many thanks in advance.

Best Answer

This is in essence what you have, just with the and and the or changed. Note that Union coincides with "or" and Intersection coincides with "and." $(X \cap Y) \cup Z = (X \cup Z) \cap (Y \cup Z)$.

$(X \cap Y) = \left\{a: a \in X, ~ a \in Y\right\}$

$(X \cap Y) \cup Z = \left\{a: a \in X ~ \text{and} ~ a \in Y\right\} \cup \left\{a: a \in Z\right\}$

1.................... $ = \left\{a: (a \in X ~ \text{and} ~ a \in Y), ~ \text{or} ~ a \in Z \right\} $

2.................... $= \left\{a: (a \in X~ \text{or} ~ a \in Z), ~ \text{and}, ~ (a \in Y ~ \text{or} ~ a \in Z) \right\}$

3.................... $= \left\{a: (a \in X~ \text{or} ~ a \in Z\right\} \cap \left\{a: ~ a \in Y ~ \text{or} ~ a \in Z \right\}$

4.................... $= (X \cup Z) \cap (Y \cup Z)$