Professional Documents
Culture Documents
Lec04 Natded
Lec04 Natded
Logica
Dipartimento di Informatica
Università di Verona
Alessandra Di Pierro
Margherita Zorzi
1 Introduction
2 An abstract example
3 Derivation rules
5 Derivations
Outline
1 Introduction
2 An abstract example
3 Derivation rules
5 Derivations
Where are we
Propositional logic
Syntax and semantics.
Deductive systems (natural deduction).
Soundness and completeness.
Functional completeness.
Natural Deduction
Up to now, we have adopted the view that propositional logic is
based on truth tables, i.e. we have looked at logic from a
semantical point of view.
This, however, is not the only possible point of view.
If one thinks of logic as a codification of (exact) reasoning, then it
should stay close to the practice of inference making, instead of
basing itself on the notion of truth.
We will now explore the non-semantic approach, by setting up a
system for deriving conclusions from premises.
Although this approach is of a formal nature, i.e. it abstains from
interpreting the statements and rules, it is advisable to keep some
interpretation in mind.
We are going to introduce a number of derivation rules, which are,
in a way, the atomic steps in a derivation.
Dip. di Informatica (Università di Verona) Propositional Logic: Natural Deduction
Introduction
Outline
1 Introduction
2 An abstract example
3 Derivation rules
5 Derivations
Language L = {r, q, ♣, ♠}
Deduction system given by rules of proof:
q α q β ♣ ♠ γ
♣ ♠ r
Language L = {r, q, ♣, ♠}
Deduction system given by rules of proof:
[q]
..
..
q α q β ♣ ♠ γ r
♣ ♠ r r δ
Proof of r
The rules:
[q]
..
..
q α q β ♣ ♠ γ r
♣ ♠ r r δ
The proof:
q
Proof of r
The rules:
[q]
..
..
q α q β ♣ ♠ γ r
♣ ♠ r r δ
The proof:
q α
♣
We apply α.
Proof of r
The rules:
[q]
..
..
q α q β ♣ ♠ γ r
♣ ♠ r r δ
The proof:
q α q β
♣ ♠
Similarly with β.
Proof of r
The rules:
[q]
..
..
q α q β ♣ ♠ γ r
♣ ♠ r r δ
The proof:
q α q β
♣ ♠ γ
r
We apply γ.
Proof of r
The rules:
[q]
..
..
q α q β ♣ ♠ γ r
♣ ♠ r r δ
The proof:
[q]1 [q]1
α β
♣ ♠ γ
r 1
r δ
We apply δ, discharging two occurrences of q.
We mark the brackets and the rule with a label, so that it is clear
which assumption is discharged in which step.
The derivation is now a proof: it has no open assumptions (all
discharged).
Dip. di Informatica (Università di Verona) Propositional Logic: Natural Deduction
An abstract example
[q]
..
..
q α q β ♣ ♠ γ r
♣ ♠ r r δ
α reads: if at some root of a tree in the forest you have constructed so
far, there is a q, then you are allowed to draw a line underneath
that q and write ♣ underneath that line.
β reads: similar to α.
[q]
..
..
q α q β ♣ ♠ γ r
♣ ♠ r r δ
α reads: if at some root of a tree in the forest you have constructed so
far, there is a q, then you are allowed to draw a line underneath
that q and write ♣ underneath that line.
β reads: similar to α.
γ reads: if the forest you have constructed so far contains two
neighboring trees, where the left tree has root ♣ and the right tree
has root ♠, then you are allowed to draw a line underneath those
two roots and write r underneath that line.
[q]
..
..
q α q β ♣ ♠ γ r
♣ ♠ r r δ
δ reads: if at some root of a tree in the forest you have constructed so
far, there is a r, then you are allowed to draw a line underneath
that r and write r underneath that line.
Moreover, you are allowed to discharge (cancel, eliminate, close)
0 or more occurrences of q at the leaves of a tree.
Marked by writing [ and ] around discharged formula.
Note that, generally, the tree may contain assumptions other
than q at the leaves.
However, these must not be discharged in this rule
application: they will remain open until they might be
discharged by some other rule application later.
Dip. di Informatica (Università di Verona) Propositional Logic: Natural Deduction
An abstract example
Making assumptions
φ → (ψ → σ) φ
→E
ψ→σ ψ
σ →E
are open.
Outline
1 Introduction
2 An abstract example
3 Derivation rules
5 Derivations
φ→ψ φ
ψ
The propositions above the line are premises, and the one below
the line is the conclusion.
This rule eliminates the connective →.
We can also introduce connectives.
φ ψ φ∧ψ φ∧ψ
∧I ∧Er
φ∧ψ φ ∧El ψ
[φ]
..
..
ψ φ→ψ φ
→I →E
φ→ψ ψ
→ I: if we can derive ψ from φ (as a hypothesis), then we can
conclude φ → ψ, without the hypothesis φ (which is discharged).
Agrees with intuition: φ → ψ means “ψ follows from φ”.
Rule is written so to suggest a derivation; the notation will
become clearer after we have defined derivations.
→ E: if we know that ψ follows from φ and φ is given, then we can
conclude ψ.
Rules can also be written by inverting the premises, e.g.
φ φ→ψ
→E
ψ
Dip. di Informatica (Università di Verona) Propositional Logic: Natural Deduction
Derivation rules
Rules for ⊥
[¬φ]
..
..
⊥ ⊥
φ ⊥E φ RAA
Outline
1 Introduction
2 An abstract example
3 Derivation rules
5 Derivations
[φ ∧ ψ]1 [φ ∧ ψ]1
∧Er ∧El
ψ φ
∧I
ψ∧φ
1
φ∧ψ→ψ∧φ →I
(φ → (ψ → σ)) → (φ ∧ ψ → σ)
[φ ∧ ψ]1
[φ ∧ ψ]1 φ ∧El [φ → (ψ → σ)]2
∧Er →E
ψ ψ→σ
σ →E
→ I1
φ∧ψ→σ
2
(φ → (ψ → σ)) → (φ ∧ ψ → σ) → I
φ φ→⊥
φ → ((φ → ⊥) → ⊥) “bottom-up”
φ → ((φ → ⊥) → ⊥)
φ → ((φ → ⊥) → ⊥) “bottom-up”
[φ]1
..
..
(φ → ⊥) → ⊥
1
φ → ((φ → ⊥) → ⊥) → I
φ [φ → ⊥]1
⊥ →E
1
(φ → ⊥) → ⊥ → I
φ → ((φ → ⊥) → ⊥) “bottom-up”
[φ]1
[φ → ⊥]2
..
..
⊥ 2
(φ → ⊥) → ⊥ → I
1
φ → ((φ → ⊥) → ⊥) → I
[φ]2
[φ → ⊥]1
⊥ →E
(φ → ⊥) → ⊥ → I1
2
φ → ((φ → ⊥) → ⊥) → I
φ → ((φ → ⊥) → ⊥) “bottom-up”
[φ]1
[φ → ⊥]2
⊥ →E
(φ → ⊥) → ⊥ → I2
1
φ → ((φ → ⊥) → ⊥) → I
[φ]1
[φ → ⊥]2
→E [φ]1[¬φ]2
⊥ →E
(φ → ⊥) → ⊥ → I2 ⊥ 2
¬¬φ → I
1
φ → ((φ → ⊥) → ⊥) → I
1
φ → ¬¬φ → I
[φ ↔ ¬φ]1
[φ] 2
φ → ¬φ ∧El [φ ↔ ¬φ]1
¬φ → E [φ]2 [φ] φ → ¬φ ∧El
3
⊥ →E [φ ↔ ¬φ]1 ¬φ → E [φ]3
2
¬φ → I ¬φ → φ ∧Er ⊥ →E
→E 3
φ ¬φ → I
⊥ →E
→ I1
¬(φ ↔ ¬φ)
Outline
1 Introduction
2 An abstract example
3 Derivation rules
5 Derivations
[ψ]
D
φ
σ
[ψ]
D
φ
σ
Note that one does not necessarily cancel all occurrences of such
a proposition ψ.
This clearly is justified, as adding hypotheses does not make a
proposition underivable (irrelevant information may always be
added).
It is a matter of prudence, however, to cancel as much as possible.
Why carry more hypotheses than necessary?
Furthermore one may also apply → I if there is no hypothesis
available for cancellation, e.g.
φ
→I
ψ→φ
is a correct derivation, using just → I.
Dip. di Informatica (Università di Verona) Propositional Logic: Natural Deduction
Derivations
[φ]
.. [¬φ]
.. ..
..
ψ ⊥
→I
φ→ψ and φ RAA
Another observation
Recall that ¬φ abbreviates φ → ⊥. The rules
[φ] [¬φ]
.. ..
.. ..
⊥ ⊥
¬φ → I and φ RAA
look very much alike but they are not both cases of Reductio Ad
Absurdum.
The leftmost derivation tells us (informally) that the assumption of φ
leads to a contradiction, so φ cannot be the case, which is the meaning
of “not φ”.
The rightmost derivation tells us that the assumption of ¬φ leads to a
contradiction, hence (by the same reasoning) ¬φ cannot be the case.
So, on account of the meaning of negation, we only would get ¬¬φ.
It is by no means clear that ¬¬φ is equivalent to φ (indeed, this is denied
by the intuitionists), so it is an extra property of our logic.
(¬¬φ → φ is not derivable in the system without RAA)
Dip. di Informatica (Università di Verona) Propositional Logic: Natural Deduction
Derivations
Set of derivations
⊢ (turnstyle symbol)
1 Γ ⊢ φ if φ ∈ Γ
2 If Γ1 ⊢ φ1 and Γ2 ⊢ φ2 then Γ1 ∪ Γ2 ⊢ φ1 ∧ φ2
3 If Γ ⊢ φ1 ∧ φ2 then Γ ⊢ φ1 and Γ ⊢ φ2
4 If Γ ∪ {φ1 } ⊢ φ2 then Γ ⊢ φ1 → φ2
5 If Γ1 ⊢ φ1 → φ2 and Γ2 ⊢ φ1 then Γ1 ∪ Γ2 ⊢ φ2
6 If Γ ⊢ ⊥ then Γ ⊢ φ
7 If Γ ∪ {¬φ} ⊢ ⊥ then Γ ⊢ φ
We will also write simply Γ, φ1 ⊢ φ2 for Γ ∪ {φ1 } ⊢ φ2 and, more
generally, Γ1 , Γ2 ⊢ φ for Γ1 ∪ Γ2 ⊢ φ
Next lecture
Derivation strategy.
Soundness and completeness.
Bibliography
Dirk van Dalen. Logic and structure (4th ed.), Springer-Verlag, 2008.
See also:
Michael Huth and Mark Ryan. Logic in Computer Science (2nd ed.).
Cambridge University Press, 2004.
http://www.cs.bham.ac.uk/research/projects/lics
Dario Palladino. Corso di Logica, Carocci editore, 2008.
Achille Varzi, John Nolt, Dennis Rohatyn. Logica (2nd ed.). McGraw Hill,
2007. http://www.ateneonline.it/varzi
Andrea Asperti, Agata Ciabattoni. Logica a Informatica. McGraw Hill,
2007. Disponibile solo per acquisto online:
http://www.ateneonline.it/catlibro.asp?item_id=2469
Marco Borga. Elementi di Logica Matematica. La Goliardica Editrice
Universitaria di Roma, 1984.