1 / 44

Logic and Proofs: section 1.4-1.6

Logic and Proofs: section 1.4-1.6. Basic Proof Methods I Basic Proof Methods II Proofs Involving Quantifiers. Modus Ponens. Consider (p  (p→q)) → q. Example : Assume you are given the following two statements: “you are in this class” “if you are in this class, you will get a grade”

Download Presentation

Logic and Proofs: section 1.4-1.6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Logic and Proofs: section 1.4-1.6 Basic Proof Methods I Basic Proof Methods II Proofs Involving Quantifiers

  2. Modus Ponens • Consider (p  (p→q)) → q Example: Assume you are given the following two statements: “you are in this class” “if you are in this class, you will get a grade” Let p = “you are in this class” Let q = “you will get a grade” By Modus Ponens, you can conclude that you will get a grade

  3. Modus Tollens Assume that we know: ¬q and p → q We can conclude ¬p • Example: Assume you are given the following two statements: • “you will not get a grade” • “if you are in this class, you will get a grade” • Let p = “you are in this class” • Let q = “you will get a grade” • By Modus Tollens, you can conclude that you are not in this class

  4. Addition & Simplification • Addition: If you know that p is true, then p  q will ALWAYS be true • Simplification: If p  q is true, then p will ALWAYS be true

  5. Example of proof • “It is not sunny this afternoon and it is colder than yesterday” • “We will go swimming only if it is sunny” • “If we do not go swimming, then we will take a canoe trip” • “If we take a canoe trip, then we will be home by sunset” • Does this imply that “we will be home by sunset”? ¬p q r → p ¬r → s s → t t p q r s t

  6. Example of proof • ¬p  q 1st hypothesis • ¬p Simplification using step 1 • r → p 2nd hypothesis • ¬r Modus tollens using steps 2 & 3 • ¬r → s 3rd hypothesis • s Modus ponens using steps 4 & 5 • s → t 4th hypothesis • t Modus ponens using steps 6 & 7

  7. More rules of inference • Conjunction: if p and q are true separately, then pq is true • Disjunctive: If pq is true, and p is false, then q must be true • Resolution: If pq is true, and ¬pr is true, then qr must be true • Conditional Transitivity: If p→q is true, and q→r is true, then p→r must be true

  8. Example of proof • “If it does not rain or if it is not foggy, then the sailing race will be held and the lifesaving demonstration will go on” • “If the sailing race is held, then the trophy will be awarded” • “The trophy was not awarded” Can you conclude: “It rained”? (¬r  ¬f) → (s  l) s → t ¬t r

  9. Example of proof • ¬t 3rd hypothesis • s → t 2nd hypothesis • ¬s Modus tollens using steps 2 & 3 • (¬r¬f)→(sl) 1st hypothesis • ¬(sl)→¬(¬r¬f) Contrapositive of step 4 • (¬s¬l)→(rf) DeMorgan’s law and double negation law • ¬s¬l Addition from step 3 • rf Modus ponens using steps 6 & 7 • r Simplification using step 8

  10. Direct proofs (If p then q): p→q • Example: Show that the square of an even number is an even number (i.e. if n is even, then n2 is even) • Proof: Assume n is even • Thus, n = 2k, for some k (definition of even numbers) • But, n2 = (2k)2 = 4k2 = 2(2k2) • As n2 is 2 times an integer, n2 is thus even

  11. Indirect proofs To show: p→q, instead show the contra positive ¬q→¬p Example: If n2 is an odd integer then n is an odd integer Proof: by contrapositive, we need to show: If n is an even integer, then n2 is an even integer Since n is even n=2k for some integer k (definition of even numbers) n2 = (2k)2 = 4k2 = 2(2k2) Since n2 is 2 times an integer, it is even

  12. Problem Solving Strategy When do you use a direct proof versus an indirect proof? - If it’s not clear from the problem, try direct first, then indirect second - If indirect fails, try the other proofs

  13. Example • Problem: • Prove that if n is an integer and n3+5 is odd, then n is even • Via direct proof • n3+5 = 2k+1 for some integer k (definition of odd numbers) • n3 = 2k-4 • Then what … • So direct proof didn’t work out. Next up: indirect proof

  14. Example (cont.) • Problem: • Prove that if n is an integer and n3+5 is odd, then n is even • Via indirect proof (Contrapositive) • Need to show: If n is odd, then n3+5 is even • Assume n is odd, and show that n3+5 is even • n=2k+1 for some integer k (definition of odd numbers) • n3+5 = (2k+1)3+5 = 8k3+12k2+6k+6 = 2(4k3+6k2+3k+3) • As 2(4k3+6k2+3k+3) is 2 times an integer, it is even

  15. Proof by contradiction • Given a statement of the form p→q Just consider the case where p is true and q is false then arrive to a contradiction . • Example: Prove that if n is an integer and n3+5 is odd, then n is even • Rephrased: If n3+5 is odd, then n is even • Proof: Assume p is true and q is false. • Assume n3+5 is odd, and n is odd). • Since n is odd, n=2k+1 for some integer k (definition of odd numbers) • But, n3+5 = (2k+1)3+5 = 8k3+12k2+6k+6 = 2(4k3+6k2+3k+3) • As 2(4k3+6k2+3k+3) is 2 times an integer, it must be even • Contradiction!

  16. Short Cut 1 Consider an implication: p→q If it can be shown that p is false, then the implication is always true (by definition of an implication) Example: Consider the statement: All criminology majors in Math 3313 are female (i.e. If you are a criminology major and you are in Math 3313, then you are female) Proof: Since there are no criminology majors in this class, the antecedent is false, and the implication is true

  17. Short Cut 2 Consider an implication: p→q If it can be shown that q is true, then the implication is always true by definition of an implication • Example: Consider the statement: • If you are tall and are in Math 3313 then you are a student • Proof: Since all people in Math 3313 are students, the implication is true regardless

  18. Proof by cases Show a statement is true by showing all possible cases are true You are showing

  19. Proof by Cases Example • Prove that • Note that b ≠ 0 • Cases: • Case 1: a ≥ 0 and b > 0 • Then |a| = a, |b| = b, and • Case 2: a ≥ 0 and b < 0 • Then |a| = a, |b| = -b, and • Case 3: a < 0 and b > 0 • Then |a| = -a, |b| = b, and • Case 4: a < 0 and b < 0 • Then |a| = -a, |b| = -b, and

  20. Proofs of equivalences • This is showing the definition of a bi-conditional • Given a statement of the form “p if and only if q” • Show it is true by showing (p→q)(q→p) is true

  21. Proofs of equivalence example Problem: • Show that m2=n2 if and only if m=n or m=-n (i.e. (m2=n2) ↔ [(m=n)(m=-n)] ) Proof: Need to prove two parts: • [(m=n)(m=-n)] → (m2=n2) • Proof by cases! • Case 1: (m=n)→ (m2=n2) • (m)2 = m2, and (n)2 = n2, so this case is proven • Case 2: (m=-n) → (m2=n2) • (m)2 = m2, and (-n)2 = n2, so this case is proven • (m2=n2) → [(m=n)(m=-n)] • Subtract n2 from both sides to get m2-n2=0 • Factor to get (m+n)(m-n) = 0 • Since that equals zero, one of the factors must be zero • Thus, either m+n=0 (which means m=n) • Or m-n=0 (which means m=-n)

  22. Uniqueness proofs • A theorem may state that only one such value exists • To prove this, you need to show: • Existence: that such a value does indeed exist • Either via a constructive or non-constructive existence proof • Uniqueness: that there is only one such value

  23. Uniqueness proof example • If the real number equation 5x+3=b has a solution then it is unique • Existence • We can manipulate 5x+3=b to yield x=(b-3)/5 • Uniqueness • If there are two such numbers, then they would fulfill the following: b = 5x+3 = 5y+3 • We can manipulate this to yield that x = y • Thus, the one solution is unique!

  24. Counterexamples DISPROVING a UNIVERSAL statement by a counterexample Example: Every positive integer is the square of another integer Proof: The square root of 5 is 2.236, which is not an integer

  25. Inference Rules for Quantifiers Universal instantiation • xP(x)P(o) (substitute any object o) • P(g) (for g a general element of universe.)xP(x) • xP(x)P(c) (substitute a newconstantc) • P(o) (substitute any extant object o)xP(x) Universal generalization Existential instantiation Existential generalization

  26. Example “Everyone in this foundation math class has taken a course in computer science” and “Marla is a student in this class” imply “Marla has taken a course in computer science” F(x): “x is in foundation math class” C(x): “x has taken a course in computer science” x (F(x)  C(x)) F(Marla)  C(Marla)

  27. Example – cont. StepProved by1. x (F(x)  C(x)) Premise #1.2. F(Marla)  C(Marla)Univ. instantiation.3. F(Marla)Premise #2.4. C(Marla) Modus ponens on 2,3.

  28. Another Example “A student in this class has not read the book” and “Everyone in this class passed the first exam” imply “Someone who passed the first exam has not read the book” C(x): “x is in this class” B(x): “x has read the book” P(x): “x passed the first exam” x(C(x) B(x)) x (C(x)  P(x))  x(P(x) B(x))

  29. Another Example – cont. StepProved by1. x(C(x) B(x)) Premise #1.2. C(a)  B(a) Exist. instantiation.3. C(a)Simplification on 2.4. x (C(x)  P(x)) Premise #2.5. C(a)  P(a) Univ. instantiation. 6. P(a) Modus ponens on 3,5 7. B(a) Simplification on 2 8. P(a)  B(a) Conjunction on 6,7 9. x(P(x) B(x)) Exist. generalization

  30. Proof Methods • Proving pq • Direct proof: Assume p is true, and prove q. • Indirect proof: Assume q, and prove p. • Trivial proof: Prove q true. • Vacuous proof: Prove p is true. • Proving p • Proof by contradiction: Prove p (r  r) (r  ris a contradiction); therefore p must be false. • Prove (a  b)  p • Proof by cases: prove (a p) and (b p). • More …

  31. Proving Existentials • A proof of a statement of the form xP(x) is called an existence proof. • If the proof demonstrates how to actually find or construct a specific element a such that P(a) is true, then it is called a constructive proof. • Otherwise, it is called a non-constructive proof.

  32. Constructive Existence Proof • Theorem: There exists a positive integer n that is the sum of two perfect cubes in two different ways: • equal to j3 + k3 and l3 + m3 where j, k, l, m are positive integers, and {j,k} ≠ {l,m} • Proof: Consider n = 1729, j = 9, k = 10, l = 1, m = 12. Now just check that the equalities hold.

  33. Non-constructive Existence Proof • Theorem:“There are infinitely many prime numbers.” • Any finite set of numbers must contain a maximal element, so we can prove the theorem if we can just show that there is no largest prime number. • i.e., show that for any prime number, there is a larger number that is also prime. • More generally: For any number,  a larger prime. • Formally: Show n p>n : p is prime.

  34. Limits on Proofs • Some very simple statements of number theory haven’t been proved or disproved! • E.g. Goldbach’s conjecture: Every integer n≥2 is exactly the average of some two primes. • n≥2  primes p,q: n=(p+q)/2. • There are true statements of number theory (or any sufficiently powerful system) that can never be proved (or disproved) (Gödel).

  35. Rules of inference for the universal quantifier • Assume that we know that x P(x) is true • Then we can conclude that P(c) is true • Here c stands for some specific constant • This is called “universal instantiation” • Assume that we know that P(c) is true for any value of c • Then we can conclude that x P(x) is true • This is called “universal generalization”

  36. Existence Proofs • Given a statement: x P(x) • We only have to show that a P(c) exists for some value of c • Two types: • Constructive: Find a specific value of c for which P(c) exists • Nonconstructive: Show that such a c exists, but don’t actually find it • Assume it does not exist, and show a contradiction

  37. Constructive Existence Proof Example • Show that a square exists that is the sum of two other squares • Proof: 32 + 42 = 52 • Show that a cube exists that is the sum of three other cubes • Proof: 33 + 43 + 53 = 63

  38. Non-constructive Existence Proof Example • Problem: Prove that either 2*10500+15 or 2*10500+16 is not a perfect square • A perfect square is a square of an integer • Rephrased: Show that a non-perfect square exists in the set {2*10500+15, 2*10500+16} • Proof: The only two perfect squares that differ by 1 are 0 and 1 • Thus, any other numbers that differ by 1 cannot both be perfect squares • Thus, a non-perfect square must exist in any set that contains two numbers that differ by 1 • Note that we didn’t specify which one it was!

  39. Rules of inference for the existential quantifier • Assume that we know that x P(x) is true • Then we can conclude that P(c) is true for some value of c • This is called “existential instantiation” • Assume that we know that P(c) is true for some value of c • Then we can conclude that x P(x) is true • This is called “existential generalization”

  40. Example of proof • Given the hypotheses: • “Linda, a student in this class, owns a red convertible.” • “Everybody who owns a red convertible has gotten at least one speeding ticket” • Can you conclude: “Somebody in this class has gotten a speeding ticket”? C(Linda) R(Linda) x (R(x)→T(x)) x (C(x)T(x))

  41. Example of proof • x (R(x)→T(x)) 3rd hypothesis • R(Linda) → T(Linda) Universal instantiation using step 1 • R(Linda) 2nd hypothesis • T(Linda) Modes ponens using steps 2 & 3 • C(Linda) 1st hypothesis • C(Linda)  T(Linda) Conjunction using steps 4 & 5 • x (C(x)T(x)) Existential generalization using step 6 Thus, we have shown that “Somebody in this class has gotten a speeding ticket”

  42. Example of proof • Given the hypotheses: • “There is someone in this class who has been to France” • “Everyone who goes to France visits the Louvre” • Can you conclude: “Someone in this class has visited the Louvre”? x (C(x)F(x)) x (F(x)→L(x)) x (C(x)L(x))

  43. Example of proof • x (C(x)F(x)) 1st hypothesis • C(y)  F(y) Existential instantiation using step 1 • F(y) Simplification using step 2 • C(y) Simplification using step 2 • x (F(x)→L(x)) 2nd hypothesis • F(y) → L(y) Universal instantiation using step 5 • L(y) Modus ponens using steps 3 & 6 • C(y)  L(y) Conjunction using steps 4 & 7 • x (C(x)L(x)) Existential generalization using step 8 Thus, we have shown that “Someone in this class has visited the Louvre”

  44. How do you know which one to use? • Experience! • In general, use quantifiers with statements like “for all” or “there exists”

More Related