14
0 ogic is or should be itions n operations nguage of classical propositional logic retation and truth ty (tautologicity) tables -completeness of the nontautologicity problem n-style axiomatizations (sequent calculus systems) Giorgi Japaridze Logic Propositional Logic Propositional Logic Episode 4

0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity)

Embed Size (px)

Citation preview

0

• What logic is or should be• Propositions• Boolean operations• The language of classical propositional logic• Interpretation and truth• Validity (tautologicity)• Truth tables• The NP-completeness of the nontautologicity problem• Gentzen-style axiomatizations (sequent calculus systems)

Giorgi Japaridze

LogicPropositional LogicPropositional Logic

Episode 4

What logic is or should be4.1

1. Logic is the most basic, general-purpose, universal-utility tool for reasoning and acting rationally.

2. All intellectual activities (sciences, engineering, politics, everyday life) are or shouldbe based on logic, while logic, in turn, is self-sufficient and needs none of those.

3. Logic makes no ontological commitments, and is focused on form rather than content. It is exactly this full abstraction from content that makes logic general-purpose and universal-utility.

Below are a few theses about what your lecturer believes logic is or should be:

4. All other sciences can be seen as applications of logic to some particular domains. For this very reason, such sciences are special- rater than general-purpose tools, applicable only to limited parts of the world.

5. Logic is the same to (all other) intellectual activities as programming languages

are to (all other) application programs.

Propositions4.2

There are only two propositions: ⊤ (true) and ⊥ (false).

Classical logic sees no difference between two true or two false propositions, so we have

“2+2=4” = “snow is white” = ⊤ and “2+2=5” = “snow is black” = ⊥.

If you find this strange or confusing, remember that, from the point of view of set theory, we similarly have

{x | x>(x+1)} = {x | x is an elephant that can fly} =

Boolean operations4.3

Negation “Not” {⊤, ⊥} {⊤, ⊥} Conjunction “And” {⊤, ⊥}{⊤, ⊥} {⊤, ⊥} Disjunction “Or” {⊤, ⊥}{⊤, ⊥} {⊤, ⊥} Implication “If ... then” {⊤, ⊥}{⊤, ⊥} {⊤, ⊥}

Symbol Name Translation Type

p p

⊥ ⊤

p q pq pq pq

Note that:p = p

pq = pq

(pq) = pq (pq) = pq

The language of classical propositional logic4.4

The language of classical propositional logic is built from:1. Two logical atoms: ⊤ and ⊥.2. Infinitely many nonlogical atoms: p, q, r, s, p1, p2, p3, ...3. Propositional connectives: , , , .4. Parentheses: (, ).

Formulas are defined inductively by:1. Atoms (logical or nonlogical) are formulas.2. If F is a formula, then so is (F).3. If E and F are formulas, then so are (E)(F), (E)(F), (E)(F).

For readability, we will be typically omitting certain parentheses,whenever this does not create ambiguity. has the highest precedence, so that, say, pq should be understood as (p)q rather than as (pq). And has the lowest precedence, so that, say, pqr should be understood as (pq)r rather than as p(qr).

Interpretation and truth4.5

An interpretation is a function * that assigns a particular proposition p* (⊤ or ⊥) to each nonlogical atom p.

Synonyms of “interpretation” are model and truth assignment.

Every interpretation * extends from nonlogical atoms to all formulas by stipulating that:

⊤* = ⊤⊥* = ⊥(F)* = (F*)(EF)* = (E*)(F*)(EF)* = (E*)(F*)(EF)* = (E*)(F*)

We say that formula F is true under interpretation *, or simply thatF* is true, if F*= ⊤. Otherwise we say that it is false.

Validity; truth tables; NP-completeness of the nonvalidity problem

4.6

We say that a formula F is valid (or is a tautology) if F is true under every interpretation.

Examples of tautologies: ⊤; ⊥; pp; p(qp); ⊥p. How about this one? [(pq)r] [(pq)(pr)] There is a brute force method, called the truth table method, that allows us to get answers to such questions. It consists of going through all possible interpretations to see if all of them make the formula true.

p q r [(pq) r] [ (p q) (p r)]

⊥ ⊥⊤

What is the trouble with the

truth table method? Inefficiency. The truth table for a formula with a couple of hundred atoms would have more rows than the number of particles in the Universe! Deductive methods (the following slides) are morepractical, even though, generally, we have:

Theorem 4.1. The problem of telling whether a formula is tautological is coNP-complete, meaning that no truly efficient algorithms are known for it.

Deductive systems4.7

There are various deductive systems for classical propositional logic. They can be divided into two major classes: Hilbert-style and Gentzen-style. Hilbert-style systems are axiom-based while Gentzen-style systems are rule-based. Gentzen-style systems have a number of advantages, including existence of straightforward proof search algorithms. In this course we will deal only with Gentzen-style systems. Another name for such systems is sequent calculi. From now on we will consider the version of the language of classical propositional logic where formulas are not allowed to contain logical atoms or implication. This does not mean diminishing the expressive power of the language, as ⊤ can be considered an abbreviation of pp, ⊥ considered an abbreviation of pp, and

EF an abbreviation of EF.

Furthermore, officially will only be allowed on atoms. When applied to non-atomic formulas, is considered an abbreviation defined by:

E = E (EF) = EF (EF) = EF

A sequent calculus system for classical propositional logic4.8

A sequent is any finite sequence of formulas (in the sense of Slide 4.7). Here are the rules of one of several equivalent sequent calculus systems for classical propositional logic. Let us call it G1. In the following rules, E,F stand for any formulas, and G,H stand for any sequents. Above the horizontal line is (are) the premise(s), and below the line is the conclusion.A proof in such a system is a tree of sequents, where each node is the conclusion of some rule, and the children of the node are the premises of that rule. Such a tree is a proof of the sequent at its root. A formula F is considered provable if the sequentF is provable (of course, “provable” means “has a proof”).

Identity Exchange Weakening Contraction

-Introduction -Introduction

G,F,E,H

G,E,F,H G

G,EE

E,EI W

G,E

G,E,EC

G, EF

G, E, F

G, H, EF

G, E H, F

[no premises]

An example of a proof in sequent calculus4.9

Example. Find a proof of (pq)(r s) (pr)(qs).

First, we rewrite the formula as [(pq)(r s)][(pr)(qs)].

Next, we construct a proof of it in the bottom-up fashion as follows:

[(pq)(r s)][(pr)(qs)]

(pq)(r s), (pr)(qs)

(pq)(r s), (pr)(qs), (pr)(qs) C

(pr)(qs), (pr)(qs), (pq)(r s) E (twice)

(pr)(qs), pq (pr)(qs), rs

(pr)(qs), p, q

(pr)(qs), r, s

p, q, (pr)(qs) E (twice)

r, s, (pr)(qs) E (twice)

p, pr

q, qs

p, p, r

q, q, s

p, pW

q, q W

II

r, pr

s, qs

r, r, pE

s, s, q E

r, rW

s, s W

II

r, p, r

s, q, s

Soundness and completeness4.10

Theorem 4.2. For any formula F, we have: 1. (Soundness) If F is provable in G1, then F is a tautology. 2. (Completeness) If F is a tautology, then F is provable in G1.

Provableformulas

“Good”formulas

Soundness:

“Good”formulas

Provableformulas

Completeness:

In our present case, “good” = “tautological”.

A sequent calculus system without structural rules4.11

• The Identity rule of G1 can be called an axiom, as it takes no premises.• The rules -Introduction and -Introduction are called logical rules as they “explain”the logical meanings of connectives. • The remaining rules of Exchange, Weakening and Contraction are called structural rules, as they only restructure sequents and otherwise are not related to any logical connectives.

Below comes a simpler system --- let us call it G2 --- that has no structural rules at all. A significant change, however, is that in G2 sequents are seen as sets ratherthan sequences of formulas. G2 only has the following three rules, where E,F areany formulas and G is any “sequent”, i.e. any set of formulas.

Axiom -Introduction -Introduction

G, EF

G, E, F

G, EF

G, E G, F

G,E,EA

[no premises]

In view of Theorems 4.2 and 4.4, system G2 is equivalent, in its deductive power, to our old friend G1.

Another example4.12

Example. Find a proof of [(pq)(r s)][(pr)(qs)] in G2.

We use a standard proof search method, which can be applied to any formula. The method is to start with the target formula, and keep applying, in the bottom-upsense, the two logical rules (in whatever order you like) as long as there are conjunctions or disjunctions in the sequent:

[(pq)(r s)][(pr)(qs)]

(pq)(r s), (pr)(qs)

pq, (pr)(qs)

p, q, (pr)(qs)

A

p, q, pr p, q, qs

p, q, p, r

p, q, q, s

A

rs, (pr)(qs)

r, s, (pr)(qs)

A

r, s, pr r, s, qs

r, s, p, r

r, s, q, s

A

You will end up with a tree where all leaves are sequents containing only atoms and negated atoms. Such a tree is a G2-proof if (and only if) every leaf contains some atom together with the negation of the same atom. One can show (see next slide) that the target formula is provable iff this method generates a proof tree.

Soundness and completeness proof4.13

Lemma 4.3. (a) Every sequent which is (the conclusion of) an axiom of G2 is valid. (b) The two logical rules of G2 preserve validity in both top-down and bottom-up directions. That is, the premise(s) is (are) valid iff so is the conclusion.

We extend the concepts of truth and validity (tautologicity) from formulas to sequents by understanding each sequent F1,...,Fn as the formula F1...Fn.

Proof: Obvious.

Theorem 4.4. (Soundness and completeness of G2:) A sequent is provable in G2 iff it is valid (tautological).

Proof. The Soundness of G2 is an immediate consequence of Lemma 4.3: Axioms are valid and the rules preserve validity, so every sequent in a proof tree will be valid. As for completeness, assume a given formula is valid. Apply to it the method of Slide 4.12. In view of Lemma 4.3, all sequents in the tree generated by this

method will be valid. This includes the leaves of the tree. But leaves only contain sequents where every formula is an atom or a negated atom. Obviously such a sequent is valid iff it is an axiom. Thus, the tree will be a proof tree.