Prove p → (q → r) ≡ (p ∧ q) → r without a truth table.
The algebra of propositions is the toolkit of equivalence laws — De Morgan, distributive, absorption and the rest — used to simplify formulas and prove equivalences without truth tables, to rewrite them with fewer connectives, and to convert them into normal forms.
Two compound propositions A and B are logically equivalent, written A ≡ B, when they have the same truth value in every row — equivalently, when A ↔ B is a tautology. Equivalence can be shown by a truth table (mechanical but grows as 2ⁿ) or by a chain of known laws (short and elegant once the laws are familiar).
What makes the algebraic method legal is the substitution principle: replacing any sub-formula by an equivalent one produces an equivalent formula. Equivalence is also reflexive, symmetric and transitive, so a chain A ≡ B ≡ C ≡ … ≡ Z proves A ≡ Z.
| p | q | p → q | ¬(p → q) | ¬q | p ∧ ¬q |
|---|---|---|---|---|---|
| T | T | T | F | F | F |
| T | F | F | T | T | T |
| F | T | T | F | F | F |
| F | F | T | F | T | F |
| Law | ∧ form | ∨ form |
|---|---|---|
| Identity | p ∧ T ≡ p | p ∨ F ≡ p |
| Domination (null) | p ∧ F ≡ F | p ∨ T ≡ T |
| Idempotent | p ∧ p ≡ p | p ∨ p ≡ p |
| Double negation (involution) | ¬(¬p) ≡ p | ¬(¬p) ≡ p |
| Commutative | p ∧ q ≡ q ∧ p | p ∨ q ≡ q ∨ p |
| Associative | (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) | (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) |
| Distributive | p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) | p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) |
| De Morgan | ¬(p ∧ q) ≡ ¬p ∨ ¬q | ¬(p ∨ q) ≡ ¬p ∧ ¬q |
| Absorption | p ∧ (p ∨ q) ≡ p | p ∨ (p ∧ q) ≡ p |
| Negation (complement) | p ∧ ¬p ≡ F | p ∨ ¬p ≡ T |
Two remarks. Unlike school arithmetic, both distributive laws hold: ∧ distributes over ∨ and ∨ distributes over ∧. And De Morgan generalises to any number of terms: ¬(p₁ ∧ p₂ ∧ … ∧ pₙ) ≡ ¬p₁ ∨ ¬p₂ ∨ … ∨ ¬pₙ, and dually for ∨.
| Equivalence | Comment |
|---|---|
| p → q ≡ ¬p ∨ q | Implication as a disjunction — the standard way to eliminate → |
| p → q ≡ ¬q → ¬p | Contrapositive |
| p ∨ q ≡ ¬p → q | A disjunction as an implication |
| p ∧ q ≡ ¬(p → ¬q) | A conjunction as a negated implication |
| ¬(p → q) ≡ p ∧ ¬q | Negating an implication |
| (p → q) ∧ (p → r) ≡ p → (q ∧ r) | Common hypothesis: conclusions combine with ∧ |
| (p → r) ∧ (q → r) ≡ (p ∨ q) → r | Common conclusion: hypotheses combine with ∨ (proof by cases) |
| (p → q) ∨ (p → r) ≡ p → (q ∨ r) | Common hypothesis with ∨ |
| (p → r) ∨ (q → r) ≡ (p ∧ q) → r | Common conclusion with ∨ |
| (p ∧ q) → r ≡ p → (q → r) | Exportation |
| p ↔ q ≡ (p → q) ∧ (q → p) | Definition of the biconditional |
| p ↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q) | Both true or both false |
| p ↔ q ≡ ¬p ↔ ¬q | Negating both sides keeps ↔ |
| ¬(p ↔ q) ≡ p ↔ ¬q ≡ p ⊕ q | Negating a biconditional gives XOR |
To show that a formula is a tautology, reduce it to T; to show it is a contradiction, reduce it to F. Here is (p ∧ q) → (p ∨ q):
Take a formula written with only ¬, ∧, ∨, T and F. Its dual Aᵈ is obtained by replacing every ∧ with ∨, every ∨ with ∧, every T with F and every F with T. Variables and negation signs stay exactly where they are. Before dualising, rewrite any → or ↔ in terms of ¬, ∧, ∨.
| Formula A | Dual Aᵈ |
|---|---|
| p ∨ (q ∧ r) | p ∧ (q ∨ r) |
| (p ∧ T) ∨ ¬q | (p ∨ F) ∧ ¬q |
| ¬(p ∨ q) ∧ (p ∨ ¬(q ∧ ¬s)) | ¬(p ∧ q) ∨ (p ∧ ¬(q ∨ ¬s)) |
| p → q, rewritten as ¬p ∨ q | ¬p ∧ q |
The principle of duality: if A ≡ B then Aᵈ ≡ Bᵈ. That is why every law in the table above comes with a twin — prove one and the other is free. Duality also connects the dual and the negation: ¬A(p₁, …, pₙ) ≡ Aᵈ(¬p₁, …, ¬pₙ), which is just De Morgan applied all the way through.
A set of connectives is functionally complete (adequate) if every possible truth function can be written using only those connectives. {¬, ∧, ∨} is complete because any truth table can be written as an OR of AND-terms (a DNF, see below). Since p ∨ q ≡ ¬(¬p ∧ ¬q), the smaller set {¬, ∧} already suffices; likewise {¬, ∨}, and {¬, →} because p ∨ q ≡ ¬p → q. Even {→, F} is complete, since ¬p ≡ p → F.
NAND and NOR are complete on their own. The NAND symbol ↑ is called the Sheffer stroke after Henry Sheffer's 1913 paper, and NOR's ↓ the Peirce arrow after C. S. Peirce, who had noticed this completeness around 1880 but never published it. That is why NAND and NOR are called universal gates in digital electronics (Module 2).
| Target | Using only NAND (↑) | Using only NOR (↓) |
|---|---|---|
| ¬p | p ↑ p | p ↓ p |
| p ∧ q | (p ↑ q) ↑ (p ↑ q) | (p ↓ p) ↓ (q ↓ q) |
| p ∨ q | (p ↑ p) ↑ (q ↑ q) | (p ↓ q) ↓ (p ↓ q) |
| p → q | p ↑ (q ↑ q) | ((p ↓ p) ↓ q) ↓ ((p ↓ p) ↓ q) |
Why is {∧, ∨} not complete? Any formula built from ∧ and ∨ alone is true whenever all of its variables are true (it is truth-preserving), so it can never equal ¬p, which is false when p is true. The same argument rules out {∧, ∨, →, ↔}. The general criterion is Post's theorem (1941): a set is complete exactly when it is not confined to the truth-preserving, falsity-preserving, monotone, self-dual or affine functions — {¬, ↔}, for example, stays inside the affine class and cannot build p ∧ q.
A literal is a variable or its negation (p, ¬p). An elementary product (fundamental conjunction) is an AND of literals, such as p ∧ ¬q ∧ r; an elementary sum (fundamental disjunction, clause) is an OR of literals, such as ¬p ∨ q. A formula is in disjunctive normal form (DNF) if it is an OR of elementary products, and in conjunctive normal form (CNF) if it is an AND of elementary sums. Every formula has both forms, though not uniquely.
Normal forms give instant tests. A DNF is a contradiction exactly when every term contains a complementary pair (p and ¬p); a CNF is a tautology exactly when every clause contains a complementary pair. CNF is also the input format of SAT solvers and of the resolution rule met in the next topic.
With n variables, a minterm is an AND containing every variable exactly once (plain or negated); it is true in exactly one row. A maxterm is an OR containing every variable exactly once; it is false in exactly one row. The principal disjunctive normal form (PDNF, canonical sum of products) is the OR of the minterms of the T rows; the principal conjunctive normal form (PCNF, canonical product of sums) is the AND of the maxterms of the F rows. Unlike ordinary DNF/CNF, these are unique up to order, so two formulas are equivalent exactly when their PDNFs coincide.
Writing rule: in a minterm, a variable that is T in the row appears plain and one that is F appears negated. In a maxterm it is the opposite — T appears negated, F appears plain — because the maxterm must be false in that row.
| p | q | r | f = (p ∧ q) ∨ (¬p ∧ r) | Contributes |
|---|---|---|---|---|
| T | T | T | T | minterm p ∧ q ∧ r (m₇) |
| T | T | F | T | minterm p ∧ q ∧ ¬r (m₆) |
| T | F | T | F | maxterm ¬p ∨ q ∨ ¬r (M₅) |
| T | F | F | F | maxterm ¬p ∨ q ∨ r (M₄) |
| F | T | T | T | minterm ¬p ∧ q ∧ r (m₃) |
| F | T | F | F | maxterm p ∨ ¬q ∨ r (M₂) |
| F | F | T | T | minterm ¬p ∧ ¬q ∧ r (m₁) |
| F | F | F | F | maxterm p ∨ q ∨ r (M₀) |
The minterm indices of the PDNF and the maxterm indices of the PCNF split {0, 1, …, 2ⁿ − 1} between them, so their counts add up to 2ⁿ. A tautology has all 2ⁿ minterms and an empty PCNF; a contradiction has all 2ⁿ maxterms. Algebraically, a DNF term missing a variable r is expanded by ∧ (r ∨ ¬r) and distributed; a CNF clause missing r is expanded by ∨ (r ∧ ¬r).
Try the problem first, then reveal the working one step at a time.
Prove p → (q → r) ≡ (p ∧ q) → r without a truth table.
Simplify (p ∨ q) ∧ ¬(¬p ∧ q) as far as possible.
Find the principal disjunctive and conjunctive normal forms of p → (q ∧ r).
Express p ∨ q and p → q using only the NAND connective ↑, and verify the second by a truth table.
Simplify ¬(p → q) ∨ (p ∧ q).
Prove (p → q) ∧ (p → r) ≡ p → (q ∧ r) using the laws of logic.
Write the duals of (a) (p ∨ T) ∧ (q ∨ F) (b) ¬(p ∧ q) ∨ (p ∧ ¬r) (c) p ↔ q.
Find the PDNF and PCNF of p ↔ q.
Explain why {∧, ∨} is not functionally complete while {¬, ∨} is.
10 questions. 70 % passes the topic quiz (+30 XP, +20 more for 100 %). Exam scoring: +1 correct, −⅓ wrong.
Modelled on real KPSC questions (reworded) with the same concept and answer; each links to its original paper.