Is $ \neg(p \iff q) \equiv \neg p \iff \neg q $ valid

logicpropositional-calculus

For the question if the following is valid, I get false, but the book says the answer is true but doesn't explain why $$ \neg(p \iff q) \equiv \neg p \iff \neg q $$

The way I worked out the answer was expanding the left-hand side equation
$$p \rightarrow q \land q \rightarrow p $$
$$(\neg p \lor q) \land (q \rightarrow p) $$
$$ \neg(p \land \neg q) \land \neg(q \land p)$$
$$ \neg p \lor q \lor q \lor \neg p) $$
$$ (p \rightarrow \neg q) \lor (\neg q \rightarrow \neg p) $$

But this is not equivalent to $ \neg p \iff \neg q $

Can someone help explain where I am going wrong?

Best Answer

Since $p,\,q$ have the same truth-values iff $\neg p,\,\neg q$ do, $(p\iff q)\equiv (\neg p\iff\neg q)$. In particular, $(p\iff q)\not\equiv \neg(\neg p\iff\neg q)\equiv (p\iff\neg q)$. In fact, we're working out the exclusive or of $p,\,q$. If you want to prove any of these results by your preferred techniques, first write $$\neg (p\iff q)\equiv\neg ((\neg p\lor q)\land (\neg q\lor p))\equiv(p\land\neg q)\lor (q\land\neg p).$$

Related Question