Raw

Lecture 7. Proofing (methods of proof)

Overview

Lecture 6 gave us the semantics of propositional logic: truth tables, satisfiability, and the notion of a tautology (a formula true under every truth assignment). This lecture turns to the syntax and practice of proof — how we move from statements we accept (premises, or hypotheses) to statements we thereby establish (conclusions), and how we prove mathematical theorems.

Two closely related ideas run through the whole lecture:

  • A proof is a finite sequence of statements, each of which is either an accepted premise, an axiom, or follows from earlier statements by a rule of inference.
  • Every legitimate rule of inference is nothing more than a tautology in disguise: the rule “from A1,A2,,AnA_1, A_2, \dots, A_n infer BB” is valid exactly when the implication

A1A2AnBA_1 \wedge A_2 \wedge \dots \wedge A_n \to B

is a tautology.

We first make that connection precise, catalogue the standard rules of inference, build several formal derivations, and then study the informal-but-rigorous techniques used to prove ordinary mathematical statements: direct proof, contraposition, contradiction, cases/exhaustion, existence and uniqueness, counterexamples, and mathematical induction (both weak and strong). We close with the classic fallacies that look like valid rules but are not, a short history, exercises, and hints.

This is the craft at the heart of every later lecture. Number theory, combinatorics, graph theory, the analysis of algorithms — all of it is stated as theorems and believed only once proved. Learning the methods here is learning the language in which the rest of the subject is written.

7.1 What is a proof, and why rigor?

Mathematics is unusual among human activities: its claims are not merely supported by evidence, they are settled. Once a theorem is correctly proved it is true forever, with no exceptions, in every model of its hypotheses. A proof is what produces that certainty.

Definition (proof, informal). A proof of a statement SS is a finite chain of reasoning that establishes SS beyond any doubt, in which every step is either a definition, a previously established result (axiom, theorem, lemma), a hypothesis, or a consequence of earlier steps by a valid rule of inference. A rigorous proof is one in which every such step could, in principle, be expanded into the fully formal derivations of §7.4.

The vocabulary of mathematical results:

  • A theorem is a statement that has been proved true.
  • A proposition is a theorem of lesser importance.
  • A lemma is an auxiliary theorem proved mainly as a stepping stone to a bigger one.
  • A corollary is a theorem that follows almost immediately from another.
  • A conjecture is a statement believed true but not yet proved (e.g. the Goldbach conjecture: every even integer >2> 2 is a sum of two primes).
  • An axiom (or postulate) is a statement accepted without proof, a starting point.
  • A definition fixes the exact meaning of a term. Proofs live or die on definitions: to prove “nn is odd,” you must know that odd means “n=2k+1n = 2k+1 for some integer kk.”

Why rigor matters: patterns lie. Empirical evidence — “it worked for the first thousand cases” — is not proof. Mathematics is full of patterns that hold for a long time and then break.

  • The polynomial f(n)=n2+n+41f(n) = n^2 + n + 41 (studied by Euler) is prime for every n=0,1,2,,39n = 0, 1, 2, \dots, 39. It is tempting to conjecture it is always prime. But f(40)=402+40+41=1681=412f(40) = 40^2 + 40 + 41 = 1681 = 41^2 is composite.
  • Pierre de Fermat conjectured that every Fermat number Fn=22n+1F_n = 2^{2^n} + 1 is prime. Indeed F0=3,F1=5,F2=17,F3=257,F4=65537F_0=3,\,F_1=5,\,F_2=17,\,F_3=257,\,F_4=65537 are all prime. In 1732 Euler showed F5=232+1=4294967297=641×6700417F_5 = 2^{32}+1 = 4294967297 = 641 \times 6700417 is composite. No further Fermat prime has ever been found.
  • Euler conjectured (1769) that a fifth power is never the sum of four positive fifth powers. In 1966 Lander and Parkin found, by computer search,

275+845+1105+1335=1445,27^5 + 84^5 + 110^5 + 133^5 = 144^5,

demolishing the conjecture (both sides equal 6191736422461\,917\,364\,224).

Common pitfall. Verifying finitely many cases proves nothing about the infinitely many you did not check — unless the statement itself only concerns finitely many cases (proof by exhaustion, §7.10). A universally quantified claim “nP(n)\forall n\, P(n)” over an infinite domain requires a general argument, typically induction (§7.11–7.12) or a direct/indirect proof.

Remark (proofs versus discovery). The polished proof you read is rarely the messy path by which it was found. Experiment, examples, and pattern-spotting are indispensable for discovering what is true; proof is how you confirm it. This lecture is about confirmation.

7.2 From semantics to syntax: tautological implication

Recall from Lecture 6 that a tautology is a formula true under every truth assignment. We now connect this semantic notion to the act of inferring.

Definition (tautological implication / logical consequence). A formula BB is a tautological consequence of formulas A1,,AnA_1, \dots, A_n, written A1,,AnBA_1, \dots, A_n \models B, when every truth assignment that makes all of A1,,AnA_1, \dots, A_n true also makes BB true.

The central theorem linking semantics to proof is the following equivalence — the semantic deduction theorem already proved in Lecture 6 (Theorem 6.15), restated here as a licence to infer.

Justification theorem. A1,,AnBA_1, \dots, A_n \models B if and only if the single formula A1A2AnBA_1 \wedge A_2 \wedge \dots \wedge A_n \to B is a tautology.

Proof. (\Leftarrow) Suppose A1AnBA_1 \wedge \dots \wedge A_n \to B is a tautology, and take any assignment making all AiA_i true. Then the antecedent A1AnA_1 \wedge \dots \wedge A_n is true. An implication with a true antecedent can be true only if its consequent is true; since the whole implication is true (being a tautology), BB is true. Hence every assignment satisfying all premises satisfies BB, i.e. A1,,AnBA_1,\dots,A_n \models B.

(\Rightarrow) Conversely suppose A1,,AnBA_1,\dots,A_n \models B. Consider any assignment. If it makes all AiA_i true, then by hypothesis it makes BB true, so the implication reads TT=T\text{T}\to\text{T}=\text{T}. If it makes some AiA_i false, the antecedent is false and the implication reads F()=T\text{F}\to(\cdot)=\text{T}. Either way the implication is true, so it is a tautology. ∎

This is exactly the schema on the slides: ABA \to B and, more generally, A1A2AnBA_1 \wedge A_2 \wedge \dots \wedge A_n \to B. It is what makes deductive proof trustworthy: certify once (by a truth table, or algebraically) that a given implication is a tautology, and you may use it forever as a licence to write BB beneath any premises matching A1,,AnA_1, \dots, A_n — regardless of what the letters concretely mean. Truth is transmitted from premises to conclusion.

Definition (deductive / truth-preserving reasoning). Reasoning in which the conclusion is guaranteed true whenever the premises are true. It contrasts with inductive/empirical reasoning (a physicist generalizing from experiments), where true premises make a conclusion only probable. Everything in this lecture is deductive.

Remark (soundness in one sentence). A rule of inference is called sound precisely when its guaranteeing implication is a tautology. Soundness is the whole game: an unsound “rule” can lead from true premises to a false conclusion, and a single such rule would let us “prove” anything. This is why §7.16’s fallacies are dangerous — they are unsound rules dressed up to look sound.

7.3 Rules of inference

Definition (rule of inference). A rule of inference is a fixed pattern “premises \Rightarrow conclusion” whose associated implication is a tautology. We write a rule as a fraction: premises above the line, conclusion below.

A1A2An  B\frac{A_1 \quad A_2 \quad \dots \quad A_n}{\therefore\; B}

Four core rules of inference: modus ponens, modus tollens, hypothetical and disjunctive syllogism

The table below lists the standard propositional rules. The middle column gives the “introduction/elimination” names used on the slides (Ukrainian axiomatic tradition), the last column the guaranteeing tautology — you can verify any of them with a truth table.

Rule (standard name) Slide name Premises Conclusion Guaranteeing tautology
Modus ponens Separation rule A,  ABA,\; A \to B BB (A(AB))B\big(A \wedge (A\to B)\big)\to B
Modus tollens Negative separation rule AB,  ¬BA \to B,\; \neg B ¬A\neg A ((AB)¬B)¬A\big((A\to B)\wedge \neg B\big)\to \neg A
Hypothetical syllogism Hypothetical syllogism AB,  BCA \to B,\; B \to C ACA \to C ((AB)(BC))(AC)\big((A\to B)\wedge(B\to C)\big)\to(A\to C)
Disjunctive syllogism Removing disjunction AB,  ¬AA \vee B,\; \neg A BB ((AB)¬A)B\big((A\vee B)\wedge \neg A\big)\to B
Addition Including disjunction AA ABA \vee B A(AB)A \to (A\vee B)
Simplification Removing conjunction ABA \wedge B AA (AB)A(A\wedge B)\to A
Conjunction Including conjunction A,  BA,\; B ABA \wedge B (AB)(AB)\big(A \wedge B\big)\to(A\wedge B)
Resolution AB,  ¬ACA \vee B,\; \neg A \vee C BCB \vee C ((AB)(¬AC))(BC)\big((A\vee B)\wedge(\neg A\vee C)\big)\to(B\vee C)
Contraposition Implication contraposition ABA \to B ¬B¬A\neg B \to \neg A (AB)(¬B¬A)(A\to B)\leftrightarrow(\neg B\to \neg A)

A few remarks on the most important rules:

  • Modus ponens (A, ABBA,\ A\to B \therefore B) is the workhorse rule; in the axiomatic tradition it is called the separation rule because it “separates” BB off the implication. Almost every direct proof is a chain of modus ponens steps.
  • Modus tollens propagates falsity backwards: knowing the consequent fails, the antecedent must fail too. It is the engine of proof by contraposition (§7.8).
  • Disjunctive syllogism is elimination by ruling out alternatives (“it is AA or BB; it is not AA; therefore BB”). It powers proof by cases when one case is excluded.
  • Resolution is the single rule on which automated theorem provers and SAT solvers are built (see §7.5). From ABA \vee B and ¬AC\neg A \vee C, the complementary pair A/¬AA / \neg A “cancels,” leaving BCB \vee C. Disjunctive syllogism is the special case where CC is empty.

Verifying a rule (worked example). Let us confirm modus tollens is sound by truth table, i.e. that ((AB)¬B)¬A\big((A\to B)\wedge \neg B\big)\to \neg A is a tautology.

AA BB ABA\to B ¬B\neg B (AB)¬B(A\to B)\wedge\neg B ¬A\neg A whole \to
F F T T T T T
F T T F F T T
T F F T F F T
T T T F F F T

The last column is all T, so the rule is sound. Notice the only row where the antecedent (AB)¬B(A\to B)\wedge\neg B is true is the first, and there ¬A\neg A is also true — exactly as the Justification theorem predicts.

3.1 Rules of inference for quantified statements

Ordinary mathematics quantifies over infinite domains (“for all integers nn…”, “there exists a real xx…”), so we also need rules that strip and attach quantifiers. These are used silently in every proof below.

Rule From Infer Caveat
Universal instantiation xP(x)\forall x\, P(x) P(c)P(c) cc any element of the domain
Universal generalization P(c)P(c) with cc arbitrary xP(x)\forall x\, P(x) cc must be genuinely arbitrary — no special assumptions about it
Existential instantiation xP(x)\exists x\, P(x) P(c)P(c) cc a new name for some witness
Existential generalization P(c)P(c) for some particular cc xP(x)\exists x\, P(x)

Common pitfall (universal generalization). To prove “xP(x)\forall x\, P(x)” by taking an arbitrary cc and proving P(c)P(c), you may assume nothing about cc beyond membership in the domain. If your argument secretly uses “let cc be even” or “let c=0c=0”, you have proved only a special case, not the universal statement.

7.4 Formal derivations from premises

Definition (formal derivation). A formal derivation (proof) of BB from premises Γ={A1,,An}\Gamma = \{A_1, \dots, A_n\}, written ΓB\Gamma \vdash B, is a finite numbered list of formulas ending in BB, where each line is either a premise or is obtained from earlier lines by a rule of inference. Every line carries a justification naming the rule and the line numbers used.

The turnstile \vdash (“yields”, provability, a syntactic notion) mirrors \models (“entails”, a semantic notion). Because our rules are exactly the tautological ones, the two agree: ΓB\Gamma \vdash B precisely when ΓB\Gamma \models B. That two-way agreement is the soundness (\vdash \Rightarrow \models) and completeness (\models \Rightarrow \vdash) of propositional calculus.

Example 7.1 (a complete derivation). Show that {pq,  qr,  ¬r,  ps}s\{\,p \to q,\ \ q \to r,\ \ \neg r,\ \ p \vee s\,\} \vdash s.

# Formula Justification
1 pqp \to q premise
2 qrq \to r premise
3 ¬r\neg r premise
4 psp \vee s premise
5 prp \to r hypothetical syllogism, 1, 2
6 ¬p\neg p modus tollens, 5, 3
7 ss disjunctive syllogism, 4, 6

Each step is licensed by a rule from the table, so line 7 is established: ss follows from the four premises. ∎

Example 7.2 (a derivation using conjunction and simplification). Show {pq,  pr,  qt}rt\{\,p \wedge q,\ \ p \to r,\ \ q \to t\,\} \vdash r \wedge t.

# Formula Justification
1 pqp \wedge q premise
2 prp \to r premise
3 qtq \to t premise
4 pp simplification, 1
5 qq simplification, 1
6 rr modus ponens, 2, 4
7 tt modus ponens, 3, 5
8 rtr \wedge t conjunction, 6, 7

Example 7.3 (a derivation with quantifiers — the Socrates syllogism). From “All humans are mortal” and “Socrates is human,” derive “Socrates is mortal.” Let H(x)H(x) mean “xx is human” and M(x)M(x)xx is mortal.”

# Formula Justification
1 x(H(x)M(x))\forall x\,(H(x) \to M(x)) premise
2 H(Socrates)H(\text{Socrates}) premise
3 H(Socrates)M(Socrates)H(\text{Socrates}) \to M(\text{Socrates}) universal instantiation, 1
4 M(Socrates)M(\text{Socrates}) modus ponens, 3, 2

Common pitfall (order and scope). A line may cite only lines above it. You cannot justify line 5 using line 7. And a rule must match its pattern exactly: to apply modus ponens you need both AA and the whole implication ABA \to B present on earlier lines — having AA and BAB\to A does not license anything.

7.5 The resolution rule and refutation

Resolution deserves its own section because it is the basis of practical automated reasoning. It operates on formulas in conjunctive normal form (CNF) — a conjunction of clauses, where each clause is a disjunction of literals (variables or negated variables).

Definition (resolution rule). From two clauses that contain a complementary pair of literals,

(AB)(¬AC)  BC,\frac{(A \vee B) \qquad (\neg A \vee C)}{\therefore\; B \vee C},

infer the resolvent BCB \vee C, obtained by deleting the complementary pair A,¬AA, \neg A and disjoining what remains. Resolving AA with ¬A\neg A alone yields the empty clause \square, which represents \bot (falsehood).

The resolution rule: cancel the complementary pair A / ¬A to obtain the resolvent B ∨ C

Refutation. To prove ΓB\Gamma \vdash B by resolution, one shows that Γ{¬B}\Gamma \cup \{\neg B\} is unsatisfiable: convert everything to CNF and derive the empty clause \square. Reaching \square means the premises together with the negation of the goal are contradictory, so the goal follows. This is proof by refutation, the contradiction method (§7.9) mechanized.

Example 7.4 (resolution refutation). Prove {pq, qr, p}r\{\,p \to q,\ q \to r,\ p\,\} \vdash r.

Negate the goal and convert to clauses. Using pq¬pqp \to q \equiv \neg p \vee q:

{ ¬pq,¬qr,p,¬r }.\{\ \neg p \vee q,\quad \neg q \vee r,\quad p,\quad \neg r\ \}.

Now resolve:

# Clause From
1 ¬pq\neg p \vee q premise (pqp\to q)
2 ¬qr\neg q \vee r premise (qrq\to r)
3 pp premise
4 ¬r\neg r negated goal
5 qq resolve 3 & 1 (on pp)
6 rr resolve 5 & 2 (on qq)
7 \square resolve 6 & 4 (on rr)

The empty clause appears, so {pq, qr, p, ¬r}\{p\to q,\ q\to r,\ p,\ \neg r\} is unsatisfiable; therefore rr follows from the three premises. ∎

Remark (why CS cares). A SAT solver decides whether a CNF formula is satisfiable; modern solvers use conflict-driven clause learning, a refined resolution. Resolution refutation underlies logic programming (Prolog’s execution model is a restricted resolution called SLD-resolution) and many verification tools. That an entire industry rests on one tautology is a striking illustration of §7.2.

7.6 The substitution rule and propositional calculus

Beyond rules that combine whole formulas, we need a rule that lets us instantiate a proven schema.

Definition (substitution rule). Let F1F_1 be a propositional formula and AA an atomic formula (a single propositional variable). If F1F_1 is a tautology (or theorem) containing AA, then the formula obtained by replacing every occurrence of AA in F1F_1 by an arbitrary formula F2F_2 is again a tautology (theorem). The replacement must be uniform: all occurrences of AA, and only AA, are replaced. (This is distinct from the replacement rule of Lecture 6, Theorem 6.6, which swaps a subformula for a logically equivalent one; here an atom is replaced by an arbitrary formula.)

For example, from the tautology A¬AA \vee \neg A we may substitute A:=(pq)A := (p \wedge q) to obtain the tautology (pq)¬(pq)(p\wedge q)\vee \neg(p\wedge q).

Common pitfall. Non-uniform substitution destroys validity. From the tautology AAA \to A, replacing only the first AA by pqp\wedge q gives (pq)A(p \wedge q) \to A, which is not a tautology (false when p,qp, q true and AA false).

These ideas let us define an axiomatic propositional calculus as a triple:

  • Language — the set of well-formed formulas built from propositional variables and connectives, e.g. over connective set {,¬}\{\to, \neg\}.
  • Postulates (axiom schemas) — a chosen set of universally valid formulas taken as starting points. A classic three-schema (Hilbert-style) system is

A1: A(BA),\textbf{A1: } A \to (B \to A),

A2: (A(BC))((AB)(AC)),\textbf{A2: } \big(A \to (B \to C)\big) \to \big((A \to B) \to (A \to C)\big),

A3: (¬B¬A)(AB).\textbf{A3: } (\neg B \to \neg A) \to (A \to B).

  • Rules — laws for producing new theorems from old, here just the separation rule (modus ponens) and the substitution rule.

A theorem of the calculus is any formula obtainable from the postulates by finitely many applications of the rules. This is the purely syntactic face of logic: theorems are generated by symbol manipulation, and the completeness theorem guarantees that the theorems are exactly the tautologies.

We now leave the formal calculus and study the informal but rigorous proofs of everyday mathematics. Every technique below is ultimately justified by the rules above; we simply stop writing out each line.

7.7 Direct proof

Definition (direct proof). To prove an implication pqp \to q, assume pp is true and, through a chain of valid inferences and definitions, derive that qq is true. (An unconditional statement is proved the same way, with no antecedent to assume.)

We use two standard definitions throughout: an integer nn is even if n=2kn = 2k for some integer kk, and odd if n=2k+1n = 2k+1 for some integer kk. An integer aa divides bb (written aba \mid b) if b=acb = ac for some integer cc.

Example 7.5. If nn is an odd integer, then n2n^2 is odd.

Proof. Assume nn is odd, so n=2k+1n = 2k + 1 for some integer kk. Then

n2=(2k+1)2=4k2+4k+1=2(2k2+2k)+1.n^2 = (2k+1)^2 = 4k^2 + 4k + 1 = 2\,(2k^2 + 2k) + 1.

Put t=2k2+2kt = 2k^2 + 2k, an integer. Then n2=2t+1n^2 = 2t + 1, which is by definition odd. ∎

Example 7.6. The sum of two even integers is even.

Proof. Let a,ba, b be even, say a=2sa = 2s and b=2tb = 2t for integers s,ts, t. Then a+b=2s+2t=2(s+t)a + b = 2s + 2t = 2(s+t), and s+ts+t is an integer, so a+ba+b is even. ∎

Example 7.7 (transitivity of divisibility). For all integers a,b,ca, b, c: if aba \mid b and bcb \mid c, then aca \mid c.

Proof. Assume aba \mid b and bcb \mid c. Then b=asb = a s and c=btc = b t for some integers s,ts, t. Substituting, c=bt=(as)t=a(st)c = b t = (a s) t = a (s t). Since stst is an integer, aca \mid c. ∎

Example 7.8. If nn is even, then (1)n=1(-1)^n = 1.

Proof. Assume nn is even, so n=2kn = 2k. Then (1)n=(1)2k=((1)2)k=1k=1.(-1)^n = (-1)^{2k} = \big((-1)^2\big)^k = 1^k = 1.

Example 7.9 (a sharper fact needing a lemma). If nn is odd, then n21(mod8)n^2 \equiv 1 \pmod 8 — that is, 8(n21)8 \mid (n^2 - 1).

Proof. First a lemma: the product of two consecutive integers m(m+1)m(m+1) is always even. Indeed, one of m,m+1m, m+1 is even; if m=2jm = 2j then m(m+1)=2j(m+1)m(m+1) = 2j(m+1), and if m+1=2jm+1 = 2j then m(m+1)=2jmm(m+1) = 2jm — either way the product is 2×(integer)2\times(\text{integer}).

Now assume nn is odd, n=2k+1n = 2k+1. Then

n2=4k2+4k+1=4k(k+1)+1.n^2 = 4k^2 + 4k + 1 = 4k(k+1) + 1.

By the lemma k(k+1)k(k+1) is even, say k(k+1)=2mk(k+1) = 2m. Hence n2=4(2m)+1=8m+1n^2 = 4(2m) + 1 = 8m + 1, so n21=8mn^2 - 1 = 8m and 8(n21)8 \mid (n^2-1). ∎

Remark (trivial and vacuous proofs). Two degenerate but legitimate direct proofs of pqp \to q deserve names. A trivial proof establishes qq outright, without using pp at all (then pqp\to q is automatically true). A vacuous proof shows pp is false, so pqp \to q is true “by default.” Example (vacuous): “If nn is both even and odd, then n=n+1n = n+1 is true because no integer is both even and odd — the hypothesis is never satisfied.

7.1 Biconditionals and equivalences (iff, TFAE)

To prove a biconditional P    QP\iff Q, prove the two implications separately: PQP\Rightarrow Q and QPQ\Rightarrow P (each by whatever method fits — direct, contrapositive, or contradiction). Both directions are required; proving only one is the single most common gap. Example:nn is even     n2\iff n^2 is even” needs n evenn2 evenn\text{ even}\Rightarrow n^2\text{ even} (direct) and n2 evenn evenn^2\text{ even}\Rightarrow n\text{ even} (contrapositive: nn odd n2\Rightarrow n^2 odd).

To prove several statements all equivalent — “TFAE: P1,,PkP_1,\dots,P_k” — it suffices to prove one cycle of implications P1P2PkP1P_1\Rightarrow P_2\Rightarrow\cdots \Rightarrow P_k\Rightarrow P_1: any statement then implies any other by following the cycle. That is kk implications instead of the k(k1)k(k-1) ordered pairs.

7.8 Proof by contraposition

Definition (proof by contraposition). Instead of proving pqp \to q directly, prove its contrapositive ¬q¬p\neg q \to \neg p. The two are logically equivalent, so a proof of one is a proof of the other.

Contraposition: prove ¬Q → ¬P instead of P → Q

The equivalence is itself a tautology, confirmed by the truth table:

pp qq pqp \to q ¬q¬p\neg q \to \neg p
F F T T
F T T T
T F F F
T T T T

Columns 3 and 4 are identical, so pq¬q¬pp \to q \equiv \neg q \to \neg p. Contraposition is the method of choice when the negated statements are easier to compute with than the originals — typically when qq is a negative or existential claim.

Common pitfall (contrapositive vs. converse). The contrapositive of pqp \to q is ¬q¬p\neg q \to \neg p (equivalent). The converse is qpq \to p and the inverse is ¬p¬q\neg p \to \neg q (both not equivalent to the original). Proving the converse proves a different statement. Confusing “if” with “only if” is one of the most common errors in student proofs.

Example 7.10. For integers, if n2n^2 is even then nn is even.

Proof (contraposition). The contrapositive is: if nn is odd then n2n^2 is odd, which is Example 7.5. Since the contrapositive is true, so is the original. ∎

Example 7.11. For integers, if 3n+23n + 2 is odd then nn is odd.

Proof (contraposition). Contrapositive: if nn is even then 3n+23n+2 is even. Assume n=2kn = 2k. Then 3n+2=6k+2=2(3k+1)3n + 2 = 6k + 2 = 2(3k+1), which is even. The contrapositive holds, hence so does the original. ∎

Example 7.12. For all positive real numbers n,mn, m: if nm>100nm > 100, then n>10n > 10 or m>10m > 10.

Proof (contraposition). The contrapositive is if n10n \le 10 and m10m \le 10, then nm100nm \le 100. (Here ¬(n>10m>10)\neg(n>10 \vee m>10) becomes n10m10n\le 10 \wedge m \le 10 by De Morgan, and ¬(nm>100)\neg(nm>100) becomes nm100nm \le 100.) Assume 0<n100 < n \le 10 and 0<m100 < m \le 10. Multiplying the inequalities by positive quantities,

n10  nm10m,m10  10m100.n \le 10 \ \Rightarrow\ nm \le 10m, \qquad m \le 10 \ \Rightarrow\ 10m \le 100.

Chaining, nm10m100nm \le 10m \le 100. Having proved the contrapositive, the original implication holds. ∎

Remark. Example 7.12 shows why contraposition helps: the original conclusion is a disjunction (“n>10n>10 or m>10m>10”), awkward to prove directly, whereas its negation is a conjunction of two clean inequalities we can just multiply.

7.9 Proof by contradiction (reductio ad absurdum)

Definition (proof by contradiction). To prove a statement pp, assume its negation ¬p\neg p and derive a contradiction — a formula of the form r¬rr \wedge \neg r, i.e. \bot. Since (¬p)(\neg p \to \bot) forces pp to be true, pp is established.

Proof by contradiction: assume the negation, derive an absurdity (⊥)

The engine is the tautology (¬p(r¬r))p\big(\neg p \to (r \wedge \neg r)\big) \to p. To prove an implication pqp \to q by contradiction, assume p¬qp \wedge \neg q and derive \bot; the only row where pqp \to q is false is pp true, qq false, and that is exactly what we rule out:

pp qq pqp \to q
F F T
F T T
T F F
T T T

Example 7.13 (a classic). 2\sqrt{2} is irrational.

Proof. Suppose, for contradiction, that 2\sqrt{2} is rational. Then it can be written in lowest terms as

2=mn,m,nZ,  n0,  gcd(m,n)=1.\sqrt{2} = \frac{m}{n}, \qquad m, n \in \mathbb{Z},\ \ n \neq 0,\ \ \gcd(m, n) = 1.

Squaring, 2=m2/n22 = m^2/n^2, hence m2=2n2m^2 = 2n^2. So m2m^2 is even, and therefore mm is even (Example 7.10). Write m=2km = 2k. Substituting,

(2k)2=2n2  4k2=2n2  n2=2k2,(2k)^2 = 2n^2 \ \Rightarrow\ 4k^2 = 2n^2 \ \Rightarrow\ n^2 = 2k^2,

so n2n^2 is even and hence nn is even. But then 22 divides both mm and nn, contradicting gcd(m,n)=1\gcd(m, n) = 1. The assumption is untenable, so 2\sqrt{2} is irrational. ∎

Example 7.14 (Euclid’s theorem, ca. 300 BCE). There are infinitely many primes.

Proof. Suppose, for contradiction, that there are only finitely many primes, listed as p1,p2,,pnp_1, p_2, \dots, p_n. Consider the number

N=p1p2pn+1.N = p_1 p_2 \cdots p_n + 1.

Since N>1N > 1, it has at least one prime divisor pp (this fact is proved in Example 7.26). That pp must be one of p1,,pnp_1, \dots, p_n, since those are supposedly all the primes. But then pNp \mid N and pp1p2pn=N1p \mid p_1 p_2 \cdots p_n = N - 1, so p(N(N1))=1p \mid \big(N - (N-1)\big) = 1. No prime divides 11 — contradiction. Hence there are infinitely many primes. ∎

Common pitfall. Euclid’s argument does not claim N=p1pn+1N = p_1\cdots p_n + 1 is itself prime. It only needs NN to have some prime factor outside the list. Indeed NN can be composite: 23571113+1=30031=59×5092\cdot3\cdot5\cdot7\cdot11\cdot13 + 1 = 30031 = 59 \times 509. Students often misremember this as “the product of the first kk primes plus one is prime,” which is false.

Example 7.15. There is no smallest positive rational number.

Proof. Suppose, for contradiction, that rr is the smallest positive rational. Then r/2r/2 is also rational (a quotient of rationals) and positive, yet r/2<rr/2 < r. This contradicts the minimality of rr. Hence no smallest positive rational exists. ∎

Example 7.16. log23\log_2 3 is irrational.

Proof. Suppose log23\log_2 3 is rational. Since log23>0\log_2 3 > 0, write log23=p/q\log_2 3 = p/q with positive integers p,qp, q. Then 2p/q=32^{p/q} = 3, so raising to the qq-th power, 2p=3q2^{p} = 3^{q}. The left side 2p2^p is even (as p1p \ge 1), while the right side 3q3^q is odd. An even number cannot equal an odd number — contradiction. Hence log23\log_2 3 is irrational. ∎

Remark (contradiction vs. contraposition). They are close cousins but not identical. Contraposition proves pqp\to q by proving ¬q¬p\neg q \to \neg p with a direct argument and no contradiction. Contradiction is more general (it proves any statement, not just implications) but is often criticized for being less informative: it tells you that something is impossible without always revealing why constructively. Where a direct or contrapositive proof is available, many mathematicians prefer it.

7.10 Proof by cases and exhaustion

Definition (proof by cases). Split the hypothesis into finitely many exhaustive cases C1,,CkC_1, \dots, C_k (whose disjunction C1CkC_1 \vee \dots \vee C_k is always true) and prove the conclusion separately in each. It rests on the tautology

((C1q)(Ckq))(C1Ck)    q.\Big((C_1 \to q) \wedge \dots \wedge (C_k \to q)\Big) \wedge (C_1 \vee \dots \vee C_k) \;\to\; q.

Definition (proof by exhaustion). The special case in which the domain is finite and small enough that we simply check every element.

Common pitfall. The cases must be exhaustive — their disjunction must cover every possibility. Forgetting a case (e.g. handling x>0x>0 and x<0x<0 but not x=0x=0) leaves a hole in the proof. The cases need not be mutually exclusive, but they must together cover everything.

Example 7.17 (exhaustion). (n+1)33n(n+1)^3 \ge 3^n for every natural number nn with 1n41 \le n \le 4.

Proof. The domain {1,2,3,4}\{1,2,3,4\} is finite; check each.

nn (n+1)3(n+1)^3 3n3^n (n+1)33n(n+1)^3 \ge 3^n?
1 88 33
2 2727 99
3 6464 2727
4 125125 8181

All four hold. ∎ (The inequality fails at n=5n=5: 63=216<243=356^3 = 216 < 243 = 3^5 — which is exactly why the hypothesis restricts n4n \le 4.)

Example 7.18. For every integer nn, n20n^2 \equiv 0 or 1(mod4)1 \pmod 4.

Proof (two cases on parity). Case 1: nn even. Then n=2kn = 2k, so n2=4k20(mod4)n^2 = 4k^2 \equiv 0 \pmod 4. Case 2: nn odd. Then n=2k+1n = 2k+1, so n2=4k2+4k+1=4(k2+k)+11(mod4)n^2 = 4k^2 + 4k + 1 = 4(k^2+k) + 1 \equiv 1 \pmod 4. Every integer is even or odd, so the cases are exhaustive and n20n^2 \equiv 0 or 1(mod4)1 \pmod 4 always. ∎ (Corollary: no integer of the form 4m+24m + 2 or 4m+34m+3 is a perfect square.)

Example 7.19. Every prime p>3p > 3 has the form 6k+16k+1 or 6k+56k+5 (equivalently 6k±16k \pm 1).

Proof. Any integer is exactly one of 6k,6k+1,6k+2,6k+3,6k+4,6k+56k, 6k+1, 6k+2, 6k+3, 6k+4, 6k+5. We rule out four cases for a prime p>3p > 3:

  • 6k6k, 6k+26k+2, 6k+46k+4 are all even, hence divisible by 22; since p>3>2p > 3 > 2, such pp would be composite.
  • 6k+3=3(2k+1)6k+3 = 3(2k+1) is divisible by 33; since p>3p > 3, such pp would be composite.

The only remaining forms are 6k+16k+1 and 6k+56k+5, so a prime p>3p > 3 must be one of these. ∎

Example 7.20 (cases via “without loss of generality”). For all real numbers x,yx, y: x+yx+y|x + y| \le |x| + |y| (the triangle inequality).

Proof. Recall aa|a| \ge a and aa|a| \ge -a for every real aa; equivalently aaa-|a| \le a \le |a|. Adding the inequalities xxx-|x| \le x \le |x| and yyy-|y| \le y \le |y| gives

(x+y)x+yx+y.-\big(|x|+|y|\big) \le x + y \le |x| + |y|.

A number tt satisfying ctc-c \le t \le c (with c0c \ge 0) satisfies tc|t| \le c. Taking t=x+yt = x+y and c=x+yc = |x|+|y| yields x+yx+y|x+y| \le |x| + |y|. ∎ (This packages the four sign-cases x,y0x,y \gtrless 0 into one uniform argument — the phrase “without loss of generality” often signals such a compression.)

7.11 Mathematical induction (weak form)

Definition (mathematical induction, weak form). To prove that a statement P(n)P(n) holds for every integer nan \ge a, establish two obligations:

  • Base step — show P(a)P(a) is true.
  • Inductive step — show that for every kak \ge a, if P(k)P(k) is true (the inductive hypothesis, IH), then P(k+1)P(k+1) is true.

If both hold, then P(n)P(n) is true for all nan \ge a.

Intuitively, the base step knocks over the first domino, and the inductive step guarantees each domino knocks over the next; so every domino falls. Formally, induction is one of the Peano axioms characterizing the natural numbers — it is not derived from more basic principles but assumed as part of what N\mathbb{N} means.

The domino metaphor for induction: the base case tips the first domino and each step tips the next

Common pitfall (never skip the base step). Both steps are essential. Consider the false claim P(n)P(n): “n=n+1n = n+1.” Its inductive step actually goes through: if k=k+1k = k+1 then adding 11 gives k+1=k+2k+1 = k+2, i.e. P(k+1)P(k+1). Yet P(n)P(n) is false for every nn, because the base step fails. An inductive step with no valid base proves nothing.

Example 7.21 (arithmetic series). For every integer n1n \ge 1, 1+2++n=n(n+1)2.\displaystyle 1 + 2 + \dots + n = \frac{n(n+1)}{2}.

Proof. Base (n=1n=1): the left side is 11; the right side is 122=1\tfrac{1\cdot 2}{2} = 1. Equal, so P(1)P(1) holds. Inductive step: assume for some k1k \ge 1 that 1+2++k=k(k+1)21 + 2 + \dots + k = \tfrac{k(k+1)}{2} (IH). Then

1+2++k+(k+1)=k(k+1)2+(k+1)=k(k+1)+2(k+1)2=(k+1)(k+2)2,1 + 2 + \dots + k + (k+1) = \frac{k(k+1)}{2} + (k+1) = \frac{k(k+1) + 2(k+1)}{2} = \frac{(k+1)(k+2)}{2},

which is P(k+1)P(k+1). By induction the formula holds for all n1n \ge 1. ∎

Example 7.22 (sum of odd numbers). For every integer n1n \ge 1, 1+3+5++(2n1)=n2.\displaystyle 1 + 3 + 5 + \dots + (2n-1) = n^2.

Proof. Base (n=1n=1): left side =1= 1, right side =12=1= 1^2 = 1. ✓ Inductive step: assume 1+3++(2k1)=k21 + 3 + \dots + (2k-1) = k^2 (IH). The (k+1)(k+1)-th odd number is 2(k+1)1=2k+12(k+1)-1 = 2k+1, so

1+3++(2k1)=k2 by IH+(2k+1)=k2+2k+1=(k+1)2,\underbrace{1 + 3 + \dots + (2k-1)}_{=\,k^2\ \text{by IH}} + (2k+1) = k^2 + 2k + 1 = (k+1)^2,

which is P(k+1)P(k+1). By induction the identity holds for all n1n \ge 1. ∎

Example 7.23 (sum of squares). For every integer n1n \ge 1, 12+22++n2=n(n+1)(2n+1)6.\displaystyle 1^2 + 2^2 + \dots + n^2 = \frac{n(n+1)(2n+1)}{6}.

Proof. Base (n=1n=1): left =1=1, right =1236=1= \tfrac{1\cdot 2\cdot 3}{6} = 1. ✓ Inductive step: assume i=1ki2=k(k+1)(2k+1)6\sum_{i=1}^{k} i^2 = \tfrac{k(k+1)(2k+1)}{6} (IH). Then

i=1k+1i2=k(k+1)(2k+1)6+(k+1)2=(k+1)[k(2k+1)+6(k+1)]6=(k+1)(2k2+7k+6)6.\sum_{i=1}^{k+1} i^2 = \frac{k(k+1)(2k+1)}{6} + (k+1)^2 = \frac{(k+1)\big[k(2k+1) + 6(k+1)\big]}{6} = \frac{(k+1)(2k^2 + 7k + 6)}{6}.

Factoring 2k2+7k+6=(k+2)(2k+3)2k^2 + 7k + 6 = (k+2)(2k+3) gives (k+1)(k+2)(2k+3)6\tfrac{(k+1)(k+2)(2k+3)}{6}, which is the formula with n=k+1n = k+1. By induction it holds for all n1n \ge 1. ∎

Example 7.24 (a divisibility result). For every integer n1n \ge 1, 6(n3n)6 \mid (n^3 - n).

Proof. Base (n=1n=1): 131=01^3 - 1 = 0, and 606 \mid 0. ✓ Inductive step: assume 6(k3k)6 \mid (k^3 - k) (IH). Then

(k+1)3(k+1)=k3+3k2+3k+1k1=(k3k)+3k2+3k=(k3k)+3k(k+1).(k+1)^3 - (k+1) = k^3 + 3k^2 + 3k + 1 - k - 1 = (k^3 - k) + 3k^2 + 3k = (k^3 - k) + 3k(k+1).

The first term is divisible by 66 by the IH. For the second, k(k+1)k(k+1) is a product of consecutive integers, hence even (lemma of Example 7.9), so 3k(k+1)3k(k+1) is divisible by 66. A sum of two multiples of 66 is a multiple of 66, so 6((k+1)3(k+1))6 \mid \big((k+1)^3 - (k+1)\big). By induction 6(n3n)6 \mid (n^3 - n) for all n1n \ge 1. ∎

Example 7.25 (an inequality, non-unit base). For every integer n4n \ge 4, 2n<n!2^n < n!.

Proof. Base (n=4n = 4): 24=16<24=4!2^4 = 16 < 24 = 4!. ✓ (Note the base is n=4n=4, not 11: the claim is false for n3n \le 3, since 23=8>6=3!2^3 = 8 > 6 = 3!.) Inductive step: assume 2k<k!2^k < k! for some k4k \ge 4 (IH). Then

2k+1=22k<2k!<(k+1)k!=(k+1)!,2^{k+1} = 2\cdot 2^k < 2 \cdot k! < (k+1)\cdot k! = (k+1)!,

where the middle inequality uses the IH and the last uses k+1>2k + 1 > 2 (true since k4k \ge 4). Hence 2k+1<(k+1)!2^{k+1} < (k+1)!. By induction 2n<n!2^n < n! for all n4n \ge 4. ∎

Remark (choosing the base). Induction proves “P(n)P(n) for all nan \ge a” for whatever starting value aa makes the base step true. Example 7.25 illustrates that the natural starting point is not always 11 — you begin where the statement first holds.

7.12 Strong induction

Definition (strong induction / complete induction). To prove P(n)P(n) for all nan \ge a:

  • Base step — show P(a)P(a) (and possibly a few more initial values) is true.
  • Inductive step — show that for every kak \ge a, if P(a),P(a+1),,P(k)P(a), P(a+1), \dots, P(k) are all true, then P(k+1)P(k+1) is true.

The difference from weak induction is the strength of the hypothesis: you may assume the statement for all smaller values, not just the immediately preceding one.

Weak and strong induction are logically equivalent (each can be derived from the other, and both from the well-ordering principle: every nonempty set of positive integers has a least element). Strong induction is the natural tool when P(k+1)P(k+1) depends on a value further back than P(k)P(k) — for instance, when a number factors into two smaller-but-unpredictable pieces.

Example 7.26 (every integer 2\ge 2 has a prime factor). Every integer n2n \ge 2 is divisible by some prime.

Proof (strong induction). Base (n=2n = 2): 22 is prime and 222 \mid 2. ✓ Inductive step: let k2k \ge 2 and assume every integer mm with 2mk2 \le m \le k has a prime factor (IH). Consider k+1k+1.

  • If k+1k+1 is prime, then k+1k+1 is a prime factor of itself.
  • If k+1k+1 is composite, then k+1=abk+1 = a b with integers 2a,bk2 \le a, b \le k. By the IH (applied to aa), aa has a prime factor pp. Since pap \mid a and a(k+1)a \mid (k+1), transitivity of divisibility (Example 7.7) gives p(k+1)p \mid (k+1).

Either way k+1k+1 has a prime factor. By strong induction every integer 2\ge 2 has one. ∎ (This is the fact borrowed in Euclid’s proof, Example 7.14, and it needs the full smaller-than-k+1k+1 hypothesis — hence strong induction.)

Example 7.27 (existence of prime factorizations). Every integer n2n \ge 2 can be written as a product of primes.

Proof (strong induction). Base (n=2n=2): 22 is prime, a product of one prime. ✓ Inductive step: assume every integer mm with 2mk2 \le m \le k is a product of primes. Consider k+1k+1.

  • If k+1k+1 is prime, it is already such a product.
  • If k+1=abk+1 = ab with 2a,bk2 \le a, b \le k, then by the IH both aa and bb are products of primes; concatenating those factorizations expresses k+1k+1 as a product of primes.

By strong induction every integer 2\ge 2 is a product of primes. ∎ (This is the existence half of the Fundamental Theorem of Arithmetic; uniqueness of the factorization requires more work.)

Example 7.28 (a “postage stamp” / representation result). Every integer n12n \ge 12 can be written as 4a+5b4a + 5b for some nonnegative integers a,ba, b (i.e. paid with 4-cent and 5-cent stamps).

Proof (strong induction with several base cases). Base cases n=12,13,14,15n = 12, 13, 14, 15:

12=43,13=42+5,14=4+52,15=53. 12 = 4\cdot 3,\quad 13 = 4\cdot 2 + 5,\quad 14 = 4 + 5\cdot 2,\quad 15 = 5\cdot 3. \ \checkmark

Inductive step: let k15k \ge 15 and assume every integer mm with 12mk12 \le m \le k is representable (IH). Consider k+1k+1. Since k+116k + 1 \ge 16, we have k+14=k312k+1-4 = k-3 \ge 12, and also k3kk - 3 \le k, so by the IH k3=4a+5bk-3 = 4a + 5b for some a,b0a, b \ge 0. Then k+1=4(a+1)+5bk+1 = 4(a+1) + 5b, a valid representation. By strong induction every n12n \ge 12 is representable. ∎

Common pitfall (too few base cases). In Example 7.28 the inductive step reaches back four units (nn4n \to n-4), so it needs four consecutive base cases 12,13,14,1512,13,14,15 to get started; a single base case would leave 13,14,1513, 14, 15 unproved. Strong induction problems frequently require you to verify enough initial values to “feed” the inductive step.

Well-ordering and the “least counterexample”. Strong induction is equivalent to the well-ordering principle: every non-empty set of positive integers has a least element. This licenses a clean proof shape — to show P(n)P(n) for all nn, suppose the set of counterexamples is non-empty, take its least element mm, and derive a contradiction (typically by producing a smaller counterexample, or by invoking P(k)P(k) for all k<mk<m). Example: every integer n>1n>1 has a prime factor — otherwise a least counterexample mm is composite, m=abm=ab with 1<a<m1<a<m; by minimality aa has a prime factor, which then divides mm, a contradiction.

7.13 Induction in computer science: correctness and loop invariants

Induction is the mathematical backbone of program correctness. Two ideas recur:

Recursion mirrors induction. A recursive function that reduces its input toward a base case is proved correct exactly as a theorem is proved by induction: verify the base case(s), then assume the recursive calls are correct (the inductive hypothesis) and show the combining step is correct.

Loop invariants. A loop invariant is a statement that holds before the loop and is preserved by each iteration. Proving a loop correct is proving the invariant by induction on the number of iterations, then reading off the result at termination.

A loop invariant holds before the loop and is preserved by every iteration

Example 7.29 (correctness of an iterative factorial). Consider:

function factorial(n):        // assume n >= 0
    f := 1
    i := 1
    while i <= n:
        f := f * i
        i := i + 1
    return f

Claim. On termination, factorial(n) returns n!n!.

Proof. Take the loop invariant II: “at the top of the while-test, f=(i1)!f = (i-1)!.”

  • Initialization (base). Before the first test, i=1i = 1 and f=1=0!=(i1)!f = 1 = 0! = (i-1)!. So II holds.
  • Maintenance (inductive step). Suppose II holds at some loop-top with the test true (so ini \le n): f=(i1)!f = (i-1)!. The body sets ffi=(i1)!i=i!f \leftarrow f\cdot i = (i-1)!\cdot i = i!, then ii+1i \leftarrow i+1. Now f=i!=((i+1)1)!f = i! = ((i+1)-1)! with the new ii, so II holds again at the next loop-top.
  • Termination. The loop ends when i>ni > n; since ii increases by 11 from 11, it exits with i=n+1i = n+1. By the invariant f=(i1)!=n!f = (i-1)! = n!, which is returned. ∎

Remark. The same three-part schema — initialization, maintenance, termination — proves correctness of sorting loops, search loops, and array summations. It is induction wearing engineering clothes, and it is why “what is the loop invariant?” is the first question in verifying any loop.

7.14 Existence and uniqueness proofs

Definition (existence proof). Establishes a statement “xP(x)\exists x\, P(x).” A constructive existence proof exhibits an explicit witness xx; a non-constructive one proves existence without producing a specific xx.

Example 7.30 (constructive). There exists a prime pp such that p+2p+2 and p+6p+6 are also prime.

Proof. Take p=5p = 5: then p+2=7p+2 = 7 and p+6=11p+6 = 11, all three prime. ∎

Example 7.31 (non-constructive). There exist irrational numbers x,yx, y with xyx^y rational.

Proof. Consider the number 22\sqrt{2}^{\,\sqrt{2}}.

  • If it is rational, take x=y=2x = y = \sqrt{2} (both irrational) and we are done.
  • If it is irrational, take x=22x = \sqrt{2}^{\,\sqrt{2}} and y=2y = \sqrt 2; then

xy=(22)2=222=22=2Q.x^y = \Big(\sqrt{2}^{\,\sqrt{2}}\Big)^{\sqrt{2}} = \sqrt{2}^{\,\sqrt{2}\cdot\sqrt{2}} = \sqrt{2}^{\,2} = 2 \in \mathbb{Q}.

One of the two cases must hold, so a suitable pair exists — yet the proof never tells us which pair works. That is the hallmark of a non-constructive proof. ∎

Definition (uniqueness proof). To prove “there is a unique xx with P(x)P(x),” establish two things: existence (some xx has PP) and uniqueness (if P(x1)P(x_1) and P(x2)P(x_2) both hold, then x1=x2x_1 = x_2).

Example 7.32 (existence and uniqueness). For real numbers a,ba, b with a0a \ne 0, the equation ax+b=0ax + b = 0 has exactly one real solution.

Proof. Existence: x=b/ax = -b/a is defined (since a0a \ne 0) and satisfies a(b/a)+b=b+b=0a(-b/a) + b = -b + b = 0. Uniqueness: suppose ax1+b=0ax_1 + b = 0 and ax2+b=0ax_2 + b = 0. Subtracting, a(x1x2)=0a(x_1 - x_2) = 0. Since a0a \ne 0, we may divide to get x1x2=0x_1 - x_2 = 0, i.e. x1=x2x_1 = x_2. Thus the solution is unique. ∎

7.15 Counterexamples and disproof

To disprove a universal statement “xP(x)\forall x\, P(x)” you need only exhibit one xx where PP fails. Such an xx is a counterexample. By duality with §7.1: a single counterexample refutes a universal claim, exactly as a single witness proves an existential one.

Definition (counterexample). A counterexample to “xP(x)\forall x\, P(x)” is a specific element cc of the domain for which P(c)P(c) is false. One counterexample suffices to show the universal statement is false.

Example 7.33. Disprove: “every prime is odd.”

The prime 22 is even. So 22 is a counterexample and the statement is false. ∎

Example 7.34. Disprove: “if 2n12^n - 1 is to be prime it suffices that nn be prime,” i.e. “nn prime 2n1\Rightarrow 2^n - 1 prime.”

Take n=11n = 11, which is prime. Then 2111=2047=23×892^{11} - 1 = 2047 = 23 \times 89 is composite. Counterexample found; the claim is false. ∎

Example 7.35. Disprove: “every positive integer is a sum of two perfect squares.”

Take n=3n = 3. The squares not exceeding 33 are 00 and 11; the possible sums of two are 0,1,20, 1, 2, never 33. So 33 is a counterexample. ∎

Common pitfall (proof by example is not proof). A counterexample disproves a universal claim, but examples never prove one. “PP holds for n=1,2,3n = 1, 2, 3, so nP(n)\forall n\,P(n)” is the fallacy of hasty generalization — recall Euler’s polynomial and Fermat numbers from §7.1. Confirming instances raises confidence but settles nothing.

7.16 Common fallacies

Definition (fallacy). A fallacy is an argument whose form resembles a valid rule but whose guaranteeing implication is not a tautology. It is an unsound rule.

Affirming the consequent — from ABA \to B and BB, wrongly concluding AA. The formula ((AB)B)A\big((A\to B)\wedge B\big)\to A is not a tautology: take AA false, BB true — then ABA\to B is true and BB is true, yet AA is false. (“If it rained, the ground is wet; the ground is wet; therefore it rained” — but a sprinkler could be responsible.) Contrast with the valid modus ponens (AB, ABA\to B,\ A \therefore B).

Denying the antecedent — from ABA \to B and ¬A\neg A, wrongly concluding ¬B\neg B. The formula ((AB)¬A)¬B\big((A\to B)\wedge \neg A\big)\to \neg B fails on the same row AA false, BB true: premises true, conclusion ¬B\neg B false. (“If it rained, the ground is wet; it did not rain; therefore the ground is not wet” — again the sprinkler.) Contrast with the valid modus tollens (AB, ¬B¬AA\to B,\ \neg B \therefore \neg A).

Begging the question (circular reasoning) — assuming, somewhere in the argument, the very thing to be proved. Example: “ff is continuous because its graph has no breaks, and it has no breaks because it is continuous.” No new information is transmitted; the conclusion is smuggled into the premises.

The “a=b1=2a=b \Rightarrow 1 = 2” fallacy (hidden division by zero). Let a=ba = b. Then

a2=ab  a2b2=abb2  (ab)(a+b)=b(ab)  a+b=b  2b=b  2=1.a^2 = ab \ \Rightarrow\ a^2 - b^2 = ab - b^2 \ \Rightarrow\ (a-b)(a+b) = b(a-b) \ \Rightarrow\ a + b = b \ \Rightarrow\ 2b = b \ \Rightarrow\ 2 = 1.

The error is the cancellation of (ab)(a-b): since a=ba = b, we have ab=0a - b = 0, and dividing by zero is illegitimate. A single invalid step “proves” an absurdity — a reminder that every step must be justified.

The “all horses are the same color” fallacy (a broken inductive step). Claim: in any set of nn horses, all have the same color. “Proof.” Base n=1n=1: trivially one horse matches itself. Step: given k+1k+1 horses h1,,hk+1h_1,\dots,h_{k+1}, the first kk (namely h1,,hkh_1,\dots,h_k) are one color by IH, and the last kk (h2,,hk+1h_2,\dots,h_{k+1}) are one color by IH; the overlap h2,,hkh_2,\dots,h_k forces all k+1k+1 to match. The flaw: the overlap argument needs the two kk-subsets to share a member, which fails at the very first step k=1k+1=2k = 1 \to k+1 = 2: the sets {h1}\{h_1\} and {h2}\{h_2\} do not overlap. The inductive step is invalid for that one crucial value, so the chain never gets going.

The lesson: a rule is legitimate only when its guaranteeing implication is a genuine tautology, and an induction is valid only when the inductive step holds for every kak \ge a (base included). When in doubt, test with a truth table or examine the smallest cases explicitly.

7.17 A short history

The idea that a claim can be demonstrated, not merely observed, is one of the great inventions of Greek mathematics. Thales and the Pythagoreans (6th c. BCE) gave early proofs, and Euclid’s Elements (ca. 300 BCE) organized geometry and number theory into the first great axiomatic system: definitions and postulates at the base, theorems derived by explicit reasoning above. Euclid’s proof of the infinitude of primes (Example 7.14) is still taught essentially unchanged.

Explicit mathematical induction appears in the work of Francesco Maurolico (1575) and, more influentially, Blaise Pascal (1650s, in his treatise on the arithmetical triangle). Its modern axiomatic form is due to Giuseppe Peano (1889), whose axioms make induction a defining property of the natural numbers.

The 19th century brought a drive for rigor: Cauchy, Weierstrass, and Dedekind put analysis on firm foundations, and Gottlob Frege (Begriffsschrift, 1879) created modern formal logic. David Hilbert’s program (1920s) sought to reduce all mathematics to the manipulation of formal symbols with a finite, checkable set of rules — the syntactic vision of §7.6. In 1931 Kurt Gödel’s incompleteness theorems showed the program could not fully succeed: any sufficiently rich consistent system contains true statements it cannot prove. Proof has limits, but within them it remains our only route to certainty.

The modern era added computer-assisted proof: the Four Color Theorem (Appel and Haken, 1976) was proved with essential help from a computer checking thousands of cases, and today proof assistants such as Coq, Lean, and Isabelle let mathematicians verify proofs down to the primitive rules — the formal derivations of §7.4, carried out by machine.

Chapter summary

  • A proof transmits certainty: a finite chain of definitions, prior results, hypotheses, and rule-justified steps. Rigor matters because patterns lie (Euler’s polynomial, Fermat numbers, Euler’s sum-of-powers conjecture).
  • A conclusion BB follows from premises A1,,AnA_1, \dots, A_n exactly when A1AnBA_1 \wedge \dots \wedge A_n \to B is a tautology (Justification theorem); this is what makes a rule of inference sound, and it licenses every technique in the chapter.
  • Standard propositional rules: modus ponens, modus tollens, hypothetical syllogism, disjunctive syllogism, addition, simplification, conjunction, resolution — each backed by a tautology. Quantifier rules: universal/existential instantiation and generalization.
  • A formal derivation ΓB\Gamma \vdash B is a numbered list of premises and rule-justified steps ending in BB; syntactic provability \vdash matches semantic entailment \models (soundness + completeness). Resolution refutation derives the empty clause \square and powers SAT solvers and Prolog.
  • Proof techniques for mathematics:
    • Direct — assume pp, derive qq.
    • Contraposition — prove ¬q¬p\neg q \to \neg p (beware: not the converse!).
    • Contradiction — assume ¬p\neg p, reach \bot (2\sqrt 2 irrational; infinitude of primes; log23\log_2 3 irrational).
    • Cases / exhaustion — split into exhaustive cases (must cover everything).
    • Existence (constructive vs. non-constructive) and uniqueness (existence + “any two coincide”).
    • Counterexample — one instance disproves a universal claim.
  • Mathematical induction proves P(n)P(n) for all nan \ge a: weak uses P(k)P(k+1)P(k) \to P(k+1); strong uses P(a)P(k)P(k+1)P(a)\wedge\dots\wedge P(k) \to P(k+1). Never skip the base step; strong induction may need several base cases. Induction underlies program correctness and loop invariants.
  • Fallaciesaffirming the consequent, denying the antecedent, circular reasoning, hidden division by zero, and broken inductive steps (“all horses”) mimic valid reasoning but rest on non-tautologies or gaps.

Exercises

Warm-up

  1. Classify each statement by the proof method you would most naturally use (direct, contraposition, contradiction, cases, induction, counterexample): (a) “The sum of two odd integers is even.” (b) “3\sqrt{3} is irrational.” (c) “i=1ni3=(n(n+1)2)2\sum_{i=1}^n i^3 = \big(\tfrac{n(n+1)}2\big)^2 for all n1n\ge1.” (d) “Not every continuous function is differentiable.”
  2. Prove directly that the sum of two odd integers is even.
  3. Prove directly that the product of two odd integers is odd.
  4. Give the contrapositive, converse, and inverse of: “If nn is divisible by 66, then nn is divisible by 33.” Which are true?
  5. State the guaranteeing tautology for disjunctive syllogism and verify it with a truth table.
  6. Fill in the justifications for this derivation of rr from {p, pq, qr}\{\,p,\ p\to q,\ q\to r\,\}: line 1 pp; line 2 pqp\to q; line 3 qrq\to r; line 4 qq; line 5 rr.
  7. Disprove by counterexample: “For every integer nn, n2n+11n^2 - n + 11 is prime.”

Standard

  1. Prove by contraposition: for every integer nn, if 5n+35n + 3 is even then nn is odd.
  2. Prove by contradiction that 3\sqrt{3} is irrational. Identify the step that produces the contradiction.
  3. Prove by cases that for every integer nn, n2+nn^2 + n is even.
  4. Prove by induction: i=1ni2=n(n+1)(2n+1)6\displaystyle \sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6} for all n1n \ge 1.
  5. Prove by induction: 3(n3+2n)3 \mid (n^3 + 2n) for all n1n \ge 1.
  6. Prove by induction the geometric sum 1+2+4++2n=2n+11\displaystyle 1 + 2 + 4 + \dots + 2^n = 2^{n+1} - 1 for all n0n \ge 0.
  7. Give a formal derivation of ¬p\neg p from the premises {p(qr), ¬r}\{\,p \to (q \wedge r),\ \neg r\,\}, justifying each line. (Hint: you may use qrrq \wedge r \to r.)
  8. Use resolution refutation to show that {pq, ¬qr, ¬r}p\{\,p \vee q,\ \neg q \vee r,\ \neg r\,\} \vdash p.
  9. State the loop invariant for the following loop and use it to prove the returned value equals i=1nai\sum_{i=1}^n a_i:
    s := 0; i := 1
    while i <= n:  s := s + a[i];  i := i + 1
    return s
    

Challenge

  1. Prove that 2+3\sqrt{2} + \sqrt{3} is irrational. (Hint: square it and reduce to the irrationality of 6\sqrt 6.)
  2. Prove by strong induction that every integer n12n \ge 12 can be written as 4a+5b4a + 5b with a,b0a, b \ge 0. How many base cases do you need, and why?
  3. Prove: for every integer n1n \ge 1 there exist nn consecutive composite integers. (Hint: consider (n+1)!+2,(n+1)!+3,,(n+1)!+(n+1)(n+1)! + 2, (n+1)! + 3, \dots, (n+1)! + (n+1).)
  4. Find and explain the flaw in the “all horses are the same color” induction (§7.16). At exactly which value of kk does the inductive step break, and why?
  5. Prove that log23\log_2 3 is irrational, then adapt the argument to show log25\log_2 5 is irrational.

Selected answers & hints

  • 2. Let a=2s+1a = 2s+1, b=2t+1b = 2t+1. Then a+b=2s+2t+2=2(s+t+1)a + b = 2s + 2t + 2 = 2(s+t+1), even. ∎
  • 4. Contrapositive: “If nn is not divisible by 33, then nn is not divisible by 66” (true). Converse: “If nn is divisible by 33, then nn is divisible by 66” (false; n=3n=3). Inverse: “If nn is not divisible by 66, then nn is not divisible by 33” (false; n=3n=3). The original and its contrapositive are true; converse and inverse are false — and are equivalent to each other, not to the original.
  • 7. n=11n = 11 gives 11211+11=121=11211^2 - 11 + 11 = 121 = 11^2, composite. (Also n=10n=10: 101101 is prime, so small values mislead — the point of §7.15.)
  • 8. Contrapositive: if nn is even then 5n+35n+3 is odd. Let n=2kn = 2k: 5n+3=10k+3=2(5k+1)+15n + 3 = 10k + 3 = 2(5k+1) + 1, odd. ∎
  • 9. Assume 3=m/n\sqrt 3 = m/n in lowest terms. Then 3n2=m23n^2 = m^2, so 3m23 \mid m^2, hence 3m3 \mid m (as 33 is prime). Write m=3am = 3a: 3n2=9a2n2=3a23n^2 = 9a^2 \Rightarrow n^2 = 3a^2, so 3n3 \mid n. Then 33 divides both mm and nncontradiction with gcd(m,n)=1\gcd(m,n)=1.
  • 10. Case nn even: n2+n=n(n+1)n^2 + n = n(n+1) with nn even, so even. Case nn odd: then n+1n+1 even, so n(n+1)n(n+1) even. Exhaustive. ∎
  • 12. Base n=1n=1: 1+2=31 + 2 = 3, divisible by 33. Step: (k+1)3+2(k+1)=(k3+2k)+3k2+3k+3=(k3+2k)+3(k2+k+1)(k+1)^3 + 2(k+1) = (k^3 + 2k) + 3k^2 + 3k + 3 = (k^3+2k) + 3(k^2 + k + 1); first term divisible by 33 by IH, second obviously. ∎
  • 15. Clauses {pq, ¬qr, ¬r, ¬p}\{p\vee q,\ \neg q \vee r,\ \neg r,\ \neg p\} (last is negated goal). Resolve ¬r\neg r with ¬qr¬q\neg q \vee r \Rightarrow \neg q; resolve ¬q\neg q with pqpp \vee q \Rightarrow p; resolve pp with ¬p\neg p \Rightarrow \square. Contradiction, so pp follows. ∎
  • 16. Invariant: at the top of the test, s=i=1i1ais = \sum_{i'=1}^{i-1} a_{i'}. Initialization: i=1i=1, s=0=s = 0 = empty sum. Maintenance: if s=i=1i1ais = \sum_{i'=1}^{i-1}a_{i'} then after s+=ais \mathrel{+}= a_i and i+=1i \mathrel{+}= 1, again s=i=1i1ais = \sum_{i'=1}^{i-1}a_{i'}. Termination: i=n+1i = n+1, so s=i=1nais = \sum_{i'=1}^{n} a_{i'}. ∎
  • 17. Let s=2+3s = \sqrt2 + \sqrt3. If ss were rational, so would s2=5+26s^2 = 5 + 2\sqrt6 be, forcing 6=(s25)/2\sqrt6 = (s^2-5)/2 rational. But 6\sqrt6 is irrational (if 6=p/q\sqrt6 = p/q lowest terms, 6q2=p2p6q^2 = p^2 \Rightarrow p even p=2a2a2=3q2q\Rightarrow p=2a \Rightarrow 2a^2 = 3q^2 \Rightarrow q even, contradicting lowest terms). Contradiction, so ss is irrational. ∎
  • 18. Base cases 12,13,14,1512,13,14,15 (four of them, because the inductive step goes from nn to n4n-4, so it needs four consecutive established values to reach every larger nn). Step: for k+116k+1 \ge 16, k312k-3 \ge 12 is representable by IH; add one 44-stamp.
  • 19. The nn numbers (n+1)!+j(n+1)! + j for j=2,3,,n+1j = 2, 3, \dots, n+1 are consecutive; each is divisible by jj (since j(n+1)!j \mid (n+1)! and jjj \mid j) and exceeds jj, hence composite. ∎
  • 20. The inductive step relies on the two overlapping kk-element subsets sharing a horse. For k=1k = 1 (proving P(2)P(2) from P(1)P(1)) the subsets {h1}\{h_1\} and {h2}\{h_2\} are disjoint, so no color is forced to match. The step fails precisely at k=1k=1, breaking the chain immediately after the base.
  • 21. If log23=p/q\log_2 3 = p/q (p,q1p,q \ge 1) then 2p=3q2^p = 3^q: even == odd, contradiction. Identically, log25=p/q\log_2 5 = p/q gives 2p=5q2^p = 5^q, even == odd — impossible.

Further reading

  • K. H. Rosen, Discrete Mathematics and Its Applications — Chapter 1 (Rules of Inference, Introduction to Proofs, Proof Methods and Strategy) and Chapter 5 (Induction and Recursion).
  • S. S. Epp, Discrete Mathematics with Applications — Chapters 4–5 (Elementary Number Theory and Methods of Proof; Sequences, Mathematical Induction, and Recursion).
  • D. J. Velleman, How to Prove It: A Structured Approach — a book-length treatment of the craft of proof, with strong coverage of quantifier reasoning and proof strategy.

Lectures/CDM-L07.md · 57.8 KB · updated 2026-08-01 21:11