Direct Proof and Counterexample
What You’ll Learn
Section titled “What You’ll Learn”In this lesson you’ll learn what a mathematical proof actually is, how to write a direct proof of an if-then statement, the standard definitions for even, odd, and divisible that make these proofs possible, and how to disprove a universal claim with one counterexample.
The Concept
Section titled “The Concept”A proof is a convincing argument that a statement is true for every case it claims to cover, built from definitions, previously established results, and valid logic.
The word “every” is what makes this hard, and it’s also why examples aren’t proofs. Checking a claim for shows it works 100 times. It says nothing about .
What you’re allowed to use
Section titled “What you’re allowed to use”A proof can use:
- Definitions. These are the workhorses. Most beginner proofs are just “unfold the definitions and do algebra.”
- Axioms. Basic assumed truths, like the fact that the sum of two integers is an integer.
- Previously proven theorems.
- Valid logical steps.
A proof cannot use: examples, pictures alone, “it’s obvious,” or “everyone knows.”
The definitions you need
Section titled “The definitions you need”Almost every proof in this lesson runs on these. Learn them as equations, not as English.
An integer is even if there exists an integer with
An integer is odd if there exists an integer with
An integer divides , written , if there exists an integer with
Read as ” divides ,” meaning is a multiple of with no remainder. The slashed version means ” does not divide ,” the same way negates . So is true, and is true because 7 leaves a remainder. Careful not to confuse (a statement, either true or false) with the fraction (a number).
An integer is prime if its only positive divisors are 1 and .
Two integers are consecutive if they differ by 1, so they look like and .
The move that makes proofs work: when you’re told something is even, immediately write . Now you have algebra to do instead of a vague property to reason about.
Direct proof
Section titled “Direct proof”Most theorems have the form . A direct proof does this:
- Assume is true.
- Translate into equations using definitions.
- Work forward with algebra and logic.
- Arrive at , translated back into words.
The structure on the page:
Claim. If , then .
Proof. Assume . [definitions, algebra, reasoning] Therefore . ∎
The ∎ (or QED) marks the end. You’ll also see an open box, □.
The universal quantifier is implied
Section titled “The universal quantifier is implied”“If is even, then is even” really means
That’s why you must work with a general and never with a specific one. Starting a proof with “let ” is fatal, no matter how the algebra goes afterward.
Disproof by counterexample
Section titled “Disproof by counterexample”To disprove a universal claim, produce one case where it fails. That’s the negation rule from the quantifiers lesson:
One counterexample is a complete disproof. You don’t need to explain why the claim is wrong in general, or find a second counterexample, or feel bad about how easy it was.
Be careful about what you’re negating. To disprove “if then ” you need a case where holds and fails. A case where fails tells you nothing, because the implication is vacuously true there.
Common mistakes
Section titled “Common mistakes”- Assuming the conclusion - starting from what you want to prove and working backward to something true proves nothing on its own. Write it in the valid direction.
- Using specific numbers - “let’s try : , which is even, so it’s proved.” No. That’s one case.
- Reusing a variable name - if and are both even, write and . Using for both silently assumes they’re equal, which quietly proves a much weaker claim.
- Circular reasoning - using the theorem, or something equivalent to it, as a step in its own proof.
Worked Examples
Section titled “Worked Examples”Example 1: The sum of two even integers is even.
Proof. Let and be even integers. By definition there exist integers and with and .
Then
Since and are integers, is an integer. So equals 2 times an integer, which is the definition of even.
Therefore the sum of two even integers is even. ∎
Notice the shape. Unfold definitions, factor out the 2, point at the definition again. That last step, explicitly noting that is an integer, is what makes it rigorous rather than hand-wavy.
Example 2: If is odd, then is odd.
Proof. Let be an odd integer, so for some integer .
Let , which is an integer since is. Then , which is odd by definition.
Therefore if is odd, is odd. ∎
The trick every time: manipulate the expression into the exact form the definition demands, here .
Example 3: The product of two consecutive integers is even.
Proof. Let the integers be and . Consider two cases.
Case 1: is even. Then , so
which is even.
Case 2: is odd. Then is even, so
which is even.
Every integer is even or odd, so the cases are exhaustive. Therefore is always even. ∎
This is proof by cases. It’s completely legitimate as long as your cases cover every possibility.
Example 4: Divisibility is transitive.
Claim. If and , then .
Proof. Assume and . By definition there are integers and with
Substitute the first into the second:
Since is an integer, by definition. ∎
Short, clean, and it works for every integer at once. Notice again the two distinct variable names.
Example 5: Disprove a claim.
Claim. For every positive integer , the value is prime.
Disproof. Try small values: gives 43 (prime), gives 47 (prime), gives 53 (prime). It keeps working for a while, which is exactly what makes this claim famous.
But take :
Since , it is not prime. The claim is false. ∎
This one holds for through and then breaks. Forty consecutive successes and the claim is still false. That’s the whole argument for why proofs exist.
Example 6: Disprove a converse.
Claim. If is divisible by 4, then is divisible by 4.
Disproof. Take . Then , and , so is divisible by 4. But is not divisible by 4.
The hypothesis holds and the conclusion fails, so the implication is false. ∎
Real-World Applications
Section titled “Real-World Applications”Proof is the difference between “my tests pass” and “this cannot fail.” Aerospace software, cryptographic protocols, and medical device firmware get formally verified precisely because testing can only ever check finitely many cases, and might be the one you skipped.
Counterexamples are how security research works. Nobody proves an encryption scheme is unbreakable by trying it a lot. They look for a single input that breaks the guarantee, and one is enough to retire the algorithm.
In everyday engineering, this shows up as edge cases. “Every user has a last name” is a universal claim, and one user in Indonesia with a single mononym is a counterexample that breaks your form validation. Learning to hunt for counterexamples makes you noticeably better at spotting bad assumptions in a spec before they become bugs.
The style of thinking transfers beyond math too. When someone makes a sweeping claim, the productive response is usually not a counter-sweep. It’s one well-chosen example.
Retrying will remove your ✅ checkmark until you pass again.