Differences of sets

discrete mathematicselementary-set-theory

I struggled proving the following propositions, I'd be glad if anyone could help:
$$ (X \cup Y)\setminus(Y \cap Z)=(X\setminus Y)\cup(Y \setminus Z)\\(X \cup Y)\setminus (Y\cup Z) = X \setminus (Y \cup Z)$$

I shall mention my approach was working cases, along the lines of "if x $\in X $, then…". Though I couldn't work these specific two arguments.

EDIT: I'm asking for the proof. I already validated the arguments using Venn diagrams. If someone can post a proof using algebra of sets I'd apprieciate it.

Best Answer

Notice, $A=B ⇔ ((\forall x \in A ⇒x\in B) \land (\forall x \in B⇒x\in A))$. Looking at the definition you can notice that the right hand side is nothing but two two directions of subset. Therefore, suppose $A, B$ are two sets, then to show $A=B$ it suffices to show $(A \subseteq B) \land (B \subseteq A)$.

Now, In order to show $A\subseteq B$. Assume an arbitrary $x \in A$, then show $x\in B$.

I will show one direction of subset for the first one, the other is quite similar I hope you will be able to do it.

Suppose $x\in ((X\cup Y)\setminus(Y\cap Z))$. Then, $(x\in X \lor x\in Y) \land (x\notin Y\land x\notin Z)$

As you can see, the above atomics follow from the definition of union, intersection, and difference. Since $(x\in X \lor x\in Y) \land (x\notin Y\land x\notin Z)$, then $((x\in X\land x\notin Y)\lor (x\in Y\land x\notin Z))$. I got these by De Morgan distribution.

Finally, Translate the definitions into the respective symbol:$((x\in X\land x\notin Y)\lor (x\in Y\land x\notin Z))≡x\in ((X\setminus Y)\lor (Y\setminus Z))$

Which implies: $x\in ((X\setminus Y)\cup(Y\setminus Z))$.

Therefore, $((X\cup Y)\setminus (Y\cap Z))\subseteq ((X\setminus Y)\cup(Y\setminus Z))$


Here is another proof with additional explanations

Show that $(X\cup Y)\setminus (Y\cap Z)=(X\setminus Y)\cup(Y\setminus Z)$

Suppose: $$x\in (X\cup Y)\land x\notin (Y\cup Z)$$ Above supposition follows from the definition of difference.$$x\in(X\cup Y)\rightarrow (x\in X \lor x\in Y)\land x\notin (Y\cap Z)\rightarrow (x\notin Y \lor x\notin Z)$$$$Supp. x\in X \land x\notin Y\rightarrow x\in(X\setminus Y)(a)$$$$Supp.x\in X\land x\notin Z\rightarrow x\in(X\setminus Z)(b)$$$$Supp.x\in Y\land x\notin Y\rightarrow \bot$$$$Supp.x\in Y \land x\notin Z \rightarrow x\in (Y\setminus Z)(c)$$

Therefore, from a and c, $$x\in (X\setminus Y)\cup (Y\cap Z)\rightarrow (X\cup Y)\setminus (Y\cap Z)\subseteq(X\setminus Y)\cup(Y\setminus Z)$$

The other direction of subset is very similar to this one, hopefully you can do it.