snick Learning Goals: In-Class snack By the end of this unit, you should be able to: – Devise and attempt multiple different, appropriate CPSC 121: Models of Computation proof strategies — including all those listed in the “pre - class” learning goals plus use of logical 2016W2 equivalences, rules of inference, universal modus ponens/tollens, and predicate logic premises — for Proof Techniques a given theorem. (Part B) – For theorems requiring only simple insights beyond strategic choices or for which the insight Steve Wolfman, based on notes by is given/hinted, additionally prove the theorem. Patrice Belleville and others 1 2 Outline Using Logical Equivalences • More Proof Strategies Every logical equivalence that we’ve learned applies to predicate logic statements. – Using Logical Equivalences For example, to prove ~ x D, P(x), you – Using Predicate Logic Premises can prove x D, ~P(x) and then convert – Proof by contradiction it back with generalized De Morgan’s. • Strategies Summary To prove x D, P(x) Q(x), you can • Problems and Discussion prove x D, ~Q(x) ~P(x) and convert • Next Lecture Notes it back using the contrapositive rule. In other words, Epp’s “proof by contrapositive” is 3 4 direct proof after applying a logical equivalence rule. Worked Problem : Worked Problem : Even Squares Even Squares Theorem: If the square of an integer n is even, Theorem: If the square of an integer n is even, then n is even. then n is even. Problem : prove the theorem. Approach: (1) Prove the contrapostive: If an integer n is This is a tricky problem, unless you try some odd, then its square is also odd. different approaches. (2) Transform the result back into our An approach that may work with conditional theorem. statements is to try the contrapositive (which is logically equivalent to the original conditional). We now focus on proving the contrapositive. 5 6 1
Worked Problem : Worked Problem : Even Squares (part 1) Even Squares (part 2) We know 2k 2 + 2k is an integer (since k is Theorem : If an integer n is odd, then its square is also odd. an integer and multiplication and addition are “closed over the integers”). n 2 is 2q+1 for some integer q ; so, n 2 is odd. Proof : Without loss of generality, let n be an integer. Assume n is odd. Thus, if an integer n is odd, its square is odd. We know (from Epp’s definition of “odd”) that The contrapositive of this statement is also n = 2k + 1 for some integer k . true: if the square of an integer n is even, n 2 = (2k + 1) 2 then n is even. = 4k 2 + 4k + 1 QED = 2(2k 2 + 2k) + 1 7 8 Using Predicate Logic Outline Premises: Universals • More Proof Strategies What can you say if you know (rather than needing to prove) x D, P(x)? – Using Logical Equivalences If you know x D, P(x): – Using Predicate Logic Premises You can say P(d) is true for any particular d in D – Proof by contradiction of your choice, for an arbitrary d, or for every d. • Strategies Summary • Problems and Discussion • Next Lecture Notes 9 10 This is basically the opposite of how we go about proving a universal. Using Predicate Logic Using Predicate Logic Premises Premises: Existentials What can you say if you know (rather than needing What can you say if you know (rather than needing to prove) y D, Q(y)? to prove) x D, P(x) or y D, Q(y)? If you know y D, Q(y): If you know x D, P(x), you can say for any d in Do you know Q(d) is true for every d in D? D that P(d) is true. You can say P(d) is true for Do you know Q(d) is true for a particular d of any particular d in D or for an arbitrary one. your choice? If you know y D, Q(y), you can say that for some d in D, Q(d) is true, but you don’t know What do you know? which one. So, assume nothing more about d than that it’s from D. 11 12 This is basically the opposite of how we go about proving a existential. This is basically the opposite of how we go about proving the statements. 2
Problem: Anti-Symmetric How Shall We Start Our Strategy? Generally Faster? Let an algorithm be “generally faster” than another a. Witness algorithm exactly when it’s faster for all problem b. Inequality proof sizes n greater than some minimum i . c. Antecedent assumption Assume that if one algorithm is faster than another algorithm for any particular n , then the other d. WLOG algorithm is not faster than the first algorithm for e. I have no idea that n . Problem: Prove that if one algorithm is generally Theorem reminder: If one algorithm is generally faster than another, then the other is not faster than another, then the other is not generally generally faster than the first. faster than the first. 13 14 Problem: Anti-Symmetric Problem: Anti-Symmetric Generally Faster? Generally Faster? WLOG, let a and b be algorithms. Theorem: If one algorithm is generally faster than another, then the other is not generally faster than the Assume a is generally faster than b . first. Based on the definition of generally faster, then: WLOG, let a and b be algorithms. there is an i such that a is faster than b for all n > i . Assume a is generally faster than b . We now need to prove that b is not generally faster than a , that is that there is no i 2 such that b is faster than a Based on the definition of generally faster, then: there is an i such that a is faster than b for all n > i . for all n 2 > i 2 . We now need to prove that b is not generally faster than Instead, we’ll prove the equivalent statement that for all a , that is that there is no i 2 such that b is faster than a i 2 , there is an n 2 > i 2 such that b is not faster than a for all n 2 > i 2 . for problem size n 2 . Should we prove the negation or try something else? 15 16 I renamed the variables so I wouldn’t get confused! Problem: Anti-Symmetric How Shall We Continue? Generally Faster? a. Witness Continuing: WLOG, let i 2 be a positive integer. b. Inequality proof Let n 2 = ?? . (NOTE FOR LATER, better be > i 2 !) c. Antecedent assumption We now need to prove that b is not faster than a for problem size n 2 . d. WLOG e. I have no idea Does our assumption that a is generally faster than b help? Under what conditions? It’s common in scratch work to build up “NOTES 17 18 FOR LATER” and handle them at the end. 3
Problem: Anti-Symmetric Crucial Steps and Generally Faster? Where They Came From?? Finishing the proof: (NOTE FOR LATER, n 2 better be > i as well!) Based on our assumption and since n 2 > i , a is faster than b for problem size n 2 . Based on our initial assumption about “faster”, we know that since a is faster than b for problem size n 2 , b is not faster than a for problem size n 2 . QED! (Note: we assumed nothing about i (the existential) but that it’s a positive integer, but we 19 20 picked n (the universal) to be whatever we want!) A New Proof Strategy Outline “Proof by Contradiction” • More Proof Strategies To prove p: – Using Logical Equivalences Assume ~p. – Using Predicate Logic Premises Derive a contradiction. – Proof by contradiction • Strategies Summary You have then shown that there was • Problems and Discussion something wrong (impossible) about • Next Lecture Notes assuming ~p; so, p must be true. Can you use this in predicate logic proofs? 21 Of course you can, just like every other prop logic technique! 22 Side Note: Example in Dialogue: Prove that Achilles is not Omnipotent Really a New Proof Strategy? “Assume ~p and derive a contradiction” is Achilles: I am omnipotent you know. the same “assume ~p and prove F”. Tortoise: Can you lift a mountain with your mind, no matter how big? That’s antecedent assumption! Achilles: Of course! What have we proven? ~p F Tortoise: Can you make a mountain out of nothing, What’s that logically equivalent to? no matter how big? Achilles: Certainly! Tortoise: Can you make a mountain so big that even you cannot lift it? Achilles: See if I invite you over for dinner again. I stole the characters from Gödel, Escher, Bach. 23 24 I stole the story from some sci-fi novel. 4
Recommend
More recommend