# Expressing a set using set-builder notation and then the simplifying the resulting expression

Describe $(A \setminus B) \cup (A \cap B)$ in set-builder notation, and simplify it using the laws of logic.

So, looking at this intuitively, I know that it translates to “all elements contained in $A$ but not $B$, as well as all elements contained in both $A$ and $B$”. In other words, this is just $A$. I can thus write out a variation of set-builder notation: $$\{ x \mid ((x \in A) \land \neg (x \in B)) \lor ((x \in A) \land (x \in B)) \}.$$ This does allow me to use logical laws to simplify the problem, but it doesn’t look like examples of set-builder notation that I’ve seen and I feel like I’m missing a step. Would anyone be able to tell me how to convert what I’ve done so far into formal set-builder notation, while keeping the logical operators needed to simplify it?

• It is cumbersome, but correct; the syntax of set-builder is $\{ x \mid \varphi(x) \}$ where $\varphi$ is a formula with $x$ free. And the long expression is a formula $\varphi(x,A,B)$ with $x$ free and two "parameters" $A$ and $B$. – Mauro ALLEGRANZA Feb 3 '17 at 7:16
• Cumbersome is fine, I deliberately wrote it long-form so I'd have more to work with when simplifying. But you're saying that what I have written DOES qualify as a completed set-builder conversion? – Mock Feb 3 '17 at 7:18
• Now you have to simplify the formula using Distributivity. – Mauro ALLEGRANZA Feb 3 '17 at 7:19
• Yes, and I know the goal is to end up with A. Thank you for the help! If you make your comment an answer I can approve it. – Mock Feb 3 '17 at 7:20