Playground Documentation Challenges Full Docs
← All Challenges

#23. AND Distributes over OR

Medium if <…> contradict

Given that and(p, or(q, r)) -> true, prove that or(and(p,q), and(p,r)) evaluates to true. This is the forward direction of the distributivity law: AND distributes over OR.

Hint

Assume or(and(p,q), and(p,r)) -> false inside and(p,or(q,r)) -> true. Case split on p: when p -> false, the outer and is false — contradiction. When p -> true, split on q and r: at least one of and(p,q), and(p,r) must be true.

Your Solution
Output