Sie sind auf Seite 1von 48

Introduction to Logic

by Magda Várterész

1
Lesson 1

What does the word ,,logic” mean?

• Everyday meanings

– a set of reasons someone uses in order to reach an opinion


I could not follow Paul’s logic.
– reasonable thinking
There is a logic in bringing Peter with us because he does know the
area.
– synonyms of the word ,,logical”:
∗ systematic
∗ reasonable
∗ consistent
∗ methodical

• A branch of science
Logic is the study of careful reasoning by formal methods; it is specifically
concerned with whether reasoning is correct.

Reasoning
thinking process

old knowledge =⇒ new knowledge

↓ we can follow it ↓
with the help of a language
statement(s) a new statement
premise(s) conclusion

2
Propositions

A sentence that is either true or false, but not both is called a proposition.
A proposition is expressed as a declarative sentence (as opposed to a question,
command, etc.)

Example 1.1

1. The only positive integers that divide 7 are 1 and 7 itself.

2. The number 2 is odd.

3. Earth is the only planet in the universe that has life.

4. What time is it?

5. Sit down, please!

6. He plays football.

Which of the above are declarative sentences and which are propositions?

1. declarative sentence; proposition; it is true

2. declarative sentence; proposition; it is false

3. declarative sentence; proposition; it is either true or false (but not both),


but no one knows which at this time

4. question; it is neither true nor false

5. command; it is neither true nor false

6. declarative sentence; it is neither true nor false

3
What is the correct reasoning?

Example 1.1 Consider the following argument about Peter, who is a stu-
dent in a logic course.

Premise: If Peter has the ability and works hard, then Peter will be suc-
cessful in the course.
Conclusion: Therefore, if Peter is not successful in the course, then Peter
does not have the ability or Peter does not work hard.

What do you think? Is the reasoning correct? (Yes, it is.)

Example 1.2 Consider an argument of Paul, who is a sportsman.

Premise 1: If I run the 100 meters in 10 seconds, then I am delegated to


the Olympic Games.
Premise 2: But I am not able to run the 100 meters in 10 seconds.
Conclusion: Therefore, I am not delegated to the Olympic Games.

Is the reasoning correct? (No, it is not.)

Example 1.3 Consider an similar argument.

Premise 1: If the car runs out of petrol, then the car stops.
Premise 2: The car does not run out of petrol.
Conclusion: Therefore, the car does not stop.

Do you think, the reasoning is correct? (This and the previous reasonings
are faulty, because although the premises are true, the conclusion is not sure
true.)

4
The abstracted form of an argument

What is the common in the last two arguments?

Premise 1: If ..............., then .


Premise 2: Not ................
Conclusion: Not .

We can put the same proposition in place of the same sign. We shall
use capital Roman letters to denote the simple propositions, these are called
propositional letters.
→ Let us use capital Roman letters instead of signs!

Premise 1: If A, then B.
Premise 2: Not A.
Conclusion: Not B.

The abstracted form of an argument is not bound to any particular content.


But we know, that to conclude in this way is not correct.

Example 1.4 Our first argument can be written in abstracted form by the
help of letters P, Q, and R represent the following statements:

P: Peter has the ability.


Q: Peter works hard.
R: Peter will be (is) successful in the course.

Premise 1: If P and Q, then R.


Conclusion: Therefore, if not R, then not P or not Q.

To conclude in this way is true, because if the premise is true, the conclu-
sion is also true.

5
Exercises
(written home-work)

1. Indicate which of the following are declarative sentences and which are
propositions?

(a) The integer 24 is even.


(b) Is the integer 315 − 1 even?
(c) The product of 2 and 3 is 7.
(d) The sum of x and y is 3.
(e) For every positive integer n, there is a prime number larger than n.
(f) Alfred Hitchock won an Academy Award in 1940 for directing ”Re-
becca”.
(g) Buy two tickets to the Unhinged Universe rock concert for Friday.

2. Let P, Q, and R denote the following propositions:

P: Paul reads The New York Times.


Q: Paul watches the BBC News.
R: Paul jogs 3 miles.

Write each of the following propositions in the abstracted form.

(a) Paul reads The New York Times and watches the BBC News.
(b) Paul watches the BBC News or jogs 3 miles.
(c) If Paul reads The New York Times, then he does not watch the
BBC News.
(d) Paul does not read The New York Times and does not watch the
BBC News.
(e) Paul reads The New York Times or watches the BBC News, but he
does not jog 3 miles.

6
Lesson 2

The logical connectives

Most propositions are combinations of simpler propositions, formed through


some choice of the words not, and, or, and if ..., then .... These words are
called the logical connectives. The simple propositions can be symbolized
by a single propositional letter, and the compound propositions by some com-
bination of propositional letters and logical connectives.

DEFINITION 2.1
Let P and Q be propositional letters.

1. The negation of P is the compound proposition

Not P.

It has truth-value opposite that of P . We denote it by ¬P .

2. The conjunction of P and Q is the compound proposition

P and Q.

It is true provided both P and Q are true. We denote the conjunction


of P and Q by (P ∧ Q).

3. The disjunction of P and Q is the compound proposition

P or Q.

It is true if at least one of P or Q is true. The disjunction of P and Q is


denoted by (P ∨ Q).

4. The implication of P and Q is the compound proposition

If P, then Q.

It is false when P is true and Q is false, and it is true otherwise. We


symbolize the proposition by (P ⊃ Q).

7
Example 2.1

Let P and Q denote the following propositions:


P : Hungary is located in Europe.
Q : Debrecen is the capital of Hungary.

1. The negation of P is the compound proposition


¬P : Hungary is not located in Europe.
Since P is true, ¬P is false.
The negation of Q is
¬Q : Debrecen is not the capital of Hungary.
Since Q is false, ¬Q is true.

2. The conjunction of P and Q is the compound proposition


(P ∧ Q) : Hungary is located in Europe and Debrecen is the capital of
Hungary.
Since Q is false, (P ∧ Q) is false too.

3. The disjunction of P and Q is the compound proposition


(P ∨ Q) : Hungary is located in Europe or Debrecen is the capital of
Hungary.
Since P is true, (P ∨ Q) is true.

4. The implication of P and Q is the compound proposition


(P ⊃ Q) : If Hungary is located in Europe, then Debrecen is the capital
of Hungary.
(P ⊃ Q) is false, because P is true, but Q is false.

We can make compound propositions from other compound propositions


likewise above. Therefore if A and B denote compound propositions ¬A,
(A ∧ B), (A ∨ B) and (A ⊃ B) are compound propositions too.
Exercise
Determine the following compound propositions and their truth-values.

(¬P ∨ Q) (¬P ∧ Q) (¬P ⊃ Q)


(P ∨ ¬Q) (P ∧ ¬Q) (P ⊃ ¬Q)
(¬P ∨ ¬Q) (¬P ∧ ¬Q) (¬P ⊃ ¬Q)

8
The truth table

The truth-value of a given compound proposition can be determined from


the truth-values of the simple propositions of which it is composed. The table
will contain a column for each propositional letter in the proposition and a
column for the whole proposition. If the proposition is particularly complex,
other columns may be used for certain subpropositions. The table contains a
row for each possible combination of truth-values of the propositional letters
involved.
Truth tables for (P ∧ Q), (P ∨ Q), (P ⊃ Q) and ¬P :

P Q (P ∧ Q) P Q (P ∨ Q) P Q (P ⊃ Q)
T T T T T T T T T
T F F T F T T F F
F T F F T T F T T
F F F F F F F F T

P ¬P
T F
F T

Example 2.1

The truth table of ((P ∨ Q) ∧ ¬P )

P Q (P ∨ Q) ¬P ((P ∨ Q) ∧ ¬P )
T T T F F
T F T F F
F T T T T
F F F T F

9
Exercises
(written home-work)

1. Let P, Q, and R denote the following propositions:

P: Paul reads The New York Times.


Q: Paul watches the BBC News.
R: Paul jogs 3 miles.

Write each of the following compound propositions with the help of log-
ical connectives.

(a) Paul reads The New York Times and watches the BBC News.
(b) Paul watches the BBC News or jogs 3 miles.
(c) If Paul reads The New York Times, then he does not watch the
BBC News.
(d) Paul does not read The New York Times and does not watch the
BBC News.
(e) Paul reads The New York Times or watches the BBC News, but he
does not jog 3 miles.

2. Write the truth tables of each following proposition.

(a) ¬(P ∧ Q)
(b) ¬(¬P ∨ ¬Q)
(c) (¬P ∨ (Q ⊃ P ))
(d) (¬Q ⊃ (Q ⊃ P ))
(e) (P ∧ (Q ⊃ ¬P ))
(f) ((P ∨ ¬Q) ⊃ Q)
(g) (P ∧ (Q ⊃ ¬R))
(h) (¬(P ∧ Q) ∨ (R ∧ ¬P ))

10
Lesson 3

The language of propositional logic


syntax ←→ semantics

Propositional logic describes and studies the ways in which propositions


are combined to form other propositions. This is what is called the syntactic
part of logic, the one which deals with propositions as just strings of symbols.
We also are concerned with meaning to the symbols. This part of language
is called semantics. The major theme is the relationship between these two
aspects of language.

The syntax of the language of propositional logic

The description of the syntax of any language begins with its alphabet.
The language of propositional logic consists of the following symbols:

1. logical connectives: ¬, ∧, ∨, ⊃

2. parentheses: ( , )

3. a set P r of propositional letters and signs > and ⊥

The next definition gives the grammar according to which logic expressions
are constructed. It is an inductive definition that describes the ”shortest” ex-
pressions first and then describes how to build longer expressions from shorter
ones.
DEFINITION 3.1 (propositional formulas)

1. A propositional letter, > or ⊥ is a formula. (These are atomic formulas.)

2. If A and B are formulas, then ¬A, (A∧B), (A∨B), (A ⊃ B) are formulas.

3. A string of symbols is a formula if and only if it can be obtained by


starting with atomic formulas (1) and repeatedly applying (2).

11
Example 3.1 Let P, Q, R be propositional letters.

Atomic formulas: P, Q, R, >, ⊥.

Formulas: ¬P, (Q ∨ R), ¬(¬P ⊃ (Q ∨ R)), . . .

Not formulas: S, P ∨ ¬, (¬P ∧ R, . . .

The semantics of the language of propositional logic

The meaning of a formula in logic is simply its truth value. Thus, the
notion of semantics is based on assigning truth values to formulas.
DEFINITION 3.2
An interpretation of a propositional logic language is a function

I : P r → {T, F }

that assigns to each propositional letter a unique truth value.


DEFINITION 3.3 (truth valuation of propositional formulas by the inter-
pretation I)

1. ||>||I = T, ||⊥||I = F. If P ∈ P r, then ||P ||I = I(P ).

2. If A and B formulas, then

• ||¬A||I = T if and only if ||A||I = F,


• ||(A ∧ B)||I = T if and only if ||A||I = T and ||B||I = T,
• ||(A ∨ B)||I = T if and only if ||A||I = T or ||B||I = T,
• ||(A ⊃ B)||I = T if and only if ||A||I = F or ||B||I = T.

Example 3.2 Let P, Q, R be propositional letters and consider the inter-


pretation I such that I(P ) = F, I(Q) = T, I(R) = F. What is the truth value
of the formula ((¬P ∧ ¬Q) ⊃ R)?

||((¬P ∧ ¬Q) ⊃ R)||I = T, because ||(¬P ∧ ¬Q)||I = F .

||(¬P ∧ ¬Q)||I = F, because ||¬Q||I = F.

12
Some more syntactic notions of propositional logic

DEFINITION 3.4 (immediate subformulas)

1. An atomic formula has no immediate subformulas.

2. The only immediate subformula of ¬A is A.

3. The immediate subformulas of (A4B), where 4 denotes ∧, ∨ or ⊃, are


A and B.

DEFINITION 3.5 Let be A a formula. The set of subformulas of A is the


smallest set that contains A and contains, with each member, the immediate
subformulas of that member.
DEFINITION 3.6 (d(A): degree of a formula A)

1. If A an atomic formula, then d(A) = 0.

2. d(¬A) = d(A) + 1.

3. d(A4B) = d(A) + d(B) + 1.

Example 3.2
The immediate subformulas of the formula ((¬P ∧ ¬Q) ⊃ R) are
(¬P ∧ ¬Q) and R.
d((¬P ∧ ¬Q) ⊃ R) = 4
The set of its subformulas is

{((¬P ∧ ¬Q) ⊃ R), (¬P ∧ ¬Q), R, ¬P, ¬Q, P, Q}

Precedence rule for the logical connectives

We adopt a precedence rule to omit certain parentheses in the formulas.


connective precedence
¬ first
∧ second
∨ second
⊃ third

13
Exercises
(written home-work)

1. Are the next strings formulas or not?

(a) ((X ∧ Y )¬Z)


(b) (X(∧Y ) ⊃ Z)
(c) ((Z ⊃ X) ∧ ¬X)
(d) ((¬X ⊃ Y ) ⊃ ¬(X ∧ Z))

2. Determine the immediate subformulas and the set of subformulas of the


next formulas.

(a) (((X ⊃ Y ) ∧ (Y ⊃ Z)) ⊃ (¬X ∨ Z))


(b) ((X ⊃ Y ) ⊃ ((X ⊃ ¬Y ) ⊃ ¬Y ))
(c) ((X ∨ ¬Y ) ⊃ ¬(X ∨ (Z ⊃ Y )))
(d) ¬((X ⊃ Y ) ⊃ ¬(¬X ∧ Z))

3. Omit the needless parentheses in the formulas.

(a) (((X ⊃ Y ) ∨ (Y ⊃ Z)) ⊃ (X ∧ Z))


(b) ((X ⊃ Y ) ⊃ (X ⊃ (Y ⊃ Z)))

4. Write back the parentheses in the formulas.

(a) X ⊃ Y ⊃ Z ⊃ ¬X
(b) X ∨ Y ∧ Z ⊃ Y

14
Lesson 4

Logical equivalence

There may be several different ways to say the same thing.


Example 4.1
The fact, that Peter is not elder then Paul, we can express so that Paul is elder
then Peter or they are of an age.
We would like to define formally what this means for formulas.
DEFINITION 4.1
Let A and B formulas. We say that A and B are logically equivalent, de-
noted A ∼ B, provided A and B have the same truth value for every possible
interpretation.
Example 4.2

1. Show that ¬¬P ∼ P.


We do this by constructing a truth table and comparing the columns
labelled by ¬¬P and P .

P ¬P ¬¬P
T F T
F T F

Since the columns headed by ¬¬P and P agree in every row, these
formulas are logically equivalent.

2. Use a truth table to verify that ¬(P ∨ Q) ∼ ¬P ∧ ¬Q.

P Q P ∨Q ¬(P ∨ Q) ¬P ¬Q ¬P ∧ ¬Q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T

15
Important logical equivalences

the associative properties


A ∧ (B ∧ C) ∼ (A ∧ B) ∧ C
A ∨ (B ∨ C) ∼ (A ∨ B) ∨ C
the commutative properties
A∧B ∼ B∧A
A∨B ∼ B∨A
the distributive properties
A ∧ (B ∨ C) ∼ (A ∧ B) ∨ (A ∧ C)
A ∨ (B ∧ C) ∼ (A ∨ B) ∧ (A ∨ C)
the idempotent laws
A∧A ∼ A
A∨A ∼ A
the eliminations
A ∧ (B ∨ A) ∼ A
A ∨ (B ∧ A) ∼ A
De Morgan’s laws
¬(A ∧ B) ∼ ¬A ∨ ¬B
¬(A ∨ B) ∼ ¬A ∧ ¬B
negation in the implication
¬(A ⊃ B) ∼ A ∧ ¬B
A ⊃ ¬A ∼ ¬A
¬A ⊃ A ∼ A
connections between logical connectives
A∧B ∼ ¬(¬A ∨ ¬B)
A∧B ∼ ¬(A ⊃ ¬B)
A∨B ∼ ¬(¬A ∧ ¬B)
A∨B ∼ ¬A ⊃ B
A⊃B ∼ ¬(A ∧ ¬B)
A⊃B ∼ ¬A ∨ B

16
contraposition
A ⊃ B ∼ ¬B ⊃ ¬A
double negation
¬¬A ∼ A
transposition of the first members in an implication

A ⊃ (B ⊃ C) ∼ B ⊃ (A ⊃ C)

conjunction in the first member of an implication

A ∧ B ⊃ C ∼ A ⊃ (B ⊃ C)

computation laws (> *


) C ∨ ¬C, ⊥ *
) C ∧ ¬C)
A∧> ∼ A A∧⊥ ∼ ⊥
A∨> ∼ > A∨⊥ ∼ A
A⊃> ∼ > A ⊃ ⊥ ∼ ¬A
>⊃A ∼ A ⊥⊃A ∼ >
selfdistributivity of the implication

A ⊃ (B ⊃ C) ∼ (A ⊃ B) ⊃ (A ⊃ C)

partition of events

A ∨ B ⊃ C ∼ (A ⊃ C) ∧ (B ⊃ C)

17
Propositional tautology and contradiction

Some formulas have the seemingly dull property of always being true or
always being false.
DEFINITION 4.2
A formula that is true for all possible interpretations is called a (propositional)
tautology. We denote with |= A if A is a tautology. A formula that is false for
all possible interpretations is called a (propositional) contradiction. We denote
with =| A if A is a contradiction.
Example 4.3

1. Verify that P ∨ ¬P is a tautology.

P ¬P P ∨ ¬P
T F T
F T T

2. Show that P ∧ ¬P is a contradiction.

P ¬P P ∧ ¬P
T F F
F T F

3. Show that |= A if and only if =| ¬A.


If |= A, then A is true for all possible interpretations, so ¬A is false for
all possible interpretations, so that it is a contradiction.
If =| ¬A, then ¬A is false for all possible interpretations, so A is true for
all possible interpretations, so that A is a tautology.

18
Some important tautologies

excluded third
|= A ∨ ¬A
law about contradiction
|= ¬(A ∧ ¬A)
identity law
|= A ⊃ A
insertion a first member to an implication

|= A ⊃ (B ⊃ A)

transitivity
|= (A ⊃ B) ∧ (B ⊃ C) ⊃ (A ⊃ C)
reductio ad absurdum

|= (A ⊃ B) ∧ (A ⊃ ¬B) ⊃ ¬A

whatever from a contradiction

|= A ⊃ (¬A ⊃ B)

Pierce’s law
|= ((A ⊃ B) ⊃ A) ⊃ A
modus ponens
|= A ∧ (A ⊃ B) ⊃ B
modus tollens
|= (A ⊃ B) ∧ ¬B ⊃ ¬A

Exercises
(written home-work)

1. Show that the formulas facing pages 14-15 are really logically equivalent.

2. Show that the formulas facing page 17 are tautologies.

19
Lesson 5

Propositional consequence

DEFINITION 5.1
Let A1 , A2 , . . . , An (n ≥ 1) and B formulas. We say that B is a proposi-
tional consequence of A1 , A2 , . . . , An , or B follows from A1 , A2 , . . . , An , denoted
A1 , A2 , . . . , An |= B, if B is true in every interpretation, where every formula
of A1 , A2 , . . . , An is true.
THEOREM 5.1
A1 , A2 , . . . , An |= B if and only if |= A1 ∧ A2 ∧ . . . ∧ An ⊃ B.
Proof.

• If A1 , A2 , . . . , An |= B then B is true in every interpretation, where


every formula of A1 , A2 , . . . , An is true. Now we consider an arbitrary
interpretation I. There are two cases:

1. There is 1 ≤ i ≤ n that Ai is false in I. Then the conjunction


A1 ∧ A2 ∧ . . . ∧ An is false in I too, so the implication A1 ∧ A2 ∧
. . . ∧ An ⊃ B is true in I.
2. Every formula of A1 , A2 , . . . , An is true in I. Then the conjunction
A1 ∧ A2 ∧ . . . ∧ An and the formula B is true in I too, so the
implication A1 ∧ A2 ∧ . . . ∧ An ⊃ B is true in I.

• If |= A1 ∧ A2 ∧ . . . ∧ An ⊃ B then A1 ∧ A2 ∧ . . . ∧ An ⊃ B is true for all


possible interpretations. Now we consider an arbitrary interpretation I
in where every formula of A1 , A2 , . . . , An is true. Then the conjunction
A1 ∧ A2 ∧ . . . ∧ An is true in I too, and because the implication A1 ∧ A2 ∧
. . . ∧ An ⊃ B in I, the formula B must be true in I.

20
THEOREM 5.2
A1 , A2 , . . . , An |= B if and only if =| A1 ∧ A2 ∧ . . . ∧ An ∧ ¬B.
Proof.
From Theorem 5.1 A1 , A2 , . . . , An |= B if and only if |= A1 ∧ A2 ∧ . . . ∧ An ⊃
B. But from the last lesson we know that a formula is a tautology if and
only if its negation is a contradiction, so A1 , A2 , . . . , An |= B if and only
if =| ¬(A1 ∧ A2 ∧ . . . ∧ An ⊃ B). From the last lesson we know also that
¬(A1 ∧ A2 ∧ . . . ∧ An ⊃ B) ∼ (A1 ∧ A2 ∧ . . . ∧ An ) ∧ ¬B, so they have the same
truth value in every interpretation.
Example 5.1

1. Show that P, P ⊃ Q |= Q.
We do this by constructing a truth table for P ∧ (P ⊃ Q) ⊃ Q.
P Q P ⊃Q P ∧ (P ⊃ Q) P ∧ (P ⊃ Q) ⊃ Q
T T T T T
T F F F T
F T T F T
F F T F T

2. Show that ¬Q, P ⊃ Q |= ¬P.


We do this by constructing a truth table for ¬Q ∧ (P ⊃ Q) ⊃ ¬P.
P Q ¬P ¬Q P ⊃Q ¬Q ∧ (P ⊃ Q) ¬Q ∧ (P ⊃ Q) ⊃ ¬P
T T F F T F T
T F F T F F T
F T T F T F T
F F T T T T T

21
3. Is the the following reasoning correct? (Example 1.1)
Premise: If Peter has the ability and works hard, then Peter will be
successful in the course.
Conclusion: Therefore, if Peter is not successful in the course, then Peter
does not have the ability or Peter does not work hard.
This argument can be written in abstracted form by the help of letters
P, Q, and R represent the following propositions:

P: Peter has the ability.


Q: Peter works hard.
R: Peter will be (is) successful in the course.

Premise 1: P ∧ Q ⊃ R
Conclusion: ¬R ⊃ ¬P ∨ ¬Q

Therefore we have to prove that the implication A *


) (P ∧ Q ⊃ R) ⊃
(¬R ⊃ ¬P ∨ ¬Q) is a tautology.
P Q R ¬P ¬Q ¬R P ∧Q P ∧Q⊃R ¬P ∨ ¬Q ¬R ⊃ ¬P ∨ ¬Q A
T T T F F F T T F T T
T T F F F T T F F F T
T F T F T F F T T T T
T F F F T T F T T T T
F T T T F F F T T T T
F T F T F T F T T T T
F F T T T F F T T T T
F F F T T T F T T T T

22
Exercises
(written home-work)

1. Show that

(a) ¬Q, P ∨ Q, P ⊃ R |= R
(b) P ⊃ Q, ¬P ⊃ ¬Q |= ¬Q ⊃ ¬P

2. Is the next reasoning correct? (Example 1.2)


Premise 1: If I run the 100 meters in 10 seconds, then I am delegated to
the Olympic Games.
Premise 2: But I am not able to run the 100 meters in 10 seconds.
Conclusion: Therefore, I am not delegated to the Olympic Games.

3. Is the next reasoning correct? (Example 1.3)


Premise 1: If the car runs out of petrol, then the car stops.
Premise 2: The car does not run out of petrol.
Conclusion: Therefore, the car does not stop.

23
Lesson 6

A sequent

Let A1 , A2 , . . . , An , B1 , B2 , . . . , Bm , (n, m ≥ 0) be formulas in a propositional


logic language. The formula in the form

> ∧ A1 ∧ A2 ∧ . . . ∧ An ⊃ B1 ∨ B2 ∨ . . . ∨ Bm ∨ ⊥

is called a sequent. Denotation: A1 , A2 , . . . , An → B1 , B2 , . . . , Bm , or shortly:


Γ → ∆, where Γ * ) {A1 , A2 , . . . , An } és ∆ *
) {B1 , B2 , . . . , Bm }.

Axiom schemes of Gentzen calculus

AΓ → ∆A
⊥Γ → ∆

Deduction rules of Gentzen calculus

ABΓ → ∆ Γ → ∆A; Γ → ∆B
(∧ →) (→ ∧)
(A ∧ B)Γ → ∆ Γ → ∆(A ∧ B)

AΓ → ∆; BΓ → ∆ Γ → ∆AB
(∨ →) (→ ∨)
(A ∨ B)Γ → ∆ Γ → ∆(A ∨ B)

Γ → ∆A; BΓ → ∆ AΓ → ∆B
(⊃→) (→⊃)
(A ⊃ B)Γ → ∆ Γ → ∆(A ⊃ B)

Γ → ∆A AΓ → ∆
(¬ →) (→ ¬)
¬AΓ → ∆ Γ → ∆¬A

24
Let A be a formula. A proof tree for A in the Gentzen calculus is a finite
labelled tree whose nodes are labelled with sequents, whose root is labelled
with → A, and all of whose leaves are labelled with axioms. If a node is
labelled with Γ → ∆, then its children must be labelled with the sequents
from which Γ → ∆ is derived by one of the deduction rules. A formula A is
said to be provable in the Gentzen calculus if there is a proof tree for A.
Example 6.1 → (A ∧ B ⊃ C) ⊃ (A ⊃ (B ⊃ C)) is provable:

A, B → A, C A, B → B, C

A, B → A ∧ B, C C, A, B → C [ (→ ∧) ]

A ∧ B ⊃ C, A, B → C [ (⊃ →) ]

A ∧ B ⊃ C, A → B ⊃ C [ (→ ⊃) ]

A ∧ B ⊃ C → A ⊃ (B ⊃ C) [ (→ ⊃) ]

→ (A ∧ B ⊃ C) ⊃ (A ⊃ (B ⊃ C)) [ (→ ⊃) ]

(a) Soundness of the Gentzen calculus: Every formula provable in the Gentzen
calculus is a tautology.

(b) Completeness of the Gentzen calculus: If a formula is tautology, then it


is provable in the Gentzen calculus.

25
Exercises
(written home-work)

Show that the next sequents are provable in the Gentzen calculus.

(a) → (A ∨ B ⊃ C) ⊃ (A ⊃ C) ∧ (B ⊃ C)

(b) → ((A ⊃ C) ∧ (B ⊃ C)) ⊃ (A ∨ B ⊃ C)

(c) → (A ⊃ (B ⊃ C)) ⊃ (A ∧ B ⊃ C)

(d) → (A ∧ B ⊃ C) ⊃ (A ⊃ (B ⊃ C))

(e) → (A ⊃ B ∨ C) ⊃ (A ⊃ B) ∨ (A ⊃ C)

(f) → (A ⊃ B) ∨ (A ⊃ C) ⊃ (A ⊃ (B ∨ C))

(g) → ¬(A ⊃ B) ⊃ ¬A ∨ ¬B

(h) → (A ⊃ B) ⊃ ¬A ∨ B

26
Lesson 7

Predicates

The propositional logic is incapable of describing many sentences. Con-


sider, for example, the declarative sentence:

x is an odd integer.

A declarative sentence is a proposition that is either true or false. Our


sentence is not a proposition because whether it is true or false depends on the
value of x. For example, the sentence is true if x = 3 and false if x = 4. Since
most of the sentences in mathematics and computer science use variables, we
must extend the language of logic to include such sentences.
A predicate (or relation) is a sentence P (x) about the symbol x; it becomes
a proposition only when x is given a particular value in some domain of P .
We refer to x as a variable and P as a predicate symbol.
A predicate P (x), by itself, is neither true or false. However, for each x in
its domain, P (x) is a proposition and is, therefore, either true or false. We can
think of a predicate as defining a class of propositions, one for each element of
its domain.
Example 7.1

1. Let P (x) denote the sentence: x is an odd integer.


Then P is a predicate symbol, x a variable, P (x) a predicate, the domain
of P is the set of positive integers. P (3) denotes the proposition that 3
is an odd integer (which is true), P (4) denotes the proposition that 4 is
an odd integer (which is false).
So we obtain the class of propositions

P (1), P (2), P (3), . . . .

Each of P (1), P (2), P (3), . . . is either true or false.

27
2. x is a student of Debrecen University.
Let S(x) denote this sentence, the domain of S is a set of persons.
3. x is a right-angled triangle.
Let R(x) denote this sentence, the domain of R is a set of triangles.
4. If x is odd, then x is not a multiple of 2.
Let P (x) denote that x is odd and Q(x) denote that x is a multiple of
2. The domain of P and Q is the set of positive integers. This sentence
has the logical form
P (x) ⊃ ¬Q(x)
and its truth value can be determined for a specified value of x. (It is
true for all x.)

Quantifiers

Sentences such as

”there exists an x that x is prime and x + 10 is prime”

or

”for all x, if x is odd, then x + 1 is even”

cannot be symbolized using the logical connectives presented thus far. The
reason for this is the presence of the phrases ”there exists an x” and ”for all
x”. They are use so frequently that they warrant symbolic representation.

1. The proposition

”there exists an x such that P (x)”

is symbolized by

∃xP (x)

The sign ∃ is called the existential quantifier and translates as ”there


exists”. Other common phrases for ∃ are ”for some” or ”there is some”.
Also, the words ”such that” are often replaced by ”for which” or ”satis-
fying”. The proposition ∃xP (x) is true if there is at least one value of
domain of P for which P (x) is true.

28
2. The proposition

”for all x, P (x)”

is symbolized by

∀xP (x)

The sign ∀ is called the universal quantifier and translates as ”for all”.
Other phrases for ∀ are ”for each” or ”for every” or ”given any”. The
proposition ∀xP (x) is true if P (x) is true for every value of domain of
P.

The quantifiers ∃ and ∀, together with the logical connectives, are collec-
tively referred to as the logical symbols.
Example 7.2

1. Every integer is a rational number. Let I(x) denote that x is an integer,


and R(x) that x is a rational number. The logical form of the sentence:

∀x(I(x) ⊃ R(x))

2. There exists an even prime number. Let E(x) denote that x is an even
number, and P (x) that x is a prime number. The logical form of the
sentence:

∃x(E(x) ∧ P (x))

29
Exercises
(written home-work) by next Friday)

1. Symbolize the following sentences:

(a) Every rational number is a real number.


(b) Some real numbers are rational numbers.
(c) Not every real number is a rational number.

2. Let C(x) mean ”x is a used-car dealer”, and H(x) mean ”x is honest”.


Translate each of the following into English:

(a) ∃xC(x)
(b) ∃xH(x)
(c) ∀x(C(x) ⊃ ¬H(x))
(d) ∃x(C(x) ∧ H(x))
(e) ∃x(H(x) ⊃ C(x))

3. Let P (x), L(x), R(x, y, z) and E(x, y) represent ”x is a point”, ”x is a


line”, ”z passes through x and y” and ”x = y, respectively. Translate
the following:

(a) For every two points, there is a line passing through both points.
(b) For every two points, there is one and only one line passing through
both points.

30
Lesson 8

The syntax of the language of first-order logic

First-order logic describes and studies also the structure of propositions.


The language L of first-order logic consists of the following symbols:

1. propositional logical connectives: ¬, ∧, ∨, ⊃

2. quantifiers: ∀, ∃

3. parentheses and comma: ( ) ,

4. variables: v1 , v2 , . . . (which we write informally as x, y, z, . . .

5. a set C of constant symbols

6. a set P r of predicate symbols and signs > and ⊥

DEFINITION 8.1 (first-order atomic formula)


An atomic formula of L is any string of the form P (t1 , t2 , . . . , tn ), where
P ∈ P r is a n-place predicate symbol and t1 , t2 , . . . , tn are variables or constant
symbols (so called terms) of L; also > and ⊥ are taken to be atomic formulas
of L.
DEFINITION 8.2 (first-order formulas)

1. Any atomic formula is a formula of L.

2. If A and B are (first-order) formulas of L, then ¬A, (A∧B), (A∨B), (A ⊃


B) are (first-order) formulas of L.

3. If A is a (first-order) formulas of L and x is a variable, then ∀xA and


∃xA are (first-order) formulas of L.

4. A string of symbols is a formula of L if and only if it can be obtained by


starting with atomic formulas (1) and repeatedly applying (2) and (3).

31
Example 8.1 Let P 1 , Q2 , R3 be one-, two- and tree-place predicate sym-
bols of L.

Atomic formulas: P (x), Q(c, y), R(z, z, z), >, ⊥.

Formulas: ¬P (x), (Q(c, y) ∨ R(z, z, z)), ¬(¬P (x) ⊃ (Q(c, y) ∨ R(z, z, z))),
∀xP (x), ∃y∃z(Q(c, y) ∨ R(z, z, z)) . . .

Not formulas: xP (x), P (x, x) ∨ Q(c, y), P (P (x)) . . .


DEFINITION 8.3 (immediate subformulas)

1. An atomic formula has no immediate subformulas.

2. The only immediate subformula of ¬A is A.

3. The immediate subformulas of (A4B), where 4 denotes ∧, ∨ or ⊃, are


A and B.

4. The only immediate subformula of ∃xA and ∀xA is A. A is called the


scope of the quantifiers.

DEFINITION 8.4 Let be A a formula. The set of subformulas of A is the


smallest set that contains A and contains, with each member, the immediate
subformulas of that member.
DEFINITION 8.5 (d(A): degree of a formula A)

1. If A an atomic formula, then d(A) = 0.

2. d(¬A) = d(A) + 1.

3. d(A4B) = d(A) + d(B) + 1.

4. d(∃xA) = d(A) + 1 and d(∀xA) = d(A) + 1.

32
DEFINITION 8.6 The free-variable occurrences in a formula are defined as
follows:

1. If A an atomic formula, then all the variable occurrences in A are free-


variable occurrences.

2. The free-variable occurrences in ¬A are free-variable occurrences in A.

3. The free-variable occurrences in A4B are free-variable occurrences in A


together with the free-variable occurrences in B.

4. The free-variable occurrences in ∀xA and ∃xA are are free-variable oc-
currences in A, except for occurrences of x.

A variable occurrence is called bound if it is not free.


DEFINITION 8.7 A sentence (also called a closed formula) of L is a formula
of L with no free-variable occurrences.
In a first-order formula we can replace the bound variables by new variables.
Example 8.2

1. Replace y with x and z with w in ∃y∃z(Q(c, y) ∨ R(z, z, z)). We get


∃x∃z(Q(c, x) ∨ R(w, w, w)). These two formulas are similar to one an-
other, they are congruent.

2. But if we replace x with y in ∃xR(x, y, z). We get ∃yR(y, y, z), in which is


only one free-variable occurrence. These two formulas are not congruent.

DEFINITION 8.8 The formulas A and B are congruent (A ≈ B in the next


cases:

1. If A is an atomic formula, then there is not any other formula which is


congruent with A.

2. ¬A ≈ ¬A0 if and only if A ≈ A0 .

3. A4B ≈ A0 4B 0 if and only if A ≈ A0 and B ≈ B 0 .

4. ∀xA ≈ ∀yA0 and ∃xA ≈ ∃yA0 if and only if when we replace the free-
occurrence x in A and y in A0 with the same new variable z, we get, that
Axz ≈ Ayz .

33
Exercises
(written home-work)

1. Let P 1 , Q2 , R3 be one-, two- and tree-place predicate symbols of L. Are


the next strings first-order formulas in L?

(a) Q(x, y, y)
(b) (P (x) ⊃ ∀y(R(x, y, z) ∧ P (x, y)))
(c) R(P (x), y, z)

2. Determine the set of subformulas.

(a) Q(x, y) ⊃ ¬∀xP (x)


(b) (∃x¬(P (x) ⊃ Q(x, y)) ⊃ ∀zP (z)

3. Determine free and bound variables of next formulas.

(a) ∀x(∀yP (x, y, z) ⊃ Q(x, y))


(b) ∀y∃z(P (x, y, z) ⊃ ∃zQ(z, x))
(c) ∃x∀y(P (x) ∨ Q(x, y)) ⊃ ∀yQ(x, y)

34
Lesson 9

First-order semantics

It is more complicated to give meaning to a formula of first-order logic than


it was in the propositional logic. We must say what domain is involved for the
quantifiers to quantify over. Then we must say how we are interpreting the
constant and predicate symbols with respect to that domain, an interpreta-
tion. And finally, since formulas may contain free variables, we must give an
assignment of values to them.
DEFINITION 9.1
An interpretation of a first-order logic language L is a pair hD, Ii where

1. D is a nonempty set, called the domain of L

2. I is a mapping that associates

• to every constant symbol c ∈ C, some member cI ∈ D,


• to every n-place predicate symbol P ∈ P r, some n-ary relation
PI ⊆ Dn

DEFINITION 9.2 A valuation in an interpretation hD, Ii is a mapping θ


from the set of variables to the set of D.
DEFINITION 9.3 Let x be a variable. The valuation η in the interpretation
hD, Ii is an x-variant of the valuation θ, provided θ and η the same values to
every variable except x.

35
DEFINITION 9.4 Let hD, Ii be an interpretation for the language L, and
let θ be an valuation in this interpretation. To each formula of L, we associate
a truth value as follows:

1. For the atomic cases,

• ||P (t1 , t2 , . . . , tn )||I,θ = T if and only if (|t1 |I,θ , |t2 |I,θ , . . . , |tn |I,θ ) ∈
PI , where |x|I,θ = θ(x), and for a constant symbol c, |c|I,θ = cI .
• ||>||I = T ||⊥||I = F

2. If A and B formulas, then

• ||¬A||I,θ = T if and only if ||A||I,θ = F,


• ||A ∧ B||I,θ = T if and only if ||A||I,θ = T and ||B||I,θ = T,
• ||A ∨ B)||I,θ = T if and only if ||A||I,θ = T or ||B||I,θ = T,
• ||A ⊃ B||I,θ = T if and only if ||A||I,θ = F or ||B||I,θ = T.
• ||∀xA||I,θ = T if and only if ||A||I,η = T for every valuation η that
is an x-variant of θ.
• ||∃xA||I,θ = T if and only if ||A||I,η = T for some valuation η that
is an x-variant of θ.

36
DEFINITION 9.5 Let A and B formulas. A and B are logically equivalent,
denoted A ∼ B, if ||A||I,θ = ||B||I,θ in every interpretation I for every valuation
θ.
DEFINITION 9.6 A formula A of L is first-order tautology if ||A||I,θ = T
in every interpretation I for every valuation θ. (|= A) A formula A of L is first-
order contradiction if ||A||I,θ = F in every interpretation I for every valuation
θ. (=| A)

Important logical equivalences and tautologys

fictive quantifiers
if x 6∈ F v(A), then
∀xA ∼ A ∃xA ∼ A
change of place of the same quantifiers

∀x∀yA(x, y) ∼ ∀y∀xA(x, y)

∃x∃yA(x, y) ∼ ∃y∃xA(x, y)
quantifiers in an implication

|= ∀xA(x) ⊃ ∃xA(x)

|= ∃y∀xA(x, y) ⊃ ∀x∃yA(x, y)
De Morgan’s laws
¬∃xA(x) ∼ ∀x¬A(x)
¬∀xA(x) ∼ ∃x¬A(x)
change of place of quantifier and negation

∃xA(x) ∼ ¬∀x¬A(x)

∀xA(x) ∼ ¬∃x¬A(x)
lifting out the one side
if x 6∈ F v(A), then
A ∧ ∀xB(x) ∼ ∀x(A ∧ B(x))
A ∧ ∃xB(x) ∼ ∃x(A ∧ B(x))
A ∨ ∀xB(x) ∼ ∀x(A ∨ B(x))
A ∨ ∃xB(x) ∼ ∃x(A ∨ B(x))

37
A ⊃ ∀xB(x) ∼ ∀x(A ⊃ B(x))
A ⊃ ∃xB(x) ∼ ∃x(A ⊃ B(x))
∀xB(x) ⊃ A ∼ ∃x(B(x) ⊃ A)
∃xB(x) ⊃ A ∼ ∀x(B(x) ⊃ A)
lifting out the both sides

∀xA(x) ∧ ∀xB(x) ∼ ∀x(A(x) ∧ B(x))

∃xA(x) ∨ ∃xB(x) ∼ ∃x(A(x) ∨ B(x))


|= ∀xA(x) ∨ ∀xB(x) ⊃ ∀x(A(x) ∨ B(x))
|= ∃x(A(x) ∧ B(x)) ⊃ ∃xA(x) ∧ ∃xB(x)
congruent formulas
Ha A ≈ B, akkor A ∼ B.

Exercises
(written home-work)

1. Show that the formulas facing pages 36-37 are really logically equivalent.

2. Show that the next formulas are not tautologys.

(a) ∃xP (x) ⊃ ∀xP (x)


(b) ∀x∃yP (x, y) ⊃ ∃y∀xP (x, y)
(c) ∃xP (x) ∧ ∃xQ(x) ⊃ ∃x(P (x) ∧ Q(x))
(d) ∀x(P (x) ∨ Q(x)) ⊃ ∀xP (x) ∨ ∀xQ(x)
(e) ∀xP (x, x) ⊃ ∀x∀yP (x, y)
(f) ∃x∃yP (x, y) ⊃ ∃xP (x, x)
(g) P (x) ⊃ ∀xP (x)
(h) ∃xP (x) ⊃ P (x)
(i) ∀xP (x, y) ≡ ∀yP (y, y)
(j) ∃xP (x, y) ≡ ∃yP (y, y)

38
Lesson 10

First-order consequence

DEFINITION 10.1
Let A1 , A2 , . . . , An (n ≥ 1) and B formulas. We say that B is a first-order con-
sequence of A1 , A2 , . . . , An , or B follows from A1 , A2 , . . . , An , denoted A1 , A2 , . . . , An |=
B, if B is true in every interpretation for every valuation, where every formula
of A1 , A2 , . . . , An is true.
THEOREM 10.1
A1 , A2 , . . . , An |= B if and only if |= A1 ∧ A2 ∧ . . . ∧ An ⊃ B.
THEOREM 10.2
A1 , A2 , . . . , An |= B if and only if =| A1 ∧ A2 ∧ . . . ∧ An ∧ ¬B.
THEOREM 10.3
If A1 , A2 , . . . , An |= B and x is not free in formulas A1 , A2 , . . . , An , then
A1 , A2 , . . . , An |= ∀xB.
Example 10.1

1. Show, that the conclusion is a first-order consequence of the premises.

Premise 1: ∀x(P (x) ⊃ Q(x))


Premise 2: ¬Q(c)
Conclusion: ¬P (c)
Let I be an interpretation, in which the premises are true. It means that
P (x) ⊃ Q(x) is true for every valuation in I. So it is true for the case,
when the valuation θ associate c to x: ||P (x) ⊃ Q(x)||I,θ = T . Since the
premise 2 is true in I too, we get that Q(c) is false. So also P (c) is false
and ¬P (c) is true. So that ¬P (c) is a logical consequence of premises.

39
2. Show, that the conclusion is a first-order consequence of the premises.

Premise 1: Every student studies logic.


Premise 2: Paul is student.
Conclusion: Therefore, the Paul studies logic.
First we translate the propositions into formulas.
Denote ”x is a student” by S(x), ”x studies logic” by L(x) and Paul by p.
Then the propositions can be represented by Premise 1: ∀x(S(x) ⊃ L(x))
Premise 2: S(p)
Conclusion: L(p)
Let I be an interpretation, in which the premises are true. It means that
S(x) ⊃ L(x) is true for every valuation in I. So it is true for the case,
when the valuation θ associate p to x: ||S(x) ⊃ L(x)||I,θ = T . Since the
premise 2 is true in I too, we get that also L(p) is true, so that L(p) is
a logical consequence of premises.

Exercises
(written home-work)

Show, that the conclusion is a first-order consequence of the premises.

Premise 1: Every student is hardworking.


Premise 2: Everyone who is both hardworking and intelligent will succeed in
his career.
Premise 3: John is an student.
Premise 4: John is intelligent.
Conclusion: John will succeed in his career.

40
Lesson 11

Gentzen calculus

Let A1 , A2 , . . . , An , B1 , B2 , . . . , Bm , (n, m ≥ 0) be first-order formulas in a


language L. The formula in the form
> ∧ A1 ∧ A2 ∧ . . . ∧ An ⊃ B1 ∨ B2 ∨ . . . ∨ Bm ∨ ⊥
is called a sequent. Denotation: A1 , A2 , . . . , An → B1 , B2 , . . . , Bm , or shortly:
Γ → ∆, where Γ * ) {A1 , A2 , . . . , An } és ∆ *
) {B1 , B2 , . . . , Bm }.

Axiom schemes of Gentzen calculus

AΓ → ∆A
⊥Γ → ∆
Deduction rules of Gentzen calculus

ABΓ → ∆ Γ → ∆A; Γ → ∆B
(∧ →) (→ ∧)
(A ∧ B)Γ → ∆ Γ → ∆(A ∧ B)

AΓ → ∆; BΓ → ∆ Γ → ∆AB
(∨ →) (→ ∨)
(A ∨ B)Γ → ∆ Γ → ∆(A ∨ B)

Γ → ∆A; BΓ → ∆ AΓ → ∆B
(⊃→) (→⊃)
(A ⊃ B)Γ → ∆ Γ → ∆(A ⊃ B)

Γ → ∆A AΓ → ∆
(¬ →) (→ ¬)
¬AΓ → ∆ Γ → ∆¬A
A(x||t)∀xAΓ → ∆ Γ → ∆A(x||y)
(∀ →) (→ ∀)
∀xAΓ → ∆ Γ → ∆∀xA
A(x||y)Γ → ∆ Γ → ∆A(x||t)∃xA
(∃ →) (→ ∃)
∃xAΓ → ∆ Γ → ∆∃xA

41
Let A be a formula. A proof tree for A in the Gentzen calculus is a finite
labelled tree whose nodes are labelled with sequents, whose root is labelled
with → A, and all of whose leaves are labelled with axioms. If a node is
labelled with Γ → ∆, then its children must be labelled with the sequents
from which Γ → ∆ is derived by one of the deduction rules. A formula A is
said to be provable in the Gentzen calculus if there is a proof tree for A.

(a) Soundness of the Gentzen calculus: Every first-order formula provable in


the Gentzen calculus is a first-order tautology.

(b) Completeness of the Gentzen calculus: If a formula is first-order tautol-


ogy, then it is provable in the Gentzen calculus.

Example 11.1
→ ∀xP (x) ⊃ ¬∃x¬P (x) is provable:

P (y), ∀xP (x) → P (y)

∀xP (x) → P (y) [ (∀ →) ]

∀xP (x), ¬P (y) → [ (¬ →) ]

∀xP (x), ∃x¬P (x) → [ (∃ →) ]

∀xP (x) → ¬∃x¬P (x) [ (→ ¬) ]

→ ∀xP (x) ⊃ ¬∃x¬P (x) [ (→⊃) ]

42
Example 11.2
→ ∀xP (x) ⊃ ¬∃x¬P (x) is provable:

P (y) → P (y), ∃x¬P (x)

→ P (y), ¬P (y), ∃x¬P (x) [ (→ ¬) ]

→ P (y), ∃x¬P (x) [ (→ ∃) ]

→ ∀xP (x), ∃x¬P (x) [ (→ ∀) ]

¬∃x¬P (x) → ∀xP (x) [ (¬ →) ]

→ ¬∃x¬P (x) ⊃ ∀xP (x) [ (→⊃) ]

Exercises
(written home-work)

Show that the next sequents are provable in the Gentzen calculus.

(a) → ∀xP (x) ⊃ ∃xP (x)

(b) → ∀xP (x) ∨ ∀xQ(x) ⊃ ∀x(P (x) ∨ Q(x))

(c) → ∃x(P (x) ∧ Q(x)) ⊃ ∃xP (x) ∧ ∃xQ(x)

(d) R ⊃ ∃xP (x) → ∃x(R ⊃ P (x)) (x is not free in R)

(e) ∀xP (x) ⊃ R → ∃x(P (x) ⊃ R) (x is not free in R)

43
Lesson 12

Normal forms

DEFINITION 12.1
• A literal is an atom or the negation of an atom.

• Let L1 , L2 , . . . , Ln (n ≥ 1) be literals.
L1 ∧ L2 ∧ . . . ∧ Ln is an elementary conjunction,
L1 ∨ L2 ∨ . . . ∨ Ln is an elementary disjunction.

• Let D1 , D2 , . . . , Dm be elementary disjunctions and let K1 , K2 , . . . , Km


be elementary conjunctions (m ≥ 1). Then
D1 ∧ D2 ∧ . . . ∧ Dm is a conjunctive normal form,
K1 ∨ K2 ∨ . . . ∨ Km disjunctive normal form.

Example 12.1
• P , ¬P , Q(x) and ¬R(c, y) are literals

• Q(x) ∨ ¬R(c, y) is an elementary disjunction.

• (Q(x) ∨ ¬R(c, y)) ∧ ¬Q(c) is a conjunctive normal form.

THEOREM 12.1
There exists an algorithm transforming any given quantifier-free formula A
into an equivalent conjunctive (or disjunctive) normal form B.
Steps of transformation procedure:
1. Use the equivalence

• A ⊃ B ∼ ¬A ∨ B

to eliminate the logical connective ⊃.

2. Use the equivalences

• ¬¬A ∼ A

44
• ¬(A ∧ B) ∼ ¬A ∨ ¬B
• ¬(A ∨ B) ∼ ¬A ∧ ¬B

to move the negation signs immediately before atoms.

3. Use the distributivity

• A ∧ (B ∨ C) ∼ (A ∧ B) ∨ (A ∧ C)
• A ∨ (B ∧ C) ∼ (A ∨ B) ∧ (A ∨ C)

to get a normal form.

Example 12.2 Transform the formula

(A ⊃ B) ∨ ¬(¬B ⊃ A ∨ ¬C)

into conjunctive normal form:

1. (¬A ∨ B) ∨ ¬(¬¬B ∨ (A ∨ ¬C))

2. (¬A ∨ B) ∨ ¬(B ∨ (A ∨ ¬C))

3. (¬A ∨ B) ∨ (¬B ∧ ¬(A ∨ ¬C))

4. (¬A ∨ B) ∨ (¬B ∧ (¬A ∧ ¬¬C))

5. (¬A ∨ B) ∨ (¬B ∧ ¬A ∧ C)

6. (¬A ∨ B ∨ ¬B) ∧ (¬A ∨ B ∨ ¬A) ∧ (¬A ∨ B ∨ C)

45
DEFINITION 12.2
A formula is in a prenex normal form, if it is in the form of Q1 x1 Q2 x2 . . . Qn xn C (n ≥
0), where Qi is either ∀ or ∃, and C is a formula containing no quantifier.
Example 12.3 The formula ∀x∃y∃z(P (x) ⊃ ¬Q(y, z)) is in prenex normal
form.
THEOREM 12.2
There exists an algorithm transforming any given formula A into an equivalent
prenex normal form B.
Steps of transformation procedure:

1. If there is a variable having both free and bound occurrences, then re-
name its bound occurrences.

2. If there is a variable having bound occurrences by two different quanti-


fiers, then rename one of them.

3. Use the equivalences

• ¬∃xA(x) ∼ ∀x¬A(x)
• ¬∀xA(x) ∼ ∃x¬A(x)
• A ∧ ∀xB(x) ∼ ∀x(A ∧ B(x))
• A ∧ ∃xB(x) ∼ ∃x(A ∧ B(x))
• A ∨ ∀xB(x) ∼ ∀x(A ∨ B(x))
• A ∨ ∃xB(x) ∼ ∃x(A ∨ B(x))
• A ⊃ ∀xB(x) ∼ ∀x(A ⊃ B(x))
• A ⊃ ∃xB(x) ∼ ∃x(A ⊃ B(x))
• ∀xB(x) ⊃ A ∼ ∃x(B(x) ⊃ A)
• ∃xB(x) ⊃ A ∼ ∀x(B(x) ⊃ A)

to move the quantifiers before.

46
Example 12.4 Transform the formula

∀xP (x) ⊃ ¬∃xQ(x)

into prenex normal form:

1. ∀xP (x) ⊃ ¬∃yQ(y)

2. ∀xP (x) ⊃ ∀y¬Q(y)

3. ∃x(P (x) ⊃ ∀y¬Q(y))

4. ∃x∀y(P (x) ⊃ ¬Q(y))

Exercises
(written home-work)

Transform next formulas into conjunctive and disjunctive normal forms:

(a) ¬(A ∧ B ⊃ ¬A) ∧ ¬(A ∧ B ⊃ ¬B)

(b) ¬(A ∧ (B ∨ C)) ⊃ (A ∧ B) ∨ C

(c) (C ⊃ A) ⊃ (¬(B ∨ C) ⊃ A)

(d) ((A ⊃ B) ⊃ (C ⊃ ¬A)) ⊃ (¬B ⊃ ¬C)

Transform next formulas into prenex normal forms:

(a) ∃x∀yP (x, y) ∨ ∃x∀yQ(x, y)

(b) ∃x∀yP (x, y) ⊃ ∃x∀yQ(x, y)

(c) ∃x(∀yP (x, y) ∨ ∃zR(z)) ⊃ ∃xQR(x)

(d) ∀x(∃yP (x, y) ⊃ ∀xR(x)) ⊃ ∀x∃yP (x, y)

47
1. Show that the formulas A ⊃ B and ¬(A ∧ ¬B) are logically equivalent.

2. Is the next reasoning correct?


Premise 1: If I run the 100 meters in 10 seconds, then I am delegated to
the Olympic Games.
Premise 2: But I am not able to run the 100 meters in 10 seconds.
Conclusion: Therefore, I am not delegated to the Olympic Games.

3. Give the definition of a first-order formula.

4. Show that the next formula is not tautology: ∃xP (x) ⊃ ∀xP (x).

5. Show that the next sequent is provable in the Gentzen calculus:

∀xP (x) ⊃ R → ∃x(P (x) ⊃ R)

(x is not free in R)

Das könnte Ihnen auch gefallen