550 likes | 1.05k Views
Methods of proof. Section 1.6 & 1.7. 1. Proof Methods. 2. How are these questions related?. Does p logically imply c ? Is the proposition ( p c ) a tautology? Is the proposition ( ¬ p c ) is a tautology? Is the proposition (¬ c ¬ p ) is a tautology?
E N D
Methods of proof Section 1.6 & 1.7 MSU/CSE 260 Fall 2009 1
Proof Methods 2 MSU/CSE 260 Fall 2009
How are these questions related? • Doesplogically implyc ? • Is the proposition(p c) a tautology? • Is the proposition (¬p c) is a tautology? • Is the proposition (¬ c ¬p)is a tautology? • Is the proposition (p ¬c) is a contradiction? 3 MSU/CSE 260 Fall 2009
Proof Methodsh1 h2 …hn c ? • Let p=h1 h2 …hn . The following propositions are equivalent: • p c • (p c) is a tautology. Direct • (¬p c) is a tautology. Direct • (¬ c ¬p)is a tautology. Contrapositive • (p ¬c) is a contradiction. Contradiction 4 MSU/CSE 260 Fall 2009
Formal Proofs • A proof is equivalent to establishing a logical implication chain • Given premises (hypotheses) h1 ,h2 ,…,hnand conclusion c, to give a formal proof that the hypotheses imply the conclusion, entails establishing h1 h2 …hn c MSU/CSE 260 Fall 2009
Formal Proof p1 Premise p2 Tautology . . prk, k’, Inf. Rule . . . pn _____ c • To prove:h1 h2 …hn c • Produce a series of wffs, p1 ,p2 ,…pn,c such that each wff pris: • one of the premises or • a tautology, or • an axiom/law of the domain (e.g., 1+3=4 or x > x+1 ) • justified by definition, or • logically equivalent to or implied by one or more propositions pk where1 ≤k < r. 6 MSU/CSE 260 Fall 2009
Example • Prove the theorem: “If integer n is odd, then n2 is odd.” • Informal proof: • It is given that n is an odd integer. • Thus n = 2k + 1, for some integer k. • Thus n2 = (2k + 1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1 • Therefore, n2 is odd. 7 MSU/CSE 260 Fall 2009
Example Prove the theorem: “If integer n is odd, then n2 is odd.” Formal Proof: h c 1. n is odd Premise (h) 2. k (n = 2k + 1) Definition of “odd” (Universe is Integers) 3. n = 2c + 1, for some integer c Step 2, specialization 4. (n = 2c + 1) (n2 = (2c + 1)2) Laws of arithmetic 5. n2 = (2c + 1)2 Steps 3 & 4, modus ponens = 4c2 + 4c + 1 Laws of arithmetic = 2(2c2 + 2c) + 1 Laws of arithmetic 6. k (n2 = 2k + 1) Step 5, generalization 7. n2 is odd Definition of “odd” 8 MSU/CSE 260 Fall 2009
Formal Proofs….. • Example: Given: p q,q r,p. Prove: r We want to establish the logical implication: (p q)(q r)pr. • We can use either of the following approaches • Truth Table • A chain of logical implications • Note that if AB and BC then AC 9 MSU/CSE 260 Fall 2009
Does (p q) (q r)pr ?Truth Table Method 10 MSU/CSE 260 Fall 2009
Does (p q) (q r)pr ?Chain Method • h1 =p q,h2 = q r,h3 = p, c = r We want to prove thath1 h2 h3c • p Premise • p q Premise • q Steps 1 & 2, modus ponens* • q r Premise • r Steps 3&4, modus ponens *See Table 1, page 66 11 MSU/CSE 260 Fall 2009
Example • Prove: If 2 is even and if 3 is even and if the sum of any two even integers is even, then all integers greater than 1 and less than 6 are even. • 2 is even Premise • 2. 3 is even Premise • 3. n m ((n is even) (n is even) (n+m is even)) Premise • 4. (2 is even) (2 is even) (4 is even) Specialization (twice), step 3, math • 5. (3 is even) (2 is even) (5 is even) Specialization (twice), step 3, math • 6. 4 is even Conj. & modus ponens, steps 1&4 • 7. 5 is even Conj. & modus ponens, steps 1,2,&5 • 8. (2 is even) (3 is even) (4 is even) (5 is even) Conj.(many times), steps 1,2,6&7 So this is a bona fide theorem – the statement is true! 12 MSU/CSE 260 Fall 2009
Proving conclusions of the form p q • Direct: Assume p, in addition to the given hypotheses, and conclude q. • Contrapositive:Assume q, in addition to the given hypotheses, and conclude p. • Contradiction: Assume both p and q, in addition to the given hypotheses, and conclude False. • Vacuous: Assume the given hypotheses, and conclude p. • Trivial: Assume the given hypotheses, and conclude q. MSU/CSE 260 Fall 2009
Example: Direct proof • Prove hypothetical syllogism. • Prove: (p q)(q s) (p s) • p Assumption • p q Premise • q 1, 2, modus ponens • q s Premise • s 3, 4, modus ponens • p s 1, 5, direct method of proof MSU/CSE 260 Fall 2009
Example: Contrapositive proof Prove hypothetical syllogism. Prove: (p q)(q s) (p s) • s Assumption • q s Premise • q 1, 2, modus tollens • p q Premise • p 3, 4, modus tollens • p s 1, 5, contrapositive method MSU/CSE 260 Fall 2009
Example: Contradiction proof Prove hypothetical syllogism. Prove: (p q)(q s) (p s) • p Assumption • s Assumption • q s Premise • q 2, 3, modus tollens • p q Premise • p 4, 5, modus tollens • p p 1, 6, conjunction • False 7, logical equivalence • p s 1, 2, 8, contradiction method MSU/CSE 260 Fall 2009
Example: Vacuous proof • Prove: If p r and q r, then p q s • Equivalently, prove: (p r ) (q r ) (p q s) • p r Premise • p r 1, Implication • q r Premise • q r 3, Implication • p q 2, 4, Resolution • (p q ) 5, DeMorgan • p q s 6, Vacuously MSU/CSE 260 Fall 2009
Example: Trivial proof • Prove: If p r and r, then q p • Equivalently, prove: (p r ) ( r ) ( q p) • p r Premise • r Premise • p1, 2, modus tollens • q p 3, Trivially MSU/CSE 260 Fall 2009
Non-examples: Vacuous, trivial proofs Recall hypothetical syllogism. Prove: (p q)(q s) (p s) Why didn’t we give example vacuous or trivial proofs of hypothetical syllogism? MSU/CSE 260 Fall 2009
Example • Leth1 =q dh2 = (q d ) ¬ ph3 = ¬ p (a ¬b)h4 = (a ¬b) (r s)c=r s we want to establishh1 h2 h3h4 c. 20 MSU/CSE 260 Fall 2009
Solution 1 • Leth1 =q dh2 = (q d ) ¬ ph3 = ¬ p (a ¬b) h4 = (a ¬b) (r s)c=r swe want to establishh1 h2 h3h4 c. • (q d ) ¬ p Premise • ¬ p (a ¬b) Premise • (q d ) (a ¬b) 1&2, Hypothetical Syllogism • (a ¬b) (r s) Premise • (q d ) (r s) 3&4, HS • q d Premise • r s 5&6, Modus Ponens MSU/CSE 260 Fall 2009
Solution 2 • Leth1 =q dh2 = (q d ) ¬ ph3 = ¬ p (a ¬b) h4 = (a ¬b) (r s)c=r s,we want to establishh1 h2 h3h4 c. • q d Premise • (q d ) ¬ p Premise • ¬ p 1&2, and modus ponens • ¬ p (a ¬b) Premise • (a ¬b)3&4, modus ponens • (a ¬b) (r s) Premise • r s 5&6, modus ponens MSU/CSE 260 Fall 2009
Example • Question: Is [(¬ (p q)) (¬ p q)]≡(¬ p q) ? • Different ways to answer the above question • By means of the Truth Table. • By means of derivation. • By formulating it as logical equivalence, that is, as a “proof”. 23 MSU/CSE 260 Fall 2009
Is [(¬ (p q)) (¬ p q)]≡(¬ p q) ?Truth Table Method 24 MSU/CSE 260 Fall 2009
Is [(¬ (p q)) (¬ p q)]≡(¬ p q) ?Derivation Method (¬ (p q)) (¬ p q) ≡ ¬(¬ (p q)) (¬ p q) ≡ (p q) (¬ p q) ≡ ((p q) ¬ p) q ) ≡ (¬ p (p q)) q ≡ ((¬ p p)(¬ p q)) q ≡ ((T)(¬ p q)) q ≡ (¬ p q) q ≡ (¬ p) (q q ) ≡ (¬ p) (q) ≡ (¬ p q) 25 MSU/CSE 260 Fall 2009
Is [ (¬ (p q)) (¬ p q)]≡(¬ p q) ?Logical Equivalence Method To show S≡ R:show thatS R and RS -------------------------------------------------- In this case, we haveS = [¬ (p q)) (¬ p q)] and R = (¬ p q) 26 MSU/CSE 260 Fall 2009
Prove [(¬ (p q)) (¬ p q)](¬ p q) • (¬ (p q)) (¬ p q) Premise • (p q) (¬ p q)1, Implication & double neg. • (p (¬ p q)) (q (¬ p q)) 2, Distribution • (T q) (q ¬ p) 3, Comm., Assoc, Taut. & Idem. • T (q ¬ p) 4, Domination • ¬ p q 5, Identity, Commutative Prove (¬ p q) [(¬ (p q)) (¬ p q)] • ¬ p q Premise • (¬ (p q)) (¬ p q) Trivially, from 1 27 MSU/CSE 260 Fall 2009
Example • Is the following reasoning logical? If you are poor then you have no money. If you have money then you are not poor. Therefore, being poor is the same as having no money! • Define the following propositions: • p= “you are poor” q = “you have no money” • Can we conclude that p ≡ qgiven that p qand¬q ¬p. • In other words, can we prove that:[(p q) (¬ q ¬ p)] (p q) . MSU/CSE 260 Fall 2009
Solution: Does [(p q) (¬ q ¬ p)]≡ (pq) ? There is a possibility of not being poor while having no money! MSU/CSE 260 Fall 2009
More Example • Leth1 =p (q s) h2 = ¬ r ph3 = qc=r swe want to establishh1 h2 h3c 30 MSU/CSE 260 Fall 2009
Does ( p (q s) ) (¬ r p)q (r s) ? • ¬ r p Premise • r Assumption • ¬ (¬ r ) Double negation, 2 • p Disj. syllogism, 1&3 • p (q s) Premise • q s Modus ponens, 4&5 • q Premise • s Modus ponens, 6&7 • r s Direct proof, 2&8 31 MSU/CSE 260 Fall 2009
General Proof by Contradiction • Proof by contradiction is a general proof method (conclusion can be of any form) • Method: • To prove that h1 h2 …hn c: Assume c, in addition to the hypotheses, and conclude False. • When c has the form pq, we get the “specialized” version presented earlier. MSU/CSE 260 Fall 2009
Example:General Proof by Contradiction • Leth1 =q dh2 = (q d ) ¬ ph3 = ¬ p (a ¬b)h4 = (a ¬b) (r s)c=r s, Prove by contradiction that h1 h2 h3h4 c. 33 MSU/CSE 260 Fall 2009
h1 h2 h3h4 ¬c F(q d) ((q d ) ¬ p ) (¬ p (a ¬b))((a ¬b) (r s)) ¬ (r s)F • q d Premise • (q d ) ¬ p Premise • ¬ p 1&2, and modus ponens • ¬ p (a ¬b) Premise • (a ¬b)3&4, modus ponens • (a ¬b) (r s) Premise • r s 5&6, modus ponens • ¬(r s) Contrary Assumption • F 34 MSU/CSE 260 Fall 2009
Rules of Inference for Predicates • All the Propositional logic rules. • The Universal Specification (US) rule:xP(x) P(y)for anyyin the domain.The rule is also know as Instantiation rule • The Existential Specification (ES)xP(x) P(y)for someyin the domain. • The Existential Generalization (EG)P(y) xP(x) 35 MSU/CSE 260 Fall 2009
Other Facts • x (A(x) → B(x)) ≡ xA(x) → xB(x) • xA(x) → xB(x) ≡ x (A(x) → B(x)) • x (A(x) B(x)) ≡ xA(x) xB(x) • x (A(x) B(x)) ≡ xA(x) xB(x) 36 MSU/CSE 260 Fall 2009
Prove thatx (H(x) →M(x)) H(s) ⇒ M(s) • This is the famous Socrates’s argument All men are mortal Socrates is a man Therefore, Socrates is a mortal • Let H(x) be “xis a man”, • LetM(x) be “x is a mortal” and • Letsbe “Socrates”. 37 MSU/CSE 260 Fall 2009
Prove thatx (H(x) →M(x)) H(s) ⇒ M(s) • x (H(x) →M(x)) Premise • H(s) →M(s)1, Universal Specification • H(s)Premise • M(s)2&3 and MP 38 MSU/CSE 260 Fall 2009
Prove that x (H(x) →M(x)) xH(x) xM(x) • xH(x)Premise • H(y)Existential Specification, for somey • x (H(x) →M(x))Premise • H(y) →M(y)3 & Universal Specification • M(y)2&4, Modus Ponens • xM(x) 5, Existential Generalization 39 MSU/CSE 260 Fall 2009
Prove thatx (A(x) B(x)) xA(x) xB(x) • x (A(x) B(x)) Premise • A(y) B(y)1, ES, y is fixed now. • A(y) 2, Simplification • B(y) 2, Simplification • xA(x)3, EG • xB(x)4, EG • xA(x) xB(x)5&6, Conjunction Question: Is the converse true? MSU/CSE 260 Fall 2009
DoesxA(x) xB(x) x (A(x) B(x))? • xA(x) Premise • A(y) 1, ES, where y is fixed • xB(x) Premise, ES • B(y) 3, ES, where y is fixed • A(y) B(y) 2 and 4 • x (A(x) B(x)) 5, EG This proof is invalid. The “y” in step 2 and 4 cannot be assumed to be the same! A new name must be used to denote a (fixed) y’ such that B(y’) in step 4. 41 MSU/CSE 260 Fall 2009
Prove thatx (A(x) B(x)) xA(x) xB(x) • ¬ (xA(x) xB(x))Contrary Assumption • ¬ xA(x) ¬ xB(x)1 & De Morgan’s • ¬ xA(x) 2 • x¬A(x) 3 & De Morgan’s • ¬ xB(x) 2 • x¬B(x) 5 & De Morgan’s • ¬A(y)4, ES, fixed y • ¬B(y)6, US, free tochoose y as in 7 • ¬A(y) ¬B(y)7 & 8 • ¬ (A(y) B(y))9, De Morgan’s • x (A(x) B(x)) Premise • A(y) B(y)11, US, any y, same as in 9 • Contradiction10 & 12 42 MSU/CSE 260 Fall 2009
Proofs, and Proof Methods, Summary & Recap • What is a logical argument? • Logical Implication (⇒) • When is a mathematical argument correct? • Need rules of inference 43 MSU/CSE 260 Fall 2009
Proof Methods • Direct • Contrapositive • Contradiction • Vacuous • Trivial • To disprove, just need a “counterexample” 44 MSU/CSE 260 Fall 2009
Applications of Logic • Day-to-day conversation • The equivalent Algebra (Boolean) for circuit design • Program Correctness • Complexity Theory 45 MSU/CSE 260 Fall 2009