1 Proving Things Why prove things? Proof by Substitution, within Logic Rules of Inference: applying Logic Using Assumptions Proof Strategies
2 Why Proofs? Knowledge is power. Where do we get it? direct observation reading; being told reasoning, proving (& generalize) (if source is reliable) (if sound)
3 What is a Proof Like? A proof is like ordinary reasoning in that it makes sense, but also is precise often long in symbolic form What is a Proof? a sequence of justified steps from obvious truths to a valid (useful) conclusion
4 Three kinds of Proofs and how they re justified Proof by Truth Table: justified by definitions of operators and exhaustive case analysis (all states) Proof by Substitution: justified by equivalence and its transitivity Proof by Inference Rule: justified by rules proved within logic then apply to math, CS..
5 Using Truth Tables to Prove a useful Tautology Elimination of an Alternative: (p q) Ÿ ÿ p Æ q p q p q ÿ p (p q) Ÿ ÿ p (p q) Ÿ ÿ p Æ q T T T F F T T F T F F T F T T T T T F F F T F T
6 Using Known Equivalences to Prove a New One Result: Strategy: Distributivity of OR from the Right Use?? for an unproved equivalence. Keep substituting equivalent expressions on one side or the other, until the two sides are the same. (q Ÿ r) p?? (q p) Ÿ (r p) Commutativity of OR, 3 times p (q Ÿ r)?? (p q) Ÿ (p r) Distributivity (one of the known ones, from the left). p (q Ÿ r) p (q Ÿ r) Yes, they are the same.
7 Using Equivalences to Prove an Asserted Expression Strategy: Keep substituting equivalent expressions to show that the given expression is (equivalent to) TRUE. Theorem: The conditional is Transitive {(p Æ q) Ÿ (q Æ r)} Æ (p Æ r) Replace all conditionals ÿ {(ÿ p q) Ÿ (ÿ q r)} (ÿ p r) DeMorgan s law {ÿ (ÿ p q) ÿ (ÿ q r)} (ÿ p r) DeMorgan s law twice, inside {(ÿ ÿ p Ÿ ÿ q) (ÿ ÿ q Ÿ ÿ r)} (ÿ p r) continued..
8 [repeating the last expression, and continuing...] {(ÿ ÿ p Ÿ ÿ q) (ÿ ÿ q Ÿ ÿ r )} (ÿ p r) Remove double negations. Remove some unneeded parentheses (p Ÿ ÿ q) ( q Ÿ ÿ r) ÿ p r Rearrange & regroup the 4 disjuncts. {(p Ÿ ÿ q) ÿ p} {( q Ÿ ÿ r) r} distributes from the right. Excluded middle {TRUE Ÿ (ÿ q ÿ p)} {(q r) Ÿ TRUE} TRUE Ÿ a a (ÿ q ÿ p) (q r) Rearrange and regroup, noting all the ORs (ÿ q q) ÿ p r Excluded middle. TRUE ÿ p r TRUE a TRUE TRUE
9 Rules of Inference I: Introducing and Eliminating and Ÿ Ÿ-introduction Ÿ-elimination p p Ÿ q q p p Ÿ q -introduction excluded middle p p q p ÿ p Note: We may replace p and q by any propositions, even complex ones.
10 A Proof by Rules of Inference Theorem (to be proved): If p Ÿ q is true, then so is p q. Proof: Claim p Ÿ q p p q Justification Given Ÿ-elimination -introduction
11 Rules of Inference II: Using Conditional Expressions Modus Ponens Modus Tollens p Æ q p q p Æ q ÿ q ÿ p Cases p q p Æ r q Æ r r
12 Rules of Inference III: Using Assumptions Æ-introduction [p] q p Æ q ÿ-introduction (reduction to absurdity) (contradiction) F-introduction ÿ p [p] FALSE p ÿ p FALSE
13 Using Æ in place of if-then in a theorem Before: If p Ÿ q then p q. Now: p Ÿ q Æ p q Proof: Claim Justification 1 [p Ÿ q] Assumption 2 p Ÿ-elimination: 1 3 p q -introduction: 2 4 pÿq Æp q Æ-introduction: 1,3
14 Example: Transitivity of Æ Theorem: If p Æ q and q Æ r are true, then so is p Æ r. ((p Æ q) Ÿ (q Æ r)) Æ (p Æ r) Proof: Claim Justification 1 [(pæq)ÿ(qær)] Assumption 2 pæq Ÿ-Elimination: 1 3 qær Ÿ-Elimination: 1 4 [p] Assumption 5 q Modus ponens: 2,4 6 r Modus ponens: 3,5 7 pær Æ-introduction: 4,6 8 ((pæq)ÿ(qær)) Æ (pær) Æ-introduction: 1,7
15 About Transitivity of the Conditional By proving this, we have established a new Rule of Inference: p Æ q q Æ r p Æ r This new rule is the basis of proofs by Divide & Conquer Each of the two assumptions in the proof is based on a strategy of to prove aæb, assume a and prove b. Transitive operators include: the conditional the biconditional less-than, since a < b Ÿ b < c Æ a < c and several others
16 A True thing is implied by anything: ANY Æ TRUE q Æ (p Æ q) Note: We will soon make good use of this! Claim Justification 1 [q] Assumption 2 [p] Assumption 3 q from line 1 4 pæq Æ-introduction: 2,3 5 qæ(pæq) Æ-introduction: 1,4
17 Example: Contrapositive (ÿq Æ ÿp) Æ (p Æ q) Claim Justification 1 [ÿ q Æ ÿ p] Assumption 2 q ÿ q Excluded Middle 3 [ÿ q] Assumption 4 ÿ p Modus Ponens: 1,3 5 pæ q Vacuous Proof: 4 6 ÿ q Æ (p Æ q) Æ-introduction: 7 q Æ (p Æ q) ANY Æ TRUE 8 p Æ q Cases: 2, 6, 7 9 the result Æ-introduction: 1,8
18 Idea: Exercise A true proposition cannot imply both some other proposition and that other proposition s negation. If p Æ q and p Æ ÿ q are true, then p is false. Proof: ((p Æ q) Ÿ (p Æ ÿ q)) Æ ÿ p Claim Justification 1 [... ] Assumption 2...... n-1 ÿp n the theorem Æ-introduction
19 Rules of Inference IV: Obtaining More Conditionals Vacuous Proof ÿ p p Æ q Contrapositive p Æ q ÿ q Æ ÿ p
20 Rules of Inference V: The Biconditional p Æ q q Æ p p q p q p Æ q p q q Æ p
21 Theorem 2: (p Æ q) (ÿ p q) is true for all values of p and q. [ÿ p q] Assumption (indented) of right side [ÿ p] Additional assumption, case 1 p Æ q - vacuous proof - ÿ p Æ (p Æ q) - end of case 1 - [q] Additional assumption, case 2 [p] - third level assumption - q - from second level assumption - p Æ q - conditional introduction - q Æ (p Æ q) - end of case 2 - p Æ q - true in either case (ÿ p q) Æ (p Æ q) End of first major subproof [p Æ q] Assumption of left side p ÿ p Law of the excluded middle [p] Additional assumption, case 1 q - modus ponens - ÿ p q - OR introduction - p Æ (ÿ p q) - end of case 1 - [ÿ p] Additional assumption, case 2 ÿ p q - OR introduction - ÿ p Æ (ÿ p q) - end of case 2 - ÿ p q - true in either case (p Æ q) Æ (ÿ p q) End of second major subproof (p Æ q) (ÿ p q) Statement of the theorem (now proved)
22 Summary of Proof Styles Truth Tables Substitution (of equivalent expressions) Rules of Inference