How exactly do you prove a union? Example included. My homework question is:
Let $X$ be a set and $A,B \subseteq X$. Show that $(X \setminus A) \cup (X \setminus B)=X\setminus(A\cap B)$
My answer is:
Consider an arbitrary $x \in (X \setminus A) \cup (X \setminus B)$. Either $x \in (X \setminus A)$ or $x \in (X \setminus B)$. If $x \in (X \setminus A)$, then $x \in X$ but $x \notin A$. By definition, if $x \notin A$ then $x \notin A\cap B$. Hence, $x\in X\setminus(A\cap B)$. If $x \in (X\setminus B)$, then $x \in X$ but $x \notin B$. By definition, if $x \notin B$ then $x \notin A\cap B$ also. As $x \in X\setminus (A \cap B)$, then $(X\setminus A)\cup (X \setminus B) \subseteq X \setminus (A \cap B)$
Consider an arbitrary $x \in X\setminus (A\cap B)$. Consequently, $x \in X$ and $x \notin (A \cap B)$, and therefore, $x \notin A$ and $x \notin B$. Since, $x \in X$, and $A,B \subseteq X$, then $x \in (X \setminus A)$ and $x \in (X \setminus B)$. Finally, $x\in (X\setminus A)\cup (X\setminus B)$. Hence, $X\setminus (A\cap B)\subseteq (X\setminus A)\cup (X\setminus B)$ Q.E.D
After writing this down I started to think that how I proved $x\in (X\setminus A)\cup (X\setminus B)$ was wrong as I proved both $x \in (X\setminus A)$ and $x \in (X\setminus B)$. If I remember correctly this proves an intersection instead. Is this proof right or did I make a mistake and how do I fix it?
 A: Here it is another way to approach it for the sake of curiosity.
According to the corresponding properties of the set operations, we have that
\begin{align*}
(X\backslash A)\cup(X\backslash B) & = (X\cap A^{c})\cup(X\cap B^{c})\\\\
& = X\cap(A^{c}\cup B^{c})\\\\
& = X\cap(A\cap B)^{c}\\\\
& = X\backslash(A\cap B)
\end{align*}
and we are done.
Hopefully this helps!
A: The property you are asked to prove is a DeMorgan identity; it can help to visualize it by drawing a Venn diagram.
The step you have wrong is the following:
"Consequently, $x \in X $ and $x \notin (A∩B)$, and therefore, $x \notin A$ and $x \notin B$."
If an element is not in the intersection of two sets, it is not in at least one of two sets.
A: You did have an error and you did (incorrectly) argue that $x$ is in the intersection.
You argued:

Consider an arbitrary x∈X∖(A∩B). Consequently, x∈X and x∉(A∩B), and therefore, x∉A and x∉B. Since, x∈X, and A,B⊆X, then x∈(X∖A) and x∈(X∖B). Finally, x∈(X∖A)∪(X∖B). Hence, X∖(A∩B)⊆(X∖A)∪(X∖B) Q.E.D$

Now $x \not \in (A\cap B)$ meaning that [$x \in A$ and $x\in B$] is false.... means that  [$x \in A$] and [$x\in B$] are not BOTH true.  But that doesn't mean they are both false.  It means one or the other (and maybe, but not necessarily, both) are false.
In short if $x \not \in (A\cap B)$ the either $x \not \in A$ OR (not "and") $x \not \in B$.
So you would argue as $A,B\subset X$ then $x \in (X\setminus A)$ OR (not "and") $x \in (X\setminus B)$.
ANd that is how you argue a union; by showing $x$ is in one or the other.
So $x \in (X\setminus A)\cup (X\setminus B)$.
In other words:

Consider an arbitrary x∈X∖(A∩B). Consequently, x∈X and x∉(A∩B), and therefore, x∉A OR x∉B. Since, x∈X, and A,B⊆X, then x∈(X∖A) OR x∈(X∖B). Finally, x∈(X∖A)∪(X∖B). Hence, X∖(A∩B)⊆(X∖A)∪(X∖B) Q.E.D$

A: Let $P$ be $x\in X.$ Let $Q$ be $x\in A$. Let $R$ be $x\in B.$ Observe that $$ x\in (X\setminus A)\cup (X\setminus B)\iff [ (x\in (X\setminus A)\lor (x\in X\setminus B)]\iff [(P\land \neg Q)\lor (P\land \neg R)] .$$ Therefore for any $x$ we have $$x\in X\setminus (A\cap B)\iff$$ $$\iff [x\in X\land \neg (x\in A\land x\in B)]\iff$$ $$\iff [P \land \neg (Q\land R)]\iff$$ $$ \iff [P\land (\,(\neg Q)\lor (\neg R)\,)]\iff$$ $$\iff  [(P\land \neg Q)\lor (P\land \neg R)]\iff $$ $$\iff x\in (X\setminus A)\cup (X\setminus B).$$
Or we can say that any $x\in X$ belongs to  $X\setminus (A\cap B)$ iff $x$ does not belong to $A$ (and hence belongs to $X\setminus A$) OR $x$ does not belong to $B$ (and hence belongs to $X$ \ $B$).
