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 infer ” is valid exactly when the implication
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 is a finite chain of reasoning that establishes 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 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 “ is odd,” you must know that odd means “ for some integer .”
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 (studied by Euler) is prime for every . It is tempting to conjecture it is always prime. But is composite.
- Pierre de Fermat conjectured that every Fermat number is prime. Indeed are all prime. In 1732 Euler showed 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,
demolishing the conjecture (both sides equal ).
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 “” 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 is a tautological consequence of formulas , written , when every truth assignment that makes all of true also makes 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. if and only if the single formula is a tautology.
Proof. () Suppose is a tautology, and take any assignment making all true. Then the antecedent 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), is true. Hence every assignment satisfying all premises satisfies , i.e. .
() Conversely suppose . Consider any assignment. If it makes all true, then by hypothesis it makes true, so the implication reads . If it makes some false, the antecedent is false and the implication reads . Either way the implication is true, so it is a tautology. ∎
This is exactly the schema on the slides: and, more generally, . 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 beneath any premises matching — 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 conclusion” whose associated implication is a tautology. We write a rule as a fraction: premises above the line, conclusion below.

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 | |||
| Modus tollens | Negative separation rule | |||
| Hypothetical syllogism | Hypothetical syllogism | |||
| Disjunctive syllogism | Removing disjunction | |||
| Addition | Including disjunction | |||
| Simplification | Removing conjunction | |||
| Conjunction | Including conjunction | |||
| Resolution | — | |||
| Contraposition | Implication contraposition |
A few remarks on the most important rules:
- Modus ponens () is the workhorse rule; in the axiomatic tradition it is called the separation rule because it “separates” 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 or ; it is not ; therefore ”). 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 and , the complementary pair “cancels,” leaving . Disjunctive syllogism is the special case where is empty.
Verifying a rule (worked example). Let us confirm modus tollens is sound by truth table, i.e. that is a tautology.
| whole | ||||||
|---|---|---|---|---|---|---|
| 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 is true is the first, and there 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 …”, “there exists a real …”), so we also need rules that strip and attach quantifiers. These are used silently in every proof below.
| Rule | From | Infer | Caveat |
|---|---|---|---|
| Universal instantiation | any element of the domain | ||
| Universal generalization | with arbitrary | must be genuinely arbitrary — no special assumptions about it | |
| Existential instantiation | a new name for some witness | ||
| Existential generalization | for some particular | — |
Common pitfall (universal generalization). To prove “” by taking an arbitrary and proving , you may assume nothing about beyond membership in the domain. If your argument secretly uses “let be even” or “let ”, 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 from premises , written , is a finite numbered list of formulas ending in , 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 (“yields”, provability, a syntactic notion) mirrors (“entails”, a semantic notion). Because our rules are exactly the tautological ones, the two agree: precisely when . That two-way agreement is the soundness () and completeness () of propositional calculus.
Example 7.1 (a complete derivation). Show that .
| # | Formula | Justification |
|---|---|---|
| 1 | premise | |
| 2 | premise | |
| 3 | premise | |
| 4 | premise | |
| 5 | hypothetical syllogism, 1, 2 | |
| 6 | modus tollens, 5, 3 | |
| 7 | disjunctive syllogism, 4, 6 |
Each step is licensed by a rule from the table, so line 7 is established: follows from the four premises. ∎
Example 7.2 (a derivation using conjunction and simplification). Show .
| # | Formula | Justification |
|---|---|---|
| 1 | premise | |
| 2 | premise | |
| 3 | premise | |
| 4 | simplification, 1 | |
| 5 | simplification, 1 | |
| 6 | modus ponens, 2, 4 | |
| 7 | modus ponens, 3, 5 | |
| 8 | 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 mean “ is human” and “ is mortal.”
| # | Formula | Justification |
|---|---|---|
| 1 | premise | |
| 2 | premise | |
| 3 | universal instantiation, 1 | |
| 4 | 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 and the whole implication present on earlier lines — having and 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,
infer the resolvent , obtained by deleting the complementary pair and disjoining what remains. Resolving with alone yields the empty clause , which represents (falsehood).

Refutation. To prove by resolution, one shows that is unsatisfiable: convert everything to CNF and derive the empty clause . Reaching 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 .
Negate the goal and convert to clauses. Using :
Now resolve:
| # | Clause | From |
|---|---|---|
| 1 | premise () | |
| 2 | premise () | |
| 3 | premise | |
| 4 | negated goal | |
| 5 | resolve 3 & 1 (on ) | |
| 6 | resolve 5 & 2 (on ) | |
| 7 | resolve 6 & 4 (on ) |
The empty clause appears, so is unsatisfiable; therefore 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 be a propositional formula and an atomic formula (a single propositional variable). If is a tautology (or theorem) containing , then the formula obtained by replacing every occurrence of in by an arbitrary formula is again a tautology (theorem). The replacement must be uniform: all occurrences of , and only , 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 we may substitute to obtain the tautology .
Common pitfall. Non-uniform substitution destroys validity. From the tautology , replacing only the first by gives , which is not a tautology (false when true and 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 .
- Postulates (axiom schemas) — a chosen set of universally valid formulas taken as starting points. A classic three-schema (Hilbert-style) system is
- 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 , assume is true and, through a chain of valid inferences and definitions, derive that is true. (An unconditional statement is proved the same way, with no antecedent to assume.)
We use two standard definitions throughout: an integer is even if for some integer , and odd if for some integer . An integer divides (written ) if for some integer .
Example 7.5. If is an odd integer, then is odd.
Proof. Assume is odd, so for some integer . Then
Put , an integer. Then , which is by definition odd. ∎
Example 7.6. The sum of two even integers is even.
Proof. Let be even, say and for integers . Then , and is an integer, so is even. ∎
Example 7.7 (transitivity of divisibility). For all integers : if and , then .
Proof. Assume and . Then and for some integers . Substituting, . Since is an integer, . ∎
Example 7.8. If is even, then .
Proof. Assume is even, so . Then ∎
Example 7.9 (a sharper fact needing a lemma). If is odd, then — that is, .
Proof. First a lemma: the product of two consecutive integers is always even. Indeed, one of is even; if then , and if then — either way the product is .
Now assume is odd, . Then
By the lemma is even, say . Hence , so and . ∎
Remark (trivial and vacuous proofs). Two degenerate but legitimate direct proofs of deserve names. A trivial proof establishes outright, without using at all (then is automatically true). A vacuous proof shows is false, so is true “by default.” Example (vacuous): “If is both even and odd, then ” 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 , prove the two implications separately: and (each by whatever method fits — direct, contrapositive, or contradiction). Both directions are required; proving only one is the single most common gap. Example: “ is even is even” needs (direct) and (contrapositive: odd odd).
To prove several statements all equivalent — “TFAE: ” — it suffices to prove one cycle of implications : any statement then implies any other by following the cycle. That is implications instead of the ordered pairs.
7.8 Proof by contraposition
Definition (proof by contraposition). Instead of proving directly, prove its contrapositive . The two are logically equivalent, so a proof of one is a proof of the other.

The equivalence is itself a tautology, confirmed by the truth table:
| F | F | T | T |
| F | T | T | T |
| T | F | F | F |
| T | T | T | T |
Columns 3 and 4 are identical, so . Contraposition is the method of choice when the negated statements are easier to compute with than the originals — typically when is a negative or existential claim.
Common pitfall (contrapositive vs. converse). The contrapositive of is (equivalent). The converse is and the inverse is (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 is even then is even.
Proof (contraposition). The contrapositive is: if is odd then is odd, which is Example 7.5. Since the contrapositive is true, so is the original. ∎
Example 7.11. For integers, if is odd then is odd.
Proof (contraposition). Contrapositive: if is even then is even. Assume . Then , which is even. The contrapositive holds, hence so does the original. ∎
Example 7.12. For all positive real numbers : if , then or .
Proof (contraposition). The contrapositive is if and , then . (Here becomes by De Morgan, and becomes .) Assume and . Multiplying the inequalities by positive quantities,
Chaining, . Having proved the contrapositive, the original implication holds. ∎
Remark. Example 7.12 shows why contraposition helps: the original conclusion is a disjunction (“ or ”), 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 , assume its negation and derive a contradiction — a formula of the form , i.e. . Since forces to be true, is established.

The engine is the tautology . To prove an implication by contradiction, assume and derive ; the only row where is false is true, false, and that is exactly what we rule out:
| F | F | T |
| F | T | T |
| T | F | F |
| T | T | T |
Example 7.13 (a classic). is irrational.
Proof. Suppose, for contradiction, that is rational. Then it can be written in lowest terms as
Squaring, , hence . So is even, and therefore is even (Example 7.10). Write . Substituting,
so is even and hence is even. But then divides both and , contradicting . The assumption is untenable, so 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 . Consider the number
Since , it has at least one prime divisor (this fact is proved in Example 7.26). That must be one of , since those are supposedly all the primes. But then and , so . No prime divides — contradiction. Hence there are infinitely many primes. ∎
Common pitfall. Euclid’s argument does not claim is itself prime. It only needs to have some prime factor outside the list. Indeed can be composite: . Students often misremember this as “the product of the first primes plus one is prime,” which is false.
Example 7.15. There is no smallest positive rational number.
Proof. Suppose, for contradiction, that is the smallest positive rational. Then is also rational (a quotient of rationals) and positive, yet . This contradicts the minimality of . Hence no smallest positive rational exists. ∎
Example 7.16. is irrational.
Proof. Suppose is rational. Since , write with positive integers . Then , so raising to the -th power, . The left side is even (as ), while the right side is odd. An even number cannot equal an odd number — contradiction. Hence is irrational. ∎
Remark (contradiction vs. contraposition). They are close cousins but not identical. Contraposition proves by proving 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 (whose disjunction is always true) and prove the conclusion separately in each. It rests on the tautology
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 and but not ) leaves a hole in the proof. The cases need not be mutually exclusive, but they must together cover everything.
Example 7.17 (exhaustion). for every natural number with .
Proof. The domain is finite; check each.
| ? | |||
|---|---|---|---|
| 1 | ✓ | ||
| 2 | ✓ | ||
| 3 | ✓ | ||
| 4 | ✓ |
All four hold. ∎ (The inequality fails at : — which is exactly why the hypothesis restricts .)
Example 7.18. For every integer , or .
Proof (two cases on parity). Case 1: even. Then , so . Case 2: odd. Then , so . Every integer is even or odd, so the cases are exhaustive and or always. ∎ (Corollary: no integer of the form or is a perfect square.)
Example 7.19. Every prime has the form or (equivalently ).
Proof. Any integer is exactly one of . We rule out four cases for a prime :
- , , are all even, hence divisible by ; since , such would be composite.
- is divisible by ; since , such would be composite.
The only remaining forms are and , so a prime must be one of these. ∎
Example 7.20 (cases via “without loss of generality”). For all real numbers : (the triangle inequality).
Proof. Recall and for every real ; equivalently . Adding the inequalities and gives
A number satisfying (with ) satisfies . Taking and yields . ∎ (This packages the four sign-cases 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 holds for every integer , establish two obligations:
- Base step — show is true.
- Inductive step — show that for every , if is true (the inductive hypothesis, IH), then is true.
If both hold, then is true for all .
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 means.

Common pitfall (never skip the base step). Both steps are essential. Consider the false claim : “.” Its inductive step actually goes through: if then adding gives , i.e. . Yet is false for every , because the base step fails. An inductive step with no valid base proves nothing.
Example 7.21 (arithmetic series). For every integer ,
Proof. Base (): the left side is ; the right side is . Equal, so holds. Inductive step: assume for some that (IH). Then
which is . By induction the formula holds for all . ∎
Example 7.22 (sum of odd numbers). For every integer ,
Proof. Base (): left side , right side . ✓ Inductive step: assume (IH). The -th odd number is , so
which is . By induction the identity holds for all . ∎
Example 7.23 (sum of squares). For every integer ,
Proof. Base (): left , right . ✓ Inductive step: assume (IH). Then
Factoring gives , which is the formula with . By induction it holds for all . ∎
Example 7.24 (a divisibility result). For every integer , .
Proof. Base (): , and . ✓ Inductive step: assume (IH). Then
The first term is divisible by by the IH. For the second, is a product of consecutive integers, hence even (lemma of Example 7.9), so is divisible by . A sum of two multiples of is a multiple of , so . By induction for all . ∎
Example 7.25 (an inequality, non-unit base). For every integer , .
Proof. Base (): . ✓ (Note the base is , not : the claim is false for , since .) Inductive step: assume for some (IH). Then
where the middle inequality uses the IH and the last uses (true since ). Hence . By induction for all . ∎
Remark (choosing the base). Induction proves “ for all ” for whatever starting value makes the base step true. Example 7.25 illustrates that the natural starting point is not always — you begin where the statement first holds.
7.12 Strong induction
Definition (strong induction / complete induction). To prove for all :
- Base step — show (and possibly a few more initial values) is true.
- Inductive step — show that for every , if are all true, then 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 depends on a value further back than — for instance, when a number factors into two smaller-but-unpredictable pieces.
Example 7.26 (every integer has a prime factor). Every integer is divisible by some prime.
Proof (strong induction). Base (): is prime and . ✓ Inductive step: let and assume every integer with has a prime factor (IH). Consider .
- If is prime, then is a prime factor of itself.
- If is composite, then with integers . By the IH (applied to ), has a prime factor . Since and , transitivity of divisibility (Example 7.7) gives .
Either way has a prime factor. By strong induction every integer has one. ∎ (This is the fact borrowed in Euclid’s proof, Example 7.14, and it needs the full smaller-than- hypothesis — hence strong induction.)
Example 7.27 (existence of prime factorizations). Every integer can be written as a product of primes.
Proof (strong induction). Base (): is prime, a product of one prime. ✓ Inductive step: assume every integer with is a product of primes. Consider .
- If is prime, it is already such a product.
- If with , then by the IH both and are products of primes; concatenating those factorizations expresses as a product of primes.
By strong induction every integer 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 can be written as for some nonnegative integers (i.e. paid with 4-cent and 5-cent stamps).
Proof (strong induction with several base cases). Base cases :
Inductive step: let and assume every integer with is representable (IH). Consider . Since , we have , and also , so by the IH for some . Then , a valid representation. By strong induction every is representable. ∎
Common pitfall (too few base cases). In Example 7.28 the inductive step reaches back four units (), so it needs four consecutive base cases to get started; a single base case would leave 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 for all , suppose the set of counterexamples is non-empty, take its least element , and derive a contradiction (typically by producing a smaller counterexample, or by invoking for all ). Example: every integer has a prime factor — otherwise a least counterexample is composite, with ; by minimality has a prime factor, which then divides , 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.

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 .
Proof. Take the loop invariant : “at the top of the while-test, .”
- Initialization (base). Before the first test, and . So holds.
- Maintenance (inductive step). Suppose holds at some loop-top with the test true (so ): . The body sets , then . Now with the new , so holds again at the next loop-top.
- Termination. The loop ends when ; since increases by from , it exits with . By the invariant , 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 “.” A constructive existence proof exhibits an explicit witness ; a non-constructive one proves existence without producing a specific .
Example 7.30 (constructive). There exists a prime such that and are also prime.
Proof. Take : then and , all three prime. ∎
Example 7.31 (non-constructive). There exist irrational numbers with rational.
Proof. Consider the number .
- If it is rational, take (both irrational) and we are done.
- If it is irrational, take and ; then
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 with ,” establish two things: existence (some has ) and uniqueness (if and both hold, then ).
Example 7.32 (existence and uniqueness). For real numbers with , the equation has exactly one real solution.
Proof. Existence: is defined (since ) and satisfies . Uniqueness: suppose and . Subtracting, . Since , we may divide to get , i.e. . Thus the solution is unique. ∎
7.15 Counterexamples and disproof
To disprove a universal statement “” you need only exhibit one where fails. Such an 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 “” is a specific element of the domain for which is false. One counterexample suffices to show the universal statement is false.
Example 7.33. Disprove: “every prime is odd.”
The prime is even. So is a counterexample and the statement is false. ∎
Example 7.34. Disprove: “if is to be prime it suffices that be prime,” i.e. “ prime prime.”
Take , which is prime. Then is composite. Counterexample found; the claim is false. ∎
Example 7.35. Disprove: “every positive integer is a sum of two perfect squares.”
Take . The squares not exceeding are and ; the possible sums of two are , never . So is a counterexample. ∎
Common pitfall (proof by example is not proof). A counterexample disproves a universal claim, but examples never prove one. “ holds for , so ” 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 and , wrongly concluding . The formula is not a tautology: take false, true — then is true and is true, yet 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 ().
Denying the antecedent — from and , wrongly concluding . The formula fails on the same row false, true: premises true, conclusion 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 ().
Begging the question (circular reasoning) — assuming, somewhere in the argument, the very thing to be proved. Example: “ 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 “” fallacy (hidden division by zero). Let . Then
The error is the cancellation of : since , we have , 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 horses, all have the same color. “Proof.” Base : trivially one horse matches itself. Step: given horses , the first (namely ) are one color by IH, and the last () are one color by IH; the overlap forces all to match. The flaw: the overlap argument needs the two -subsets to share a member, which fails at the very first step : the sets and 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 (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 follows from premises exactly when 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 is a numbered list of premises and rule-justified steps ending in ; syntactic provability matches semantic entailment (soundness + completeness). Resolution refutation derives the empty clause and powers SAT solvers and Prolog.
- Proof techniques for mathematics:
- Direct — assume , derive .
- Contraposition — prove (beware: not the converse!).
- Contradiction — assume , reach ( irrational; infinitude of primes; 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 for all : weak uses ; strong uses . Never skip the base step; strong induction may need several base cases. Induction underlies program correctness and loop invariants.
- Fallacies — affirming 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
- 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) “ is irrational.” (c) “ for all .” (d) “Not every continuous function is differentiable.”
- Prove directly that the sum of two odd integers is even.
- Prove directly that the product of two odd integers is odd.
- Give the contrapositive, converse, and inverse of: “If is divisible by , then is divisible by .” Which are true?
- State the guaranteeing tautology for disjunctive syllogism and verify it with a truth table.
- Fill in the justifications for this derivation of from : line 1 ; line 2 ; line 3 ; line 4 ; line 5 .
- Disprove by counterexample: “For every integer , is prime.”
Standard
- Prove by contraposition: for every integer , if is even then is odd.
- Prove by contradiction that is irrational. Identify the step that produces the contradiction.
- Prove by cases that for every integer , is even.
- Prove by induction: for all .
- Prove by induction: for all .
- Prove by induction the geometric sum for all .
- Give a formal derivation of from the premises , justifying each line. (Hint: you may use .)
- Use resolution refutation to show that .
- State the loop invariant for the following loop and use it to prove the returned value equals :
s := 0; i := 1 while i <= n: s := s + a[i]; i := i + 1 return s
Challenge
- Prove that is irrational. (Hint: square it and reduce to the irrationality of .)
- Prove by strong induction that every integer can be written as with . How many base cases do you need, and why?
- Prove: for every integer there exist consecutive composite integers. (Hint: consider .)
- Find and explain the flaw in the “all horses are the same color” induction (§7.16). At exactly which value of does the inductive step break, and why?
- Prove that is irrational, then adapt the argument to show is irrational.
Selected answers & hints
- 2. Let , . Then , even. ∎
- 4. Contrapositive: “If is not divisible by , then is not divisible by ” (true). Converse: “If is divisible by , then is divisible by ” (false; ). Inverse: “If is not divisible by , then is not divisible by ” (false; ). The original and its contrapositive are true; converse and inverse are false — and are equivalent to each other, not to the original.
- 7. gives , composite. (Also : is prime, so small values mislead — the point of §7.15.)
- 8. Contrapositive: if is even then is odd. Let : , odd. ∎
- 9. Assume in lowest terms. Then , so , hence (as is prime). Write : , so . Then divides both and — contradiction with .
- 10. Case even: with even, so even. Case odd: then even, so even. Exhaustive. ∎
- 12. Base : , divisible by . Step: ; first term divisible by by IH, second obviously. ∎
- 15. Clauses (last is negated goal). Resolve with ; resolve with ; resolve with . Contradiction, so follows. ∎
- 16. Invariant: at the top of the test, . Initialization: , empty sum. Maintenance: if then after and , again . Termination: , so . ∎
- 17. Let . If were rational, so would be, forcing rational. But is irrational (if lowest terms, even even, contradicting lowest terms). Contradiction, so is irrational. ∎
- 18. Base cases (four of them, because the inductive step goes from to , so it needs four consecutive established values to reach every larger ). Step: for , is representable by IH; add one -stamp.
- 19. The numbers for are consecutive; each is divisible by (since and ) and exceeds , hence composite. ∎
- 20. The inductive step relies on the two overlapping -element subsets sharing a horse. For (proving from ) the subsets and are disjoint, so no color is forced to match. The step fails precisely at , breaking the chain immediately after the base.
- 21. If () then : even odd, contradiction. Identically, gives , 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.