Introduction to Proofs Goals 1 Introduce notion of

  • Slides: 15
Download presentation
Introduction to Proofs Goals 1. Introduce notion of proof & basic proof methods. 2.

Introduction to Proofs Goals 1. Introduce notion of proof & basic proof methods. 2. Distinguish between correct & incorrect arguments 3. Understand & construct basic types of proofs.

Introduction • Proof: A valid argument establishing the truth of a mathematical statement. •

Introduction • Proof: A valid argument establishing the truth of a mathematical statement. • In CS, we want to prove – the correctness of an algorithm or program – more generally, a property of an algorithm/data structure, program, or system (e. g. , Java can be parsed efficiently? ) – – AI strategies, automated theorem proving the consistency/feasibility of a specification consequences of a mathematical model of computing. . . Copyright © Peter Cappello 2

Methods for Proving Theorems • A theorem typically is of the form x (

Methods for Proving Theorems • A theorem typically is of the form x ( P( x ) Q( x ) ). • The proof method typically is of the form 1. Let c be an arbitrary element in the domain. 2. Show that P( c ) Q( c ) is true. (The essence. ) 3. Therefore, x ( P( x ) Q( x ) ). Copyright © Peter Cappello 3

Direct Proof of p q 1. Assume that p is true. 2. Show that

Direct Proof of p q 1. Assume that p is true. 2. Show that q is true. Example – Let the domain be the integers. – Prove: x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) Proof: WHAT WHY 1. Let x be an arbitrary integer such that 3 | x – 2. (premise) 2. . 3. Therefore, x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) Copyright © Peter Cappello (Universal Generalization) 4

Direct Proof of p q 1. Assume that p is true. 2. Show that

Direct Proof of p q 1. Assume that p is true. 2. Show that q is true. Example – Let the domain be the integers. – Prove: x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) Proof: WHAT WHY 1. Let x be an arbitrary integer such that 3 | x – 2. (premise) 2. Let integer q = ( x – 2 ) / 3. (from step 1 & definition of “|”) 3. . 4. Therefore, x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) (Universal Generalization) Copyright © Peter Cappello 2011 5

Direct Proof of p q 1. Assume that p is true. 2. Show that

Direct Proof of p q 1. Assume that p is true. 2. Show that q is true. Example – Let the domain be the integers. – Prove: x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) Proof: WHAT WHY 1. Let x be an arbitrary integer such that 3 | x – 2. (premise) 2. Let integer q = ( x – 2 ) / 3. (from step 1 & definition of “|”) 3. x = 3 q + 2. (algebraic manipulation of step 2) 4. . 5. Therefore, x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) (Universal Generalization) Copyright © Peter Cappello 2011 6

Direct Proof of p q 1. Assume that p is true. 2. Show that

Direct Proof of p q 1. Assume that p is true. 2. Show that q is true. Example – Let the domain be the integers. – Prove: x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) Proof: WHAT WHY 1. Let x be an arbitrary integer such that 3 | x – 2. (premise) 2. Let integer q = ( x – 2 ) / 3. (from step 1 & definition of “|”) 3. x = 3 q + 2. (algebraic manipulation of step 2) 4. x 2 = ( 3 q + 2 )2 = 9 q 2 + 12 q + 4 = 3( 3 q 2 + 4 q + 1 ) + 1. 5. . 6. Therefore, x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) (Universal Generalization) Copyright © Peter Cappello 2011 7

Direct Proof of p q 1. Assume that p is true. 2. Show that

Direct Proof of p q 1. Assume that p is true. 2. Show that q is true. Example – Let the domain be the integers. – Prove: x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) Proof: WHAT WHY 1. Let x be an arbitrary integer such that 3 | x – 2. (premise) 2. Let integer q = ( x – 2 ) / 3. (from step 1 & definition of “|”) 3. x = 3 q + 2. (algebraic manipulation of step 2) 4. x 2 = ( 3 q + 2 )2 = 9 q 2 + 12 q + 4 = 3( 3 q 2 + 4 q + 1 ) + 1. 5. x 2 – 1 = 3( 3 q 2 + 4 q + 1 ). (subtract 1 from both sides of step 4) 6. . 7. Therefore, x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) Copyright © Peter Cappello 2011 (Universal Generalization) 8

Direct Proof of p q 1. Assume that p is true. 2. Show that

Direct Proof of p q 1. Assume that p is true. 2. Show that q is true. Example – Let the domain be the integers. – Prove: x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) Proof: WHAT WHY 1. Let x be an arbitrary integer such that 3 | x – 2. (premise) 2. Let integer q = ( x – 2 ) / 3. (from step 1 & definition of “|”) 3. x = 3 q + 2. (algebraic manipulation of step 2) 4. x 2 = ( 3 q + 2 )2 = 9 q 2 + 12 q + 4 = 3( 3 q 2 + 4 q + 1 ) + 1. 5. x 2 – 1 = 3( 3 q 2 + 4 q + 1 ). 6. 3 | x 2 – 1. (subtract 1 from both sides of step 4) (from step 5 & definition of the meaning of “|”) 7. Therefore, x ( ( 3 | x – 2 ) ( 3 | x 2 – 1 ) ) (Universal Generalization) Copyright © Peter Cappello 2011 9

Proof by Contraposition of p q Direct proof of the contrapositive: ~q ~p 1.

Proof by Contraposition of p q Direct proof of the contrapositive: ~q ~p 1. Assume q is false. 2. Show that p is false. Copyright © Peter Cappello 10

Proof by Contraposition of p q Example The domain is the set of integers.

Proof by Contraposition of p q Example The domain is the set of integers. Prove: a b ( (ab is even) (a is even b is even) ) Proof WHAT WHY 1. Let a, b be arbitrary integers. 2. Assume (a is even b is even). 3. a is odd b is odd. (De Morgan’s law) 4. m ( a = 2 m + 1 ) n ( b = 2 n + 1 ). (Defn. of odd. ) 5. ab = (2 m + 1)(2 n + 1) = 4 mn + 2 m + 2 n + 1 = 2(2 mn + m + n) + 1 which is odd. 6. a b ( (ab is even) (a is even b is even) ) (U. G. ) Copyright © Peter Cappello 11

Proof by Contradiction of p q Show p q is true by showing that

Proof by Contradiction of p q Show p q is true by showing that (p q) ≡ (p q) is false: 1. Assume p q. 2. Show that this leads to a contradiction. If you need to show x P( x ) You may assume x P( x ), then show that this leads to a contradiction. Copyright © Peter Cappello 12

Example If 1, 2, …, 10 are placed randomly in a circle then the

Example If 1, 2, …, 10 are placed randomly in a circle then the sum of some 3 adjacent numbers 17. Proof: 1. Place 1, 2, …, 10 randomly in a circle. (Premise) 2. Assume that the sum of no 3 adjacent numbers 17. 3. Then, x 1 + x 2 + x 3 16 (explain with diagram) x 2 + x 3 + x 4 16 x 3 + x 4 + x 5 16 … x 10 + x 1 + x 2 16. 4. Sum the 10 inequalities: 3( x 1 + x 2 +. . . + x 10 ) 16 10 = 160 3(1 + 2 + … + 10) 160 3*55 = 165 160, a contradiction. 5. Our assumption is false: 6. If 1, …, 10 are placed randomly in a circle then the sum of some 3 adjacent numbers 17. Copyright © Peter Cappello 13

Proving p q ≡ (p q) (q p) ≡ (p q) ( p q)

Proving p q ≡ (p q) (q p) ≡ (p q) ( p q) To prove p q it is necessary & sufficient to show either: (p q) (q p), or equivalently (p q) ( p q) Copyright © Peter Cappello 14

Presentation Perhaps the clearest proof presentation: – Give a numbered list of statements, where

Presentation Perhaps the clearest proof presentation: – Give a numbered list of statements, where the last statement is the statement to be proved – For each statement, explain why its truth follows from: • previous statements • premises • previously established mathematical facts or definitions. Copyright © Peter Cappello 15