FORMAL PROOFS DONU ARAPURA

Similar documents
Natural deduction for truth-functional logic

Introduction to Metalogic

Section 1.2: Propositional Logic

Logic for Computer Science - Week 4 Natural Deduction

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

Propositional Logic: Part II - Syntax & Proofs 0-0

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

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

Supplementary Logic Notes CSE 321 Winter 2009

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Manual of Logical Style

1.1 Statements and Compound Statements

Section 1.1: Logical Form and Logical Equivalence

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

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

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Lecture 5 : Proofs DRAFT

The Logic of Compound Statements cont.

THE LOGIC OF COMPOUND STATEMENTS

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

5. And. 5.1 The conjunction

Section 1.3: Valid and Invalid Arguments

Manual of Logical Style (fresh version 2018)

Proof strategies, or, a manual of logical style

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

Propositional Logic. Spring Propositional Logic Spring / 32

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

ANS: If you are in Kwangju then you are in South Korea but not in Seoul.

cis32-ai lecture # 18 mon-3-apr-2006

Propositional Logic Review

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

Propositional Logic. Fall () Propositional Logic Fall / 30

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33

Inference and Proofs (1.6 & 1.7)

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

THE LOGIC OF COMPOUND STATEMENTS

Section 1.1 Propositions

4 Derivations in the Propositional Calculus

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

PUZZLE. You meet A, B, and C in the land of knights and knaves. A says Either B and I are both knights or we are both knaves.

PHIL 50 - Introduction to Logic

Propositions and Proofs

Intermediate Logic. Natural Deduction for TFL

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

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

Arguments and Proofs. 1. A set of sentences (the premises) 2. A sentence (the conclusion)

Basic Logic and Proof Techniques

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

5. And. 5.1 The conjunction

A Little Deductive Logic

First Order Logic: Syntax and Semantics

PHIL12A Section answers, 28 Feb 2011

Artificial Intelligence: Knowledge Representation and Reasoning Week 2 Assessment 1 - Answers

A Little Deductive Logic

CITS2211 Discrete Structures Proofs

8. Reductio ad absurdum

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

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

The statement calculus and logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Math.3336: Discrete Mathematics. Propositional Equivalences

Advanced Topics in LP and FP

Logic and Proofs 1. 1 Overview. 2 Sentential Connectives. John Nachbar Washington University December 26, 2014

3 The Semantics of the Propositional Calculus

Logic for Computer Science - Week 5 Natural Deduction

CSC Discrete Math I, Spring Propositional Logic

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

Formal Logic. Critical Thinking

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

Math 300 Introduction to Mathematical Reasoning Autumn 2017 Proof Templates 1

Logic: Propositional Logic (Part I)

Writing proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Logic. Propositional Logic: Syntax

Part Two: The Basic Components of the SOFL Specification Language

Natural Deduction for Propositional Logic

Propositional natural deduction

CHAPTER 6 - THINKING ABOUT AND PRACTICING PROPOSITIONAL LOGIC

Logic. Propositional Logic: Syntax. Wffs

COMP Intro to Logic for Computer Scientists. Lecture 6

CH 59 SQUARE ROOTS. Every positive number has two square roots. Ch 59 Square Roots. Introduction

15414/614 Optional Lecture 1: Propositional Logic

Artificial Intelligence Chapter 7: Logical Agents

Propositional Equivalence

PROPOSITIONAL CALCULUS

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

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

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

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

Proposition logic and argument. CISC2100, Spring 2017 X.Zhang

Where are my glasses?

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Deductive and Inductive Logic

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

PSU MATH RELAYS LOGIC & SET THEORY 2017

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

GÖDEL S COMPLETENESS AND INCOMPLETENESS THEOREMS. Contents 1. Introduction Gödel s Completeness Theorem

Transcription:

FORMAL PROOFS DONU ARAPURA This is a supplement for M385 on formal proofs in propositional logic. Rather than following the presentation of Rubin, I want to use a slightly different set of rules which can be found in the book Logic, Language and Proof by Barwise and Etchmenedy. The list of rules here is longer, but more intuitive. 1. Formal proofs As we saw in class, an argument consists of a list of assumptions or premises φ 1,... φ n and a conclusion ψ. It is valid if ψ is true whenever the assumptions are true. We also say that ψ can be deduced from the assumptions in this case. Validity can be checked using truth tables, but the method is often cumbersome and a bit unatural. We want to look at an alternative which is perhaps closer to the way that people reason. Consider the following argument: It is raining. If it is raining, then he will take an umbrella. If he take an umbrella, he will not get wet. Therefore, he will not get wet. Most of us would agree instinctively, that this argument is clearly valid, but not because we compute truth tables. Instead we would probably reason in steps: from the first two statements, we can conclude that he will take an umbrella, then together with the third statement we would conclude that he will not get wet. We can try to mimic this kind of reasoning by introducing the idea of a formal proof. To give a formal proof of ψ from assumptions φ 1,... φ n, we construct a series of intermediate conclusions φ n+1, φ n+2..., using certain rules called rules of inference or deduction rules, until we get to our desired goal ψ. This sequence is called a proof. Of course if the argument is not valid, then a proof shouldn t exist. Perhaps the most basic rule of inference is the following, which comes with a Latin name: Rule 1 ( Modus ponens or rule of detachment.). ψ can be deduced from φ and φ ψ To see that ψ is really a valid consequence of φ and φ ψ, we consider the truth table P Q P Q T T T T F F F T T F F T Now let s construct the formal proof for the above example. Using the names R, U, W as before, we see that we have prove W from R, R U, U W. We 1

2 DONU ARAPURA write down the proof, with line numbers and explanations of the steps. Also we use horizontal lines to to separate the assumptions from the rest. Let us use MP to denote modus ponens. 1 R Assumptions 2 R U 3 U W 4 U MP 1,2 5 W MP 3,4 2. Simple Rules of Inference Although modus ponens is quite powerful, we need additional rules to be able construct interesting proofs. Since we will encounter a lot of rules, it will be helpful to organize things as follows. For each operation, we will have a pair of rules. One is called an introduction rule which will allow us to insert the operation, and another called the elimination rule which tell us how to take it out. Let s start with what we know, in this scheme modus ponens would be renamed: Rule 1 ( -elimination). ψ can be deduced from φ, φ ψ The rules for are pretty straightforward. Rule 2 ( -elimination). φ and ψ can be deduced from φ ψ Rule 3 ( -introduction). φ ψ can be deduced from φ, ψ Let s prove the commutative law P Q Q P. 1 P Q Assumption 2 P -elim 1 3 Q -elim 2 4 Q P -intro 2,3 Rule 4 ( -introduction). φ ψ and ψ φ can be deduced for φ, for any ψ. Rule 5 ( -elimination). φ can be deduced from φ Rule 6 ( -elimination). φ ψ and ψ φ can be deduced from φ ψ. Rule 7 ( -introduction). φ ψ can be deduced from φ ψ, ψ φ. Here s a simple example using the above rules. assumption ( P ) (P Q). Find a proof of R Q from 1 ( P ) (P Q) Assumption 2 P -elim 1 3 P Q -elim 1 4 P -elim 2 5 Q -elim (or MP) 3,4 6 R Q -intro 5

FORMAL PROOFS 3 3. Remaining rules of inference The remaining rules are somewhat complicated in that they involve multiple steps. The first such rule is -introduction or the method of conditional proof. Suppose we which to check that the following is valid. If it is raining, then he will take an umbrella. If he will take an umbrella then he will not get wet. Therefore, if it is raining, he will not get wet. We would probably argue as follows: Suppose it is raining. Then he will take an umbrella. Then he will not get wet. Therefore, if it is raining, he will not get wet. In other words, to prove a statement of the form φ ψ, we introduce φ as a temporary assumption and try to prove ψ. Here s the precise statement. Rule 8 ( -introduction). If ψ can be deduced from φ 1,... φ n, φ, then φ ψ can be deduced from φ 1,... φ n. If in the middle of a long proof, we wanted to establish φ ψ, we could use this method. We add φ as a temporary assumption, and then try to prove ψ. After we have done this, we conclude φ ψ and remove φ from our list of temporary assumptions. When writing the proof, we will usually use horizontal lines to help keep straight where a temporary assumption is introduced or removed. Note the emphasis on usually. If things get too cluttered, we might omit, or sometimes we add extra ones to increase readability. So the proof of R W assuming R U, U W is 1 R U Assumptions 2 U W 3 R -intro assumption 4 U -elim 1,3 5 W -elim 2,3 6 R W -intro 3-5 The next rule is -elimination or proof by cases. Here s an example from algebra. To keep the argument self contained we include basic algebraic facts. x > 2 or x < 2 If x > 2 then x 2 > 4 If x < 2 then x 2 > 4 Therefore, x 2 > 4 So when presented with φ φ, we consider the cases where φ and φ are true separately. Rule 9 ( -elimination). If ψ can be deduced for φ 1,... φ n, φ and from φ 1,... φ n, φ, then ψ can be deduced for φ 1,... φ n, φ φ. Let us know carry out the proof of the algebra example. Using symbols G: x > 2 L: x < 2 S: x 2 > 4

4 DONU ARAPURA The proof is given below: 1 G L Assumptions 2 G S 3 L S 4 G -elim assumption 1 5 S -elim 2,4 6 L -elim assumption 1 7 S -elim 3,6 8 S -elim 4-7 Here is a proof of part of a distributive law P (Q R) (P Q) (P R) 1 P (Q R) Assumption 2 P -elim assumption 1 3 P Q -intro 2 4 P R -intro 2 5 (P Q) (P R) -intro 3,4 6 Q R -elim assumption 1 7 Q -elim 4 8 R -elim 4 9 P Q -intro 7 10 P R -intro 8 11 (P Q) (P R) -intro 9,10 12 (P Q) (P R) -elim 2-11 The final rule is -introduction or the method of proof by contradiction or indirect proof. This is perhaps the least intuitive of the rules, but it is very common in mathematical arguments. The idea if you are trying to prove ψ, it is enough to assume the opposite ψ and derive a contradiction. It will be convenient to introduce a symbol Contra, which stands for contracdiction. We introduce two rules specifically for it: Rule 10 (Contra-introduction). Contra can be deduced from ψ and ψ, whatever ψ is. Rule 11 (Contra-elimination). ψ can be deduced from Contra, whatever ψ is. The last rule may seem strange, but it has the same the content as the implication F anything that we saw using truth tables. We now come to the final rule. Rule 12 ( -introduction). If Contra can be deduced from φ 1,... φ n, ψ, then ψ can be deduced from φ 1,... φ n. As an example, let us prove Q P given P Q. conditional proof and proof by contradiction. 1 P Q Assumptions 2 Q -intro assumption 3 P -intro assumption 4 Q -elim 1,3 5 Contra -intro 2,4 6 P -intro 3-5 7 Q P -intro 2-6 Here will use both

FORMAL PROOFS 5 4. More examples Give a formal proof of Q assuming P and P Q. 1 P Assumptions 2 P Q 3 P -elim assumption 2 4 Contra Contra-intro 1, 3 5 Q Contra-elim 6 Q -elim assumption 2 7 Q -elim 3-6 Prove (P Q) P Q with no assumptions. (This amounts to showing that it is a tautology.) 1 (P Q) P -intro assumption 2 P Q -elim 1 3 P -elim 1 4 Q -elim 2,3 5 (P Q) P Q -intro 1-3 Prove P Q assuming (P Q). (This part of De Morgan s law.) 1 (P Q) Assumption 2 P -intro assumption 3 P Q -intro 2 4 Contra Contra-intro 1,3 5 P -intro 2-4 6 Q -intro assumption 7 P Q -intro 2,6 8 Contra Contra-intro 1,7 9 Q -intro 6-8 10 P Q -intro 5,9 Recall that a collection of statements φ 1,... φ n is consistent if they are all true for at least one assignment of truth values to the variables, otherwise they are inconsistent. These can be checked using truth tables. Here s another way to check inconsistency: The statements are inconsistent if it possible to derive a contradiction from them. Let s check that P Q, Q R, R P are inconsistent.

6 DONU ARAPURA 1 P Q Assumptions 2 Q R 3 R P 4 P -elim 1 5 Q -elim 1 6 Q -elim assumption 2 7 Contra Contra-elim 5,6 8 R -elim assumption 2 9 P -elim 3,8 10 Contra Contra-elim 4,9 11 Contra -elim 6-10 We now consider a more substantial example starting with a verbal argument. The store is open every day except Sunday. Parking is free on Saturday and Sunday. Therefore parking is free and the store is open on Saturday. First let us reword to make the logical structure clearer. Also there is a hidden assumption that we need to make explicit, namely that Saturday is not Sunday. The store is open if the day is not Sunday. Parking is free if the day Saturday or the day is Sunday. If the day is Saturday then it is not Sunday. Therefore parking is free and the store is open if the day is Saturday. Now it s clear that the building blocks are the following statements O: The store is open. P: Parking is free. S: The day is Saturday. U: The day is Sunday. We can now translate the above argument into symbolic language as U O, S U P, S U S P O The symbol means The full truth table would require 16 lines. We analyze things in order to reduce the size. Note that for the argument to be invalid, we need a counterexample. In particular, we need to make the conclusion false. To do this we need S true and P and O both false (write out the truth table for S P O if you aren t convinced.) Now we construct a partial truth table with these values. U O S P U O S U P S U S P O T F T F T F F F T F F Notice that we didn t bother to finish the rows once we found a false conclusion. Therefore there is no way to find a counterexample, so the argument is valid. As an alternative, we give a proof of S P O assuming U O, S U P, S U

FORMAL PROOFS 7 1 U O Assumptions 2 S U P 3 S U 4 S -intro assumption 5 U -elim 3,4 6 O -elim 1,5 7 S U -intro 4 8 P -elim 2,7 9 P O -intro 8 10 S P O -intro 4-9 5. Final Comments There s a theoretical issue that we ve been sweeping under the rug that should be mentioned. That is that the method of truth tables and formal proofs yield the same result. Theorem 6 (Soundness and Completeness). An argument is valid if and only if there exists a formal proof for it from the given assumptions. A proof can be found in the book of Barwise and Etchmenedy. It s important to keep in mind that almost all proofs given in math books and papers are informal, which means that they are expressed in natural language like in English. Nevertheless they do conform to the same logical principles used here and others that we haven t gotten to yet. The point of doing formal proofs for us to understand the logical structure a bit more clearly In principle, informal arguments can be translated into formal ones, but doing so is usually neither practical nor desirable. The thing to keep in mind that informal proofs should not only be logically correct, but also readable by a human being. Another analogy to keep in mind, is the difference between describing an algorithm (which is closely related to the notion of proof) in a natural language or as a computer program written in low level computer language. 7. Homework Do problems E1, E2, E3 E4 from Rubin p. 33. For the valid arguments among these construct formal proofs, using the rules given here.