Lecture 1: Propositional Logic (I)

Similar documents
(p == train arrives late) (q == there are taxis) (r == If p and not q, then r. Not r. p. Therefore, q. Propositional Logic

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

1 Propositional logic

15414/614 Optional Lecture 1: Propositional Logic

03 Propositional Logic II

Introduction to Theoretical Computer Science

The statement calculus and logic

PSU MATH RELAYS LOGIC & SET THEORY 2017

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

A. Incorrect! This inequality is a disjunction and has a solution set shaded outside the boundary points.

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

EECS 1028 M: Discrete Mathematics for Engineers

Propositions. Frequently, we will use the word statement instead of proposition.

Logic of Sentences (Propositional Logic) is interested only in true or false statements; does not go inside.

Discrete Structures for Computer Science

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

Propositional logic. Programming and Modal Logic

PROPOSITIONAL CALCULUS

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

Propositional Logic. Fall () Propositional Logic Fall / 30

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Chapter 5: Section 5-1 Mathematical Logic

Today s Topic: Propositional Logic

A Quick Lesson on Negation

DISCRETE MATHEMATICS BA202

CSC Discrete Math I, Spring Propositional Logic

Propositional Logic. Spring Propositional Logic Spring / 32

Part Two: The Basic Components of the SOFL Specification Language

Propositional Logic. CS 3234: Logic and Formal Systems. Martin Henz and Aquinas Hobor. August 26, Generated on Tuesday 31 August, 2010, 16:54

Propositional logic. Programming and Modal Logic

SE 212: Logic and Computation. se212 Nancy Day

Introduction to Metalogic

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

FORMAL PROOFS DONU ARAPURA

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

A Little Deductive Logic

Logic and Propositional Calculus

Propositional Logic Not Enough

MAT2345 Discrete Math

Advanced Topics in LP and FP

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

1 Propositional Logic

Propositions and Proofs

A Little Deductive Logic

CSE 20: Discrete Mathematics

Chapter 1: Formal Logic

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Mathematics for linguists

Natural Deduction for Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

CHAPTER 6 - THINKING ABOUT AND PRACTICING PROPOSITIONAL LOGIC

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Deduction by Daniel Bonevac. Chapter 3 Truth Trees

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

THE LOGIC OF COMPOUND STATEMENTS

THE LOGIC OF COMPOUND STATEMENTS

GENERAL MATHEMATICS 11

Symbolic Logic. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing February 5 6,

Propositional Logic George Belic

Chapter 4, Logic using Propositional Calculus Handout

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

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

CS 512, Spring 2016, Handout 02 Natural Deduction, and Examples of Natural Deduction, in Propositional Logic

Discrete Structures for Computer Science

02 Propositional Logic

Topics in Logic and Proofs

Propositional Logic Language

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

1.1 Language and Logic

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship.

Introduction to Intuitionistic Logic

Ella failed to drop the class. Ella dropped the class.

Deductive Systems. Lecture - 3

Discrete Mathematics

3 Propositional Logic

Introducing Proof 1. hsn.uk.net. Contents

Predicate Logic & Quantification

Sec$on Summary. Propositions Connectives. Truth Tables. Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional

TRUTH TABLES LOGIC (CONTINUED) Philosophical Methods

Cambridge University Press How to Prove it: A Structured Approach: Second edition Daniel J. Velleman Excerpt More information

Unit 1 Logic Unit Math 114

a. ~p : if p is T, then ~p is F, and vice versa

ARTIFICIAL INTELLIGENCE

Inference in Propositional Logic

DEDUCTIVE REASONING Propositional Logic

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

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

Mathematical Logic Part One

To reason to a correct conclusion, we must build our arguments on true statements. Sometimes it is helpful to use truth tables. Simple Truth Table p

Unit 1 Logic Unit Math 114

3.2: Compound Statements and Connective Notes

Lecture Notes on Inductive Definitions

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

1.1 Language and Logic

Chapter 1 Logic Unit Math 114

Logical Representations. LING 7800/CSCI 7000 Martha Palmer 9/30/2014

Logic for Computer Science - Week 5 Natural Deduction

INTRODUCTION TO LOGIC. Propositional Logic. Examples of syntactic claims

Transcription:

Lecture 1: Propositional Logic (I) Fadoua Ghourabi Ochanomizu University ghourabi.fadoua@ocha.cc.ac.jp Octobre 12, 2016 1 / 36

Contents 1 Declarative sentences 2 Constructing propositions 3 Quizz 4 Natural deduction Rules for conjunction Rules for double negation 2 / 36

First examples Is this reasoning correct? Example 1.1 If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station. What do you think of the next one? Example 1.2 If it is raining and Jane does not have her umbrella with her, then she will get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella with her. 3 / 36

First examples Is this reasoning correct? Example 1.1 If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station. What do you think of the next one? Example 1.2 If it is raining and Jane does not have her umbrella with her, then she will get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella with her. 3 / 36

First examples How to prove that the reasonings in Examples 1.1 & 1.2 are correct? We first need to develop a language to model the logical reasoning in Example 1.1 & 1.2 Propositional logic (Logicomix) 4 / 36

Proposition Proposition is a declarative sentence which we can evaluate to True or False Examples of declarative sentences (1) The sum of 3 and 5 equals 10. (2) Prof. Ohsumi won the 2016 Nobel Prize in Physiology/Medicine (3) Jane is lying. (4) Every even natural number > 2 is the sum of two prime numbers. 5 / 36

Proposition Proposition is a declarative sentence which we can evaluate to True or False Examples of declarative sentences (1) The sum of 3 and 5 equals 10. (2) Prof. Ohsumi won the 2016 Nobel Prize in Physiology/Medicine (3) Jane is lying. (4) Every even natural number > 2 is the sum of two prime numbers. 5 / 36

Proposition Proposition is a declarative sentence which we can evaluate to True or False Examples of non-declarative sentences (1) Ready, steady, go! (2) Could you please explain what is a proposition? (3) May you find much happiness. 6 / 36

Proposition A language for propositional logic To translate English declarative sentences into strings of symbols To focus on the reasoning rather than the meaning To define a systematic approach to evaluate to True or False If p and not q, then r. Not r. p. Therefore, q Example 1.1 If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station. Example 1.2 If it is raining and Jane does not have her umbrella with her, then she will get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella with her. 7 / 36

Atom An atom is an atomic declarative sentence Atom The number 5 is even. The sun is shinning. Are these declarative sentences atoms? If the sun is shinning, then I go for a hike in the mountain. I am not late. 8 / 36

Atom An atom is an atomic declarative sentence Atom The number 5 is even. The sun is shinning. Are these declarative sentences atoms? If the sun is shinning, then I go for a hike in the mountain. I am not late. An atom is a non-negative sentence I am late. is an atom. I am not late. is not an atom. 8 / 36

Atom An atom is an atomic declarative sentence Atom The number 5 is even. The sun is shinning. Are these declarative sentences atoms? If the sun is shinning, then I go for a hike in the mountain. I am not late. An atom is a non-negative sentence I am late. is an atom. I am not late. is not an atom. 8 / 36

Constructing propositions Declarative sentence: If the sun is shinning and I am not sick, then I go for a hike in the mountain. (1) Single out atoms If {the sun is shinning} and not {I am sick}, then {I go for a hike in the mountain}. 9 / 36

Constructing propositions Declarative sentence: If the sun is shinning and I am not sick, then I go for a hike in the mountain. (1) Single out atoms If {the sun is shinning} and not {I am sick}, then {I go for a hike in the mountain}. (2) Assign symbols p, q, r,... to atoms p: The sun is shinning. q: I am sick. r : I go for a hike in the mountain. 9 / 36

Constructing propositions Declarative sentence: If the sun is shinning and I am not sick, then I go for a hike in the mountain. (1) Single out atoms If {the sun is shinning} and not {I am sick}, then {I go for a hike in the mountain}. (2) Assign symbols p, q, r,... to atoms p: The sun is shinning. q: I am sick. r : I go for a hike in the mountain. (3) Form a proposition by connecting atoms using logical operators If {the sun is shinning} and not {I am sick}, then {I go for a hike in the mountain}. (p ( q)) r 9 / 36

Constructing propositions Declarative sentence: If the sun is shinning and I am not sick, then I go for a hike in the mountain. (1) Single out atoms If {the sun is shinning} and not {I am sick}, then {I go for a hike in the mountain}. (2) Assign symbols p, q, r,... to atoms p: The sun is shinning. q: I am sick. r : I go for a hike in the mountain. (3) Form a proposition by connecting atoms using logical operators If {the sun is shinning} and not {I am sick}, then {I go for a hike in the mountain}. (p ( q)) r 9 / 36

Logical operators q denotes the negation of q. We say not q. example: I am not sick. q q True False False True p q denotes the conjunction of p and q. We say p and q example. The sun is shinning and I am sick. p q p q True True True False True False True False False False False False 10 / 36

Logical operators q denotes the negation of q. We say not q. example: I am not sick. q q True False False True p q denotes the conjunction of p and q. We say p and q example. The sun is shinning and I am sick. p q p q True True True False True False True False False False False False 10 / 36

Logical operators p q denotes the disjunction of p and q. We say p or q which means at least one of p and q is true. p q p q True True True example. The sun is shinning or I am sick. False True True True False True False False False p q denotes the implication between p and q. We say p implies q which means that q is a logical consequence of p: example. If I put money in the vending machine then I get a drink. p q p q True True True True False False False True True False False True 11 / 36

Logical operators p q denotes the disjunction of p and q. We say p or q which means at least one of p and q is true. p q p q True True True example. The sun is shinning or I am sick. False True True True False True False False False p q denotes the implication between p and q. We say p implies q which means that q is a logical consequence of p: example. If I put money in the vending machine then I get a drink. p q p q True True True True False False False True True False False True 11 / 36

Logical operators If the sun is shinning and I am not sick, then I go for a hike in the mountain. p: The sun is shinning. q: I am sick. r: I go for a hike in the mountain. (p ( q)) r We can unambiguously omit some of the brackets because: (1) Binding priorities >, > (p ( q)) r p q r (p q) p q 12 / 36

Logical operators If the sun is shinning and I am not sick, then I go for a hike in the mountain. p: The sun is shinning. q: I am sick. r: I go for a hike in the mountain. (p ( q)) r We can unambiguously omit some of the brackets because: (1) Binding priorities >, > (p ( q)) r p q r (2) Right associativity of (p q) p q p q r p (q r) 12 / 36

Logical operators If the sun is shinning and I am not sick, then I go for a hike in the mountain. p: The sun is shinning. q: I am sick. r: I go for a hike in the mountain. (p ( q)) r We can unambiguously omit some of the brackets because: (1) Binding priorities >, > (p ( q)) r p q r (2) Right associativity of (p q) p q p q r p (q r) 12 / 36

She brought neither pen nor pencil. p: She brought a pen., q: She brought a pencil. p q Cancer will not be cured unless its cause is determined and a new drug for cancer is found. p: The cause of cancer is determined., q: A new drug of cancer is found., r: Cancer is cured. p q r 13 / 36

Quizz 121016 1/ Make sure that you fully understand the binding priorities by inserting as many brackets as possible. e.g. p q r means (p q) r since binds more tightly than (a) p q p q (b) p ( q p r) (c) Why p q r is problematic? 2/ Translate the following English sentences into propositions. (a) If the train arrives late and there are no taxis at the station, then John is late for his meeting. (b) The weather tomorrow is either rainy or cloudy. (c) No teacher. No students. No class. (d) Today, it will rain or shine, but not both. 14 / 36

Sequent Example 1.1 If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station. p: The train arrives late. q: There are taxis at the station. p q r r: John is late for his meeting. 15 / 36

Sequent Example 1.1 If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station. p: The train arrives late. q: There are taxis at the station. r: John is late for his meeting. p q r r 16 / 36

Sequent Example 1.1 If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station. p: The train arrives late. q: There are taxis at the station. r: John is late for his meeting. p q r r p 17 / 36

Example 1.1 Sequent If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting.the train did arrive late. Therefore, there were taxis at the station. p: The train arrives late. q: There are taxis at the station. r: John is late for his meeting. From p q r r p infer q suppose we have propositions p q r, r, p that we call the premises we apply proof rules, that we call natural deduction rules, to premises and propositions inferred from premises eventually, we obtain proposition q that we call the conclusion 18 / 36

Example 1.1 Sequent If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting.the train did arrive late. Therefore, there were taxis at the station. p: The train arrives late. q: There are taxis at the station. r: John is late for his meeting. From p q r r p infer q suppose we have propositions p q r, r, p that we call the premises we apply proof rules, that we call natural deduction rules, to premises and propositions inferred from premises eventually, we obtain proposition q that we call the conclusion 18 / 36

Sequent p q r, r, p }{{} premises q }{{} conclusion φ 1, φ 2,..., φ n }{{} premises ψ }{{} conclusion The above expression is called sequent If a proof is found then the sequent is valid we manage to infer the conclusion ψ by applying natural deduction rules on propositions (premises and propositions inferred from premises) 19 / 36

Sequent p q r, r, p }{{} premises q }{{} conclusion φ 1, φ 2,..., φ n }{{} premises ψ }{{} conclusion The above expression is called sequent If a proof is found then the sequent is valid we manage to infer the conclusion ψ by applying natural deduction rules on propositions (premises and propositions inferred from premises) What are the natural deduction rules? How to choose them? 19 / 36

Sequent p q r, r, p }{{} premises q }{{} conclusion φ 1, φ 2,..., φ n }{{} premises ψ }{{} conclusion The above expression is called sequent If a proof is found then the sequent is valid we manage to infer the conclusion ψ by applying natural deduction rules on propositions (premises and propositions inferred from premises) What are the natural deduction rules? How to choose them? 19 / 36

Rules for conjunction: (1) and-introduction If we have φ and ψ, we can conclude φ ψ Note that φ and ψ can be any proposition φ ψ φ ψ i Example p: The sun is shining., q: I am not sick. p: They met yesterday, q r: They took a cup of coffee or went for a walk p q p q p q r p (q r) i i 20 / 36

Rules for conjunction: (1) and-introduction If we have φ and ψ, we can conclude φ ψ Note that φ and ψ can be any proposition φ ψ φ ψ i Example p: The sun is shining., q: I am not sick. p: They met yesterday, q r: They took a cup of coffee or went for a walk p q p q p q r p (q r) i i 20 / 36

Rules for conjunction: (2) and-elimination If we have φ ψ then we can conclude φ If we have φ ψ then we can conclude ψ Example p: The sun is shining., q: I am not sick. φ ψ φ φ ψ ψ p q p p q q e 1 e 2 e 1 e 2 21 / 36

Rules for conjunction: (2) and-elimination If we have φ ψ then we can conclude φ If we have φ ψ then we can conclude ψ Example p: The sun is shining., q: I am not sick. φ ψ φ φ ψ ψ p q p p q q e 1 e 2 e 1 e 2 pattern matching: φ ψ φ e 1 φ ψ ψ e 2 21 / 36

Rules for conjunction: (2) and-elimination If we have φ ψ then we can conclude φ If we have φ ψ then we can conclude ψ Example p: The sun is shining., q: I am not sick. φ ψ φ φ ψ ψ p q p p q q e 1 e 2 e 1 e 2 pattern matching: φ ψ φ e 1 φ ψ ψ e 2 21 / 36

Rules for conjunction: Example We prove that p q, r q r is valid (1) Write down the premises, leave a gap, and then write the conclusion 1. p q premise 2. r premise q r 22 / 36

Rules for conjunction: Example We prove that p q, r q r is valid (1) Write down the premises, leave a gap, and then write the conclusion (2) Apply suitable natural deduction rules to fill the gap, in our example: 1. p q premise 2. r premise q r 23 / 36

Rules for conjunction: Example We prove that p q, r q r is valid (1) Write down the premises, leave a gap, and then the conclusion (2) Apply suitable natural deduction rules to fill the gap, in our example: We apply e 2 to the first premise, which gives us q Then, we apply i to q and the second premise, which gives us q r (pay attention to the order 3, 2) 1. p q premise 2. r premise 3. q e 2 1 4. q r Recall: φ ψ φ ψ i φ ψ φ e 1 φ ψ ψ e 2 24 / 36

Rules for conjunction: Example We prove that p q, r q r is valid (1) Write down the premises, leave a gap, and then the conclusion (2) Apply suitable natural deduction rules to fill the gap, in our example: We apply e 2 to the first premise, which gives us q Then, we apply i to q and the second premise, which gives us q r (pay attention to the order 3, 2) 1. p q premise 2. r premise 3. q e 2 1 4. q r i 3, 2 Recall: φ ψ φ ψ i φ ψ φ e 1 φ ψ ψ e 2 25 / 36

Rules for conjunction: Example We prove that p q, r q r is valid (1) Write down the premises, leave a gap, and then the conclusion (2) Apply suitable natural deduction rules to fill the gap, in our example: We apply e 2 to the first premise, which gives us q Then, we apply i to q and the second premise, which gives us q r (pay attention to the order 3, 2) Ja`skowski-style proof 1. p q premise 2. r premise 3. q e 2 1 4. q r i 3, 2 Gentzen-style proof p q q e 2 q r r i Recall: φ ψ φ ψ i φ ψ φ e 1 φ ψ ψ e 2 26 / 36

Rules for conjunction: First example with Isabelle theory examples imports Main names begin end Open a new file and save it examples.thy Start a theory with the name examples Download theory names.thy (ghourabi.net/tp16.html) and save it in the same folder as examples.thy All the definitions and proofs are delimited by begin and end 27 / 36

Rules for conjunction: First example with Isabelle General structure of a (propositional logic) proof in Isar language lemma name: assumes assm 1 and and assm n shows goal proof -... [Steps of the proof]... qed A name is given to lemma so that, once proved, it can be used to prove other lemmas assm 1 assm n are premises goal is the conclusion The above lemma defines the following sequent: assm 1,, assm n goal 28 / 36

Rules for conjunction: First example with Isabelle We prove that p q, r q r is valid lemma example1: assumes p q and r shows q r proof -...... qed [Steps of the proof] try: thm and introduction thm and elimination1 thm and elimination2 Can you guess the natural deduction rules? 29 / 36

Rules for conjunction: First example with Isabelle We prove that p q, r q r is valid lemma example1: assumes 1: p q and 2: r shows q r proof - from 1 have 3: q by (rule and elimination2) from 3 and 2 show q r by (rule and introduction) qed General scheme of an intermediate step of the proof from 1 have 3: q by (rule and elimination2) General scheme of the final step of the proof (no goal is left) from 3 and 2 show q r by (rule and introduction) 30 / 36

Rules for conjunction: First example with Isabelle We prove that p q, r q r is valid lemma example1: assumes 1: p q and 2: r shows q r proof - from 1 have 3: q by (rule and elimination2) from 3 and 2 show q r by (rule and introduction) qed General scheme of an intermediate step of the proof from 1 have 3: q by (rule and elimination2) General scheme of the final step of the proof (no goal is left) from 3 and 2 show q r by (rule and introduction) 30 / 36

Rules for conjunction: Second example with Isabelle Prove that p q q p is valid (1) on paper (2) with Isabelle 31 / 36

Rules for double negation: (3) notnot elimination It is not true that it is not raining. It is raining. 32 / 36

Rules for double negation: (3) notnot elimination It is not true that it is not raining. It is raining. φ φ e 32 / 36

Rules for double negation: (3) notnot elimination It is not true that it is not raining. It is raining. φ φ e 32 / 36

Rules for double negation: (4) notnot elimination It is not true that it is not raining. It is raining. φ φ i 33 / 36

Rules for double negation: Example Prove that p, (q r) p r 1. p premise 2. (q r) premise p r 34 / 36

Rules for double negation: Example Prove that p, (q r) p r 1. p premise 2. (q r) premise 3. p i 1 4. q r e 2 p r 35 / 36

Rules for double negation: Example Prove that p, (q r) p r 1. p premise 2. (q r) premise 3. p i 1 4. q r e 2 5. r e 2 6. p r i 3, 5 Remember: φ ψ ψ φ ψ φ ψ e 2 i Try the proof in Isabelle! 36 / 36