Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS104:Discrete Structures Chapter 2: Proof Techniques.

Similar presentations


Presentation on theme: "CS104:Discrete Structures Chapter 2: Proof Techniques."— Presentation transcript:

1 CS104:Discrete Structures Chapter 2: Proof Techniques

2 2 Introduction to Proofs (In Book: Chapter 1-sec 1.8)

3 Introduction to Proofs 3 A proof : is a valid argument that establishes the truth of a mathematical statement. There are two types of proofs :  Formal proof : where all steps are supplied and the rules for each step in the argument are given  Informal proof : where more than one rule of inference may be used in each step, where steps may be skipped, where the axioms being assumed and rule of inference used are not explicitly stated.

4 Introduction to Proofs (Cont.) 4  A theorem is a statement that can be shown to be true.  Less important theorems sometimes are called propositions.  (Theorems can also be referred to as facts or results.)  it may be the universal quantification of a conditional statement with one or more premises and a conclusion, or it may be another type of logical statements.  Proof is a valid argument (sequence of statements) that establishes the truth of a theorem. And the statements to be used in proofs include:  Axioms or postulates (statement assumed to be true without proof)  Hypothesis (premises) of the theorem  Previously proven theorems  Rules of inference used to draw conclusions and to move from one step to another o Ex: If x is positive integer then x+1 is positive integer. Axioms Hypothesis Proven theorems New Theorems Rules of inference

5 Introduction to Proofs (Cont.) 5  Lemma is a less important theorem that is helpful in the proof of other results  A corollary is a theorem that can be established directly from a theorem that has been proved.  A conjuncture is a statement that is being proposed to be a true statement, usually on the basis of some partial evidence. When a proof of a conjuncture is found, the conjuncture becomes a theorem

6 Introduction to Proofs (Cont.) 6  Methods of proving theorems:  Direct proofs  Proof by Contraposition  Vacuous Proofs  Trivial Proofs  Proofs by Contradiction  Proof by cases

7 Methods of proving theorems – Direct proofs 7  A direct proof of a conditional statement p  q is constructed when the first step is the assumption that p is true; subsequent steps are constructed using rules of inference, with the final step showing that q must also be true. A direct proof shows that a conditional statement p  q is true by showing that if p is true then q must also be true. In a direct proof, we assume that p is true and use axioms, definitions, and previously proven theorems, together with rules of inference, to show that q must also be true.

8 8  Definition : The integer n is even if there exists an integer k such that n = 2k, and n is odd if there exists an integer k such that n = 2k + 1.  Note that every integer is either even or odd, and no integer is both even and odd.  Two integers have the same parity when both are even or both are odd; they have opposite parity when one is even and the other is odd. Methods of proving theorems – Direct proofs

9 9  Example Give a direct proof of the theorem : “If n is an odd integer, then n 2 is odd.”  Proof: We assume that n is odd. ( hypothesis ) => n = 2k + 1, where k is some integer.( definition of odd number ) => n 2 = (2k+1) 2 = 4k 2 + 4k + 1 = 2(2k 2 +2k)+1 ( By squaring ) Since r = 2k 2 +2k is an integer ( Axiom ) => n 2 = 2r+1 is odd.  Example : Use a direct proof to show that : “If n is an even integer, then n 2 is even.” We can square both sides of the equation n = 2k + 1 to obtain a new equation that expresses n 2

10 Methods of proving theorems – Direct proofs 10  Can we use this methodology to prove theorems of the form ∀ x(P(x) → Q(x)) ? Proofs of theorems of this type that are not direct proofs, that is, that do not start with the premises and end with the conclusion are called indirect proof.  Example Give a direct proof of the theorem : “if m and n are both perfect squares, then nm is also perfect”  Proof: We assume that m and n are both perfect squares : m = s 2 and n = t 2 m.n = s 2. t 2 = (st) 2 m.n is also perfect

11 Methods of proving theorems – Proof by Contrapositio n 11  An extremely useful type of indirect proof is known as proof by contraposition ( p → q equivalent to ¬ q → ¬ p )  Methodology of Proof by Contraposition : It is proving the conditional statement p → q by showing that its contrapositive, ¬ q → ¬ p, is true to prove that p → q ¬ q¬ q ¬ q¬ q Begin with is true as a premise using ( axioms, definitions previously proven theorems with rules of inference ) ¬ p¬ p ¬ p¬ p must be also true It is showing the contrapositive ¬ q → ¬ p is true End with is true

12 12  Example Prove that if n is an integer and 3n + 2 is odd, then n is odd.  Proof: We assume that the conclusion of the conditional statement “if 3n + 2 is odd, then n is odd” is false. => n = 2k, where k is some integer. ( definition of even number ) => 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1)( Substituting 2k for n ) Since r = 3k + 1 is an integer( Axiom ) => 3n + 2 = 2r is even. => We assume that n is even.( hypothesis ) ( definition of even number ) Because the negation of the conclusion of the conditional statement implies that the hypothesis is false, the original conditional statement is true. We have proved the theorem “if 3n + 2 is odd, then n is odd” Methods of proving theorems – Proof by Contrapositio n ( Substituting 2k for n in hypthesis : 3n+2 )

13 13  Example Use an indirect proof to show that “if n 2 is odd then n is odd”  Proof: The contraposition is “if n is not odd then n 2 is not odd ” => n = 2k, where k is some integer.( definition of even number ) => n 2 = (2k) 2 = 4k 2 = 2(2k 2 ) Since r = 2k 2 is an integer( Axiom ) => n 2 = 2r => We Assume that n is not odd i.e., n is even( hypothesis ) ( definition of not odd number ) Methods of proving theorems – Proof by Contrapositio n Thus, if n 2 is odd then n is odd is true

14 14  Example Prove that if n = ab where a and b are positive integers then a   n or b   n  Proof: Let p=“a  n”, q=“b  n” and r=“n=ab” We want to prove that r  p  q => The contraposition is  (p  q )   r (By definition) =>  p   q   r (De Morgan’s law) Now, assume that a  n and b  n (  p   q) => a.b   n.  n = n (by multiplying above twos) => ab  n =>  r which contradicts the statement n = ab Because the negation of the conclusion of the conditional statement implies that the hypothesis is false, the original conditional statement is true. Methods of proving theorems – Proof by Contrapositio n

15 Methods of proving theorems – Vacuous Proofs 15  Vacuous Proofs A conditional statement p  q is TRUE if p is FALSE. If we can show that p is False, then we have a proof, called vacuous proof, of the conditional statement p  q.  Example Show that the proposition P(0) is true, where P(n) is “If n > 1, then n 2 > n” and the domain consists of all integers.  Proof: Note that P(0) is “If 0 > 1, then 0 2 > 0.” We can show P(0) using a vacuous proof. Indeed, the hypothesis 0 > 1 is false. This tells us that P(0) is automatically true.  Example Prove that if he is alive and he is dead then the sun is ice cold  Proof: Since the hypothesis is always false the implication is vacuously true.

16 Methods of proving theorems – Trivial Proofs 16  Trivial Proofs A conditional statement p  q is TRUE if q is True. If we can show that q is True, then we have a proof, called Trivial proof, of the conditional statement p  q.  Example Let P(n) be “If a and b are positive integers with a ≥ b, then a n ≥ b n where the domain consists of all nonnegative integers. Show that P(0) is true.  Proof: The proposition P(0) is “If a ≥ b, then a 0 ≥ b 0.” Because a 0 = b 0 = 1, the conclusion of the conditional statement “If a ≥ b, then a 0 ≥ b 0 ” is true. Hence, this conditional statement, which is P(0), is true  Example Prove that if x=2 then x 2  0 for all real numbers  Proof: Since x 2  0 is true then the implication is trivially true. (we didn’t use the fact x=2)  Example Use a trivial proof to show that if n > 1 then n 2 ≥ n for all integers

17 Methods of proving theorems – Proofs by Contradiction 17  Example Prove that  2 is irrational by giving a proof by contradiction.  Proof: Let p is “  2 is irrational “ To start a proof by contradiction, we suppose that ¬ p is true, "It is not the case that is irrational” Let  p is  2 is rational ( hypothesis )  2 = a/b for some integers a and b (b  0) and a and b have no common factors We can square both sides of the equation  2 = a/b => 2 = a 2 /b 2 Definition: The real number r is rational if there exist integers p and q with q  0 such that r = p/q and p and q have no common factors A real number that is not rational is called irrational

18 Methods of proving theorems – Proofs by Contradiction 18 We have now shown that the assumption of ¬ p leads to the equation √2 = a/b, where  a and b have no common factors,  but both a and b are even ( that is, 2 divides both a and b) That is our assumption of ¬ p leads to the contradiction, ¬ p must be false. That is, the statement p, “ √2 is irrational,” is true. We have proved that √2 is irrational. => 2b 2 = a 2 By the definition of an even integer it follows that a 2 is even, so we can substituting with a = 2c for some integer => 2b 2 = (2c) 2 = 4c 2  b 2 = 2c 2 By the definition of an even integer it follows that b 2 is even, i.e. b is even ( Dividing both sides of this equation by 2 )

19 Methods of proving theorems – Proofs by Contradiction 19  To prove a conditional statement p  q by contradiction we prove that: ( p   q  F is true ) which is equivalent to p  q.  Example Give a proof by contradiction of the theorem : “If 3n + 2 is odd, then n is odd.”  Proof: Suppose that 3n+2 is odd and n is even [p   q] => n = 2r (hypothesis  q, definition of even numbers) =>3n = 6r (multiply both sides by 3) => 3n+2=2+6r (add 2 to both sides) => 3n+2=2(1+3r) => 3n+2=2k (Let k=1+3r) => Thus 3n+2 is even which is false (a contradiction !) Therefore the implication is true.

20 Methods of proving theorems – Proofs of Equivalence 20  Proofs of Equivalence To prove a theorem that is a biconditional statement, that is, a statement of the form p ↔ q, we show that p → q and q → p are both true.  Example Prove the theorem: “If n is an integer, then n is odd if and only if n 2 is odd.” “if n is odd then n 2 is odd” proved in Example 5 “ n 2 is odd then n is odd” proved in Example 7  Therefore, n is even if and only if n 2 is even  Proving equivalence of several propositions: If we want to prove that p1  p2  p3…  pn  Then it is sufficient to prove p1  p2,, p2  p3 … pn  p1

21 Methods of proving theorems – Counterexample 21  Counterexample : To show that a statement of the form ∀ xP(x) is false, we need only find a counterexample, that is, an example x for which P(x) is false.  E.g. Prove that “For all real numbers x 2 > x” is false X=0.5 is a counterexample since 0.5 2 > 0.5 is not true  To show that this statement is false, we look for a counterexample which is 3 because we cannot write 3 as the sum of the squares of two integers. To show this is the case, note that the only perfect squares not exceeding 3 are: (0 2 = 0 & 1 2 = 1), but 3  1+0. Therefore the statement is false  Example Show that the statement: “Every positive integer is the sum of the squares of two integers” is false.

22 Methods of proving theorems – proof by cases 22  Proof by cases : A proof by cases must cover all possible cases that arise in a theorem. Each case may cover an infinite number of instances  Example Prove "if n is an integer then n 2 ≥ n".  Proof: We can prove that n 2 ≥ n for every integer by considering three cases, when n = 0, when n ≥ 1, and when n ≤ -1. Case 1: When n = 0, since 0 2 = 0, 0 2 >= 0. So, n 2 ≥ n is true. Case 2: When n ≥ 1, From n ≥ 1, we get n 2 ≥ n (by multiplying with n). Case 3: When n ≤ -1, since n is negative, n 2 is positive, so n 2 ≥ n. Hence, if n is an integer then n 2 ≥ n.

23 Methods of proving theorems – proof by cases 23  Example Use a proof by cases to prove that |xy| = |x||y|, where x and y real numbers. Hint: Consider all 4 cases: x and y positive or negative

24 Mistakes in Proofs 24  There are many common errors made in constructing mathematical and the most common errors are mistakes in arithmetic and basic algebra.  Each step of a mathematical proof needs to be correct and the conclusion needs to follow logically from the steps that precede it. Be careful! Many mistakes result from the introduction of steps that do not logically follow from those that precede it

25 Mistakes in Proofs 25  Example What is wrong with this famous supposed “proof” that 1 = 2 ?  Proof: Suppose a and b are two equal positive integers. Steps : 1. a = b 2. a 2 = ab 3. a 2 - b 2 = ab - b 2 4. (a − b)(a + b) = b(a − b) 5. a + b = b 6. 2b = b 7. 2 = 1 Reason ( Given) (Multiply both sides of (1) by a) (Subtract b2 from both sides of (2)) (Factor both sides of (3)) (Divide both sides of (4) by a − b ) (Replace a by b in (5) because a = b & simplify) (Divide both sides of (6) by b)  Can you find the error  The error is that a − b equals zero; division of both sides of an equation by the same quantity is valid as long as this quantity is not zero. Every step is valid except for one, step 5 where we divided both sides by a − b

26 Mistakes in Proofs 26  Example What is wrong with this “proof” ? “Theorem:” If n 2 is positive, then n is positive.  Proof: Suppose that n 2 is positive. Because the conditional statement : “If n is positive, then n 2 is positive” is true, we can conclude that n is positive. Then our hypothesis is Q(n). (1)  Solution : Let P(n) be “n is positive” and Q(n) be “n 2 is positive.” This statement “If n is positive, then n 2 is positive” is the statement: ∀ n(P (n) → Q(n)). (2) From the hypothesis (1) and the statement (2): We cannot conclude P(n) because we are not using a valid rule of inference. Instead, we can prove that by using counterexample A counterexample supplied by n = −1 for which n 2 = 1 is positive, but n is negative.

27 End of Chapter 2


Download ppt "CS104:Discrete Structures Chapter 2: Proof Techniques."

Similar presentations


Ads by Google