# Show that $A\setminus (B\setminus C)=(A\setminus B)\cup(A\cap B\cap C)$

I'm having difficulty showing this equality (assuming that the question doesn't have a typo).. I've tried in both directions and I can't seem to get what I need.

\begin{align} A\setminus (B\setminus C)&=A\cap\overline{(B\cap \overline{C})}\\ &=A\cap(\overline{B}\cup C)\\ &=(A\cap \overline{B})\cup(A\cap C)\\ &=(A\setminus B)\cup (A\cap C) \end{align}

And in the other direction (A bit more convoluted):

\begin{align} (A\setminus B)\cup (A\cap B\cap C)&=(A\cap\overline{B})\cup(A\cap B\cap C)\\ &=[A\cup (A\cap \overline{B})]\cup [B\cup (A\cap \overline{B})]\cup [C\cup (A\cap \overline{B})]\\ &=[A\cup (A\cap \overline{B})]\cup [(B\cup A)\cap(B\cup\overline{B})]\cup [C\cup (A\cap \overline{B})]\\ &=[A\cup (A\cap \overline{B})]\cup [(B\cup A)\cap\mathcal{U}]\cup [C\cup (A\cap \overline{B})]\\ &=[A\cup (A\cap \overline{B})]\cup (B\cup A)\cup [C\cup (A\cap \overline{B})]\\ &=[(A\cap \overline{B})\cup (A\cap \overline{B})]\cup(A\cup A)\cup B\cup C\\ &=(A\setminus B)\cup A\cup B\cup C \end{align}

Both of these seem to be "close", but neither is the same, and neither quite get to the goal. Is there a flaw in my algebra? Or is this not even possible using this method?

Write $A\cap C = (A\cap B\cap C)\cup (A\cap \overline{B}\cap C)$ in the second-to-last last line of the first part:

\begin{align}A\setminus(B\setminus C)&=(A\cap \overline{B})\cup(A\cap C) =(A\cap \overline{B})\cup(A\cap \overline{B}\cap C)\cup(A\cap B\cap C) \end{align}

Then note that $$(A\cap \overline{B})\cup(A\cap \overline{B}\cap C)=A\cap \overline B.$$

You need $$X\cup (X\cap Y)= X\tag{1}$$$$X\cap(Y\cup\overline{Y})=X\tag{2}$$

You can prove (2) if you know that:

$$X\cup\overline{X} = Y\cup\overline{Y}\tag{3}$$ $$X\cap (X\cup Y)=X\tag{4}$$

Proof of $2$ using $3,4$:

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

• I vaguely recall this from some years ago -- what is this property/equality/law called? I'm referring to the addition of $B$ and $\overline{B}$ to both sides of a union – agent154 Sep 19 '15 at 17:15
• In general: $X = (X\cap B)\cup(X\cap \overline B)$. This follows because $X=X\cap (B\cup \overline{B})$, which is just saying that $B\cup\overline{B}$ is the entire universe. Not sure what that is called. – Thomas Andrews Sep 19 '15 at 17:19
• The second equality is that $X\cup(X\cap B)=X$. Again, not sure what that is called. – Thomas Andrews Sep 19 '15 at 17:21

Hint: Using $^c$ to denote complement, $$A\setminus\left(B\setminus C\right)=A\cap\left(B\cap C^{c}\right)^{c}=A\cap\left(B^{c}\cup C\right)=A\cap\left(B^{c}\cup\left(B\cap C\right)\right).$$