HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Valid Arguments and Methods of Proof
  1. 1Validating statements and arguments
  2. 2Direct proof, contrapositive and counterexample
  3. 3Proof by contradiction and by cases
  1. Mathematics
  2. /Valid Arguments and Methods of Proof
  3. /Direct proof, contrapositive and counterexample

Course 36.3·Lesson 2 of 3

Direct proof, contrapositive and counterexample

A direct proof starts from the hypothesis and reaches the conclusion through known facts. A proof by contrapositive proves ∼q⇒∼p\sim q \Rightarrow \sim p∼q⇒∼p instead of p⇒qp \Rightarrow qp⇒q

Lesson 2 of 3Show all lessonsHide
Valid Arguments and Methods of Proof
  1. 1Validating statements and arguments
  2. 2Direct proof, contrapositive and counterexample
  3. 3Proof by contradiction and by cases

Try the code and the simulations beside the lesson.

What you will be able to do

  • write a direct proof with clear steps;
  • prove a statement through its contrapositive;
  • prove a statement about finitely many cases by exhaustion;
  • disprove a statement with a counterexample.

The direct proof

A direct proof of "if ppp then qqq" starts by assuming ppp. Each line follows from the one before, from a definition or from a known fact. The last line is qqq.

Claim. The sum of two odd integers is even.

Proof.

  1. Let the odd integers be 2m+12m + 12m+1 and 2n+12n + 12n+1, where mmm and nnn are integers.
  2. Their sum is 2m+2n+2=2(m+n+1)2m + 2n + 2 = 2(m + n + 1)2m+2n+2=2(m+n+1).
  3. m+n+1m + n + 1m+n+1 is an integer, so the sum is twice an integer.
  4. So the sum is even. This completes the proof.

A second example. If nnn is odd, then n2−1n^2 - 1n2−1 is divisible by 888.

  1. Write n=2k+1n = 2k + 1n=2k+1. Then n2−1=4k2+4k=4k(k+1)n^2 - 1 = 4k^2 + 4k = 4k(k + 1)n2−1=4k2+4k=4k(k+1).
  2. One of kkk and k+1k + 1k+1 is even, so k(k+1)k(k + 1)k(k+1) is even.
  3. So 4k(k+1)4k(k + 1)4k(k+1) is 444 times an even number, a multiple of 888.

Check with n=7n = 7n=7: 49−1=48=8×649 - 1 = 48 = 8 \times 649−1=48=8×6.

The proof by contrapositive

Sometimes the hypothesis gives little to work with. Then prove the contrapositive, which is equivalent.

Claim. For an integer nnn, if n2n^2n2 is even, then nnn is even.

A direct start, "n2=2kn^2 = 2kn2=2k", does not lead anywhere easily. So prove the contrapositive: if nnn is odd, then n2n^2n2 is odd.

  1. Let n=2k+1n = 2k + 1n=2k+1.
  2. Then n2=4k2+4k+1=2(2k2+2k)+1n^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1n2=4k2+4k+1=2(2k2+2k)+1, which is odd.
  3. The contrapositive is true, so the claim is true.

Another one. If a+b≥20a + b \ge 20a+b≥20 for real numbers aaa and bbb, then a≥10a \ge 10a≥10 or b≥10b \ge 10b≥10. The contrapositive is: if a<10a < 10a<10 and b<10b < 10b<10, then a+b<20a + b < 20a+b<20. That is clear, because adding the two inequalities gives it.

Proof by exhaustion

When there are only a few cases, check them all. This is a proof by exhaustion.

Claim. No perfect square ends in the digit 222, 333, 777 or 888.

The last digit of n2n^2n2 depends only on the last digit of nnn. Check the ten digits:

  • 0→00 \to 00→0, 1→11 \to 11→1, 2→42 \to 42→4, 3→93 \to 93→9, 4→64 \to 64→6;
  • 5→55 \to 55→5, 6→66 \to 66→6, 7→97 \to 97→9, 8→48 \to 48→4, 9→19 \to 19→1.

The last digits of squares are 0,1,4,5,6,90, 1, 4, 5, 6, 90,1,4,5,6,9. None is 222, 333, 777 or 888.

Disproof by counterexample

To show that a for-all claim is false, one counterexample is enough.

  • "n2+n+41n^2 + n + 41n2+n+41 is prime for every whole number nnn." It is prime for n=0,1,…,39n = 0, 1, \dots, 39n=0,1,…,39. But at n=40n = 40n=40 it is 1681=4121681 = 41^21681=412.
  • "Every number 22n+12^{2^n} + 122n+1 is prime." This was believed for n=0n = 0n=0 to 444. But 232+1=641×67004172^{32} + 1 = 641 \times 6700417232+1=641×6700417.
  • "If a2=b2a^2 = b^2a2=b2, then a=ba = ba=b." The pair a=3a = 3a=3, b=−3b = -3b=−3 is a counterexample.

Forty cases that work do not prove a claim. One case that fails disproves it.

A note for other syllabi

A-Level Mathematics names these methods proof by deduction, proof by exhaustion and disproof by counterexample. IB Analysis and Approaches asks for simple deductive proofs, often from the left side to the right side of an identity. The methods are the same.

Practise with new numbers

Try it in Python

The program searches for counterexamples. It tests Euler's formula n2+n+41n^2 + n + 41n2+n+41, then checks the factor 641641641 of 232+12^{32} + 1232+1.

Read it first. Then run it. What is the first counterexample it prints?

1. Change c = 41 to c = 17. Where does the formula fail now?

2. Why can a computer find a counterexample, but not prove a for-all claim about every whole number?

Common mistakes

  • Proving by examples. Checking ten cases is not a proof of a statement about every integer, unless there are only ten cases.
  • Assuming the conclusion. A direct proof starts from the hypothesis, never from what you want.
  • Proving the converse instead. "If nnn is even, then n2n^2n2 is even" is the converse of the claim above, not its contrapositive.
  • Using the same letter for two numbers. Two odd integers are 2m+12m + 12m+1 and 2n+12n + 12n+1, not 2k+12k + 12k+1 twice.

Remember these

  • Direct: assume ppp, reach qqq.
  • Contrapositive: assume ∼q\sim q∼q, reach ∼p\sim p∼p.
  • Exhaustion: check every one of finitely many cases.
  • One counterexample disproves a for-all claim.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. Prove that the product of an even integer and any integer is even.
  1. Give a counterexample to "every odd number greater than 111 is prime".
  1. To prove "if 3n+23n + 23n+2 is odd, then nnn is odd" by contrapositive, what do you assume?
  1. What are the possible last digits of a fourth power n4n^4n4?
  1. Disprove: "For every real xxx, x2=x\sqrt{x^2} = xx2​=x."

References

  • NCERT, Mathematics Textbook for Class XII, Part II, Appendix 1, Proofs in Mathematics.
  • Richard Hammack, Book of Proof, third edition, Chapters 4 and 5 (direct and contrapositive proof).

Enroll free in Valid Arguments and Methods of Proof

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (4)

Prove directly that if n is an odd integer, then n² - 1 is divisible by 8…Hard · High School (11–12) · by StemPy Lab
For integers a and b, prove that if a + b ≥ 15, then a ≥ 8 or b ≥ 8…Hard · High School (11–12) · by StemPy Lab
The formula f(n) = n² + n + 41 gives a prime for n = 0, 1, 2, … for a long time…Advanced · High School (11–12) · by StemPy Lab
Next: lesson 3Proof by contradiction and by cases
← Valid Arguments and Methods of Proof
← Validating statements and argumentsProof by contradiction and by cases →

Discussion (0)

Log in to join the discussion.

Loading…

. A proof by exhaustion checks every one of finitely many cases. A single counterexample disproves a for-all claim, as
n=40n = 40n=40
does for 'every
n2+n+41n^2 + n + 41n2+n+41
is prime'. A-Level calls these proof by deduction, by exhaustion and disproof by counterexample.
about 25 min1 simulation1 practice question1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Prove by exhaustion that no perfect square ends in the digit 2, 3, 7 or 8…Advanced · High School (11–12) · by StemPy Lab

Python Labs (1)

A counterexample hunterPython Lab · by StemPy Lab