START WELL TO END WELL
+92 340 1501700 startwelleducationbhimber@gmail.com Mon – Sat: 8:00 AM – 2:00 PM
Startwell Education logo
StartwellEducation
Discrete Structures · Lecture 7

Direct Proof and Proof by Implication

Week 3, slot 1 · CLO-2 · Bloom C3 · Prerequisite: Lectures 1–6 · Reference: Rosen 7th, Logic and Proofs

Learning objectives

  1. Use correct proof vocabulary: axiom, definition, theorem, lemma, corollary, conjecture.
  2. Write a direct proof of an implication p → q.
  3. Recognise vacuous and trivial proofs.
  4. Avoid the standard errors of proof writing.

Roman Urdu. Proof ek mantiqi daleel hai jo sabit karti hai ke koi statement hamesha sahih hai. Direct proof mein hum hypothesis p ko maan kar definitions aur pehle sabit shuda baaton se seedha q tak pohanchte hain. Sirf misalen dikhana proof nahi hota.

Core concepts

Vocabulary

Term Meaning
Axiom A statement accepted without proof
Definition An exact meaning of a term
Theorem A statement proved true
Lemma A helper theorem used to prove a bigger one
Corollary A result that follows quickly from a theorem
Conjecture A statement believed true but not proved

Definitions used in this course. An integer n is even if n = 2k for some integer k, and odd if n = 2k + 1 for some integer k. For integers a and b with a ≠ 0, a | b (a divides b) if b = a·k for some integer k. A real number is rational if it equals a/b for integers a, b with b ≠ 0.

Direct proof of p → q. Assume p is true. Using definitions, known facts and rules of inference, show q is true. Then p → q holds. - Trivial proof: if q is true, then p → q is true whatever p is. - Vacuous proof: if p is false, then p → q is true.

Common errors: proving by examples; assuming the conclusion; dividing by something that might be zero; using the same letter for different things.

Worked examples

Example 1 (basic). Theorem. The sum of two even integers is even. Given: m and n even. Required: m + n even. Proof: m = 2a and n = 2b for integers a, b. Then m + n = 2a + 2b = 2(a + b), and a + b is an integer, so m + n is even. ∎

Example 2 (intermediate). Theorem. If n is odd, then n² is odd. Proof: n = 2k + 1 for some integer k. Then n² = 4k² + 4k + 1 = 2(2k² + 2k) + 1. Since 2k² + 2k is an integer, n² is odd. ∎

Example 3 (advanced). Theorem. The sum of two rational numbers is rational. Proof: let x = a/b and y = c/d with b ≠ 0, d ≠ 0. Then x + y = (ad + bc)/(bd). The numerator ad + bc is an integer. The denominator bd is a nonzero integer because b and d are nonzero. So x + y is rational. ∎

Example 4 (computing). Claim: the function abs(x) returns a value ≥ 0. Direct proof by cases on the precondition x ∈ ℤ: if x ≥ 0 it returns x ≥ 0; if x < 0 it returns −x > 0. Proof by cases is a direct proof in which the hypothesis is split into exhaustive cases.

Computer science connection

Proving that a function meets its specification (precondition → postcondition); proving properties of algorithms; the form of every verification condition in program proofs.

Key takeaways

  • Direct proof: assume p, derive q.
  • Always write what is given, what is required and the definitions used.
  • Checking examples never proves a ∀ statement.

Roman Urdu. Direct proof mein hypothesis maan kar definitions ke zariye conclusion tak jate hain. Even ka matlab n = 2k, odd ka matlab n = 2k + 1. Chand misalen check kar lena proof nahi hota.

Five revision questions

  1. Prove that the sum of two odd integers is even.
  2. Prove that if a | b and b | c then a | c.
  3. Distinguish a lemma from a corollary.
  4. Why is "If 0 = 1 then 5 is prime" proved vacuously?
  5. What is wrong with "test n = 1, 2, 3 and it works, so it holds for all n"?

Homework. Prove: (a) the product of two even integers is even; (b) if n is even then n² is divisible by 4; (c) the product of two rationals is rational.

Quiz

Direct proof mein p → q ke liye kya karte hain?

All lectures

  1. Lecture 0: Discrete vs Continuous
  2. Lecture 1: Propositions and Connectives
  3. Lecture 2: Truth Tables, Tautologies and Contradictions
  4. Lecture 3: Logical Equivalence and the Laws of Logic
  5. Lecture 4: Predicate Logic and Quantifiers
  6. Lecture 5: Rules of Inference
  7. Lecture 6: Logical Arguments and Puzzle Solving
  8. Lecture 7: Direct Proof and Proof by Implication
  9. Lecture 8: Proof by Contraposition
  10. Lecture 9: Proof by Contradiction
  11. Lecture 10: Mathematical Induction
  12. Lecture 11: Strong Induction
  13. Lecture 12: Applications of Proofs and Proof Strategy
Admissions Open

Give your child the right start.

Seats are limited. Visit our campus, meet our teachers and see why families trust Startwell Education.