Prove $A = (A \setminus B) \cup (A \cap B)$

Solution 1:

The usual way to prove that two sets are equal is by element-chasing: Choose an arbitrary element of one set and show it's in the other, and then do it again in the opposite direction.

So for example, suppose $x \in A$. If $x \in B$, then $x \in A \cap B$ and we're done; if $x \notin B$, then $x \in A \setminus B$ and we're again done.

Now suppose $x \in (A \setminus B) \cup (A \cap B)$, and prove that $x \in A$.

Solution 2:

For completeness's sake, here is a proof using just the rules of Boolean algebra. Let $U$ be the universal set. Then:

$$A = A\cap U = A \cap (\overline B \cup B) = (A \cap \overline B) \cup (A \cap B) = (A \setminus B) \cup (A \cap B) $$