1 Discrete Structures CS 2800 Prof. Bart Selman Module Logic (part 2 --- proof methods)

Slides:



Advertisements
Similar presentations
Methods of Proof. Methods of Proof The Vicky Pollard Proof Technique Prove that when n is even n2 is even. Assume n is 0, then n2 is 0, and that is.
Advertisements

With examples from Number Theory
Discrete Math Methods of proof 1.
Introduction to Proofs
1 Section 1.5 Rules of Inference. 2 Definitions Theorem: a statement that can be shown to be true Proof: demonstration of truth of theorem –consists of.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
CS 173: Discrete Mathematical Structures Cinda Heeren Rm 2213 Siebel Center Office Hours: M 12:30-2:30p.
Elementary Number Theory and Methods of Proof
The Foundations: Logic and Proofs
Induction and recursion
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
CSE115/ENGR160 Discrete Mathematics 02/07/12
CSE115/ENGR160 Discrete Mathematics 01/31/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/01/11
Discrete Structures CS 2800
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Discrete Structures CS 23022
Fall 2002CMSC Discrete Structures1 Let’s proceed to… Mathematical Reasoning.
CS 2210 (22C:019) Discrete Structures Logic and Proof Spring 2015 Sukumar Ghosh.
Methods of Proof & Proof Strategies
Introduction to Proofs
Introduction to Proofs
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 03: PROOFS Section 1.5 Jarek Rossignac CS1050: Understanding.
MATH 224 – Discrete Mathematics
1 Methods of Proof CS/APMA 202 Epp, chapter 3 Aaron Bloomfield.
Methods of Proof. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical theorems. Direct.
Section 1.8. Section Summary Proof by Cases Existence Proofs Constructive Nonconstructive Disproof by Counterexample Nonexistence Proofs Uniqueness Proofs.
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
Proofs1 Elementary Discrete Mathematics Jim Skon.
CSci 2011 Discrete Mathematics Lecture 6
1 Methods of Proof. 2 Consider (p  (p→q)) → q pqp→q p  (p→q)) (p  (p→q)) → q TTTTT TFFFT FTTFT FFTFT.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
1 Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2011 Suprakash Datta Office: CSEB 3043 Phone: ext
Proofs1 Advanced Discrete Mathematics Jim Skon. Proofs2  Definition: A theorem is a valid logical assertion which can be proved using other theorems.
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
Discrete Structures (DS)
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
CompSci 102 Discrete Math for Computer Science March 1, 2012 Prof. Rodger Slides modified from Rosen.
Chapter 1, Part III: Proofs With Question/Answer Animations 1.
資訊科學數學 7 : Proof, Number and Orders 陳光琦助理教授 (Kuang-Chi Chen)
Module #1 - Logic Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank. Modified By Mingwu Chen 1 Module.
Chapter 1, Part III: Proofs With Question/Answer Animations 1.
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Methods of Proof Lecture 4: Sep 20 (chapter 3 of the book, except 3.5 and 3.8)
Chapter 1, Part III: Proofs With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Chapter 1 Logic and proofs
Chapter 1 Logic and Proof.
The Foundations: Logic and Proofs
CS 2210:0001 Discrete Structures Logic and Proof
CSE15 Discrete Mathematics 02/01/17
Predicate Calculus Validity
Proof Techniques.
Explorations in Artificial Intelligence
Module #10: Proof Strategies
Discrete Structures CSC 281
The Foundations: Logic and Proofs
Mathematical Reasoning
Methods of Proof. Methods of Proof Definitions A theorem is a valid logical assertion which can be proved using Axioms: statements which are given.
Week #6 – 30 September / 2/4 October 2002 Prof. Marie desJardins
Methods of Proof Rosen 1.7, 1.8 Lecture 4: Sept 24, 25.
Information Technology Department SKN-SITS,Lonavala.
Module #10: Proof Strategies
Mathematical Reasoning
Methods of Proof Rosen 1.7, 1.8 Lecture 4: Sept, 2019.
Presentation transcript:

1 Discrete Structures CS 2800 Prof. Bart Selman Module Logic (part proof methods)

2 Methods for Proving Theorems

3 Theorems, proofs, and rules of inference When is a mathematical argument (or “proof”) correct? What techniques can we use to construct a mathematical argument? Theorem – statement that can be shown to be true. Axioms or postulates or premises – statements which are given and assumed to be true. Proof – sequence of statements, a valid argument, to show that a theorem is true. Rules of Inference – rules used in a proof to draw conclusions from assertions known to be true. Note: Lemma is a “pre-theorem” or a result that needs to be proved to prove the theorem; A corollary is a “post-theorem”, a result which follows directly the theorem that has been proved. Conjecture is a statement believed to be true but for which there is not a proof yet. If the conjecture is proved true it becomes a thereom. Fermat’s theorem was a conjecture for a long time.

4 Valid Arguments Recall: An argument is a sequence of propositions. The final proposition is called the conclusion of the argument while the other propositions are called the premises or hypotheses of the argument. An argument is valid whenever the truth of all its premises implies the truth of its conclusion. How to show that q logically follows from the hypotheses (p 1  p 2  …  p n )? Show that (p 1  p 2  …  p n )  q is a tautology One can use the rules of inference to show the validity of an argument. Vacuous proof - if one of the premises is false then (p1  p2  …  pn)  q is vacuously True, since False implies anything. (reminder)

5 Note: Many theorems involve statements for universally quantified variables: e.g. “If x > y, where x and y are positive real numbers, then x 2 > y 2 ” Quite often, when it is clear from the context, theorems are proved without explicitly using the laws of universal instantiation and universal generalization.

6 Methods of Proof 1) Direct Proof 2) Proof by Contraposition 3) Proof by Contradiction 4) Proof of Equivalences 5) Proof by Cases 6) Existence Proofs 7) Counterexamples

7 1) Direct Proof Proof statement : p  q by: Assume p From p derive q.

8 Direct proof --- Example 1 Here’s what you know: Mary is a Math major or a CS major. If Mary does not like discrete math, she is not a CS major. If Mary likes discrete math, she is smart. Mary is not a math major. Can you conclude Mary is smart? M  C  D   C D  S  M ((M  C)  (  D   C)  (D  S)  (  M))  S ? Let M - Mary is a Math major C – Mary is a CS major D – Mary likes discrete math S – Mary is smart Informally, what’s the chain of reasoning?

9 In general, to prove p  q, assume p and show that q follows. ((M  C)  (  D   C)  (D  S)  (  M))  S ?

Reminder: Propositional logic Rules of Inference or Method of Proof Rule of InferenceTautology (Deduction Theorem)Name P  P  Q P  (P  Q) Addition P  Q  P (P  Q)  P Simplification P Q  P  Q [(P)  (Q)]  (P  Q) Conjunction P P  Q  Q [(P)  (P  Q)]  P Modus Ponens  Q P  Q   P [(  Q)  (P  Q)]   P Modus Tollens P  Q Q  R  P  R [(P  Q)  (Q  R)]  (P  R) Hypothetical Syllogism (“chaining”) P  Q  P  Q [(P  Q)  (  P)]  Q Disjunctive syllogism P  Q  P  R  Q  R [(P  Q)  (  P  R)]  (Q  R) Resolution See Table 1, p. 66, Rosen. Subsumes MP

11 1. M  CGiven (premise) 2.  D   CGiven 3. D  SGiven 4.  MGiven DS (disjunctive syllogism; 1,4) MT (modus tollens; 2,5) 5. C 6. D 7. S MP (modus ponens; 3,6) Mary is smart! Example 1 - direct proof QED QED or Q.E.D. --- quod erat demonstrandum “which was to be demonstrated” or “I rest my case”

12 Direct Proof --- Example 2 Theorem: If n is odd integer, then n 2 is odd. Looks plausible, but… How do we proceed? How do we prove this? Start with Definition: An integer 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. Properties: An integer is even or odd; and no integer is both even and odd. (aside: would require proof.)

13 Theorem:  (n) P(n)  Q(n), where P(n) is “n is an odd integer” and Q(n) is “n 2 is odd.” We will show P(n)  Q(n) Example 2: Direct Proof

Theorem: If n is odd integer, then n 2 is odd. Proof: Let P --- “n is odd integer” Q --- “n 2 is odd” we want to show that P  Q Assume P, i.e., n is odd. By definition n = 2k + 1, where k is some integer. Therefore n 2 = (2k + 1) 2 = 4k 2 + 4k + 1 = 2 (2k 2 + 2k ) + 1, which is by definition is an odd number (use k’ = (2k 2 + 2k ) ). QED Proof strategy hint: Go back to definitions of concepts and start by trying direct proof.

15 2) Proof by Contraposition Proof of a statement p  q Use the equivalence to the contrapositive: ¬q  ¬ p So, try: from ¬q derive ¬ p (i.e. via direct proof).

16 Again, p  q   q   p (the contrapositive) So, we can prove the implication p  q by first assuming  q, and showing that  p follows. Example: Prove that if a and b are integers, and a + b ≥ 15, then a ≥ 8 or b ≥ 8. (a + b ≥ 15)  (a ≥ 8) v (b ≥ 8) (Assume  q) Suppose (a < 8)  (b < 8). (Show  p)Then (a ≤ 7)  (b ≤ 7), thus (a + b) ≤ 14, thus (a + b) < 15, thus it’s not the case that (a+b >= 15). Proof by Contraposition: Example 1 QED Proof strategy: Note that negation of conclusion is easier to start with here. Why?

Proof by Contraposition: Example 2 Theorem For n integer, if 3n + 2 is odd, then n is odd. I.e. For n integer, 3n + 2 is odd  n is odd Proof by Contraposition: Let p --- “3n + 2” is odd; q --- “n is odd”; we want to show that p  q The contraposition of our theorem is ¬q  ¬p n is even  3n + 2 is even Now we can use a direct proof Assume ¬q, i.e, n is even therefore n = 2 k for some k Therefore 3 n + 2 = 3 (2k) + 2 = 6 k + 2 = 2 (3k + 1) which is even. QED Again, negation of conclusion is easy to start with. Try direct proof.  Intuitively, why? Start with intuitive understanding!

18 3) Proof by Contradiction (arguably the most celebrated / used proof method) A – We want to prove p. We show that: (1)¬p  F (i.e., ¬p leads to a False statement or contradiction, say r  ¬r) (2) We conclude that ¬p is false since (1) is True, and therefore p is True. B – We want to show p  q (1)Assume the negation of the conclusion, i.e., ¬q (2)Use show that (p  ¬q)  F (i.e., (p  ¬q) leads to a False statement or contradiction) (3) Since ((p  ¬q )  F)  (p  q) (why?) we are done

19 Example: Rainy days make gardens grow. Gardens don’t grow if it is not hot. When it is cold outside, it rains. Prove that it’s hot. Given:R  G  H   G  H  R Show: H (( R  G )  (  H   G )  (  H  R ))  H ? Example 1: Proof by Contradiction Let R – Rainy day G – Garden grows H – It is hot Hmm. We will assume “not Hot” ≡ “Cold”

20 Given:R  G  H   G  H  R Show: H 1. R  GGiven (“if it rains, plants grow”) 2.  H   GGiven (“if it’s cold, plants don’t grow”) 3.  H  R Given (“if it’s cold, it rains”) 4.  H assume the contrary 5. R MP (3,4) 6. G MP (1,5) 7.  G MP (2,4) 8. G   G contradiction! (so, our assumption must be wrong.  H Aside: we assume it’s either Hot or it is not Hot. Called the “law of excluded middle”. In certain complex arguments, it’s not so obvious. (hmm…) This led to “constructive mathematics” and “intuitionistic mathematics”. QED Hmm… “it can’t be cold!”

21 Thm.  2 is irrational. Suppose  2 is rational. Then  2 = a/b for some integers a and b (assume relatively prime; no factor in common).  2 = a/b implies 2 = a 2 /b 2 2b 2 = a 2 a 2 is even, and so a is even (i.e., a = 2k for some k) b 2 = 2k 2 2b 2 = (2k) 2 = 4k 2 b 2 is even, and so b is even (b = 2k’ for some k’) But if a and b are both even, then they are not relatively prime ! Contradition. So,  2 cannot be rational. Q.E.D. Proof by Contradiction: Example 2 Our first interesting math proof! It’s quite clever!! Note: how we again first went to the definition of concepts (“rational”). Makes sense. Definitions provide important premises. In a sense, math is all about “What follows from the definitions!” Aside: A number is rational if it can be written as the ratio of two integers.

22 You’re going to let me get away with that? a 2 is even, and so a is even (i.e., a = 2k for some k)?? So, a really is even. QED contradiction Suppose to the contrary that a is not even. Then a = 2k + 1 for some integer k Then a 2 = (2k + 1)(2k + 1) = 4k^2 + 4k + 1 = 2(2k^2+2k) + 1 = 2k’ + 1 and a 2 is odd.

Theorem: There are infinitely many prime numbers. Proof by contradiction Let P – “There are infinitely many primes” Assume ¬P, i.e., “there is a finite number of primes”, call largest p_r. Let’s define R the product of all the primes, i.e, R = p_1 x p_2 x … x p_r. Consider R + 1 Now, R+1 is either prime or not: –If it’s prime, we have prime larger than p_r. –If it’s not prime, let p* be a prime dividing (R+1). But p* cannot be any of p_1, p_2, … p_r (remainder 1 after division); so, p* not among initial list and thus p* is larger than p_r. This contradicts our assumption that there is a finite set of primes, and therefore such an assumption has to be false which means that there are infinitely many primes. QED Proof by Contradiction: Example 3 See e.g. Also, non-constructive flavor. One of the most famous early proofs. An early intellectual “tour the force”. (Euclid’s proof, ca 300 BC) Clever “trick”. The key to the proof. Obviously?

Can we use construction to generate new primes? Answer: 24 yes and no. Construction leads to new primes not on list but only indirectly. 2 * = = 7 ok! (prime) 2 * 3 *5 + 1 = = 31 ok! 2 * 3 * 5 * = = 211 ok! 2 * 3 * 5 * 7 * = = 2311 ok! 2 * 3 * 5 * 7 * 11 * = 30, = 30,031 not prime!  = 59 * 509 (both not on list!) How do we know? Requires factoring! Believed to be very hard…

25 Theorem“If 3n+2 is odd, then n is odd” Let p = “3n+2 is odd” and q = “n is odd” 1 – Assume p and ¬q i.e., 3n+2 is odd and n is not odd. 2 – Because n is not odd, it is even. 3 – If n is even, n = 2k for some k, and therefore 3n+2 = 3 (2k) + 2 = 2 (3k + 1), which is even. 4 – So, we have a contradiction, 3n+2 is odd and 3n+2 is even. Therefore, we conclude p  q, i.e., “If 3n+2 is odd, then n is odd.” Q.E.D. Proof by Contradiction: Example 4 Compare with earlier proof by “contraposition”. Quite similar idea but slightly different proof strategy.

26 Reminder: Methods of Proof 1) Direct Proof 2) Proof by Contraposition 3) Proof by Contradiction 4) Proof of Equivalences 5) Counterexamples 6) Proof by Cases 7) Existence Proofs

27 4) Proof of Equivalences To prove p  q show that p  q and q  p. The validity of this proof results from the fact that (p  q)  [ (p  q)  (q  p)] is a tautology

28 5) Counterexamples Show that  (x) P(x) is false we need only to find a counterexample.

29 Counterexample: example Show that the following statement is false: “Every day of the week is a weekday” Proof: Saturday and Sunday are weekend days.

30 6) Proof by Cases To show (p 1  p 2  …  p n )  q We use the tautology [(p 1  p 2  …  p n )  q ]  [(p 1  q )  (p 2  q)  …  (p n  q )] A particular case of a proof by cases is an exhaustive proof in which all the cases are considered Note: equivalence via re-writes or consider “when is expression False?”

31 Theorem “If n is an integer, then n 2 ≥ n ” Proof by cases Case 1 n=0 0 2 = 0 Case 2 n > 0, i.e., n >= 1. We get n 2 ≥ n since we can multiply both sides of the inequality by n, which is positive. Case 3 n n because n is negative. So, n 2 ≥ n. Proof by cases: Example Aside: Hmm. Where is disjunction? (p 1  p 2  …  p n )  q

32 7) Existence Proofs Existence Proofs: –Constructive existence proofs Example: “there is a positive integer that is the sum of cubes of positive integers in two different ways” By “brute force”: 1729 = = –Non-constructive existence proofs Example: “  n (integers),  p so that p is prime, and p > n.” Quite subtle in general… We showed it implicitly before. (a corollary from “infinitely many primes”) Uniqueness proofs Involves: Existence proof Show uniqueness

33 Existence Proofs: Example 1  n (integers),  p so that p is prime, and p > n. Proof: Let n be an arbitrary integer, and consider n! + 1. If (n! + 1) is prime, we are done since (n! + 1) > n. But what if (n! + 1) is composite? If (n! + 1) is composite then it has a prime factorization, p 1 p 2 …p n = (n! + 1) NON-CONSTRUCTIVE Consider the smallest p i, and call it p. How small can it be ? Can it be 2? Can it be 3? Can it be 4?Can it be n? So, p > n, and we are done. QED But we don’t know what p is!!

Thm. There exist irrational numbers x and y such that x y is rational. Proof:  2 is irrational (see earlier proof). Consider: z =  2  2 We have two possible cases: 1)z is rational. Then, we’re done (take x =  2 and y =  2 ). or 1)z is irrational. Now, let x = z and y =  2. And consider: x y = (  2  2 )  2 =  2 (  2  2) =  2 2 = 2, which is rational. So, we’re done. Since, either 1) or 2) must be true, it follows that there does exist irrational x and y such that x y is rational. Q.E.D. Existence proof: Example 2 Non-constructive! So… what is it: is  2  2 rational or not?? guess? It’s irrational but requires very different proof… “Start with something you know about rational / irrational numbers. ”

Existence proof: Example 3 From game theory. Consider the game “Chomp”. Two players. Players take turn eating at least one of the remaining cookies. At each turn, the player also eats all cookies to the left and below the cookie he or she selects. The player who is “forced” to eat the poisened cookie loses.  Is there a winning strategy for either player? Poisonous m x n cookies Winning strategy for a player: “A way of making moves” that is guaranteed to lead to a win, no matter what the opponent does. (How big to write down?)

Claim: First player has a winning strategy! Proof. (non-constructive) First, note that the game cannot end in a “draw”. After at most m x n moves, someone must have eaten the last cookie.  Consider the following strategy for the first player: --- Start by eating the cookie in the bottom right corner. Three possible moves --- Now, two possibilities: 1)This is part of a winning strategy for 1st player (and thus player has winning strategy). OR 2)2nd player can now make a move that is part of the winning strategy for the 2nd player. But, if 2) is the case, then 1 st player can follow a winning strategy by on the first move making the move of the second player and following his or her winning strategy! So, again, 1 st player has winning strategy. Q.E.D. This is called a “strategy stealing” argument. Think through carefully to convince yourself! (Actual strategy not known for general boards!) Is first choice of the bottom right cookie essential? If so, why? Corner is “null move”

37 Fallacies Fallacies are incorrect inferences. Some common fallacies: 1.The Fallacy of Affirming the Consequent 2.The Fallacy of Denying the Antecedent 3.Begging the question or circular reasoning

38 The Fallacy of Affirming the Consequent If the butler did it he has blood on his hands. The butler had blood on his hands. Therefore, the butler did it. This argument has the form P  Q Q  P or ((P  Q)  Q)  P which is not a tautology and therefore not a valid rule of inference (try: Q --- True and P --- False)

39 The Fallacy of Denying the Antecedent If the butler is nervous, he did it. The butler is really mellow. Therefore, the butler didn't do it. This argument has the form P  Q ¬P  ¬Q or ((P  Q)  ¬P)  ¬Q which is not a tautology and therefore not a valid rule of inference. (Consider P --- False, and Q --- True.)

40 Begging the question or circular reasoning This occurs when we use the truth of the statement being proved (or something equivalent) in the proof itself. Example: Conjecture: if n 2 is even then n is even. Proof: If n 2 is even then n 2 = 2k for some k. Let n = 2m for some m. Hence, n must be even. Note that the statement n = 2m is introduced without any argument showing it.

41 Final example: Tiling Standard checkerboard. 8x8 = 64 squares A domino Can you use 32 dominos to cover the board? Easily! (many ways!) What about the mutilated checkerboard? Hmm… Use counting? No! Why? Proof uses clever coloring and counting argument. Note: also valid for board and dominos without b&w pattern! (use proof by contradiction) What is the proof based upon? Notoriously hard problem automated theorem prover --- requires “true cleverness” X X 62 squares: 32 black 30 white 31 doms.: 31 black 31 white squares! Do we need the “colors”?

42 Additional Proof Methods Covered in CS2800 Induction Proofs Combinatorial proofs But first we have to cover some basic notions on sets, functions, and counting.