TITLE: Using the distributivity law for propositional logic
QUESTION [7 upvotes]: I know how to use the standard rule
$$p\vee (q\wedge r)\equiv (p\vee q)\wedge (p\vee r)$$
but what if I have a two by two statement like:
$$(p\vee q)\wedge (r\vee s)$$
...
I'm guessing that it follows a similar rule to the FOIL method in algebra? I took a shot in the dark and came up with this, but I want to make sure my logic is correct.
$$(p\wedge r)\vee (p\wedge s)\vee (q\wedge r)\vee (q\wedge s)$$

REPLY [2 votes]: Let $t=p\lor q$. Then:
$$(p\lor q) \land (r\lor s) = t\land (r\lor s) = (t\land r)\lor(t\land s)$$
Substitute back $p\lor q$ and you get:
$$=((p\lor q)\land r)\lor ((p\lor q)\land s)$$
Now distribute the sub-expressions:
$$(p\lor q)\land r) = (p\land r)\lor (q\land r)$$
$$(p\lor q)\land s) = (p\land s)\lor (q\land s)$$
Substituting back in you get:
$$\begin{align}(p\lor q) \land (r\lor s) &= ((p\land r)\lor (q\land r))\lor ((p\land s)\lor (q\land s))\\
&= (p\land r)\lor (q\land r)\lor (p\land s)\lor (q\land s)
\end{align}$$