TT2026 Introduction to Proof Systems notes


Remaining TODOs: 11


1. Logic

Definition 1.1: Logic is the study of the principles of correct reasoning.

This requires:

  • an unambiguous language in which we can formulate statements
  • a mathematical framework to determine the truth of a statement

Definition 1.2: A logical syllogism is an example of correct reasoning.

For example:

All beings are mortal;
All humans are beings;
Therefore all humans are mortal.

2. Propositional logic

2.1. Syntax

Definition 2.1.1: Basic sentences in propositional logic are atomic propositions.

For example, ๐‘Ž: Alice is an architect.

Definition 2.1.2: Compound sentences can be formed by logical connectives: ยฌ (negation), โˆจ (disjunction), โˆง (conjunction).

e.g. ยฌ๐‘Ž; ๐‘Žโˆจ๐‘.

Example:

{ยฌ๐‘,๐‘Žโˆจ๐‘,๐‘โ†’๐‘}โŠจ๐‘Ž

โ€œโŠจโ€ means โ€œentailsโ€; we have some propositions and we draw a conclusion.

Definition 2.1.3: Let ๐‘‹={๐‘ฅ1,๐‘ฅ2,โ€ฆ} be a countably infinite set of propositional variables.

Formulas of propositional logic are defined inductively:

  1. (basis clause) true,false and every propositional variable ๐‘ฅ are propositional formulae
  2. (inductive clause) If ๐น,๐บ are formulae, then so are ยฌ๐น (negation), ๐นโˆจ๐บ (disjunction, with ๐น and ๐บ the disjuncts), and ๐นโˆง๐บ (conjunction, with ๐น and ๐บ the conjuncts)
  3. (extremal clause) Nothing else is a formula
Remark: The extremal clause of the above definition ensures that the set of propositional formulae is the minimal set that satisfies the basis and inductive clauses.

Definition 2.1.4: There are some derived connectives:

  • implication: ๐นโ†’๐บโ‰”ยฌ๐นโˆง๐บ. Here ๐น is the antecedent and ๐บ is the consequent
  • bi-implication: ๐นโ†”๐บโ‰”(๐นโ†’๐บ)โˆง(๐บโ†’๐น)
  • Exclusive-OR: ๐นโŠ•๐บโ‰”(๐นโˆงยฌ๐บ)โˆจ(ยฌ๐นโˆง๐บ)
  • Indexed conjunction: โ‹€๐‘–=1๐‘›๐น๐‘–โ‰”(โ€ฆ((๐น1โˆง๐น2)โˆง๐น3)โˆงโ€ฆโˆง๐น๐‘›)
  • Indexed disjunction: โ‹๐‘–=1๐‘›๐น๐‘–โ‰”(โ€ฆ((๐น1โˆจ๐น2)โˆจ๐น3)โˆจโ€ฆโˆจ๐น๐‘›)
Definition 2.1.5: The set of all formulae of proposition logic over ๐‘‹ is denoted by โ„ฑ๏ธ€(๐‘‹).

Definition 2.1.6: The operate precedence for propositional logic is:

โ‹๐‘–,โ‹€๐‘– โ‰ช โ†” โ‰ช โ†’ โ‰ช โˆง,โˆจ โ‰ช ยฌ
Definition 2.1.7: A literal is an atomic proposition or its negation.

Definition 2.1.8: We say that ๐น is in conjunctive normal form (CNF) if

๐น=โ‹€๐‘–=1๐‘›โ‹๐‘—=1๐‘š๐‘–๐ฟ๐‘–,๐‘—,

where each ๐ฟ๐‘–,๐‘— is a literal.

๐น is in disjunctive normal form (DNF) if ๐น

๐น=โ‹๐‘–=1๐‘›โ‹€๐‘—=1๐‘š๐‘–๐ฟ๐‘–,๐‘—.

Definition 2.1.9: ๐น is in ๐‘˜-CNF if it is in CNF, and all the ๐‘š๐‘–s are equal to some fixed ๐‘˜.

๐น is in ๐‘˜-DNF if it is in DNF with all the ๐‘š๐‘–s equal to fixed ๐‘˜.

Remark: Normal forms are particularly well-suited for algorithmic treating.
Definition 2.1.10: Functions on formulae of propositional logic are uniquely defined by specifying the function values for โ€œbase casesโ€ and โ€œinductive stepsโ€, following the cases in Definitionย 2.1.3. Such a definition is said to use structural induction.

Example: Suppose we want to define a function that returns the set of all subformulae of a formula ๐น.

We define sub:๐น(๐‘‹)โ†’๐’ซ๏ธ€(๐น(๐‘‹)) using structural induction,

sub(true)โ‰”{true}sub(false)โ‰”{false}sub(๐‘ฅ)โ‰”{๐‘ฅ}sub(ยฌ๐น)โ‰”sub(๐น)โˆช{ยฌ๐น}sub(๐นโˆง๐บ)โ‰”sub(๐น)โˆชsub(๐บ)โˆช{๐นโˆง๐บ}sub(๐นโˆจ๐บ)โ‰”sub(๐น)โˆชsub(๐บ)โˆช{๐นโˆจ๐บ}

2.2. (Tarski-style) semantics

Definition 2.2.1: An assignment is a function ๐’œ๏ธ€:๐‘‹โ†’{0,1} that induces a function ๐’œ๏ธ€ฬ‚:โ„ฑ๏ธ€(๐‘‹)โ†’{0,1}. That is ๐’œ๏ธ€ maps propositional variables to truth values, and ๐’œ๏ธ€ฬ‚ maps formulae to truth values.

We define ๐’œ๏ธ€ฬ‚ using structural induction.

๐’œ๏ธ€ฬ‚(false)โ‰”0;๐’œ๏ธ€ฬ‚(true)โ‰”1;๐’œ๏ธ€ฬ‚(๐‘ฅ)โ‰”๐’œ๏ธ€(๐‘ฅ)for every๐‘ฅโˆˆ๐‘‹;๐’œ๏ธ€ฬ‚(ยฌ๐น)โ‰”{1if๐’œ๏ธ€ฬ‚(๐น)=00otherwise;๐’œ๏ธ€ฬ‚(๐นโˆง๐บ)โ‰”{1if๐’œ๏ธ€ฬ‚(๐น)=1and๐’œ๏ธ€ฬ‚(๐บ)=10otherwise;๐’œ๏ธ€ฬ‚(๐นโˆจ๐บ)โ‰”{1if๐’œ๏ธ€ฬ‚(๐น)=1or๐’œ๏ธ€ฬ‚(๐บ)=10otherwise.

Note that we define ๐’œ๏ธ€ฬ‚ in a kind of meta language - the โ€œandโ€ and โ€œorโ€ here are not the same as in propositional logic.

From now we write ๐’œ๏ธ€ instead of ๐’œ๏ธ€ฬ‚ for convenience.

Remark: We can construct truth tables for logical and derived connectives in the obvious manner. Implication may be surprising:

๐‘Ž๐‘๐‘Žโ†’๐‘
truetruetrue
truefalsefalse
falsefalsefalse
falsetruetrue

In particular this means that you can use false to show anything to be true, i.e. we should start with true assumptions when trying to prove something (obviously).

Definition 2.2.2: Let ๐น,๐บโˆˆโ„ฑ๏ธ€(๐‘‹),๐’ฎ๏ธ€โІโ„ฑ๏ธ€(๐‘‹) and ๐’œ๏ธ€:๐‘‹โ†’{0,1}. Then

  1. If ๐’œ๏ธ€(๐น)=1 then ๐’œ๏ธ€โŠง๐น (โ€œ๐’œ๏ธ€ is a model of ๐นโ€, or โ€œ๐น holds under ๐’œ๏ธ€โ€).
  2. If ๐’œ๏ธ€โŠง๐น for all ๐นโˆˆ๐’ฎ๏ธ€, then we write ๐ดโŠง๐‘† (โ€œ๐’œ๏ธ€ models ๐’ฎ๏ธ€โ€)
  3. ๐น is satisfiable is there is some ๐’œ๏ธ€:๐‘‹โ†’{0,1} s.t. ๐’œ๏ธ€(๐น)=1, or ๐’œ๏ธ€โŠง๐น. Otherwise, ๐น is unsatisfiable.
  4. If ๐น holds under any assignment, we say that ๐น is valid, or that ๐น is a tautology.
  5. If, for all assignments ๐’œ๏ธ€, ๐’œ๏ธ€โŠง๐’ฎ๏ธ€ implies ๐’œ๏ธ€โŠง๐น for some ๐น (not neccessarily an ๐นโˆˆ๐’ฎ๏ธ€ from statement 2), then ๐’ฎ๏ธ€ entails ๐น, written ๐’ฎ๏ธ€โŠจ๐น. We write ๐บโŠจ๐น if {๐บ}โŠจ๐น.
  6. If ๐นโŠจ๐บ and ๐บโŠจ๐น, then ๐น and ๐บ are logically equivalent, ๐นโ‰ก๐บ.
  7. If ๐น is satisfiable iff ๐บ is satisfiable, then ๐น and ๐บ are equisatisfiable.

Example:

{๐‘ฅ,๐‘ฅโ†’๐‘ฆ}โŠจ๐‘ฆ๐‘ฅโ†’(๐‘ฆโ†’๐‘ง)โ‰ก(๐‘ฅโˆง๐‘ฆ)โ†’๐‘ง๐‘ฅโˆจ๐‘ฆis equisat with(๐‘ฅโˆจ๐‘ง)โˆง(๐‘ฆโˆจยฌ๐‘ง)

Example (Encoding constraint satisfaction problem - Hamiltonian path problem): For undirected graph ๐บโ‰”(๐‘‰,๐ธ), is there a path visiting every vertex exactly once?

Introduce propositional variables ๐‘ฅ๐‘–,๐‘— expressing whether a Hamiltonian path visits vertex ๐‘– at time ๐‘— in a Hamiltonian path.

๐น1โ‰”โ‹€๐‘–=1๐‘›โ‹๐‘—=1๐‘›๐‘ฅ๐‘–,๐‘—๐น2โ‰”โ‹€๐‘–=1๐‘›โ‹€1โ‰ค๐‘—โ‰ค๐‘˜โ‰ค๐‘›ยฌ(๐‘ฅ๐‘–,๐‘—โˆง๐‘ฅ๐‘–,๐‘˜)๐น3โ‰”โ‹€๐‘–=1๐‘›โ‹€๐‘˜=1๐‘›โ‹€๐‘—=1๐‘›โˆ’1๐‘ฅ๐‘–,๐‘—โˆง๐‘ฅ๐‘˜,๐‘—+1โ†’๐‘’๐‘–,๐‘˜๐น4:โ‹€{๐‘–,๐‘—}โˆˆ๐ธ๐‘’๐‘–,๐‘—โˆงโ‹€{๐‘–,๐‘—}โˆ‰๐ธยฌ๐‘’๐‘–,๐‘—.

Then ๐น1โˆง๐น2โˆง๐น3โˆง๐น4 iff ๐บ has a Hamiltonian path.

This is a practical example of why satisfiable is an important concept.

Remark: This is nonconstructive, and also uses the law of the excluded middle; some claim that using the law of the excluded middle for nonconstructive proofs is invalid.

2.3. Minimal calculus (minimal logic)

Definition 2.3.1: The minimal calculus, ๐Œ0 consists of a finite number of axioms:

  • ๐‘ƒ๐ฟ1:๐ดโ†’(๐ดโˆง๐ด)
  • ๐‘ƒ๐ฟ2:(๐ดโˆง๐ต)โ†’(๐ตโˆง๐ด)
  • ๐‘ƒ๐ฟ3:(๐ดโ†’๐ต)โ†’[(๐ดโˆง๐ถ)โ†’(๐ตโˆง๐ถ)]
  • ๐‘ƒ๐ฟ4:[(๐ดโ†’๐ต)โ†’(๐ตโ†’๐ถ)]โ†’(๐ดโ†’๐ถ)
  • ๐‘ƒ๐ฟ5:๐ตโ†’(๐ดโ†’๐ต)
  • ๐‘ƒ๐ฟ6:(๐ดโˆง(๐ดโ†’๐ต))โ†’๐ต
  • ๐‘ƒ๐ฟ7:๐ดโ†’(๐ดโˆจ๐ต)
  • ๐‘ƒ๐ฟ8:(๐ดโˆจ๐ต)โ†’(๐ตโˆจ๐ด)
  • ๐‘ƒ๐ฟ9:[(๐ดโ†’๐ถ)โˆง(๐ตโ†’๐ถ)]โ†’[(๐ดโˆจ๐ต)โ†’๐ถ]
  • ๐‘ƒ๐ฟ10:[(๐ดโ†’๐ต)โˆง(๐ดโ†’ยฌ๐ต)]โ†’ยฌ๐ด

We also have a single inference rule, modus ponens: From ๐ด and ๐ดโ†’๐ต, infer ๐ต.

Remark: Modus ponens is basically ๐‘ƒ๐ฟ6, but it allows us to actually perform pattern-matching on the proof and reduce it.
Remark:All of the axioms are also valid formulae in Tarski-style semantics
Remark: Implication needs to be a primitive in the minimal logic, so that we can deal very carefully with negation.
Remark: The subscript 0 in ๐Œ0 indicates that this is a propositional logic (as opposed to, e.g., predicate logic)

Definition 2.3.2: A derivation in the minimal calculus is a finite sequence of formulae ๐ด1,โ€ฆ,๐ด๐‘›, each ๐ด๐‘– being either an axiom, or obtained from ๐ด๐‘—,๐ด๐‘˜,๐‘—,๐‘˜<๐‘– by application of modus ponens. If some ๐ด๐‘– is neither an axiom nor MP-derived, it is a hypothesis.

We write โŠข๐Œ0๐ต if ๐ต is derivable; then ๐ต is a theorem or provable in ๐Œ0.

Example:

  1. โŠข๐ถ(hypothesis)
  2. โŠข๐ถโ†’(๐ทโ†’๐ถ)(๐‘ƒ๐ฟ5)
  3. โŠข๐ทโ†’๐ถ(๐‘€๐‘ƒ1,2)
  4. โŠข(๐ทโ†’๐ถ)โ†’[(๐ทโ†’๐ท)โ†’(๐ถโˆง๐ท)](๐‘ƒ๐ฟ3)
  5. โŠข(๐ทโˆง๐ท)โ†’(๐ถโˆง๐ท)(๐‘€๐‘ƒ3,4)
  6. โŠข๐ทโ†’(๐ทโˆง๐ท)(๐‘ƒ๐ฟ1)
  7. โŠข๐ท(hypothesis)
  8. โŠข๐ทโˆง๐ท(๐‘€๐‘ƒ6,7)
  9. โŠข๐ถโˆง๐ท(๐‘€๐‘ƒ5,2)

This gives us a new proof rule, conjunction introduction:

โˆงINTRO:IfโŠข๐Œ0๐ถandโŠข๐Œ0๐ทthenโŠข๐Œ0๐ถโˆง๐ท.

Example:

  1. ๐ดโ†’๐ต (hypothesis)
  2. ๐ตโ†’๐ถ (hyp)
  3. (๐ดโ†’๐ต)โˆง(๐ตโ†’๐ถ) (โˆงINTRO (1, 2))
  4. [(๐ดโ†’๐ต)โˆง(๐ตโ†’๐ถ)]โ†’(๐ดโ†’๐ถ) (PL4)
  5. ๐ดโ†’๐ถ (MP (3, 4))

This gives us a new rule, transitivity of implication,

โ†’TRANS:IfโŠข๐Œ0๐ดโ†’๐ตandโŠข๐Œ0๐ตโ†’๐ถthenโŠข๐Œ0๐ดโ†’๐ถ.
Definition 2.3.3: Ex falso quodlibet (โ€œfrom falsehood, anything followsโ€) is the principal that ยฌ๐ดโ†’(๐ดโ†’๐ต), i.e. anything is provable from a false hypothesis.
Definition 2.3.4: Tertium non datur (โ€œno third [possibility] is givenโ€) is the law of the excluded middle, ยฌยฌ๐ดโ†’๐ด (equivalently, ๐ดโˆงยฌ๐ด is a tautology).

Remark: Not every valid statement in Tarski-style semantics is derivable using the minimal calculus.

In particular, it is not possible to derive ex falso quodlibet or tertium non datur.

Proposition 2.3.5: โŠฌ๐Œ0ยฌ๐ดโ†’(๐ดโ†’๐ต)

Proof: Let โ„Ž:โ„ฑ๏ธ€(๐‘‹)โ†’{0,1} be such that:

  • Propositional and template variables are given an arbitrary but fixed value
  • โ„Ž(ยฌ๐น)=0
  • The remaining logical connectives are reduced inductively according to the following table

    โ„Ž(๐น)โ„Ž(๐บ)โ„Ž(๐นโˆง๐บ)โ„Ž(๐นโˆจ๐บ)โ„Ž(๐นโ†’๐บ)
    00100
    01011
    10010
    11010

Then choose โ„Ž such that โ„Ž(๐ด)=0,โ„Ž(๐ต)=1, and observe that all aaxioms of ๐Œ0 evaluate to 0 under โ„Ž, while โ„Ž(ยฌ๐ดโ†’(๐ดโ†’๐ต))=1.

Observe also that if โ„Ž(๐ด)=โ„Ž(๐ดโ†’๐ต)=0, then applying modus ponens to get ๐ต must have โ„Ž(๐ต)=0, otherwise โ„Ž(๐ดโ†’๐ต) would evaluate to 1 by the definition of โ„Ž.

Therefore, starting from axioms and using modus ponens, we cannot create a formula ๐น that evaluates to 1 under โ„Ž; therefore ยฌ๐ดโ†’(๐ดโ†’๐ต) is not derivable from the axioms and modus ponens.

Definition 2.3.6: If we add ex falso quodlibet as an extra axiom, PL11 ยฌ๐ดโ†’(๐ดโ†’๐ต), then we get intuitionistic logic, denoted ๐‰0.

If we add tertium non datur, the law of the excluded middle, as a 12th axiom, we get classical logic, denoted ๐Š0.

Theorem 2.3.7: For any formula ๐น, โŠง๐น (๐น is valid) iff โŠข๐Š0๐น.
โŸธ is soundness and is simple.
โŸน is completeness and is more difficult to prove.

2.4. Equational reasoning

Idea: substitute subformulae by equivalent ones, according to the axioms of Boolean algebras.

Definition 2.4.1: A Boolean algebra is a structure that satisfies the following axioms:

  • ๐ดโˆจ๐ดโ‰ก๐ด
  • ๐ดโˆง๐ดโ‰ก๐ด (idempotence)
  • ๐ดโˆง๐ตโ‰ก๐ตโˆง๐ด
  • ๐ดโˆจ๐ต=๐ตโˆจ๐ด (commutativity)
  • (๐ดโˆง๐ต)โˆง๐ถโ‰ก๐ดโˆง(๐ตโˆง๐ถ)
  • (๐ดโˆจ๐ต)โˆจ๐ถโ‰ก๐ดโˆจ(๐ตโˆจ๐ถ) (associativity)
  • ๐ดโˆง(๐ดโˆจ๐ต)โ‰ก๐ด
  • ๐ดโˆจ(๐ดโˆง๐ต)โ‰ก๐ด (absorption)
  • ๐ดโˆง(๐ตโˆจ๐ถ)โ‰ก(๐ดโˆง๐ต)โˆจ(๐ดโˆง๐ถ)
  • ๐ดโˆจ(๐ตโˆง๐ถ)โ‰ก(๐ดโˆจ๐ต)โˆง(๐ดโˆจ๐ถ) (distributivity)
  • ยฌยฌ๐ดโ‰ก๐ด (double negation)
  • ยฌ(๐ดโˆง๐ต)โ‰กยฌ๐ดโˆจยฌ๐ต
  • ยฌ(๐ดโˆจ๐ต)โ‰กยฌ๐ดโˆงยฌ๐ต (de Morgan)
  • ๐ดโˆจยฌ๐ดโ‰กtrue
  • ๐ดโˆงยฌ๐ดโ‰กfalse (complementation)
  • ๐ดโˆจtrueโ‰กtrue
  • ๐ดโˆงfalseโ‰กfalse (zero laws)
  • ๐ดโˆจfalseโ‰ก๐ด
  • ๐ดโˆงtrueโ‰ก๐ด (identity laws)
Remark: Sets form a Boolean algebra.

Definition 2.4.2: We write ๐บ[๐น/๐ป] to mean the formula obtained from ๐บ by replacing every occurrence of ๐ป in ๐บ by ๐น.

This is a substitution.

Formally, ๐บ[๐น/๐ป]โ‰”๐น if ๐บ=๐ป. For ๐นโ‰ ๐ป, we proceed by structural induction:

  • Base case: ๐‘ฅ[๐น/๐ป]โ‰”๐‘ฅ for all ๐‘ฅโˆˆ๐‘‹
  • Inductive steps:
    • (ยฌ๐บ)[๐น/๐ป]=ยฌ(๐บ[๐น/๐ป])
    • (๐บ1โˆง๐บ2)[๐น/๐ป]=(๐บ1[๐น/๐ป])โˆง(๐บ2[๐น/๐ป])
    • (๐บ1โˆจ๐บ2)[๐น/๐ป]=(๐บ1[๐น/๐ป])โˆจ(๐บ2[๐น/๐ป])

Theorem 2.4.3 (Substitution theorem): Let ๐น,๐บ,๐บโ€ฒ,๐ป be formulae s.t. ๐บโ€ฒ=๐บ[๐น/๐ป] and ๐นโ‰ก๐ป, then ๐บโ€ฒโ‰ก๐บ.

Proof: By structural induction on ๐บ.

If ๐บโ‰ก๐ป then ๐บ[๐น/๐ป]=๐นโ‰ก๐ป, hence ๐บโ€ฒโ‰ก๐บ.

Otherwise:

  • If ๐บ=๐‘ฅ, then ๐บโ€ฒ=๐‘ฅ, hence ๐บโ‰ก๐บโ€ฒ
  • If ๐บ=ยฌ๐ฝ, then ๐บโ€ฒ=๐บ[๐น/๐ป]=ยฌ(๐ฝ[๐น/๐ป]), by inductive hypothesis, =ยฌ๐ฝโ€ฒ where ๐ฝโ€ฒโ‰ก๐ฝ
  • Conjunction and disjunction follow similarly.

Definition 2.4.4: A proof by equational reasoning of ๐นโ‰ก๐บ is a sequence ๐น1,โ€ฆ,๐น๐‘› such that ๐น1=๐น, ๐น๐‘›=๐บ, and ๐น๐‘–+1 is obtained from ๐น๐‘– by a substitution according to the Boolean algebra axioms.

Theorem 2.4.5 (soundness): If we have an equational proof starting in ๐น and ending in ๐บ, then ๐นโ‰ก๐บ.

Proof: Consequence of the substitution theorem.
Definition 2.4.6: A formula is in negation normal form if negation appears only in front of propositional variables.

Lemma 2.4.7: Every formula can be transformed into DNF by equational reasoning.

Proof:

We exhaustively apply de Morganโ€™s laws, and rewrite ยฌtrueโ‰กfalse and ยฌfalseโ‰กtrue. This gives us the negation normal form of ๐น.

Then we exhaustively apply distributivity and the identity laws.

We can then reintroduce any variables ๐‘ฅ๐‘– that were eliminated, by replacing any disjunct ๐ท with (๐ทโˆง๐‘ฅ๐‘–)โˆจ(๐ทโˆงยฌ๐‘ฅ๐‘–). Thus we obtain a canonical (up to disjunct ordering) DNF for the formula.

Theorem 2.4.8 (comleteness): If ๐นโ‰ก๐บ, then there is an equational proof starting in ๐น and ending in ๐บ.

Proof: Given ๐น,๐บ s.t. ๐นโ‰ก๐บ, then ๐น and ๐บ have the same truth table, hence the same DNF ๐ป. Then we apply Lemmaย 2.4.7 to ๐น to obtain ๐ป by proof ๐‘ƒ1, and to ๐บ to obtain ๐ป by proof ๐‘ƒ2.

Then the equational proof of ๐นโ‰ก๐บ is ๐‘ƒ1 concatenated with the reverse of ๐‘ƒ2.

2.5. Resolution

Use formulae in CNF, presented as sets.

E.g. if ๐น=(๐‘1โˆจยฌ๐‘2)โžclauseโˆง(๐‘3โˆจยฌ๐‘4โˆจ๐‘5)โˆง(ยฌ๐‘2).

We represent this as {{๐‘1,ยฌ๐‘2}โžclause,{๐‘3,ยฌ๐‘4,๐‘5},{ยฌ๐‘2}}.

We represent the empty clause as โ–กโ‰กfalse. {โ–ก}โ‰กfalse,{}โ‰กtrue.

Remark: The set representation naturally expresses commutativity, associativity and idempotence.

Definition 2.5.1: Given literal ๐ฟ, we define

๐ฟฬ…={ยฌ๐‘if๐ฟ=๐‘๐‘if๐ฟ=ยฌ๐‘.

Definition 2.5.2: Let ๐ถ1,๐ถ2 be clauses s.t. ๐ฟโˆˆ๐ถ1 and ๐ฟฬ…โˆˆ๐ถ2. Then the resolvent of ๐ถ1 and ๐ถ2 is

๐‘…=(๐ถ1\{๐ฟ})โˆช(๐ถ2\{๐ฟฬ…}).

We say that ๐‘… is derived by resolution from ๐ถ1 and ๐ถ2; we write .

Definition 2.5.3: A derivation (or proof) of a clause ๐ถ from the set of clauses ๐น is a sequence ๐ถ1,โ€ฆ,๐ถ๐‘š of clauses such that

  • ๐ถ๐‘š=๐ถ
  • For each 1โ‰ค๐‘–โ‰ค๐‘š, either ๐ถ๐‘–โˆˆ๐น (an assumption), or ๐ถ๐‘– is the resolvent of ๐ถ๐‘— and ๐ถ๐‘˜, for some ๐‘—โ‰ ๐‘˜,๐‘—,๐‘˜<๐‘–.
Definition 2.5.4: A derivation of โ–ก demonstrates a refutation of ๐น.
Remark: To show that ๐’ฎ๏ธ€โŠง๐น, we can demonstrate a refutation of ๐’ฎ๏ธ€โˆช{ยฌ๐น}.

Definition 2.5.5: Given ๐น, define

Res(๐น)=๐นโˆช{๐‘…|๐‘…is a resolvent from two clauses in๐น}.

Also define Res0(๐น)=๐น; Res๐‘›1(๐น)=Res(Res๐‘›(๐น)).

Also Resโˆ—(๐น)=โ‹ƒ๐‘›>0Res๐‘›(๐น). Note that this is computable in finite time. TODO is it?

Proposition 2.5.6: ๐ถโˆˆResโˆ—(๐น) iff there exists a resolution derivation of ๐ถ from ๐น.

Lemma 2.5.7 (Resolution lemma): If ๐‘… is the resolvent of ๐ถ1,๐ถ2โˆˆ๐น, then ๐นโ‰ก๐นโˆช{๐‘…}.

Proof: ๐นโ‰ก๐นโˆช{๐‘…} if we have that ๐’œ๏ธ€โŠง๐น iff ๐’œ๏ธ€โŠง๐นโˆช{๐‘…}.

โŸธ: If ๐’œ๏ธ€โŠง๐นโˆช{๐‘…}, then clearly ๐’œ๏ธ€โŠง๐น.

โŸน: Let ๐’œ๏ธ€โŠง๐น, ๐‘…={๐ถ1\{๐ฟ}}โˆช{๐ถ2\{๐ฟฬ…}}. Then we have two cases:

  1. ๐’œ๏ธ€โŠง๐ฟ, then since ๐’œ๏ธ€โŠง๐ถ2, we have ๐’œ๏ธ€โŠง๐ถ2\{๐ฟฬ…}. Hence ๐’œ๏ธ€โŠง๐‘….
  2. ๐’œ๏ธ€โŠงยฌ๐ฟ, then since ๐’œ๏ธ€โŠง๐ถ1, we have ๐’œ๏ธ€โŠง๐ถ1\{๐ฟ}, so ๐’œ๏ธ€โŠง๐‘….

Theorem 2.5.8 (soundness): If โ–ก can be derived by resolution from ๐น, then ๐น is unsatisfiable.

Proof: By induction on the length of the resolution proof.

๐นโ‰ก๐น1โ‰กโ€ฆโ‰ก๐น๐‘›โ‰กโ–กโ‰กfalse.

Theorem 2.5.9 (completeness): If ๐น is unsatisfiable, then โ–ก can be derived from ๐น by resolution.

Proof: By induction on the number of propositional variables that appear in ๐น, ๐‘›.

If ๐‘›=0, then ๐น={โ–ก}. Trivial.

Then suppose true for ๐‘›, and consider ๐‘›+1.

๐น mentions prop. vars. ๐‘1,โ€ฆ,๐‘๐‘›+1. Let ๐น0=๐น[false/๐‘๐‘›+1],๐น1=๐น[true/๐‘๐‘›+1].

Since ๐น is unsatisfiable, both ๐น0 and ๐น1 are unsatisfiable. By the inductive hypothesis, we have ๐ถ0,๐ถ1,โ€ฆ,๐ถ๐‘š=โ–ก being a refutation of ๐น0.

Note that ๐ถ๐‘– or ๐ถ๐‘–โˆช{๐‘๐‘›+1} are already in ๐น. By reintroducing ๐‘๐‘›+1, we either obtain a proof of โ–ก, or of ๐‘๐‘›+1.

In the latter case, we can apply the same reasoning to ๐น1 and obtain a proof of ยฌ๐‘๐‘›+1. Then the final resolution step gives us โ–ก.

Remark: Constructing equivalent CNF formulae can be expensive. But because resolution only checks unsatisfiability, we only need an equisatisfiable formula.

Give ๐น, do the following:

  • Introduce fresh prop. vars for every subformula ๐บ of ๐น, whenever ๐บ is not a literal; call it ๐‘ฅ๐บ
  • Introduce ๐‘ฅ๐บโ†”๐บโ€ฒ, where ๐บโ€ฒ is ๐บ, with the top-level subformulae replaced by the new prop. vars.
  • Use equational transformation to transform all of the ๐‘ฅ๐บโ†”๐บโ€ฒs into CNF
  • The final formula is all new CNF formulae, plus ๐‘ฅ๐น.

Example: Consider the formula ๐น=ยฌ(๐‘โˆง๐‘ž)โˆง๐‘Ÿ. The subformulae of ๐น, excluding literals, are {ยฌ(๐‘โˆง๐‘ž)โˆง๐‘Ÿ,ยฌ(๐‘โˆง๐‘ž),๐‘โˆง๐‘ž}. Then we introduce new propositional variables ๐‘ฅ๐น, ๐‘ฅยฌ(๐‘โˆง๐‘ž), ๐‘ฅ๐‘โˆง๐‘ž, and say that:

  • ๐‘ฅ๐นโ†”๐‘ฅยฌ(๐‘โˆง๐‘ž)โˆง๐‘Ÿ
  • ๐‘ฅยฌ(๐‘โˆง๐‘ž)โ†”ยฌ๐‘ฅ๐‘โˆง๐‘ž
  • ๐‘ฅ๐‘โˆง๐‘žโ†”๐‘โˆง๐‘ž

We then transform these into CNF:

  • (ยฌ๐‘ฅ๐นโˆจ(๐‘ฅยฌ(๐‘โˆง๐‘ž)โˆง๐‘Ÿ))โˆง(ยฌ(๐‘ฅยฌ(๐‘โˆง๐‘ž)โˆง๐‘Ÿ)โˆจ๐‘ฅ๐น)โ‰ก(ยฌ๐‘ฅ๐นโˆจ๐‘ฅยฌ(๐‘โˆง๐‘ž))โˆง(ยฌ๐‘ฅ๐นโˆจ๐‘Ÿ)โˆง(ยฌ๐‘ฅยฌ(๐‘โˆง๐‘ž)โˆจยฌ๐‘Ÿโˆจ๐‘ฅ๐น)
  • (๐‘ฅยฌ(๐‘โˆง๐‘ž)โ†’ยฌ๐‘ฅ๐‘โˆง๐‘ž)โˆง(ยฌ๐‘ฅ๐‘โˆง๐‘žโ†’๐‘ฅยฌ(๐‘โˆง๐‘ž))โ‰ก(ยฌ๐‘ฅยฌ(๐‘โˆง๐‘ž)โˆจยฌ๐‘ฅ๐‘โˆง๐‘ž)โˆง(๐‘ฅ๐‘โˆง๐‘žโˆจ๐‘ฅยฌ(๐‘โˆง๐‘ž))
  • (๐‘ฅ๐‘โˆง๐‘žโ†’(๐‘โˆง๐‘ž))โˆง((๐‘โˆง๐‘ž)โ†’๐‘ฅ๐‘โˆง๐‘ž)โ‰ก(ยฌ๐‘ฅ๐‘โˆง๐‘žโˆจ(๐‘โˆง๐‘ž))โˆง(ยฌ(๐‘โˆง๐‘ž)โˆจ๐‘ฅ๐‘โˆง๐‘ž)โ‰ก(ยฌ๐‘ฅ๐‘โˆง๐‘žโˆจ๐‘)โˆง(ยฌ๐‘ฅ๐‘โˆง๐‘žโˆจ๐‘ž)โˆง(ยฌ๐‘โˆจยฌ๐‘žโˆจ๐‘ฅ๐‘โˆง๐‘ž)

    and combine them all with ๐‘ฅ๐น to get:

    {{๐‘ฅ๐น},{ยฌ๐‘ฅ๐‘โˆง๐‘ž,๐‘},{ยฌ๐‘ฅ๐‘โˆง๐‘ž,๐‘ž},{ยฌ๐‘,ยฌ๐‘ž,๐‘ฅ๐‘โˆง๐‘ž},{ยฌ๐‘ฅยฌ(๐‘โˆง๐‘ž),ยฌ๐‘ฅ๐‘โˆง๐‘ž},{๐‘ฅ๐‘โˆง๐‘ž,๐‘ฅยฌ๐‘โˆง๐‘ž},{ยฌ๐‘ฅ๐‘“,๐‘ฅยฌ(๐‘โˆง๐‘ž)},{ยฌ๐‘ฅ๐น,๐‘Ÿ},{ยฌ๐‘ฅยฌ(๐‘โˆง๐‘ž),ยฌ๐‘Ÿ,๐‘ฅ๐น}}.

2.6. Natural deduction

Definition 2.6.1: The calculus of natural deduction has no axioms. Proofs begin by assumptions, and we use rules for Boolean connectives. A proof is a tree.

Temporary assumptions that are discharged are denoted by square brackets in the proof rules. If, at the end of a proof, all assumptions are discharged, the proof is valid.

Definition 2.6.2: The natural deduction rules are as follows:

  • Conjunction introduction:

  • Conjunction elimination:

  • Disjunction introduction:

  • Disjunction elimination:

    This says that, in order to derive ๐ถ from ๐ดโˆจ๐ต, it is sufficient to derive ๐ถ from ๐ด and also ๐ถ from ๐ต. Then both assumptions [๐ด] and [๐ต] are discharged. This is informally proof by cases.
  • Implication introduction:

  • Implication elimination:

  • Negation introduction:

  • Negation elimination:

  • Ex falso quodlibet:

  • Reductio ad absurdum:

Remark: Without โŠฅJ or โŠฅK, natural deduction is equivalent to ๐Œ0; with โŠฅJ it is equivalent to ๐‰0; and with โŠฅK, it is equivalent to ๐Š0.
Definition 2.6.3: A deduction of a formula ๐น is a finite tree of formulae in which every leaf is an assumption, and every other formula is the conclusion of an application of one of the inference rules. The open assumptions of a deduction are those that are not discharged by any rule in the tree. A deduction of ๐น with no open assumptions is a proof of ๐น, and ๐น is a theorem if such a proof exists.
Remark: Natural deduction is sound and complete.

2.7. Sequent calculus

Definition 2.7.1: A sequent is an expression of the form

๐ด1,โ€ฆ,๐ด๐‘›โŸน๐ต1,โ€ฆ,๐ต๐‘š,

where the ๐ด๐‘–s and ๐ต๐‘–s are propositional forumlae.

Such a sequent is valid if the following is valid in classical logic:

  • ๐ด1โˆงโ€ฆโˆง๐ด๐‘›โ†’๐ต1โˆจโ€ฆโˆจ๐ต๐‘š, if ๐‘›,๐‘šโ‰ 0
  • ๐ต1โˆจโ€ฆโˆจ๐ต๐‘š, if ๐‘›=0,๐‘šโ‰ 0
  • ยฌ(๐ด1โˆงโ€ฆโˆง๐ด๐‘›), if ๐‘›โ‰ 0,๐‘š=0,
  • false otherwise.

The left-hand side of the sequent is the antecedent, and the right-hand side is the succedent.

Remark: The sequent with an empty antecedent and empty succedent is the empty sequent and is always invalid, by the last case in the definition above.
Remark: ๐ดโŸน๐ด is a tautology/axiom.
Remark: In declarations of sequent inference rules, we use the Greek letters ฮ“,ฮ”,ฮฃ,ฮ ,ฮฆ,ฮ˜,ฮ›,ฮž to denote (possibly empty) ordered lists of propositional formulae.

Definition 2.7.2: The inference rules of sequent calculus are either structural rules, which manipulate the list structure of a sequent, and operational rules, which provide rules for introducing logical connectives in the antecent or succedent. Inference rules take one or more premises from which a conclusion is drawn.

Definition 2.7.3: The structural rules are as follows:

  • Interchange allows consecutive formulae to be swapped, on both the left and right-hand sides:

  • Weakening allows formulae to be added to the left or right:

  • Contraction allows duplicate formulae to be merged:

Definition 2.7.4: The operational rules are as follows:

  • Conjunction:

  • Disjunction:

  • Conditional:

  • Negation:

Definition 2.7.5: A proof in the sequent calculus is a finite tree of sequents in which every leaf is an axiom (๐ดโ‡’๐ด), and every other node is obtained from its children (where children are written above their parent) by an inference rule.

A sequent is provable or derivable if it is the root of such a proof.

Remark: To prove validity of ๐น in the sequent calculus, we want to obtain an empty left-hand side, with ๐น on the right:

Example: To prove that (๐‘โˆง๐‘ž)โ†’๐‘:

Example: To prove (๐‘โ†’๐‘ž)โ†’(ยฌ๐‘žโ†’ยฌ๐‘)

Theorem 2.7.6: The sequent calculus is a sound and complete proof system for classical logic.

2.8. The compactness theorem

Theorem 2.8.1 (compactness theorem):

A set of formulae ๐’ฎ๏ธ€ is satisfiable iff every finite subset of ๐’ฎ๏ธ€ is satisfiable.

Equivalently, a set of formulae ๐’ฎ๏ธ€ is unsatisfiable iff there is some unsatisfiable finite ๐’ฎ๏ธ€โ€ฒโІ๐’ฎ๏ธ€.

Proof:

โ€œโŸนโ€: Suppose that ๐’ฎ๏ธ€ is satisfiable, then there exists ๐’œ๏ธ€ s.t. ๐’œ๏ธ€โŠง๐น for all ๐นโˆˆ๐’ฎ๏ธ€, hence ๐’œ๏ธ€โŠง๐บ for all ๐บโˆˆ๐’ฎ๏ธ€โ€ฒ for any finite subset ๐’ฎ๏ธ€โ€ฒโІ๐‘†.

โ€œโŸธโ€:

Define a partial assignment to be a function ๐’œ๏ธ€:๐‘‹โ†’{0,1}, where dom(๐’œ๏ธ€)={๐‘ฅ1,โ€ฆ,๐‘ฅ๐‘›}.

We say that a partial assignment ๐’œ๏ธ€ is good if ๐’œ๏ธ€โŠง๐น for all ๐นโˆˆ๐’ฎ๏ธ€ s.t. ๐น only mentions the variables in dom(๐’œ๏ธ€).

Suppose that every finite subset of ๐’ฎ๏ธ€ is satisfiable, then for every ๐‘›, there is a partial assignment ๐’œ๏ธ€ s.t. dom(๐’œ๏ธ€)={๐‘ฅ1,โ€ฆ,๐‘ฅ๐‘›} that is good:

  • Let ๐’ฎ๏ธ€โ€ฒโˆˆ๐‘† be all formulae over ๐‘ฅ1,โ€ฆ,๐‘ฅ๐‘›.
  • ๐’ฎ๏ธ€โ€ฒ might be infinite, but contains only finitely many formulae, up to logical equivalence.
  • Choose representatives for each equivalence class and put them in ๐’ฎ๏ธ€โ€ณโІ๐’ฎ๏ธ€โ€ฒ, ๐’ฎ๏ธ€โ€ณ finite.
  • By assumption, there is some ๐’œ๏ธ€ such that ๐’œ๏ธ€โŠง๐น for all ๐นโˆˆ๐’ฎ๏ธ€โ€ณ. Moreover, ๐’œ๏ธ€ will satisfy every formula in ๐’ฎ๏ธ€โ€ฒ, because they are all logically equivalent to a formula in ๐’ฎ๏ธ€โ€ณ

Now we plan to construct a sequence ๐’œ๏ธ€0,๐’œ๏ธ€1,โ€ฆ of partial assignments that are good, and such that ๐’œ๏ธ€๐‘–+1 extends ๐’œ๏ธ€๐‘–; that is, dom(๐’œ๏ธ€๐‘–)โІdom(๐’œ๏ธ€๐‘–+1), and ๐’œ๏ธ€๐‘–(๐‘ฅ๐‘—)=๐’œ๏ธ€๐‘–+1(๐‘ฅ๐‘—) for all ๐‘ฅ๐‘—โˆˆdom(๐’œ๏ธ€๐‘–).

We do this while maintaining the invariant that, for all ๐‘›โ‰ฅ0, there are infinitely many good extensions of ๐’œ๏ธ€๐‘›.

We construct the ๐’œ๏ธ€๐‘›s by induction on ๐‘›.

The base case is clear: ๐’œ๏ธ€0 is the empty assignment, which vacuously satisfies the empty subset of ๐’ฎ๏ธ€, and there are clearly an infinite number of good assignments that extend the empty assignment, since every finite subset of ๐’ฎ๏ธ€ is satisfiable.

Then suppose we constructed ๐’œ๏ธ€1,โ€ฆ,๐’œ๏ธ€๐‘›, and consider two assignments โ„ฌ๏ธ€,โ„ฌ๏ธ€โ€ฒ that extend ๐’œ๏ธ€๐‘›, with โ„ฌ๏ธ€(๐‘ฅ๐‘›+1)=0,โ„ฌ๏ธ€(๐‘ฅ๐‘›+1)=1. Since ๐’œ๏ธ€๐‘› has infinitely many good extensions, one of โ„ฌ๏ธ€ and โ„ฌ๏ธ€โ€ฒ must have infinitely many good extensions. Pick the โ„ฌ๏ธ€ or โ„ฌ๏ธ€โ€ฒ that has infinitely many good extensions to be ๐’œ๏ธ€๐‘›+1. Then by induction we have constructed our sequence ๐’œ๏ธ€0,โ€ฆ,๐’œ๏ธ€๐‘›.

Now we take ๐’œ๏ธ€ such that ๐’œ๏ธ€(๐‘ฅ๐‘–)=๐’œ๏ธ€๐‘–(๐‘ฅ๐‘–) for all ๐‘–โ‰ฅ1. Then ๐’œ๏ธ€โŠง๐น for all ๐นโˆˆ๐’ฎ๏ธ€, because we can take the largest index of a prop. var. that appears in ๐น, and we know that ๐’œ๏ธ€ extends a model of ๐น, so ๐’œ๏ธ€โŠง๐น.

Example (an application of the compactness theorem):

Proposition: Let ๐บโ‰”(๐‘‰,๐ธ) be a graph with ๐‘‰={๐‘ฃ๐‘–|๐‘–โˆˆโ„•}, and suppose that every finite subgraph of ๐บ is ๐‘˜-colourable, then ๐บ is ๐‘˜-colourable.

Proof: For every ๐‘ฃโˆˆ๐‘‰, introduce a propositional variabel ๐‘ฅ๐‘ฃ,๐‘– (๐‘ฃ has colour ๐‘–).

๐น๐‘ฃโ‰”โ‹๐‘–=1๐‘˜๐‘ฅ๐‘ฃ,๐‘–โˆ€๐‘ฃโˆˆ๐‘‰๐บ๐‘ฃโ‰”โ‹€๐‘–=1๐‘˜โˆ’1โ‹€๐‘—=๐‘–+1๐‘˜ยฌ(๐‘ฅ๐‘ฃ,๐‘–โˆง๐‘ฅ๐‘ฃ,๐‘—)โˆ€๐‘ฃโˆˆ๐‘‰๐ป๐‘ข,๐‘ฃโ‰”โ‹€๐‘–=1๐‘˜ยฌ(๐‘ฅ๐‘ฃ,๐‘–โˆง๐‘ฅ๐‘ข,๐‘–)โˆ€(๐‘ข,๐‘ฃ)โˆˆ๐ธ

Then let

๐’ฎ๏ธ€โ‰”{๐น๐‘ฃ,๐บ๐‘ฃ|๐‘ฃโˆˆ๐‘‰}โˆช{๐ป๐‘ข,๐‘ฃ|(๐‘ข,๐‘ฃ)โˆˆ๐ธ},

and we claim that ๐’ฎ๏ธ€ is satisfiable iff ๐บ has a colouring (proof is easy).

Observe that any finite ๐‘†โ€ฒโІ๐‘† โ€œtalks aboutโ€ a finite subgraph of ๐บ; by assumption, ๐‘†โ€ฒ is satisfiable. By the compactness theorem, ๐‘† is satisfiable; therefore ๐บ is ๐‘˜-colourable.

3. 1st-order logic

3.1. Syntax

Definition 3.1.1: A signature, ๐œŽ, is a tuple of

  • constant symbols (๐‘,๐‘‘)
  • function symbols (๐‘“,๐‘”)
  • predicate symbols (๐‘ƒ,๐‘„,๐‘…)

with function and predicate symbols each having nonzero arity ๐‘˜.

We also keep a set of variables ๐‘‹={๐‘ฅ1,๐‘ฅ2,โ€ฆ}, independently from the signature.

Definition 3.1.2: A ๐œŽ-term is defined by structural induction:

  • every ๐‘ฅ is a term
  • every ๐‘ is a term
  • if ๐‘ก1,โ€ฆ,๐‘ก๐‘˜ are terms, then ๐‘“(๐‘ก1,โ€ฆ,๐‘ก๐‘˜) is a term (assuming ๐‘“ has arity ๐‘˜)
  • nothing else is a term

Definition 3.1.3: A formula of 1st-order logic over ๐œŽ is defined by structural induction.

  • ๐‘ƒ(๐‘ก1,โ€ฆ,๐‘ก๐‘˜) is an atomic formula for a ๐‘˜-ary relation symbol ๐‘ƒ and terms ๐‘ก1,โ€ฆ,๐‘ก๐‘˜
  • If ๐น,๐บ are formulae, and ๐‘ฅโˆˆ๐‘‹, then the following are formulae:
    • ยฌ๐น, ๐นโˆง๐บ, ๐นโˆจ๐บ
    • โˆƒ๐‘ฅ๐น (existential quantifier)
    • โˆ€๐‘ฅ๐น (universal quantifier)
  • Nothing else is a formula

Definition 3.1.4: For existential/universal quanitifiers โˆƒ๐‘ฅ๐น / โˆ€๐‘ฅ๐น, we say that ๐น is in the scope of โˆƒ๐‘ฅ / โˆ€๐‘ฅ, and moreover ๐‘ฅ is bound by โˆƒ๐‘ฅ / โˆ€๐‘ฅ.

If a variable is not bound, it is free.

A formula with no free variables is a sentence, or closed.

TODO quantifier depth

3.2. Semantics

Definition 3.2.1: A ๐œŽ-structure or ๐œŽ-assignment ๐’œ๏ธ€ is a tuple consisting of:

  • A non-empty universe ๐’ฐ๏ธ€๐’œ๏ธ€
  • For every ๐‘˜-ary function symbol ๐‘“, a function ๐‘“๐’œ๏ธ€:๐’ฐ๏ธ€๐’œ๏ธ€๐‘˜โ†’๐’ฐ๏ธ€๐’œ๏ธ€
  • For every ๐‘˜-ary predicate symbol ๐‘ƒ, a ๐‘˜-ary relation ๐‘ƒ๐’œ๏ธ€โІ๐’ฐ๏ธ€๐’œ๏ธ€๐‘˜
  • For every constant ๐‘, a ๐‘๐’œ๏ธ€โˆˆ๐’ฐ๏ธ€๐’œ๏ธ€
  • For every variable ๐‘ฅ, a ๐‘ฅ๐’œ๏ธ€โˆˆ๐’ฐ๏ธ€๐’œ๏ธ€.

Definition 3.2.2: For ๐œŽ-structure ๐’œ๏ธ€ and term ๐‘ก, we define the value of ๐‘ก under ๐’œ๏ธ€ by structural induction:

  • ๐’œ๏ธ€(๐‘)โ‰”๐‘๐’œ๏ธ€โˆˆ๐’ฐ๏ธ€๐’œ๏ธ€
  • ๐’œ๏ธ€(๐‘ฅ)โ‰”๐‘ฅ๐’œ๏ธ€โˆˆ๐’ฐ๏ธ€๐’œ๏ธ€
  • ๐’œ๏ธ€(๐‘“(๐‘ก1,โ€ฆ,๐‘ก๐‘˜))โ‰”๐‘“๐’œ๏ธ€(๐’œ๏ธ€(๐‘ก1),โ€ฆ,๐’œ๏ธ€(๐‘ก๐‘˜))

Definition 3.2.3: We define the satisfaction relation ๐’œ๏ธ€โŠง๐น by structural induction:

  • ๐’œ๏ธ€โŠง๐‘ƒ(๐‘ก1,โ€ฆ,๐‘ก๐‘˜) iff (๐’œ๏ธ€(๐‘ก1),โ€ฆ๐’œ๏ธ€(๐‘ก๐‘˜))โˆˆ๐‘ƒ๐’œ๏ธ€
  • ๐’œ๏ธ€โŠงยฌ๐น iff ๐’œ๏ธ€โŠง๐น
  • ๐’œ๏ธ€โŠง๐นโˆง๐บ iff ๐’œ๏ธ€โŠง๐น and ๐’œ๏ธ€โŠง๐บ
  • ๐’œ๏ธ€โŠง๐นโˆจ๐บ iff ๐’œ๏ธ€โŠง๐น or ๐’œ๏ธ€โŠง๐บ
  • ๐’œ๏ธ€โŠงโˆƒ๐‘ฅ๐น iff there is ๐‘Žโˆˆ๐’ฐ๏ธ€๐’œ๏ธ€ s.t. ๐’œ๏ธ€[๐‘ฅโ†ฆ๐‘Ž]โŠง๐น
  • ๐’œ๏ธ€โŠงโˆ€๐‘ฅ๐น iff for all ๐‘Žโˆˆ๐’ฐ๏ธ€๐’œ๏ธ€, ๐’œ๏ธ€[๐‘ฅโ†ฆ๐‘Ž]โŠง๐น

Definition 3.2.4: A 1st-order logic formula ๐น is satisfiable if there is a ๐œŽ-structure ๐’œ๏ธ€ s.t. ๐’œ๏ธ€โŠง๐น.

๐น is unsatisfiable if there is no such structure.

Definition 3.2.5: 1st-order logic formulae ๐น,๐บ are equivalent (๐นโ‰ก๐บ) if ๐’œ๏ธ€โŠง๐นโ‡”๐’œ๏ธ€โŠง๐บ for all ๐’œ๏ธ€.
Definition 3.2.6: 1st-order formulae are equisatisfiable if ๐น is satisfiable iff ๐บ is satisfiable.

3.3. Equivalences & Skolem form

Definition 3.3.1: A formula ๐บ is in Skolem form if ๐บ=โˆ€๐‘ฅ1โˆ€๐‘ฅ2โ€ฆโˆ€๐‘ฅ๐‘˜๐น, where ๐น is quantifier-free.
Lemma 3.3.2 (Relevance Lemma): Let ๐น be a formula, and assignments ๐’œ๏ธ€,๐’œ๏ธ€โ€ฒ coinciding on their interpretation of constants, function symbols, predicate symbols and variables that are free in ๐น. Then ๐’œ๏ธ€โŠง๐น iff ๐’œ๏ธ€โ€ฒโŠง๐น.

Remark: Propositional logic laws for logical equivalence still carry over, e.g. (ยฌ๐นโˆง๐บ)โ‰กยฌ๐นโˆจยฌ๐บ.

Moreover, logical equivalence is still a congruence, e.g. ๐นโˆง๐บโ‰ก๐นโ€ฒโˆง๐บโ€ฒ iff ๐นโ‰ก๐นโ€ฒ and ๐บโ‰ก๐บโ€ฒ.

Also, if ๐นโ‰ก๐บ, then โˆ€๐‘ฅ๐นโ‰กโˆ€๐‘ฅ๐บ, and โˆƒ๐‘ฅ๐นโ‰กโˆƒ๐‘ฅ๐บ.

Theorem 3.3.3:

Let ๐น,๐บ be formulae, then the following equivalences hold in 1st-order logic:

  1. ยฌโˆ€๐‘ฅ๐นโ‰กโˆƒ๐‘ฅยฌ๐น, ยฌโˆƒ๐‘ฅ๐นโ‰กโˆ€๐‘ฅยฌ๐น (these allow us to establish a negation-normal form for 1st-order logic)
  2. If ๐‘ฅ does not appear free in ๐บ, then

    • โˆ€๐‘ฅ๐นโˆง๐บโ‰กโˆ€๐‘ฅ(๐นโˆง๐บ), โˆ€๐‘ฅ๐นโˆจ๐บโ‰กโˆ€๐‘ฅ(๐นโˆจ๐บ)
    • โˆƒ๐‘ฅ๐นโˆง๐บโ‰กโˆƒ๐‘ฅ(๐นโˆง๐บ), โˆƒ๐‘ฅ๐นโˆจ๐บโ‰กโˆƒ๐‘ฅ(๐นโˆจ๐บ)
  3. โˆ€๐‘ฅ๐นโˆงโˆ€๐‘ฅ๐บโ‰กโˆ€๐‘ฅ(๐นโˆง๐บ), (โˆƒ๐‘ฅ๐นโˆจโˆƒ๐‘ฅ๐บ)โ‰กโˆƒ๐‘ฅ(๐นโˆจ๐บ)
  4. โˆ€๐‘ฅโˆ€๐‘ฆ๐นโ‰กโˆ€๐‘ฆโˆ€๐‘ฅ๐น, โˆƒ๐‘ฅโˆƒ๐‘ฆ๐นโ‰กโˆƒ๐‘ฆโˆƒ๐‘ฅ๐น

Proof:

  1. ๐ดโŠงยฌโˆ€๐‘ฅ๐น iff ๐’œ๏ธ€โŠงโˆ€๐‘ฅ๐น

    iff ๐’œ๏ธ€[๐‘ฅโ†ฆ๐‘Ž]โŠง๐น for some ๐‘Žโˆˆ๐’ฐ๏ธ€๐’œ๏ธ€

    iff ๐’œ๏ธ€[๐‘ฅโ†ฆ๐‘Ž]โŠงยฌ๐น for some ๐‘Žโˆˆ๐’ฐ๏ธ€๐’œ๏ธ€

    iff ๐’œ๏ธ€โŠงโˆƒ๐‘ฅยฌ๐น

    and similar for the second equivalence.

  2. ๐’œ๏ธ€โŠง(โˆ€๐‘ฅ๐น)โˆง๐บ iff ๐’œ๏ธ€โŠงโˆ€๐‘ฅ๐น and ๐’œ๏ธ€โŠง๐บ

    iff, for all ๐‘Žโˆˆ๐’ฐ๏ธ€๐’œ๏ธ€, ๐’œ๏ธ€[๐‘ฅโ†ฆ๐‘Ž]โŠง๐น and ๐’œ๏ธ€โŠง๐บ

    iff, for all ๐‘Žโˆˆ๐’ฐ๏ธ€๐’œ๏ธ€, ๐’œ๏ธ€[๐‘ฅโ†ฆ๐‘Ž]โŠง๐น and ๐’œ๏ธ€[๐‘ฅโ†ฆ๐‘Ž]โŠง๐บ

    (by the Relevance Lemma, since ๐‘ฅ does not appear free in ๐บ)

    iff, for all ๐‘Žโˆˆ๐’ฐ๏ธ€๐’œ๏ธ€, ๐’œ๏ธ€[๐‘ฅโ†ฆ๐‘Ž]โŠง๐นโˆง๐บ

    iff ๐’œ๏ธ€โŠงโˆ€๐‘ฅ(๐นโˆง๐บ)

    and similarly for the other equivalences.

  3. TODO exercise
  4. TODO exercise

Definition 3.3.4: A formula ๐บ is in prenex form if

๐บ=๐‘„1๐‘ฅ1โ€ฆ๐‘„๐‘›๐‘ฆ๐‘›๐บโ€ฒ, ๐‘„๐‘–โˆˆ{โˆƒ,โˆ€},

where ๐บโ€ฒ is quantifier-free.

Lemma 3.3.5: Any formula ๐น is equivalent to one in prenex form.

Definition 3.3.6: Let ๐น be a formula, ๐‘ฅ a variable, and ๐‘ก a term, then ๐น[๐‘ก/๐‘ฅ] is a substitution obtained by replacing every free occurrence of ๐‘ฅ in ๐น with ๐‘ก.

TODO define by structural induction.

Lemma 3.3.7 (translation-lemma): If ๐‘ก is a term and ๐น a formula such that no variable in ๐‘ก occurs bound in ๐น, then we have that ๐’œ๏ธ€โŠง๐น[๐‘ก/๐‘ฅ] iff ๐’œ๏ธ€[๐‘ฅโ†ฆ๐’œ๏ธ€(๐‘ก)]โŠง๐น.

Proof:TODO, optional

Lemma 3.3.8: Let ๐น=๐‘„๐‘ฅ๐บ with ๐‘„ a quantifier, and ๐‘ฆ a variable not occurring in ๐บ. Then ๐นโ‰ก๐‘„๐‘ฆ๐บ[๐‘ฆ/๐‘ฅ].

Proof:TODO
Definition 3.3.9: A formula is rectified if no variable occurs both bound and free at the same time, and all quantifiers refer to different variables.

Lemma 3.3.10: Every formula is equivalent to a rectified formula, and moreover one in rectified prenex form.

Proof: TODO by the lemmas above.

Lemma 3.3.11: Let ๐น=โˆ€๐‘ฆ1โˆ€๐‘ฆ2โ€ฆโˆ€๐‘ฆ๐‘˜โˆƒ๐‘ง๐บ where ๐บ is rectified. Let ๐‘“ be a fresh function symbol of arity ๐‘˜, then ๐น is equisatisfiable with ๐นโ€ฒโ‰”โˆ€๐‘ฆ1โˆ€๐‘ฆ2โ€ฆโˆ€๐‘ฆ๐‘˜๐บ[๐‘“(๐‘ฆ1,โ€ฆ,๐‘ฆ๐‘˜)/๐‘ง].

Proof sketch: Suppose ๐’œ๏ธ€โŠง๐น. We define ๐’œ๏ธ€โ€ฒ extending ๐’œ๏ธ€ such that ๐‘“๐’œ๏ธ€โ€ฒ(๐‘Ž1,โ€ฆ,๐‘Ž๐‘˜)โ‰”๐‘Ž, where ๐‘Ž is such that ๐’œ๏ธ€[๐‘ฆ1โ†ฆ๐‘Ž1]โ€ฆ[๐‘ฆ๐‘˜โ†ฆ๐‘Ž๐‘˜][๐‘ฅโ†ฆ๐‘Ž]โŠง๐บ.

Then ๐’œ๏ธ€โ€ฒโŠง๐นโ€ฒ.

Remark: If ๐‘˜=0, then ๐‘“ is a constant symbol.

Theorem 3.3.12: Any 1st-order formula ๐น is equisatisfiable with a formula in Skolem form.

Proof: We get ๐น in prenex form, and utilise Lemmaย 3.3.11 to eliminate existential quanitifiers from left to right.
Remark: The quantifier-free part of a Skolem-form formula is sometimes known as the matrix of the formula.

3.4. Herbrandโ€™s Theorem & Ground Resolution

Definition 3.4.1: A ground term (of ๐œŽ) is a variable-free term.

Definition 3.4.2: A ๐œŽ-structure โ„‹๏ธ€ is a Herband structure if the following are true:

  • ๐’ฐ๏ธ€โ„‹๏ธ€ is the set of ground terms
  • ๐‘โ„‹๏ธ€=๐‘ for every constant symbol ๐‘
  • For every ๐‘˜-ary function symbol ๐‘“ and ground terms ๐‘ก1,โ€ฆ,๐‘ก๐‘˜, ๐‘“โ„‹๏ธ€(๐‘ก1,โ€ฆ,๐‘ก๐‘˜)=๐‘“(๐‘ก1,โ€ฆ,๐‘ก๐‘˜)
Remark: The interpretations of constant and function symbols are just strings of symbols.
Remark: The only thing we are free to choose is the interpretation of predicate symbols.
Remark: The interpretation of a term in a Herbrand structure is โ„‹๏ธ€(๐‘ก)=๐‘ก.

Corollary 3.4.3 (translation lemma for Herbrand structures):

โ„‹๏ธ€โŠง๐น[๐‘ก/๐‘ฅ] iff โ„‹๏ธ€[๐‘ฅโ†ฆ๐‘ก]โŠง๐น.

Theorem 3.4.4 (Herbrand's theorem): Let ๐น=โˆ€๐‘ฅ1โ€ฆ๐‘ฅ๐‘˜๐นโˆ— be a closed formula in Skolem form. Then ๐น is satisfiable iff ๐น has a Herbrand model.

Proof:

โ€œโŸธโ€: obvious.

โ€œโŸนโ€: Suppose ๐’œ๏ธ€โŠง๐น. We define (๐‘ก1,โ€ฆ,๐‘ก๐‘›)โˆˆ๐‘ƒโ„‹๏ธ€ iff ๐’œ๏ธ€โŠง๐‘ƒ(๐‘ก1,โ€ฆ,๐‘ก๐‘›). Then we show that โ„‹๏ธ€ is a model of ๐น by induction on the number of quantifiers ๐‘˜.

If ๐‘˜=0, then ๐น is a Boolean combination of atomic formulae ๐‘ƒ(๐‘ก1,โ€ฆ,๐‘ก๐‘›) for ground terms ๐‘ก1,โ€ฆ,๐‘ก๐‘›. By construction, โ„‹๏ธ€โŠง๐‘ƒ(๐‘ก1,โ€ฆ,๐‘ก๐‘˜) iff ๐’œ๏ธ€โŠง๐‘ƒ(๐‘ก1,โ€ฆ,๐‘ก๐‘˜), so โ„‹๏ธ€โŠง๐น, iff ๐’œ๏ธ€โŠง๐น.

Then suppose true for Skolem-form sentences with ๐‘˜ quantifiers, and consider ๐น with ๐‘˜+1 quantifiers, where ๐น=โˆ€๐‘ฅ1๐บ. By the translation lemma, ๐’œ๏ธ€โŠง๐บ[๐‘ก/๐‘ฅ1] iff ๐’œ๏ธ€[๐‘ฅ1โ†ฆ๐’œ๏ธ€(๐‘ก)]โŠง๐บ. Hence ๐’œ๏ธ€โŠง๐บ[๐‘ก/๐‘ฅ1] for all ground terms ๐‘ก. ๐บ[๐‘ก/๐‘ฅ1] is closed, so by the i.h. โ„‹๏ธ€โŠง๐บ[๐‘ก/๐‘ฅ1] for all ground terms ๐‘ก. By the translation lemma, ๐’œ๏ธ€[๐‘ฅ1โ†ฆ๐‘ก]โŠง๐บ for all ๐‘กโˆˆ๐’ฐ๏ธ€โ„‹๏ธ€, hence โ„‹๏ธ€โŠงโˆ€๐‘ฅ1๐บ, .

Corollary 3.4.5: For any formula with an uncountable model, there is a countable model.

Definition 3.4.6: Let ๐น=โˆ€๐‘ฅ1โ€ฆโˆ€๐‘ฅ๐‘›๐นโˆ— be closed in Skolem form, and define the Herbrand expansion ๐ธ(๐น) to be

๐ธ(๐น)โ‰”{๐นโˆ—[๐‘ก1/๐‘ฅ1]โ€ฆ.[๐‘ก๐‘›/๐‘ฅ๐‘›]|๐‘ก1,โ€ฆ๐‘ก๐‘›are ground terms}.
Remark: Each formula in ๐ธ(๐น) is a Boolean combination of atomic formulae. This means that ๐ธ(๐น) has a Herbrand model iff it is propositionally satisfiable, i.e. there is an assignment to the set of closed atomic formulae that makes all formulae in ๐ธ(๐น) evaluate to true.

Theorem 3.4.7: A closed Skolem-form formula ๐นโ‰”โˆ€๐‘ฅ1โ€ฆโˆ€๐‘ฅ๐‘˜๐นโˆ— is satisfiable iff ๐ธ(๐น) is satisfiable when viewing atomic formulae as propositional variables.

Proof:

๐น sat. iff exists a Herbrand model โ„‹๏ธ€ of ๐น, by Herbrandโ€™s Theorem
iff โ„‹๏ธ€โŠง๐น
iff โ„‹๏ธ€([๐‘ฅ1โ†ฆ๐‘ก1]โ€ฆ[๐‘ฅ๐‘›โ†ฆ๐‘ก)๐‘›])โŠง๐นโˆ— for all ground terms ๐‘ก1,โ€ฆ,๐‘ก๐‘›โˆˆ๐’ฐ๏ธ€โ„‹๏ธ€
iff โ„‹๏ธ€โŠง๐นโˆ—[๐‘ก1/๐‘ฅ1]โ€ฆ[๐‘ก๐‘›/๐‘ฅ๐‘›], by the Translation Lemma for Herbrand structures
iff โ„‹๏ธ€โŠง๐ธ(๐น) by defn of Herbrand expansion
iff ๐ธ(๐น) is satisfiable, by Herbrandโ€™s Theorem.

Theorem 3.4.8 (Ground Resolution): A closed Skolem-form formula ๐น is unsatisfiable iff there is a propositional resolution refutation of ๐ธ(๐น).

Proof: TODO

Remark:

To prove validity of ๐น, we can provide a ground resolution refutation of ๐บโ‰”ยฌ๐น.

  • Transform into negation normal form
  • Transform into rectified prenex form
  • Skolemise
  • Transform into CNF
  • Do a propositional resolution proof on the Herband expansion
  • If โ–ก is derived, then ๐บ is unsatisfiable, so ๐น is valid

Example:

Let ๐น=(โˆ€๐‘ฅ(๐‘ƒ(๐‘ฅ)โ†’๐‘„(๐‘ฅ))โˆงโˆƒ๐‘ฅ๐‘ƒ(๐‘ฅ))โ†’โˆƒ๐‘ฅ๐‘„(๐‘ฅ), ๐บโ‰”ยฌ๐น.

๐บโ‰กโˆ€๐‘ฅ(๐‘ƒ(๐‘ฅ)โ†’๐‘„(๐‘ฅ)โˆงโˆƒ๐‘ฅ๐‘ƒ(๐‘ฅ)โˆงยฌโˆƒ๐‘ฅ๐‘„(๐‘ฅ)โ‰กโˆ€๐‘ฅ(ยฌ๐‘ƒ(๐‘ฅ)โˆง๐‘„(๐‘ฅ))โˆงโˆƒ๐‘ฅ๐‘ƒ(๐‘ฅ)โˆงโˆ€๐‘ฅยฌ๐‘„(๐‘ฅ)โ‰กโˆ€๐‘ฅ(ยฌ๐‘ƒ(๐‘ฅ)โˆจ๐‘„(๐‘ฅ))โˆงโˆƒ๐‘ฆ๐‘ƒ(๐‘ฆ)โˆงโˆ€๐‘งยฌ๐‘„(๐‘ง)โ‰กโˆ€๐‘ฅโˆƒ๐‘ฆโˆ€๐‘ง((ยฌ๐‘ƒ(๐‘ฅ)โˆจ๐‘„(๐‘ฅ))โˆง๐‘ƒ(๐‘ฆ)โˆงยฌ๐‘„(๐‘ง))equisat w/โˆ€๐‘ฅโˆ€๐‘ง((ยฌ๐‘ƒ(๐‘ฅ)โˆจ๐‘„(๐‘ฅ))โˆง๐‘ƒ(๐‘“(๐‘ฅ))โˆงยฌ๐‘„(๐‘ง))โ‰•๐ป

Note that the set of ground terms is empty because there are no constant symbols. However, we can introduce a fresh constant symbol ๐‘Ž, and now the set of ground terms is {๐‘Ž,๐‘“(๐‘Ž),๐‘“(๐‘“(๐‘Ž)),โ€ฆ}.

๐ธ(๐ป)={ยฌ๐‘ƒ(๐ด)โˆจ๐‘„(๐ด),๐‘ƒ(๐‘“(๐‘Ž)),ยฌ๐‘„(๐‘Ž),ยฌ๐‘ƒ(๐‘“(๐‘Ž))โˆจ๐‘„(๐‘“(๐‘Ž)),ยฌ๐‘„(๐‘“(๐‘Ž)),โ€ฆ}

TODO resolution refutation

3.5. Natural deduction and sequent calculus in 1st-order logic

Definition 3.5.1: We introduce new natural deduction proof rules for quantifiers:

  • Universal elimination:

  • Universal introduction:

    where ๐‘ is free and must not occur in any undischarged assumption on which the deduction of ๐ด(๐‘) relies.

  • Existential introduction:

  • Existential elimination:

    provided that ๐‘ does not occur in ๐ถ, and all assumptions [๐ด(๐‘)] must be discharged when โˆƒE is applied.

Example:

Definition 3.5.2: We extend the sequent calculus with new proof rules for quantifier.

  • Universal quantification:

    where the exclamation mark (!) indicates that ๐‘Ž must not occur in ฮ“,ฮ˜.

    • Existential quantification:

Example:

TODO IMPORTANT: exercise 22 (ground resolution), 23 (natural deduction), 26 (sequent calculus)