Covers: Chapter 7 — Natural Deduction in Propositional Logic (§7.1–7.7) Prerequisite: Lesson 05 (Propositional Logic) Unlocks: Lesson 07 (Predicate Logic)
Truth tables work but get unwieldy fast — n variables means 2^n rows. With 5 variables, that’s 32 rows. With 10, it’s 1024. Natural deduction lets you prove validity by deriving the conclusion from the premises step by step, using rules of inference — like building a proof in mathematics or constructing a chain of evidence in an investigation.
These rules let you derive new lines from existing lines in a proof. Each rule has a specific pattern — you can only apply it when the pattern matches exactly.
n. p ⊃ q
m. p
∴ q MP n, m
n. p ⊃ q
m. ~q
∴ ~p MT n, m
n. p ⊃ q
m. q ⊃ r
∴ p ⊃ r HS n, m
n. p ∨ q
m. ~p
∴ q DS n, m
n. (p ⊃ q) · (r ⊃ s)
m. p ∨ r
∴ q ∨ s CD n, m
n. p · q
∴ p Simp n
(You can also get q from p · q — just use commutativity first.)
n. p
m. q
∴ p · q Conj n, m
n. p
∴ p ∨ q Add n
(You can add anything as a disjunct. This seems odd but is logically sound.)
Prove: From premises (1) p ⊃ q, (2) q ⊃ r, (3) p — derive r.
1. p ⊃ q Premise
2. q ⊃ r Premise
3. p Premise
4. q MP 1, 3
5. r MP 2, 4
Engineering reading: “If the sensor fails (p), the data goes stale (q). If data goes stale (q), the estimator diverges (r). The sensor failed (p). Therefore: the data goes stale (step 4), and the estimator diverges (step 5).”
p ⊃ q and can get p, you get q.p ⊃ q and ~q, you get ~p.Unlike inference rules (which go one direction), replacement rules are equivalences — you can substitute in either direction, and you can apply them to part of a line.
| Name | Equivalence |
|---|---|
| De Morgan’s (DM) | ~(p · q) ≡ ~p ∨ ~q, ~(p ∨ q) ≡ ~p · ~q |
| Double Negation (DN) | ~~p ≡ p |
| Commutation (Com) | p ∨ q ≡ q ∨ p, p · q ≡ q · p |
| Association (Assoc) | (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) |
| Distribution (Dist) | p · (q ∨ r) ≡ (p · q) ∨ (p · r) |
| Transposition (Trans) | (p ⊃ q) ≡ (~q ⊃ ~p) |
| Material Implication (Impl) | (p ⊃ q) ≡ (~p ∨ q) |
| Material Equivalence (Equiv) | (p ≡ q) ≡ (p ⊃ q) · (q ⊃ p) |
| Exportation (Exp) | (p · q) ⊃ r ≡ p ⊃ (q ⊃ r) |
| Tautology (Taut) | p ≡ p ∨ p, p ≡ p · p |
Prove: From (1) ~p ∨ q and (2) ~q — derive ~p.
1. ~p ∨ q Premise
2. ~q Premise
3. p ⊃ q Impl 1 (replaced ~p ∨ q with p ⊃ q)
4. ~p MT 3, 2
Without replacement rules, this would be much harder. Material Implication let us convert the disjunction into a conditional, then apply Modus Tollens.
Prove: From (1) p ⊃ (q · r), (2) ~q — derive ~p.
1. p ⊃ (q · r) Premise
2. ~q Premise
3. ~q ∨ ~r Add 2 (adding ~r as disjunct)
4. ~(q · r) DM 3 (De Morgan's: ~q ∨ ~r ≡ ~(q · r))
5. ~p MT 1, 4
Engineering reading: “If the robot is in autonomous mode (p), then both the planner is running (q) and the motors are enabled (r). The planner is not running (~q). Therefore the robot is not in autonomous mode (~p).”
To prove a conditional conclusion (p ⊃ q): 1. Assume the antecedent (p) as a temporary hypothesis. 2. From that assumption plus the premises, derive the consequent (q). 3. Discharge the assumption: conclude p ⊃ q.
Example: From (1) p ⊃ q, (2) q ⊃ r — prove p ⊃ r.
1. p ⊃ q Premise
2. q ⊃ r Premise
┌──────────────────
3. │ p Assume (CP)
4. │ q MP 1, 3
5. │ r MP 2, 4
└──────────────────
6. p ⊃ r CP 3–5
Lines 3–5 are inside the conditional proof “box.” They depend on the assumption. Line 6 discharges the assumption.
To prove a conclusion q: 1. Assume the negation (~q). 2. From that assumption plus the premises, derive a contradiction (any r · ~r). 3. Discharge the assumption: conclude q (since ~q leads to contradiction).
Example: From (1) p ∨ q, (2) ~p — prove q.
1. p ∨ q Premise
2. ~p Premise
┌──────────────────
3. │ ~q Assume (IP)
4. │ p DS 1, 3 (from p ∨ q and ~q, get p)
5. │ p · ~p Conj 4, 2 (contradiction!)
└──────────────────
6. q IP 3–5
When to use IP: When the conclusion doesn’t obviously follow from the premises, try assuming its negation and see if you reach a contradiction.
What form is the conclusion?
p ⊃ q → Try Conditional Proof (assume p, derive q)
p · q → Derive p and q separately, then Conj
p ∨ q → Try to derive p or q, then Add
~p → Try MT or IP
p → Try MP, DS, or Simp from premises
General strategy: 1. Look at the conclusion’s main connective. 2. Choose the strategy that matches. 3. If stuck, try Indirect Proof — assume the opposite of what you want and derive a contradiction.
Very common in debugging — tracing a causal chain:
1. a ⊃ b "SPI jitter → DMA corruption"
2. b ⊃ c "DMA corruption → stale sensorbar data"
3. c ⊃ d "stale data → estimator divergence"
4. a "SPI jitter occurred"
5. a ⊃ c HS 1, 2
6. a ⊃ d HS 5, 3
7. d MP 6, 4
1. a ∨ b ∨ c "It's hardware, firmware, or software"
2. ~a "Ruled out hardware"
3. ~b "Ruled out firmware"
4. b ∨ c DS 1, 2 (with a eliminated)
5. c DS 4, 3
When you have a disjunction and need to show both cases lead to the same (or compatible) conclusions:
1. p ∨ q "Either the motor overheated or the driver failed"
2. p ⊃ r "If motor overheated → replace motor"
3. q ⊃ r "If driver failed → also replace motor (it may be damaged)"
4. (p ⊃ r) · (q ⊃ r) Conj 2, 3
5. r ∨ r CD 4, 1
6. r Taut 5