3. Proofs as objects
Draft
From axioms to rules
A proof can be made into a mathematical object: a finite tree of formulas in which every step applies one of a small fixed set of rules. Whether a tree is a valid proof can be checked mechanically step by step, and theorems can be proved about proofs just as they are about finite graphs. The central theorem of this part says that every logical detour in a proof can be eliminated, and from that single fact follows the consistency of logic. Consider a concrete detour: instead of chaining \(P\) through \(P \to Q\) to get \(Q\) and through \(Q \to R\) to get \(R\), the proof below first packages \(P\) and \(P \to Q\) into a pair, proves the helper implication \(P \land (P \to Q) \to R\), and immediately unpacks both to derive \(R\).
proof R from P, P → Q and Q → R, through the lemma P ∧ (P → Q) → R
tree the conclusion first, the premises of a rule indented under it rule
R →E
P ∧ (P → Q) → R the detour: introduced here, eliminated one line down →I, discharges [P ∧ (P → Q)]
R →E
Q → R an assumption
Q →E
P → Q ∧E₂
[P ∧ (P → Q)]
P ∧E₁
[P ∧ (P → Q)]
P ∧ (P → Q) ∧I
P an assumption
P → Q an assumption
steps formulas in the proof after each conversion 12 → 11 → 8 → 5
of them no subformula of what is proved 4, 2, 1, 0
normal after 3 conversions: R from Q → R and Q, Q from P → Q and P. Every formula is a subformula of
R, P, P → Q or Q → R.
other a lemma used twice 10 → 11 · a case already known 7 → 2 · a case, then a projection 9 → 10 → 7 → 4
Lean 4.35.0, #reduce on the same proof, stops after 1 of the 3 conversions: hqr (⟨hp, hpq⟩.right ⟨hp, hpq⟩.left)
(the live figure needs JavaScript; it loads no data)
Three rewritings strip the lemma away and shrink 12 formulas to 5, every remaining formula being a piece of an open assumption or of the conclusion. A proof in that stripped-down state has nowhere to hide a contradiction (Section 3.3). Sections 1 and 2 turned computation into a mathematical object by defining lambda terms that reduce and types that force reduction to halt. This part does the same for deduction, and Section 4 shows that the two objects are identical: removing a logical detour is a step of program reduction, and for implication it is β-reduction itself.
A kernel (Section 6) checks these proof objects against two demands: the rules must express real mathematical proofs, and they must prove no contradiction, since one contradiction proves everything. Writing a proof as a flat list of formulas makes checking easy, since every line stands unconditionally on its own, yet makes finding proofs hard, since there is no step for making a temporary assumption. Adding temporary assumptions turns proofs into trees whose rules come in matched pairs: an introduction builds a formula up, and an elimination takes it apart. Introducing a formula only to eliminate it at once is a detour; proving that all detours can be removed establishes consistency outright for logic, and for arithmetic from one ordering principle that arithmetic itself cannot prove.
That proofs should be objects of mathematics at all was David Hilbert's demand, in a talk of 1917.
To conquer this field [concerning the foundations of mathematics] we must turn the concept of a specifically mathematical proof itself into an object of investigation, just as the astronomer considers the movement of his position, the physicist studies the theory of his apparatus, and the philosopher criticizes reason itself.
—David Hilbert, "Axiomatisches Denken" (1918), as translated in Rathjen and Sieg, "Proof Theory". M. Rathjen and W. Sieg, "Proof Theory", Stanford Encyclopedia of Philosophy (revision of 21 February 2024), §1 (the entry); the words in brackets are the entry's. The talk was given to the Swiss Mathematical Society and printed the year after.
The first formal systems represented proofs as flat lists rather than trees: in the calculi of Frege (1879), Russell, and Hilbert's school, nearly all logical content sits in axiom schemes so that proofs rely on a single inference rule and are easy to check by induction.
Definition 3.1.1 (a Hilbert-style system). Formulas are built from atoms \(p, q, r, \dots\) and \(\bot\) (falsity) with \(\land\), \(\lor\) and \(\to\); \(\lnot A\) abbreviates \(A \to \bot\). A proof is a finite list of formulas, each an axiom or obtained from two earlier lines \(A\) and \(A \to B\) as \(B\) (modus ponens, the only rule). The axioms are the instances of a few schemes, in which \(A\), \(B\) and \(C\) stand for any formulas. Two schemes govern implication,
\[\text{(1)}\quad A \to (B \to A), \qquad\quad \text{(2)}\quad (A \to B) \to ((A \to (B \to C)) \to (A \to C)),\]and a few more each of the other connectives.The system is that of J. Moschovakis, "Intuitionistic Logic", Stanford Encyclopedia of Philosophy (revision of 16 December 2022), §2.1 (the entry), after Kleene: ten schemes for propositional logic, and two schemes and two rules more for the quantifiers. It takes negation as a connective with two schemes of its own, and classical logic differs from it in one scheme. Frege's Begriffsschrift of 1879 was the first system of this kind for which completeness was claimed.
Because a Hilbert-style list has no rule for making a temporary assumption, proving even the trivial implication \(A \to A\) requires assembling nested axiom instances so that modus ponens cancels the unwanted premises.
Example 3.1.2 (the identity in five lines). For every formula \(A\), the list
\[\begin{aligned} &1.\;\; A \to (A \to A) && \text{scheme (1) with } B := A \\ &2.\;\; (A \to (A \to A)) \to ((A \to ((A \to A) \to A)) \to (A \to A)) && \text{scheme (2) with } B := A \to A,\ C := A \\ &3.\;\; (A \to ((A \to A) \to A)) \to (A \to A) && \text{from 1 and 2} \\ &4.\;\; A \to ((A \to A) \to A) && \text{scheme (1) with } B := A \to A \\ &5.\;\; A \to A && \text{from 4 and 3} \end{aligned}\]is a proof of \(A \to A\): three axioms and two uses of modus ponens. ◁
Nobody guesses line 2 by staring at the goal \(A \to A\), and the reason is structural. Modus ponens steps from \(X\) and \(X \to Y\) to \(Y\), erasing \(X\) completely: working backward from a target \(Y\), nothing in \(Y\) indicates which intermediate formula \(X\) to invent, and \(X\) may be far more complicated than \(Y\), as \(A \to ((A \to A) \to A)\) is in line 4. The system is not logically weak; it proves the exact same theorems as the calculi that follow (Section 3.4). What it lacks is the move by which mathematicians actually prove an implication: temporarily assume \(A\), derive \(B\), and conclude \(A \to B\). A Hilbert system can only simulate that move from outside (via the constructive proof of the deduction theorem), expanding each line derived under \(A\) into three lines of axioms and modus ponens, and expanding the assumption \(A\) itself into the five lines of Example 3.1.2.Moschovakis, §2.2, which gives the five lines and remarks that they are "part of the constructive proof of the Deduction Theorem". In a derivation of \(B\) from the assumption \(A\), a line \(C\) that is an axiom becomes \(C\), \(C \to (A \to C)\) and \(A \to C\); a line \(C\) obtained by modus ponens from \(D\) and \(D \to C\) becomes an instance of scheme (2), with \(D\) for its \(B\), and two uses of the rule, on \(A \to D\) and on \(A \to (D \to C)\); the line \(A\) becomes the five lines.
In 1926 Jan Łukasiewicz put it to his seminar that mathematicians do not prove theorems this way: they make assumptions and see where they lead. By September 1932 Gerhard Gentzen had a calculus that does the same.F. J. Pelletier, "A brief history of natural deduction", History and Philosophy of Logic 20 (1999), pp. 1 to 31 (the author's copy), §3, which credits the first such calculus to Stanisław Jaśkowski, in a paper of 1934 that answered Łukasiewicz. For Gentzen: J. von Plato, "The Development of Proof Theory", Stanford Encyclopedia of Philosophy (revision of 13 October 2014), §4 (the entry).
Natural deduction
In Gentzen's calculus, published in 1935, the theorem of Example 3.1.2 takes one step. Assume \(A\): that is a derivation of \(A\) from the assumption \(A\). Conclude \(A \to A\), and mark the assumption as discharged, no longer something the conclusion depends on:
\[\dfrac{[A]^{1}}{A \to A}\;{\to}\mathrm{I}^{1}\]His paper opens by saying what it is for.
My starting point was this: The formalization of logical deduction, especially as it has been developed by Frege, Russell, and Hilbert, is rather far removed from the forms of deduction used in practice in mathematical proofs. Considerable formal advantages are achieved in return.
In contrast, I intended first to set up a formal system which comes as close as possible to actual reasoning. The result was a ‘calculus of natural deduction’ (‘NJ’ for intuitionist, ‘NK’ for classical predicate logic)…
—Gerhard Gentzen, "Investigations into logical deduction" (1935), translated by M. E. Szabo (1969), as quoted by F. J. Pelletier (1999). "Untersuchungen über das logische Schließen", Mathematische Zeitschrift 39 (1935), pp. 176 to 210 and 405 to 431, received on 21 July 1933; the passage is from the synopsis on its first page. Szabo's English is in The Collected Papers of Gerhard Gentzen (North-Holland, 1969), quoted here as far as Pelletier (1999), p. 4, quotes it; the last ellipsis is Pelletier's. The highlighted sentence in the original: Ich wollte nun zunächst einmal einen Formalismus aufstellen, der dem wirklichen Schließen möglichst nahe kommt.
Because rules can combine two separate subproofs and discharge open assumptions sitting at leaves above them, derivations now form trees with labeled leaves rather than flat lists. Lean's basic tactics apply the rules of this calculus directly (Section 10.2), and Section 4 recovers the same rules as the typing rules of a programming language.
Definition 3.2.1 (natural deduction). A derivation is a finite tree of formulas. Its leaves are assumptions; every other formula follows from those directly above it by one of the following rules. An assumption is open unless a rule further down has discharged it, which is recorded by brackets and a number shared with the rule. A derivation derives its lowest formula, the conclusion, from its open assumptions; with none it is a proof. The rules for the connectives are
\[\dfrac{A \quad B}{A \land B}\;{\land}\mathrm{I} \qquad \dfrac{A \land B}{A}\;{\land}\mathrm{E}_1 \qquad \dfrac{A \land B}{B}\;{\land}\mathrm{E}_2 \qquad \dfrac{\begin{array}{c} {[A]^{n}} \\ \vdots \\ B \end{array}}{A \to B}\;{\to}\mathrm{I}^{n} \qquad \dfrac{A \to B \quad A}{B}\;{\to}\mathrm{E}\] \[\dfrac{A}{A \lor B}\;{\lor}\mathrm{I}_1 \qquad \dfrac{B}{A \lor B}\;{\lor}\mathrm{I}_2 \qquad \dfrac{A \lor B \quad \begin{array}{c} {[A]^{n}} \\ \vdots \\ C \end{array} \quad \begin{array}{c} {[B]^{m}} \\ \vdots \\ C \end{array}}{C}\;{\lor}\mathrm{E}^{n,m} \qquad \dfrac{\bot}{C}\;{\bot}\mathrm{E}\]The rule →I discharges any number of occurrences of \(A\) above it, none included, and ∨E occurrences of \(A\) above its second premise and of \(B\) above its third. In an elimination (E) the premise that carries the connective is the major premise. These nine rules are intuitionistic logic; without ⊥E they are minimal logic. Predicate logic adds four,
\[\dfrac{A(a)}{\forall x\,A(x)}\;{\forall}\mathrm{I} \qquad \dfrac{\forall x\,A(x)}{A(t)}\;{\forall}\mathrm{E} \qquad \dfrac{A(t)}{\exists x\,A(x)}\;{\exists}\mathrm{I} \qquad \dfrac{\exists x\,A(x) \quad \begin{array}{c} {[A(a)]^{n}} \\ \vdots \\ C \end{array}}{C}\;{\exists}\mathrm{E}^{n}\]where \(t\) is any term and the variable \(a\), which does not occur in \(A(x)\), occurs in no open assumption above ∀I, and in ∃E neither in \(C\) nor in an open assumption other than the discharged \(A(a)\).Gentzen's name for this calculus is NJ; his classical calculus NK is the subject of Section 3.6. The rules are given as in J.-Y. Girard, Proofs and Types, translated and with appendices by P. Taylor and Y. Lafont (Cambridge University Press, 1989; the web edition), §§2.1 and 10.1. The condition on the variable is Gentzen's.
Discharging has no counterpart in a list of formulas. In Section 3.1, the assumption \(P \land (P \to Q)\) sits at two leaves and one →I step discharges both: the leaves stay as local placeholders, while the lemma \(P \land (P \to Q) \to R\) below no longer depends on them, just as \(\lambda x\) in Section 1 binds every free \(x\) in its body. Likewise, the freshness condition on \(a\) in ∀I and ∃E ensures that \(a\) stands for an arbitrary individual under no special assumption.
Each connective has rules of two kinds. An introduction (I) says how to build a direct proof: for \(A \land B\) a proof of each part, for \(A \to B\) a derivation of \(B\) from \(A\). An elimination (E) says how to use one: projecting from \(A \land B\), applying \(A \to B\) to \(A\), or splitting \(A \lor B\) into cases that each yield \(C\). Gentzen remarked that introductions act as definitions of the connectives and eliminations as their consequences (Section 4.7); Section 3.3 turns that remark into a theorem by showing that an elimination extracts only what its introduction put in.
Detours and normal proofs
In Section 3.1, the lemma \(P \land (P \to Q) \to R\) is concluded by an introduction (→I) and at once becomes the major premise of an elimination (→E). Gentzen called such a peak a hillock or detour: the proof climbs to a formula more complex than its neighbors and comes straight back down. A case split (∨E) or ⊥E sitting between an introduction and an elimination can also hide a detour inside its branches until the outer elimination is pushed up into them. Removing detours requires one exact rewrite rule per connective.
Definition 3.3.1 (detours, conversions, normal derivations). A detour is a formula in a derivation that is the conclusion of an introduction and the major premise of an elimination. A conversion removes one. For \(\land\): ∧I followed by ∧E₁ is replaced by the derivation of the first premise of the ∧I (of the second, for ∧E₂). For \(\to\): →I followed by →E against a derivation \(\mathcal{E}\) of \(A\) is replaced by the derivation of \(B\) that stood above the →I, with a copy of \(\mathcal{E}\) for every discharged occurrence of \(A\). For \(\lor\) likewise: ∨I followed by ∨E is replaced by the case that the ∨I chose, with the derivation above the ∨I for that case's assumption. Two commuting conversions apply where a ∨E or a ⊥E concludes the major premise of an elimination: the elimination moves up into both cases of the ∨E, or the ⊥E absorbs it and concludes its conclusion. The quantifiers have conversions of both kinds. A derivation is normal when no conversion applies.For the quantifiers: ∀I followed by ∀E is replaced by the derivation above the ∀I with \(t\) put for \(a\) throughout; ∃I followed by ∃E by the derivation above the second premise of the ∃E, with \(t\) put for \(a\) and the derivation above the ∃I for the discharged assumption; and an elimination whose major premise is concluded by a ∃E moves up above that second premise.
In the page's engine the detour conversions for \(\to\), \(\land\) and \(\lor\) are three lines: n is the elimination, m its major premise, and subst(p, x, r) puts the derivation r for the assumption labeled x in p.
function convert(n, d) {
var m = n.sub[0], rf, u, v, q, w, t;
switch (d) {
case DET.imp: return subst(m.sub[0], m.label, n.sub[1]);
case DET.and: return m.sub[n.rule === 'andE1' ? 0 : 1];
case DET.or: return m.rule === 'orI1' ? subst(n.sub[1], n.labels[0], m.sub[0]) : subst(n.sub[2], n.labels[1], m.sub[0]);
// ...
}
}
Each conversion works because an elimination inverts its introduction: what →E needs from \(A \to B\), a way from \(A\) to \(B\), is what stood above →I. Whether conversions ever stop is less obvious, raising for proofs the termination question of Section 2.4. Removing the implication detour in Section 3.1 places ∧I directly over ∧E₁ and ∧E₂, creating two conjunction detours; and substituting into an assumption used twice copies a subproof, turning 10 formulas into 11 in a shared proof of \(R \land R\). A normal proof is direct, not short.
Theorem 3.3.2 (normalization). In intuitionistic logic every derivation can be transformed by conversions into a normal derivation of the same conclusion with no new open assumptions; and in whatever order conversions are applied, they come to an end.The first half is in a manuscript of 1933 that Gentzen gave to Bernays and did not print; Jan von Plato found it in 2005 and published it in 2008. D. Prawitz published a proof in Natural Deduction: A Proof-Theoretical Study (Almqvist & Wiksell, 1965), and the second half, strong normalization, in 1971. F. J. Pelletier and A. Hazen, "Natural Deduction Systems in Logic", Stanford Encyclopedia of Philosophy (revision of 24 February 2026), §§5.1 to 5.4 (the entry).
The idea of the proof, for \(\land\) and \(\to\) under a chosen order. Call the parse-tree height of the detour formula its degree, and measure a derivation by \((d, m)\): the maximum detour degree \(d\) and the count \(m\) of detours of degree \(d\). Convert a detour of degree \(d\) with no detour of degree \(d\) above it. Duplicating the argument then copies only detours of degree below \(d\), and any newly exposed detours sit on proper subformulas \(A\) or \(B\), also of degree below \(d\). Thus \((d, m)\) drops in the lexicographic order, which allows no infinite descent. Section 3.5 repeats this argument along a much longer ordering.
A normal proof is useful because it cannot invent complex helper formulas that vanish before the end.
Theorem 3.3.3 (subformula property). In a normal derivation of intuitionistic logic every formula is a subformula of the conclusion or of an open assumption. Here every instance \(A(t)\) counts as a subformula of \(\forall x\,A(x)\) and of \(\exists x\,A(x)\).Girard, §10.3.1, for the rules of \(\land\), \(\to\) and \(\forall\), with a proof of ten lines; §10.3.2 for the rest, where the commuting conversions are needed. Rathjen and Sieg, §2.1.
For \(\land\) and \(\to\), the tree shows why. Walking upward along major premises from any elimination can never hit an introduction (which would be a detour), so the path climbs through eliminations to an open assumption, taking it apart into subformulas before introductions lower down build subformulas of the conclusion. With \(\lor\), the commuting conversions are essential: otherwise proving \(P\) from \(P \lor P\) by building \(P \land P\) in both branches and projecting afterward would hide \(P \land P\) without creating a direct detour.
Where nothing is assumed, that upward path along major premises has nowhere to land, yielding consistency at once.
Corollary 3.3.4. (i) Intuitionistic logic is consistent: \(\bot\) has no proof, and no atom has one. (ii) Disjunction property: from a proof of \(A \lor B\), normalization produces a proof of \(A\) or a proof of \(B\).
Proof. Because a closed proof has no open assumptions, its normal form cannot end in an elimination: tracing major premises upward from a final elimination would have to terminate at an open assumption.In the full calculus too. No formula on that path is concluded by an introduction, nor by a ∨E, ∃E or ⊥E, to which a commuting conversion would apply. So above the last rule the path runs through ∧E, →E and ∀E to an assumption, and nothing discharges it: these rules discharge nothing, and a last rule ∨E or ∃E discharges only above its other premises. Girard, §10.3.2. The normal proof must therefore end in an introduction rule. Neither \(\bot\) nor a bare atom has an introduction rule, which gives (i), and the only introductions for \(A \lor B\) step directly from a proof of \(A\) or from a proof of \(B\), which gives (ii). ∎
Looking at the rules of conjunction and implication, one notes that the premisses (the formulas immediately above the inference line) are subformulas of the conclusion in the I-rules, whereas it is the other way around in the E-rules. Gentzen noticed that in normal derivations, this property of single steps is inherited by the whole derivation, in the sense that all formulas are subformulas of the conclusion. This result gave as a byproduct a decision method for intuitionistic propositional logic. Another corollary was a syntactic proof of consistency: if a contradiction is provable, anything is provable, but an atomic formula, say, has no proof: if it has a proof, it has a normal proof, but no E-rules apply to an atomic formula, and no I-rule concludes it either.
—Jan von Plato, "The Development of Proof Theory" (2014). Stanford Encyclopedia of Philosophy, §4.
Gentzen published neither Theorem 3.3.2 nor its proof. Classical natural deduction adds a rule such as double-negation elimination, from \(\lnot\lnot A\) infer \(A\) (Section 3.6), which breaks the pairing of introductions with eliminations and can bring in formulas unrelated to the conclusion. To obtain a single normalization theorem covering both intuitionistic and classical logic, Gentzen designed a second calculus.
The sequent calculus and the cut rule
Instead of tracking open assumptions at distant leaves of a tree, Gentzen's second calculus writes every node as a self-contained line \(\Gamma \Rightarrow \Delta\) listing its active assumptions \(\Gamma\) on the left of \(\Rightarrow\) and its target conclusions \(\Delta\) on the right. Rather than arising implicitly whenever an introduction meets an elimination, all use of intermediate lemmas is isolated in a single explicit rule called cut. Here is the detour proof of Section 3.1 rewritten with its lemma as a cut.
proof P, P → Q, Q → R ⇒ R, with one cut, on the lemma P ∧ (P → Q) → R
tree the conclusion first, the two premises of the cut indented under it rule
P, P → Q, Q → R ⇒ R cut on P ∧ (P → Q) → R
Q → R ⇒ P ∧ (P → Q) → R the lemma is proved: 8 rule applications →R
P, P → Q, P ∧ (P → Q) → R ⇒ R the lemma is used: 5 rule applications →L
steps rule applications after each step of the elimination 14 → 13 → 11 → 11 → 12 → 12 → 9 → 7 → 5
of them on formulas outside the sequent proved 6, 4, 4, 4, 3, 3, 0, 0, 0
other a lemma used twice 12 → 11 → 9 → 15 → 13 → 11 · the family at n = 3: 21 → 33 → 33 → 31 → 31 → 29
family Statman's tautologies with n hypotheses, measured in the page for n = 2 to 10
with cut, 12n − 15 rule applications 9, 21, 33, 45, 57, 69, 81, 93, 105
without cut, the proof this procedure returns, 10·3ⁿ⁻² − 1 9 · 29 · 89 · 269 · 809 · 2,429 · 7,289 · 21,869 · 65,609
the same steps in the other order, axioms on atoms, at n = 6: 547,061 against 1,457; at n = 7 stopped over 1,000,000
published: about 2ⁿ branches at least in every proof without cut (1,024 at n = 10)
published, predicate logic, not run: a lower bound that is a tower, 2, 4, 16, 65,536
Lean 4.35.0 keeps a lemma stated with have in the term it checks: have lemma := fun h => hqr (h.right h.left); lemma ⟨hp, hpq⟩
(the live figure needs JavaScript; it loads no data)
Eliminating the cut takes eight steps. The number of rule applications goes 14, 13, 11, 11, 12, 12, 9, 7, 5, not always downward, and at the end no formula is left but those of the sequent proved and their parts. The synopsis of Gentzen's paper says what his main theorem, the Hauptsatz, is and why it needed a new calculus.
A closer investigation of the specific properties of the natural calculus finally led me to a very general theorem which will be referred to below as the Hauptsatz. The Hauptsatz says that every purely logical proof can be reduced to a definite, though not unique, normal form. Perhaps we may express the essential properties of such a normal proof by saying: it is not roundabout. No concepts enter into the proof other than those contained in its final result, and their use was therefore essential to the achievement of that result …
In order to be able to enunciate and prove the Hauptsatz in a convenient form, I had to provide a logical calculus especially suited to the purpose. For this the natural calculus proved unsuitable… [T]herefore, I [developed] a new calculus of logical deduction possessing all the desired properties in both their intuitionist and their classical forms (‘LJ’ for intuitionist, ‘LK’ for classical predicate logic). The Hauptsatz will then be enunciated and proved by means of that calculus…
—Gerhard Gentzen, "Investigations into logical deduction" (1935), translated by M. E. Szabo (1969), as quoted by F. J. Pelletier (1999). From the same synopsis; Pelletier (1999), pp. 28 to 29, whose ellipses and brackets these are. The usual name today is the cut elimination theorem.
Gentzen's structural insight was to make both sides of \(\Rightarrow\) symmetric: allowing multiple formulas in \(\Delta\) on the right (read disjunctively: if all formulas in \(\Gamma\) hold, at least one formula in \(\Delta\) holds) accommodates classical reasoning without special indirect-proof rules, while restricting \(\Delta\) to at most one formula recovers intuitionistic logic inside the exact same framework.
Definition 3.4.1 (sequents, LK and LJ). A sequent is an expression \(\Gamma \Rightarrow \Delta\) in which \(\Gamma\) (the antecedent) and \(\Delta\) (the succedent) are finite lists of formulas, read: if all of \(\Gamma\) hold, at least one of \(\Delta\) holds. So \(\Rightarrow A\) asserts \(A\), and the empty sequent \(\Rightarrow\) a contradiction. A derivation in LK is a finite tree of sequents with initial sequents, \(A \Rightarrow A\) or \(\bot \Rightarrow\), at its leaves, each other sequent following from those directly above it by a rule. The structural rules add a formula on either side (weakening), merge two copies of one (contraction) and reorder (exchange). The connectives have rules on the left and on the right,
\[\dfrac{A, \Gamma \Rightarrow \Delta}{A \land B, \Gamma \Rightarrow \Delta}\;{\land}\mathrm{L}_1 \qquad \dfrac{B, \Gamma \Rightarrow \Delta}{A \land B, \Gamma \Rightarrow \Delta}\;{\land}\mathrm{L}_2 \qquad \dfrac{\Gamma \Rightarrow \Delta, A \quad \Gamma \Rightarrow \Delta, B}{\Gamma \Rightarrow \Delta, A \land B}\;{\land}\mathrm{R}\] \[\dfrac{A, \Gamma \Rightarrow \Delta \quad B, \Gamma \Rightarrow \Delta}{A \lor B, \Gamma \Rightarrow \Delta}\;{\lor}\mathrm{L} \qquad \dfrac{\Gamma \Rightarrow \Delta, A}{\Gamma \Rightarrow \Delta, A \lor B}\;{\lor}\mathrm{R}_1 \qquad \dfrac{\Gamma \Rightarrow \Delta, B}{\Gamma \Rightarrow \Delta, A \lor B}\;{\lor}\mathrm{R}_2\] \[\dfrac{\Gamma \Rightarrow \Delta, A \quad B, \Lambda \Rightarrow \Theta}{A \to B, \Gamma, \Lambda \Rightarrow \Delta, \Theta}\;{\to}\mathrm{L} \qquad \dfrac{A, \Gamma \Rightarrow \Delta, B}{\Gamma \Rightarrow \Delta, A \to B}\;{\to}\mathrm{R}\]and one rule introduces nothing, the cut:
\[\dfrac{\Gamma \Rightarrow \Delta, A \qquad A, \Lambda \Rightarrow \Theta}{\Gamma, \Lambda \Rightarrow \Delta, \Theta}\;\text{cut}\]The quantifiers have the rules
\[\dfrac{A(t), \Gamma \Rightarrow \Delta}{\forall x\,A(x), \Gamma \Rightarrow \Delta}\;{\forall}\mathrm{L} \qquad \dfrac{\Gamma \Rightarrow \Delta, A(a)}{\Gamma \Rightarrow \Delta, \forall x\,A(x)}\;{\forall}\mathrm{R} \qquad \dfrac{A(a), \Gamma \Rightarrow \Delta}{\exists x\,A(x), \Gamma \Rightarrow \Delta}\;{\exists}\mathrm{L} \qquad \dfrac{\Gamma \Rightarrow \Delta, A(t)}{\Gamma \Rightarrow \Delta, \exists x\,A(x)}\;{\exists}\mathrm{R}\]with \(a\) not occurring in the lower sequent of ∀R and of ∃L. LJ is LK with at most one formula in every succedent.L is for "logistic", J and K for intuitionistisch and klassisch; "sequent" is Kleene's English for Gentzen's Sequenz. Gentzen's calculus has negation as a connective with a rule on each side; with \(\lnot A\) read as \(A \to \bot\) and the initial sequent \(\bot \Rightarrow\) those two rules are derived. The notation of this series for a sequent is a turnstile, \(\Gamma \vdash \Delta\); this part keeps the double arrow of its figures and of the Stanford Encyclopedia, and uses \(\vdash\) for "proves". Rules as in Rathjen and Sieg, §2.2, and Girard, §5.1.
The right rules match the introductions of natural deduction, while the left rules turn natural deduction's eliminations upside down: reading downward from premise to conclusion, both left and right rules only ever build larger formulas out of smaller ones, either in the conclusion on the right or among the assumptions on the left. Consequently, in every rule except one, every formula above the inference line reappears intact or inside a compound formula below the line. The lone exception is cut: it proves a lemma \(A\) on the right of one premise, assumes \(A\) on the left of the other, and splices the two sequents together so that \(A\) vanishes completely from the bottom line. Cut is the use of an intermediate lemma, generalizing the modus ponens of Section 3.1; in Lean it corresponds to have, and Lean displays every proof goal as a sequent (Definition 10.1.1).
These are three shapes of one logic: Gentzen's paper proves that a Hilbert-style system, natural deduction and the sequent calculus derive the same formulas, intuitionistic or classical.
One theorem, three shapes of proofA → A proved in each calculus; the three derive the same formulas
3.1Hilbert-style system Frege 1879, Russell, Hilbert
A proof is a list of formulas: axioms, and conclusions of modus ponens, the only rule. Proofs are hard to find, because the premise A of modus ponens leaves no trace in its conclusion.
1 A → (A → A)
2 (A → (A → A)) → ((A → ((A → A) → A)) → (A → A))
3 (A → ((A → A) → A)) → (A → A)
4 A → ((A → A) → A)
5 A → A
3.2Natural deduction Gentzen 1935
A proof is a tree that starts from assumptions; each connective has rules that introduce it and rules that eliminate it. Detours can be removed, and a proof without them holds only parts of what it proves.
[A]
A → A by →I, which discharges the assumption
3.4Sequent calculus Gentzen 1935
A proof is a tree of sequents, each carrying its assumptions; each connective has rules on the left and rules on the right, and a lemma is a cut. The theorem about detours holds here for classical logic too.
A ⇒ A
⇒ A → A by →R
With the detour made a rule, the theorem wanted since Section 3.3 holds for both logics.
Theorem 3.4.2 (Hauptsatz; Gentzen 1935). Every derivation in LK can be transformed into a derivation in LK of the same sequent in which the cut rule does not occur, and every derivation in LJ into such a derivation in LJ.Gentzen (1935), III §2.5; Rathjen and Sieg, §2.2; Girard, chapter 13: all three for the calculus with negation as a connective. With ⊥ and its initial sequent in place of the two negation rules, as in Definition 3.4.1, the proof has one case more, a cut on ⊥ against \(\bot \Rightarrow\): the ⊥ in the other premise is traced up to where it came in, by a weakening or in an initial sequent \(\bot \Rightarrow \bot\), and deleted all the way, which leaves a derivation of the conclusion of the cut.
As before, its worth is in what a proof without cut can contain.
Corollary 3.4.3. (i) Subformula property: in a derivation without cut every formula is a subformula of a formula of the sequent derived. (ii) Consistency: the empty sequent has no derivation, in LK or in LJ.
Proof. (i) is true of every rule but cut, by inspection. If the empty sequent had a derivation, it would have one without cut, in which by (i) no formula could occur; but the leaves of a derivation are initial sequents, and they contain formulas. ∎
The idea of the proof of the Hauptsatz. Pick a cut that has no other cuts above it. If the cut formula was just built at the last step of both premises, on the right in one and on the left in the other, replace that cut by cuts on strictly smaller subformulas: a cut on \(C \land D\) between ∧R and ∧L₁ drops to a single cut on \(C\), while a cut on \(C \to D\) splits into two cuts, on \(C\) and on \(D\), mirroring the conversions of Section 3.3. Otherwise at least one premise ended in a rule that left the cut formula untouched, so the cut can be pushed upward past that rule until a cut against an initial sequent \(A \Rightarrow A\) disappears altogether. Induction runs lexicographically on the complexity of the cut formula and then on the sum of the heights of the two premises. What makes elimination expensive is contraction, where an assumption \(A\) was used twice: pushing the cut past contraction duplicates the entire proof of \(A\). "It is contraction that accounts for the high cost of eliminating cuts."Rathjen and Sieg, §2.2. The proof is laid out in Girard, chapter 13, which calls the theorem "a result which everyone should see proved at least once". Gentzen handled the contracted formula by proving the theorem for a variant of cut, the mix, which removes all copies of the cut formula at once.
Example 3.4.4 (the cost on a family). For Statman's sequence of tautologies at \(n\) from 2 to 10, the page builds each sequent together with a short proof containing \(n - 2\) cuts, runs cut elimination to completion, and counts total rule applications in the tree (leaves and duplicated branches included). The \(n\)th sequent has \(n\) hypotheses, and with cuts its proof chains \(n - 2\) lemmas together, deriving each lemma from the previous one by a case split and reusing it two or three times in just \(12n - 15\) rule applications. Removing those cuts produces a proof of \(10 \cdot 3^{n-2} - 1\) rule applications at every \(n\) measured, jumping from 105 with cuts to 65,609 without cuts at \(n = 10\). Those counts reflect one particular elimination order rather than the smallest possible cut-free proof: running the same steps in the opposite order, with initial sequents restricted to atoms, takes 547,061 rule applications instead of 1,457 already at \(n = 6\). Even so, no procedure can keep cut-free proofs of this family small: published lower bounds show that every cut-free proof has on the order of \(2^{n}\) branches at least, because without lemmas to share work, each case split must be repeated separately inside both branches of the split before it.P. Bruscoli and A. Guglielmi, "On the proof complexity of deep inference", arXiv 0709.1201 (version 3, 2009), §3.2, after Statman (1978); the family is given there as formulas, and the sequents here are those formulas with their implications unfolded. The \(n\)th sequent has the hypotheses \(a_n \lor b_n\) and \((F_{k+1} \to a_k) \lor (F_{k+1} \to b_k)\) for \(k = n - 1, \dots, 1\), where \(F_k\) is the conjunction of the \(a_i \lor b_i\) with \(i \ge k\), and the conclusion \(a_1 \lor b_1\); the lemmas are \(F_{n-1}, \dots, F_2\). The page's engine keeps weakening, contraction and exchange implicit, so none of them is counted. ◁
Across all formulas and all elimination procedures, two general bounds separate propositional from predicate logic.
Theorem 3.4.5 (the price of cut elimination). Let \(2_0(x) = x\) and \(2_{i+1}(x) = 2^{2_i(x)}\). (i) In classical propositional logic a proof with cuts in which \(s\) rules other than weakening, contraction and exchange are applied has a cut-free proof in which at most \(2^{s}\) are. (ii) In predicate logic there are sentences \(\psi_1, \psi_2, \dots\) that have proofs with cut of size polynomial in \(n\) and no cut-free proof of fewer than \(2_n(0)\) lines: 1, 2, 4, 16, 65,536, \(2^{65{,}536}\) and so on.(i): S. R. Buss, "An introduction to proof theory", chapter I of Handbook of Proof Theory (Elsevier, 1998), §1.2.11 (the author's copy), stated there without proof for the chapter's calculus PK, a variant of the propositional part of LK; a cut counts among the \(s\). (ii): P. Pudlák, "The lengths of proofs", chapter VIII of the same Handbook, Theorem 5.2.3; lower bounds of this kind were first shown by Statman and by Orevkov, in papers dated between 1978 and 1982. For an upper bound, Girard, §13.3, estimates that a proof of height \(h\) whose cut formulas have degree at most \(d\) becomes at worst a cut-free proof of height \(H(d, h)\), with \(H(0, h) = h\) and \(H(d + 1, h) = 4^{H(d, h)}\).
Reaching a tower of exponentials requires quantifiers; the page's engines are propositional, so part (ii) is reported from the literature rather than run. None of this explosion is a defect of cut-free proofs: mathematical practice writes proofs with lemmas to keep them brief, while proof theory eliminates cuts only in principle to analyze what could ever be proved. The Hauptsatz asks nobody to inline every lemma; its consistency corollary follows from knowing that one could. Yet Corollary 3.4.3 covers pure logic alone, leaving open what happens once mathematical axioms such as induction enter a proof.
Consistency
Lean's logic has arithmetic in it. What a consistency proof for such a system can use and show is the question behind Sections 6.6 and 13.8. For arithmetic the answer is known exactly, and it rests on a fact that can be played as a game.
A hydra is a finite rooted tree. Chop off one of its heads at stage \(n\) of the battle, and the beast sprouts \(n\) copies of a subtree in return. It is a theorem that the hydra eventually dies whichever heads are cut, and a second theorem that Peano arithmetic cannot prove this even when restricted to computable strategies, the form in which arithmetic can state the game. Both the death of the hydra and Gentzen's 1936 consistency proof for arithmetic rest on the same fact.
hydra the one drawn in the paper of Kirby and Paris: 7 heads, 13 nodes
rule stage n: one head is cut; the node one segment under the node that lost it grows n replicas of what
stood over that segment (nothing, if the head sat on the root)
ordinal a head counts 0; a node with a, b, … over it counts ω^a + ω^b + …; the hydra counts what its root counts
stage ordinal of the position, cut by the paper's strategy (from the root, always to the least) heads
0 ω^(ω^ω + ω^3) + ω^(ω^2 + 1) 7
1 ω^(ω^ω + ω^3) + ω^ω^2·2 8
2 ω^(ω^ω + ω^3) + ω^ω^2 + ω^(ω·3) 9
3 ω^(ω^ω + ω^3) + ω^ω^2 + ω^(ω·2 + 4) 12
4 ω^(ω^ω + ω^3) + ω^ω^2 + ω^(ω·2 + 3)·5 31
1,000 the page stops, at 5,062 heads; the ordinal fell at every stage played
theorem (Kirby and Paris, 1982) whichever heads are cut, the battle is won: a theorem, not what these runs show
runs won: a path of 2 segments at stage 3, a path of 3 at stage 37 (at 20 when the greatest ordinal is cut
first), a stalk with two heads at stage 13 (at 10). Not won at stage 1,000: a path of 4, the paper's hydra
Goodstein sequence of 4
base 2 3 4 5 6
the term 4 26 41 60 83
written in the base 2^2 3^2·2 + 3·2 + 2 4^2·2 + 4·2 + 1 5^2·2 + 5·2 6^2·2 + 6 + 5
with ω for the base ω^ω ω^2·2 + ω·2 + 2 ω^2·2 + ω·2 + 1 ω^2·2 + ω·2 ω^2·2 + ω + 5
at 0 after 3·2^402,653,211 − 3 steps, a number of 121,210,695 digits (counted, not walked); the sequence of 3
after 5 steps; the sequence of 266 has terms of 39, 617 and 10,922 digits in bases 3, 4 and 5
(the live figure needs JavaScript; it loads no data)
The hydra can grow at every stage, to thousands of heads from seven, and still the expression written under it only ever goes down. What that has to do with proofs begins with Hilbert, who in 1900 had put second on his list of problems a proof that the axioms of arithmetic "are not contradictory, that is, that a definite number of logical steps based upon them can never lead to contradictory results". By the 1920s he had a method: formalize mathematics, so that it "becomes an inventory of provable formulas", and show by finitary reasoning, about derivations as finite arrangements of signs, that none ends in a contradiction.D. Hilbert, "Mathematical problems", translated by M. W. Newson, Bulletin of the American Mathematical Society 8 (1902), pp. 437 to 479, Problem 2 (a transcription); the arithmetic meant is that of the real numbers. R. Zach, "Hilbert's Program", Stanford Encyclopedia of Philosophy (revision of 29 September 2023), §1.3 (the entry), for the program and the second phrase. The painted rock tells what was at stake between him and Brouwer.
What a finitary consistency proof would buy is concrete. Take any universal law \(\forall x\,P(x)\) over the natural numbers where \(P(x)\) is checkable by a program whose loops are bounded in advance. Suppose an abstract theory \(T\) containing basic arithmetic proves \(\forall x\,P(x)\), perhaps using infinite sets or nonconstructive axioms, and a finitary base theory \(F\) proves that \(T\) is consistent. Then \(F\) already proves \(\forall x\,P(x)\) directly: if any counterexample \(n\) existed, \(T\) could verify \(\lnot P(n)\) by direct computation, clashing with \(\forall x\,P(x)\) and making \(T\) inconsistent.Rathjen and Sieg, §1.1, Theorem 1.1, with primitive recursive arithmetic as the example of \(F\). Hilbert's own example of such a statement, in a lecture at Hamburg in 1927, was Fermat's.
For pure logic, Corollary 3.3.4 and Corollary 3.4.3 meet Hilbert's demand by elementary means. Arithmetic, however, adds non-logical axioms, above all the induction scheme, which provides an axiom instance for every formula \(F(x)\) no matter how many quantifiers \(F\) contains. A cut on an induction instance cannot be eliminated inside the finite sequent calculus (unrolling induction works for a fixed numeral \(k\), not for a free variable \(x\)), and because \(F(x)\) can be arbitrarily complex, the subformula property fails. Worse, by 1931 Gödel had already proved a sharp ceiling on what any consistency proof can use. Stating that ceiling contrasts two standard systems: Peano arithmetic (PA), which has addition, multiplication, and induction for all formulas, and primitive recursive arithmetic (PRA), which has functions defined by bounded primitive recursion (Section 2.5) and restricts induction to quantifier-free formulas.
Theorem 3.5.1 (second incompleteness theorem; Gödel 1931). Let \(F\) be a consistent formal system with a decidable set of axioms in which elementary arithmetic can be carried out (PRA suffices). Let \(\mathrm{Prov}_F\) be a formula of arithmetic that expresses provability in \(F\), with \(\ulcorner A \urcorner\) the numeral of a number that codes \(A\), such that for all sentences \(A\) and \(B\)
\[\begin{aligned} &\text{if } F \vdash A \text{ then } F \vdash \mathrm{Prov}_F(\ulcorner A \urcorner), \\ &F \vdash \mathrm{Prov}_F(\ulcorner A \urcorner) \to \mathrm{Prov}_F(\ulcorner \mathrm{Prov}_F(\ulcorner A \urcorner) \urcorner), \\ &F \vdash \mathrm{Prov}_F(\ulcorner A \urcorner) \land \mathrm{Prov}_F(\ulcorner A \to B \urcorner) \to \mathrm{Prov}_F(\ulcorner B \urcorner). \end{aligned}\]Then \(F\) does not prove the sentence \(\mathrm{Cons}(F)\), which is \(\lnot \mathrm{Prov}_F(\ulcorner \bot \urcorner)\).P. Raatikainen, "Gödel's Incompleteness Theorems", Stanford Encyclopedia of Philosophy (revision of 8 October 2025), §§1.1, 3.1 and 3.2 (the entry). Gödel announced the first theorem at Königsberg on 7 September 1930, and the paper with both appeared in January 1931. The three conditions are Löb's, of the 1950s, and some such conditions are needed: with Rosser's formula, which holds of exactly the same sentences, the corresponding sentence is provable in \(F\).
The theorem does not say that the consistency of \(F\) cannot be proved. It says where the proof cannot be carried out, and the entry cited adds: "For many theories, this is perfectly possible." Von Neumann nevertheless wrote to Gödel in the autumn of 1930 that the result showed "there is no rigorous justification for classical mathematics".As quoted in J. Kennedy, "Kurt Gödel", Stanford Encyclopedia of Philosophy (revision of 10 September 2025), §2.2 (the entry). Gödel's own paper left open that some finitary reasoning might not be formalized in the system (Zach, §4). Gentzen, who by early 1932 had made the consistency of arithmetic his task, put the matter in terms that have stayed.
Such a consistency proof would in turn be a mathematical proof, in which certain inferences and concept formations would be used. These must already be presupposed to be secure (in particular, consistent). An "absolute consistency proof" is therefore not possible. A consistency proof can only reduce the correctness of certain forms of inference to the correctness of other forms of inference.
One will therefore have to require that a consistency proof use only forms of inference that can be regarded as considerably more secure than the forms of inference of the theory whose consistency is being proved.
2.32. Of the greatest importance for this point is the following proof-theoretic theorem proved by K. Gödel: "It is not possible to prove the consistency of a formally given (delimited) theory which contains pure number theory (and already of pure number theory itself) with the entire means of the theory in question (provided that this theory really is consistent)".
It follows that, in order to prove the consistency of pure number theory, say, one cannot make do with a part of the means of proof usable in pure number theory, indeed not even with all of these means of proof. Is a genuine reduction then still possible at all?
Well, it remains entirely conceivable that the consistency of pure number theory can be proved with means that in part no longer belong to pure number theory, but can nevertheless be regarded as more secure than the questionable components of pure number theory itself.
—Gerhard Gentzen, "Die Widerspruchsfreiheit der reinen Zahlentheorie" (1936), translated here from the German. Mathematische Annalen 112 (1936), pp. 493 to 565, received on 11 August 1935; nos. 2.31 and 2.32, p. 500. A working translation made for this series; the published English is in Szabo's edition. The highlighted sentences in the original: Ein „absoluter Widerspruchsfreiheitsbeweis“ ist also nicht möglich. Ein Widerspruchsfreiheitsbeweis kann lediglich die Richtigkeit gewisser Schlußweisen auf die Richtigkeit anderer Schlußweisen zurückführen. And: Nun, es bleibt ja durchaus denkbar, daß man die Widerspruchsfreiheit der reinen Zahlentheorie nachweisen kann mit Hilfsmitteln, die zum Teil nicht mehr der reinen Zahlentheorie angehören, aber trotzdem als sicherer gelten können als die bedenklichen Bestandteile der reinen Zahlentheorie selbst.
Gentzen found that extra principle in a transfinite ordering of finite symbolic expressions. In Section 3.3, normalizing a pure logical proof decreased a pair \((d, m)\) of natural numbers. Simplifying an arithmetic proof that uses induction can unroll one step into arbitrarily many concrete steps chosen later, so no fixed tuple of natural numbers suffices; measuring progress requires milestones built from powers of \(\omega\), a formal symbol standing above every natural number.
Definition 3.5.2 (the ordinals below ε₀). The ordinal \(\varepsilon_0\) is the least \(\alpha\) with \(\omega^{\alpha} = \alpha\), the supremum of \(\omega, \omega^{\omega}, \omega^{\omega^{\omega}}, \dots\) Every ordinal \(\beta\) with \(0 < \beta < \varepsilon_0\) is in exactly one way a sum \(\omega^{\beta_1} \cdot k_1 + \dots + \omega^{\beta_n} \cdot k_n\) with \(\beta > \beta_1 > \dots > \beta_n\) and positive integers \(k_i\), its Cantor normal form, and writing the exponents in the same form comes to an end. The ordinals below \(\varepsilon_0\) are thus finite expressions, compared as numerals are: at the first term where two differ the larger exponent decides, then the larger coefficient, and a longer expression beats its own beginning.Rathjen and Sieg, §3.1, where the order and the arithmetic of these expressions are noted to be primitive recursive; M. Rathjen, "The art of measuring the strength of theories", Notices of the American Mathematical Society 70(7), 2023, pp. 1071 to 1079, §3.
Everything Gentzen needed beyond PRA is a single well-foundedness principle: no sequence in this ordering can step downward forever. Three theorems pin down its exact logical strength relative to PA.
Theorem 3.5.3 (Gentzen 1936, 1938, 1943). Let \(\mathrm{PRWO}(\varepsilon_0)\) be the statement that no primitive recursive sequence of ordinals below \(\varepsilon_0\) descends forever. (i) PRA proves that \(\mathrm{PRWO}(\varepsilon_0)\) implies the consistency of PA. (ii) If PA is consistent, it does not prove \(\mathrm{PRWO}(\varepsilon_0)\). (iii) For every ordinal \(\alpha\) below \(\varepsilon_0\), PA proves induction along the ordering of the ordinals below \(\alpha\).M. Rathjen, "Goodstein's theorem revisited", arXiv 1405.4484 (2014), Theorem 2.8, for (i) and (ii); Rathjen and Sieg, §3.2, for (iii), from Gentzen's paper of 1943.
The idea of the proof. Assign to every PA derivation an ordinal below \(\varepsilon_0\), and define an explicit reduction step on any putative proof of the empty sequent: the rewritten tree may grow taller when an induction is partially unrolled into concrete numerals, yet its assigned ordinal strictly drops. Both the ordinal assignment and the reduction step are primitive recursive, and PRA suffices to prove that each step lowers the ordinal. A contradiction in PA would therefore generate an infinite descending primitive recursive sequence below \(\varepsilon_0\), which \(\mathrm{PRWO}(\varepsilon_0)\) rules out, giving (i). If PA could prove \(\mathrm{PRWO}(\varepsilon_0)\), then by (i) PA would prove \(\mathrm{Cons}(\mathrm{PA})\), contradicting Gödel's Theorem 3.5.1; that gives (ii), while (iii) shows \(\varepsilon_0\) is the exact threshold, since PA proves well-foundedness up to every smaller height \(\alpha < \varepsilon_0\).
The appearance of \(\varepsilon_0\) is no accident. In a 1950 reformulation due to Schütte, the induction axiom is replaced by the \(\omega\)-rule, which infers \(\forall x\,F(x)\) from infinitely many premises \(F(0), F(1), F(2), \dots\). Proofs become infinite trees of ordinal height, cuts can once again be eliminated outright, and each round of cut elimination raises tree height from \(\alpha\) to \(\omega^{\alpha}\), matching the exponential tower of Theorem 3.4.5 with \(\omega\) in place of \(2\); any proof starting with cuts of finite degree ends strictly below \(\varepsilon_0\).Rathjen and Sieg, §3.2, Theorem 3.5, after Schütte (1950).
The hydra game turns descent below \(\varepsilon_0\) into a visual tree battle.
Definition 3.5.4 (the battle; Kirby and Paris 1982). A hydra is a finite rooted tree; a head is a leaf other than the root, with its segment. At stage \(n = 1, 2, 3, \dots\) one head is cut off. If the node \(v\) that carried it is the root, nothing grows. Otherwise the node \(w\) one segment below \(v\) sprouts \(n\) copies of what stands, after the cut, above the segment from \(w\) to \(v\). The battle is won when only the root is left; a strategy chooses the head to cut at each stage. The ordinal of a hydra is counted from the heads down: a head counts 0, a node whose successors, the nodes directly above it, count \(\alpha_1 \ge \dots \ge \alpha_k\) counts \(\omega^{\alpha_1} + \dots + \omega^{\alpha_k}\), and the hydra counts what its root counts.
Because its positions encode ordinals below \(\varepsilon_0\), the game inherits both termination and unprovability in PA.
Theorem 3.5.5 (Kirby and Paris 1982). (i) Every strategy is a winning strategy: whatever heads are cut, the battle is won after finitely many stages. (ii) PA does not prove the statement that every recursive (computable) strategy is a winning strategy.L. Kirby and J. Paris, "Accessible independence results for Peano arithmetic", Bulletin of the London Mathematical Society 14 (1982), pp. 285 to 293: the battle on p. 286, the ordinal of a hydra on p. 292. R. L. Goodstein, "On the restricted ordinal theorem", Journal of Symbolic Logic 9 (1944), pp. 33 to 41. The sequence of 4 runs 4, 26, 41, 60, 83 and, by the paper, first reaches 0 after \(3 \cdot 2^{402{,}653{,}211} - 3\) steps.
Part (i) follows in one step because every cut lowers the hydra's ordinal: if the node that lost a head previously counted \(\gamma + 1\), its remaining subtree counts \(\gamma\), so the node below trades one summand \(\omega^{\gamma + 1} = \omega^{\gamma} \cdot \omega\) for \(n + 1\) copies of \(\omega^{\gamma}\), which is strictly smaller in Cantor normal form no matter how large stage \(n\) has become. Goodstein sequences play out the same descent on integers: write a number in hereditary base \(b\) (expanding exponents in base \(b\) too), replace every \(b\) by \(b + 1\), and subtract \(1\), repeating from \(b = 2\) upward. Replacing the current base with \(\omega\) turns each term into an ordinal below \(\varepsilon_0\) that strictly drops at every step even while the integers themselves skyrocket; Goodstein proved in 1944 that every sequence eventually hits 0, another true arithmetic statement beyond PA.
Two runs in the figure show how deceptive "finitely many stages" can look while it is happening.
Example 3.5.6 (battles in the page). Using exact integer arithmetic, the page plays the rules of Definition 3.5.4 under Kirby and Paris's strategy (walking upward from the root along the successor of least ordinal at each step) and halts a run at 1,000 stages or 100,000 nodes. A three-segment path, of initial ordinal \(\omega^{\omega}\), dies at stage 37. The hydra drawn in their paper, starting with 7 heads and ordinal \(\omega^{\omega^{\omega} + \omega^{3}} + \omega^{\omega^{2} + 1}\), swells to 31 heads after four stages and to 5,062 heads at stage 1,000, where the simulation stops. Its ordinal fell at every single cut, yet that the battle will eventually end is guaranteed by Theorem 3.5.5, not demonstrated by the truncated run. ◁
So the consistency of arithmetic rests on PRA and on one statement about one ordering of finite expressions. That every hydra dies and the one step of Gentzen's proof that is not elementary rest on the same fact: ordinals below \(\varepsilon_0\) do not descend forever. Whether that fact is more secure than the induction axioms it vouches for is the question the quoted paragraphs leave open; Gentzen answered yes, in §16 of the same paper. For a reader of machine-checked proofs the lesson is the kind of guarantee to expect. Lean's logic is a formal system in which arithmetic can be carried out, so by Theorem 3.5.1 it does not, if it is consistent, prove the sentence that expresses its consistency. What can be had is what the quoted paragraphs describe, a reduction to the consistency of another theory (Section 6.6).
PA is a classical theory, and Lean becomes one by axioms (Section 7). What classical logic adds, in theorems and in risk, is the last question.
Two logics
Every rule of natural deduction so far belongs to intuitionistic logic. Classical logic, the logic of ordinary mathematics, has one rule more, and whether a propositional formula needs it can be decided. Type a formula: the page returns a proof, or a model in which the formula fails.
formula p ∨ ¬p, the excluded middle: provable in classical logic only
classical logic a proof of 8 rules, one of them classical: double negation elimination (DNE), ¬¬A → A
intuitionistic logic no proof: a Kripke model with 2 worlds, whose root does not force the formula
the worlds, later ones higher forced (●) or not (○) w1 w2 why, at w1
w2 ● p p ○ ● p does not hold at w1
│ ¬p ○ ○ w2, above w1, forces p
w1 ○ no atom p ∨ ¬p ○ ● w1 forces neither p nor ¬p
presets intuitionistic logic classical logic countermodel
p ∨ ¬p no proof 8 rules, DNE once 2 worlds
((p → q) → p) → p no proof 9 rules, DNE once 2 worlds
¬(p ∨ q) → ¬p ∧ ¬q 8 rules the same proof none
¬p ∧ ¬q → ¬(p ∨ q) 7 rules the same proof none
¬p ∨ ¬q → ¬(p ∧ q) 7 rules the same proof none
¬(p ∧ q) → ¬p ∨ ¬q no proof 12 rules, DNE once 3 worlds
¬¬(p ∨ ¬p) 6 rules the same proof none
(p → q) → q → p no proof no proof 1 world: q true, p false
Lean Lean 4.35.0 accepts the seven proofs as the page writes them: the three classical ones depend on
propext, Classical.choice and Quot.sound, the four others on no axiom (recorded)
bounds 40 connectives typed, 60,000 sequents searched, 2,000 rules drawn
(the live figure needs JavaScript; it loads no data)
For the excluded middle, \(p \lor \lnot p\), it returns both: a classical proof, and a model with two worlds, which shows that none can do without the classical rule. The classical proof is the intuitionistic proof of \(\lnot\lnot(p \lor \lnot p)\), six rules, with the classical rule on top, and that rule is the whole difference between the logics.
Definition 3.6.1 (classical logic). Classical natural deduction is the calculus of Definition 3.2.1 with one addition, in any of three forms that are derivable from one another. The excluded middle: any formula \(A \lor \lnot A\) may stand as a leaf that is not an assumption. Double negation elimination: from \(\lnot\lnot A\) infer \(A\), which with →I is indirect proof. Peirce's law: any formula \(((A \to B) \to A) \to A\) may stand as such a leaf. In the sequent calculus the difference is no rule but the second formula on the right: LK derives \(\Rightarrow A, \lnot A\) (one of \(A\) and \(\lnot A\) holds), and LJ has no such sequent.Gentzen's NK takes the first form; the proofs the page finds use the second. Each form follows from another in a few lines of the calculus of Definition 3.2.1, ⊥E among them: the second from the first and from the third (with ⊥ for \(B\)), the first and the third from the second. Written as Lean terms with the other form as a hypothesis, the four derivations are accepted by Lean 4.35.0 and depend on no axiom. Moschovakis, §§1 and 2.1; Rathjen and Sieg, §2.1.
Intuitionistic logic never refutes the excluded middle, since \(\lnot\lnot(A \lor \lnot A)\) is already an intuitionistic theorem, nor does it introduce a third truth value. Proving a negated statement \(\lnot A\) by assuming \(A\) and deriving \(\bot\) remains valid (it is simply →I for \(A \to \bot\)); what intuitionistic logic withholds is jumping from the absurdity of \(\lnot A\) to a positive assertion of \(A\). Section 4.4 explains the constructive reason: asserting \(A \lor \lnot A\) demands an actual method deciding which side holds.Moschovakis, §1, with the example of the twin primes above a given number, for which no such method is known. To prove rigorously that \(p \lor \lnot p\) cannot be derived from the intuitionistic rules, failed proof searches prove nothing, and ordinary two-valued truth tables always evaluate \(p \lor \lnot p\) to true. Kripke solved this by replacing a single static truth assignment with a branching diagram of growing states of knowledge, called worlds.
Definition 3.6.2 (Kripke models). A Kripke model is a partially ordered set of nodes, called worlds, each with a set of atoms true at it, such that an atom true at \(k\) is true at every \(k^{\prime} \ge k\). A world forces a formula, \(k \Vdash A\), by these clauses: \(k \Vdash p\) if \(p\) is true at \(k\); never \(k \Vdash \bot\); \(k \Vdash A \land B\) if \(k \Vdash A\) and \(k \Vdash B\); \(k \Vdash A \lor B\) if \(k \Vdash A\) or \(k \Vdash B\); and \(k \Vdash A \to B\) if every \(k^{\prime} \ge k\) that forces \(A\) forces \(B\). So \(k \Vdash \lnot A\) if no world above or equal to \(k\) forces \(A\).
The worlds are stages of knowledge: what is forced at one stays forced later, and an implication speaks about all later stages. That such models refute exactly what has no proof is a theorem.
Theorem 3.6.3 (Kripke 1965). A propositional formula has a proof in intuitionistic logic if and only if it is forced at every world of every Kripke model, and if and only if it is forced at the root of every Kripke model that is a finite tree. A procedure returns, for every propositional formula, such a proof or such a tree whose root does not force it.As given in Moschovakis, §5.1. A model with one world is a truth assignment, so a formula that fails classically fails in a model too.
So one small tree shows that the classical rule cannot be derived from the others.
Example 3.6.4 (the excluded middle fails at a root). Take two worlds, \(w_1 \le w_2\), with \(p\) true at \(w_2\) only. The root \(w_1\) does not force \(p\), and it does not force \(\lnot p\), because \(w_2\), above it, forces \(p\). So it does not force \(p \lor \lnot p\). Nothing here makes the formula false: at the root \(p\) is not yet known, and its negation cannot be asserted because \(p\) becomes true later. The same model refutes \(\lnot\lnot p \to p\) and Peirce's law. Of the four De Morgan laws only \(\lnot(p \land q) \to \lnot p \lor \lnot q\) needs the classical rule. ◁
Does the rule add risk as well as theorems? By 1933 it had turned out that the two logics do not differ in what can go wrong: a classical proof can be rewritten, rule by rule, as an intuitionistic proof of a statement with double negations in it.
classical (p → q) → (¬p → q) → q, by cases on p ∨ ¬p: 10 formulas, the excluded middle used once
q ∨E
p ∨ ¬p the excluded middle (the classical axiom)
q, from p → q and [p] →E
q, from ¬p → q and [¬p] →E
statement what intuitionistic logic proves in its place
Glivenko ¬¬((p → q) → (¬p → q) → q)
Gödel-Gentzen (¬¬p → ¬¬q) → (¬¬¬p → ¬¬q) → ¬¬q
Kolmogorov ¬¬(¬¬(¬¬p → ¬¬q) → ¬¬(¬¬(¬¬¬¬¬p → ¬¬q) → ¬¬q))
translated rule by rule (Gödel-Gentzen): 23 formulas, 15 of them added, no classical axiom
the excluded middle becomes ¬(¬¬¬p ∧ ¬¬¬¬p), proved in 6 formulas; the case split becomes a refutation
after 4 conversions no detour is left: 13 formulas
sizes formulas in the proof by cases excluded middle double negation Peirce's law contraposition 24 theorems, summed
the classical proof 10 1 1 13 10 484
Gödel-Gentzen, detours removed 13 6 8 11 11 426
Glivenko, a proof found by search 20 9 12 12 21 547
Gödel-Gentzen, as translated 23 6 8 20 17 837
Kolmogorov, detours removed 28 12 17 20 26 855
Kolmogorov, as translated 47 12 17 56 50 2,160
Lean 4.35.0, #print axioms: the classical proofs depend on propext, Classical.choice and Quot.sound; their translations on no axiom
(the live figure needs JavaScript; it loads no data)
Intuitionistic logic balks at \(A \lor B\) and \(\exists x\,A(x)\) because their introduction rules demand picking a side or exhibiting a witness, whereas negated formulas require no witness and already absorb double negations (\(\lnot\lnot\lnot C\) reduces intuitionistically to \(\lnot C\)). Double-negating atoms and rewriting \(\lor\) and \(\exists\) via De Morgan's laws in terms of \(\lnot\), \(\land\), and \(\forall\) turns every formula into one on which double-negation elimination holds constructively.
Definition 3.6.5 (the Gödel-Gentzen translation). The translation \(g\) changes a formula only at its atoms and at the two connectives whose introduction makes a choice: \(g(p) = \lnot\lnot p\) for an atom \(p\), \(g(\bot) = \bot\), \(g(A \land B) = g(A) \land g(B)\), \(g(A \to B) = g(A) \to g(B)\), \(g(\forall x\,A) = \forall x\,g(A)\), and
\[g(A \lor B) = \lnot(\lnot g(A) \land \lnot g(B)), \qquad g(\exists x\,A) = \lnot\forall x\,\lnot g(A).\]Because \(g\) preserves provability from classical to intuitionistic logic while leaving \(\bot\) unchanged, any contradiction in classical logic or Peano arithmetic translates directly into a contradiction in its intuitionistic counterpart.
Theorem 3.6.6 (Glivenko 1929; Gödel and Gentzen 1933). (i) Classical logic proves that \(A\) and \(g(A)\) are equivalent. (ii) Intuitionistic logic proves \(\lnot\lnot g(A) \to g(A)\). (iii) \(A\) has a proof in classical logic if and only if \(g(A)\) has one in intuitionistic logic. (iv) If PA proves \(A\), then Heyting arithmetic, which has the axioms of PA and intuitionistic logic, proves \(g(A)\), with equations left untranslated; since \(g(0 = 1)\) is then \(0 = 1\), the two theories are consistent or inconsistent together. (v) A propositional formula \(A\) has a proof in classical logic if and only if \(\lnot\lnot A\) has one in intuitionistic logic.Moschovakis, §4.1; Buss (1998), §3.1.4. Kolmogorov had a translation for logic in 1925, with a double negation on every subformula. Gödel and Gentzen found theirs for arithmetic independently of each other in 1932 and 1933, and Gentzen withdrew his paper on hearing of Gödel's (von Plato, §§3 and 4).
Glivenko's theorem (v) simply places \(\lnot\lnot\) in front of the whole formula without touching its interior, which works for propositional logic yet fails once quantifiers enter: \(\forall x\,\lnot\lnot(A(x) \lor \lnot A(x))\) is intuitionistically provable, whereas \(\lnot\lnot\forall x\,(A(x) \lor \lnot A(x))\) is not. For full predicate logic, part (iii) translates a classical derivation step by step: intuitionistic rules map to themselves or short intuitionistic combinations, and wherever the classical proof invokes double-negation elimination, part (ii) supplies an intuitionistic proof of \(\lnot\lnot g(C) \to g(C)\).
Example 3.6.7 (a proof by cases, translated). Take the classical proof of \((p \to q) \to (\lnot p \to q) \to q\) that splits into cases on \(p \lor \lnot p\) (a tree of 10 formulas), translate it rule by rule in the page, and normalize the result. Under \(g\), the theorem becomes \((\lnot\lnot p \to \lnot\lnot q) \to (\lnot\lnot\lnot p \to \lnot\lnot q) \to \lnot\lnot q\), proved in 23 formulas (15 added by the translation) with no classical axiom: the excluded middle \(p \lor \lnot p\) turns into \(\lnot(\lnot\lnot\lnot p \land \lnot\lnot\lnot\lnot p)\), the harmless law of non-contradiction for \(\lnot\lnot p\), and the case split becomes a refutation. Four detour conversions then trim the proof down to 13 formulas. ◁
The theorem was a surprise for Hilbert's program, which had taken indirect existence proofs for the part of arithmetic in need of securing: intuitionistic arithmetic carries all the risk already. It is no comfort to a constructivist either.
One consequence of the proof of the above theorem is a constructive proof that the consistency of intuitionistic logic is equivalent to the consistency of classical logic; thus intuitionistic logic does not provide a better foundations for mathematics from the point of view of sheer consistency. This is, however, of little interest to a constructivist, since the translation of classical logic into intuitionistic logic does not preserve the constructive meaning (under, e.g., the BHK interpretation) of the formula.
—Samuel R. Buss, "An introduction to proof theory" (1998). §3.1.4, pp. 67 to 68; "the above theorem" is the one on the translation, and "a better foundations" is the chapter's wording.
The reading the passage names, after Brouwer, Heyting and Kolmogorov, is that of Section 4.4. What is lost shows in Definition 3.6.5: a translated existence statement is \(\lnot\forall\lnot\), and a proof of that hands over no witness, whereas by Corollary 3.3.4 an intuitionistic proof of a disjunction hands over one of its sides (Section 4.5).
Two logics, one rule apartthe same five things in intuitionistic and in classical logic
- the rules
nine rules Introductions and eliminations for each connective; from ⊥, anything.
3.6and the excluded middle A ∨ ¬A as a starting point, or ¬¬A → A, or Peirce's law: each gives the others.
- a sequent
at most one formula on the right LJ · Γ ⇒ A: from all of Γ, A.
3.4any number on the right LK · ⇒ A, ¬A is derivable: A, or else not A.
- a formula with no proof
fails at the root of a tree of worlds p ∨ ¬p: two worlds, p true at the later one only.
3.6fails in a truth table One world is enough: true or false for each atom.
- a proof of A ∨ B
gives a proof of A or of B The disjunction property: a normal proof ends in an introduction.
3.3need not p ∨ ¬p has a proof; p has none, and ¬p has none.
- consistency
holds a copy of classical logic The Gödel-Gentzen translation: A is provable classically exactly when its translation is provable here.
3.6no less safe A classical proof of a contradiction translates into an intuitionistic one.
In Lean
Every piece of this proof theory appears directly in Lean, where inference rules, detours, and classical axioms can all be inspected as code. Lean's core library (Init/Prelude.lean) defines falsity and disjunction solely by listing their introduction rules.
/--
`False` is the empty proposition. Thus, it has no introduction rules.
It represents a contradiction. `False` elimination rule, `False.rec`,
expresses the fact that anything follows from a contradiction.
This rule is sometimes called ex falso (short for ex falso sequitur quodlibet),
or the principle of explosion.
For more information: [Propositional Logic](https://lean-lang.org/theorem_proving_in_lean4/propositions_and_proofs.html#propositional-logic)
-/
inductive False : Prop
-- ...
inductive Or (a b : Prop) : Prop where
/-- `Or.inl` is "left injection" into an `Or`. If `h : a` then `Or.inl h : a ∨ b`. -/
| inl (h : a) : Or a b
/-- `Or.inr` is "right injection" into an `Or`. If `h : b` then `Or.inr h : a ∨ b`. -/
| inr (h : b) : Or a b
Or has two introductions and False has none. Nobody writes the eliminations Or.rec and False.rec: Lean generates them from the introductions (Section 5.6), which can be read as Gentzen's remark of Section 3.2 turned into a mechanism. Implication needs no declaration: it is the function type of Section 2, with fun for its introduction and application for its elimination. The other rules are constants of the library, each with a tactic, a command that applies it from below to the goal, the statement still to be proved.
| rule | in Lean, as #check prints it |
as a tactic |
|---|---|---|
| ∧I | @And.intro : ∀ {a b : Prop}, a → b → a ∧ b |
constructor |
| ∧E₁ | @And.left : ∀ {a b : Prop}, a ∧ b → a |
exact h.1 |
| ∧E₂ | @And.right : ∀ {a b : Prop}, a ∧ b → b |
exact h.2 |
| →I | fun h => … |
intro h |
| →E | f h |
apply f |
| ∨I₁ | @Or.inl : ∀ {a b : Prop}, a → a ∨ b |
left |
| ∨I₂ | @Or.inr : ∀ {a b : Prop}, b → a ∨ b |
right |
| ∨E | @Or.elim : ∀ {a b c : Prop}, a ∨ b → (a → c) → (b → c) → c |
cases h |
| ⊥E | @False.elim : {C : Sort u_1} → False → C |
contradiction |
A natural-deduction proof is a term built from these. Here is the normal proof of Section 3.1, written directly and again with tactics.
theorem direct (P Q R : Prop) : (P → Q) → (Q → R) → P → R :=
fun hpq hqr hp => hqr (hpq hp)
theorem byTactics (P Q R : Prop) : (P → Q) → (Q → R) → P → R := by
intro hpq hqr hp
apply hqr
apply hpq
exact hp
#print direct
#print byTactics
theorem direct : ∀ (P Q R : Prop), (P → Q) → (Q → R) → P → R :=
fun P Q R hpq hqr hp => hqr (hpq hp)
theorem byTactics : ∀ (P Q R : Prop), (P → Q) → (Q → R) → P → R :=
fun P Q R hpq hqr hp => hqr (hpq hp)
Both styles store the exact same underlying term. In the tactic script, intro applies →I backward from the goal upward, apply hqr applies →E backward (reducing the goal R to Q), and exact closes the leaf with the open assumption hp (Section 10.2). Even the five-line Hilbert proof of Example 3.1.2 can be written as a single application term S A (A → A) A (K A A) (K A (A → A)) given proofs K and S of the two axiom schemes. Writing the detour proof from Section 3.1 with have shows what Lean does with an explicit lemma.
theorem viaLemma (P Q R : Prop) : (P → Q) → (Q → R) → P → R :=
fun hpq hqr hp =>
have lemma : P ∧ (P → Q) → R := fun h => hqr (h.2 h.1)
lemma ⟨hp, hpq⟩
#print viaLemma
#reduce (proofs := true) fun (P Q R : Prop) (hpq : P → Q) (hqr : Q → R) (hp : P) =>
(fun (h : P ∧ (P → Q)) => hqr (h.2 h.1)) ⟨hp, hpq⟩
example : viaLemma = direct := rfl
theorem viaLemma : ∀ (P Q R : Prop), (P → Q) → (Q → R) → P → R :=
fun P Q R hpq hqr hp =>
have lemma := fun h => hqr (h.right h.left);
lemma ⟨hp, hpq⟩
fun P Q R hpq hqr hp => hqr (⟨hp, hpq⟩.right ⟨hp, hpq⟩.left)
Lean checks the proof as written: the lemma stays in the stored term, and nothing eliminates the cut. The last line is accepted too, since Lean's kernel, which checks the stored terms, takes any two proofs of one proposition to be equal (Section 6.3), detours or not. Asked to reduce the proof, #reduce plugs the lemma in and stops after the first of the page's three conversions, both conjunction detours in place. The reason is not logic. And.left is a theorem of the library, and the reduction that #reduce runs never unfolds a theorem, by one line of Lean's sources (Lean/Meta/GetUnfoldableConst.lean).
def getUnfoldableConst? (constName : Name) : MetaM (Option ConstantInfo) := do
let some ainfo := (← getEnv).findAsync? constName | throwUnknownConstantAt (← getRef) constName
match ainfo.kind with
| .thm => return none
| .defn => if (← canUnfold ainfo.toConstantInfo) then return ainfo.toConstantInfo else return none
| _ => return none
Classical logic enters Lean not by adding new rules to the kernel, but by invoking library axioms, as #print axioms shows when comparing \(\lnot\lnot(p \lor \lnot p)\) with \(p \lor \lnot p\).
theorem notNotEm (p : Prop) : ¬¬(p ∨ ¬p) :=
fun h => h (Or.inr (fun hp => h (Or.inl hp)))
theorem em (p : Prop) : p ∨ ¬p :=
Classical.byContradiction (notNotEm p)
#print axioms notNotEm
#print axioms em
example (p q : Prop) (hp : p) (hq : q) : p ∧ q := by
intro h
'notNotEm' does not depend on any axioms
'em' depends on axioms: [propext, Classical.choice, Quot.sound]
ProofsAsObjects.lean:32:8: error: Tactic `introN` failed: There are no additional binders or `let` bindings in the goal to introduce
p q : Prop
hp : p
hq : q
⊢ p ∧ q
notNotEm is the six-rule proof of Section 3.6, and em is that proof with the classical rule on top. In Lean the rule is not primitive: #print axioms traces it to three axioms, the subject of Section 7. The error is what intro answers when the goal is not an implication: →I has nothing to introduce.
A proof is a finite tree built by rules, and so a thing about which theorems can be proved. Its detours can be removed, and a proof without detours contains nothing but parts of what it proves: that is why logic proves no contradiction, and why for arithmetic the same argument needs one principle that arithmetic itself cannot prove.
Section 4 asks why a proof behaves so much like a program, and puts the three parts together: the proofs of this part turn out to be the typed terms of Section 2, and the removal of a detour a step of their computation.