Help with proving a logical equivalence How do I prove this using logical equivalences? 
$(p \rightarrow q) \lor (q \land r) \equiv \neg ((p \land \neg r) \land \neg q) \land \neg (r \land (\neg q \land p))$
Any suggestions or tips would be greatly appreciated. Thanks in advance!
EDIT: 
Stuff I've tried so far:
Using the law of implication to change the $p \rightarrow q$ into $\neg p \lor q$
It seems like $r$ appears on both sides of the $\land$ in the final expression, so I tried expanding the single $r$ in $q \land r$ into $r \land r$ to give $q \land (r \land r)$ but that doesn't seem to be getting me anywhere
 A: Claim:
$$
(p \rightarrow q) \lor (q \land r) \equiv \neg ((p \land \neg r) \land \neg q) \land \neg (r \land (\neg q \land p))
$$
LHS:
$$
(p \rightarrow q) \lor (q \land r) \equiv (\neg p \lor q) \lor (q \land r) \equiv ((\neg p  \lor q) \lor q ) \land ((\neg p \lor q) \lor r) \equiv \\ (\neg p  \lor q ) \land ((\neg p \lor q) \lor r) \equiv (\neg p \lor q) 
$$
RHS:
$$
\neg ((p \land \neg r) \land \neg q) \land \neg (r \land (\neg q \land p)) \equiv \\
\neg [((p \land \neg r) \land \neg q) \lor (r \land (\neg q \land p))] \equiv \\
\neg [((\neg q \land p) \land \neg r) \lor ((\neg q \land p) \land r)] \equiv \\
\neg [((\neg q \land p)  \land (r \lor \neg r)] \equiv \\
q \lor \neg p \equiv (\neg p \lor q) 
$$
so LHS = RHS and the Claim is true.
A: Hint: Convert each side to DNF (an OR of ANDs) using the identities:

  
*
  
*$x \to y \equiv \neg x \lor y$
  
*$\neg (x \lor y) \equiv \neg x \land \neg y$
  
*$\neg (x_1 \land \cdots \land x_n) \equiv \neg x_1 \lor \cdots \lor \neg x_n$
  

A: First let’s recall a few laws.


*

*definition of implication: $a\implies b \equiv \lnot a \lor b$

*DeMorgan's Laws:


*

*$a \lor b \equiv \lnot(\lnot a \land \lnot b)$

*$a \land b \equiv \lnot(\lnot a \lor \lnot b)$


*Commutation:


*

*$a \lor b \equiv b \lor a$

*$a \land b \equiv b \land a$


*Association:


*

*$(a \lor b) \lor c \equiv a \lor (b \lor c)$

*$(a \land b) \land c \equiv a \land (b \land c)$


*Distribution:


*

*$a \lor (b \land c) \equiv (a \lor b) \land (a \lor c)$

*$a \land (b \lor c) \equiv (a \land b) \lor (a \land c)$


*Idempotency:


*

*$a \lor a \equiv a$

*$a \land a \equiv a$


*Identity:


*

*$a \lor \bot \equiv a$

*$a \land \top \equiv a$


*Zero:


*

*$a \lor \top \equiv \top$

*$a \land \bot \equiv \bot$



Starting with the RHS and working backward,
\begin{align}
\lnot((p \land \lnot r) \land \lnot q) &\land \lnot(r \land (\lnot q \land p))\\
\lnot(p \land \lnot q \land \lnot r) &\land \lnot(p \land \lnot q \land r) \quad\text{Association and Commutation}\\
(\lnot p \lor q \lor r) &\land (\lnot p \lor q \lor \lnot r) \quad\text{DeMorgan}\\
((p \implies q) \lor r) &\land ((p \implies q) \lor \lnot r) \quad\text{dfn. of impl.}\\
(p \implies q) &\lor (r \land \lnot r) \quad\text{Distribution}\\
(p \implies q) &\lor \bot \quad\text{dfn. of Contradiction}\\
p &\implies q \quad\text{Identity}\\
\end{align}
Now starting with the LHS and working forward,
\begin{align}
(p \implies q) &\lor (q \land r)\\
((p \implies q) \lor q) &\land ((p \implies q) \lor r) \quad\text{Distribution}\\
((\lnot p \lor q) \lor q) &\land ((p \implies q) \lor r) \quad\text{dfn. of impl.}\\
(\lnot p \lor q) &\land ((p \implies q) \lor r) \quad\text{Associativity and Idempotency}\\
(p \implies q) &\land ((p \implies q) \lor r) \quad\text{dfn. of impl.}\\
((p \implies q) \lor \bot) &\land ((p \implies q) \lor r) \quad\text{Identity}\\
(p \implies q) &\lor (\bot \land r) \quad\text{Distribution}\\
(p \implies q) &\lor \bot \quad\text{Zero}\\
p &\implies q \quad\text{Identity}\\
\end{align}
Therefore both the LHS and RHS are logically equivalent to $p \implies q$, and by Transitivity of equivalence, the LHS and the RHS are logically equivalent to each other.
