In my logic course I saw the following equivalence, but I don't understand how they get there.$(\neg p\vee \neg q)\wedge(p\vee q)\, \Longleftrightarrow \, (\neg p\wedge p)\vee (\neg p\wedge q)\vee(\neg q\wedge p)\vee(\neg q\wedge q)$
I can see it's equivalent by setting up a truth table, but I just don't understand how they used the logical equivalence for distributivity which is $\varphi \vee (\psi \wedge \chi )\Longleftrightarrow (\varphi \vee \psi )\wedge (\varphi \vee \chi )$ to reach the formula on the right side.
Thanks in advance!
First step: we have to distribute $(p∨q)$ over $(¬p∨¬q)$ to get:
Second setp: apply Distributivity again twice to get:
Finally, we may use $(\lnot p \land p) \equiv (q \land \lnot q) \equiv \text {FALSE }$ and $(\text { FALSE} \lor \alpha) \equiv \alpha$ for a formula $\alpha$ whatever to get the equivalent: