CS2013 Maths for Computing Science Proof (part b) Adam Wyner University of Aberdeen Computing Science.

Slides:



Advertisements
Similar presentations
Discrete Math Methods of proof 1.
Advertisements

Introduction to Proofs
Introduction to Theorem Proving
CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
1 Introduction to Abstract Mathematics Valid AND Invalid Arguments 2.3 Instructor: Hayk Melikya
CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science Slides adapted from Michael P. Frank ' s course based on the.
Logic Concepts Lecture Module 11.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Truth Trees Intermediate Logic.
CS128 – Discrete Mathematics for Computer Science
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
So far we have learned about:
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
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.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
Discrete Mathematics and its Applications
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
First Order Logic. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order.
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
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.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
CS201: Data Structures and Discrete Mathematics I
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
CompSci 102 Discrete Math for Computer Science
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,
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
CS2013 Mathematics for Computing Science Adam Wyner University of Aberdeen Computing Science Slides adapted from Michael P. Frank ' s course based on the.
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.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Chapter 1 Logic and proofs
2. The Logic of Compound Statements Summary
Advanced Algorithms Analysis and Design
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
The Foundations: Logic and Proofs
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
CSE 311: Foundations of Computing
CS 270 Math Foundations of CS
A Brief Summary for Exam 1
The Method of Deduction
Computer Security: Art and Science, 2nd Edition
Module #10: Proof Strategies
Foundations of Discrete Mathematics
COMP 1380 Discrete Structures I Thompson Rivers University
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.
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

CS2013 Maths for Computing Science Proof (part b) Adam Wyner University of Aberdeen Computing Science

October 2014CS2013 Maths for Computing2 Topics Equivalences that can be used to replace formulae in proofs Tableau proofs Further examples of Propositional Logic proofs. Proof rules with quantifiers.

October 2014CS2013 Maths for Computing3 Equivalences Equivalence expressions can be substituted since they do not change truth.

October 2014CS2013 Maths for Computing4 Equivalences

October 2014CS2013 Maths for Computing5 A Direct Proof 1. ((A ∨ ¬ B) ∨ C)  (D  (E  F)) 2. (A ∨ ¬ B)  ((F  G)  H) 3. A  ((E  F)  (F  G)) 4. A 5. Show: D  H 6. A ∨ ¬ B 7. (A ∨ ¬ B) ∨ C 8. (D  (E  F)) 9. (E  F)  (F  G) 10. D  (F  G) 11. (F  G)  H 12. D  H

October 2014CS2013 Maths for Computing6 A Direct Proof 1. ((A ∨ ¬ B) ∨ C)  (D  (E  F)) 2. (A ∨ ¬ B)  ((F  G)  H) 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 9. (E  F)  (F  G)IE 3,4 10. D  (F  G)HS 8,9 11. (F  G)  HIE 2,6 12. D  HHS 10,11

October 2014CS2013 Maths for Computing7 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

October 2014CS2013 Maths for Computing8 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

October 2014CS2013 Maths for Computing9 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

October 2014CS2013 Maths for Computing10 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

October 2014CS2013 Maths for Computing11 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

October 2014CS2013 Maths for Computing12 A Logical Equivalence Prove: ¬ (p ∨ (¬ p ∧ q)) is equivalent to ¬ p ∧ ¬ q 1. ¬ (p ∨ (¬ p ∧ q)) ....

October 2014CS2013 Maths for Computing13 A Logical Equivalence Prove: ¬ (p ∨ (¬ p ∧ q)) is equivalent to ¬ p ∧ ¬ q 1. ¬ (p ∨ (¬ p ∧ q))  second De Morgan 2.  first De Morgan 3.  double negation 4.  second distributive 5.  negation 6.  commutativity 7.  identity law for F

October 2014CS2013 Maths for Computing14 A Logical Equivalence Prove: ¬ (p ∨ (¬ p ∧ q)) is equivalent to ¬ p ∧ ¬ q 1. ¬ (p ∨ (¬ p ∧ q))  ¬ p ∧ ¬ (¬ p ∧ q) 2.  ¬ p ∧ (¬ (¬ p) ∨ ¬ q) 3.  ¬ p ∧ (p ∨ ¬ q) 4.  (¬ p ∧ p) ∨ ( ¬ p ∧ ¬ q) 5.  F ∨ ( ¬ p ∧ ¬ q) 6.  ( ¬ p ∧ ¬ q) ∨ F 7.  ( ¬ p ∧ ¬ q)

October 2014CS2013 Maths for Computing15 A Logical Equivalence Prove: ¬ (p ∨ (¬ p ∧ q)) is equivalent to ¬ p ∧ ¬ q 1. ¬ (p ∨ (¬ p ∧ q))  ¬ p ∧ ¬ (¬ p ∧ q)second De Morgan 2.  ¬ p ∧ (¬ (¬ p) ∨ ¬ q)first De Morgan 3.  ¬ p ∧ (p ∨ ¬ q)double negation 4.  (¬ p ∧ p) ∨ ( ¬ p ∧ ¬ q)second distributive 5.  F ∨ ( ¬ p ∧ ¬ q)negation 6.  ( ¬ p ∧ ¬ q) ∨ Fcommutativity 7.  ( ¬ p ∧ ¬ q)identity law for F

Tableau Proofs Another formal method for logical proofs. Thanks to Ulle Endriss for some slides. October 2014CS2013 Maths for Computing16

Tableau Method – How? A method for proving that a given set of formulas is not satisfiable : Given: set of premises ∆ and conclusion φ Task: prove ∆ |= φ How? show ∆ ∪ {¬φ} is not satisfiable (which is equivalent), i.e. add the complement of the conclusion to the premises and derive a contradiction (“refutation procedure”). If a proof fails, we can sometimes conclude that the set in question is satisfiable, or that the conclusion in question does not follow (ok for propositional logic; for first-order logic only in special cases). October 2014CS2013 Maths for Computing17

Construction Data structure: a proof is represented as a tableau—a binary tree, the nodes of which are labelled with formulas. Start: we start by putting the premises and the negated conclusion into the root of an otherwise empty tableau. Expansion: we apply expansion rules to the formulas on the tree, thereby adding new formulas and splitting branches. Use all premises and copy analysed formulas into all relevant branches. Closure: we close branches that are contradictory. Success: a proof is successful iff we can close all branches. October 2014CS2013 Maths for Computing18

Construction We close a branch if it contains both a formula and the same formula with a "¬" in front. Each such branch represents a way in which the original sentences might perhaps be true. Closing a branch signifies that this branch is not a way in which the original sentences could all be true. Where all the branches close, there was no way in which the original sentences could all be true. There is at most one rule that can be applied to a given formula. October 2014CS2013 Maths for Computing19

Propositional Tableau Rules October 2014CS2013 Maths for Computing20

Example (Truth Tables say?) Prove: ((P → Q) → P) → P ¬(((P → Q) → P) → P) ((P → Q) → P) ¬P ¬(P → Q)P x P ¬Q x October 2014CS2013 Maths for Computing21

Prove: P → (Q ∧ R), ¬Q ∨ ¬R |= ¬P P → (Q ∧ R), ¬Q ∨ ¬R, P ¬P(Q ∧ R) x Q R ¬Q¬Rx October 2014CS2013 Maths for Computing22

More Examples {(P → Q) → R), S → ¬P, T, (¬S → T) → Q, ¬R} {P → (Q ∨ R), ¬R → (S ∧ T), ¬T, T → U} {P ∧ R, (¬P ∨ Q) ∧ (¬Q ∨ ¬R)} {(P ∨ Q) ∧ R, ¬Q ∨ ¬R, ¬P} {¬P ∨ Q, ¬P ∨ ¬Q, P ∨ R, ¬R} {P ∧ R, P ∨ Q, ¬P ∨ ¬Q} October 2014CS2013 Maths for Computing23

Termination Assuming we analyse each formula at most once, we have: Theorem 1 (Termination) For any propositional tableau, after a finite number of steps no more expansion rules will be applicable. This must be so, because each rule results in ever shorter formulas. Note: Importantly, termination will not hold in the first- order case. October 2014CS2013 Maths for Computing24

Quantifiers How to prove with universal and existential quantifiers. October 2014CS2013 Maths for Computing25

October 2014CS2013 Maths for Computing26 Universal Instantiation  x P(x)  P(o)(substitute any constant o) The same for any other variable than x.

October 2014CS2013 Maths for Computing27 Existential Generalization P(o)  x P(x) The same for any other variable than x.

October 2014CS2013 Maths for Computing28 Universal Generalisation 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 then the inference to  x P(x) is valid! In other words...

October 2014CS2013 Maths for Computing29 Universal Generalisation 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).

October 2014CS2013 Maths for Computing30 Existential Instantiation  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.

October 2014CS2013 Maths for Computing31 Simple Formal Proof in Predicate Logic Argument: –“ All TAs compose quizzes. Ramesh is a TA. Therefore, Ramesh composes quizzes. ” First, separate the premises from conclusions: –Premise #1: All TAs compose quizzes. –Premise #2: Ramesh is a TA. –Conclusion: Ramesh composes quizzes.

October 2014CS2013 Maths for Computing32 Rendering in Logic Render the example in logic notation. 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))

October 2014CS2013 Maths for Computing33 Rendering cont… 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:

October 2014CS2013 Maths for Computing34 Formal Proof Using Natural Deduction 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)

October 2014CS2013 Maths for Computing35 A very similar proof Can you prove:  x(T(x) → E(x)) and  E(r)   T(r).

October 2014CS2013 Maths for Computing36  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)

October 2014CS2013 Maths for Computing37 Quantifier Rules

October 2014CS2013 Maths for Computing38 Longer Quantifier Proof

References and Credits Slides adapted from Michael P. Frank ' s course Textbook: Rosen. Discrete Mathematics & Its Applications. McGraw-Hill. Fifth edition. CS 2013 Maths for Computing39October 2014