Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science Slides adapted from Michael P. Frank ' s course based on the.

Similar presentations


Presentation on theme: "CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science Slides adapted from Michael P. Frank ' s course based on the."— Presentation transcript:

1 CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science Slides adapted from Michael P. Frank ' s course based on the text Discrete Mathematics & Its Applications (5 th Edition) by Kenneth H. Rosen

2 Proof Replacement & Quantifiers

3 2013Frank / van Deemter / Wyner3 Topics Equivalences that can be used to replace formulae in proofsEquivalences that can be used to replace formulae in proofs Further examples of Propositional Logic proofs.Further examples of Propositional Logic proofs. Proof rules with quantifiers.Proof rules with quantifiers.

4 2013Frank / van Deemter / Wyner4 Equivalences Equivalence expressions can be substituted since they do not change truth.

5 2013Frank / van Deemter / Wyner5 Equivalences

6 2013Frank / van Deemter / Wyner6 A Direct Proof 1. ((A ∨ ¬ B) ∨ C)  (D  (E F)) 1. ((A ∨ ¬ B) ∨ C)  (D  (E  F)) 2. (A ∨ ¬ B)  ((F )  H) 2. (A ∨ ¬ B)  ((F  G)  H) 3. A  ((E )  (F )) 3. A  ((E  F)  (F  G)) 4. A 5. Show: D  H 6. A ∨ ¬ B 7. (A ∨ ¬ B) ∨ C 8. (D  (E F)) 8. (D  (E  F)) 9. (E )  (F ) 9. (E  F)  (F  G) 10. D  (F ) 10. D  (F  G) 11. (F )  H 11. (F  G)  H 12. D  H

7 2013Frank / van Deemter / Wyner7 A Direct Proof 1. ((A ∨ ¬ B) ∨ C)  (D  (E F)) 1. ((A ∨ ¬ B) ∨ C)  (D  (E  F)) 2. (A ∨ ¬ B)  ((F )  H) 2. (A ∨ ¬ B)  ((F  G)  H) 3. A  ((E )  (F )) 3. A  ((E  F)  (F  G)) 4. A 5. Show: D  HDD 12 6. A ∨ ¬ BDI 4 7. (A ∨ ¬ B) ∨ CDI 6 8. (D  (E F))IE 1,7 8. (D  (E  F))IE 1,7 9. (E )  (F )IE 3,4 9. (E  F)  (F  G)IE 3,4 10. D  (F )HS 8,9 10. D  (F  G)HS 8,9 11. (F )  HIE 2,6 11. (F  G)  HIE 2,6 12. D  HHS 10,11

8 2013Frank / van Deemter / Wyner8 A Conditional Proof 1. (A ∨ B)  (C ∧ D) 2. (D ∨ E)  F 3. Show: A  F 4. A 5. Show: F 6. A ∨ B 7. C ∧ D 8. D 9. (D ∨ E) 10. F

9 2013Frank / van Deemter / Wyner9 A Conditional Proof 1. (A ∨ B)  (C ∧ D) 2. (D ∨ E)  F 3. Show: A  FCD 4, 5 4. AAssumption 5. Show: FDD 10 6. A ∨ BDI 4 7. C ∧ DIE 1,6 8. DCE 7 9. (D ∨ E)DI 8 10. FIE 2,9

10 2013Frank / van Deemter / Wyner10 An Indirect Proof 1. A  (B ∧ C) 2. (B ∨ D)  E 3. (D ∨ A) 4. Show: EID 13 5. Assumption 6. IE 2,5 7. Second De Morgan 6 8. CE 7 9. DE 4,8 10. IE 1,9 11. CE 10 12. CE 7 13. ContraI 11,12

11 2013Frank / van Deemter / Wyner11 An Indirect Proof 1. A  (B ∧ C) 2. (B ∨ D)  E 3. (D ∨ A) 3. Show: E 4. ¬ E 5. ¬ (B ∨ D) 6. ¬ B ∧ ¬ D 7. ¬ D 8. A 9. B ∧ C 10. B 11. ¬ B 12. B ∧ ¬ B

12 2013Frank / van Deemter / Wyner12 An Indirect Proof 1. A  (B ∧ C) 2. (B ∨ D)  E 3. (D ∨ A) 4. Show: EID 13 5. ¬ EAssumption 6. ¬ (B ∨ D)IE 2,5 7. ¬ B ∧ ¬ DSecond De Morgan 6 8. ¬ DCE 7 9. ADE 4,8 10. B ∧ CIE 1,9 11. BCE 10 12. ¬ BCE 7 13. B ∧ ¬ BContraI 11,12

13 2013Frank / van Deemter / Wyner13 A Logical Equivalence Prove: ¬ (p ∨ (¬ p ∧ q)) is equivalent to ¬ p ∧ ¬ q 1. ¬ (p ∨ (¬ p ∧ q)) 1. ¬ (p ∨ (¬ p ∧ q)) ....

14 2013Frank / van Deemter / Wyner14 A Logical Equivalence Prove: ¬ (p ∨ (¬ p ∧ q)) is equivalent to ¬ p ∧ ¬ q 1. ¬ (p ∨ (¬ p ∧ q))second De Morgan 1. ¬ (p ∨ (¬ p ∧ q))  second De Morgan 2.first De Morgan 2.  first De Morgan 3.double negation 3.  double negation 4.second distributive 4.  second distributive 5.negation 5.  negation 6.commutativity 6.  commutativity 7.identity law for F 7.  identity law for F

15 2013Frank / van Deemter / Wyner15 A Logical Equivalence Prove: ¬ (p ∨ (¬ p ∧ q)) is equivalent to ¬ p ∧ ¬ q 1. ¬ (p ∨ (¬ p ∧ q))¬ p ∧ ¬ (¬ p ∧ q) 1. ¬ (p ∨ (¬ p ∧ q))  ¬ p ∧ ¬ (¬ p ∧ q) 2.¬ p ∧ (¬ (¬ p) ∨ ¬ q) 2.  ¬ p ∧ (¬ (¬ p) ∨ ¬ q) 3.¬ p ∧ (p ∨ ¬ q) 3.  ¬ p ∧ (p ∨ ¬ q) 4.¬ p ∧ p) ∨ ( ¬ p ∧ ¬ q) 4.  (¬ p ∧ p) ∨ ( ¬ p ∧ ¬ q) 5. ∨ ( ¬ p ∧ ¬ q) 5.  F ∨ ( ¬ p ∧ ¬ q) 6.( ¬ p ∧ ¬ q) ∨ 6.  ( ¬ p ∧ ¬ q) ∨ F 7.( ¬ p ∧ ¬ q) 7.  ( ¬ p ∧ ¬ q)

16 2013Frank / van Deemter / Wyner16 A Logical Equivalence Prove: ¬ (p ∨ (¬ p ∧ q)) is equivalent to ¬ p ∧ ¬ q 1. ¬ (p ∨ (¬ p ∧ q))¬ p ∧ ¬ (¬ p ∧ q)second De Morgan 1. ¬ (p ∨ (¬ p ∧ q))  ¬ p ∧ ¬ (¬ p ∧ q)second De Morgan 2.¬ p ∧ (¬ (¬ p) ∨ ¬ q)first De Morgan 2.  ¬ p ∧ (¬ (¬ p) ∨ ¬ q)first De Morgan 3.¬ p ∧ (p ∨ ¬ q)double negation 3.  ¬ p ∧ (p ∨ ¬ q)double negation 4.¬ p ∧ p) ∨ ( ¬ p ∧ ¬ q)second distributive 4.  (¬ p ∧ p) ∨ ( ¬ p ∧ ¬ q)second distributive 5. ∨ ( ¬ p ∧ ¬ q)negation 5.  F ∨ ( ¬ p ∧ ¬ q)negation 6.( ¬ p ∧ ¬ q) ∨ commutativity 6.  ( ¬ p ∧ ¬ q) ∨ Fcommutativity 7.( ¬ p ∧ ¬ q)identity law for F 7.  ( ¬ p ∧ ¬ q)identity law for F

17 2013Frank / van Deemter / Wyner17 Universal Instantiation  x P(x)  P(o)(substitute any constant o)  x P(x)  P(o)(substitute any constant o) The same for any other variable than x.

18 2013Frank / van Deemter / Wyner18 Existential Generalization P(o)  x P(x)P(o)  x P(x) The same for any other variable than x.

19 2013Frank / van Deemter / Wyner19 Universal Generalisation P(g)  x P(x)P(g)  x P(x) This is not a valid inference of course. But suppose you can prove P(g) without using any information about g...This is not a valid inference of course. But suppose you can prove P(g) without using any information about g...... then the inference to  x P(x) is valid!... then the inference to  x P(x) is valid! In other words...In other words...

20 2013Frank / van Deemter / Wyner20 Universal Generalisation P(g) (for g an arbitrary or general constant)  x P(x)P(g) (for g an arbitrary or general constant)  x P(x) Concretely, your strategy should be to choose a new constant g (i.e., that did not occur in your proof so far) and to prove P(g).Concretely, your strategy should be to choose a new constant g (i.e., that did not occur in your proof so far) and to prove P(g).

21 2013Frank / van Deemter / Wyner21 Existential Instantiation  x P(x)  P(c) (substitute a new constant c)  x P(x)  P(c) (substitute a new constant c) Once again, the inference is not generally valid, but we can regard it as valid if c is a new constant.

22 2013Frank / van Deemter / Wyner22 Simple Formal Proof in Predicate :ogic Argument:Argument: –“ All TAs compose quizzes. Ramesh is a TA. Therefore, Ramesh composes quizzes. ” First, separate the premises from conclusions:First, separate the premises from conclusions: –Premise #1: All TAs compose quizzes. –Premise #2: Ramesh is a TA. –Conclusion: Ramesh composes quizzes.

23 2013Frank / van Deemter / Wyner23 Rendering in Logic Render the example in logic notation. Premise #1: All TAs compose easy quizzes.Premise #1: All TAs compose easy quizzes. –Let U.D. = all people –Let T(x) :≡ “ x is a TA ” –Let E(x) :≡ “ x composes quizzes ” –Then Premise #1 says:  x(T(x)→E(x))

24 2013Frank / van Deemter / Wyner24 Rendering cont… Premise #2: Ramesh is a TA.Premise #2: Ramesh is a TA. –Let r :≡ Ramesh –Then Premise #2 says: T(r) –And the Conclusion says: E(r) The argument is correct, because it can be reduced to a sequence of applications of valid inference rules, as follows:The argument is correct, because it can be reduced to a sequence of applications of valid inference rules, as follows:

25 2013Frank / van Deemter / Wyner25 Formal Proof Using Natural Deduction StatementHow obtained StatementHow obtained 1.  x(T(x) → E(x))(Premise #1) 2.T(r) → E(r)(Universal instantiation) 3.T(r)(Premise #2) 4.  E(r)(MP 2, 3)

26 2013Frank / van Deemter / Wyner26 A very similar proof Can you prove:  x(T(x) → E(x)) and  E(r)  x(T(x) → E(x)) and  E(r)   T(r).   T(r).

27 2013Frank / van Deemter / Wyner27  in Natural Deduction A very simple example: Theorem: From  xF(x) it follows that  yF(y) 1.  xF(x)(Premiss) 2.F(a)(Arbitrary a, Exist. Inst.) 3.   yF(y)(Exist. Generalisation)

28 2013Frank / van Deemter / Wyner28 Quantifier Rules ß

29 2013Frank / van Deemter / Wyner29 Longer Quantifier Proof


Download ppt "CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science Slides adapted from Michael P. Frank ' s course based on the."

Similar presentations


Ads by Google