CS 641 meeting -*- Outline -*- * calculational proofs and notation (Cohen, Ch. 1) See Also Dijkstra & Scholten, chapter 4, and Cohen's chapter 6 ** shapes of calculations ------------------- BASIC SHAPE OF CALCULATIONAL PROOF X = < hint why X = true > true -------------------- Other formats ------------------ TO PROVE X = Z X = < hint why X = Y > Y = < hint why Y = Z > Z ------------------ this is valid because = is transitive: (X=Y) /\ (Y=Z) ==> X=Z format saves writing compared to X = Z = < hint why Y = Z > X = Y = < hint why X = Y > X = X = < = is reflexive > true as don't have to write X out each time note also that you get more control over the order ------------------- TO PROVE A ==> C A = < hint why A = B > B ==> < hint why B ==> C > C ------------------- this is valid because (A=B) /\ (B ==> C) ==> (A ==> C) format valid for any transtive relation, for example with implication (==>) and consequence (<==), provided they all go in the same direction! -------------------- PROOFS UNDER ASSUMPTIONS e.g., to prove E ==> (A = D) A = < hint why A = B > B = < hint why E ==> (B = C) > C = < hint why C = D > D -------------------- valid because (E ==> (A=B /\ B=C /\ C=D)) ==> (E ==> A=D) this is not being sneaky, but is an abbreviation. often useful when E is some property that allows some manipulation Also ok to prove universals by skolemization. ----------------------- EXAMPLE CALCULATIONAL PROOF def: f is conjuctive = (all X,Y:: f.(X /\ Y) = (f.X /\ f.Y)) def: f is monotonic = (all P,Q:: (P ==> Q) ==> (f.P ==> f.Q)) Thm. a conjuctive f is monotonic. Proof: observe for any f, P, and Q f.P ==> f.Q = < predicate calculus > (f.P /\ f.Q) = f.P = < f is conjunctive > f.(P /\ Q) = f.P <== < Leibniz > P /\ Q = P = < Predicate calculus > P ==> Q ----------------------- Note this uses the consequence (<==) to start with the more complex side. we'll see the equivalence between P /\ Q = P and P ==> Q later. ** heuristic (p. 15) start with the more complex side and simplify less rabbits generally are pulled out of the hat that way ** calculations vs. appeals to intuition (p. 19) calculations are ideally syntactic manipulations based on syntactic laws not "meaning" of formulas Q: does this mean that formal models can't be used in proofs? no, but then it isn't what Cohen would call a calculation certainly don't want to appeal to intuition ** notation *** three dots "..." (section 1.6) Q: Why does Cohen say to do away with the 3 dots? ambiguous, verbose, doesn't allow substitution *** naturals (1.7) start with 0 *** function (1.8) application indicated by infix dot; functions curried f.x.y instead of f(x,y) domain of partial function f(i:1<=i<9) here i is a dummy or bound variable variables that aren't dummies are free need to avoid capture of free variables... ** exercises have students show their work on exercises from Cohen's chapter 1