Prove that $(X \cap Y) \cup Z = (X \cup Z) \cap (Y \cup Z)$ 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. 
 A: Looks okay, but you've swapped and and or. Remember that:
$A \cap B$ is the set of elements that are in $A$ and $B$. If $x \in A \cap B$, then $x \in A$ and $x \in B$.
$A \cap B$ is the set of elements that are in $A$ or $B$. If $x \in A \cap B$, then $x \in A$ and $x \in B$.
Note that this means that intersection is a subset of union: If $x \in A \cap B$, then $x \in A \cup B$, because if ($x \in A$ and $ x \in B$) holds, then $(x \in A$ or $x \in B$) also holds.
A: 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)$
