Playground Documentation Challenges Full Docs
← All Challenges

#15. AND Commutativity

Easy if <…> contradict

Prove that equivalent(and(a,b), and(b,a)) evaluates to true for all booleans a and b. This shows that AND is commutative.

Hint

Assume the opposite, then case-split on both a and b. You need nested if blocks: first on a, then on b.

Your Solution
Output