BCA151 Discrete Structure

Discrete StructureUnit 817 min read

Proof Techniques: Direct, Contrapositive, Contradiction, Induction & Cases

Unit 8 of Discrete Structure teaches five rigorous proof methods—direct, contrapositive, contradiction, mathematical induction, and proof by cases—with definitions, step-by-step examples, and real-world applications in algorithms, cryptography, and financial systems. Students learn to construct airtight logical argumen

TAKEAWAYS:

  • Direct proofs start with premises and apply logical rules to reach the conclusion, ideal for "if P then Q" statements.
  • Contrapositive proofs rewrite "if P then Q" as "if not Q then not P" and are often easier to prove.
  • Proof by contradiction assumes the opposite of the statement and derives a contradiction, useful for uniqueness proofs.
  • Mathematical induction proves statements for all natural numbers by showing a base case and an inductive step.
  • Proof by cases breaks a statement into exhaustive, mutually exclusive scenarios and proves each separately.
  • Real-world tie-ins include WhatsApp’s end-to-end encryption (proofs of security protocols), Ncell’s billing algorithms (induction for recursive fee calculations), and NEPSE’s stock price validation (contradiction for fraud detection).

1. Introduction to Proof Techniques

Proof techniques are the backbone of mathematics and computer science. They allow us to verify the correctness of algorithms, validate logical statements, and ensure the reliability of systems. In this unit, we focus on five key methods:

  1. Direct Proof
  2. Proof by Contrapositive
  3. Proof by Contradiction
  4. Mathematical Induction
  5. Proof by Cases

Each method has its strengths and is suited to specific types of problems. Let’s explore them one by one.


2. Direct Proof

Definition

A direct proof starts with the given premises (assumptions) and uses logical deductions, definitions, and previously established theorems to arrive at the conclusion. It follows the structure:

Given: Premise To Prove: Conclusion Proof: If is true, then by [logical steps], must also be true.

How It Works

  1. Assume the hypothesis is true.
  2. Apply definitions, axioms, or known theorems to derive intermediate statements.
  3. Conclude with .

Worked Example: Even + Even = Even

Statement: If and are even integers, then is even. Proof:

  1. Let and for some integers (definition of even).
  2. Then, .
  3. Since is an integer, is even by definition.

Visual: Direct Proof Flow

flowchart TD
    A["Given: P is true"] --> B["Apply definitions/theorems"]
    B --> C["Derive intermediate statements"]
    C --> D["Conclude Q is true"]

When to Use

  • When the statement is of the form "If , then ."
  • When definitions or algebraic manipulations directly lead to the conclusion.

Real-World Example: WhatsApp Encryption

WhatsApp uses Signal Protocol for end-to-end encryption. The correctness of its key exchange relies on direct proofs to show that:

If Alice and Bob follow the protocol correctly, then an eavesdropper cannot decrypt their messages. This is proven by assuming the protocol steps (premises) and showing that the final ciphertext is secure (conclusion).


3. Proof by Contrapositive

Definition

The contrapositive of a statement "If , then " is "If not , then not ." These two statements are logically equivalent. A proof by contrapositive assumes the negation of the conclusion and shows that it leads to the negation of the hypothesis.

Why Use It?

Sometimes, proving the contrapositive is easier than proving the original statement directly.

Worked Example: Rational Numbers

Statement: If is irrational, then is irrational. Contrapositive: If is rational, then is rational. Proof:

  1. Assume is rational, so where are integers with no common factors.
  2. Then, , which is rational by definition.

Visual: Contrapositive Logic

flowchart TD
    A["Original: If P, then Q"] -->|"Logically Equivalent"| B["Contrapositive: If not Q, then not P"]
    B --> C["Easier to prove in some cases"]

Real-World Example: Ncell Billing System

Ncell’s billing system uses recursive algorithms to calculate charges. To prove that:

If a customer’s usage exceeds the threshold, then they are charged extra, the contrapositive is: If a customer is not charged extra, then their usage did not exceed the threshold. This is easier to verify in code by checking the billing logic’s conditions.


4. Proof by Contradiction

Definition

In a proof by contradiction, we assume the opposite of what we want to prove and show that this assumption leads to a contradiction (a statement that is always false, like ). If the assumption leads to a contradiction, it must be false, and the original statement must be true.

Structure

  1. Assume (the negation of the conclusion).
  2. Show that this leads to a contradiction (e.g., or ).
  3. Conclude that must be true.

Worked Example: Square Root of 2 is Irrational

Statement: is irrational. Proof:

  1. Assume is rational, so where are coprime integers.
  2. Then, , so .
  3. is even, so is even. Let .
  4. Substituting: → → .
  5. is even, so is even.
  6. But and are both even, contradicting the assumption that they are coprime.
  7. Thus, is irrational.

Visual: Contradiction Proof Steps

flowchart TD
    A["Assume ¬Q"] --> B["Derive intermediate statements"]
    B --> C["Reach contradiction (e.g., P ∧ ¬P)"]
    C --> D["Conclude Q must be true"]

Real-World Example: NEPSE Fraud Detection

NEPSE (Nepal Stock Exchange) uses contradiction proofs to detect fraudulent transactions. For example:

If a stock price is reported as , but the proof shows that assuming is valid leads to a contradiction (e.g., violating market rules), then must be invalid. This ensures only valid trades are recorded.


5. Mathematical Induction

Definition

Mathematical induction is used to prove statements about all natural numbers (or recursively defined structures). It consists of two steps:

  1. Base Case: Prove the statement is true for the initial value (usually or ).
  2. Inductive Step: Assume the statement holds for some arbitrary (inductive hypothesis), and then prove it holds for .

If both steps are satisfied, the statement is true for all natural numbers.

Structure

  1. Base Case: Show is true (or ).
  2. Inductive Hypothesis: Assume is true for some .
  3. Inductive Step: Prove is true using .

Worked Example: Sum of First Natural Numbers

Statement: for all . Proof:

  1. Base Case (): LHS = 1, RHS = . True.
  2. Inductive Step: Assume (inductive hypothesis). Then, . This matches the formula for .

Visual: Induction Process

flowchart TD
    A["Base Case: Prove P(0)"] --> B["Inductive Hypothesis: Assume P(k) is true"]
    B --> C["Inductive Step: Prove P(k+1) using P(k)"]
    C --> D["Conclusion: P(n) is true for all n"]

Real-World Example: Daraz Order Processing

Daraz uses recursive algorithms to process orders. The total cost of an order with items can be proven using induction:

  1. Base Case: 1 item → cost is straightforward.
  2. Inductive Step: Assume the cost formula works for items. For items, add the new item’s cost to the previous total. This ensures the billing system works correctly for any number of items.

6. Proof by Cases

Definition

A proof by cases divides the problem into exhaustive and mutually exclusive scenarios and proves the statement for each case separately. It is useful when the statement behaves differently under different conditions.

Structure

  1. Identify all possible cases (e.g., , , ).
  2. Prove the statement for each case individually.

Worked Example: Absolute Value Definition

Statement: For any real number , if , and if . Proof:

  1. Case 1: . By definition, .
  2. Case 2: . By definition, . Since these cases cover all real numbers, the statement is proven.

Visual: Proof by Cases

flowchart TD
    A["Identify all cases"] --> B["Case 1: Prove P"]
    A --> C["Case 2: Prove P"]
    A --> D["Case n: Prove P"]
    B --> E["Conclusion: P holds in all cases"]
    C --> E
    D --> E

Real-World Example: Kathmandu Traffic Light Control

Traffic lights in Kathmandu use proof by cases to manage vehicle flow:

  1. Case 1: If the sensor detects a vehicle at a red light, the light turns green.
  2. Case 2: If no vehicle is detected, the light remains red.
  3. Case 3: If a pedestrian presses the button, the light changes after a delay. Each case is programmed separately to ensure smooth traffic flow.

Comparison Table: Proof Techniques

Technique When to Use Strengths Weaknesses Example
Direct Proof "If P, then Q" statements Straightforward, intuitive May require complex algebraic steps Even + Even = Even
Contrapositive When proving the contrapositive is easier Logically equivalent to original Less intuitive for some students Rationality proofs
Contradiction Proving uniqueness or irrationality Powerful for "must be true" statements Can be abstract is irrational
Induction Statements about natural numbers Proves for all Requires careful base case setup Sum of first numbers
Proof by Cases Statements with multiple scenarios Exhaustive coverage More cases = more work Absolute value definition

7. Common Mistakes and Pitfalls

  1. Skipping the Base Case in Induction: Forgetting to verify the base case invalidates the entire proof. Always check or .

  2. Assuming What You Need to Prove: In induction, do not use the conclusion to prove . Only the inductive hypothesis is allowed.

  3. Non-Exhaustive Cases: In proof by cases, ensure all possible scenarios are covered. Missing a case means the proof is incomplete.

  4. Logical Fallacies in Direct Proofs: Avoid circular reasoning (e.g., proving by assuming ).


8. Step-by-Step Proof Template

Use this template to structure your proofs in exams:

For Direct/Contrapositive Proofs:

  1. State the given: Clearly write the hypothesis .
  2. State the goal: Clearly write the conclusion .
  3. Apply definitions: Rewrite using definitions or algebraic manipulations.
  4. Derive : Show how the steps lead to .
  5. Conclude: Write "Therefore, is true."

For Proof by Contradiction:

  1. Assume the opposite: Write "Assume ."
  2. Derive consequences: Show how this leads to a contradiction.
  3. Conclude: Write "This is a contradiction, so must be true."

For Mathematical Induction:

  1. Base Case: Prove for or .
  2. Inductive Hypothesis: Assume is true.
  3. Inductive Step: Prove using .
  4. Conclusion: State that by induction, is true for all .

9. In the Real World

Discrete mathematics and proof techniques are everywhere in technology and everyday life. Here’s how they apply to products and systems students interact with:

1. WhatsApp End-to-End Encryption (Contrapositive & Contradiction)

  • Idea Used: Proof by contradiction ensures security.
  • How:
    • WhatsApp’s Signal Protocol uses ephemeral keys and double ratchet algorithms.
    • To prove security, WhatsApp’s team assumes an attacker can decrypt messages (contradiction assumption) and shows this leads to breaking mathematical assumptions (e.g., the hardness of the Diffie-Hellman problem).
    • Since no known method exists to break these assumptions, the original statement ("messages are secure") holds.

2. Ncell Billing System (Mathematical Induction)

  • Idea Used: Recursive fee calculation.
  • How:
    • Ncell’s billing system calculates charges for calls, SMS, and data using recursive functions.
    • Example: If a call costs Rs. for the first minute and Rs. for each additional minute, the total cost for minutes can be proven using induction:
      1. Base Case: 1 minute costs .
      2. Inductive Step: Assume minutes cost . Then for , the cost is .
    • This ensures the billing algorithm works for any call duration.

3. Daraz Order Processing (Proof by Cases)

  • Idea Used: Handling different order scenarios.
  • How:
    • Daraz’s checkout system processes orders based on:
      1. Case 1: Single item → apply discount if eligible.
      2. Case 2: Multiple items → calculate subtotal, tax, and shipping separately.
      3. Case 3: Bulk order → apply volume discount.
    • Each case is programmed separately to ensure correct pricing.

4. NEPSE Stock Validation (Contradiction)

  • Idea Used: Fraud detection.
  • How:
    • NEPSE uses contradiction to validate stock prices. For example:
      • Statement: A reported price is valid only if it satisfies market rules.
      • Proof: Assume is valid but violates a rule (e.g., exceeds daily limit). This leads to a contradiction with the exchange’s policies, so must be invalid.
    • This ensures only legitimate trades are recorded.

5. Kathmandu Traffic Light System (Proof by Cases)

  • Idea Used: Managing traffic scenarios.
  • How:
    • Traffic lights at busy intersections use proof by cases:
      1. Case 1: Vehicle detected → turn green.
      2. Case 2: Pedestrian button pressed → delay and turn red for vehicles.
      3. Case 3: No activity → keep lights as is.
    • Each case is handled by sensors and timers to optimize flow.

6. Bank Loan Interest Calculation (Mathematical Induction)

  • Idea Used: Recursive interest computation.
  • How:
    • Banks calculate compound interest using the formula: .
    • To verify this for compounding periods, induction is used:
      1. Base Case: 1 period → .
      2. Inductive Step: Assume it holds for periods, then prove for .

10. Exam Tip

What Examiners Look For

  1. Clarity: Clearly state what you are proving and why.
  2. Structure: Follow the logical flow of the proof technique.
  3. Rigor: Every step must be justified (e.g., "by definition," "by algebraic manipulation").
  4. Completeness:
    • For induction, show both base case and inductive step.
    • For cases, cover all scenarios.
  5. Avoid Assumptions: Do not assume what you need to prove (e.g., in induction, do not use to prove ).

Common Exam Questions and How to Answer

Question Type How to Approach
Prove directly Start with , apply definitions/theorems, and derive .
Prove using contrapositive Rewrite as and prove that.
Prove by contradiction Assume , derive a contradiction, and conclude .
Prove by induction Show base case, assume , and prove .
Prove by cases Identify all cases, prove for each, and state they are exhaustive.

Sample Exam Answer Structure

Question: Prove that the sum of the first odd numbers is using mathematical induction.

Answer:

  1. Base Case (): Sum = 1, and . ✔️
  2. Inductive Hypothesis: Assume the sum of the first odd numbers is .
  3. Inductive Step: Sum of first odd numbers = .
  4. Conclusion: By induction, the statement holds for all .

This note covers all subtopics of Unit 8: Proof Techniques with definitions, examples, real-world ties, and exam strategies. Practice constructing proofs for each method to master the unit!

Based on the TU BCA syllabus for Discrete Structure (BCA151), unit 8.

Discussion

Loading…