# simple proof for logical formula

I am stuck in this proof, I am given:

$$A\setminus(B\setminus(C\setminus D)) = (A\cup C)\setminus (B\cup D)$$. I did this, but cannot come to solution where i can say, this is true or not.

$A\setminus(B\setminus(C\setminus D)) \Leftrightarrow x\in(A\setminus(B\setminus(C\setminus D))) \Leftrightarrow x\in A \land x\notin(B\setminus(C\setminus D)) \Leftrightarrow x\in A \land x\notin B \land \neg(x\notin(C\setminus D)) \Leftrightarrow x\in A \land x\notin B \land \neg(x\notin C \land \neg(x\notin D) ) \Leftrightarrow x\in A \land x\notin B \land x\in C \lor x\notin D \Leftrightarrow ...???$

Something is odd. If you put A,B,D = $\emptyset$, $C = \Omega$, LHS is empty but RHS is not. – Gautam Shenoy Apr 28 '13 at 17:06
You've made some errors in your logic. Be careful writing things like $X \not \in Y$, because it's really shorthand for $\neg ( X \in Y )$. When you expanded your brackets, because you worked outside-in, what you ended up doing essentially is putting the closing bracket too soon. For instance, you wrote $$x \in A \wedge x \not \in (B \setminus (C \setminus D)) \Leftrightarrow x \in A \wedge x \not \in B \wedge \neg (x \not \in C \setminus D)$$ This is false. In fact you should have written $$x \in A \wedge x \not \in (B \setminus (C \setminus D)) \Leftrightarrow x \in A \wedge \neg(x \in B \wedge (x \not \in C \setminus D))$$ These are not equivalent. Expanded further, the RHS of the latter is $$x \in A \wedge (x \not \in B \vee (x \in C \setminus D))$$ by de Morgan's law.