2 Proof Techniques

Discrete Structure · Unit 2

Proof Techniques

Exam-focused notes for Proof Techniques (Discrete Structure, BIT152): what the TU syllabus asks and how it has actually been tested, with 14 solved past questions from this unit.

Proof Techniques in short

A proof is a valid argument that shows a statement is true. This chapter covers the main proof methods, induction, and the rules that make an argument valid. These skills are used again in algorithms and program checking.

Proof Techniques: notes

Direct proof

A direct proof of $p \to q$ assumes $p$ is true and uses definitions, known facts and rules of inference to show $q$ is true.

Example. Prove that if $n$ is an even integer, then $n^2$ is even.

Let $n$ be even. Then $n = 2k$ for some integer $k$. So:

$$\begin{aligned} n^2 &= (2k)^2 \ &= 4k^2 \ &= 2(2k^2) \end{aligned}$$

Since $2k^2$ is an integer, $n^2$ is even.

Example. Prove that the sum of two odd integers is even.

Let $a = 2m + 1$ and $b = 2n + 1$. Then:

$$a + b = 2m + 2n + 2 = 2(m + n + 1)$$

This is twice an integer, so $a + b$ is even.

Useful definitions: $n$ is even if $n = 2k$, and odd if $n = 2k + 1$, for some integer $k$. An integer $a$ divides $b$ if $b = ac$ for some integer $c$.

Indirect proof

An indirect proof (proof by contraposition) proves $p \to q$ by proving the equivalent statement $\neg q \to \neg p$. We assume the conclusion is false and show the hypothesis is false.

Example. Prove that if $3n + 2$ is odd, then $n$ is odd.

The contrapositive is: if $n$ is even, then $3n + 2$ is even. Let $n = 2k$. Then:

$$3n + 2 = 6k + 2 = 2(3k + 1)$$

This is even. So the contrapositive is true, and the original statement is true.

Use this method when the conclusion $\neg q$ gives you more to work with than $p$ does.

Proof by contradiction

In a proof by contradiction, we assume the statement is false and reach a result that contradicts a known fact. Then the assumption was wrong, so the statement is true. To prove $p$, show that $\neg p \to (r \land \neg r)$ for some statement $r$.

Example. Prove that $\sqrt{2}$ is irrational.

Assume $\sqrt{2}$ is rational. Then $\sqrt{2} = a/b$ where $a, b$ are integers with no common factor and $b \ne 0$. Squaring:

$$\begin{aligned} 2 &= \frac{a^2}{b^2} \ a^2 &= 2b^2 \end{aligned}$$

So $a^2$ is even, which means $a$ is even. Write $a = 2c$. Then $4c^2 = 2b^2$, so $b^2 = 2c^2$, and $b$ is even too. Now $a$ and $b$ are both even, so they have the common factor 2. This contradicts our choice. Hence $\sqrt{2}$ is irrational.

Example. Prove that there is no largest prime. Assume the primes are $p_1, p_2, \dots, p_k$ only. Let $N = p_1 p_2 \cdots p_k + 1$. No $p_i$ divides $N$ (the remainder is 1). So either $N$ is a new prime or it has a prime factor not in the list. Both contradict the assumption.

What this unit covers

  • Direct proof
  • Indirect proof
  • Proof by contradiction
  • Mathematical induction
  • Structural induction
  • Rules of inference
  • Proving correctness of recursive algorithms

Mathematical induction

2082 · 5 marks

Using mathematical induction prove that sum of first N odd integers is N2N^2N2. [5]

Show solved answer

Proof by Mathematical Induction: Sum of First N Odd Integers = N²

Statement to Prove

$$1 + 3 + 5 + \cdots + (2N-1) = N^2$$


Step 1: Base Case (N = 1)

When N = 1, the first odd integer is 1.

  • LHS = 1
  • RHS = 1² = 1

Since LHS = RHS, the statement holds for N = 1. ✓


Step 2: Inductive Hypothesis

Assume the statement is true for N = k, i.e., assume:

$$1 + 3 + 5 + \cdots + (2k-1) = k^2$$


Step 3: Inductive Step

We must prove the statement is true for N = k + 1, i.e., we must show:

$$1 + 3 + 5 + \cdots + (2k-1) + (2(k+1)-1) = (k+1)^2$$

Starting from the LHS of N = k+1:

$$\underbrace{1 + 3 + 5 + \cdots + (2k-1)}_{\text{sum of first } k \text{ odd integers}} + (2k+1)$$

Applying the Inductive Hypothesis (replacing the underbraced part with k²):

$$= k^2 + (2k + 1)$$

Factoring the right side:

$$= k^2 + 2k + 1$$

$$= (k+1)^2$$

This is exactly the RHS for N = k+1. ✓


Conclusion

  • The base case holds for N = 1.
  • Assuming the statement holds for N = k, we proved it holds for N = k+1.

By the Principle of Mathematical Induction, the statement:

$$\boxed{1 + 3 + 5 + \cdots + (2N-1) = N^2}$$

is true for all positive integers N. $\blacksquare$

Open this answer on its own page →

2081 · 5 marks

Prove that 13+23+33+⋯+n31^3 + 2^3 + 3^3 + \cdots + n^313+23+33+⋯+n3 is a perfect square using mathematical induction. [5]

Show solved answer

Proof by Mathematical Induction

Claim

$$1^3 + 2^3 + 3^3 + \cdots + n^3 = \left[\frac{n(n+1)}{2}\right]^2$$

This is a perfect square for all positive integers $n$.


Step 1: Base Case ($n = 1$)

LHS: $1^3 = 1$

RHS: $\left[\frac{1(1+1)}{2}\right]^2 = \left[\frac{1 \cdot 2}{2}\right]^2 = [1]^2 = 1$

Since LHS $=$ RHS $= 1$, the base case holds. $\checkmark$


Step 2: Inductive Hypothesis

Assume the statement is true for $n = k$, i.e., assume:

$$1^3 + 2^3 + 3^3 + \cdots + k^3 = \left[\frac{k(k+1)}{2}\right]^2$$


Step 3: Inductive Step

We must prove the statement holds for $n = k + 1$, i.e., we must show:

$$1^3 + 2^3 + \cdots + k^3 + (k+1)^3 = \left[\frac{(k+1)(k+2)}{2}\right]^2$$

Starting from the LHS:

$$1^3 + 2^3 + \cdots + k^3 + (k+1)^3$$

Applying the inductive hypothesis:

$$= \left[\frac{k(k+1)}{2}\right]^2 + (k+1)^3$$

$$= \frac{k^2(k+1)^2}{4} + (k+1)^3$$

Factor out $(k+1)^2$:

$$= (k+1)^2 \left[\frac{k^2}{4} + (k+1)\right]$$

$$= (k+1)^2 \left[\frac{k^2 + 4(k+1)}{4}\right]$$

$$= (k+1)^2 \left[\frac{k^2 + 4k + 4}{4}\right]$$

$$= (k+1)^2 \cdot \frac{(k+2)^2}{4}$$

$$= \frac{(k+1)^2(k+2)^2}{4}$$

$$= \left[\frac{(k+1)(k+2)}{2}\right]^2$$

This is exactly the RHS for $n = k+1$. $\checkmark$


Conclusion

By the Principle of Mathematical Induction, the formula holds for all positive integers $n$:

$$\boxed{1^3 + 2^3 + 3^3 + \cdots + n^3 = \left[\frac{n(n+1)}{2}\right]^2}$$

Since $\dfrac{n(n+1)}{2}$ is always a positive integer (as $n(n+1)$ is always even), the sum is always a perfect square. $\blacksquare$

Open this answer on its own page →

2079 · 5 marks

Use mathematical induction to prove that the sum of the first n odd positive integers is n2n^2n2. [5]

Claim: The sum of the first n odd positive integers is n². The first n odd positive integers are: 1, 3, 5, 7, ..., (2n - 1). So we want to prove: $$1 + 3 + 5 + \cdots + (2n-1) = n^2$$ --- Left-hand side (LHS): The first odd positive integer is 1. Right-hand side (RHS): $n^2 = 1^2 = 1$. Since LHS ...

Open this answer on its own page →

2078 · 5 marks

Use mathematical induction to show that the sum of first n positive integers is n(n+1)/2. [5]

$$P(n): 1 + 2 + 3 + \cdots + n = \frac{n(n+1)}{2}$$ for all positive integers $n \geq 1$. --- Left Hand Side (LHS): $$1$$ Right Hand Side (RHS): $$\frac{1(1+1)}{2} = \frac{1 \times 2}{2} = 1$$ Since LHS = RHS = 1, the statement P(1) is true. --- Assume that P(k) is true for some arbitrary positiv...

Open this answer on its own page →

0

Mathematical Induction, Proof, and Recursively Defined Functions

--- Mathematical Induction is a proof technique used to establish that a statement P(n) is true for all positive integers n. It operates on a simple but powerful principle: if a statement holds for a starting value, and whenever it holds for some value k it also holds for k+1, then it must hold f...

Open this answer on its own page →

Proving correctness of recursive algorithms

2082 · 5 marks

Prove the correctness of following recursive algorithm for computing $a^n$ using induction.

Power(a, n)
{
if (n = 0) return 1;
else return a * Power(a, n-1);
}

[5]

Claim: For all integers $n \geq 0$, Power(a, n) correctly returns $a^n$. --- When $n = 0$, the algorithm executes the branch: $$\text{return } 1$$ By definition of exponentiation: $$a^0 = 1 \quad \text{for any } a$$ The algorithm returns $1$, which equals $a^0$. ✓ The base case holds. --- Assume ...

Open this answer on its own page →

Direct proof

2081 · 5 marks

Using direct proof show that the sum of odd and even number is odd. [5]

Before writing the proof, we state the formal definitions: - An integer $n$ is even if $n = 2k$ for some integer $k$. - An integer $n$ is odd if $n = 2k + 1$ for some integer $k$. --- If $a$ is an odd integer and $b$ is an even integer, then $a + b$ is odd. --- Step 1: Assume the hypothesis. Let ...

Open this answer on its own page →

2079 · 5 marks

Show that the sum of two even numbers is even using direct proof. [5]

An integer $n$ is even if there exists an integer $k$ such that: $$n = 2k$$ --- Statement: If $a$ and $b$ are even integers, then $a + b$ is also an even integer. --- Assume that $a$ and $b$ are two even integers. Step 1: By the definition of even numbers, since $a$ is even, there exists an integ...

Open this answer on its own page →

2078 · 10 marks

Explain direct proof, indirect proof, and proof by contradiction. Use direct proof to show that 'If n is an odd integer, then n' is an odd integer'. Also use indirect proof to show that 'If n is an integer and n' then n is odd'.[10]

Show solved answer

Proof Methods: Direct Proof, Indirect Proof, and Proof by Contradiction


A. Definitions of Proof Methods

i. Direct Proof

A direct proof is a method in which we assume the hypothesis p is true and then use logical steps, definitions, axioms, and previously proven theorems to directly establish that the conclusion q is true.

Structure:

Assume p  →  logical reasoning  →  conclude q

We move in a straight forward path from hypothesis to conclusion.


ii. Indirect Proof (Proof by Contrapositive)

An indirect proof proves a statement p → q by instead proving its contrapositive, which is:

$$\neg q \rightarrow \neg p$$

Since p → q is logically equivalent to ¬q → ¬p, proving the contrapositive is sufficient to prove the original statement.

Structure:

Assume ¬q  →  logical reasoning  →  conclude ¬p

iii. Proof by Contradiction

In proof by contradiction (also called Reductio ad Absurdum), we assume the negation of the entire statement we want to prove, i.e., we assume p ∧ ¬q, and then show that this assumption leads to a logical contradiction.

Structure:

Assume p ∧ ¬q  →  derive a contradiction  →  conclude p → q must be true

B. Direct Proof: "If n is an odd integer, then n² is an odd integer"

Statement: If n is odd, then n² is odd.

Proof:

Step 1: Assume n is an odd integer.

Step 2: By the definition of an odd integer: $$n = 2k + 1 \quad \text{for some integer } k$$

Step 3: Compute n²: $$n^2 = (2k + 1)^2 = 4k^2 + 4k + 1$$

Step 4: Factor out 2: $$n^2 = 2(2k^2 + 2k) + 1$$

Step 5: Let m = 2k² + 2k. Since k is an integer, m is also an integer.

Step 6: Therefore: $$n^2 = 2m + 1$$

This is exactly the form of an odd integer (an integer of the form 2m + 1).

Conclusion: Therefore, if n is an odd integer, then n² is an odd integer. $\blacksquare$


C. Indirect Proof: "If n is an integer and n² is odd, then n is odd"

Statement: If n² is odd, then n is odd.

Proof (by Contrapositive):

Step 1: Write the contrapositive of the statement:

Original: If n² is odd, then n is odd.

Contrapositive: If n is not odd (i.e., n is even), then n² is not odd (i.e., n² is even).

Step 2: Assume n is even.

Step 3: By the definition of an even integer: $$n = 2k \quad \text{for some integer } k$$

Step 4: Compute n²: $$n^2 = (2k)^2 = 4k^2 = 2(2k^2)$$

Step 5: Let m = 2k². Since k is an integer, m is also an integer.

Step 6: Therefore: $$n^2 = 2m$$

This is exactly the form of an even integer.

Step 7: So n² is even, which means n² is not odd.

Conclusion: The contrapositive is proven. Since p → q ≡ ¬q → ¬p, the original statement "If n² is odd, then n is odd" is also true. $\blacksquare$


D. Summary Table

MethodWhat We AssumeWhat We ShowBasis
Direct Proofp is trueq is truep → q directly
Indirect Proof¬q is true¬p is true¬q → ¬p (contrapositive)
Proof by Contradictionp ∧ ¬q is trueA contradiction arisesNegation leads to absurdity
Open this answer on its own page →

2080.1 · 5 marks

Using direct proof show that the sum of square of even number is even. [5]

If $n$ is an even number, then $n^2$ is even. --- - An integer $n$ is even if there exists an integer $k$ such that $n = 2k$. - An integer $m$ is even if there exists an integer $j$ such that $m = 2j$. --- Given: $n$ is an even integer. To Prove: $n^2$ is even. --- Step 1: Since $n$ is even, by d...

Open this answer on its own page →

0 · 5 marks

What direct proof? Give a direct proof of the theorem "If n is an odd integer, then n2n^2n2 is an odd integer." [5]

A direct proof is a method of proving a statement of the form "If P, then Q" by assuming P is true and using logical steps, definitions, axioms, and previously proven theorems to show that Q must also be true. It proceeds in a straightforward, linear chain of reasoning from hypothesis to conclusi...

Open this answer on its own page →

Structural induction

2081 · 5 marks

Explain about structural induction and recursive definitions with example. [5]

A recursive definition (also called an inductive definition) defines an object in terms of simpler versions of itself. It consists of two parts: 1. Base Case (Basis Step): Defines the simplest instance(s) of the object explicitly. 2. Recursive/Inductive Step: Defines larger instances in terms of ...

Open this answer on its own page →

Proof by contradiction

2080 · 5 marks

Prove that $2\sqrt{2}$ is irrational number. [5]

  • A rational number is any number that can be expressed as $\frac{p}{q}$, where $p, q \in \mathbb{Z}$ and $q \neq 0$, with $\gcd(p, q) = 1$. - An irrational number is a number that cannot be expressed in such a form. --- Assume, for the sake of contradiction, that $2\sqrt{2}$ is rational. Then, b...
Open this answer on its own page →

Rules of inference

2080.1 · 5 marks

List any five rules of inferences. [5]

Show solved answer

Rules of Inference

Rules of inference are valid argument forms used to derive conclusions from premises in logical reasoning.


Five Rules of Inference

1. Modus Ponens (Law of Detachment)

$$p$$ $$p \rightarrow q$$ $$\therefore q$$

Meaning: If $p$ is true, and $p \rightarrow q$ is true, then $q$ must be true.

Example: "It is raining. If it rains, the ground is wet. Therefore, the ground is wet."


2. Modus Tollens

$$\neg q$$ $$p \rightarrow q$$ $$\therefore \neg p$$

Meaning: If $q$ is false and $p \rightarrow q$ is true, then $p$ must be false.


3. Hypothetical Syllogism

$$p \rightarrow q$$ $$q \rightarrow r$$ $$\therefore p \rightarrow r$$

Meaning: If $p$ implies $q$, and $q$ implies $r$, then $p$ implies $r$ (chain rule).


4. Disjunctive Syllogism

$$p \lor q$$ $$\neg p$$ $$\therefore q$$

Meaning: If at least one of $p$ or $q$ is true, and $p$ is false, then $q$ must be true.


5. Addition (Disjunction Introduction)

$$p$$ $$\therefore p \lor q$$

Meaning: If $p$ is true, then $p \lor q$ is true for any proposition $q$.


Note: Other common rules include Simplification ($p \land q \therefore p$), Conjunction ($p, q \therefore p \land q$), and Resolution. Each rule represents a tautology of the form: (premises) $\rightarrow$ conclusion.

Open this answer on its own page →