10  Natural deduction

As an alternative to Hilbert systems for deductive reasoning, we can use natural deduction systems. The notion of natural deduction came about in the 1920s as an alternative to formal systems based on an axiomatic approach. The latter were quite firmly established at that time, following the work of Frege, Russell, and Hilbert. First explored by Łukasiewicz, who pushed for a more natural treatment of logic, and Jaśkowski, who made a first attempt at formalizing this approach, natural deduction as we will present it below is due to Gentzen, who also introduced the sequent calculus. In this lecture, we will present a simplified natural deduction system, using only the \(\Rightarrow\) constructor (called implication) for well-formed formulas, as we did for Hilbert systems.

One difficulty of Hilbert systems was the absence of a so-called introduction rule for well-formed formulas of the form \(F \Rightarrow G\), meaning that, in order to be able to say that \(\Gamma \vdash_h F \Rightarrow G\) follows from \(\Gamma, F \vdash_h G\), we had to prove the deduction theorem (and this particular implication was proved by induction on the proof of \(\Gamma, F \vdash_h G\)). In contrast, in natural deduction systems, each logical connective comes equipped with an introduction rule (saying how to reach a conclusion of the form \(\Gamma \vdash F \Rightarrow G\), say) and an elimination rule (saying how to use an assumption of the form \(\Gamma \vdash F \Rightarrow G\)). As we shall see, proof derivations in natural deduction systems are usually written in tree notation, where the conclusion (called the root of the tree) appears at the bottom and the initial assumptions (called the leaves) appear at the top.

Proof tree

This enables us to visualize the structure of a proof a little better, especially how many times it “branches out” because we are using rules with more than one assumption. As we shall see, when we construct proof trees, we start with the root and build our way up to the leaves. Since we write from top to bottom, it would not be unreasonable to put the root at the top and proceed from there, but this is not the usual convention in the literature and we will follow the latter.

10.1 Sequents and inference rules

In natural deduction, sequents are (certain kinds of) pairs \((\Gamma, F)\) where \(\Gamma\) is a list of well-formed formulas called the assumptions of the sequent and \(F\) is a well-formed formula called the conclusion of the sequent. The list \(\Gamma\) is also called the context of the sequent \(\Gamma \vdash\). Note that the empty list is a context, called the empty context.

Definition 10.1 (Contexts) A context \(\Gamma\) is a list of well-formed formulas. We denote by \(\mathrm{Ctx} := \mathrm{List Wff}\) the set of contexts.

To define sequents properly, we proceed inductively. The point is that not all pairs \((\Gamma, F)\) in \(\mathrm{List Wff} \times \mathrm{Wff}\) are sequents. We can call those general pairs pre-sequents. The idea is that only those pre-sequents that are constructed according to a given set of rules are considered sequents, and listing these rules amounts to defining an inductive predicate on pre-sequents, meaning a function \(\mathrm{Ctx} \times \mathrm{Wff} \to \mathrm{Prop}\), where the proposition “the pre-sequent \((\Gamma, F)\) is a sequent” is defined inductively.

When \(\Gamma'\) is a list of well-formed formulas and \(A\) is a well-formed formula, by \(\Gamma', A\), we mean the concatenation \(\Gamma \texttt{++} [A]\) of \(\Gamma\) and the singleton list \([A]\).

Definition 10.2 (Sequents) Let \(\Gamma\) be a context and let \(F\) be a well-formed formula. The property of being a sequent, denoted by \(\Gamma \vdash F\) and read as “\(\Gamma\) proves \(F\)”, is defined inductively as follows.

  1. (Focus) If \(\Gamma\) is a context and \(A\) is a well-formed formula, then \(\Gamma, A \vdash A\).
  2. (Weakening) If \(\Gamma\) is a context and \(A, B\) are well-formed formulas such that \(\Gamma \vdash A\), then \(\Gamma, B \vdash A\).
  3. (\(\Rightarrow\)-intro) If \(\Gamma\) is a context and \(A, B\) are well-formed formulas such that \(\Gamma, A \vdash B\), then \(\Gamma \vdash A \Rightarrow B\).
  4. (\(\Rightarrow\)-elim) If \(\Gamma\) is a context and \(A, B\) are well-formed formulas such that \(\Gamma \vdash A\) and \(\Gamma, A \vdash B\), then \(\Gamma \vdash B\).

To emphasise that a pair \((\Gamma, F)\) is a sequent, we denote it by \(\Gamma \vdash F\). In practice, the notation \(\Gamma \vdash F\) will refer both to a pre-sequent \((\Gamma, F)\) of which we know that it is a sequent and to the fact that the pre-sequent \((\Gamma, F)\) is a sequent.

Equivalently, one could say that a pair \((\Gamma, F)\), consisting of a context \(\Gamma\) and a formula \(F\), is a sequent if one of the following properties holds:

  1. (Focus) There exist a context \(\Gamma'\) and a well-formed formula \(A\) such that \(\Gamma = \Gamma' \texttt{++} [A]\) and \(F = A\).
  2. (Weakening) There exist a context \(\Gamma'\) and well-formed formulas \(A\) and \(B\) such that \((\Gamma', A)\) is a (previously obtained) sequent, \(\Gamma = \Gamma' \texttt{++} [B]\) and \(F = A\).
  3. (\(\Rightarrow\)-intro) There exist well-formed formulas \(A\) and \(B\) such that \((\Gamma \texttt{++} [A], B)\) is a (previously obtained) sequent and \(F = A \Rightarrow B\).
  4. (\(\Rightarrow\)-elim) There exists a well-formed formula \(E\) such that \((\Gamma, E)\) and \((\Gamma, E \Rightarrow F)\) are sequents.

Either way, we have defined a predicate IsSequent : Ctx → Wff → Prop, which we will formalise in Rocq in the next lecture. Definition 10.2 lists four ways, called inference rules, to prove that the proposition \(\Gamma \vdash F\) holds. The first two rules, focus and weaken are common to all natural deduction systems (they are not related to well-formed formulas). The other two, \(\Rightarrow\)-intro and \(\Rightarrow\)-elim, are related to the constructor \(\Rightarrow\) for well-formed formulas. As a matter of fact, there should be zero or more introduction rules and zero or more elmination rules for each constructor. So what we have presented here is a deliberately simplified natural deduction system, where we have ignored the constructors \(\wedge\) and \(vee\), for instance. We will see about those later. For now, our goal is to present the principles of a natural deduction, to establish the soundness of Boolean semantics of well-formed formulas with respect to this deductive reasoning system, and to compare sequents in the sense of Definition 10.2 to derivable well-formed formulas in the sense of Hilbert systems.

10.2 Derived rules

Let us prove a few basic sequents \(\Gamma \vdash F\) using the inference rules of Definition 10.2. Equivalently, let us prove that a few pairs \((\Gamma, F)\), where \(\Gamma\)is a list of well-formed formulas and \(F\) is a well-formed formulas, are sequents in the sense of Definition 10.2. We will write the proof in tree form, to be read from bottom to top, indicating the name of the inference rule used to go from a sequent to the row immediately above it.

When a row contains more than one sequent, that row is to be interpreted as the conjunction of those sequents (in the meta-language). For instance, in the inference rule \(\Rightarrow\)-elim, says that if we have the sequents \(\Gamma \vdash A\) and \(\Gamma \vdash A \Rightarrow B\), then we can deduce the sequent \(\Gamma \vdash B\).

Proof tree

As a warm-up, let us write the four basic inference rules of Definition 10.2 in tree form (of height one, since it is just one rule). The height of the proof trees we shall construct later will depend on the number of inference rules (basic or derived from basic) that have been used on each branch (a branch being a path from the root to a leaf).

Proof tree

Proof tree

Note that when a sequent holds for all context \(\Gamma\), it holds in particular in the empty context \(\Gamma = [\ ]\). Later, it will be a good exercise to prove that if \([\ ] \vdash F\) holds (which will be written simply as \(\vdash F\), then for every list of well-formed formulas \(\Gamma\), we have the sequent \(\Gamma \vdash F\).)

NoteHeuristics to write a proof using natural deduction

When looking for a proof, the following informal strategy is often useful:

  1. If it is possible to apply an introduction rule, do it.
  2. If not, try to find an appropriate elimination rule, or a theorem you can apply.

10.2.1 \(A \Rightarrow A\)

Let us prove a rule called \(I\) (for identity).

Theorem 10.1 (I) For every context \(\Gamma\) and every well-formed formula \(A\), the sequent \(\Gamma \vdash A \Rightarrow A\) holds.

Proof. Proof tree

10.2.2 Revert

This next rule is called the revert rule. It is a converse to the introduction rule of implication, so in fact the sequent \(\Gamma \vdash A \Rightarrow B\) holds if and only if the sequent \(\Gamma, \vdash B\) holds, exactly as in the deduction theorem for Hilbert systems (but with a much simpler proof).

Theorem 10.2 (The revert rule) For every context \(\Gamma\) and all well-formed formulas \(A, B\), if the sequent \(\Gamma \vdash A \Rightarrow B\) holds, then the sequent \(\Gamma, A \vdash B\) holds.

Proof. Proof tree

10.2.3 Transitivity of \(\Rightarrow\)

Next we prove the \(\Rightarrow\)-trans rule. Note how we use the revert rule (which is not one of our basic rules but is derived from those) in the proof of \(\Rightarrow\)-trans.

Theorem 10.3 (Transitivity of implication) For every context \(\Gamma\) and all well-formed formulas \(A, B, C\), the sequent \(\Gamma \vdash (A \Rightarrow B) \Rightarrow (B \Rightarrow C) \Rightarrow (A \Rightarrow C)\) holds.

Proof. Proof tree

Note also, that we are not specifying, at each step, the precise arguments of each of the inference rules. For instance in the above application of the elimination rule for \(\Rightarrow\), our goal was to deduce \(C\) and we chose to apply \(\Rightarrow\)-elim with \(B\) and \(B \Rightarrow C\) as arguments, but we did not indicate it explicitly on the right side. If we did (but still left the context implicit), the proof tree would look as follows.

Proof tree

If we wanted to indicate the context explicitly, say with the notation \(\Gamma' := \Gamma, A \Rightarrow B, B \Rightarrow C, A\), our proof tree would look as follows.

Proof tree

In particular, when applying \(\Rightarrow\)-elim, the context \(\Gamma'\) has to be the same in all three ocurrences of a context.

10.2.4 Cut

The next rule, known as the cut rule, is genuinely new to us (we did not cover it in the lecture on Hilbert systems). It gives us a way, if we want to derive \(B\) from \(\Gamma\), to add a well-formed formula \(A\) in the context.

Theorem 10.4 (The cut rule) For every context \(\Gamma\) and all well-formed formulas \(A, B\), if the sequents \(\Gamma \vdash A\) and \(\Gamma, A \vdash B\) hold, then the sequent \(\Gamma \vdash B\) holds.

Proof. Proof tree

TipApplying a lemma in the course of a proof

Using the cut rule formalises the notion of “applying a lemma” in a proof: one adds an assumption to the context and then one proves that assumption from the original context.

10.3 Axioms from Hilbert systems

In preparation for the forthcoming comparison theorem with the Hilbert system KS+mp constructed earlier in the course, we give a proof, in the natural deduction system of Definition 10.2, of the axioms K and S from the Hilbert system KS+mp. As for the MP rule of that Hilbert system, it simply corresponds to the inference rule \(\Rightarrow\)-elim.

Theorem 10.5 (K) For every context \(\Gamma\) and all well-formed formulas \(A, B\), the sequent \(\Gamma \vdash A \Rightarrow B \Rightarrow A\) holds.

Proof. Proof tree

Theorem 10.6 (S) For every context \(\Gamma\) and all well-formed formulas \(A, B, C\), the sequent \(\Gamma \vdash (A \Rightarrow B \Rightarrow C) \Rightarrow (A ⇒ B) \Rightarrow (A \Rightarrow C)\) holds.

Proof. Proof tree

On this example, we can appreciate that the only creative step in the proof, just like in Theorem 10.3, is the choice of \(B\) when applying \(\Rightarrow\)-elim in order to deduce \(\Gamma' \vdash C\) from \(\Gamma' \vdash B\) and \(\Gamma' \vdash B \Rightarrow C\) (where \(\Gamma' := \Gamma, A \Rightarrow B \Rightarrow C, A \Rightarrow B, A\)).