Today's Topics Proof Terminology • Theorem • Axioms, Postulates
Total Page:16
File Type:pdf, Size:1020Kb
Today’s topics Proof Terminology • Proof techniques • Theorem – Indirect, by cases, and direct – Rules of logical inference – A statement that has been proven to be true. – Correct & fallacious proofs • Axioms, postulates, hypotheses, premises – Assumptions (often unproven) defining the • Reading: Section 1.5 structures about which we are reasoning. • Upcoming – Sets and Functions • Rules of inference – Patterns of logically valid deductions from hypotheses to conclusions. CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.1 4.2 More Proof Terminology Inference Rules - General Form • Lemma - A minor theorem used as a stepping- • An Inference Rule is stone to proving a major theorem. – A pattern establishing that if we know that a • Corollary - A minor theorem proved as an easy set of antecedent statements of certain forms consequence of a major theorem. are all true, then we can validly deduce that a • Conjecture - A statement whose truth value has certain related consequent statement is true. not been proven. (A conjecture may be widely believed to be true, regardless.) • antecedent 1 • Theory – The set of all theorems that can be antecedent 2 … proven from a given set of axioms. ! consequent “!” means “therefore” CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.3 4.4 Inference Rules & Implications Some Inference Rules • Each valid logical inference rule • p Rule of Addition corresponds to an implication that is a ! p$q tautology. • p"q Rule of Simplification • antecedent 1 Inference rule • antecedent 1 Inference rule ! p antecedent 2 … ! consequent • p Rule of Conjunction • Corresponding tautology: q p q ((ante. 1) " (ante. 2) " …) # consequent ! p"q CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.5 4.6 Modus Ponens & Tollens Syllogism Inference Rules “the mode of • p Rule of modus ponens affirming” • p#q Rule of hypothetical p#q (a.k.a. law of detachment) q#r syllogism !q !p#r • ¬q • p $ q Rule of disjunctive p#q Rule of modus tollens ¬p syllogism !¬p “the mode of denying” ! q Aristotle CompSci 102 © Michael Frank CompSci 102 © Michael Frank (ca. 384-322 B.C.) 4.7 4.8 Formal Proofs Formal Proof Example • A formal proof of a conclusion C, given • Suppose we have the following premises: “It is not sunny and it is cold.” premises p1, p2,…,pn consists of a sequence “We will swim only if it is sunny.” of steps, each of which applies some “If we do not swim, then we will canoe.” inference rule to premises or previously- “If we canoe, then we will be home early.” proven statements (antecedents) to yield a • Given these premises, prove the theorem “We will be home early” using inference rules. new true statement (the consequent). • A proof demonstrates that if the premises are true, then the conclusion is true. CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.9 4.10 Inference Rules for Quantifiers Common Fallacies • %x P(x) • A fallacy is an inference rule or other proof !P(o) (substitute any specific object o) method that is not logically valid. • P(g) (for g a general element of u.d.) – A fallacy may yield a false conclusion! !%x P(x) • Fallacy of affirming the conclusion: • &x P(x) – “p#q is true, and q is true, so p must be true.” !P(c) (substitute a new constant c) (No, because F#T is true.) • P(o) (substitute any extant object o) • Fallacy of denying the hypothesis: x P(x) !& – “p#q is true, and p is false, so q must be false.” (No, again because F#T is true.) CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.11 4.12 Circular Reasoning A Correct Proof • The fallacy of (explicitly or implicitly) assuming the very We know that n must be either odd or even. statement you are trying to prove in the course of its 2 proof. Example: If n were odd, then n would be odd, since an • Prove that an integer n is even, if n2 is even. odd number times an odd number is always 2 • Attempted proof: “Assume n2 is even. Then n2=2k for an odd number. Since n is even, it is not some integer k. Dividing both sides by n gives n = (2k)/n odd, since no even number is also an odd = 2(k/n). So there is an integer j (namely k/n) such that number. Thus, by modus tollens, n is not odd n=2j. Therefore n is even.” number. Thus, by modus tollens, n is not odd – Circular reasoning is used in this proof. Where? either. Thus, by disjunctive syllogism, n must be even. ! CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.13 4.14 A More Verbose Version Proof Methods for Implications Uses some number theory we haven’t defined yet. Suppose n2 is even !2||n2 ! n2 mod 2 = 0. Of course n mod For proving implications p#q, we have: 2 is either 0 or 1. If it’s 1, then n'1 (mod 2), so n2'1 (mod 2), using the theorem that if a'b (mod m) and c'd (mod m) • Direct proof: Assume p is true, and prove q. 2 then ac'bd (mod m), with a=c=n and b=d=1. Now n '1 • Indirect proof: Assume ¬q, and prove ¬p. (mod 2) implies that n2 mod 2 = 1. So by the hypothetical syllogism rule, (n mod 2 = 1) implies (n2 mod 2 = 1). Since • Vacuous proof: Prove ¬p by itself. we know n2 mod 2 = 0 ( 1, by modus tollens we know that n mod 2 ( 1. So by disjunctive syllogism we have that n mod • Trivial proof: Prove q by itself. 2 = 0 !2|n ! n is even. • Proof by cases: Show p#(a $ b), and (a#q) and (b#q). CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.15 4.16 Direct Proof Example Indirect Proof Example • Definition: An integer n is called odd iff n=2k+1 • Theorem: (For all integers n) for some integer k; n is even iff n=2k for some k. If 3n+2 is odd, then n is odd. • Theorem: Every integer is either odd or even. • Proof: Suppose that the conclusion is false, i.e., that n is – This can be proven from even simpler axioms. even. Then n=2k for some integer k. Then 3n+2 = • Theorem: (For all numbers n) If n is an odd 3(2k)+2 = 6k+2 = 2(3k+1). Thus 3n+2 is even, because it integer, then n2 is an odd integer. equals 2j for integer j = 3k+1. So 3n+2 is not odd. We • Proof: If n is odd, then n = 2k+1 for some have shown that ¬(n is odd)"¬(3n+2 is odd), thus its integer k. Thus, n2 = (2k+1)2 = 4k2 + 4k + 1 = contra-positive (3n+2 is odd) " (n is odd) is also true. # 2(2k2 + 2k) + 1. Therefore n2 is of the form 2j + 1 (with j the integer 2k2 + 2k), thus n2 is odd. # CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.17 4.18 Vacuous Proof Example Trivial Proof Example • Theorem: (For all n) If n is both odd and • Theorem: (For integers n) If n is the sum even, then n2 = n + n. of two prime numbers, then either n is odd • Proof: The statement “n is both odd and or n is even. even” is necessarily false, since no number • Proof: Any integer n is either odd or even. can be both odd and even. So, the theorem So the conclusion of the implication is true is vacuously true. # regardless of the truth of the antecedent. Thus the implication is true trivially. # CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.19 4.20 Proof by Contradiction Proof by Contradiction Example • A method for proving p. 2 • Theorem: 2 is irrational. 1/2 • Assume ¬p, and prove both q and ¬q for – Proof: Assume 2 were rational. This means there are integers i,j with no common divisors some proposition q. (Can be anything!) such that 21/2 = i/j. Squaring both sides, 2 = • Thus ¬p# (q " ¬q) i2/j2, so 2j2 = i2. So i2 is even; thus i is even. Let i=2k. So 2j2 = (2k)2 = 4k2. Dividing both • (q " ¬q) is a trivial contradiction, equal to F sides by 2, j2 = 2k2. Thus j2 is even, so j is • Thus ¬p#F, which is only true if ¬p=F even. But then i and j have a common divisor, namely 2, so we have a contradiction. # • Thus p is true. CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.21 4.22 Review: Proof Methods So Far Proving Existentials • Direct, indirect, vacuous, and trivial proofs • A proof of a statement of the form &x P(x) of statements of the form p#q. is called an existence proof. • Proof by contradiction of any statements. • If the proof demonstrates how to actually find or construct a specific element a such • Next: Constructive and nonconstructive that P(a) is true, then it is a constructive existence proofs. proof. • Otherwise, it is nonconstructive. CompSci 102 © Michael Frank CompSci 102 © Michael Frank 4.23 4.24 Another Constructive Constructive Existence Proof Existence Proof • Theorem: There exists a positive integer n • Theorem: For any integer n>0, there that is the sum of two perfect cubes in two exists a sequence of n consecutive different ways: composite integers. – equal to j3 + k3 and l3 + m3 where j, k, l, m are • Same statement in predicate logic: positive integers, and {j,k} $ {l,m} %n>0 &x %i (1)i)n)#(x+i is composite) • Proof: Consider n = 1729, j = 9, k = 10, • Proof ? l = 1, m = 12.