This matches the formula for n=k+1, so by induction the formula holds for all n ≥ 1. ■
Proof by Cases
Claim: For any integer n, n(n+1) is even.
Case 1: n is even. Then n = 2k for some integer k, so n(n+1) = 2k(n+1) = 2·[k(n+1)], which is even.
Case 2: n is odd. Then n+1 is even, so n+1 = 2k for some integer k, so n(n+1) = n·2k = 2·(nk), which is even.
Every integer is either even or odd, and both cases give an even result.
Therefore n(n+1) is even for every integer n. ■
Strong Induction
Claim: Every integer n ≥ 2 can be written as a product of one or more primes.
Base case: n=2. 2 is itself prime, so it trivially is 'a product of one prime'.
Strong inductive hypothesis: assume every integer k with 2 ≤ k < n can be written as a product of primes.
Inductive step: consider n. If n is prime, we're done. Otherwise n = a·b with 2 ≤ a,b < n. By the strong hypothesis, both a and b can be written as products of primes, so n = a·b can too.
By strong induction, every integer n ≥ 2 is a product of primes. ■
Structural Induction
Claim: For every full binary tree T (every node has 0 or 2 children), the number of leaves L(T) = the number of internal nodes I(T) + 1.
Base case: T is a single leaf node. Then L(T)=1, I(T)=0, and indeed 1 = 0+1.
Inductive hypothesis: assume the claim L=I+1 holds for the (structurally smaller) left subtree T1 and right subtree T2.
Inductive step: if T has a root with subtrees T1 and T2, then L(T) = L(T1)+L(T2), and I(T) = 1 + I(T1) + I(T2). By the hypothesis, L(T1)=I(T1)+1 and L(T2)=I(T2)+1, so L(T) = I(T1)+I(T2)+2 = (I(T)-1)+2 = I(T)+1.
By structural induction, the claim holds for every full binary tree. ■
Disproof by Counterexample
Claim: Claim to disprove: For all integers n, n² + n + 1 is prime.
To disprove a 'for all' statement, it suffices to find a single value of n where it fails.
Try n = 4: n²+n+1 = 16+4+1 = 21.
21 = 3 × 7, which is not prime.
Since the statement fails for n=4, it is false in general — this single counterexample disproves it. ■
Check Your Own Proof
What is Proof Techniques?
A mathematical proof is a logically airtight argument that a statement is always true. The standard techniques — direct proof, contrapositive, contradiction, and induction — each have specific situations where they work best.
How Does This Calculator Work?
This module is a reference and practice tool: browse the four core proof techniques with fully worked examples, or paste your own proof attempt to check its structure against the pattern for each technique.
Common Formulas & Rules
Direct proof: assume the hypothesis, apply definitions and known results, arrive at the conclusion.
Proof by contrapositive: to prove P → Q, instead prove ¬Q → ¬P (logically equivalent, sometimes far easier).
Proof by contradiction: assume the statement is false, derive a logical impossibility, conclude the original statement must be true.
Mathematical induction: prove a base case, then prove that if the statement holds for n, it holds for n+1 — this establishes it for all n.
Counterexample: a single case where a claimed universal statement fails, sufficient to disprove ∀x, P(x).
Worked Example
To prove "if n² is even, then n is even" by contrapositive: assume n is odd, so n = 2k+1 for some integer k. Then n² = 4k² + 4k + 1 = 2(2k²+2k) + 1, which is odd. We've shown ¬(n even) → ¬(n² even), which is logically equivalent to the original statement — and often much easier to work with directly.
Study guide: Proofs
Written for students learning this topic for the first time. Last updated October 2026.
Overview
A proof is a logical argument that a statement is true in every case. Checking examples can never prove a universal claim, but a single counterexample can disprove one. Learning to prove is largely learning to choose a technique and then justify each step.
Key ideas explained
Direct proof
Assume the hypothesis and deduce the conclusion from definitions and known facts. A typical opening is “Let n be even, so n = 2k for some integer k.”
Contrapositive
To prove P → Q, prove the equivalent statement ¬Q → ¬P. It works well when the negated conclusion gives you something concrete to compute with.
Contradiction
Assume the statement is false and derive something impossible. Classic examples are the irrationality of √2 and the infinitude of primes.
Induction
Prove a base case, assume the claim for k (the inductive hypothesis), and prove it for k + 1. Strong induction assumes all earlier cases. Induction works because every natural number is reached by repeatedly adding one, like toppling dominoes.
Worked examples
Induction: the sum of the first n integers
Problem. Prove 1 + 2 + … + n = n(n + 1)/2 for all n ≥ 1.
Base case n = 1: the left side is 1 and the right side is 1·2/2 = 1.
Answer. The formula holds for n = k + 1 whenever it holds for k, so it holds for all n ≥ 1.
Contrapositive: squares and parity
Problem. Prove that if n² is even then n is even.
The contrapositive is: if n is odd then n² is odd.
Let n = 2k + 1. Then n² = 4k² + 4k + 1 = 2(2k² + 2k) + 1, which is odd.
Answer. The contrapositive is proved, so the original statement is true.
Enter these same values in the calculator above and compare each step with the working shown here.
Common mistakes to avoid
Proof by example. n² + n + 41 is prime for n = 0,…,39, yet for n = 40 it equals 41².
Circular reasoning, such as assuming the statement for n + 1 inside an induction step.
Forgetting the base case, or checking one that does not match the claim.
Never using the inductive hypothesis, which usually means the argument is not really induction.
Confusing the converse with the contrapositive.
Where this shows up in computer science
Loop invariants and the correctness of recursive functions are inductive arguments.
Proofs of runtime and optimality, such as greedy exchange arguments, support algorithm design.
Security reductions prove that breaking a system would solve a problem believed to be hard.
Test yourself
Try each question before opening the answer.
Prove or disprove: for every integer n, n² + n is even.
True. n² + n = n(n + 1) is a product of consecutive integers, and one of them is even.
What are the three parts of an induction proof?
The base case, the inductive hypothesis, and the inductive step.
Give a counterexample to “every prime is odd”.
n = 2.
Frequently asked questions
When should I use proof by contrapositive instead of direct proof?
Use contrapositive when the direct implication is awkward to work with but its logical opposite (¬Q → ¬P) simplifies nicely — common when the hypothesis involves a property that's hard to use directly, like evenness derived from a squared term.
What's the difference between proof by contradiction and contrapositive?
Contrapositive proves P → Q by proving ¬Q → ¬P directly. Contradiction assumes the entire statement (including P) is false and derives an impossibility, which is a more general technique that works even for statements without a clean if-then structure.
Why does mathematical induction work?
Induction proves a base case holds, then proves that truth at step n guarantees truth at step n+1. Since the base case is true, step 2 follows, which makes step 3 true, and so on for every natural number — like an infinite row of dominoes.
We use cookies for essential site functionality and, where enabled, for ads (Google AdSense) and analytics
(Google Analytics). See our Privacy Policy for details.