Logic & Proof Techniques

The foundation of rigorous reasoning and digital systems. Learn propositions and connectives, truth tables, implication and equivalence, tautologies and contradictions, quantifiers (∀, ∃) and predicate logic, and proof techniques: direct proof, contrapositive, contradiction and mathematical induction.

Software specifications, safety interlocks, database queries and circuit design are all logic. Proof techniques let engineers show algorithms are correct and formulas hold for all cases — not just the ones tested.

An analogy

Logic is like the rules of a board game: follow them precisely and every conclusion you reach is guaranteed to be valid.

Propositions and truth tables

A proposition is true or false. Truth tables list all combinations; two statements are equivalent if their columns match. A tautology is always true; a contradiction always false.

Implication pitfalls

'If the alarm is on, pressure is high' does not mean 'if pressure is high, the alarm is on' (converse) — confusing these is a common specification error. The contrapositive is equivalent; the converse is not.

Quantifiers

∀ (every sensor reads below the limit) and ∃ (some sensor reads above). Negation swaps them. Order matters: ∀x∃y ≠ ∃y∀x.

Proofs

Direct proof; contrapositive; contradiction (√2 irrational); induction for statements about all integers (sums, algorithm loops — loop invariants); counterexamples disprove universal claims.

Formulas

Worked example: Induction

Given: Claim: 1 + 2 + … + n = n(n + 1)/2

Find: Proof.

Answer: True for all n ≥ 1

Worked example: Contrapositive

Given: If n² is even then n is even

Find: Proof.

Answer: Proved

Common mistakes

Applications

Key takeaways

Going further