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

Slides:



Advertisements
Similar presentations
Resolution Proof System for First Order Logic
Advertisements

Slides adapted from Michael P. Frank ' s course based on the text Discrete Mathematics & Its Applications (5 th Edition) by Kenneth H. Rosen CS2013 Mathematics.
CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
CS128 – Discrete Mathematics for Computer Science
TR1413: Discrete Mathematics For Computer Science Lecture 3: Formal approach to propositional logic.
So far we have learned about:
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Discrete Mathematics and its Applications
Fall 2002CMSC Discrete Structures1 Let’s proceed to… Mathematical Reasoning.
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
CS2013 Maths for Computing Science Proof (part b) Adam Wyner University of Aberdeen Computing Science.
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Introduction to Proofs
MATH 224 – Discrete Mathematics
Discrete Mathematics CS 2610 August 24, Agenda Last class Introduction to predicates and quantifiers This class Nested quantifiers Proofs.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
2.3Logical Implication: Rules of Inference From the notion of a valid argument, we begin a formal study of what we shall mean by an argument and when such.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
Fallacies The proposition [(p  q)  q]  p is not a tautology, because it is false when p is false and q is true. This type of incorrect reasoning is.
Lecture 1.2: Equivalences, and Predicate Logic* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren, Zeph.
(CSC 102) Lecture 8 Discrete Structures. Previous Lectures Summary Predicates Set Notation Universal and Existential Statement Translating between formal.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
Chapter 1: The Foundations: Logic and Proofs
Lecture 1.3: Predicate Logic CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science Slides adapted from Michael P. Frank ' s course based on the.
Module #1 - Logic Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank. Modified By Mingwu Chen 1 Module.
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
Symbolic Logic The Following slide were written using materials from the Book: The Following slide were written using materials from the Book: Discrete.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
Lecture 1.3: Predicate Logic, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Uniqueness Quantifier ROI for Quantified Statement.
Chapter 1 Logic and proofs
2. The Logic of Compound Statements Summary
3. The Logic of Quantified Statements Summary
Introduction to Logic for Artificial Intelligence Lecture 2
Discrete Math - Module #1 - Logic
Formal Logic CSC 333.
COMP 1380 Discrete Structures I Thompson Rivers University
Module #10: Proof Strategies
Propositional Calculus: Boolean Algebra and Simplification
CS201: Data Structures and Discrete Mathematics I
CS 1502 Formal Methods in Computer Science
Proving Existentials A proof of a statement of the form x P(x) is called an existence proof. If the proof demonstrates how to actually find or construct.
CSE 311 Foundations of Computing I
CS201: Data Structures and Discrete Mathematics I
Mathematical Reasoning
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
A Brief Summary for Exam 1
The Method of Deduction
Computer Security: Art and Science, 2nd Edition
Metatheorems Computational Logic Lecture 8
Module #10: Proof Strategies
Foundations of Discrete Mathematics
COMP 1380 Discrete Structures I Thompson Rivers University
CPSC 121: Models of Computation
CS201: Data Structures and Discrete Mathematics I
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Mathematical Reasoning
Discrete Mathematics and its Applications
CS201: Data Structures and Discrete Mathematics I
Lecture 1.3: Predicate Logic
Presentation transcript:

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

Proof Replacement & Quantifiers

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.

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

2013Frank / van Deemter / Wyner5 Equivalences

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

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 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

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

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 A ∨ BDI 4 7. C ∧ DIE 1,6 8. DCE 7 9. (D ∨ E)DI FIE 2,9

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

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

2013Frank / van Deemter / Wyner12 An Indirect Proof 1. A  (B ∧ C) 2. (B ∨ D)  E 3. (D ∨ A) 4. Show: EID ¬ 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 ¬ BCE B ∧ ¬ BContraI 11,12

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

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

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)

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

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.

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

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...

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).

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.

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.

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))

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:

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)

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).

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)

2013Frank / van Deemter / Wyner28 Quantifier Rules ß

2013Frank / van Deemter / Wyner29 Longer Quantifier Proof