Propositional natural deduction

Similar documents
Logic As Algebra COMP1600 / COMP6260. Dirk Pattinson Australian National University. Semester 2, 2017

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

2.2: Logical Equivalence: The Laws of Logic

Propositional Equivalence

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

AMTH140 Lecture 8. Symbolic Logic

CSC Discrete Math I, Spring Propositional Logic

Proof strategies, or, a manual of logical style

Compound Propositions

Proving Things. Why prove things? Proof by Substitution, within Logic. Rules of Inference: applying Logic. Using Assumptions.

Logic: Propositional Logic (Part I)

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Topic 1: Propositional logic

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Supplementary Logic Notes CSE 321 Winter 2009

Manual of Logical Style (fresh version 2018)

Section 1.2: Propositional Logic

Propositional Logic. Spring Propositional Logic Spring / 32

COMP 2600: Formal Methods for Software Engineeing

PROPOSITIONAL CALCULUS

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Learning Goals of CS245 Logic and Computation

CISC-102 Winter 2016 Lecture 17

CHAPTER 10. Gentzen Style Proof Systems for Classical Logic

CSE 20: Discrete Mathematics

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

Natural Deduction for Propositional Logic

CITS2211 Discrete Structures Proofs

02 Propositional Logic

1.1 Language and Logic

Chapter 1: The Logic of Compound Statements. January 7, 2008

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Manual of Logical Style

1.3 Propositional Equivalences

Logic for Computer Science - Week 5 Natural Deduction

Examples. Example (1) Example (2) Let x, y be two variables, and denote statements p : x = 0 and q : y = 1. Solve. x 2 + (y 1) 2 = 0.

Inference in Propositional Logic

Propositional Resolution

Propositional Logic Part 1

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

Overview. I Review of natural deduction. I Soundness and completeness. I Semantics of propositional formulas. I Soundness proof. I Completeness proof.

15414/614 Optional Lecture 1: Propositional Logic

Formal (natural) deduction in propositional logic

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Advanced Topics in LP and FP

Logic for Computer Science - Week 4 Natural Deduction

Propositional Logic Language

Propositional logic (revision) & semantic entailment. p. 1/34

CS250: Discrete Math for Computer Science. L6: CNF and Natural Deduction for PropCalc

MAT 243 Test 1 SOLUTIONS, FORM A

Equivalence and Implication

We last time we began introducing equivalency laws.

Two hours. Note that the last two pages contain inference rules for natural deduction UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

Part I: Propositional Calculus

Propositional Logic: Syntax

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

Language of Propositional Logic

Department of Computer Science & Software Engineering Comp232 Mathematics for Computer Science

ANALYSIS EXERCISE 1 SOLUTIONS

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

Chapter 4: Classical Propositional Semantics

Math 10850, fall 2017, University of Notre Dame

Math 102 Section 08, Fall 2010 Solutions Practice for Formal Proofs of Arguments

Warm-Up Problem. Write a Resolution Proof for. Res 1/32

Chapter 11: Automated Proof Systems

2 Truth Tables, Equivalences and the Contrapositive

Proof Terminology. Technique #1: Direct Proof. Learning objectives. Proof Techniques (Rosen, Sections ) Direct Proof:

Boolean Logic. CS 231 Dianna Xu

Logic, Sets, and Proofs

Part Two: The Basic Components of the SOFL Specification Language

Tautologies, Contradictions, and Contingencies

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

A statement is a sentence that is definitely either true or false but not both.

1.1 Language and Logic

Equational Logic: Part 2. Roland Backhouse March 6, 2001

Propositional Logic: Equivalence

Logic and Inferences

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

Logic Overview, I. and T T T T F F F T F F F F

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

Math 300 Introduction to Mathematical Reasoning Autumn 2017 Proof Templates 1

cse541 LOGIC FOR COMPUTER SCIENCE

Solutions to Homework I (1.1)

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

Section 1.1: Logical Form and Logical Equivalence

A Statement; Logical Operations

Proofs. Joe Patten August 10, 2018

Deductive Systems. Lecture - 3

Valid Reasoning. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing February, Outline Truth and Validity Valid Reasoning

Propositional Logic. Fall () Propositional Logic Fall / 30

A. Propositional Logic

Transcription:

Propositional natural deduction COMP2600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2016

Major proof techniques 1 / 25 Three major styles of proof in logic and mathematics Model based computation: truth tables for propositional logic Algebraic proof: simplification rules e.g. De Morgan s Deductive reasoning: rules of inference Natural deduction is one example Other examples: tableau calculi, resolution, Hilbert calculi

Example proof using truth tables 2 / 25 Statement to be proved: (p (q r)) ((p q) r)) For all 8 (= 2 3 ) possibilities of p,q,r, calculate truth value of the statement p q r q r p (q r) p q (p q) r (p (q r)) ((p q) r))

Example proof using truth tables 2 / 25 Statement to be proved: (p (q r)) ((p q) r)) For all 8 (= 2 3 ) possibilities of p,q,r, calculate truth value of the statement p q r q r p (q r) p q (p q) r (p (q r)) ((p q) r)) T T T T T T T T

Example proof using truth tables 2 / 25 Statement to be proved: (p (q r)) ((p q) r)) For all 8 (= 2 3 ) possibilities of p,q,r, calculate truth value of the statement p q r q r p (q r) p q (p q) r (p (q r)) ((p q) r)) T T T T T T T T T T F T T T T T

Example proof using truth tables 2 / 25 Statement to be proved: (p (q r)) ((p q) r)) For all 8 (= 2 3 ) possibilities of p,q,r, calculate truth value of the statement p q r q r p (q r) p q (p q) r (p (q r)) ((p q) r)) T T T T T T T T T T F T T T T T T F T T T F T T

Example proof using truth tables 2 / 25 Statement to be proved: (p (q r)) ((p q) r)) For all 8 (= 2 3 ) possibilities of p,q,r, calculate truth value of the statement p q r q r p (q r) p q (p q) r (p (q r)) ((p q) r)) T T T T T T T T T T F T T T T T T F T T T F T T T F F F F F F T

Example proof using truth tables 2 / 25 Statement to be proved: (p (q r)) ((p q) r)) For all 8 (= 2 3 ) possibilities of p,q,r, calculate truth value of the statement p q r q r p (q r) p q (p q) r (p (q r)) ((p q) r)) T T T T T T T T T T F T T T T T T F T T T F T T T F F F F F F T F T T T F F T T

Example proof using truth tables 2 / 25 Statement to be proved: (p (q r)) ((p q) r)) For all 8 (= 2 3 ) possibilities of p,q,r, calculate truth value of the statement p q r q r p (q r) p q (p q) r (p (q r)) ((p q) r)) T T T T T T T T T T F T T T T T T F T T T F T T T F F F F F F T F T T T F F T T F T F T F F F T

Example proof using truth tables 2 / 25 Statement to be proved: (p (q r)) ((p q) r)) For all 8 (= 2 3 ) possibilities of p,q,r, calculate truth value of the statement p q r q r p (q r) p q (p q) r (p (q r)) ((p q) r)) T T T T T T T T T T F T T T T T T F T T T F T T T F F F F F F T F T T T F F T T F T F T F F F T F F T T F F T T

Example proof using truth tables 2 / 25 Statement to be proved: (p (q r)) ((p q) r)) For all 8 (= 2 3 ) possibilities of p,q,r, calculate truth value of the statement p q r q r p (q r) p q (p q) r (p (q r)) ((p q) r)) T T T T T T T T T T F T T T T T T F T T T F T T T F F F F F F T F T T T F F T T F T F T F F F T F F T T F F T T F F F F F F F T

The notion of a deductive proof 3 / 25 A proof is a sequence of steps. Each step is either: an axiom or an assumption; or a statement which follows from previous steps via a valid rule of inference. Natural deduction: for each connective, there is an introduction and an elimination rule rules are formal, but resemble natural, i.e., human reasoning

Example of a natural deduction proof 4 / 25 Statement to be proved: (p (q r)) ((q s) p) 1 p (q r) Assumption 2 p -E, 1 3 (q s) p -I, 2 4 (p (q r)) ((q s) p) -I, 1 3

Conjunction rules 5 / 25 -I (and introduction) p q p q

Conjunction rules 5 / 25 -I (and introduction) p q -E (and elimination) p q p q p p q q

Example 6 / 25 Commutativity of conjunction (derived rule) p q q p 1 p q 2 p -E, 1 3 q -E, 1 4 q p -I, 2, 3

Implication rules 7 / 25 -I (implication introduction) [ p ]. q p q This notation means that by assuming p, you can prove q. p is then discharged - no longer an assumption.

Implication rules 7 / 25 -I (implication introduction) [ p ]. q p q This notation means that by assuming p, you can prove q. p is then discharged - no longer an assumption. -E (implication elimination) p p q q

Example - transitivity of implication (derived rule) 8 / 25 We prove p q q r p r

Example - transitivity of implication (derived rule) 8 / 25 We prove p q q r p r 1 p q

Example - transitivity of implication (derived rule) 8 / 25 We prove p q q r p r 1 p q 2 q r

Example - transitivity of implication (derived rule) 8 / 25 We prove p q q r p r 1 p q 2 q r 3 p

Example - transitivity of implication (derived rule) 8 / 25 We prove p q q r p r 1 p q 2 q r 3 p 4 q -E, 1, 3

Example - transitivity of implication (derived rule) 8 / 25 We prove p q q r p r 1 p q 2 q r 3 p 4 q -E, 1, 3 5 r -E, 2, 4

Example - transitivity of implication (derived rule) 8 / 25 We prove p q q r p r 1 p q 2 q r 3 p 4 q -E, 1, 3 5 r -E, 2, 4 6 p r -I, 3 5

Example - transitivity of implication (derived rule) 8 / 25 We prove p q q r p r 1 p q 2 q r 3 p 4 q -E, 1, 3 5 r -E, 2, 4 6 p r -I, 3 5 Lines 1 and 2 are the assumptions given, you may use these throughout the proof Line 3 is an assumption made within the proof, you may use it only within its scope (lines 3 to 5)

Notation: justification of a step 9 / 25

Notation: justification of a step 9 / 25 1 p q

Notation: justification of a step 9 / 25 1 p q 2 p

Notation: justification of a step 9 / 25 1 p q 2 p 3 q -E, 1, 2

Notation: justification of a step 9 / 25 1 p q 2 p 3 q -E, 1, 2 4 p q -I, 2 3

Notation: justification of a step 9 / 25 1 p q 2 p 3 q -E, 1, 2 4 p q -I, 2 3 This is a rather silly proof, we succeed in proving what we started with. But it illustrates the meaning of the line number notation: -E,1,2 means that rule -E proves line 3 from lines 1 and 2 -I,2-3 means rule -I proves line 4 from the fact that we could assume line 2 and (using that assumption) prove line 3

Rules involving assumptions 10 / 25

Rules involving assumptions 10 / 25 1 p q

Rules involving assumptions 10 / 25 1 p q 2 q r

Rules involving assumptions 10 / 25 1 p q 2 q r 3 p

Rules involving assumptions 10 / 25 1 p q 2 q r 3 p 4 q -E, 1, 3

Rules involving assumptions 10 / 25 1 p q 2 q r 3 p 4 q -E, 1, 3 5 r -E, 2, 4

Rules involving assumptions 10 / 25 1 p q 2 q r 3 p 4 q -E, 1, 3 5 r -E, 2, 4 6 q r WRONG -I, 4, 5

Rules involving assumptions 10 / 25 1 p q 2 q r 3 p 4 q -E, 1, 3 5 r -E, 2, 4 6 q r WRONG -I, 4, 5 If a statement is inside the scope of an assumption, then it depends on that assumption. Given p q and q r, we then assumed p and proved q r, but q r depends on p. Indentation and vertical lines indicate scoping Similar to scoping in program code: eg lines 3 to 5 are a a method, and p is a local variable to that method.

Useless assumptions 11 / 25 You can assume anything, but it might not be useful.

Useless assumptions 11 / 25 You can assume anything, but it might not be useful. 1 p q

Useless assumptions 11 / 25 You can assume anything, but it might not be useful. 1 p q 2 q -E, 1

Useless assumptions 11 / 25 You can assume anything, but it might not be useful. 1 p q 2 q -E, 1 3 (p q) q -I, 1 2

Useless assumptions 11 / 25 You can assume anything, but it might not be useful. 1 p q 2 q -E, 1 3 (p q) q -I, 1 2 1 p You are a giraffe 2 You are a giraffe -E, 1 3 p You are a giraffe You are a giraffe -I, 1 2

Disjunction rules 12 / 25 -I (or introduction) p p q p q p

Disjunction rules 12 / 25 -I (or introduction) p p q p q p -E (or elimination) [p] [q].. p q r r r

-E template 13 / 25

-E template 13 / 25 1 p q

-E template 13 / 25 1 p q 2 p

-E template 13 / 25 1 p q 2 p..

-E template 13 / 25 1 p q 2 p.. a r

-E template 13 / 25 1 p q 2 p.. a b r q

-E template 13 / 25 1 p q 2 p.. a b r q..

-E template 13 / 25 1 p q 2 p.. a b r q.. c r

-E template 13 / 25 1 p q 2 p.. a b r q.. c r d r -E, 1, 2 a, b c

Example: commutativity of disjunction (derived rule) 14 / 25 p q q p

Example: commutativity of disjunction (derived rule) 14 / 25 1 p q p q q p

Example: commutativity of disjunction (derived rule) 14 / 25 p q q p 1 p q 2 p

Example: commutativity of disjunction (derived rule) 14 / 25 p q q p 1 p q 2 p 3 q p -I, 2

Example: commutativity of disjunction (derived rule) 14 / 25 p q q p 1 p q 2 p 3 q p -I, 2 4 q

Example: commutativity of disjunction (derived rule) 14 / 25 p q q p 1 p q 2 p 3 q p -I, 2 4 q 5 q p -I, 4

Example: commutativity of disjunction (derived rule) 14 / 25 p q q p 1 p q 2 p 3 q p -I, 2 4 q 5 q p -I, 4 6 q p -E, 1, 2 3, 4 5

Negation rules 15 / 25 Idea: assume the opposite of what you want to prove and find a contradiction so your assumption must have been wrong -I (not introduction) [p]. q q p

Negation rules 15 / 25 Idea: assume the opposite of what you want to prove and find a contradiction so your assumption must have been wrong -I (not introduction) -E (not elimination) (eliminates from an assumption) [p]. q q p [ p]. q q p

Example: double negation introduction (derived rule) 16 / 25 p p It is raining It is not the case that is is not raining

Example: double negation introduction (derived rule) 16 / 25 p p It is raining It is not the case that is is not raining

Example: double negation introduction (derived rule) 16 / 25 p p It is raining It is not the case that is is not raining 1 p

Example: double negation introduction (derived rule) 16 / 25 p p It is raining It is not the case that is is not raining 1 p 2 p

Example: double negation introduction (derived rule) 16 / 25 p p It is raining It is not the case that is is not raining 1 p 2 p 3 p p -I, 1, 2 4 p I, 2 3

Example: contradiction elimination (derived rule) 17 / 25 p p q

Example: contradiction elimination (derived rule) 17 / 25 p p q

Example: contradiction elimination (derived rule) 17 / 25 p p q 1 p p

Example: contradiction elimination (derived rule) 17 / 25 p p q 1 p p 2 q

Example: contradiction elimination (derived rule) 17 / 25 p p q 1 p p 2 q 3 p p R, 1

Example: contradiction elimination (derived rule) 17 / 25 p p q 1 p p 2 q 3 p p R, 1 4 q E, 2 3

Example: double negation elimination (derived rule) 18 / 25 p p

Example: double negation elimination (derived rule) 18 / 25 p p

Example: double negation elimination (derived rule) 18 / 25 1 p p p

Example: double negation elimination (derived rule) 18 / 25 p p 1 p 2 p

Example: double negation elimination (derived rule) 18 / 25 p p 1 p 2 p 3 p p -I, 1, 2 4 p E, 2 3

Equivalence 19 / 25 p q means p is true if and only if q is true We can make the definition p q (p q) (q p) which would naturally give us these rules introduction rule: p q q p elimination rules: p q p q p q p q q p

Equivalence Rules 20 / 25 Alternatively we can get rules which don t involve the symbol -I ( introduction) [p] [q] -E ( elimination).. q p p q p q p p q q Note the similarities to the -I and -E rules q p

Which rule to use next? 21 / 25 Guided by the form of your goal, and what you already have proved form ie, look at the connective:,,, always can consider using -E (not elimination) rule to prove p q, -I (or introduction) may not work p p q q p q p may not be necessarily true, q may not be necessarily true

To prove p q, sometimes you need to do this: 22 / 25 1 Using -E, assume (p q) (hoping to prove some contradiction) 2 When is (p q) true? When both p and q false! 3 From (p q) how to prove p? (next slide) 4 Having proved both p and q, prove some further contradiction Exercise: prove p q p q

Not-or elimination (derived rule) 23 / 25 (p q) p

Not-or elimination (derived rule) 23 / 25 (p q) p

Not-or elimination (derived rule) 23 / 25 (p q) p 1 (p q)

Not-or elimination (derived rule) 23 / 25 (p q) p 1 (p q) 2 p

Not-or elimination (derived rule) 23 / 25 (p q) p 1 (p q) 2 p 3 p q -I, 2

Not-or elimination (derived rule) 23 / 25 (p q) p 1 (p q) 2 p 3 p q -I, 2 4 (p q) (p q) -I, 1, 3

Not-or elimination (derived rule) 23 / 25 (p q) p 1 (p q) 2 p 3 p q -I, 2 4 (p q) (p q) -I, 1, 3 5 p I, 2 4

Proving a contrapositive rule 24 / 25 In the same way, whenever you can prove any q then you can prove p p q

Proving a contrapositive rule 24 / 25 In the same way, whenever you can prove any q then you can prove p p q

Proving a contrapositive rule 24 / 25 In the same way, whenever you can prove any q then you can prove p p q 1 q

Proving a contrapositive rule 24 / 25 In the same way, whenever you can prove any q then you can prove p p q 1 q 2 p

Proving a contrapositive rule 24 / 25 In the same way, whenever you can prove any q then you can prove p p q 1 q 2 p 3 q your proof of q from p

Proving a contrapositive rule 24 / 25 In the same way, whenever you can prove any q then you can prove p p q 1 q 2 p 3 q your proof of q from p 4 q q -I, 1, 3

Proving a contrapositive rule 24 / 25 In the same way, whenever you can prove any q then you can prove p p q 1 q 2 p 3 q your proof of q from p 4 q q -I, 1, 3 5 p I, 2 4

Law of the excluded middle (derived) 25 / 25 p p Everything must either be or not be. Russell

Law of the excluded middle (derived) 25 / 25 p p Everything must either be or not be. Russell

Law of the excluded middle (derived) 25 / 25 p p Everything must either be or not be. Russell 1 (p p)

Law of the excluded middle (derived) 25 / 25 p p Everything must either be or not be. Russell 1 (p p) 2 p -E (previous slide), 1

Law of the excluded middle (derived) 25 / 25 p p Everything must either be or not be. Russell 1 (p p) 2 p -E (previous slide), 1 3 p -E (previous slide), 1

Law of the excluded middle (derived) 25 / 25 p p Everything must either be or not be. Russell 1 (p p) 2 p -E (previous slide), 1 3 p -E (previous slide), 1 4 p p -I, 2, 3 5 p p E, 1 4