COP 5021 Lecture -*- Outline -*- * Calculational Style Proofs ** proof formats with equality ------------------------------------------ CALCULATIONAL STYLE PROOFS Why? General Format A == {hint why A == B} B == {hint why B == C} C This establishes that A == C because it shows (A == B) /\ (B == C) If C is true, then this proves A ------------------------------------------ ... to prove theorems carefully (not skipping steps, get feedback) to understand reasons to make proofs that are easily read and understood Note that we don't say "by transitivitity" *** proof formats with implication ------------------------------------------ STANDARD PROOF OUTLINES To show: A ==> D A ==> {hint why A ==> B} B == {hint why B == C} C ==> {hint why C ==> D} D Another way: D <== {hint why D <== C} C == {hint why C == B} B <== {hint why B <== A} A ------------------------------------------ Q: What's the logical formula that these are equivalent to? (A ==> B) /\ (B == C) /\ (C ==> D) We would use the second one when D is more complex than A as it is useful to "reduce" from more complex to simpler formulas. ** rules and strategies *** rules ------------------------------------------ SOME INFORMAL RULES A. Don't use two reasons in one hint, use two steps instead B. Substituting equals for equals always is okay. C. Be careful with substitution when you only know an implication ------------------------------------------ *** strategies ------------------------------------------ SOME STRATEGIES, HINTS A. Start from the more complex side. B. Use lemmas to isolate parts of a proof. C. Avoid proof by contradiction if possible. D. Look at the proof afterwards to see if it can be simplified, or clarified ------------------------------------------ ** practice --------------------------------------------------------- PRACTICE For the following: give a proof or find a counterexample. P <==> P <==> P <==> !P P <== Q <==> P \/ !Q <==> P P ==> Q <==> P \/ Q <==> Q X ==> X \/ Y absorption: X \/ (X /\ Y) <==> X currying: P ==> (Q ==> R) <==> (P /\ Q ==> R) golden rule: P /\ Q <==> P <==> Q <==> P \/ Q (P ==> Q) \/ (Q ==> P) conjunction distributes over implication: P /\ (Q ==> R) <==> P /\ Q ==> P /\ R disjunction distributes over discrepancy: P \/ (Q <=!=> R) <==> P \/ Q <=!=> P \/ R (P <==> P \/ Q) /\ (P \/ Q <==> P) <==> P <==> Q --------------------------------------------------------- The first 2 are not valid. For counterexamples: take P as true in the first formula take P as false in the second formula