Constructing Hilbert-style F0 proofs with a simple graph-based notation

Constructing Hilbert-style F0 proofs with a simple graph-based notation

There exist different kinds of deductive systems in logic. Every deductive system consists of certain axioms and rules of inference. The problem of constructing a proof in every such system is quite difficult — computationally it is NP\mathcal{NP}-Hard, since satisfiability can be reduced to it. So it is a good idea to trade-off between logical axioms and inference rules. Hilbert (Frege)-style proof systems are interesting because most of them use several axioms but only one inference rule — modus ponens, unlike, for example, Gentzen natural deduction. In other words, Hilbert-style proof systems “push” all the complexity of constructing a proof into the axioms — it is hard to syntactically instantiate them, but once done it is easier to combine them as there is only one rule of inference — modus ponens. In this post, I will present a notation for these Hilbert-style proofs I came up with recently, that allows one to construct them in a more systematic way, with less “guessing”.

The F0 Hilbert-style proof system

First, we need to define the proof system in which we will construct proofs. We will consider only formulas over {¬,}\{\neg, \rightarrow\} without true and false. By the way, this is a complete operator set, so every boolean function can be expressed only by using negation and implication. Let a(ba)Axiom 1(a(bc))((ab)(ac))Axiom 2(¬a¬b)(ba)Axiom 3\begin{aligned} a &\rightarrow (b \rightarrow a) & \text{Axiom 1} \\ (a \rightarrow (b \rightarrow c)) &\rightarrow ((a \rightarrow b) \rightarrow (a \rightarrow c)) & \text{Axiom 2} \\ (\neg a \rightarrow \neg b) &\rightarrow (b \rightarrow a) & \text{Axiom 3} \end{aligned}

be the set of axioms, that hold for arbitrary propositional formulas aa, bb, and cc.

The only inference rule we need is modus ponens (MP), which can be defined as follows: ααββ\begin{array}{c} \alpha \quad \alpha \rightarrow \beta \\ \hline \beta \end{array}

It can be proven that this is a sound and complete proof system.

Deduction theorem

In order to considerably simplify the proof construction in many cases, we need to briefly define the deduction theorem, which states that: Σ(ab)Σ{a}b\Sigma \vdash (a \rightarrow b) \Leftrightarrow \Sigma \cup \{a\} \vdash b

This theorem essentially provides a bridge between syntactic entailment and provability in the F0 proof system — for example, proving ab\vdash a \rightarrow b is equivalent to proving {a}b\{a\} \vdash b. Intuitively, this theorem holds because s(ab)(sa)bs \rightarrow (a \rightarrow b) \leftrightarrow (s \wedge a) \rightarrow b is valid and F0 is sound and complete.

The deduction theorem is not a rule of inference or an axiom — if some F0 proof uses it, then there exists a proof without it (this can be proven by induction).

Notation for proofs

Usually, proofs are defined as finite sequences of propositional formulas, where each element is either an axiom or modus ponens applied to some already proven formulas (that are located before the current formula in the sequence). For example, a typical proof of aa\vdash a \rightarrow a would be:

  1. a((aa)a)a \rightarrow ((a \rightarrow a) \rightarrow a) — Axiom 1
  2. (a((aa)a))((a(aa))(aa))(a \rightarrow ((a \rightarrow a) \rightarrow a)) \rightarrow ((a \rightarrow (a \rightarrow a)) \rightarrow (a \rightarrow a)) — Axiom 2
  3. (a(aa))(aa)(a \rightarrow (a \rightarrow a)) \rightarrow (a \rightarrow a) — MP(1, 2)
  4. a(aa)a \rightarrow (a \rightarrow a) — Axiom 1
  5. aaa \rightarrow a — MP(4, 3)

However, such proofs are hard to construct by hand, because we need to come up with concrete instances of axioms and it isn’t trivial in many cases which formulas should be substituted for variables. It is therefore much easier to construct the proof in a bottom-up manner, which means that we start with the formula to be proven and then apply axioms, lemmas and modus ponens backwards.

For example, we can rewrite the proof above with the following graph notation:

Proof illustration

In this notation:

  • Nodes mean proven statements.
  • Edge (u,v)E(u, v) \in E means that statement uu is needed for the proof of statement vv in one step — application of an axiom/lemma/assumption combined with modus ponens or simply modus ponens.
  • Cycles are not allowed, because we cannot refer to the correctness of some statement while proving it (the graph is a DAG).

By the way, this notation is more compact compared to the list-notation because when applying an axiom, lemma or an assumption we don’t need to state it and then add the result of modus ponens. Instead of that, we just replace the left side of the axiom/lemma/assumption with it’s right side.

How to come up with F0 proofs

The intuitive “algorithm” for coming up with proofs in the F0 proof system can be summarized as follows:

  • Apply the deduction theorem as much as possible.
  • Derive as many formulas as possible from the assumptions.
  • If the statement isn’t already proven, start constructing the proof bottom-up and apply axioms, lemmas, and assumptions as well as modus ponens backwards.

While performing the bottom-up construction of the proof, our goal is essentially to reach an already proven statement or an assumption from the statement to be proven. In order to do so, we need to iteratively search for ancestor nodes of some node vv that will get us closer to the desired assumptions or lemmas. For the construction of some node uu such that (u,v)E(u, v) \in E holds, we have the following options:

  • Add an assumption or an already proven statement to the left of vv (see, for example, the above proof where the first construction step was to add a(aa)a \rightarrow (a \rightarrow a) to the left of v=aav = a \rightarrow a). This step is essentially modus ponens applied backwards.
  • Let uu be the left-hand side of some assumption or already proven statement if vv is an instance of it’s right-hand side (see, for example, how Axiom 2 was applied above).

Examples

In the following examples, different F0 proofs are visualized with the graph notation described above. It is also a good idea to read these proofs bottom-up, this is how I constructed them.

Lemma 1 (Trivial implication)

aa\vdash a \rightarrow a

Proof: The statement follows directly with the deduction theorem. Also, we already proved this statement above without using the deduction theorem.

Lemma 2 (Double negation elimination)

¬¬aa\vdash \neg \neg a \rightarrow a

Proof: By the deduction theorem, the above statement is equivalent to ¬¬aa\neg \neg a \vdash a

Proof illustration

Lemma 3 (Introduce double negation)

a¬¬a\vdash a \rightarrow \neg \neg a

Proof:

Proof illustration

Lemma 4 (Double negation implication)

(ab)(¬¬a¬¬b)\vdash (a \rightarrow b) \rightarrow (\neg \neg a \rightarrow \neg \neg b)

Proof: By the deduction theorem, the above statement is equivalent to {ab,¬¬a}¬¬b\{a \rightarrow b, \neg \neg a \} \vdash \neg \neg b

Proof illustration

Lemma 5 (Implication transitivity 1)

(ab)((bc)(ac))\vdash (a \rightarrow b) \rightarrow ((b \rightarrow c) \rightarrow (a \rightarrow c))

Proof: By the deduction theorem, the above statement is equivalent to {a,ab,bc}c\{a, a \rightarrow b, b \rightarrow c\} \vdash c

Proof illustration

Lemma 6 (Simple implication transitivity)

a((ab)b)\vdash a \rightarrow ((a \rightarrow b) \rightarrow b)

Proof: By the deduction theorem, the above statement is equivalent to {a,ab}b\{a, a \rightarrow b\} \vdash b

Proof illustration

Lemma 7 (Implication transitivity 2)

(ab)((ca)(cb))\vdash (a \rightarrow b) \rightarrow ((c \rightarrow a) \rightarrow (c \rightarrow b))

Proof: By the deduction theorem, the above statement is equivalent to {c,ca,ab}b\{c, c \rightarrow a, a \rightarrow b\} \vdash b

Proof illustration

Lemma 8 (Implication from inconsistency)

¬b(ba)\vdash \neg b \rightarrow (b \rightarrow a)

Proof: By the deduction theorem, the above statement is equivalent to {¬b}(ba)\{\neg b\} \vdash (b \rightarrow a)

Proof illustration

Lemma 9 (Implication from contradiction)

(ab)((a¬b)(ac))\vdash (a \rightarrow b) \rightarrow ((a \rightarrow \neg b) \rightarrow (a \rightarrow c))

Proof: By the deduction theorem, the above statement is equivalent to {a,ab,a¬b}c\{a, a \rightarrow b, a \rightarrow \neg b\} \vdash c

Proof illustration

Lemma 10

(¬aa)a\vdash (\neg a \rightarrow a) \rightarrow a

Proof: By the deduction theorem, the above statement is equivalent to (¬aa)a(\neg a \rightarrow a) \vdash a

Proof illustration

Lemma 11 (Contraposition)

(ab)(¬b¬a)\vdash (a \rightarrow b) \rightarrow (\neg b \rightarrow \neg a)

Proof: By the deduction theorem, the above statement is equivalent to {ab,¬b}¬a\{a \rightarrow b, \neg b\} \vdash \neg a

Proof illustration

Lemma 12 (Elimination of assumptions)

(ba)((¬ba)a)\vdash (b \rightarrow a) \rightarrow ((\neg b \rightarrow a) \rightarrow a)

Proof: By the deduction theorem, the above statement is equivalent to {ba,¬ba}a\{b \rightarrow a, \neg b \rightarrow a\} \vdash a

Proof illustration

Lemma 13

a(¬b¬(ab))\vdash a \rightarrow (\neg b \rightarrow \neg (a \rightarrow b))

Proof: By the deduction theorem, the above statement is equivalent to {a,¬b}¬(ab)\{a, \neg b\} \vdash \neg (a \rightarrow b)

Proof illustration

Lemma 14

(a¬a)¬a\vdash (a \rightarrow \neg a) \rightarrow \neg a

Proof: By the deduction theorem, the above statement is equivalent to (a¬a)¬a(a \rightarrow \neg a) \vdash \neg a

Proof illustration

Lemma 15 (Proof by contradiction)

(ab)((a¬b)¬a)\vdash (a \rightarrow b) \rightarrow ((a \rightarrow \neg b) \rightarrow \neg a)

Proof: By the deduction theorem, the above statement is equivalent to {ab,a¬b}¬a\{a \rightarrow b, a \rightarrow \neg b\} \vdash \neg a

Proof illustration


Copyright © 2019 — 2023 Alexander Mayorov. All rights reserved.