1 propositional proofs 2. rules of inference and formal proofs 2

24
1 Propositional Proofs 2

Upload: eric-wilson

Post on 12-Jan-2016

257 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

1

Propositional Proofs2

Page 2: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Rules of Inference and Formal Proofs

Proofs in mathematics are valid arguments that establish the truth of mathematical statements. An argument is sequence of propositions. All but the final

proposition are called premises and the final proposition is called the conclusion.

The argument is valid if the conclusion (final statement) follows from the truth of the preceding statements (premises).

In other words, an argument form with premises p1; p2; : : ; pn and conclusion q is valid if and only if

(p1 ^ p2 ^ ^ pn) q

Rules of inference are templates for building valid arguments.

We will study rules of inferences for compound propositions, for quantified statements, and then see how to combine them.

These will be the main ingredients needed in formal proofs.

2

Page 3: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Nine Basic Inference Rules

Modus Ponens (MP)p qPq

Modus Tollens (MT)p q~q ~p

Disjunctive Syllogism (DS)

p q~ Pq

Hypothetical Syllogism (HS)p qq r p r

Simplificationp q p

Conjunctionp q p q

Additionp p q

Constructive Dilemma

p qp rq sr s

Absorptionp q : : p (p q)

3

Page 4: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Rules of Equivalence

4

Double Negation (DN) p :: ~ ~ p ~ ~ p :: p

DeMorgan (DM) ~(p q) :: (~p ~q) ~(p q) :: (~p ~q)

Association (Asso)(p q) r :: p (q r)(p q) r :: p (q r)

Distribution (Dist)[p (q r)] :: [(p q) (p r)][p (q r)] :: [(p q) (p r)]

Material Implication (MI)

(p q) :: (~p q)

Exportation (Exp)((p q) r) :: (p (q r))

Material Equivalence (ME)(p q) :: [(p q) (~p ~q)](p q) :: [(p q) (q p)]

Redundancy (Re)p :: (p p)p :: (p p)

Contraposition (Cont)(p q) :: (~q ~p)

Commutation (Comm) p q :: q p p q :: q p

Page 5: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Examples

Ex.1: State which rule of inference is the basis of the following argument: “It is below freezing now. Therefore, it is either below freezing or raining now.”

Sol: Let p be “It is below freezing now” and q be “It is raining now.” Then the argument is of the form

p

∴ p q ∨Thus it is addition

5

Page 6: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Examples

Ex.2: State which rule of inference is used in the argument:

If it rains today, then we will not have a barbecue today. If we do not have a barbecue today, then we will not have a barbecue tomorrow. Therefore, if it rains today, then we will not have a barbecue tomorrow.

Sol: : Let p be “It is raining today”, q be “We will not have a barbecue today” and r be “We will not have a barbecue tomorrow.” Then the argument is of the form

p→q

q→r

∴ p→r

So this argument is a hypothetical syllogism

6

Page 7: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Ex. 1

Show that the hypotheses: It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny. If we do not go swimming, then we will take a field trip. If we take a field trip, then we will be home by sunset.

lead to the conclusion: We will be home by the sunset.

Main Steps

1. Translate the statements into proposional logic.

2. Write a formal proof, a sequence of steps that state hypotheses or apply inference rules to previous steps.

7

Page 8: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Ex. 1 Proof

Show that the hypotheses: It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny. If we do not go swimming, then we will take a field trip. If we take a field trip, then we will be home by sunset.

lead to the conclusion: We will be home by the sunset.

Where: s: \it is sunny this afternoon“ c: \it is colder than yesterday“ w: \we will go swimming“ t: \we will take a field trip. h: \we will be home by the sunset."

8

Step Reason

1. premise

2. simplification

3. premise

4. 2, 3 modus tollens

5. premise

6. t 4, 5 modus ponens

7. premise

8. h 6, 7 modus ponens

Page 9: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Ex. 2

Show that the hypotheses: The space shuttle landed in Florida (f ) or it landed in California (c) If the space shuttle landed in California then the alternate landing

shuttle was used (a) But the alternate landing shuttle was not used. Therefore, the space shuttle was landed in Florida

9

Step Reason

1. P1

2. P2

3. P3

4. 2, 3 modus tollens

5. 1 MI

6. 4, 5 modus tollens

1. P1

2. P2

3. P3

C:

Page 10: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Ex. 3

Show that the hypotheses: If the February has 29 days (d ), then it is leap year (l ) If it is a leap year, then there will be a presidential election (e) But there is not a presidential election. Therefore, February does not have 29 days

10

Step Reason

1. P1

2. P2

3. P3

4. 1, 2 H.S

5. 3, 4 MT

1. P1

2. P2

3. P3

C:

Page 11: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Ex. 4

1. Premise

2. Premise

3. Premise

4. Premise

5. 2, 4 MT

6. 1, 5 DS

7. 3, 6 MP

11

Using line numbers and the abbreviations for the rules to inference the following

1. Premise

2. Premise

3. Premise

4. Premise

5. 1,2, 3 CD

6. 4, 5 DS

Another Solution

1.

3.

4.

Page 12: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Example

Prove the theorem

(p q) (q p)

using only the axioms and inference rules

12

Page 13: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Resolution Theorem Intro.

Propositional resolution: is an extremely powerful rule of inference for Propositional Logic.

What's more, the search space using propositional resolution is much smaller than for standard propositional logic.

Before we talk about proof, with the idea that you write down some promises, statements that you’re given, and then you try to derive something from them.

Resolution: is the way that pretty much every modern automated theorem-prover is implemented.

It's apparently the best way for computers to think about proving things.

13

Page 14: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Clausal Form

Propositional resolution works only on expressions in clausal form. Before the rule can be applied, the premises and conclusions must be converted to this form.

A literal is either an atomic sentence or a negation of an atomic sentence. For example, if p is a logical constant, the following sentences are both literals:

p , p

A clause expression is either a literal or a disjunction of literals. If p and q are logical constants, then the following are clause expressions

p, p, p q

A clause is the set of literals in a clause expression. For example, the following sets are the corresponding clauses:

{p}, {p}, {p , q}

Note that the empty set {} is also a clause. It is equivalent to an empty disjunction. 14

Page 15: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Converting to clausal form1. Implications (I):

j1 j2 ® ¬ j1 j2

j1 j2 ® j1 ¬ j2

j1 j2 ® (¬ j1 j2 ) (j1 ¬ j2 )2. Negations (N):

¬ ¬ j ® j

¬ (j1 j2 ) ® ¬ j1 ¬ j2

¬ (j1 j2 ) ® ¬ j1 ¬ j2

3. Distribution (D):

j1 (j2 j3 ) ® (j1 j2) (j1 j3 )

(j1 j2 ) j3 ® (j1 j3) (j2 j3)

(j1 j2 ) j3 ® j1 (j2 j3 )

(j1 j2 ) j3 ® j1(j2 j3)4. Operators (O):

j1 ... jn ® {j1,...,jn}

j1 ... jn ® {j1}...{jn}15

Page 16: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Examples

¬ ( g (r f ))

I ¬ ( g (¬ r f ))

N ¬ g ¬ (¬ r f )

¬ g (¬ ¬ r ¬ f )

¬ g (r ¬ f )

D (¬ g r ) (¬ g ¬ f )

O {¬ g , r }

{¬ g , ¬ f }

16

g (r f )

I g (¬ r f )

O { g }

{¬ r, f }

Ex.1 Ex. 2

Page 17: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Propositional Resolution

The idea of resolution is simple. • Suppose we know that p is true or q is true,

and suppose we also know that p is false or r is true.

• One clause contains p, and the other contains ¬ p.

• If p is false, then by the first clause q must be true.

• If p is true, then, by the second clause, r must be true.

• Since p must be either true or false, then it must be the case that q is true or r is true.

• In other words, we can cancel the p literals.

17

p v q¬ p v rq v r

{p , q}{ p , r }{q , r }

Page 18: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Resolution in propositional Logic

18

{j1,..., c,..., jm}

{y1,..., c,..., yn}

{j1,...,jm,y1,...,yn}

More generally, given a clause containing a literal c and another clause containing the literal c , we can infer the clause consisting of all the literals of both clauses without the complementary pair. This rule of inference is called propositional resolution

Page 19: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Example

Ex.: Use resolution to show that the hypotheses “Jasmine is skiing or it is not snowing” and “It is snowing or Bart playing hockey” imply “Jasmine is skiing or Bart is playing hockey.”

Sol.: Let

p: “Jasmine is skiing,”

q: “It is snowing,”

r: “Bart playing hockey.”

So we have the hypotheses: p ¬q∨ and q r∨ . Applying resolution p r ∨follows.

The other way: (p ¬q) (q r) = (q r) (p ¬q) =(¬r→q) ∨ ∧ ∨ ∨ ∧ ∨(q→p). ∧ Applying Hypotheses syllogism, from (¬r→q) (q→p) ∧

follows

(¬r →p). Evidently (¬r →p) = (r p).∨19

Page 20: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Example

20

1. {p , q} Premise

2. { Ø p , q } Premise

3. {p , Ø q } Premise

4. { Ø p , Ø q } Premise

5. {q } 1,2

6. { Ø q } 3,4

7. {} 5,6

Page 21: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Example

21

1. {p , q} Premise2. {¬ p ,r } Premise3. {¬ q , r } Premise4. {¬ r } Premise5. {q ,r } 1,26. {p , r} 1,37. {¬ p } 2,48. {¬ q } 3,49. {r } 3,510. {q } 4,511. {p } 4,612. {} 4,9

Page 22: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Example

22

1. P v Q {P , Q} Primes2. ¬ P v R {¬ P , R} Primes3. ¬ Q v R {¬ Q , R} Primes4. ¬ R {¬ R} Negated conclusion5. Q v R {Q , R} 1, 26. ¬ P {¬ P} 2, 47. ¬ Q {¬ Q} 3, 48. R {R} 5, 69. {} {} 4, 8

1. P v Q

2. P R

3. Q R

Prove R

Page 23: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

Homework

1. Show that the hypotheses “If you send me an email message, then I will finish writing the program,” “If you do not send me an email message, then I will go to sleep early,” and “If I go to sleep early, then I will wake up feeling refreshed” lead to the conclusion “If I do not finish writing the program, then I will wake up feeling refreshed.”

2. Show that the hypotheses (p q) r ∧ ∨ and r→s imply the conclusion p s∨ .

23

Page 24: 1 Propositional Proofs 2. Rules of Inference and Formal Proofs 2

24

Thank You!