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 proof of a conclusion C is a deduction that ends with C • What is known or assumed to be true comes in three variations: – Premises that are assumed to be true – Any statement known to be true (e.g., 1+1 = 2) – Sound rules of inference that introduce logic statements that are true (assuming the statements they are based on are also true) Careful Again… • A formal proof guarantees that the original statement is a tautology – If any premise is false, the statement is true (P Q is true when P is false) – If all premises are true, we are able to guarantee that the conclusion is true (by the proof derivation) – Thus, the statement is always true (i.e., is a tautology) • HOWEVER: – A proof does NOT guarantee that the conclusion is true! Valid Proof vs. Valid Conclusion Consider the following proof: If 2 > 3, 2 > 3 3 < 2, then 3 < 2 . 1. 2 > 3 2. 2 > 3 3 < 2 3. 3 < 2 premise premise 1&2, modus ponens Yes! Sound argument Is the proof valid? Is the conclusion valid? No! Hence, a valid proof does not guarantee a valid conclusion. What a valid proof does guarantee is that IF the premises are all true, then the conclusion is too. Main Rules of Inference A, B |= A B Combination A B |= B Simplification A B |= A Variant of simplification A |= A B Addition B |= A B Variant of addition A, AB |= B Modus ponens B, AB |= A Modus tollens AB, BC |= AC Hypothetical syllogism A B, A |= B Disjunctive syllogism A B, B |= A Variant of disjunctive syllogism AB, AB |= B Cases AB |= AB Equivalence elimination AB |= BA Variant of equivalence elimination AB, BA |= AB Equivalence introduction A, A |= B Inconsistency law Reduction of Rules of Inference Easy to show validity of rules with truth tables • Using laws, we can also reduce the number of rules of inference – Too many to remember – Too many to program! (Project) • Example: modus tollens B AB A B A contrapositive B A modus ponens It turns out that modus ponens plus some simple laws are usually enough, and it can get even simpler… 1. Exhaustive Truth Proof Show true for all cases – e.g. Prove x2 + 5 < 20 for integers 0 x 3 02 + 5 = 5 12 + 5 = 6 22 + 5 = 9 32 + 5 = 14 < 20 < 20 < 20 < 20 T T T T – Thus, all cases are exhausted and true – Same as using truth tables when all combinations yield a tautology 2. Equivalence to Truth 2a. Transform logical expression to T Prove: R S (R S) R S (R S) R S R S RSRS (R S) (R S) T de Morgan’s law double negation implication (PQ PQ) law of excl. middle (P P) T Use laws only! 2. Equivalence to Truth (cont’d) 2b. Transform lhs to rhs or vice versa Prove: P Q P Q Q P Q P Q (P P) Q TQ Q distributive law (factoring) law of excluded middle identity Use laws only! 3. If and only if Proof • Also called necessary and sufficient • Since P Q (P Q) (Q P), we can create two standard deductive proofs: –PQ –QP • Transforms proof to a standard deductive proof actually two of them 3. If and only if Proof: Example Prove: 2x – 4 > 0 iff x > 2. Thus, we can do two proofs: (1) If 2x – 4 > 0 then x > 2. (2) If x > 2 then 2x – 4 > 0. Proof: (1) 1. 2x – 4 > 0 premise 2. 2x > 4 1, algebraic equiv. 3. x > 2 2, algebraic equiv. (2) Similarly, suppose x > 2. Then 2x > 4 and thus 2x – 4 > 0. Note that we could have also converted the lhs to the rhs Proof: 2x – 4 > 0 2x > 4 x > 2 4. Contrapositive Proof • Since P Q Q P (by the law of contrapositive), we can prove either side of the equivalence, whichever is EASIER • E.g., prove: if s is not a multiple of 3, then s is not a solution of x2 + 3x – 18 = 0 – Infinitely many non-multiples of 3 and nonsolutions to the quadratic equation – HARD! – Let: • P = s is a multiple of 3 • Q = s is a solution of x2 + 3x – 18 = 0 – Instead of P Q, we can prove Q P 4. Contrapositive Proof (cont’d) Prove: if s is a solution of x2 + 3x – 18 = 0, then s is a multiple of 3 Proof: The solutions of x2 + 3x – 18 = 0 are 3 and – 6. Both 3 and – 6 are multiples of 3. Thus, every solution s is a multiple of 3. Note: Using a contrapositive proof helps get rid of the not’s and makes the problem easier to understand indeed, the contrapositive turns this into a simple proof we can do exhaustively. 5. Proof by Contradiction • Note: P P P F T T F T F T T F • Thus, P P F • Substituting R S for P, we have • RS (R S) F • And finally (R S) F (R S) F R S F R S F implication de Morgan’s double negation 5. Proof by Contradiction (cont’d) • Thus, we have – RS R S F • Hence, to prove R S, we can – Negate the conclusion – Add it as a premise (to R) – Derive a contradiction (i.e. derive F) • Any contradiction (e.g., P P) is equivalent to F, so deriving any contradiction is enough Note: in our project we will implement the semantics of our language by programming the computer to do a proof by contradiction 5. Proof by Contradiction: Example • Prove: the empty set is unique Since P (P F), we can prove P F instead i.e. We can prove: if the empty set is not unique, then there is a contradiction, or, in other words, assuming the empty set is not unique leads (deductively) to a contradiction. • Proof: – Assume the empty set is not unique – Then, there are at least two empty sets 1 and 2 such that 1 2 – Since an empty set is a set and an empty set is a subset of every set, 1 2 and 2 1 and thus 1 = 2 – But now we have 1 2 and 1 = 2 a contradiction! – Hence, the empty set is unique