<<

Language and Lecture 4 Propositional Logic

Dr. Mark Lee

[email protected]

“This sentence has twoo errors.”

“This sentence has three a’s, two c’s, two d’s, nineteen e’s, six f’s, two g’s, five h’s, ten i’s, two l’s, twelve n’s, nine o’s, five r’s, twenty six s’s, sixteen t’s, four u’s, four v’s, eight w’s, four x’s, and two y’s.”

Formal languages

In previous weeks we’ve looked at natural languages and shown that we can reason logically about using a (semi)-formal view of language and the use of tables. In this lecture we will set out a formal view of propositional logic.

A is one where: 1. There is a clear and unambiguous syntax 2. It is possible to prove whether or not any sentence is a member of that language.

We should also hope that any interesting formal language has a suitable method for determining the of any in that language (A proof theory). However, this is not always the case.

Propositional Logic (PL)

Propositional logic has (usually) five operators:

∧ Conjunction (… and …)

∨ Disjunction (… or …)

¬ (not …)

→ Implication (If … then …)

↔ Biconditional Implication (If and only if)

Formula in PL

P atomic formula P v Q Compound formula

Any compound formula can be discomposed into a set of atomic formula and atomic formulae can be combined to form a compound formula. Consider:

I’ll go home and I’ll study logic or I’ll watch tv.

P = I’ll go home.

Q = I’ll study logic

R = I’ll watch TV

Obviously, the formula for the above would be

P ∧ Q ∨ R

However this is ambiguous between

(P ∧ Q) ∨ R and

P ∧ (Q ∨ R)

Since this is a formal language, we need to make the distinction clear and therefore:

1. Any binary connective must be bracketed

2. If a formula is compound then bracket it.

Negation

There is only one unary connective in PL. Negation always applies to the smallest formula i.e. ¬P ∨ Q means (¬P) ∨ Q

If we wish to negate the compound formula then we need to use brackets. ¬(P ∨ Q)

Propositional Logic Syntax

F → A A → [P]|[Q]|[R] ...

F → F B F B → [∧] | [∨] | [→] | [↔]

F → UF U → [¬]

Using the above grammar, we can parse any propositional logic formula. You should note that this is considerably less complex than Natural Language syntax. It also should be unambiguous (unlike most natural language). ¬(P ∨ Q)

Main connective

For any formula, the main connective is just the one connective whose scope is the entire formula.

De Morgan’s laws

(As an interlude before proof theory)

Augustus De Morgan (1806-1871) published a set of rules for PL. The most famous are referred to as De Morgan’s laws.

Rule 1 ¬(P ∧ Q) ↔ ¬P ∨ ¬Q

Rule 2 ¬(P ∨ Q) ↔ ¬P ∧ ¬Q

We can show that both laws are valid by constructing a for each

Rule 1

P Q ¬ (P∧Q) ↔ ¬P ∨ ¬Q

T T F T T F F F

T F T F T F T T

F T T F T T T F

F F T T T T T T

Rule 2

P Q ¬ (P∨Q) ↔ ¬P ∧ ¬Q

T T F T T F F F

T F F T T F F T

F T F T T T F F

F F T F T T T T

More generally it is possible to simulate any connective in PL using a collection of nand and nor gates. This has increased the relevance (and fame) of De Morgan’s laws.

Arguments

In natural language we have used the following convention for simple arguments:

Proposition 1 Premise 1

Proposition 2 Premise 2

Proposition 3 Conclusion

PL gives us two methods for expressing the above:

P → Q, P : Q (i.e. an argument which might or might not be valid)

P → Q, ¬Q ¬P (i.e. an argument which is valid and has been proved to be valid)

Proof theory

Given any system of logic, we can distinguish between a formal language (in this case PL) and a proof theory (a method of proving the validity of formulae in that language).

Given any formal language, there might be many different proof theories. So far we have used truth tables to prove whether an argument is valid in (semi-formal) PL. Truth tables however cannot be “scaled up” to deal with more interesting such as predicate calculus.

Instead we will introduce Natural Deduction over the next two weeks. However before that we must introduce some formal notation for what constitutes a proof and provide a simple notation for proofs.

A proof notation

Any proof consists of a number of lines. Each line has four parts:

Line number Formula Rule of Annotation {Dependency Numbers}

The line number is increased by one every line. The formula must be a well formed formula of PL. The rule of annotation must be a rule contained in our proof theory. The dependence numbers are the numbers of lines which the new line depends on (i.e. where the premise the line depends on, was originally introduced).

An example should make this clear. However we don’t currently have a proof theory to use. For the time being let us use , plus De Morgan’s laws and a law of substitution where any part of a compound formula can be substituted with a biconditional formula. Consider the following argument.

“It’s not the case that Peter is studying logic and Quentin is studying maths. If Peter is not studying logic or Quentin is not studying maths then Roger is taking sports sciences. Therefore Roger is studying sports sciences.”

If we wished to prove the above using truth tables then we would do the following:

P = Peter is studying logic

Q = Quentin is studying maths

R = Roger is studying sports sciences

¬(P ∧ Q). ((¬P ∨ ¬Q) → R). (therefore) R. or as a material implication

¬(P ∧ Q) ∧ ((¬P ∨ ¬Q) → R) →R

We could then create a truth table for all the values of P, Q, & R and show that the main connective (or material implication) was valid in all cases. If you are still unsure about truth tables then you could use this for an exercise.

A proof using our new notation is as follows:

1. ¬ (P ∧ Q) Premise {1}

2. (¬P ∨ ¬Q) De Morgan #1 {1}

3. (¬P ∨ ¬Q) → R Premise {3}

4 R Modus Ponens 2,3 {1,3}

This might seem complex. We will practice constructing such proofs on Tuesday.

Introducing Natural Deduction

First introduced by Jaskowski (among others) in 1929 Natural Deduction is an approach to proof theory which attempts to develop proofs which are as “natural” as possible (i.e. as close to human reasoning as possible).

Various Natural Deduction Systems exist which allow different rules of inference. However, all start from the basis that very connective has an Introduction and an Elimination rule. I’ll only introduction the rules for conjunction today to give you a taster for next time.

Conjunction Introduction is an inference rule for inferring that if two premises are true then their conjunction is also true.

1. A Premise {1}

2. B Premise {2}

3. A ∧ B Conjunction Introduction (or ∧-Intro) {1 2}

Conjunction Elimination

Conjunction elimination is an inference rule for inferring that if a conjunction is true then either side of the conjunction is also true. This requires two rules.

1. A ∧ B Premise {1}

2. A Conjunction Elimination LHS (or ∧-elim lhs) {1}

1. A ∧ B Premise {1}

2. B Conjunction Elimination LHS (or ∧-elim rhs) {1}

Both rules should seem trivially easy. Next week we will introduce more rules and practice proving things using natural deduction.