This deck shows how to start, run, and close a proof by contradiction: recognizing when it fits, negating a claim correctly - including flipping the quantifiers - and reasoning through to a genuine impossibility. It works the irrationality of the square root of 2, the infinitude of the primes, and a sketch of a greedy exchange argument. It targets four real misconceptions: negating "for all" incorrectly, confusing contradiction with contrapositive, declaring victory without a real impossibility, and assuming the claim instead of its negation.
Subject: CS3000 Algorithms · 128 slides · symbolic lesson
Open the interactive version of this deck · Homework for this lesson
Objectives
Proof by contradiction is the tool CS3000 reaches for whenever a claim says something cannot happen. This lesson is built around the hardest part: getting started. By the end you can:
Warm-up
Discussion prompt
Before we open Proof by Contradiction: without looking back, what was the main idea of Proof by Induction, and what could you do by the end of it that you could not do before?
Hint: One sentence for the idea, one for the skill. If the second one is blank, that is the part to revisit.
Answer:
A from-scratch guide to STARTING an induction proof, not just following one: recognizing when a claim needs induction, writing the base case, the inductive hypothesis, and the inductive step, and choosing weak versus strong induction. Worked proofs cover a summation identity, an inequality, a divisibility claim, a strong-induction postage argument, and two recursive-structure proofs (a recursive sum function and binary-tree leaf counts) connecting induction to recursive algorithms.
Concept
Before any new material: cover the screen.
You have named 6 reusable moves so far. Say as many as you can out loud, by number, from memory.
Do not advance until you have actually tried. Getting four of eight is information; skipping the exercise is not.
Here they are. Score yourself.
Today adds 2 moves to this list. Everything else you will need is already above.
The question that starts every proof from here on is not how do I begin. It is which of these applies here?
Counterexample
Discussion prompt
You have named 6 reusable moves so far. Say as many as you can out loud, by number, from memory.
That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.
Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.
Answer:
Do not advance until you have actually tried. Getting four of eight is information; skipping the exercise is not.
Picture it
Animation
Shows: The minimal counterexample trick — a rendered Manim animation.
Rendered with Manim.
Takeaway: Well-ordering guarantees a smallest failure exists, which is what you attack.
Section
Section 1
Concept
To prove a claim by contradiction, you assume the claim is false, reason correctly from that assumption, and arrive at something that is flatly impossible. Since your reasoning was valid, the only thing that could have been wrong is the assumption - so the claim must actually be true.
\[ \text{Assume } \lnot S \ \text{is true} \ \longrightarrow \ \text{valid reasoning} \ \longrightarrow \ \text{impossible fact} \ \Rightarrow \ S \text{ is true} \]
proof by contradiction — A proof that establishes a claim S by assuming its negation, deriving a statement that cannot possibly be true, and concluding that the negation must have been false - so S holds.
Concept
In CS3000 you will sometimes hear this called an indirect proof, in contrast to a direct proof. A direct proof starts from what is given and pushes forward to the conclusion. An indirect proof starts from the conclusion's denial and pushes forward to a disaster.
Same destination, opposite starting point. Both are completely legitimate; you choose whichever gives you something concrete to grab onto.
Analogy
Discussion prompt
Explain Another name: an indirect proof by analogy to something with no CS3000 Algorithms in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.
Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.
Answer:
Same destination, opposite starting point. Both are completely legitimate; you choose whichever gives you something concrete to grab onto.
Intuition
Picture setting a trap. You do not fight the assumption head on - you let it in the door, treat it as true, and follow where it leads. If it is false, following it honestly will eventually walk it into a wall.
The moment you hit that wall - two facts that cannot coexist - the trap springs. The assumption is what breaks, not your reasoning. That is why every step before the wall must be airtight: a shaky step gives the assumption an escape route.
Picture it
Animation
Shows: Why lowest terms is the load-bearing assumption — a rendered Manim animation.
Rendered with Manim.
Takeaway: Without lowest terms there is nothing to contradict.
Concept
Every contradiction proof has exactly three moving parts, and naming them out loud is what turns a vague plan into an actual proof you can write.
The assumption
Why: The exact, correctly-formed negation of the claim. This is your only starting fact - everything else must follow from it.
The derivation
Why: A chain of ordinary, fully justified steps - the same kind you would use in any other proof - that follows from the assumption.
The impossibility
Why: A concrete fact that cannot be true: two contradictory statements, a violated definition, or an equation like 0 equals 1.
Explain it
Discussion prompt
Explain Meet the three ingredients to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.
Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.
Answer:
Every contradiction proof has exactly three moving parts, and naming them out loud is what turns a vague plan into an actual proof you can write.
Intuition
A detective wants to show a suspect is innocent. She temporarily assumes the suspect is guilty, then traces out what must be true if that were so - the suspect would have to be in two cities at once.
Being in two places at once is impossible, so the guilty assumption collapses, and the suspect is innocent. Notice she never argued directly for innocence - she let the opposite assumption defeat itself.
Concept
Contradiction earns its keep on claims where a direct proof has nothing to build forward from - especially claims about things that supposedly do not exist or cannot happen.
Watch for phrases like: there is no largest such-and-such, this number cannot be written as a fraction, no algorithm can do better than this, this list has no smallest element, the set of primes is not finite.
Picture it
Animation
Shows: Where contradiction shows up in algorithms — a rendered Manim animation.
Rendered with Manim.
Takeaway: Most greedy correctness proofs are contradictions wearing a different name.
Intuition
If a claim already hands you an equation or an object to manipulate, try direct first. If the claim is really a denial - 'there is no X', 'you cannot do Y', 'Z is not possible' - a direct proof has nothing to grab, because there is no X to work with.
Contradiction flips that weakness into a strength: you manufacture the very thing the claim denies by assuming it exists, and then use it as your object to work with.
Intuition
A direct proof is constructive - it builds the conclusion piece by piece from the hypothesis. A contradiction proof is destructive - it builds a scenario and then demolishes it.
Both are equally rigorous. The choice is about convenience, not correctness: pick whichever starting point gives you real material to reason with.
Picture it
Animation
Shows: Try direct first — a rendered Manim animation.
Rendered with Manim.
Takeaway: Contradiction is powerful and often longer than it needs to be.
Concept
Every proof of this kind has the same five or six moves in the same order. The order is not something you rediscover each time.
It is on the right. It will stay on the right through the worked examples that follow.
Why this matters: the structure is now handled. You are not spending working memory on what comes next — you are spending all of it on the one hard step.
Step 2 is where most wrong proofs are born, and step 5 is where you have to build something — the collision does not appear on its own. You go looking for it.
Picture it
Animation
Shows: The shape of a contradiction proof — a rendered Manim animation.
Rendered with Manim.
Takeaway: The impossibility is the whole proof; everything else is setup.
Intuition
What move should we make next?
The claim is that there is no largest even number. We negated it and assumed the negation:
\[ \text{assume: there is a largest even number, call it } N \]
Nothing is contradictory yet. That statement sits there looking perfectly reasonable.
You are not going to find a contradiction by staring. You have to make one. What do you build out of N?
_Look at your toolkit. Say a move number out loud before this slide advances._ A wrong guess is useful. A silent guess is not.
Ranking
Put in order
Put the moves of Warm-up: there is no largest even number into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Nothing to build forward from directly - there is no largest number handed to us.
Worked example
Claim: no even number is bigger than every other even number.
\[ \text{Claim: there is no largest even number.} \]
Recognize the shape: this is a 'there is no' claim
Why: Nothing to build forward from directly - there is no largest number handed to us. That is the signal to try contradiction.
Write the exact negation and assume it
Why: The negation of 'no even number is largest' is 'there exists an even number that IS the largest'. Assume that number exists and name it E.
\[ \text{Assume } \exists\, E: \ E \text{ is even, and every even number} \leq E \]
Manufacture a bigger even number from E
Why: E is even, so E plus 2 is also even (an even number plus 2 stays even). And E plus 2 is strictly bigger than E.
\[ E + 2 \text{ is even}, \quad E + 2 > E \]
Verify the contradiction
Why: We assumed every even number is at most E, yet E plus 2 is an even number bigger than E. Both cannot be true, so the assumption breaks. There is no largest even number.
\[ E+2 \text{ even and } E+2 > E \ \Rightarrow\ \text{contradicts 'every even} \leq E\text{'}\ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Warm-up: there is no largest even number", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: We assumed every even number is at most E, yet E plus 2 is an even number bigger than E. Both cannot be true, so the assumption breaks. There is no largest even number.
Explain it to yourself
Discussion prompt
In The move we just made, named this move is made:
Build the object the assumption forbids
Why is that legal? Name the rule or definition it rests on before you read on.
Hint: If you can only say "because that is what you do", the rule is the thing to go and find.
Answer:
N is even and largest. Then N+2 is even and bigger. You did not find that — you constructed it, the same way you constructed the n that broke a big-O bound.
Concept
The move: #7 (Negate and assume), then #2 (The +1 trick).
Negate and assume: give the forbidden object a name
Why: The claim says no such thing exists. So assume one does and name it N. Naming it is what makes it something you can do arithmetic to.
Build the object the assumption forbids
Why: N is even and largest. Then N+2 is even and bigger. You did not find that — you constructed it, the same way you constructed the n that broke a big-O bound.
\[ N + 2 > N \quad \text{and} \quad N + 2 \text{ is even} \]
That is the whole trick, and it is #2 (The +1 trick) wearing a different hat. When a claim says for all or there is no, you win by building the one thing it says cannot exist.
Notation
Annotate
From The move we just made, named — read this one piece at a time. What is each part doing?
On: \( N + 2 > N \quad \text{and} \quad N + 2 \text{ is even} \)
Anomaly
Predict first
A student writes this, and it looks reasonable:
A student wants to prove there is no largest even number, so she starts by assuming exactly that - 'there is no largest even number' - and tries to reason forward from it.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: This gives nothing to work with.
Assume the OPPOSITE of what you want to prove - the negation - because the negation hands you a concrete object to work with.
Why: This gives nothing to work with. 'No such number exists' names no object you can do algebra on - there is no E to add 2 to. The proof stalls before it starts.
Trap
A student wants to prove there is no largest even number, so she starts by assuming exactly that - 'there is no largest even number' - and tries to reason forward from it.
\[ \text{Wanted: no largest even number} \]
Assume the claim itself is true
Why: This gives nothing to work with. 'No such number exists' names no object you can do algebra on - there is no E to add 2 to. The proof stalls before it starts.
\[ \text{Assumed: } \lnot(\exists E: E \text{ largest even})\ \text{--- same as the goal, no object to use} \]
Assume the OPPOSITE of what you want to prove - the negation - because the negation hands you a concrete object to work with.
\[ \text{Wanted: no largest even number} \]
Assume the negation: a largest even number DOES exist
Why: Now you have a specific object, E, with a specific property (every even number is at most E). That is something you can actually manipulate.
\[ \text{Assume } \exists\, E:\ E \text{ is the largest even number} \]
Only now can the proof move
Why: With E in hand, building E plus 2 and comparing it to E is a real algebraic step. The rule: always assume the negation of the goal, never the goal itself.
Step zero
Discussion prompt
There is no smallest positive real number — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Negate correctly and assume it
Answer:
Worked example
Claim: among all positive real numbers, none of them is the smallest.
\[ \text{Claim: there is no smallest positive real number.} \]
Negate correctly and assume it
Why: The negation of 'no positive real is smallest' is 'some positive real number IS the smallest'. Assume it exists and name it s.
\[ \text{Assume } \exists\, s > 0:\ \text{every real } x > 0 \text{ satisfies } x \geq s \]
Build a smaller positive number from s
Why: Since s is positive, half of s is also positive, and cutting a positive number in half makes it strictly smaller.
\[ \frac{s}{2} > 0, \qquad \frac{s}{2} < s \]
Verify the contradiction
Why: We assumed every positive real is at least s, but s over 2 is a positive real number that is strictly smaller than s. Both statements cannot hold, so the assumption fails. No smallest positive real number exists.
\[ \tfrac{s}{2} > 0 \ \text{and}\ \tfrac{s}{2} < s \ \Rightarrow\ \text{contradicts 'every positive real} \geq s\text{'}\ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "There is no smallest positive real number", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: We assumed every positive real is at least s, but s over 2 is a positive real number that is strictly smaller than s. Both statements cannot hold, so the assumption fails. No smallest positive real number exists.
Section
Section 2
Concept
Negating a plain statement, with no quantifier attached, is the easy case: flip it to its opposite. 'The light is on' negates to 'the light is off'; 'n is even' negates to 'n is odd'.
negation — The statement that is true exactly when the original is false, and false exactly when the original is true. A statement and its negation can never both be true, and can never both be false.
Picture it
Animation
Shows: Negate the statement correctly — a rendered Manim animation.
Rendered with Manim.
Takeaway: Half of failed contradiction proofs start with a bad negation.
Intuition
A negation behaves like a light switch: exactly one position is on at a time. If you flip a statement's truth value and get something that could still be true alongside the original, you have not actually written its negation - you have written something weaker or unrelated.
Concept
This is the rule students get wrong most often, so read it slowly. A universal claim - 'for all x, property P holds' - is negated by switching the quantifier to 'there exists' AND negating the inside property.
\[ \lnot\big(\forall x,\ P(x)\big) \ \equiv\ \exists x,\ \lnot P(x) \]
In plain English: the opposite of 'every single one has property P' is 'at least one of them does NOT have property P'. It only takes one exception to break a 'for all' claim.
Intuition
To disprove 'every apple in the basket is good', you do not need every apple to be bad - you only need to hold up one bad apple. That single witness is the whole negation.
This is exactly why the correct negation uses 'there exists' rather than another 'for all': denying a universal claim is a much weaker, much easier-to-satisfy statement than the original.
Concept
The mirror-image rule: an existence claim - 'there exists an x with property P' - is negated by switching the quantifier to 'for all' AND negating the inside property.
\[ \lnot\big(\exists x,\ P(x)\big) \ \equiv\ \forall x,\ \lnot P(x) \]
In plain English: the opposite of 'at least one of them has property P' is 'none of them do' - equivalently, 'every single one lacks P'.
Intuition
To deny 'there is a coin in this jar', you must show that every single item in the jar is not a coin. Finding zero coins after checking everything is the same thing as 'for all items, it is not a coin'.
Both quantifier-flip rules follow the same shape: flip the quantifier, negate what is inside it. Memorize the shape, not two separate rules.
Step zero
Discussion prompt
Negation practice: is every score on the board passing — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Identify the quantifier and the inner property
Answer:
Worked example
Consider a claim about a scoreboard: every recorded score is a passing score.
\[ \text{Claim: } \forall\, x \in \text{scores},\ x \text{ is passing} \]
Identify the quantifier and the inner property
Why: The quantifier out front is 'for all', and the inner property is 'x is passing'. To negate it, both parts must change.
Flip 'for all' to 'there exists'
Why: By the quantifier-negation rule, denying a universal claim means asserting existence of a counterexample, not asserting the universal opposite.
\[ \lnot\big(\forall x,\ P(x)\big) \equiv \exists x,\ \lnot P(x) \]
Negate the inner property and assemble
Why: The inner property 'x is passing' negates to 'x is not passing'. Combine with the flipped quantifier to get the finished negation.
\[ \text{Negation: } \exists\, x \in \text{scores},\ x \text{ is NOT passing} \]
Verify the negation is exhaustive and exclusive
Why: The original is true exactly when every score passes; the negation is true exactly when at least one score fails. Every possible scoreboard satisfies exactly one of the two - so this is a genuine negation, and either one would be the correct assumption to open a contradiction proof about scores.
\[ \text{Either every score passes, or some score fails --- never both, never neither}\ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Negation practice: is every score on the board passing", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The original is true exactly when every score passes; the negation is true exactly when at least one score fails. Every possible scoreboard satisfies exactly one of the two - so this is a genuine negation, and either one would be the correct assumption to open a contradiction proof about scores.
Anomaly
Predict first
A student writes this, and it looks reasonable:
To prove by contradiction that every integer in a set S is even, a student assumes the negation is 'every integer in S is odd'.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: This keeps the quantifier as 'for all' and just negates the inside - but the correct move is to CHANGE the quantifier to 'there exists', not keep it.
Negating a quantifier flips it: 'for all' becomes 'there exists', and only then do you negate the inside.
Why: This keeps the quantifier as 'for all' and just negates the inside - but the correct move is to CHANGE the quantifier to 'there exists', not keep it. This assumption is far stronger than the true negation, and it can even be false when the true negation is true.
Trap
To prove by contradiction that every integer in a set S is even, a student assumes the negation is 'every integer in S is odd'.
\[ \text{Claim: } \forall x \in S,\ x \text{ is even} \]
Assume 'all elements are odd'
Why: This keeps the quantifier as 'for all' and just negates the inside - but the correct move is to CHANGE the quantifier to 'there exists', not keep it. This assumption is far stronger than the true negation, and it can even be false when the true negation is true.
\[ \lnot(\forall x,\ P(x)) \ \neq \ \forall x,\ \lnot P(x) \]
Negating a quantifier flips it: 'for all' becomes 'there exists', and only then do you negate the inside.
\[ \lnot(\forall x,\ P(x)) \ \equiv\ \exists x,\ \lnot P(x) \]
Assume 'some element of S is odd'
Why: This single-witness assumption is the true negation. It is weaker and easier to satisfy than 'all are odd', and it is what a real counterexample would look like.
\[ \text{Correct assumption: } \exists\, x \in S,\ x \text{ is odd} \]
Notice the gap the wrong version misses
Why: If S contains one odd number and one even number, the true negation is satisfied (some element is odd), but the wrong assumption 'all are odd' is false. The wrong version would have silently skipped a case that actually breaks the claim.
\[ S = \{2,3\}:\ \text{true negation holds (3 is odd); 'all odd' is false --- a missed case} \]
Translation
\( \text{Correct assumption: } \exists\, x \in S,\ x \text{ is odd} \)
Draw it
Translate both ways. First write the expression above as a sentence with no symbols in it at all. Then cover it, and write your sentence back as notation. If the two versions disagree, the disagreement is the thing to fix.
Concept
Many claims in CS3000 have the shape 'if P then Q'. To assume such a claim is false for a contradiction proof, you do NOT just negate P, and you do NOT just negate Q - you keep P true and add that Q fails.
\[ \lnot(P \Rightarrow Q) \ \equiv\ P \ \text{and}\ \lnot Q \]
In plain English: an implication is broken by exactly one scenario - the hypothesis holding while the conclusion fails. That scenario, held as true, is your contradiction-proof starting assumption.
Socratic
Discussion prompt
In plain English: an implication is broken by exactly one scenario - the hypothesis holding while the conclusion fails. That scenario, held as true, is your contradiction-proof starting assumption.
Suppose that were not true. What is the first thing in Proof by Contradiction that would stop working?
Hint: Follow it one step downstream. The answer is whatever was quietly relying on it.
Picture it
Animation
Shows: Assuming a solver exists, then breaking it — a rendered Manim animation.
Rendered with Manim.
Takeaway: Self-reference is what turns the assumption against itself.
Intuition
'If it rains, I will bring an umbrella' is broken in exactly one way: it rains, and you show up without an umbrella. It is not broken by 'it does not rain' - the promise says nothing about dry days.
So negating 'if P then Q' means holding onto P (it did rain) and denying Q (no umbrella appeared) at the same time. Both pieces are assumed true together - that is the whole starting point of the proof.
Explain it to yourself
Discussion prompt
In Process: trying to prove it directly first this move is made:
The square root wrecks it
Why is that legal? Name the rule or definition it rests on before you read on.
Hint: If you can only say "because that is what you do", the rule is the thing to go and find.
Answer:
You get n equal to the square root of 2m, and there is no clean way to argue from that that n is a whole even number. The algebra will not carry you across.
Intuition
Watch me not know the answer. This is what the first two minutes actually look like.
The claim: if n squared is even, then n is even.
Try it directly: start from n squared being even and push toward n
Why: n squared even means n squared is 2m for some whole number m. Now solve for n.
The square root wrecks it
Why: You get n equal to the square root of 2m, and there is no clean way to argue from that that n is a whole even number. The algebra will not carry you across.
Dead end. Not a mistake — a move that was worth trying and did not pay off. This happens in most proofs.
Back up. Negate the conclusion instead
Why: Assume n is odd and see what n squared has to be. Odd is a shape you can write down cleanly, which is exactly what the square root would not give you.
\[ n = 2j + 1 \;\Longrightarrow\; n^{2} = 4j^{2} + 4j + 1 = 2(2j^{2} + 2j) + 1 \]
So n squared is odd, which collides with the assumption that it is even. The pivot was choosing the side of the statement that has a usable form.
The expert does not see the whole path in advance. The expert tries something, reads the result, and adjusts. That is the skill.
Hypothesis
Predict first
Contradiction proof: if n squared is even, n is even is about to be worked. State your hypothesis first: which rule or definition decides this one, and what is the first move it forces? Then watch whether the example agrees with you.
Correct: Negate the implication correctly
Why: The negation of 'P implies Q' is 'P and not Q', so assume the hypothesis holds AND the conclusion fails, both at once.
A hypothesis you wrote down is falsifiable; a vague sense of how it will go is not. If the example opens somewhere else, that gap is the thing worth chasing.
Worked example
Claim: whenever a whole number's square is even, the number itself is even.
\[ \text{Claim: } n^2 \text{ even} \Rightarrow n \text{ even} \]
Negate the implication correctly
Why: The negation of 'P implies Q' is 'P and not Q', so assume the hypothesis holds AND the conclusion fails, both at once.
\[ \text{Assume: } n^2 \text{ is even, AND } n \text{ is odd} \]
Use the odd half of the assumption
Why: An odd number is two times an integer plus one. Write n in that form using the assumption that n is odd.
\[ n = 2k+1 \quad (k \in \mathbb{Z}) \]
Square it and reorganize
Why: Expanding the square and pulling a factor of 2 out of the first two terms shows the result is odd.
\[ n^2 = 4k^2 + 4k + 1 = 2(2k^2+2k) + 1 \]
Verify the contradiction against the other half of the assumption
Why: We derived that n squared is odd, but the assumption also said n squared is even. A number cannot be both even and odd, so the assumption is impossible. The claim holds.
\[ n^2 = 2(2k^2+2k)+1 \ (\text{odd}) \ \text{but assumed } n^2 \ \text{even} \ \Rightarrow\ \text{contradiction}\ \checkmark \]
Picture it
Animation
Shows: A short one, done properly — a rendered Manim animation.
Rendered with Manim.
Takeaway: The counterexample is constructed FROM the assumption.
Section
Section 3
Concept
Before writing a single symbol, say the claim out loud and identify its exact logical shape. Is it 'for all x, property holds'? Is it 'there is no object with this property'? Is it 'if this, then that'?
You cannot negate a claim you have not pinned down. Most stalled contradiction proofs stall right here, at the naming step, not later at the algebra.
Concept
Apply the rules from Section 2: flip 'for all' to 'there exists' (or the reverse), negate 'if P then Q' to 'P and not Q', and negate a plain statement to its plain opposite.
Write this negation down as its own sentence before doing anything else. This sentence is the entire foundation of the proof - get it wrong and every later step is answering the wrong question.
Concept
Treat the negation as a true fact, the same way you would treat a given hypothesis in a direct proof. Translate it into equations, definitions, or set memberships you can actually manipulate.
Every step from here follows the same rules of valid reasoning as any other proof - nothing about being 'inside a contradiction' relaxes the standards.
Sorting
Sort into buckets
These are the pieces of Proof by Contradiction, out of order. Put each one back under the part of the lesson it belongs to.
Concept
Keep pushing the assumption forward until you can point to two specific facts that directly conflict - a number that is both even and odd, a set that is both empty and has an element, a quantity that is both less than and greater than another.
This is the payoff step. Do not stop at something merely surprising or unlikely - it must be a genuine logical impossibility.
Concept
State explicitly: since the assumption led to an impossibility through valid reasoning, the assumption must be false. Since the assumption was the negation of the claim, the claim itself must be true.
Do not skip this closing sentence. It is the step that turns 'we found something weird' into 'therefore the theorem holds' - a proof is not finished until you say it.
Intuition
A contradiction proof blames the assumption for the impossibility - but that is only fair if every other step in the chain was unquestionably valid. A single sloppy step could be the real source of the nonsense, not the assumption.
That is why contradiction proofs demand the same rigor as any other proof, step for step. The technique buys you a convenient starting point; it does not buy you looser standards along the way.
Concept
A real impossibility is a specific, checkable clash - not a feeling that something is odd. Common forms: a value with two contradictory properties, an equation that reduces to a false numeric statement, a violation of how a definition was set up, or contradicting the very assumption you started with.
contradiction — Two statements that cannot both be true at once - for example, a number that is shown to be both even and odd, or a fraction claimed to be in lowest terms while both its numerator and denominator are shown to share a common factor.
Anomaly
Predict first
A student writes this, and it looks reasonable:
Partway through a proof, a student reaches a step that looks messy or unlikely and writes 'this cannot happen, contradiction, done' without pinning down what actually clashes.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: An expression looking awkward is not the same as it being impossible.
Name the exact two facts in conflict, and show precisely why they cannot coexist.
Why: An expression looking awkward is not the same as it being impossible. This fraction might genuinely be a non-integer sometimes - but that alone does not clash with anything previously assumed unless it is actually checked against a stated requirement.
Trap
Partway through a proof, a student reaches a step that looks messy or unlikely and writes 'this cannot happen, contradiction, done' without pinning down what actually clashes.
\[ \text{Derived so far: } n = \frac{k^2+1}{k} \ \text{for some integer } k \]
Call an unusual-looking expression a contradiction
Why: An expression looking awkward is not the same as it being impossible. This fraction might genuinely be a non-integer sometimes - but that alone does not clash with anything previously assumed unless it is actually checked against a stated requirement.
\[ \text{'This looks weird' is not a proof of impossibility} \]
Name the exact two facts in conflict, and show precisely why they cannot coexist.
\[ \text{Suppose the assumption required } n \ \text{to be an integer} \]
State the specific clash
Why: If the assumption forced n to be an integer, and the derived formula for n only produces a non-integer for this particular k, then say exactly that: 'n was assumed an integer, but the derived value is not an integer for this k' - naming both sides of the clash.
\[ \text{Assumed: } n \in \mathbb{Z}. \quad \text{Derived: } n \notin \mathbb{Z}. \quad \text{Both cannot hold.} \]
Only then close the proof
Why: A genuine impossibility names both conflicting facts explicitly, in terms that trace directly back to a definition or an earlier assumption - never just an intuition that something feels off.
Break the constraint
Discussion prompt
The rule this trap just fixed:
Name the exact two facts in conflict, and show precisely why they cannot coexist.
Now break it on purpose. Build a case that violates it and follow the consequences until something visibly fails. Where does the failure first show up — and would you have noticed it if you had not been looking?
Hint: The dangerous rules are the ones whose violation still produces an answer. If yours fails loudly, try to find one that fails quietly.
Answer:
An expression looking awkward is not the same as it being impossible. This fraction might genuinely be a non-integer sometimes - but that alone does not clash with anything previously assumed unless it is actually checked against a stated requirement.
Section
Section 4
Concept
'The square root of 2 is irrational' really means 'there is no pair of integers whose ratio equals the square root of 2'. That is a denial of existence - exactly the shape contradiction handles best.
\[ \text{Claim: } \nexists\, a,b \in \mathbb{Z}: \ \sqrt{2} = \frac{a}{b} \]
So the setup writes itself: assume the negation - such integers DO exist - and see what breaks.
Intuition
What feels wrong about this?
Assume the square root of 2 is a fraction, written in lowest terms. Push the algebra through and you learn two things:
\[ a \text{ is even} \quad \text{and} \quad b \text{ is even} \]
\[ \text{but } \; \frac{a}{b} \text{ was in lowest terms} \]
_Plain English only. No notation, no algebra. Just say what bothers you._
The feeling: you promised the fraction was already reduced, and then proved both halves share a factor of 2. You cannot have both.
That feeling is the proof. It is not a substitute for the proof — it is the thing the proof writes down.
Notice what supplied the collision: the words in lowest terms. That phrase was not decoration — it was the trap being set on purpose, several steps before it sprang.
Ranking
Put in order
Put the moves of Root 2 is irrational into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Suppose root 2 IS rational. Then it equals some fraction a over b, and we may always reduce a fraction so its numerator and denominator share no common factor.
Worked example
Claim: the square root of 2 cannot be written as a ratio of two integers.
\[ \text{Claim: } \sqrt{2} \text{ is irrational} \]
Assume the negation, in lowest terms
Why: Suppose root 2 IS rational. Then it equals some fraction a over b, and we may always reduce a fraction so its numerator and denominator share no common factor.
\[ \sqrt{2} = \frac{a}{b}, \quad \gcd(a,b) = 1 \]
Square both sides and clear the denominator
Why: Squaring removes the root, and multiplying both sides by b squared clears the fraction, leaving a clean equation in integers.
\[ 2 = \frac{a^2}{b^2} \ \Rightarrow\ a^2 = 2b^2 \]
Conclude a is even
Why: a squared equals 2 times an integer, so a squared is even. An earlier result (proved by contradiction on the previous slide) shows that whenever a number's square is even, the number itself is even. So a is even, and we may write a = 2c.
\[ a^2 = 2b^2 \ \text{(even)} \ \Rightarrow\ a \text{ even} \ \Rightarrow\ a = 2c \]
Substitute back and show b is even too
Why: Replacing a with 2c in a squared equals 2 b squared gives 4c squared equals 2 b squared, so b squared equals 2c squared - meaning b squared is even, so b is even by the same result.
\[ (2c)^2 = 2b^2 \ \Rightarrow\ 4c^2 = 2b^2 \ \Rightarrow\ b^2 = 2c^2 \ \Rightarrow\ b \text{ even} \]
Verify the contradiction
Why: Both a and b turned out even, so 2 divides both of them - but the assumption required a and b to share no common factor. That is a direct clash with the lowest-terms assumption, so no such a and b exist. Root 2 is irrational.
\[ 2 \mid a \ \text{and} \ 2 \mid b \ \Rightarrow\ \gcd(a,b) \geq 2 \ \text{contradicts} \ \gcd(a,b)=1\ \checkmark \]
Picture it
Animation
Shows: The classic: root two is irrational — a rendered Manim animation.
Rendered with Manim.
Takeaway: The contradiction lands on the one assumption we were free to make.
Concept
The move: #8 (Take the extreme one).
Take the extreme one
Why: There are infinitely many fractions equal to the square root of 2, if any exist at all. Do not reason about a generic one — take the one with the smallest denominator, the fully reduced one.
Why the extreme choice pays
Why: Choosing the smallest gives you a property to violate. A generic fraction has no property that both even could contradict; the reduced one does.
You will see this again as the smallest counterexample argument, and again as take the shortest path that fails.
When an assumption gives you a whole set of objects, reach for the smallest or the largest. That is where the contradiction is cheapest to find.
Concept
'There are infinitely many primes' is the denial of 'the primes form a finite, completable list'. Once again, there is no finite object handed to us to build with directly - so assume the opposite instead.
\[ \text{Claim: } \nexists\, \text{finite list containing every prime} \]
Euclid's classic move: assume a complete finite list exists, then manufacture a number that forces a prime missing from that very list.
Concept
A contradiction proof that constructs something can be written as pseudocode. Reading it that way makes the construction concrete: hand the procedure the supposedly complete list, and watch it hand back something the list cannot contain.
NEW-PRIME(p[1..k])
// assume p[1..k] is EVERY prime that exists
N = 1
for i = 1 to k
N = N * p[i]
N = N + 1
// every p[i] divides N - 1, so none divides N
return any prime factor of NLine 8 always succeeds, because every integer above one has a prime factor. But line 7 says that factor is not on the list. So the list was not every prime after all, and the assumption on line 2 is dead.
Notation
Every line of NEW-PRIME says one thing. Read the line, then read what it does — not the other way round.
Annotate
Invariant
Watch the remainder. Whatever prime from the list you try, dividing N by it leaves one — never zero. That is the impossibility the whole proof was hunting for.
Step through it
Before the last step, try to name a prime on the list that divides N. Notice you cannot.
Picture it
Animation
Shows: NEW-PRIME executing: the current line of pseudocode is highlighted while the data it touches changes.
Rendered with Manim.
Takeaway: Multiply the assumed-complete list and add one: the result has a prime factor that the list does not contain, so no finite list can be complete.
Intuition
What move should we make next?
We assumed the negation, so we have a complete finite list of every prime that exists:
\[ p_{1}, \; p_{2}, \; \ldots, \; p_{k} \]
Again nothing is contradictory yet. Again you have to build something.
You have done this exact shape twice already today. Which move, and what would you build out of that list?
_Look at your toolkit. Say a move number out loud before this slide advances._ A wrong guess is useful. A silent guess is not.
Step zero
Discussion prompt
There are infinitely many primes — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Assume the negation: only finitely many primes exist
Answer:
Worked example
Claim: the list of prime numbers never ends.
Assume the negation: only finitely many primes exist
Why: Suppose the complete list of every prime number is p one through p sub k, with no prime beyond it.
\[ \text{Assume the complete list of primes is } p_1, p_2, \ldots, p_k \]
Build one more number from the whole list
Why: Multiply every prime on the list together and add 1. Dividing this number by any listed prime always leaves a remainder of 1, since the product part is exactly divisible.
\[ N = p_1 p_2 \cdots p_k + 1 \]
Show N needs a prime factor not on the list
Why: N is greater than 1, so it must have at least one prime divisor. But no p sub i on the list divides N, since each leaves remainder 1. So N's prime divisor is a prime that is missing from the supposedly complete list.
\[ p_i \nmid N \ \text{for every } i \ \Rightarrow\ N \text{ has a prime factor absent from the list} \]
Verify the contradiction
Why: We assumed the list contained every prime, yet produced a prime that is not on it. Both cannot be true, so the assumption of finitely many primes is impossible. There are infinitely many primes. Checking concretely with the first six primes: 2 times 3 times 5 times 7 times 11 times 13 plus 1 equals 30031, which equals 59 times 509 - two primes absent from that starting list.
\[ 2\cdot3\cdot5\cdot7\cdot11\cdot13+1 = 30031 = 59 \times 509\ \checkmark \]
Picture it
Animation
Shows: Infinitely many primes — a rendered Manim animation.
Rendered with Manim.
Takeaway: The constructed number is what breaks the assumption.
Intuition
A common misreading is that N itself must always be prime. It does not have to be - in the checked example, 30031 is not prime at all, it factors as 59 times 509.
\[ 30031 = 59 \times 509 \ \text{(neither factor was on the original list)} \]
What matters is only that SOME prime divides N, and that prime cannot be any of the ones on your assumed complete list. N is a witness that the list was incomplete - not necessarily a new prime by itself.
Section
Section 5
Concept
Both techniques feel similar because both involve negating something and reasoning forward. That surface similarity is exactly why students blend them - but they set up completely different starting assumptions.
Getting this distinction straight matters for grading in CS3000: writing a contrapositive proof but labeling it 'by contradiction' (or the reverse) is a structural error, even when every individual algebra step is correct.
Intuition
Think of them as two different opening moves in a game, both aiming for the same checkmate. Contrapositive makes ONE assumption - the conclusion is false - and marches directly to 'so the hypothesis is false too', no explosion required.
Contradiction makes TWO assumptions at once - the hypothesis is true AND the conclusion is false - and marches toward blowing something up. One move is a direct walk to a new true statement; the other is a walk toward self-destruction.
Concept
To prove 'if P then Q' by contrapositive, assume ONLY 'not Q' is true, and give a straightforward, ordinary direct proof that 'not P' follows from it.
\[ \text{Assume } \lnot Q \ \longrightarrow \ \cdots \ \longrightarrow \ \lnot P \]
Nothing ever explodes here. You simply reach a new true statement, not P, and that alone finishes the proof, because 'not Q implies not P' is logically identical to 'P implies Q'.
Concept
To prove the very same 'if P then Q' by contradiction, assume BOTH 'P is true' AND 'Q is false' at the same time, and hunt for an impossibility - not merely a new fact.
\[ \text{Assume } P \ \text{and} \ \lnot Q \ \longrightarrow \ \cdots \ \longrightarrow \ \text{impossibility} \]
The extra assumption - P being true - is exactly what gives contradiction its explosive ingredient. Without it, you would just be doing a contrapositive proof under a different name.
Picture it
Animation
Shows: The pigeonhole principle, in one picture — a rendered Manim animation.
Rendered with Manim.
Takeaway: Assume every hole holds at most one, count, and the arithmetic breaks.
Anomaly
Predict first
A student writes this, and it looks reasonable:
A student sets out to prove 'if n squared is even, then n is even' by contradiction, but only assumes 'n is odd' - forgetting to also assume the hypothesis.
It is wrong. Say what breaks — and say it before you turn the page.
Correct: This derivation is completely correct - but it is a CONTRAPOSITIVE proof, not a contradiction proof, because only one assumption was made and no impossibility was ever reached.
Either technique legitimately proves the claim - but each needs its own correctly stated setup.
Why: This derivation is completely correct - but it is a CONTRAPOSITIVE proof, not a contradiction proof, because only one assumption was made and no impossibility was ever reached. Labeling it 'by contradiction' misdescribes the argument's structure.
Trap
A student sets out to prove 'if n squared is even, then n is even' by contradiction, but only assumes 'n is odd' - forgetting to also assume the hypothesis.
\[ \text{Wanted 'by contradiction': } n^2 \text{ even} \Rightarrow n \text{ even} \]
Assume only 'n is odd', derive 'n squared is odd', stop
Why: This derivation is completely correct - but it is a CONTRAPOSITIVE proof, not a contradiction proof, because only one assumption was made and no impossibility was ever reached. Labeling it 'by contradiction' misdescribes the argument's structure.
\[ \text{Assume } \lnot Q \text{ only} \ \longrightarrow\ \lnot P \ \text{(this IS the contrapositive)} \]
Either technique legitimately proves the claim - but each needs its own correctly stated setup.
\[ \text{Wanted: } n^2 \text{ even} \Rightarrow n \text{ even} \]
For contrapositive: assume only 'not Q'
Why: Assume n is odd, derive n squared is odd directly - a single clean implication, no explosion, no second assumption.
\[ \text{Contrapositive: assume } n \text{ odd} \ \longrightarrow\ n^2 \text{ odd} \]
For contradiction: assume 'P and not Q' together
Why: Assume n squared is even AND n is odd, both at once, then derive that n squared must also be odd - directly clashing with the 'n squared is even' half of the assumption. That clash is what makes it a genuine contradiction proof.
\[ \text{Contradiction: assume } n^2 \text{ even AND } n \text{ odd} \ \longrightarrow\ n^2 \text{ odd (clashes with assumption)} \]
Two truths and a lie
Sort into buckets
Some of these hold up and some are the exact mistakes this lesson is built to prevent. Sort them.
Step zero
Discussion prompt
Same claim, the contrapositive way — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.
Hint: It starts with: Assume only the single statement 'n is odd'
Answer:
Worked example
Prove the same claim as before, 'if n squared is even, then n is even', but this time using the contrapositive, to see the structural difference directly.
\[ \text{Contrapositive to prove: } n \text{ odd} \Rightarrow n^2 \text{ odd} \]
Assume only the single statement 'n is odd'
Why: Unlike the contradiction version, there is no second assumption bolted on. An odd number is two times an integer plus one.
\[ n = 2k+1 \quad (k \in \mathbb{Z}) \]
Square it and reorganize
Why: Expanding the square and factoring out a 2 from the first two terms exposes the odd structure directly - this is a forward, constructive step, not a search for a clash.
\[ n^2 = 4k^2+4k+1 = 2(2k^2+2k)+1 \]
Verify the conclusion follows directly, with no impossibility needed
Why: The result is two times an integer plus one, so n squared is odd - a plain true fact, reached with a single assumption and no clash. Since 'n odd implies n squared odd' is the contrapositive of the original claim, the original claim is proved. Checking n = 5: n squared is 25, which is odd, consistent with the derivation.
\[ n=5:\ n^2 = 25 = 2(12)+1\ \text{(odd)}\ \checkmark \]
Picture it
Animation
Shows: Each line of the worked example "Same claim, the contrapositive way", appearing one at a time.
The same working the example does, in the order a tutor would write it.
Takeaway: The result is two times an integer plus one, so n squared is odd - a plain true fact, reached with a single assumption and no clash. Since 'n odd implies n squared odd' is the contrapositive of the original claim, the original claim is proved. Checking n = 5: n squared is 25, which is odd, consistent with the derivation.
Section
Section 6
Concept
In CS3000, saying a greedy algorithm's first choice is optimal is really saying 'no other valid first choice produces a strictly better solution'. That is a denial of existence, aimed at a hypothetical rival plan - the same shape as 'there is no largest even number', just dressed in algorithm clothing.
So the same recipe applies: assume a rival, strictly-better plan exists, and hunt for why it cannot actually beat the greedy choice.
Intuition
Picture two schedulers. One (greedy) always picks the task that frees you up soonest. Suppose, for the sake of argument, some rival scheduler beats greedy by picking a different first task.
Because greedy's first pick frees you up at least as soon as the rival's first pick, we can always swap greedy's choice into the rival's plan in place of the rival's first pick, without breaking anything later in the rival's schedule - it only ever frees up time, never costs it.
Explain it
Discussion prompt
Explain If a rival plan existed, we could steal its first move to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.
Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.
Answer:
Picture two schedulers. One (greedy) always picks the task that frees you up soonest. Suppose, for the sake of argument, some rival scheduler beats greedy by picking a different first task.
Concept
An exchange argument is a contradiction proof aimed at optimality: assume a strictly better solution exists, then show you can always swap in the greedy choice without making that solution any worse - contradicting 'strictly better'.
\[ \text{Assume: OPT is strictly better than greedy's choice } \ \longrightarrow\ \text{swap in greedy, lose nothing} \ \Rightarrow\ \text{contradiction} \]
exchange argument — A contradiction-based technique for proving a greedy choice is optimal: assume an optimal solution avoiding the greedy choice exists, then show swapping the greedy choice into it produces a solution at least as good - contradicting any claim that avoiding greedy was strictly necessary for optimality.
Ranking
Put in order
Put the moves of The greedy earliest-finish-time choice can't be beaten into the order they have to happen.
Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. Suppose, for contradiction, that some optimal solution OPT achieves the maximum possible count while never including greedy's first pick, a1.
Worked example
Setting: given a set of activities, each with a start and finish time, pick the largest possible group of activities where no two overlap. Greedy rule: always pick the still-available activity that finishes soonest.
\[ \text{Let } a_1 = \text{the activity greedy picks first (earliest finish time among all activities)} \]
Assume the negation: an optimal solution exists that skips a1
Why: Suppose, for contradiction, that some optimal solution OPT achieves the maximum possible count while never including greedy's first pick, a1. Let b1 be whichever activity OPT selects first, in order of finish time.
\[ \text{Assume OPT is optimal and } a_1 \notin \text{OPT; let } b_1 \text{ be OPT's first activity} \]
Compare finish times
Why: a1 was chosen because it has the earliest finish time of ANY activity, so a1 finishes no later than b1 does - this holds no matter which activity b1 happens to be.
\[ \text{finish}(a_1) \leq \text{finish}(b_1) \]
Swap a1 in for b1
Why: Every other activity in OPT starts after b1 finishes, and a1 finishes no later than b1, so replacing b1 with a1 cannot create any new overlap with the rest of OPT's schedule. The swapped solution has exactly the same number of activities as OPT.
\[ \text{OPT}' = (\text{OPT} \setminus \{b_1\}) \cup \{a_1\} \ \text{is valid and} \ |\text{OPT}'| = |\text{OPT}| \]
Verify the contradiction
Why: OPT' is a valid solution of the same size as OPT that DOES include a1 - so an optimal-size solution containing a1 exists after all. This contradicts nothing being lost by excluding a1, since we've shown a1 can always be included at no cost. So assuming an optimal solution must skip greedy's first choice is impossible; greedy's first choice is always safe to take. (The full proof repeats this exchange step down the whole schedule by induction - this is the sketch of that one key move.)
\[ \text{OPT}' \text{ contains } a_1, \ |\text{OPT}'|=|\text{OPT}| \Rightarrow \text{excluding } a_1 \text{ was never required}\ \checkmark \]
Notation
Annotate
From The greedy earliest-finish-time choice can't be beaten — read this one piece at a time. What is each part doing?
On: \( \text{OPT}' \text{ contains } a_1, \ |\text{OPT}'|=|\text{OPT}| \Rightarrow \text{excluding } a_1 \text{ was never required}\ \checkmark \)
Intuition
Notice the exchange argument used the exact same three ingredients from Section 1: an assumption (a strictly-necessary-to-exclude greedy choice), a derivation (the swap), and an impossibility (a same-size solution existed that included the greedy choice anyway, so excluding it was never forced).
Whether the subject is numbers, primes, or scheduling algorithms, the contradiction skeleton never changes. Once you can name the three ingredients, you can build the proof in any subject CS3000 throws at you.
Concept
Across this lesson, every impossibility traced back to one of a few sources: a number forced to be both even and odd (root 2, and the n-squared claim), a supposedly complete list caught missing an element (the primes), a minimality or lowest-terms assumption directly violated (root 2, smallest positive real), or a same-size solution existing despite an exclusion being claimed necessary (the greedy exchange).
When you are stuck hunting for a contradiction, ask which of these four shapes your derivation is closest to - it usually points straight at the clash you are missing.
Analogy
Discussion prompt
Explain Where impossibilities come from in CS3000 by analogy to something with no CS3000 Algorithms in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.
Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.
Answer:
When you are stuck hunting for a contradiction, ask which of these four shapes your derivation is closest to - it usually points straight at the clash you are missing.
Explain it to yourself
Discussion prompt
In The contradiction template this move is made:
2. Write the exact negation
Why is that legal? Name the rule or definition it rests on before you read on.
Hint: If you can only say "because that is what you do", the rule is the thing to go and find.
Answer:
Flip quantifiers correctly (for all becomes there-exists-not, and the reverse); negate 'if P then Q' as 'P and not Q'; negate a plain statement to its opposite.
Pattern
1. Name the claim's exact shape
Why: Pin down whether it's a 'for all', a 'there exists', an 'if-then', or a plain statement, before writing anything else.
2. Write the exact negation
Why: Flip quantifiers correctly (for all becomes there-exists-not, and the reverse); negate 'if P then Q' as 'P and not Q'; negate a plain statement to its opposite.
3. Assume the negation and reason forward with full rigor
Why: Treat it as a true premise and use ordinary, fully justified steps - the same standard as any other proof.
4. Reach a genuine, nameable impossibility
Why: Point to the two specific facts in conflict - not a vague sense that something looks wrong.
5. Conclude the original claim explicitly
Why: State that the assumption must be false because it produced nonsense, and therefore the original claim is true.
Real world
Discussion prompt
Outside this lesson: where does Proof by Contradiction actually turn up? Name one concrete situation — a job, a piece of software someone ships, a decision somebody has to make — and say which part of The contradiction template is doing the work in it.
Hint: Vague is the failure mode here. "Engineering" is not a situation; "deciding whether this build is fast enough to ship" is.
Answer:
How to start, run, and close a proof by contradiction: recognizing when it fits, negating a claim correctly (including flipping quantifiers), and reasoning to a genuine impossibility. Covers the irrationality of the square root of 2, the infinitude of primes, and a greedy exchange-argument sketch.
Picture it
Animation
Shows: Contradiction is not the contrapositive — a rendered Manim animation.
Rendered with Manim.
Takeaway: The contrapositive is often shorter, and worth trying first.
Elimination
Eliminate the wrong options
Which claim is the best candidate to prove by contradiction rather than direct proof?
3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.
Survives elimination: A
Why: Option A is a denial of existence - 'there is no algorithm that does X' - which hands a direct proof nothing to build forward from. Assuming the negation (such an algorithm DOES exist) gives a concrete object to reason about and hunt for an impossibility, which is exactly when contradiction earns its keep.
Check
Consider four claims a CS3000 student might need to prove.
Check your understanding
Which claim is the best candidate to prove by contradiction rather than direct proof?
Answer: A
Why: Option A is a denial of existence - 'there is no algorithm that does X' - which hands a direct proof nothing to build forward from. Assuming the negation (such an algorithm DOES exist) gives a concrete object to reason about and hunt for an impossibility, which is exactly when contradiction earns its keep.
Prediction
Predict first
What is the correct negation to assume as the starting point of the proof?
Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.
Correct: There exists a node in the list whose next pointer is null.
Why: The claim is 'for all nodes, next pointer is non-null'. Its negation flips the quantifier to 'there exists' and negates the inner property: 'there exists a node whose next pointer IS null'. That single witness node is exactly what you would assume exists and then work with.
Check
You want to prove the statement below by contradiction.
\[ \text{Claim: every node in this linked list has a non-null next pointer.} \]
Check your understanding
What is the correct negation to assume as the starting point of the proof?
Answer: A
Why: The claim is 'for all nodes, next pointer is non-null'. Its negation flips the quantifier to 'there exists' and negates the inner property: 'there exists a node whose next pointer IS null'. That single witness node is exactly what you would assume exists and then work with.
Check
A student writes the following argument to prove 'if a graph has no cycles, then it has at most n - 1 edges': 'Assume the graph has more than n - 1 edges. I will show it must contain a cycle.' No second assumption is made, and the argument ends the moment a cycle is shown to exist.
Check your understanding
What proof technique did the student actually use?
Answer: A
Why: Only one assumption was made - the negated conclusion, 'more than n - 1 edges' - and the argument walked straight to the negated hypothesis, 'contains a cycle', with no second assumption and no impossibility. That single-assumption, straight-line structure is exactly a contrapositive proof, even though a cycle sounds dramatic.
Commit first
Predict first
Is 'the function calls itself forever on ever-smaller natural numbers, without reaching the base case' a genuine impossibility?
Commit to an answer, then rate it — certain, fairly sure, or guessing — and write the rating down before you turn the page.
Correct: Yes - it directly contradicts the fact that there is no infinite strictly-decreasing sequence of natural numbers.
Why: Natural numbers cannot decrease forever - any strictly decreasing sequence of natural numbers must be finite, since each step must land on a smaller natural number and there is a floor at 0. An infinite strictly-decreasing sequence of natural numbers is a genuine, nameable impossibility, tied directly to a known fact, not just an inconvenient outcome.
The rating matters as much as the answer: confident-and-wrong is the combination that survives revision, because nothing about it feels like it needs revisiting.
Check
A student is proving that a particular recursive function always terminates. Partway through, assuming for contradiction that it does NOT terminate, they derive that the function makes a call with a smaller input forever, without ever reaching the base case.
Check your understanding
Is 'the function calls itself forever on ever-smaller natural numbers, without reaching the base case' a genuine impossibility?
Answer: A
Why: Natural numbers cannot decrease forever - any strictly decreasing sequence of natural numbers must be finite, since each step must land on a smaller natural number and there is a floor at 0. An infinite strictly-decreasing sequence of natural numbers is a genuine, nameable impossibility, tied directly to a known fact, not just an inconvenient outcome.
Prediction
Predict first
What should you assume as the starting point of a contradiction proof of this claim?
Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.
Correct: A binary search tree has n nodes, and its height is less than log base 2 of n.
Why: The claim has the shape 'if P then Q' where P is 'has n nodes' and Q is 'height is at least log base 2 of n'. The negation of an implication is 'P and not Q' - keep the hypothesis true (n nodes) and deny the conclusion (height strictly less than log base 2 of n), both held true at once.
Check
You want to prove the following claim by contradiction.
\[ \text{Claim: if a binary search tree has n nodes, then its height is at least} \ \log_2(n). \]
Check your understanding
What should you assume as the starting point of a contradiction proof of this claim?
Answer: A
Why: The claim has the shape 'if P then Q' where P is 'has n nodes' and Q is 'height is at least log base 2 of n'. The negation of an implication is 'P and not Q' - keep the hypothesis true (n nodes) and deny the conclusion (height strictly less than log base 2 of n), both held true at once.
Elimination
Eliminate the wrong options
What exactly is the impossibility that closes this proof?
3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.
Survives elimination: A
Why: The swap produces OPT', which is valid (no new overlaps, since a1 finishes no later than b1) and exactly the same size as OPT. That means a solution of optimal size containing a1 exists after all - directly undermining any version of the argument that treated excluding a1 as required for optimality. That is the specific, nameable clash that closes the proof.
Check
In the greedy earliest-finish-time exchange argument, after assuming an optimal solution OPT exists that excludes greedy's first choice a1, the proof builds OPT' by swapping b1 out for a1.
Check your understanding
What exactly is the impossibility that closes this proof?
Answer: A
Why: The swap produces OPT', which is valid (no new overlaps, since a1 finishes no later than b1) and exactly the same size as OPT. That means a solution of optimal size containing a1 exists after all - directly undermining any version of the argument that treated excluding a1 as required for optimality. That is the specific, nameable clash that closes the proof.
Concept
Moves added today:
Moves you reused today:
Move #2 is a special case of what you did today. The +1 trick builds one value that breaks a for-all claim; move #8 builds one object that breaks an assumption. Same instinct, wider target.
Full toolkit so far: #1 through #8.
Next session opens with you naming every one of these from memory, before any new material.
Counterexample
Discussion prompt
Move #2 is a special case of what you did today. The +1 trick builds one value that breaks a for-all claim; move #8 builds one object that breaks an assumption. Same instinct, wider target.
That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.
Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.
Answer:
Next session opens with you naming every one of these from memory, before any new material.
Picture it
Animation
Shows: Checking your own contradiction proof — a rendered Manim animation.
Rendered with Manim.
Takeaway: The third question is the one people skip, and it is where proofs go wrong.
Connect it up
Draw it
One page, no notation unless you need it: draw how these connect — Recognizing When Contradiction Fits · Negating Statements Correctly · The Setup Recipe · Classic Proofs · Contradiction vs. Contrapositive · Contradiction in Algorithms. Put an arrow wherever one of them is what makes another possible, and label the arrow with why.
Recap
You now have a working recipe for starting - and finishing - a proof by contradiction, the technique CS3000 leans on for every 'cannot happen' claim.
| Claim shape | Correct starting assumption |
|---|---|
| For all x, P(x) | There exists x, not P(x) |
| There exists x, P(x) | For all x, not P(x) |
| If P then Q | P and not Q, together |
| Plain statement S | Not S |
Want this taught 1-on-1? Alexander tutors CS3000 Algorithms — $55/session, free consultation.