Academy

Laws of Boolean Logic

A comprehensive guide to the algebraic laws used to simplify logical expressions.

Laws of Boolean Logic

Just as you use a(b+c)=ab+aca(b+c) = ab + ac to simplify algebra, you can use Boolean Laws to simplify complex logical circuits and expressions. These laws allow us to transform a complicated statement into a much simpler, equivalent one.


1. The Fundamental Laws

Law NameConjunction (AND)Disjunction (OR)
Identity LawspTpp \land T \equiv ppFpp \lor F \equiv p
Domination LawspFFp \land F \equiv FpTTp \lor T \equiv T
Idempotent Lawspppp \land p \equiv ppppp \lor p \equiv p
Double Negation¬(¬p)p\neg(\neg p) \equiv p
Commutative Lawspqqpp \land q \equiv q \land ppqqpp \lor q \equiv q \lor p

2. Distributive & Associative Laws

These laws are critical when dealing with more than two variables (p,q,rp, q, r).

  • Associative: (pq)rp(qr)(p \land q) \land r \equiv p \land (q \land r)
  • Distributive: p(qr)(pq)(pr)p \lor (q \land r) \equiv (p \lor q) \land (p \lor r)
{`graph TD A["p ∨ (q ∧ r)"] -- "Distribute p ∨" --> B["(p ∨ q) ∧ (p ∨ r)"] style A fill:#2d3436,stroke:#00cec9,color:#fff style B fill:#2d3436,stroke:#00cec9,color:#fff`}

3. De Morgan's Laws (The Powerhouse)

As we've seen, De Morgan's laws allow us to move a negation inside parentheses by flipping the operator.

  1. ¬(pq)¬p¬q\neg(p \land q) \equiv \neg p \lor \neg q
  2. ¬(pq)¬p¬q\neg(p \lor q) \equiv \neg p \land \neg q

4. Absorption Laws

These laws are incredibly useful for cleaning up "redundant" logic in competitive exams and programming.

  • p(pq)pp \lor (p \land q) \equiv p
  • p(pq)pp \land (p \lor q) \equiv p

Think about it: If pp is already true, the status of (pq)(p \land q) doesn't change the fact that the whole OR expression is true!


5. Applying Laws in Python

In programming, we often use these laws to simplify if statements, making the code more readable and efficient.

# Before Simplification
if (is_member or (is_member and has_coupon)):
    print("Access Granted")

# After applying Absorption Law: p or (p and q) == p
if is_member:
    print("Access Granted")

Summary Checklist for Simplification

When you are asked to "Simplify the expression," follow this order:

  1. Remove Arrows: Replace p    qp \implies q with ¬pq\neg p \lor q.
  2. Apply De Morgan's: Move negations inward.
  3. Double Negation: Clean up any ¬(¬p)\neg(\neg p).
  4. Distribute/Absorb: Use the laws above to cancel out variables.

Congratulations! You have mastered the algebraic side of Propositional Calculus.

Next Step: We move from fixed statements to Quantifiers and Variables in Level 2: Predicate Logic.