proving arguments valid in predicate calculuscs245/logic13... · a) babies are illogical. b) nobody...

22
Proving Arguments Valid in Predicate Calculus Lila Kari University of Waterloo Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 1 / 22

Upload: others

Post on 31-Jan-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Proving Arguments Valid in PredicateCalculus

Lila Kari

University of Waterloo

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 1 / 22

Page 2: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Predicate calculus - Logical consequence

• Logical consequences in Lpred , which are the counterparts oftautological consequences in Lp, involve semantics.

The notation |= for tautological consequences is also used forlogical consequences.

Definition. Suppose Σ is a set of formulas in Lpred and A is aformula in Lpred . A is called a logical consequence of Σ, writtenas Σ |= A, iff for any interpretation I and any value assignments in I , if [I , s](Σ) = 1 then [I , s](A) = 1.

The notations 6|= and |=| are used in the same sense as inpropositional logic.

Two formulas are called logically equivalent (or equivalent forshort, if no confusion will arise) iff A |=|B holds.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 2 / 22

Page 3: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Example: Proving an argument in Lpred valid

Prove that∀x¬A(x) |= ¬∃xA(x).

Proof:Suppose the contrary, that is, suppose that there is someinterpretation I over domain D and some assignment s in I such that:

(1) [I , s](∀x¬A(x)) = 1(2) [I , s](¬∃xA(x)) = 0.

Let u be a free variable symbol not occurring in A(x). Consider A(u).By (1),

(3) [I , s[u=d ]](¬A(u)) = 1 for all d ∈ D.

Hence,(4) [I , s[u=d ]](A(u)) = 0 for all d ∈ D.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 3 / 22

Page 4: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Example contd.

On the other hand, by (2) we have

(5) [I , s](∃xA(x)) = 1.

that is,(6) [I , s[u=d ]](A(u)) = 1 for some d ∈ D.

We have reached a contradiction (between (6) and (4)), thereforeour assumption was false.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 4 / 22

Page 5: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

The particular case of empty premises:(universally) valid formulas in Lpred

Recall that the notion of (universally) valid formula in Lpred isanalogous to the notion of tautology in propositional logic.

For any formula A in Lpred , one has ∅ |= A if and only if A is(universally) valid.

To demonstrate that a formula A is (universally) valid, we haveto show that ∅ |= A under all possible interpretations.

In other words, a formula A is (universally) valid if there is nointerpretation for which A yields false.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 5 / 22

Page 6: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Proving a formula is not (universally) valid

• To demonstrate that a formula A is not (universally)valid, it is therefore sufficient to find an singlecounterexample: that is, it is sufficient to give a singleinterpretation for which A yields false.

• In the case when A is of the form B → C , A is false iffB is true while C is false. Consequently, to prove that aconditional is not (universally) valid, it is sufficient tofind an interpretation that makes the antecedent trueand the consequent false.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 6 / 22

Page 7: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Example

Consider the following formula:

∃xP(x)→ ∀xP(x) (∗)

Note that if P(x) is true for some x , this obviously does not justifythe conclusion that P(x) is true for all x . For instance, if a programruns for some input data, this obviously does not allow one toconclude that the program runs for all possible input data.

Thus, to prove that (∗) is not (universally) valid, one must find aninterpretation that makes the antecedent ∃xP(x) true and theconsequent ∀xP(x) false. In other words, one must find aninterpretation that satisfies

∃xP(x) ∧ ¬∀xP(x)

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 7 / 22

Page 8: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Example contd.

It is not difficult to find such an interpretation.

Choose a domain D = {a, b} and assign P(a) the value 1 and P(b)the value 0.

Then there is an x , that is, x = a such that P(x) is true, whichmeans that ∃xP(x) yields true.

However, ∀xP(x) is obviously false.

This implies that ∃xP(x)→ ∀xP(x) is not (universally) valid, that is,

∅ 6|= ∃xP(x)→ ∀xP(x)

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 8 / 22

Page 9: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Example

Prove that the following formula is not (universally) valid:

∀x(P(x) ∨ Q(x))→ ∀xP(x) ∨ ∀xQ(x).

Solution. We find an interpretation that uses a domain in which aand b are the only individuals. The value assignment is given by thefollowing table.

x P(x) Q(x) P(x) ∨ Q(x)a 1 0 1b 0 1 1

It is easy to see that this assignment makes the left side of theformula true and the right side false.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 9 / 22

Page 10: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Example contd.

For example, if P(x) and Q(x) mean, respectively, x has brown shoesand x has black shoes then

• ∀x(P(x) ∨ Q(x)) means that everyone has either brownshoes or black shoes,

• ∀xP(x) ∨ ∀xQ(x) means that either everyone has brownshoes or that everyone has black shoes.

In other words, in addition to the fact that all shoes are either brownor black, all shoes must be of the same colour in order to satisfy theright side of the formula. This is obviously a stronger condition thanmerely requiring that all shoes be either brown or black.

Since we found an interpretation that makes the formula false, theformula is not (universally) valid, that is

∅ 6|= ∀x(P(x) ∨ Q(x))→ ∀xP(x) ∨ ∀xQ(x).

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 10 / 22

Page 11: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Proving that a formula is (universally) valid

• The problem of proving whether or not a formula inLpred is (universally) valid is undecidable; that is, there isno generally applicable algorithm that, given an arbitraryformula in Lpred as input, can reliably determine whetheror not the formula is (universally) valid.

• There are methods that work in many particular cases.

• For instance, all formulas that arise from tautologies,such as ∀xP(x) ∨ ¬(∀xP(x)), are (universally) valid.

• Other formulas are (universally) valid by definition. Forinstance, ∀xP(x) must imply P(t) for every term t, sothe formula ∀xP(x)→ P(a), where a is in the domain,is (universally) valid.

• However, there is no algorithm to provide an answer(universally valid or not), in all cases.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 11 / 22

Page 12: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Example

Prove that(∗) ∀xP(x)→ ¬∀x¬P(x)

is (universally) valid.

Proof. One must show that this formula is true under anyinterpretation or, equivalently, that there is no interpretation thatmakes it false (that is, no inperpretation that makes ∀xP(x) true,while making ∀x¬P(x) true).

This however is easy, as one observes that it is impossible that P(x)be true for all x and at the same time false for all x .

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 12 / 22

Page 13: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Note that even though ∀xP(x)→ ¬∀x¬P(x) is (universally) valid,its converse is not (the converse of p → q is q → p).

In other words, the following formula is not (universally) valid:

¬∀x¬P(x)→ ∀xP(x).

For instance, if P(x) is x has a job then antecedent (the left side) ofthis implication means not everyone is unemployed whereas theconsequent (the right side) means everyone has a job, and the firstdoes not imply the second.

Indeed, the statement not everyone is unemployed admits thepossibility that some people are without jobs, whereas everyone has ajob does not.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 13 / 22

Page 14: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Example

Show that the following formula is (universally) valid.

∀xP(x) ∨ ∀xQ(x)→ ∀x(P(x) ∨ Q(x)).

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 14 / 22

Page 15: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 15 / 22

Page 16: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Proof that penguins are not good at logic

Premise 1: ∀x(penguin(x)→ blackwhite(x))

Premise 2: ∃x(tv(x) ∧ blackwhite(x))

Conclusion: ∃x(penguin(x) ∧ tv(x))

Proof: Take the interpretation with domain D = {Pingu, OldTV},where Pingu is a penguin, and OldTV is a black-and-white TV, andthe values of the predicates penguin(x), tv(x), blackwhite(x) are:

penguin(x) blackandwhite(x) tv(x)Pingu 1 1 0OldTV 0 1 1

One can see that under this interpretation the premises are true, butthe conclusion is false. Therefore, the argument is not valid.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 16 / 22

Page 17: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Theorem.Let n ∈ N and A1,A2, . . . ,An be formulas in Lpred . Then

A1, . . . ,An |= A

if and only if∅ |= A1 ∧ . . . ∧ An → A.

Note. In the proof, we only care about the interpretations that makeA1 ∧ A2 ∧ . . .An true, because falsehood implies anything.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 17 / 22

Page 18: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Russell and the Pope

• One philosopher was shocked when Bertrand Russell toldhim that a false proposition implies any proposition.• He said “You mean from the statement “2+2=5” it

follows that you are the Pope?”• Russell replied “Yes.” “Can you prove it?” “Certainly.”

• Suppose 2 + 2 = 5.• Subtracting 2 from both sides we get 2 = 3.• Transposing we get 3 = 2.• Subtracting 1 from both sides we get 2 = 1.

“Now suppose the Pope and I are two. Since 2 = 1,then the Pope and I are one. Hence I am the Pope.”

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 18 / 22

Page 19: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Exercises from Lewis Carroll

Lewis Carroll, (really Charles Dodgson writing under a pseudonym),the author of Alice in Wonderland is also author of several works insymbolic logic. The next exercises for proving arguments in Lpred

valid or invalid, come from his book Symbolic Logic.

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 19 / 22

Page 20: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Exercise 1

Consider the following argument.

a) All lions are fierce.b) Some lions do not drink coffee.c) Some fierce creatures do not drink coffee.

Express the argument in the language of predicate calculus, whereL(x), F (x) and C (x) are the statements “x is a lion”, “x is fierce”and “x drinks coffee” respectively. The universe of discourse is theset of all creatures. Does c) follow from a) and b)?

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 20 / 22

Page 21: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Exercise from Lewis Carroll

Let P(x), I (x) and V (x) be the statements “x is a professor”, “x isignorant”, and “x is vain”. Express each of the following statementsin Lpred where the universe of discourse is the set of all people.a) No professors are ignorant.b) All ignorant people are vain.c) No professors are vain.Does c) follow from a) and b)?

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 21 / 22

Page 22: Proving Arguments Valid in Predicate Calculuscs245/Logic13... · a) Babies are illogical. b) Nobody is despised who can manage a crocodile. c) Illogical persons are despised. d) Babies

Exercise from Lewis Caroll

Let B(x), L(x), C (x) and D(x) be the statements “x is a baby”, “xis logical”, “x is able to manage crocodiles” and “x is despised”.Express each of the following statements in Lpred if the universe ofdiscourse is the set of all people:a) Babies are illogical.b) Nobody is despised who can manage a crocodile.c) Illogical persons are despised.d) Babies cannot manage crocodiles.Does d) follow from a), b) and c)?

Proving Arguments Valid in Predicate Calculus CS245, Logic and Computation 22 / 22