Beta. Content is under active construction and has not been peer-reviewed. Report errors on GitHub.Disclaimer

Foundations

Basic Logic and Proof Techniques

The fundamental proof strategies used throughout mathematics: direct proof, contradiction, contrapositive, induction, construction, and cases. Required vocabulary for reading any theorem.

CoreTier 2Stable~40 min

Why This Matters

Every theorem in this entire site is proved using one or more of these techniques. If you cannot recognize whether a proof proceeds by contradiction or contrapositive, you will struggle to read learning theory papers. Choosing the right proof technique often turns an intractable argument into a short one.

Logical Foundations

Definition

Implication

A statement PQP \Rightarrow Q ("if PP, then QQ") is false only when PP is true and QQ is false. If PP is false, the implication is vacuously true regardless of QQ.

Definition

Contrapositive

The contrapositive of PQP \Rightarrow Q is ¬Q¬P\neg Q \Rightarrow \neg P. These are logically equivalent. The converse QPQ \Rightarrow P is not equivalent to the original.

Quantifiers

Definition

Universal and Existential Quantifiers

xS,P(x)\forall x \in S, P(x) means P(x)P(x) holds for every element of SS.

xS,P(x)\exists x \in S, P(x) means there is at least one element of SS for which P(x)P(x) holds.

Negation swaps quantifiers: ¬(x,P(x))x,¬P(x))\neg(\forall x, P(x)) \equiv \exists x, \neg P(x)) and ¬(x,P(x))x,¬P(x)\neg(\exists x, P(x)) \equiv \forall x, \neg P(x).

The negation rule is critical for proofs by contradiction. To disprove "for all xx, P(x)P(x)," you need only find one counterexample.

Proof Techniques

Direct Proof

Assume PP is true. Through a chain of logical deductions, conclude QQ. This is the simplest proof structure.

Example

The sum of two even integers is even

Let a=2ma = 2m and b=2nb = 2n for integers m,nm, n. Then a+b=2(m+n)a + b = 2(m + n), which is even. Done.

Proof by Contradiction

To prove PP, assume ¬P\neg P and derive a logical contradiction. Since the assumption led to a contradiction, ¬P\neg P must be false, so PP is true.

Example

The square root of 2 is irrational

Assume 2=a/b\sqrt{2} = a/b with a,ba, b integers and gcd(a,b)=1\gcd(a, b) = 1. Then 2b2=a22b^2 = a^2, so a2a^2 is even, so aa is even. Write a=2ka = 2k. Then 2b2=4k22b^2 = 4k^2, so b2=2k2b^2 = 2k^2, so bb is even. But then gcd(a,b)2\gcd(a, b) \geq 2, contradicting gcd(a,b)=1\gcd(a, b) = 1.

Proof by Contrapositive

To prove PQP \Rightarrow Q, instead prove ¬Q¬P\neg Q \Rightarrow \neg P. These are logically equivalent. Often easier when the negation of QQ gives a concrete condition to work with.

Example

If n squared is even, then n is even

Contrapositive: if nn is odd, then n2n^2 is odd. Proof: n=2k+1n = 2k + 1 implies n2=4k2+4k+1=2(2k2+2k)+1n^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1, which is odd.

Proof by Induction

Definition

Weak Induction

To prove P(n)P(n) for all nn0n \geq n_0: (1) Base case: prove P(n0)P(n_0). (2) Inductive step: prove that P(k)P(k+1)P(k) \Rightarrow P(k+1) for all kn0k \geq n_0.

Definition

Strong Induction

To prove P(n)P(n) for all nn0n \geq n_0: (1) Base case: prove P(n0)P(n_0). (2) Inductive step: prove that P(n0)P(n0+1)P(k)P(k+1)P(n_0) \wedge P(n_0+1) \wedge \cdots \wedge P(k) \Rightarrow P(k+1). The inductive hypothesis assumes all previous cases, not just one.

Weak and strong induction are logically equivalent, but strong induction is sometimes more natural (e.g., proving properties of recursive algorithms where the recursion references multiple smaller inputs).

Proof by Construction

To prove that an object with certain properties exists, explicitly build it. Constructive proofs are stronger than existence proofs by contradiction because they produce the witness.

Proof by Cases

Split the domain into exhaustive, mutually exclusive cases and prove the claim separately in each case. Useful when a single argument does not cover all possibilities.

Main Theorems

Theorem

Principle of Mathematical Induction

Statement

Let P(n)P(n) be a predicate on the natural numbers. If P(n0)P(n_0) is true and P(k)P(k+1)P(k) \Rightarrow P(k+1) for all kn0k \geq n_0, then P(n)P(n) is true for all nn0n \geq n_0.

Intuition

Induction is the domino effect. The base case knocks over the first domino. The inductive step ensures each domino knocks over the next. Together, they guarantee all dominoes fall.

Proof Sketch

This follows from the well-ordering principle: every nonempty subset of N\mathbb{N} has a least element. Suppose P(n)P(n) fails for some nn. Let S={nn0:¬P(n)}S = \{n \geq n_0 : \neg P(n)\}. By well-ordering, SS has a least element m>n0m > n_0 (since P(n0)P(n_0) holds). Then P(m1)P(m-1) holds but P(m)P(m) does not, contradicting the inductive step.

Why It Matters

Induction is the standard technique for proving statements about sequences, sums, algorithm correctness, and recursive structures. In learning theory, induction arguments appear in proving properties of iterative algorithms (e.g., convergence of gradient descent after TT steps).

Failure Mode

Forgetting the base case is the classic failure. The inductive step "P(k)P(k+1)P(k) \Rightarrow P(k+1)" can be vacuously true if PP is never true for any starting value. Both the base case and inductive step are required.

Common Confusions

Watch Out

Contradiction vs. contrapositive

To prove PQP \Rightarrow Q by contradiction, you assume P¬QP \wedge \neg Q and derive any contradiction. To prove it by contrapositive, you assume ¬Q\neg Q and derive ¬P\neg P directly. Contrapositive is a direct proof of an equivalent statement. Contradiction is more general (you can derive any contradiction, not just ¬P\neg P), but contrapositive is cleaner when it works.

Watch Out

Converse is not the same as contrapositive

The converse of PQP \Rightarrow Q is QPQ \Rightarrow P. This is a completely different statement that may be true or false independently. The contrapositive ¬Q¬P\neg Q \Rightarrow \neg P is logically equivalent to the original. Confusing these leads to invalid proofs.

Watch Out

Induction does not work on the reals

Mathematical induction works on N\mathbb{N} (or any well-ordered set). You cannot use it to prove a statement for all real numbers. For the reals, you need different techniques (e.g., the least upper bound property, or transfinite induction with the axiom of choice).

Exercises

ExerciseCore

Problem

Prove by induction: for all n1n \geq 1, i=1ni=n(n+1)/2\sum_{i=1}^n i = n(n+1)/2.

ExerciseCore

Problem

Write the negation of: "For every ϵ>0\epsilon > 0, there exists δ>0\delta > 0 such that xa<δ|x - a| < \delta implies f(x)f(a)<ϵ|f(x) - f(a)| < \epsilon." (This is the definition of continuity.)

References

Canonical:

  • Velleman, How to Prove It, 3rd ed., Chapters 1-6
  • Hammack, Book of Proof, 3rd ed., Chapters 1-10

Current:

  • Bloch, Proofs and Fundamentals (2011), Chapters 1-3

  • Enderton, Elements of Set Theory (1977), Chapters 1-6

  • Halmos, Naive Set Theory (1960), Chapters 1-25

  • Munkres, Topology (2000), Chapter 1 (set theory review)

Next Topics

Last reviewed: April 2026

Builds on This

Next Topics