Chapter3 Logic Part1
Chapter3 Logic Part1
Lecture notes.
These lecture notes are available for download from Blackboard. Together with the videos and
the slides of the weekly live Question & Answer session they comprise the formal content of
this part of the course unit. Suggestions for those who want to do additional optional reading is
mentioned below.
These notes are by Renate Schmidt, though Joe Razavi has made some small changes for this
year–and any typos were introduced by him! These notes have been considerably restructured,
updated and extended from notes of Andrea Schalk from the 2014–5 delivery of the course,
which in turn were based on notes of Graham Gough.
If you notice any typographical or more serious errors, I (Joe) am most grateful to receive
corrections and welcome suggestions for improvement.
Additional reading
The following books on the reading list include chapters on logic, which you may wish to
consult for additional explanations, more examples and exercises.
Garnier, Rowan, and Taylor, John (2002). Discrete Mathematics for New Technol-ogy, IOP.
Chapter 1 and 2 on Logic and Mathematical proof. Very accessibly written.
Epp, Susanna S. (2011). Discrete Mathematics with Applications, Brooks/Cole. Chapter 1 and 2
on logical statements in propositional logic and quantified logical statements (propositional
and first-order logic). Very accessible. Available as online book.
Jordan, D. W. and P. Smith (2008). Mathematical Techniques: An Introduction for the Engineer-
ing, Physical, and Mathematical Sciences, Oxford University Press.
Contains only a short chapter on logic, Chapter 36, which is focussed on logic gates and switch-
ing functions; goes beyond what we cover on this topic.
Several copies of each book are available from the main library. Some of these books are
available as online books; where this is the case this is indicated above.
Many other excellent textbooks exist and can be found in the library; logic and formal systems
is standard material in Computer Science and Mathematics. The internet and Wikipedia is also
a useful additional resource. Be aware though, there are variations in the presentation and
definitions between different sources and books, and also to those we use.
1
Chapter 3
• 2 divides 4
• 225 = 152
• 2 is an odd number
• 2+2=5
2
• Grass is green
• It is raining
• I have my umbrella
Propositions can be connected with the connectives not, and, or, if-then and iff (if and only if)
to form complex propositions, which we have already seen in the previous Chapter. Examples
of complex propositions are:
Complex propositions are referred to as compound propositions and are defined to be proposi-
tions built from atomic propositions and connectives. Atomic propositions are propositions
which can‘t be further broken down, such as ‘2 divides 4‘ and ‘The grass is green‘.
When modelling logical reasoning, we don’t allow ourselves to think about the intuitive
meaning of atomic propositions, and focus instead on the relationships between them expressed
by the connectives.
¬ not, negation
∧ and, conjunction
∨ or, disjunction
→ implies, if...then, implication
We will also use the symbol ↔ read as “if and only if” or “bi-implication”.
These are referred to as propositional connectives, or propositional logic operators.
In addition we have two constants:
⊥ false
⊤ true
Which represent a proposition which is always false, and one which is always true, respectively.
It is also permitted to use round or square brackets in propositional formulas.
The use of the symbols of the language of propositional logic and their intuitive meaning is the
same as in mathematics (and the previous chapter), so we expect to be able to model the way
we use the ‘Key Phrases’ of Section 2.2.1.
The formal definition of a proposition, which we prefer to call propositional formula, is as
follows. We assume we have been given a set of symbols, called propositional variables to use
to represent atomic propositions.
3
Definition 1: Propositional formulas
• If P is a propositional variable then P is a propositional formula (called atomic formula,
or simply atom).
4
3.2 Propositional natural deduction
In this section we are going to discuss natural deduction as a formal proof system for performing
correct reasoning and constructing correct logical arguments.
There are many ways to define deduction systems. In this course we only discuss natural
deduction, but you have the opportunity to learn about other deduction approaches in years
two, three and four. Compared to other deduction systems such as tableau, resolution and
SAT solving, which all essentially use only proof by contradiction (and are well suited for
automated reasoning), natural deduction has the advantage that it is close to actual mathematical
reasoning and how mathematical proofs are typically presented.1 Mathematical arguments are
not limited to proof by contradiction, they typically include proof by case analysis, and they
allow working with infinitely many formulas. An important property of mathematical proofs is
that assumptions can be made at any time. Natural deduction systems are designed to cater for
all this and consequently provide more flexibility than other deduction systems. A characteristic
property of natural deduction systems is that all connectives are explicitly catered for in the
inference rules, which is not the case in all other systems.
𝐴1 , ..., 𝐴𝑛 ⊢ 𝐴
where 𝐴1 , ..., 𝐴𝑛 and A are propositional formulas. We have a list of propositional formulas on
the left of the turnstile symbol ⊢ and one propositional formula on the right. We think of such
a judgement as an argument denoting that
The formulas 𝐴𝑖 on the left-hand side of the turnstile are known as the antecedents and the
formula A on the right-hand side as the consequent of the given judgement.
It makes sense to think of the 𝐴𝑖 as assumptions from which A follows. Because writing
lists of propositional formulas can be a bit tedious it is customary to use this more compact
notation for judgements:
Γ⊢𝐴
where Γ is a list of propositional formulas sometimes called premises of the judgement.
Not every argument (or judgement) is correct. But our interest is correct arguments, and we
are interested in understanding how correct arguments can be constructed. Judgements which
are correct in the technical sense we define are called valid.
1
Systems used in automated reasoning will be covered in COMP21111 on Logic and Modelling, COMP24412 on
Knowledge-Based AI, and COMP60332 on Automated Reasoning and Verification.
5
Intuitively, the following is a correct argument:
We can express this argument as the following judgement, if we think of P as expressing ‘It is
raining‘ and Q as expressing ‘I have my umbrella‘.
𝑃 → 𝑄, 𝑃 ⊢ 𝑄
This judgement is valid.
Note that what we are interested in here is whether the judgement is logically correct, not
whether it expresses something true about the world. Roughly speaking, a judgement is
valid if the conclusion follows from the premises considered alone without any supporting (or
contradicting!) knowledge being used from outside sources.
For example, the argument ‘if I am a pirate’s old boot, the moon is made of green cheese. I
am a pirate’s old boot. Therefore, the moon is made of green cheese’ is a valid argument—in fact
when we translate it into a judgement it has exactly the same form as the previous example.
On the other hand, consider the argument:
If my shoes are wet then I am unhappy. I just stepped in a huge puddle.
Therefore, I am unhappy.
This is not a correct argument, because we have not written down all the knowledge about the
world we are using. If we translate this into a judgement, we could use 𝑃 for the proposition
‘my shoes are wet’, 𝑄 for the proposition ‘I am unhappy’ and 𝑅 for the proposition ‘I just
stepped in a huge puddle’. Then we can write our judgement as
𝑃 → 𝑄, 𝑅 ⊢ 𝑄.
But now we can see that there is nothing in the argument that tells us how 𝑃 and 𝑅 are
connected. And indeed, this judgement is not valid.
If we wanted to model this scenario logically, we would need to explicitly state the extra
information. One way to do this would be to give the following argument:
This argument does state enough information to see that its conclusion follows from its premises
without using common sense or experience. Using the same variable names as above, it would
have the form
𝑃 → 𝑄, 𝑅, 𝑅 → 𝑃 ⊢ 𝑄
which is valid.
6
3.2.2 Our natural deduction system
So far we have only formally modelled propositional formulas. All of the discussion of validity
in the previous section is intuitive. Now we turn to formally modelling what the connectives
mean, by giving rules which allow us to derive new judgements from given ones. These rules
are closely related to the rules of proof for the ‘Key Phrases’ in Chapter 2.
We present a system called natural deduction to infer that a propositional formula A is a
logical consequence of 𝐴1 , ..., 𝐴𝑛 . Our natural deduction system consists of a set of inference
rules for constructing a deduction (proof) showing that
The inference rules are basically instructions for creating new judgements in a deduction. In our
natural deduction system the inference rules operate on judgements because the basic elements
of a natural deduction proof is a judgement. The general form of an inference rule is as follows:
Γ1 ⊢ 𝐴1 Γ2 ⊢ 𝐴2 ... Γ𝑛 ⊢ 𝐴𝑛
Γ⊢𝐴
The judgements above the horizontal line are called the premises of the rule and the judgement
below the horizontal line is referred to as the derived judgement, or the conclusion. We can
think of an inference rule as an if-then statement in a program. The idea is that a rule is applied
when there are judgements in our partially constructed deduction that match the premises of the
rule. Applying the rule will then add the judgement below the horizontal line (the conclusion)
to the deduction.
We only use inference rules, where either n = 0, in which case the rule has no premises and
is an axiom, or n is 1, 2 or 3, in which case the rule is a one or multiple premise rule.
Our use of the terminology ‘premise‘ is ambiguous, because we use the word both for the
premise of a judgement, and the premise of a rule of inference with which correct judgements
are derived, although in the former case we mostly refer to premises as assumptions. It is
important to understand that a natural deduction system is a more complicated system with
a more complicated language, that does not just work with propositional formulas, but with
judgements, because the aim is to construct and study correct arguments involving propositional
formulas.
Now we give and discuss the inference rules of our propositional natural deduction system.
Each rule is named and an informal description and explanation is provided.
For each connective (except for ↔) there are one or two introduction rules, and one or two
elimination rules. (Recall that we consider ↔ to be a shorthand.)
For conjunction there is one introduction rule and two elimination rules:
7
Definition: Conjunction Elimination
If 𝐴 ∧ 𝐵 is derivable from a set of formulas, then so is A, and also B.
Γ⊢𝐴∧𝐵 Γ⊢𝐴∧𝐵
∧ Elim ∧ Elim
Γ⊢𝐴 Γ⊢𝐵
Γ ⊢ 𝐴 ∨ 𝐵 Γ, 𝐴 ⊢ 𝐶 Γ, 𝐵 ⊢ 𝐶
∨ Elim
Γ⊢𝐶
There are two Disjunction Introduction rules. They say that if A is derivable from a set, then so
is 𝐴 ∨ 𝐵, and also 𝐵 ∨ 𝐴.
The Disjunction Elimination rule is special because it involves the discharge of the assump-
tions A and B in the second and third premise of the rule. The rule can be viewed as realising
proof by cases common in mathematical arguments. That is, if we know 𝐴 ∨ 𝐵 holds (in the
context of some assumptions Γ ) and the two cases,
can be shown, then C is inferrable (from Γ ), and A and B can be discharged. Note that there must
be three independent proofs of each of the judgements in the premise. 𝐶 must be independently
derivable from Γ and A, and also from Γ and 𝐵, only then does it follow that Γ yields 𝐶.
A special case is illustrated by the following example: A might mean 𝑥 ∈ 𝑆 and B might
mean 𝑥 ∈ / 𝑆. If C is independently inferrable from both 𝑥 ∈ 𝑆 and 𝑥 ∈ / 𝑆 then C is inferrable
outright from Γ (since 𝐴 ∨ 𝐵 is a tautology in this case and thus Γ ⊢ 𝐴 ∨ 𝐵). Hence, C does
not depend on whether 𝑥 ∈ 𝑆 or 𝑥 ̸∈ 𝑆 and these assumptions can be discharged.
8
There are two inference rules for implication.
The Implication Introduction rule says, if 𝐵 is derivable from 𝐴 and a set, then 𝐴 → 𝐵 is
derivable from the set. The intuition is that when Γ together with 𝐴 yield B then Γ yields
𝐴→𝐵 outright and we can discharge the formula A. This reflects how mathematicians construct
proofs for implications: they assume the condition 𝐴 and show that the right-hand side of the
implication follows (recall the discussion in Chapter 2.)
It is important to note, when we work backwards and read the rule bottom-up, in order to
derive 𝐴 → 𝐵, the Implication Introduction rule requires that 𝐴 is added as an assumption and
𝐵 is derived from 𝐴 together with Γ . We can think of 𝐴 as a temporary extra assumption from
which B must follow.2 If it does then we can remove it because 𝐴 → 𝐵 follows outright from Γ .
We say 𝐴 is ‘discharged‘ during the application of the rule. This is an example of an assumption
discharge rule.3 (The Disjunction Elimination rule above is also an assumption discharge rule,
because application of the rule also involves discharging assumptions, namely 𝐴 and 𝐵.) The
second rule, the Implication Elimination rule, says that if 𝐴 is derivable from a set, and 𝐴 → 𝐵
is derivable from the same set, then B is derivable from this set. This rule is often referred to by
the traditional Latin name ‘modus ponens’.
The intuition of the Negation Introduction rule below is: If assuming a set Γ and 𝐴 leads to a
contradiction then 𝐴 cannot hold and we can infer that ¬𝐴 must hold in the presence of Γ .
It can be used to construct proofs using the principle of reductio ad absurdum, i .e ., proof by
contradiction.
Definition: Negation Introduction (reductio ad absurdum):
If 𝐴 and a set leads to a contradiction, then ¬𝐴 can be inferred from the set.
Γ, 𝐴 ⊢ ⊥
¬ Intro
Γ ⊢ ¬𝐴
2
Note that there is usually an inference in the proof of Γ, 𝐴 ⊢ 𝐵, which activates the assumption A by using the
Axiom rule below.
3
The Implication Introduction rule is strongly related to the deduction theorem of propositional logic (proved by
Herbrand in 1930). Not all logics have the deduction theorem, but if the deduction theorem holds then the logic is a
nice logic. So this makes propositional logic nice.
9
Definition: Negation Elimination:
If A is derivable from a set, and also ¬𝐴 is derivable from the set, then anything (including
⊥) is derivable from the set.
Γ ⊢ 𝐴 Γ ⊢ ¬𝐴
¬ Elim
Γ⊢𝐵
In the Negation Elimination rule the formula B in the conclusion can be any formula, since
when we have a contradiction (when A and ¬𝐴 are derivable) then anything follows. Inference
becomes trivial once a contradiction has been found.
The two rules for double negation simply reflect that ¬¬𝐴 is equivalent to 𝐴.
Any deduction also needs a starting point. The Axiom rule provides a starting point.
Ax
Γ, 𝐴 ⊢ 𝐴
It is a rule with no premises and is therefore always applicable. The rule can be used to assume
any formula A; it says that A can always be inferred from A and a set of formulas. In particular,
A may also be one of the given assumptions, and this is how it is typically used. If A is one of
the given assumptions then the rule activates this assumption and moves to the right of the ⊢,
where it can then used in the inferences.4 A may be any propositional formula. This means the
rule can introduce any formula as an assumption into a deduction.5 We present an example
shortly.
Finally we need some rules and conventions which allow us to work with the list of assumptions.
4
Our ND system has the property that the main inferences are performed with formulas on the right of the ⊢.
For instance, it can be broken down by one of the elimination rules or used in an inference using an introduction
rule, either as the main formula or in a side premise.
5
A better name for the Axiom rule is probably the assumption rule, because it is the main assumption making
rule in natural deduction systems.
10
Definition: Weakening:
New assumptions may be introduced at any point in a deduction.
Γ⊢𝐵
Weakening
Γ, 𝐴 ⊢ 𝐵
The second assumption making rule is the Weakening rule. It says if Γ yields 𝐵 then Γ with
𝐴, for any formula 𝐴, yields 𝐵. The Weakening rule allows a formula to be added the list of
assumptions on the left-hand side of a judgement at any point in the deduction. The difference
to the Axiom rule is that it does not derive a new consequent on the right-hand side of ⊢. The
Axiom rule, in contrast, introduces a formula A as a new assumption on the left-hand side and
as a new consequent on the right-hand side.
We also need two crucial assumptions about our natural deduction system are the following:
(i) We assume the order of the assumptions in judgements does not matter. This means that
we regard the judgement
... B, ... , B’ , ... ⊢ A
as being the same as
... B’ , ... , B, ... ⊢ A.
(ii) We assume that ↔ has been equivalently replaced in a pre-processing step before the
application of the deduction system.
In other natural deduction systems this is handled by a permutation rule. We minimise the use
of so-called structural rules in our system, of which permutation is one, because these operate
on occurrences of formulas and unnecessarily complicate the task of finding a proof. But, for
studying proof-theoretic properties of deduction systems they are useful.
Finally, the reader might wonder about the constants ⊥ and ⊤. The meaning of ⊥ is explained
by the Negation Introduction rule which allows us to use ⊥ if we have proved it, and the
Negation Elimination rule which is the only rule which allows us to prove ⊥ since the formula
𝐵 in that rule can be anything.
Strictly speaking, we should add an extra rule to assert that ⊤ means something which is
always true. Such a rule would have the following form:
⊤ Intro
⊢⊤
However, the only use for this rule in our system is to be able to derive ⊤, so you will never
need to use it in any of the exercises or questions in this unit. This may make ⊤ seem rather
useless; its value will become clearer once we discuss logical equivalence.
We now explore how we can use these rules together to show that more complicated judgements
are valid.
11
3.2.3 Deductions
In our natural deduction system, a deduction is a sequence of judgements, where each judge-
ments has been derived from preceding judgements by the application of one of the inference
rules. The judgement we aim to prove should always be in the last line of a deduction. In that
case the deduction is a proof of this judgement.
For example, the judgement
𝑃, 𝑄 ⊢ 𝑃 ∧ 𝑄
may be proved using this formal deduction.
1. 𝑃, 𝑄 ⊢ 𝑃 Axiom
2. 𝑃, 𝑄 ⊢ 𝑄 Axiom
3. 𝑃, 𝑄 ⊢ 𝑃 ∧ 𝑄 1, 2, ∧ Intro
The first and second judgements have been derived by the Axiom rule. It‘s obvious that the
second judgement was obtained by application of the Axiom rule, but the first was, too, because
we are assuming that the order of formulas to the left of the ⊢ does not matter (see (i) at the
end of the previous section). This implies that both 1 and 2 are correct instances of inferences
with the Axiom rule. The third judgement has been obtained by applying the Conjunction
Introduction rule to judgements 1 and 2. As 𝑃, 𝑄 ⊢ 𝑃 ∧ 𝑄 is the last judgement in the deduction,
the sequence of judgements 1 to 3 above is a proof of 𝑃, 𝑄 ⊢ 𝑃 ∧ 𝑄.
Overall, this tells us that from nothing at all we may infer that if 𝑃 and 𝑄 hold then 𝑃 ∧ 𝑄
holds. This may appear terribly obvious, but once one studies longer deductions it becomes
much less clear what may be derived in the system, and how one might do so.
Let us see if we can produce a proof of the judgement:
𝐴 → (𝐵 ∧ 𝐶), 𝐴 ⊢ 𝐵
Lines 1 and 2 of our proof can be obtained by applying the Axiom rule:
1. 𝐴 → (𝐵 ∧ 𝐶), 𝐴 ⊢ 𝐴 Axiom
2. 𝐴 → (𝐵 ∧ 𝐶), 𝐴 ⊢ 𝐴 → (𝐵 ∧ 𝐶) Axiom
Applying Implication Elimination (or modus ponens) to lines 1 and 2, gives line 3:
3. 𝐴 → (𝐵 ∧ 𝐶), 𝐴 ⊢ 𝐵 ∧ 𝐶 1, 2, → Elim
Line 4 is now obtained by applying the first Conjunction Elimination rule to line 3
4. 𝐴 → (𝐵 ∧ 𝐶), 𝐴 ⊢ 𝐵 3, ∧ Elim
Since 4 is the judgement we wanted to show, the sequence 1 to 4 is a proof of this judgement,
which is what we wanted to show.
Notice how each line in the deduction has a justification on the right-hand side, which
says how the judgement was obtained from previous judgements by the application of an
inference rule. This is an important part of the deduction and it would not be correct without
this information.
12
It can be quite hard to know which assumptions are needed to find a proof. So let us now look
at some examples with significantly larger deductions and give some tips which may help. First,
let us prove this claim:
𝐴 → (𝐵 → 𝐶) ⊢ 𝐵 → (𝐴 → 𝐶).
The first steps in any deduction are always assumption making steps. Often some creativity
and a bit of trial and error is needed to come up with the correct assumptions for a proof of the
judgement. In propositional logic, by arguing backwards the judgement that we aim to prove
usually gives us clues about what assumptions to use.
For example, arguing backwards and considering the inference rules in our natural deduction
system, one way to derive 𝐴 → (𝐵 → 𝐶) ⊢ 𝐵 → (𝐴 → 𝐶) in the last line of a proof, is by
application of the Implication Introduction rule. This is possible if we have the judgement
(Subgoal 1) 𝐴 → (𝐵 → 𝐶), 𝐵 ⊢ 𝐴 → 𝐶
and apply the Implication Introduction rule to it. This will give us 𝐴→(𝐵 →𝐶) ⊢ 𝐵 →(𝐴→𝐶).
In order to derive 𝐴 → (𝐵 → 𝐶), 𝐵 ⊢ 𝐴 → 𝐶, one possibility is by applying the Implication
Introduction rule to the judgement
(Subgoal 2) 𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐶
Let us now see if the assumptions in this judgement (Subgoal 2) are enough to construct a proof.
1. 𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐴 → (𝐵 → 𝐶) Axiom
2. 𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐴 Axiom
3. 𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐵 → 𝐶 1, 2, → Elim
4. 𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐵 Axiom
5. 𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐶 3, 4, → Elim
6. 𝐴 → (𝐵 → 𝐶), 𝐵 ⊢ 𝐴 → 𝐶 5, → Intro
7. 𝐴 → (𝐵 → 𝐶) ⊢ 𝐵 → (𝐴 → 𝐶) 6, → Intro
Success! This is a natural deduction proof of the judgement we aimed to prove. Note: lines 1 to
5 are a proof of Subgoal 2, Subgoal 1 is then proved from that in line 6 and one more step gives
line 7, which is the judgement we wanted to prove.
Next, we give a natural deduction proof of
(𝐴 ∨ 𝐵) → 𝐶 ⊢ (𝐴 → 𝐶) ∧ (𝐵 → 𝐶)
Again, we initially try to work backwards to attempt to obtain some clues of how to start. The
desired final judgement can be derived from
(Subgoal 1) (𝐴 ∨ 𝐵) → 𝐶 ⊢ 𝐴 → 𝐶 and
(Subgoal 2) (𝐴 ∨ 𝐵) → 𝐶 ⊢ 𝐵 → 𝐶
using the Conjunction Introduction rule. In turn these judgements can be derived respectively
from
(Subgoal 3) (𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ 𝐶 and
(Subgoal 4) (𝐴 ∨ 𝐵) → 𝐶, 𝐵 ⊢ 𝐶
using Implication Introduction. These are the first subgoals we want to prove. The assumptions
in these give us promising starting points for a proof.
13
1. (𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ (𝐴 ∨ 𝐵) → 𝐶 Axiom
2. (𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ 𝐴 Axiom
3. (𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ 𝐴 ∨ 𝐵 2, ∨ Intro
4. (𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ 𝐶 1,3, → Elim
An alternative would be the Negation Elimination rule (proof by contradiction) but this rule
should only be tried if no other rules help. This proves Subgoal 3. Next, let‘s perform
5. (𝐴 ∨ 𝐵) → 𝐶 ⊢ 𝐴 → 𝐶 4, → Intro
This proves the judgement of the last line is valid, which was our aim.
Notes.
(ii) The A, B and C in the inference rules can be matched with any propositional formulas.
(iv) It is useful to think of the formulas on the left-hand side of the ⊢ as the assumptions that
we have at our disposal, and the formulas on the right-hand side as consequences. To
perform the deductions, we can only work with formulas on the right-hand side of the
turnstile.
(v) In propositional logic, the judgement we want to prove tells us a lot about the assumptions
to make and the rules to apply. It is often a good idea to work backwards and develop a
strategy of which rules to apply to derive the judgement we want to prove, as we have
done in the previous examples.
14
Axiom Axiom
𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐴 𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐴 → (𝐵 → 𝐶)
Axiom → Elim
𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐵 𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐵 → 𝐶
→ Elim
𝐴 → (𝐵 → 𝐶), 𝐵, 𝐴 ⊢ 𝐶
→ Intro
𝐴 → (𝐵 → 𝐶), 𝐵 ⊢ 𝐴 → 𝐶
→ Intro
𝐴 → (𝐵 → 𝐶) ⊢ 𝐵 → (𝐴 → 𝐶)
Axiom Axiom
(𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ 𝐴 (𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ 𝐵
∨ Intro Axiom ∨ Intro Axiom
(𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ 𝐴 ∨ 𝐵 (𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ (𝐴 ∨ 𝐵) → 𝐶 (𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ 𝐵 ∨ 𝐵 (𝐴 ∨ 𝐵) → 𝐶, 𝐵 ⊢ (𝐴 ∨ 𝐵) → 𝐶
→ Elim → Elim
15
(𝐴 ∨ 𝐵) → 𝐶, 𝐴 ⊢ 𝐶 (𝐴 ∨ 𝐵) → 𝐶, 𝐵 ⊢ 𝐶
→ Intro → Intro
(𝐴 ∨ 𝐵) → 𝐶 ⊢ 𝐴 → 𝐶 (𝐴 ∨ 𝐵) → 𝐶 ⊢ 𝐵 → 𝐶
∧ Intro
(𝐴 ∨ 𝐵) → 𝐶 ⊢ (𝐴 → 𝐶) ∧ (𝐵 → 𝐶)
Exercises on natural deduction
CExercise 1. (On Sheet 4) Give natural deduction proofs of the following judgements.
Note that you must prove exactly the judgement asked for (and not use the equivalences
in the next section, for example, to replace them with formulas you prefer! They are not
needed and it‘s the point of of this section to see that rules like those in our ND system are
sufficient.)
(i) 𝐴 ∧ 𝐵 ⊢ 𝐵 ∧ 𝐴
(ii) 𝐴 ⊢ (𝐴 → (𝐵 ∧ 𝐶)) → 𝐵
(iii) (𝐴 ∨ 𝐵) → 𝐶 ⊢ 𝐴 → 𝐶
(iv) ⊢ 𝐴 ↔ ¬¬𝐴
Hint: First express ↔ using → and ∧ and construct a ND proof for
⊢ (𝐴 → ¬¬𝐴) ∧ (¬¬𝐴 → 𝐴)
(vi) ¬(𝐴 ∧ 𝐵) ⊢ ¬𝐴 ∨ ¬𝐵
(i) Derive, from the judgements Γ ⊢ 𝐵 andΓ ⊢ ¬𝐵 the judgement Γ ⊢ 𝐴, for arbitrary
propositional formulas A and B.
EExercise 3. (On Sheet 4) For each connective ⋆ ∈ {∧, ∨, →}, consider the judgement
𝑃 → 𝑄 ⊢ (𝑃 ⋆ 𝑅) → (𝑄 ⋆ 𝑅)
• Choose some real-world example propositions for the atomic propositions 𝑃 , 𝑄, and
𝑅 and work out whether the argument expressed by the judgement is logically correct
• For those judgements which you think express a logically correct argument, give a
deduction of the judgement in our natural deduction system.
16
3.2.4 Tautologies and equivalent formulas
Definition 3: Tautology
A formula 𝐴 is called a tautology if and only if the judgement
⊢𝐴
is valid.
This looks a bit strange because we have no list of formulas on the left-hand side of the ⊢, which
means we have to derive 𝐴 without using any assumptions! This might be puzzling at first,
because the Axiom rule, which needs an assumption, is the only way we have of starting a
proof. However, certain rules, such as → Intro, have extra assumptions in the premisses when
compared with the conclusion. This means that reading the proof from bottom to top, they
make extra assumptions appear, or when reading the proof from top to bottom, they delete an
assumption which we made earlier. If we delete all the assumptions made at some point in the
derivation, we will have a derivation whose last judgement has an empty list of assumptions,
showing that its conclusion is a tautology.
CExercise 4. (On Sheet 4) Give natural deduction proofs to show the following are
tautologies.
(i) 𝐴 → (𝐴 ∧ (𝐴 ∨ 𝐵))
(ii) (𝐴 ∨ (𝐴 ∧ 𝐵)) → 𝐴
(iii) 𝐴 → (¬𝐴 → 𝐵)
(iv) 𝐴 ∨ ¬𝐴
(v) ¬(𝐴 ∧ 𝐵) ∨ 𝐴
𝐴⊢𝐵
and
𝐵⊢𝐴
There are important examples of logical equivalences which we call “fundamental logical
equivalences”, several of which have traditional names. It is important to note that some of
these names are a bit misleading, because ≡ is absolutely not equality! For example some of the
equivalences below are called “commutative”, but the formulas on either side of the equivalence
are not identical, and hence not equal to each other. The fundamental equivalences are as
follows.
17
Theorem 3.1: Fundamental logical equivalences
For all formulas 𝐴 and 𝐵, we have:
𝐴 ∧ 𝐴 ≡ 𝐴 idempotence
𝐴 ∨ 𝐴 ≡ 𝐴 idempotence
𝐴 ∧ 𝐵 ≡ 𝐵 ∧ 𝐴 commutative
𝐴 ∨ 𝐵 ≡ 𝐵 ∨ 𝐴 commutative
𝐴 ∧ (𝐵 ∧ 𝑅) ≡ (𝐴 ∧ 𝐵) ∧ 𝑅 ≡ 𝐴 ∧ 𝐵 ∧ 𝑅 associative
𝐴 ∨ (𝐵 ∨ 𝑅) ≡ (𝐴 ∨ 𝐵) ∨ 𝑅 ≡ 𝐴 ∨ 𝐵 ∨ 𝑅 associative
𝐴 ∧ (𝐵 ∨ 𝑅) ≡ (𝐴 ∧ 𝐵) ∨ (𝐴 ∧ 𝑅) distributive
𝐴 ∨ (𝐵 ∧ 𝑅) ≡ (𝐴 ∨ 𝐵) ∧ (𝐴 ∨ 𝑅) distributive
𝐴 ∧ (𝐴 ∨ 𝐵) ≡ 𝐴 absorption
𝐴 ∨ (𝐴 ∧ 𝐵) ≡ 𝐴 absorption
𝐴 → 𝐵 ≡ ¬𝐴 ∨ 𝐵
𝐴 → 𝐵 ≡ ¬(𝐴 ∧ ¬𝐵)
𝐴 → 𝐵 ≡ ¬𝐵 → ¬𝐴 contrapositive
𝐴 ↔ 𝐵 ≡ (𝐴 → 𝐵) ∧ (𝐵 → 𝐴)
𝐴 ↔ 𝐵 ≡ (¬𝐴 ∨ 𝐵) ∧ (𝐴 ∨ ¬𝐵)
𝐴 ↔ 𝐵 ≡ (𝐴 ∧ 𝐵) ∨ (¬𝐴 ∧ ¬𝐵)
These equivalences give us an insight into another way to reason about propositional formulas.
In particular, we would like to use them to simplify complicated formulas and reduce the number
of different ways of expressing the same information we have to think about. However, to do
this we would need to prove lots of properties of logical equivalence. Recalling that ≡ is not
equality, because propositional formulas are just strings, we see that we should not assume that
≡ has the usual properties of equality.
In particular, we don’t know that we can replace subformulas inside a large formula with
equivalence subformulas and claim that the result is equivalent to the large subformula we
started with! The natural deduction system makes it awkward to prove properties like this, so
18
in the next sections we will introduce an alternative way to give meaning to the connectives.
The following core exercise gives you a chance to prove some of the fundamental equival-
ences for yourself, and the extensional exercise demonstrates what reasoning about equivalence
is like if we stick to using the natural deduction system.
(i) 𝐴 ∧ 𝐴 ≡ 𝐴 idempotence
(ii) 𝐴 ∨ 𝐴 ≡ 𝐴 idempotence
(iii) 𝐴 ∧ (𝐴 ∨ 𝐵) ≡ 𝐴 absorption
(iv) 𝐴 ∨ (𝐴 ∧ 𝐵) ≡ 𝐴 absorption
EExercise 6. (On Sheet 4) Suppose that for formulas 𝐴 and 𝐵, we can derive the judgement
𝐴 ⊢ 𝐵. Prove that the judgement 𝐶 → 𝐴 ⊢ 𝐶 → 𝐵 is derivable for all formulas 𝐶.
If 𝐴 ≡ 𝐵, what does your result allow you to conclude about the formulas 𝐶 → 𝐴 and
𝐶 → 𝐵? Prove that your answer is correct.
Remarks
Very many different variations of natural deduction systems exist. So don’t get confused if
you refer to textbooks and the natural deduction system looks different. We have chosen a
natural deduction system that includes several elements of other variations of natural deduction
systems and related sequent systems, while at the same time being intuitive and practical.
While conventionally natural deduction derivations are given in tree form, we have presen-
ted them in linear form, because actual human reasoning is linear! The construction of linear
proofs is easier, and proofs tend to be shorter although the system is not optimal in this respect
(the system is not as general as it could be in order to produce shortest proofs). As a consequence
the system is easier to learn and apply. There is however no loss of generality because any
proofs in linear form can also be presented in tree form, as we have noted.
Tips
You might find the following tips useful for finding natural deduction proofs.
To construct a natural deduction proof for 𝐴1 , ..., 𝐴𝑛 ⊢ 𝐴 it is useful to:
• Work backwards and develop a strategy of how to derive A from the assumption formulas
and identify the inference rules to be applied, as well as subgoals.
• It is normally a good idea to have at least all the given assumption formulas 𝐴1 , ..., 𝐴𝑛
on the left-hand sides of the judgements in a deduction.
• Activate the needed assumption formulas by using the Axiom rule:
Axiom
𝐴1 , ..., 𝐴𝑛 ⊢ 𝐴𝑖
• Attempt to derive judgements so that you prove the subgoals and perform the inferences
that you have identified in your strategy.
• Make new assumptions as needed for performing inferences with discharge rules (→
Intro, ¬ Intro, ∨ Elim), by either using the Axiom rule or the Weakening rule.
19
COMP11120, Semester 1
Assessed Exercise Sheet 4
Core exercises
• For cExercise 1: do any two parts from (ii) to (vi)
Extensional exercises
• For eExercise 3 do the case where ⋆ is →, and one of ⋆ ∈ {∧, ∨}
• Complete eExercise 6
20