Mascot image.
#EECS#Python#Intro

Proofs

Valid Arguments and Inference Rules

In Lesson 1, we built a proof system for propositional equivalences: given axioms such as De Morgan’s Laws and the Conditional axiom, we showed that two expressions can be rewritten as one another through a chain of equivalence steps. But equivalence proofs are symmetric. They establish that pqp \equiv q, meaning pp and qq carry identical truth values under every assignment. Much of mathematics proceeds asymmetrically. We know certain facts and wish to derive new ones, in one direction only. If pqp \to q is known and pp is true, we may conclude qq, but not the reverse. The tools for this one-way reasoning are called inference rules, and a proof is a structured chain of such inferences leading from premises to a conclusion.

Arguments and Validity

Definition 45 (Argument)

An argument in propositional logic is a finite sequence of propositions p1,p2,,pn,qp_1, p_2, \ldots, p_n, q. The propositions p1,,pnp_1, \ldots, p_n are the premises and qq is the conclusion. The argument is valid if the truth of all premises guarantees the truth of the conclusion:

(p1p2pn)qis a tautology.(p_1 \land p_2 \land \cdots \land p_n) \to q \quad \text{is a tautology.}

An argument that is not valid is invalid.

We write a valid argument with the premises above a horizontal line and the conclusion below:

p1p2pnq\frac{p_1 \quad p_2 \quad \cdots \quad p_n}{q}

An inference rule is an argument form that remains valid regardless of which particular propositions are substituted for its variables. Just as the axioms of Lesson 1 gave us equivalences that hold universally, inference rules give us one-directional deductions that hold universally.

Remark (The Turnstile)

The notation p1,p2,,pnqp_1, p_2, \ldots, p_n \vdash q (read ”p1,,pnp_1, \ldots, p_n entail qq”) means that qq can be derived from the premises p1,,pnp_1, \ldots, p_n using axioms, inference rules, and previously established theorems. When no premises are needed, we write q\vdash q, meaning qq is derivable from the axioms alone.

Why not simply check validity by truth table? If an argument involves kk distinct propositional variables, the truth table has 2k2^k rows. An argument with twenty premises could demand over a million rows. Inference rules allow us to verify validity in a handful of steps, regardless of the number of variables.

Modus Ponens

The cornerstone of deductive reasoning is Modus Ponens (from the Latin modus ponendo ponens, “the method of affirming by affirming”):

pqpq\frac{p \to q \quad p}{q}

If we know pqp \to q and pp, we may conclude qq. Its validity rests on the tautology

((pq)p)q((p \to q) \land p) \to q

To see why this is a tautology, suppose both pqp \to q and pp are true. By the truth table of the conditional (Lesson 1), the only circumstance under which pqp \to q is true and pp is true is when qq is also true. Hence qq must hold.

Example 42

In Lesson 3, we established the universal statement “every prime greater than 22 is odd.” Let pp denote “7 is prime and greater than 2” and qq denote “7 is odd.” The universal claim gives pqp \to q, and we can verify pp directly (7 is prime, and 7>27 > 2). Modus Ponens yields qq: the integer 7 is odd.

Problem 56

Let pp denote “it is snowing” and qq denote “the lecture is cancelled.” Suppose we know pqp \to q and pp. State the conclusion and identify the inference rule. Now suppose instead we know pqp \to q and qq. Can we conclude pp? Justify your answer using the truth table of the conditional.

Modus Tollens

Theorem 12 (Modus Tollens)

For any propositions pp and qq,

pq¬q¬p\frac{p \to q \quad \neg q}{\neg p}
Proof

Assume pqp \to q and ¬q\neg q. By the Contrapositive equivalence (Lesson 1), pq¬q¬pp \to q \equiv \neg q \to \neg p. Since ¬q\neg q is true, Modus Ponens applied to ¬q¬p\neg q \to \neg p and ¬q\neg q yields ¬p\neg p.

The Latin name modus tollendo tollens (“the method of denying by denying”) captures the reasoning: if the consequence of an implication fails, its premise must also fail.

Example 43

If nn is even, then n2n^2 is even. We observe that 4949 is not even (49=224+149 = 2 \cdot 24 + 1). By Modus Tollens, 7 is not even.

Hypothetical Syllogism

Theorem 13 (Hypothetical Syllogism)

For any propositions pp, qq, rr,

pqqrpr\frac{p \to q \quad q \to r}{p \to r}
Proof

Assume pqp \to q and qrq \to r. We wish to show prp \to r. Assume pp. From pp and pqp \to q, Modus Ponens gives qq. From qq and qrq \to r, a second application of Modus Ponens gives rr. Since assuming pp led to rr, we conclude prp \to r.

This inference is also called the chain rule or the transitivity of implication. Every multi-step mathematical deduction is, at its core, a sequence of hypothetical syllogisms. For instance, suppose we know “if nn is divisible by 44, then nn is even” and “if nn is even, then n2n^2 is even.” Hypothetical Syllogism yields: “if nn is divisible by 44, then n2n^2 is even.”

Implication Elimination

Theorem 14 (Implication Elimination)

For any propositions pp and qq, (pq)(pq)(p \to q) \vdash (p \vdash q).

Proof

Assume pqp \to q. We must show pqp \vdash q. Assume pp. From pqp \to q and pp, Modus Ponens yields qq. Thus pqp \vdash q.

This gives one direction of the link between a conditional and a derivation: if pqp \to q is known, then from the assumption pp one may derive qq. The reverse direction will appear later in Direct Proof, where we show that if assuming pp leads to qq, then the conditional pqp \to q is established. Together, the two directions show how the turnstile and the conditional correspond: pqp \vdash q if and only if pq\vdash p \to q.

Further Propositional Inference Rules

Several additional inference rules arise from tautologies. Each is stated with its justifying tautology.

Conjunction. From two established truths, their conjunction follows.

pqpqTautology: (pq)(pq)\frac{p \quad q}{p \land q} \qquad \text{Tautology: } (p \land q) \to (p \land q)

The tautological justification is immediate, but Conjunction can also be derived from Modus Ponens alone via reductio.

Proof

Assume pp and qq. Suppose for contradiction that ¬(pq)\neg(p \land q). By De Morgan’s Law (Theorem 6, Lesson 1), ¬(pq)¬p¬q\neg(p \land q) \equiv \neg p \lor \neg q. By the Conditional axiom (Lesson 1), ¬p¬qp¬q\neg p \lor \neg q \equiv p \to \neg q. Since pp holds, Modus Ponens yields ¬q\neg q. But qq is assumed, a contradiction. Therefore pqp \land q.

Simplification. From a conjunction, either conjunct may be extracted.

pqpTautology: (pq)p\frac{p \land q}{p} \qquad \text{Tautology: } (p \land q) \to p

Addition. A known truth may be weakened to a disjunction.

ppqTautology: p(pq)\frac{p}{p \lor q} \qquad \text{Tautology: } p \to (p \lor q)

Disjunctive Syllogism. If one disjunct is eliminated, the other must hold.

pq¬pqTautology: ((pq)¬p)q\frac{p \lor q \quad \neg p}{q} \qquad \text{Tautology: } ((p \lor q) \land \neg p) \to q

Resolution. Two clauses sharing a complementary literal may be combined, eliminating the shared variable.

¬prpqqrTautology: ((¬pr)(pq))(qr)\frac{\neg p \lor r \quad p \lor q}{q \lor r} \qquad \text{Tautology: } ((\neg p \lor r) \land (p \lor q)) \to (q \lor r)

Constructive Dilemma. Two conditionals with a disjunction of their antecedents yield the disjunction of their consequents.

(αγ)(βδ)(αβ)γδTautology: ((αγ)(βδ)(αβ))(γδ)\frac{(\alpha \to \gamma) \quad (\beta \to \delta) \quad (\alpha \lor \beta)}{\gamma \lor \delta} \qquad \text{Tautology: } ((\alpha \to \gamma) \land (\beta \to \delta) \land (\alpha \lor \beta)) \to (\gamma \lor \delta)

Notice the relationships among these rules. Disjunctive Syllogism is a special case of Resolution (set r=r = \bot and apply the Identity axiom). Addition is dual to Conjunction, and Simplification is a special case of Modus Ponens (since (pq)p(p \land q) \to p is a tautology).

Remark (Resolution Subsumes Other Rules)

Resolution is remarkably powerful. It can recover Hypothetical Syllogism: rewrite pqp \to q as ¬pq\neg p \lor q and qrq \to r as ¬qr\neg q \lor r (by the Conditional axiom, Lesson 1), then a single resolution step on qq yields ¬pr\neg p \lor r, which is prp \to r. It can also recover Modus Ponens: express pp as pp \lor \bot and pqp \to q as ¬pq\neg p \lor q, and resolution gives qqq \lor \bot \equiv q by the Identity axiom. This universality makes Resolution the basis of automated theorem proving in computer science.

The following table collects the propositional inference rules for reference.

NameRuleTautologyModus Ponensp,  pq    q((pq)p)qModus Tollens¬q,  pq    ¬p((pq)¬q)¬pHyp. Syllogismpq,  qr    pr((pq)(qr))(pr)Conjunctionp,  q    pq(pq)(pq)Simplificationpq    p(pq)pAdditionp    pqp(pq)Disj. Syllogismpq,  ¬p    q((pq)¬p)qResolution¬pr,  pq    qr((¬pr)(pq))(qr)Constr. Dilemma(αγ),  (βδ),  αβ    γδ((αγ)(βδ)(αβ))(γδ)Disj. Elimination(pr),  (qr),  pq    r((pr)(qr)(pq))rEx Falsop,  ¬p    q(p¬p)q\begin{array}{lcc} \textbf{Name} & \textbf{Rule} & \textbf{Tautology} \\ \hline \text{Modus Ponens} & p,\; p \to q \;\vdash\; q & ((p \to q) \land p) \to q \\ \text{Modus Tollens} & \neg q,\; p \to q \;\vdash\; \neg p & ((p \to q) \land \neg q) \to \neg p \\ \text{Hyp.\ Syllogism} & p \to q,\; q \to r \;\vdash\; p \to r & ((p \to q) \land (q \to r)) \to (p \to r) \\ \text{Conjunction} & p,\; q \;\vdash\; p \land q & (p \land q) \to (p \land q) \\ \text{Simplification} & p \land q \;\vdash\; p & (p \land q) \to p \\ \text{Addition} & p \;\vdash\; p \lor q & p \to (p \lor q) \\ \text{Disj.\ Syllogism} & p \lor q,\; \neg p \;\vdash\; q & ((p \lor q) \land \neg p) \to q \\ \text{Resolution} & \neg p \lor r,\; p \lor q \;\vdash\; q \lor r & ((\neg p \lor r) \land (p \lor q)) \to (q \lor r) \\ \text{Constr.\ Dilemma} & (\alpha \to \gamma),\; (\beta \to \delta),\; \alpha \lor \beta \;\vdash\; \gamma \lor \delta & ((\alpha \to \gamma) \land (\beta \to \delta) \land (\alpha \lor \beta)) \to (\gamma \lor \delta) \\ \text{Disj.\ Elimination} & (p \to r),\; (q \to r),\; p \lor q \;\vdash\; r & ((p \to r) \land (q \to r) \land (p \lor q)) \to r \\ \text{Ex Falso} & p,\; \neg p \;\vdash\; q & (p \land \neg p) \to q \end{array}
Problem 57

Identify the inference rule applied in each step of the following argument. Premises: (i) pqp \to q, (ii) ¬qr\neg q \lor r, (iii) ¬r\neg r.

  1. From (ii) and (iii), conclude ¬q\neg q.
  2. From (i) and step 1, conclude ¬p\neg p.

Building Complex Arguments

The power of inference rules lies in chaining them. A valid argument is a sequence of steps in which each step is either a premise or follows from earlier steps by a single inference rule.

Example 44

We show the following argument is valid. Premises: (1) p(pq)p \land (p \to q), (2) qrq \to r. Conclusion: rr.

1.p(pq)Premise2.qrPremise3.pSimplification from 14.pqSimplification from 15.qModus Ponens from 3, 46.rModus Ponens from 5, 2\begin{array}{rll} 1. & p \land (p \to q) & \text{Premise} \\ 2. & q \to r & \text{Premise} \\ 3. & p & \text{Simplification from 1} \\ 4. & p \to q & \text{Simplification from 1} \\ 5. & q & \text{Modus Ponens from 3, 4} \\ 6. & r & \text{Modus Ponens from 5, 2} \end{array}
Problem 58

Show that the following argument is valid by listing each step and the inference rule used. Premises: (1) pqp \to q, (2) q(rs)q \to (r \land s), (3) ¬ru\neg r \lor u, (4) pp. Conclusion: uu.

Hint. Apply Hypothetical Syllogism, then Modus Ponens, then Simplification, then Disjunctive Syllogism.

Inference Rules for Quantified Statements

The rules above govern propositional logic. When predicates and quantifiers enter the picture, additional rules are needed to bridge the gap between universal or existential claims and their specific instances.

Universal Instantiation (UI). If a predicate holds for every element of the universe, it holds for any particular element cc:

xP(x)P(c)for any c in the universe\frac{\forall x\, P(x)}{P(c)} \quad \text{for any } c \text{ in the universe}

Universal Generalisation (UG). If P(c)P(c) can be established for an arbitrary element cc (one about which no special assumptions are made), then xP(x)\forall x\, P(x) follows:

P(c) for arbitrary cxP(x)\frac{P(c) \text{ for arbitrary } c}{\forall x\, P(x)}

The word “arbitrary” is critical. If the proof of P(c)P(c) exploits any property peculiar to cc, the generalisation is invalid.

Existential Instantiation (EI). If at least one element satisfies PP, we may introduce a name cc for such an element:

xP(x)P(c) for some c\frac{\exists x\, P(x)}{P(c) \text{ for some } c}

The name cc must be fresh: not previously used in the argument.

Existential Generalisation (EG). If a particular element cc satisfies PP, then at least one element does:

P(c)xP(x)\frac{P(c)}{\exists x\, P(x)}

Universal Modus Ponens (UMP). Combining Universal Instantiation with Modus Ponens yields perhaps the most frequently used quantifier rule in practice:

x(P(x)Q(x))P(c)Q(c)\frac{\forall x\,(P(x) \to Q(x)) \quad P(c)}{Q(c)}
Example 45

Suppose we know x(x>0xR)\forall x\,(x > 0 \to \sqrt{x} \in \mathbb{R}) (the universe is R\mathbb{R}) and that 9>09 > 0. Universal Modus Ponens yields 9R\sqrt{9} \in \mathbb{R}.

Problem 59

Identify the quantifier inference rule used in each step. The universe is the positive integers.

  1. “Every multiple of 66 is a multiple of 33.” (Premise)
  2. 18=6318 = 6 \cdot 3, so 1818 is a multiple of 66.” (Premise)
  3. “Therefore, 1818 is a multiple of 33.”
  4. “Therefore, there exists a positive integer that is a multiple of 33.”
Example 46 (Combining Quantifier Rules)

We show that “a student in this class has not read the book” and “every student in this class passed the first exam” together imply “someone who passed the first exam has not read the book.”

Let C(x)C(x) denote ”xx is in this class,” B(x)B(x) denote ”xx has read the book,” and E(x)E(x) denote ”xx passed the exam.” The premises are x(C(x)¬B(x))\exists x\,(C(x) \land \neg B(x)) and x(C(x)E(x))\forall x\,(C(x) \to E(x)). We derive x(E(x)¬B(x))\exists x\,(E(x) \land \neg B(x)).

1.x(C(x)¬B(x))Premise2.x(C(x)E(x))Premise3.C(a)¬B(a) for some aEI from 14.C(a)E(a)UI from 25.C(a)Simplification from 36.E(a)Modus Ponens from 4, 57.¬B(a)Simplification from 38.E(a)¬B(a)Conjunction from 6, 79.x(E(x)¬B(x))EG from 8\begin{array}{rll} 1. & \exists x\,(C(x) \land \neg B(x)) & \text{Premise} \\ 2. & \forall x\,(C(x) \to E(x)) & \text{Premise} \\ 3. & C(a) \land \neg B(a) \text{ for some } a & \text{EI from 1} \\ 4. & C(a) \to E(a) & \text{UI from 2} \\ 5. & C(a) & \text{Simplification from 3} \\ 6. & E(a) & \text{Modus Ponens from 4, 5} \\ 7. & \neg B(a) & \text{Simplification from 3} \\ 8. & E(a) \land \neg B(a) & \text{Conjunction from 6, 7} \\ 9. & \exists x\,(E(x) \land \neg B(x)) & \text{EG from 8} \end{array}

Fallacies

Definition 46 (Fallacy)

A fallacy is an argument form that appears valid but is not: the premises do not logically guarantee the conclusion, even though the reasoning may seem persuasive.

Two fallacies are especially common. Both arise from misapplying the conditional.

Affirming the Consequent. The argument ”pqp \to q; qq; therefore pp” is invalid. A counterexample: let p=p = \bot and q=q = \top. Then pqp \to q is \top and qq is \top, but pp is \bot.

Denying the Antecedent. The argument ”pqp \to q; ¬p\neg p; therefore ¬q\neg q” is equally invalid. With p=p = \bot and q=q = \top, both premises are satisfied but ¬q\neg q is \bot.

Both fallacies confuse an implication with its converse or its inverse (Lesson 1): pqp \to q does not entail qpq \to p, nor does it entail ¬p¬q\neg p \to \neg q.

Example 47

“If it rained, the pitch is wet. The pitch is wet. Therefore it rained.” This affirms the consequent. The pitch might be wet because the sprinklers were on. The converse “if the pitch is wet, then it rained” does not follow from the original implication.

Problem 60

Identify the fallacy in each argument and provide a counterexample (an assignment under which the premises are true but the conclusion is false).

(a) “If nn is divisible by 66, then nn is divisible by 33. The integer 99 is divisible by 33. Therefore 99 is divisible by 66.”

(b) “If nn is prime, then n>1n > 1. The integer 44 is not prime. Therefore 414 \leqslant 1.”

Proof Techniques

With inference rules in hand, we turn to the practical matter of constructing proofs. A proof is a finite sequence of statements, each of which is an axiom, a premise, or a consequence of earlier statements by an inference rule. The form of the theorem often dictates the most effective strategy.

The building blocks of mathematical exposition have standard names. A theorem is a statement that can be shown to be true using definitions, axioms, other theorems, and rules of inference. An axiom is a statement accepted as true without proof (we met several in Lesson 1). A lemma is a “helping theorem,” proved in order to simplify the proof of a more substantial result. A corollary is a consequence that follows directly from a theorem. The term proposition is used for results considered less central than theorems. A conjecture is a statement proposed as true but not yet proved; Fermat’s Last Theorem was conjectured around 1637 and proved by Wiles in 1995, while Euler’s conjecture (an attempted generalisation) was conjectured in 1769 and disproved by counterexample in 1966.

The most common proof strategies for a conditional pqp \to q are collected below. Each is developed in its own subsection.

StrategyApproachJustificationTrivial proofShow q is trueq true    pq trueVacuous proofShow p is falsep false    pq trueDirect proofAssume p, derive qpq        pqContrapositiveAssume ¬q, derive ¬ppq¬q¬pContradictionAssume p¬q, derive r¬r(p¬q)        pq\begin{array}{lll} \textbf{Strategy} & \textbf{Approach} & \textbf{Justification} \\ \hline \text{Trivial proof} & \text{Show } q \text{ is true} & q \text{ true} \implies p \to q \text{ true} \\ \text{Vacuous proof} & \text{Show } p \text{ is false} & p \text{ false} \implies p \to q \text{ true} \\ \text{Direct proof} & \text{Assume } p,\text{ derive } q & p \vdash q \;\implies\; \vdash p \to q \\ \text{Contrapositive} & \text{Assume } \neg q,\text{ derive } \neg p & p \to q \equiv \neg q \to \neg p \\ \text{Contradiction} & \text{Assume } p \land \neg q,\text{ derive } r \land \neg r & (p \land \neg q) \to \bot \;\implies\; p \to q \end{array}

The last two strategies are called indirect proofs, since they establish the conditional without directly constructing a chain from pp to qq.

Direct Proof

Definition 47 (Direct Proof)

A direct proof of a conditional statement pqp \to q proceeds by assuming pp and deriving qq through a sequence of valid inferences. The assumption of pp is not asserted as fact; it is a hypothesis under which the argument operates.

This strategy reflects the Deduction Rule, a meta-logical principle: if assuming pp allows us to derive qq using valid inferences, then the conditional pqp \to q is established. In a sense, the Deduction Rule is the bridge between the turnstile (\vdash) and the conditional (\to): the statement pqp \vdash q (a syntactic derivation) becomes pqp \to q (a logical truth).

Example 48 (Sum of Two Rationals)

If rr and ss are rational numbers, then r+sr + s is rational.

Proof

Assume rr and ss are rational. By Definition 27 (Lesson 2), there exist integers a,b,c,da, b, c, d with b0b \neq 0 and d0d \neq 0 such that r=abr = \frac{a}{b} and s=cds = \frac{c}{d}. Then

r+s=ab+cd=ad+bcbdr + s = \frac{a}{b} + \frac{c}{d} = \frac{ad + bc}{bd}

Since ad+bcad + bc and bdbd are integers and bd0bd \neq 0, the fraction ad+bcbd\frac{ad + bc}{bd} satisfies Definition 27. Therefore r+sQr + s \in \mathbb{Q}.

Example 49 (Product of Two Odd Integers)

If mm and nn are odd integers, then mnmn is odd.

Proof

Assume mm and nn are odd. Since mm is not even, the Division Theorem (Theorem 9, Lesson 2) gives m=2j+1m = 2j + 1 for some integer jj. Likewise, n=2k+1n = 2k + 1 for some integer kk. Then

mn=(2j+1)(2k+1)=4jk+2j+2k+1=2(2jk+j+k)+1mn = (2j + 1)(2k + 1) = 4jk + 2j + 2k + 1 = 2(2jk + j + k) + 1

Since 2jk+j+k2jk + j + k is an integer, mnmn leaves a remainder of 11 when divided by 22, so mnmn is not divisible by 22. By Definition 38 (Lesson 2), mnmn is odd.

Problem 61

Prove directly that the product of a rational number and an integer is rational.

Problem 62

Prove directly that for all integers aa and bb, if aba \mid b, then a2b2a^2 \mid b^2.

Hint. By Definition 37 (Lesson 2), aba \mid b means b=qab = qa for some integer qq.

Proof by Cases

When no single line of reasoning covers every possibility, it can be effective to partition the argument into exhaustive cases. If every case leads to the same conclusion, the conclusion holds unconditionally. This strategy corresponds to the disjunction elimination rule: if p1p2pkp_1 \lor p_2 \lor \cdots \lor p_k is known and each pip_i implies qq, then qq follows.

Example 50 (Squares Modulo 3)

For every integer nn, the remainder when n2n^2 is divided by 33 is either 00 or 11.

Proof

By the Division Theorem (Theorem 9, Lesson 2), every integer nn satisfies exactly one of n=3kn = 3k, n=3k+1n = 3k + 1, or n=3k+2n = 3k + 2 for some integer kk.

Case 1. n=3kn = 3k. Then n2=9k2=3(3k2)n^2 = 9k^2 = 3(3k^2), so n2n^2 has remainder 00.

Case 2. n=3k+1n = 3k + 1. Then n2=9k2+6k+1=3(3k2+2k)+1n^2 = 9k^2 + 6k + 1 = 3(3k^2 + 2k) + 1, so n2n^2 has remainder 11.

Case 3. n=3k+2n = 3k + 2. Then n2=9k2+12k+4=3(3k2+4k+1)+1n^2 = 9k^2 + 12k + 4 = 3(3k^2 + 4k + 1) + 1, so n2n^2 has remainder 11.

In all cases, the remainder is 00 or 11.

Problem 63

Prove that for every integer nn, the remainder when n2n^2 is divided by 55 is one of 00, 11, or 44.

Remark (Without Loss of Generality)

In a proof by cases, it sometimes happens that two cases are identical up to a relabelling of variables. We then handle one case and dismiss the other with the phrase “without loss of generality” (abbreviated WLOG). For instance, to prove by contrapositive that “if x,yZx, y \in \mathbb{Z} and both xyxy and x+yx + y are even, then xx and yy are both even,” we must show that if xx or yy is odd then xyxy or x+yx + y is odd. Since the hypotheses are symmetric in xx and yy, we may assume WLOG that xx is odd; the remaining case follows by swapping xx and yy.

Proof by Contradiction

Definition 48 (Proof by Contradiction)

A proof by contradiction (Latin: reductio ad absurdum) establishes a proposition pp by assuming ¬p\neg p and deriving a contradiction, that is, a statement of the form q¬qq \land \neg q for some proposition qq. Since a sound proof system cannot derive a false conclusion from true premises, the assumption ¬p\neg p must be false, so pp is true.

This technique is especially effective when the desired conclusion is a negation (”xx is not rational”) or when a direct approach offers no obvious path forward.

Example 51 (Rational Plus Irrational)

Let rr be a rational number and aa an irrational number. Then r+ar + a is irrational.

Proof

Suppose for contradiction that r+ar + a is rational. By Definition 27 (Lesson 2), there exist integers p,q,m,np, q, m, n with q0q \neq 0 and n0n \neq 0 such that r=pqr = \frac{p}{q} and r+a=mnr + a = \frac{m}{n}. Then

a=(r+a)r=mnpq=mqnpnqa = (r + a) - r = \frac{m}{n} - \frac{p}{q} = \frac{mq - np}{nq}

Since mqnpmq - np and nqnq are integers with nq0nq \neq 0, aa is rational. This contradicts the hypothesis that aa is irrational. Therefore r+ar + a is irrational.

In Lesson 2, the interaction between rational and irrational numbers was discussed informally. The result above gives a precise instance: a rational shift can never send an irrational number to a rational one.

Problem 64

Let xRx \in \mathbb{R}. Prove by contradiction that if xx is irrational, then x-x and 1x\frac{1}{x} are both irrational.

Example 52 (No Least Positive Real Number)

There is no least positive real number. That is, there is no positive real number aa such that aba \leqslant b for every positive real number bb.

Proof

Suppose for contradiction that a least positive real number aa exists: a>0a > 0 and aba \leqslant b for every positive real number bb. Consider a2\frac{a}{2}. Since a>0a > 0, we have a2>0\frac{a}{2} > 0, so a2\frac{a}{2} is a positive real number. But a2<a\frac{a}{2} < a, contradicting aba \leqslant b for all positive bb.

Example 53 (Even Square Implies Even Root)

If nn is an integer and n2n^2 is even, then nn is even.

Proof

We prove the logically equivalent contrapositive: if nn is odd, then n2n^2 is odd. Assume nn is odd. Since nn is not even, the Division Theorem (Theorem 9, Lesson 2) gives n=2k+1n = 2k + 1 for some integer kk. Then

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

Since 2k2+2k2k^2 + 2k is an integer, n2n^2 leaves remainder 11 when divided by 22, so n2n^2 is odd. The contrapositive is logically equivalent to the original statement (Lesson 1).

Example 54 (Contrapositive: Parity of 3n + 2)

If nn is an integer and 3n+23n + 2 is odd, then nn is odd.

Proof

We prove the contrapositive: if nn is even, then 3n+23n + 2 is even. Suppose n=2kn = 2k for some integer kk. Then

3n+2=6k+2=2(3k+1)3n + 2 = 6k + 2 = 2(3k + 1)

Since 3k+1Z3k + 1 \in \mathbb{Z}, 3n+23n + 2 is even. The contrapositive is equivalent to the original statement.

Remark

The preceding proofs used the contrapositive rather than a direct contradiction. The distinction is worth noting. A proof by contradiction assumes the negation of the entire statement and derives an absurdity. A contrapositive proof assumes the negation of the conclusion and derives the negation of the hypothesis, which is simply a direct proof of the equivalent contrapositive. In practice, mathematicians often label both “proof by contradiction,” but the contrapositive route is frequently cleaner when hypothesis and conclusion are both conditionals.

The proof of the irrationality of 2\sqrt{2} is the most celebrated “genuine” contradiction: the assumption leads to a statement that contradicts itself, rather than merely establishing a contrapositive. This fulfils the promise made in Lesson 2, where the irrationality of 2\sqrt{2} was stated and its proof deferred.

Example 55 (Irrationality of √2)

2\sqrt{2} is irrational.

Proof

Suppose for contradiction that 2\sqrt{2} is rational. By Definition 27 (Lesson 2), there exist integers aa and bb with b0b \neq 0 such that 2=ab\sqrt{2} = \frac{a}{b}, where aa and bb share no common factor. Squaring gives 2b2=a22b^2 = a^2, so a2a^2 is even. By Example 52 above (even square implies even root), aa is even, say a=2ca = 2c. Then 2b2=4c22b^2 = 4c^2, so b2=2c2b^2 = 2c^2, and b2b^2 is even. By the same result, bb is even. But then aa and bb are both divisible by 22, contradicting the assumption that they share no common factor.

Theorem 15 (Pigeon-hole Principle)

If more than NN objects are distributed among NN containers, then at least one container holds two or more objects.

Proof

Suppose for contradiction that every container holds at most one object. Then the total number of objects is at most NN, contradicting the hypothesis that there are more than NN.

Problem 65

Prove by contradiction that there is no integer nn such that n2+nn^2 + n is odd.

Hint. Factor: n2+n=n(n+1)n^2 + n = n(n + 1). Consider the parity of nn and n+1n + 1.

Biconditional Proofs

A biconditional pqp \leftrightarrow q is, by definition (Lesson 1), the conjunction (pq)(qp)(p \to q) \land (q \to p). To prove it, one must establish both directions: the forward implication and its converse. In practice, the two parts are labelled (    \implies) and (    \impliedby).

Example 56 (Characterisation of Odd Integers)

An integer aa is odd if and only if a=2b+1a = 2b + 1 for some integer bb.

Proof

(    \implies) Suppose aa is odd. By Definition 38 (Lesson 2), aa is not even, so 2a2 \nmid a. The Division Theorem (Theorem 9) gives unique integers bb and rr with 0r<20 \leqslant r < 2 and a=2b+ra = 2b + r. Since r{0,1}r \in \{0, 1\} and r=0r = 0 would give 2a2 \mid a, contradicting our assumption, we have r=1r = 1. Hence a=2b+1a = 2b + 1.

(    \impliedby) Suppose a=2b+1a = 2b + 1 for some integer bb. Then aa has remainder 11 when divided by 22. By the Division Theorem, the remainder is unique, so a2ka \neq 2k for any integer kk. Hence 2a2 \nmid a, and by Definition 38, aa is odd.

Remark (Always Check the Converse)

A common error is to prove one direction of a biconditional and assume the other follows. Consider the equation x3+x+4=7\sqrt{x - 3} + \sqrt{x + 4} = 7. Squaring both sides and simplifying produces x=12x = 12 as the sole candidate. However, squaring can introduce extraneous solutions, so we must substitute back: 9+16=3+4=7\sqrt{9} + \sqrt{16} = 3 + 4 = 7. Here the candidate is genuine. Contrast this with x+x=0x + \sqrt{x} = 0: squaring leads to candidates x=0x = 0 and x=1x = 1, but 1+1=201 + \sqrt{1} = 2 \neq 0, so only x=0x = 0 is a true solution.

Problem 66

Prove that an integer nn is even if and only if n+1n + 1 is odd.

Example 57 (The Quadratic Formula)

Let a,bCa, b \in \mathbb{C}. A complex number α\alpha is a root of the polynomial x2+ax+bx^2 + ax + b if and only if

α=a+a24b2orα=aa24b2\alpha = \frac{-a + \sqrt{a^2 - 4b}}{2} \quad \text{or} \quad \alpha = \frac{-a - \sqrt{a^2 - 4b}}{2}

This was stated without proof in Lesson 2. We now prove it as a biconditional.

Proof

(    \implies) Suppose α2+aα+b=0\alpha^2 + a\alpha + b = 0. By the completing the square identity (Lesson 2),

(α+a2)2=a24b4\left(\alpha + \frac{a}{2}\right)^2 = \frac{a^2 - 4b}{4}

Since square roots of all complex numbers exist (Lesson 2),

α+a2=a24b2orα+a2=a24b2\alpha + \frac{a}{2} = \frac{\sqrt{a^2 - 4b}}{2} \quad \text{or} \quad \alpha + \frac{a}{2} = \frac{-\sqrt{a^2 - 4b}}{2}

Subtracting a2\frac{a}{2} gives the two stated values.

(    \impliedby) Direct substitution of either value into α2+aα+b\alpha^2 + a\alpha + b and expanding yields 00.

Example 58 (Divisibility by 8 via Digits)

A natural number nn is divisible by 88 if and only if the number formed by its last three base-1010 digits is divisible by 88.

Proof

Let drdr1d1d0d_r d_{r-1} \ldots d_1 d_0 be the base-1010 expansion of nn (Definition 32, Lesson 2). Write nn' for the number d2d1d0d_2 d_1 d_0 formed by the last three digits, and n=nnn'' = n - n'. Then

n=dr10r++d3103=1000(dr10r3++d3)n'' = d_r \cdot 10^r + \cdots + d_3 \cdot 10^3 = 1000(d_r \cdot 10^{r-3} + \cdots + d_3)

Since 1000=8×1251000 = 8 \times 125, we have 8n8 \mid n''.

(    \implies) Suppose 8n8 \mid n. Then n=nnn' = n - n'' is the difference of two multiples of 88, so 8n8 \mid n'.

(    \impliedby) Suppose 8n8 \mid n'. Then n=n+nn = n' + n'' is the sum of two multiples of 88, so 8n8 \mid n.

Problem 67

Prove that a natural number nn is divisible by 33 if and only if the sum of its base-1010 digits is divisible by 33.

Hint. By the Division Theorem (Theorem 9, Lesson 2), 10=33+110 = 3 \cdot 3 + 1, so 10k10^k leaves remainder 11 when divided by 33 for every k0k \geqslant 0.

Problem 68

Let a,bRa, b \in \mathbb{R} with a24b0a^2 - 4b \neq 0, and let α,β\alpha, \beta be the distinct roots of x2+ax+bx^2 + ax + b. Prove that there exists a real number cc such that αβ=c\alpha - \beta = c or αβ=ci\alpha - \beta = ci.

Hint. Apply the quadratic formula and consider the cases a24b>0a^2 - 4b > 0 and a24b<0a^2 - 4b < 0 separately.

The Law of Excluded Middle

Theorem 16 (Law of Excluded Middle)

For any proposition pp, p¬pp \lor \neg p is a tautology.

Proof

By the Complement axiom (Lesson 1), ¬pp\neg p \lor p \equiv \top. By the Commutativity axiom (Lesson 1), ¬ppp¬p\neg p \lor p \equiv p \lor \neg p. Therefore p¬pp \lor \neg p \equiv \top.

The Law of Excluded Middle (LEM) asserts that every proposition is either true or false; no third possibility exists. In proofs, LEM allows us to split into the exhaustive cases pp and ¬p\neg p even without knowing which actually holds. This is sometimes called non-constructive reasoning: the conclusion is established without determining which case obtains.

Example 59 (Even Product)

Let a,bZa, b \in \mathbb{Z}. If abab is even, then aa is even or bb is even (or both).

Proof

Suppose abab is even. By LEM, either aa is even or aa is odd.

Case 1. If aa is even, the conclusion holds immediately.

Case 2. Suppose aa is odd. If bb were also odd, then by Example 48 (product of two odd integers), abab would be odd. But abab is even, a contradiction. Therefore bb is even.

In both cases, at least one of aa or bb is even.

Problem 69

Using the Law of Excluded Middle, prove that for all integers nn, n(n+1)n(n + 1) is even.

Hint. By LEM, either nn is even or nn is odd. In each case, exhibit a factor of 22 in n(n+1)n(n + 1).

Problem 70

Reflect on the proof of the preceding example (Even Product). Where was the Law of Excluded Middle used? Where was proof by contradiction used? What was the contradiction? Prove the same result twice more: once using contradiction without LEM, and once using LEM without contradiction.

Problem 71

Let aa and bb be irrational numbers. By considering the number 22\sqrt{2}^{\sqrt{2}}, prove that it is possible for aba^b to be rational.

Hint. By LEM, either 22\sqrt{2}^{\sqrt{2}} is rational or it is irrational. In each case, exhibit irrational numbers a,ba, b such that aba^b is rational. For the second case, examine (22)2\left(\sqrt{2}^{\sqrt{2}}\right)^{\sqrt{2}}.

Ex Falso Quodlibet

The principle ex falso sequitur quodlibet (“from falsity follows whatever you like”) states that from a contradiction, any proposition may be derived:

p¬pqfor every q\frac{p \quad \neg p}{q} \quad \text{for every } q

Its validity rests on the tautology (p¬p)q(p \land \neg p) \to q: since p¬pp \land \neg p is identically false, the conditional holds for every qq by vacuous truth.

Example 60 (Consequences of a Contradiction)

Suppose we accept the false premise 1=1-1 = 1. Adding 11 to both sides gives 0=20 = 2, a false consequence. Squaring both sides gives 1=11 = 1, a true consequence. From a single contradiction, both true and false statements follow. Once a contradiction enters, the proof system can no longer distinguish truth from falsehood, and every proposition becomes derivable.

We rarely invoke Ex Falso directly, but it is the logical foundation of proof by contradiction: if assuming ¬p\neg p produces a contradiction with our true premises, then ¬p\neg p cannot coexist with those premises, and pp must hold.

Proving Quantified Statements

The proof techniques developed above apply equally when the statement involves quantifiers. Two patterns arise directly from the quantifier rules (Universal Generalisation and Existential Generalisation).

Universally quantified goals. To prove xU,P(x)\forall x \in U,\, P(x), fix an arbitrary element cUc \in U, assuming nothing about cc beyond membership in UU, and prove P(c)P(c). Universal Generalisation then yields the universal claim. Every direct proof, proof by cases, or proof by contradiction of a “for all” statement opens by fixing such an element: “let nn be an integer”, “fix rQr \in \mathbb{Q}”, and so on. All the proofs in the preceding subsections follow this pattern.

Remark (A Common Error)

Consider the statement nZ,n20\forall n \in \mathbb{Z},\, n^2 \geqslant 0. The following is not a valid proof: “Let nn be an arbitrary integer, say n=17n = 17. Then 172=289017^2 = 289 \geqslant 0.” The writer has chosen a specific value, not an arbitrary one. This argument proves nZ,n20\exists n \in \mathbb{Z},\, n^2 \geqslant 0, not the universal claim. A correct proof proceeds without naming nn: “Let nZn \in \mathbb{Z}. If n0n \geqslant 0, then n20n^2 \geqslant 0 since the product of two non-negative numbers is non-negative. If n<0n < 0, then n2>0n^2 > 0 since the product of two negative numbers is positive.”

Example 61 (Final Digits of Perfect Squares)

The base-1010 expansion of the square of every natural number ends in one of the digits 0,1,4,5,60, 1, 4, 5, 6, or 99.

Proof

Fix nNn \in \mathbb{N} and let drdr1d0d_r d_{r-1} \ldots d_0 be its base-1010 expansion (Definition 32, Lesson 2). Write n=10m+d0n = 10m + d_0 where mNm \in \mathbb{N}. Then

n2=100m2+20md0+d02=10(10m2+2md0)+d02n^2 = 100m^2 + 20md_0 + d_0^2 = 10(10m^2 + 2md_0) + d_0^2

The final digit of n2n^2 is therefore the final digit of d02d_0^2. Since d0{0,1,,9}d_0 \in \{0, 1, \ldots, 9\}, we compute:

0,  1,  4,  9,  16,  25,  36,  49,  64,  810, \; 1, \; 4, \; 9, \; 16, \; 25, \; 36, \; 49, \; 64, \; 81

The final digits are 0,1,4,9,6,5,6,9,4,10, 1, 4, 9, 6, 5, 6, 9, 4, 1, all belonging to {0,1,4,5,6,9}\{0, 1, 4, 5, 6, 9\}.

Problem 72

Prove that for all real numbers xx and yy, if xx is irrational, then x+yx + y and xyx - y are not both rational.

Hint. Suppose for contradiction that both are rational, and compute their sum.

Problem 73

Prove that every integer is rational.

Problem 74

Prove that every linear polynomial over Q\mathbb{Q} has a rational root.

Hint. A linear polynomial over Q\mathbb{Q} has the form ax+bax + b where a,bQa, b \in \mathbb{Q} and a0a \neq 0.

Problem 75

Prove that for all x,yQx, y \in \mathbb{Q}, if x<yx < y then there exists zQz \in \mathbb{Q} with x<z<yx < z < y.

Hint. Consider z=x+y2z = \frac{x + y}{2}.

Existentially quantified goals. To prove xU,P(x)\exists x \in U,\, P(x), exhibit a specific element cUc \in U and verify P(c)P(c). Existential Generalisation then yields the existential claim. This is called a constructive existence proof: the witness is explicitly produced.

Example 62 (A Constructive Existence Proof)

Fix aRa \in \mathbb{R}. The cubic polynomial x3+(1a2)xax^3 + (1 - a^2)x - a has a real root.

Proof

Define x=ax = a. Then

a3+(1a2)aa=a3+aa3a=0a^3 + (1 - a^2)a - a = a^3 + a - a^3 - a = 0

Since aRa \in \mathbb{R}, the polynomial has a real root.

Example 63 (A Perfect Square Above a Perfect Cube)

There is a natural number that is simultaneously a perfect square and one more than a perfect cube.

Proof

Take n=9n = 9. Then n=32n = 3^2 and n=23+1n = 2^3 + 1, so nn is a perfect square and one more than a perfect cube.

Example 64 (Sums of Cubes in Two Ways)

There exists a positive integer expressible as a sum of two cubes in two distinct ways.

Proof

Take n=1729n = 1729. Then 1729=103+93=123+131729 = 10^3 + 9^3 = 12^3 + 1^3. (This is the Hardy–Ramanujan number, after a celebrated anecdote between G. H. Hardy and S. Ramanujan.)

In a non-constructive existence proof, we establish that a witness must exist without identifying it. The 22\sqrt{2}^{\sqrt{2}} exercise earlier is an example: LEM guarantees that one of two candidates works, but the proof does not determine which.

Disproving universal claims. To show xU,P(x)\forall x \in U,\, P(x) is false, it suffices to exhibit a single counterexample: an element cc with ¬P(c)\neg P(c). This is an existence proof of xU,¬P(x)\exists x \in U,\, \neg P(x).

Example 65 (A Counterexample)

The claim “every positive integer is the sum of two perfect squares” is false. The integer 33 is a counterexample: the only sums of two squares not exceeding 33 are 0+0=00 + 0 = 0, 0+1=10 + 1 = 1, 1+1=21 + 1 = 2, and 0+4=40 + 4 = 4, none of which equal 33.

Problem 76

Disprove the claim: for every integer n2n \geqslant 2, 2n+12^n + 1 is prime.

Problem 77

Prove that there is an integer that is divisible by zero.

Hint. Recall Definition 37 (Lesson 2): aba \mid b means b=qab = qa for some integer qq.

Uniqueness. To prove !xU,P(x)\exists!\, x \in U,\, P(x) (the unique existential quantifier, Lesson 3), first establish existence by producing a witness cc with P(c)P(c), then establish uniqueness by assuming P(a)P(a) and P(b)P(b) and deducing a=ba = b.

Example 66 (Unique Positive Square Root)

Every positive real number has a unique positive square root.

Proof

Fix a>0a > 0.

Existence. The number a\sqrt{a} is positive and satisfies (a)2=a(\sqrt{a})^2 = a.

Uniqueness. Suppose y,z>0y, z > 0 with y2=ay^2 = a and z2=az^2 = a. Then y2=z2y^2 = z^2, so (yz)(y+z)=0(y - z)(y + z) = 0. If y+z=0y + z = 0, then z=y<0z = -y < 0, contradicting z>0z > 0. Therefore yz=0y - z = 0, i.e., y=zy = z.

Problem 78

Let nZn \in \mathbb{Z}. Prove that if n3n^3 is divisible by 33, then (n+1)31(n + 1)^3 - 1 is divisible by 33.

Hint. Expand (n+1)31(n + 1)^3 - 1 and use the hypothesis 3n33 \mid n^3.

Problem 79

(a) Prove that there is a real number which is irrational but whose square is rational.

(b) Prove that for each real number aa, the equation x2+2ax+a2=0x^2 + 2ax + a^2 = 0 has exactly one real solution.

Problem 80

Prove that there is a unique natural number with exactly one positive divisor.

Remark (Mistakes in Proofs)

A chain of equalities is only as strong as its weakest step. Consider the “proof” that 1=1-1 = 1:

1=(1)1=(1)2/2=((1)2)1/2=11/2=1\begin{aligned} -1 &= (-1)^1 \\ &= (-1)^{2/2} \\ &= \bigl((-1)^2\bigr)^{1/2} \\ &= 1^{1/2} \\ &= 1 \end{aligned}

The error is in the third step: the law (xa)b=xab(x^a)^b = x^{ab} requires x0x \geqslant 0. Similarly, squaring both sides of an equation can introduce extraneous solutions (as noted in the biconditional remark above). Each step in a proof must be a valid inference, not merely a plausible manipulation.

Quantifiers can also conceal errors. The formula (pq)(qp)(p \to q) \lor (q \to p) is a propositional tautology (verify this by truth table). Substituting predicates p(n)p(n) = ”nn is odd” and q(n)q(n) = ”nn is prime,” one might reason: “for every nn, either oddness implies primality or primality implies oddness.” Yet neither n(p(n)q(n))\forall n\,(p(n) \to q(n)) nor n(q(n)p(n))\forall n\,(q(n) \to p(n)) is true. The resolution is that n[(p(n)q(n))(q(n)p(n))]\forall n\,[(p(n) \to q(n)) \lor (q(n) \to p(n))] is not the same as [n(p(n)q(n))][n(q(n)p(n))][\forall n\,(p(n) \to q(n))] \lor [\forall n\,(q(n) \to p(n))]. The universal quantifier does not distribute over disjunction. The first formula is indeed true (for each fixed nn, one of the two conditionals holds), but the second is false.

Note (Hilbert Systems)

It is possible to build a far more economical proof system than the one developed in these notes. Hilbert and Frege showed that all of propositional logic can be axiomatised using only two connectives (¬\neg and \to), three axiom schemas, and Modus Ponens as the sole rule of inference. The price of such minimalism is longer proofs: what we accomplish in a few lines may require many more steps in a Hilbert system.

Natural Deduction

An alternative framework, called natural deduction (developed independently by Gentzen and Jaśkowski in the 1930s), organises inference rules into introduction rules (which establish a connective) and elimination rules (which extract information from it). The Conjunction rule is the introduction rule for \land (\landI), and the two Simplification rules are its elimination rules (\landE1_1, \landE2_2). Addition is \lorI, and Modus Ponens is \toE. Both our current system and natural deduction are sound and complete for propositional logic.

In this framework, rules are combined into proof trees. Each leaf is an assumption, and each internal node applies an introduction or elimination rule. For instance, the tree

pqpq  (I)r(pq)r  (I)\frac{\dfrac{p \quad q}{p \land q}\;(\land\text{I}) \quad r}{(p \land q) \land r}\;(\land\text{I})

shows how to prove (pq)r(p \land q) \land r: first combine pp and qq by \landI to obtain pqp \land q, then combine that result with rr by a second application of \landI.

Example 67 (A Natural Deduction Proof Tree)

We derive prp \land r from the premises pp, pqp \to q, and qrq \to r.

pp(pq)q  (E)(qr)r  (E)pr  (I)\frac{p \quad \dfrac{\dfrac{p \quad (p \to q)}{q}\;(\to\text{E}) \quad (q \to r)}{r}\;(\to\text{E})}{p \land r}\;(\land\text{I})

Reading from the leaves: pp and pqp \to q yield qq by \toE (Modus Ponens); then qq and qrq \to r yield rr by a second \toE; finally, pp and rr are combined by \landI.

Problem 81

Write a proof tree whose conclusion is (pq)(rs)(p \land q) \land (r \land s). Then express “2 is an even prime and 3 is an odd prime” in the form (pq)(rs)(p \land q) \land (r \land s) for appropriate propositions p,q,r,sp, q, r, s, and describe what your proof tree says about proving the statement.