# Prove that $(X \setminus Y)\cap Z=Z \setminus(Y \cap Z)$ where $Y,Z$ are subsets of $X$.

The problem I am given is:

Let $Y$ and $Z$ be subsets of $X$. Prove that

$(X \setminus Y)\cap Z=Z \setminus(Y \cap Z)$

Things I have tried:

1. Drew pictures.

2. Looked up how to show set equality and it said the standard way is to show that each side is a subset of the other. The source I have been using is: https://www.people.vcu.edu/~rhammack/BookOfProof/SetProofs.pdf

Proof:

We must show that:

1. $(X \setminus Y)\cap Z \subset Z \setminus(Y \cap Z)$

2. $Z \setminus(Y \cap Z) \subset (X \setminus Y)\cap Z$

First, showing that $(X \setminus Y)\cap Z \subset Z \setminus(Y \cap Z)$:

Suppose $x \in \left( (X \setminus Y) \cap Z\right)$.

Then $x \in X, x \notin Y,$ and $x \in Z$. (This is where I get stuck. Not sure what to do next.)

• One thing that may help: $Z\setminus (Y\cap Z)=Z\setminus Y$. – Clayton Jan 19 '18 at 19:18
• @Clayton , How do you know that $Z\setminus (Y\cap Z)=Z\setminus Y$? – LovesPeanutButter Jan 26 '18 at 22:31

I know the other answers are shorter, but I wanted to finish it the same way you started.

Assume $x\in (X\setminus Y)\cap Z$. Then $x\in X,x\notin Y,x\in Z$. Now, since $x\notin Y$ we have that $x\notin Y\cap Z$. Since $x\in Z$ and $x\notin Y\cap Z$, it is clear that $x\in Z\setminus (Y\cap Z)$.

Therefore $(X\setminus Y)\cap Z\subseteq Z\setminus (Y\cap Z)$.

Assume $x\in Z\setminus (Y\cap Z)$. Then $x\in Z$, and either $x\notin Y$ or $x\notin Z$. But we already know $x\in Z$, so $x\notin Y$. Since $Z\subseteq X$ and $x\in Z$, we know $x\in X$. Since $x\in X$ and $x\notin Y$, we know $x\in X\setminus Y$. Since $x\in Z$ and $x\in X\setminus Y$, we have $x\in (X\setminus Y)\cap Z$.

Therefore $Z\setminus (Y\cap Z)\subseteq (X\setminus Y)\cap Z$.

And so we conclude $(X\setminus Y)\cap Z= Z\setminus (Y\cap Z)$

• When you say "Assume $x\in Z\setminus (Y\cap Z)$. Then $x\in Z$, and either $x\notin Y$ or $x\notin Z$." Since it's the intersection of $Y$ and $Z$, would it be the case that $x\notin Y$ AND $x\notin Z$? Instead of or? – LovesPeanutButter Jan 22 '18 at 18:31
• No. By definition of set subtraction, we know that $x\notin (Y\cap Z)$. Then $x\in (Y\cap Z)'$ and applying DeMorgan's Law gives us $x\in (Y'\cup Z')$. Therefore, $x\in Y'$ or $x\in Z'$, i.e. $x\notin Y$ or $x\notin Z$. – Riley Jan 22 '18 at 19:14
• What do you mean by "Then $x\in (Y\cap Z)'$"? – LovesPeanutButter Jan 26 '18 at 22:51
• $(Y\cap Z)'$ is the complement of $Y\cap Z$. Perhaps you learned a different notation. – Riley Jan 27 '18 at 0:50

I like to element chase.

$x \in X\setminus Y \cap Z$ means $x \in X; x \not \in Y; x \in Z$. So $x \not \in Y\cap Z$ but $x \in Z$ so $x \in Z\setminus (Y\cap Z)$.

So $X\setminus Y \cap Z\subset Z\setminus (Y\cap Z)$

Likewise if $x \in Z\setminus (Y\cap Z)$, then $x \not \in Y\cap Z$ and $x \in Z$. If $x \in Y$ then $x \in Y\cap Z$ which it is not. So $x \not \in Y$ So $x \in X\setminus Y$. And $x \in Z$ so $x \in X\setminus Y \cap Z$

So $Z\setminus (Y\cap Z)\subset X\setminus Y \cap Z$.

=====

Also not sure why pictures didn't help:

This is the picture of $X\setminus Y$ (in pink):

And this is the picture of $(X\setminus Y) \cap Z$ (in lavender):

And this is a picture of $Z\cap Y$ (in yellow):

And this is a picture of $Z \setminus (Y\cap Z)$ (in lavender):

• How did you generate these venn diagrams? – LovesPeanutButter Jan 19 '18 at 19:54
• I used photoshop. – fleablood Jan 20 '18 at 17:04

$(X \backslash Y) \cap Z = \{a \in X : a \notin Y\} \cap Z = \{a \in X : a \in Z, a\notin Y\}$

$Z \backslash (Y \cap Z) = \{a \in X : a \in Z, a \notin (Y \cap Z)\} = \{a \in X : a \in Z, a \notin Y\}$

The last transition uses the fact that $a \in Z$ and $a \notin Y \cap Z$ is equivalent to $a \in Z$ and $a \notin Y$.

• On the second line: $Z \backslash (Y \cap Z) = \{a \in X : a \in Z, a \notin (Y \cap Z)\} = \{a \in X : a \in Z, a \notin Y\}$ How do you know that $a \in X$? – LovesPeanutButter Jan 19 '18 at 20:08
• @LovesLinearAlgebra $Z$ is a subset of $X$. – idok Jan 19 '18 at 22:44

$Z\setminus (Y\cap Z)=Z\cap(Y\cap Z)'=Z\cap (Y'\cup Z')=(Z\cap Y')\cup (Z\cap Z')=Z\cap Y'=Z\cap(X\setminus Y)$

You just need to continue reasoning. From $x\notin Y$, you can conclude that $x\notin Y\cap Z$. Now you know that $x\in Z$ and $x\notin Y\cap Z$, which precisely means that $x\in Z\setminus(Y\cap Z)$.

For the inverse direction, either start again, or look at the solution above to see if all logical connections can be treated as "if and only if". (I'm not saying that that's the case; just giving some ideas to think about.)

In order to show that $$(X \setminus Y)\cap Z \subset Z \setminus(Y \cap Z)$$ We pick an arbitrary element of the left side and show that it is as element of the right side.

If $x$ is such an element, then $x$ is in $Z$ and $x$ is not in $Y$. Since it is not in $Y$ it is not in $(Y \cap Z)$ thus it is in $Z \setminus(Y \cap Z)$

In order to show $$Z \setminus(Y \cap Z) \subset (X \setminus Y)\cap Z$$

We pick an arbitrary element of the left side and show that it is as element of the right side.

If $x$ is such an element , then $x$ is in $Z$ and $x$ is not in $(Y \cap Z)$, therefore $x$ is not in $Y$ which makes it an element of $(X\setminus Y)$.

Since it is in $Z$ and it is in $(X\setminus Y)$, it is in the intersection of the two sets which is exactly $(X\setminus Y)\cap Z$