Can somebody explain me the following equivalence in propositional algebra(by the use of the laws of algebra):
$$\lnot(p \lor q) \lor (\lnot p \land q) \equiv \lnot p$$
I get stuck after $$\lnot(p \lor q) \lor (\lnot p \land q) \equiv (\lnot p \land \lnot q) \lor (\lnot p \land q)$$
$$\begin{align} \underbrace{\lnot(p \lor q)}_{\large \equiv \;\lnot p \land \lnot q} \lor (\lnot p \land q) & \equiv (\color{blue}{\lnot p} \land \lnot q) \lor (\color{blue}{\lnot p} \land q) \tag{1} \\ &\equiv \color{blue}{\lnot p} \land (\underbrace{\lnot q \lor q}_{\large\top}) \tag{2} \\ &\equiv \lnot p \land \top\tag{3}\\ \\ &\equiv \lnot p \tag{4} \end{align}$$
In $(1)$, we use DeMorgan's Law.
In $(2)$, we use the Distributive Law ("in reverse").
In $(3)$, we recognize that $\lnot q \lor q$ is a tautology: necessarily true, whatever the truth value of $q$.
In $(4)$, we invoke the identity: $\lnot p \land \top \equiv \lnot p$