CS 641 meeting -*- Outline -*- * intermezzo on calculations we've already said most of this a few new things... ** what a calculation means -------------------- WHAT A CALCULATION MEANS P op X op

Q means (H0 ==> P op X) /\ (H1 ==> X op Q) --------------------- ** proving implications need to prove things like P ==> wp.S.R often, and as wp.S.R is usually more complex, study... ---------------------- SHAPES OF CALCULATIONS TO PROVE Q <== P Q <== P Q equiv true ---------------------- Q: why is this last valid? P ==> (Q equiv true) equiv over equiv> P ==> Q equiv P ==> true

true equiv true> equiv P ==> Q note: no loss of power here, as the calculation is equivalent ------------------------ TO PROVE P0 /\ P1 ==> Q P1 ==> Q P1 equiv Q ------------------------ The latter is valid because (P0 ==> (P1 equiv Q)) ==> (P0 /\ P1 ==> Q) as we saw in an exercise note that since this is an implication, you're proving something stronger than you need when you use this technique ------------------------ Q equiv X equiv true ------------------------ this also proves P0 /\ P1 ==> Q, because (P0 ==> (Q equiv X)) /\ (P1 ==> (X equiv true)) ==> (P0 /\ P1 ==> Q) note that since this is an implication, you're proving something stronger than you need when you use this technique but this technique is convenient, as you can use the hypotheses 1 at a time ** substitution with an implication ---------------------- USING ==> IN A LARGER CONTEXT The following are valid X /\ Y ==> < hint why Y ==> Z > X /\ Z X /\ Z <== < hint why Z <== Y > X /\ Y ---------------------- This is valid because (Y ==> Z) ==> (X /\ Y ==> X /\ Z) is valid. Q: why is it? Assume Y ==> Z, then we can calculate using one of the shapes above... X /\ Y ==> X /\ Z equiv (X /\ Y) \/ (X /\ Z) equiv X /\ Z equiv X /\ (Y \/ Z) equiv X /\ Z equiv X /\ (Y \/ Z equiv Z) equiv X equiv X ==> (Y \/ Z equiv Z) equiv X ==> (Y ==> Z) equiv X ==> true equiv true Can you also use this with disjunction? equivalence? Universal quantif? A step of the form... X \/ Y ==> < hint why Y ==> Z > X \/ Z would be valid if (Y ==> Z) ==> ((X \/ Y) ==> (X \/ Z)) is valid. Q: can you prove it for disjunction, assuming Y ==> Z? assuming Y ==> Z, we can calculate as follows. X \/ Y ==> X \/ Z equiv X \/ Y \/ X \/ Z equiv X \/ Z equiv X \/ (Y \/ Z) equiv X \/ Z equiv X \/ (Y \/ Z equiv Z) equiv X \/ (Y ==> Z) equiv X \/ true equiv true but this form does *not* work with equivalence, as shown in the "revenge of 3.f", (Y ==> Z) ==> ((X equiv Y) ==> (X equiv Z)) is invalid! for counterexample, take Y = false, Z = false, X = true Q: consider a step of the following form: (all y \in X :: (all x \in X :: p.x) \/ q.y) ==> {instantiation, that is (all x \in X :: p.x) ==> p.y} (all y \in X :: p.y \/ q.y) Can you state the justification for this and prove it's valid? Hint: use excluded middle and splitting the range. ** proof by contradiction (probably skip this) --------------------- PROOF BY CONTRADITION The following proves P ~P ==> false --------------------- Q: can you prove that (P /\ ~Q equiv false) equiv (P ==> Q)? ** Liebniz's rule is referred to in hints as "Liebniz" (x = y) ==> (f.x = f.y)