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

elementary-set-theorylogicproof-verification

In this exercise sheet (German) there is the following problem: Prove that $(A \cup B) \setminus (A \cap B) = (A \setminus B) \cup (B \setminus A)$. There is a solution shown below (und means and, oder means or).

Screenshot

I don't understand how the transition from

$x\in (A\cup B) \wedge x\notin(A\cap B)$ (item 1 above)

to

$(x \in A \wedge x \notin B) \vee (x \in B \wedge x \notin A)$ (item 2)

is made.

The only thing that comes to mind is De Morgan's law. Then

$x\in (A\cup B) \wedge x\notin(A\cap B) \iff \neg (x \in A \wedge x\notin B) \vee \neg (x \notin (A \cap B))$
$x\in (A\cup B) \wedge x\notin(A\cap B) \iff \neg (x \in A \wedge x\notin B) \vee (x \in (A \cap B))$
$x\in (A\cup B) \wedge x\notin(A\cap B) \iff \neg (x \in A \wedge x\notin B) \vee \neg(x \in A \wedge x \in B)$
$x\in (A\cup B) \wedge x\notin(A\cap B) \iff \neg (x \in A \wedge x\notin B) \vee (x \notin A \vee x \notin B)$
$x\in (A\cup B) \wedge x\notin(A\cap B) \iff \neg (x \in A \wedge x\notin B) \vee (x \notin A \vee x \notin B)$
$x\in (A\cup B) \wedge x\notin(A\cap B) \iff \neg (x \in A \wedge x\notin B) \vee (x \notin A \vee x \notin B)$
$x\in (A\cup B) \wedge x\notin(A\cap B) \iff (x \notin A \vee x\in B) \vee (x \notin A \vee x \notin B)$
$x\in (A\cup B) \wedge x\notin(A\cap B) \iff x \notin A \vee x\in B \vee x \notin A \vee x \notin B$

The problem is that I have two $x\notin A$, whereas in the solution from the exercise there is one $x\in A$ and one $x\notin A$.

Where exactly did I make a mistake?

Best Answer

This would be one way of proving it:

$$x\in (A\cup B) \wedge x\notin(A\cap B)$$

$$\iff (x\in A\lor x\in B)\land \neg(x\in A\land x\in B)$$

$$\iff(x\in A\lor x\in B)\land(x\notin A\lor x\notin B)$$

$$\iff[(x\in A\lor x\in B)\land(x\notin A)]\lor[(x\in A\lor x\in B)\land(x\notin B)]$$

$$\iff(x\in A\land x\notin A)\lor(x\in B\land x\notin A)\lor (x\in A\land x\notin B)\lor(x\in B\land x\notin B)$$

$$\iff (x\in B\land x\notin A)\lor (x\in A\land x\notin B)$$

And, to continue:

$$\iff (x\in B\setminus A)\lor (x\in A\setminus B)$$

$$\iff x\in (B\setminus A)\cup(A\setminus B)$$

Related Question