Introduction to Proof Theory Lecture 2 - Soundness and for propositional

Anupam Das & Thomas Powell

University of Copenhagen & Technische Universität Darmstadt

European Summer School on Logic, Language, and Information

Sofia University 14 August 2018

These slides are available at http://www.anupamdas.com/esslli18.

1 / 29 Outline

1 Structural induction

2 Soundness

3 Completeness

4 Compactness

5 Questions and exercises

2 / 29 This gives an inductive definition of a tree-like derivation: Definition A tree-like derivation of A from Γ is defined as follows:

• If A ∈ Γ then A is a tree-like F derivation of A from Γ.

• If A is an axiom then is a tree-like F derivation of A from Γ. A

• If π0 and π1 are tree-like derivations of A and A → B from Γ, then the following is a tree-like derivation of B from Γ:

π0 π1 A A → B (mp) B

NB: While tree-like derivations prove the same as usual ones, there can be a high cost in the size of the proof!

Inductive definitions of proofs

Recall that Tom mentioned that all proofs and derivations can be put into tree form.

3 / 29 NB: While tree-like derivations prove the same theorems as usual ones, there can be a high cost in the size of the proof!

Inductive definitions of proofs

Recall that Tom mentioned that all proofs and derivations can be put into tree form. This gives an inductive definition of a tree-like derivation: Definition A tree-like derivation of A from Γ is defined as follows:

• If A ∈ Γ then A is a tree-like F derivation of A from Γ.

• If A is an axiom then is a tree-like F derivation of A from Γ. A

• If π0 and π1 are tree-like derivations of A and A → B from Γ, then the following is a tree-like derivation of B from Γ:

π0 π1 A A → B (mp) B

3 / 29 Inductive definitions of proofs

Recall that Tom mentioned that all proofs and derivations can be put into tree form. This gives an inductive definition of a tree-like derivation: Definition A tree-like derivation of A from Γ is defined as follows:

• If A ∈ Γ then A is a tree-like F derivation of A from Γ.

• If A is an axiom then is a tree-like F derivation of A from Γ. A

• If π0 and π1 are tree-like derivations of A and A → B from Γ, then the following is a tree-like derivation of B from Γ:

π0 π1 A A → B (mp) B

NB: While tree-like derivations prove the same theorems as usual ones, there can be a high cost in the size of the proof!

3 / 29 Proposition (Structural induction) If P is some property of derivations such that: • P holds for every derivation A;

• P holds for every derivation ; A

• Whenever P holds for derivations π0 of A and π1 of B from Γ, P holds for:

π0 π1 A A → B (mp) B

Then P holds for all proofs.

Exercise: Reduce this proposition to strong induction on the length of a proof.

Structural induction

In logic (indeed, computer science), structural induction shows up all over the place. It can oten be seen as an instance of strong induction.

4 / 29 Exercise: Reduce this proposition to strong induction on the length of a proof.

Structural induction

In logic (indeed, computer science), structural induction shows up all over the place. It can oten be seen as an instance of strong induction. Proposition (Structural induction) If P is some property of derivations such that: • P holds for every derivation A;

• P holds for every derivation ; A

• Whenever P holds for derivations π0 of A and π1 of B from Γ, P holds for:

π0 π1 A A → B (mp) B

Then P holds for all proofs.

4 / 29 Structural induction

In logic (indeed, computer science), structural induction shows up all over the place. It can oten be seen as an instance of strong induction. Proposition (Structural induction) If P is some property of derivations such that: • P holds for every derivation A;

• P holds for every derivation ; A

• Whenever P holds for derivations π0 of A and π1 of B from Γ, P holds for:

π0 π1 A A → B (mp) B

Then P holds for all proofs.

Exercise: Reduce this proposition to strong induction on the length of a proof.

4 / 29 Outline

1 Structural induction

2 Soundness

3 Completeness

4 Compactness

5 Questions and exercises

5 / 29 According to its website, http://inutile.club/estatis/falso/, Falso has remarkable properties:

What’s wrong with Falso?

Let me introduce you to the Falso proof system, that extends F by a single axiom:

6 / 29 What’s wrong with Falso?

Let me introduce you to the Falso proof system, that extends F by a single axiom:

According to its website, http://inutile.club/estatis/falso/, Falso has remarkable properties:

6 / 29 A system S might also be called meaningful if it is consistent: • S does not prove ⊥. • S does not prove a contradiction. • S does not prove something!

In structural proof theory it is oten the dynamics of a proof system which gives it meaning: • Proof search in S corresponds to some computational process. • There is a normalisation procedure for proofs in S that corresponds to a computational process.

‘proofs as programs’.

Aside: On being meaningful

Proofs should be meaningful in a concrete sense. In particular, here we will insist that they only prove true things (‘soundness’).

7 / 29 In structural proof theory it is oten the dynamics of a proof system which gives it meaning: • Proof search in S corresponds to some computational process. • There is a normalisation procedure for proofs in S that corresponds to a computational process.

‘proofs as programs’.

Aside: On being meaningful

Proofs should be meaningful in a concrete sense. In particular, here we will insist that they only prove true things (‘soundness’). A system S might also be called meaningful if it is consistent: • S does not prove ⊥. • S does not prove a contradiction. • S does not prove something!

7 / 29 Aside: On being meaningful

Proofs should be meaningful in a concrete sense. In particular, here we will insist that they only prove true things (‘soundness’). A system S might also be called meaningful if it is consistent: • S does not prove ⊥. • S does not prove a contradiction. • S does not prove something!

In structural proof theory it is oten the dynamics of a proof system which gives it meaning: • Proof search in S corresponds to some computational process. • There is a normalisation procedure for proofs in S that corresponds to a computational process.

‘proofs as programs’.

7 / 29 We will prove this by structural induction on a derivation of A from Γ. For the base cases, we must verify the axioms. Here are tables for (wk) and (neg):

p q q → p p → (q → p) 0 0 1 1 p ¬p ¬¬p ¬¬p → p 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1

Proof implies truth

Recall that we write Γ  A if, for every assignment α : Prop → {0, 1}, if for every B ∈ Γ we have α(B) = 1 then α(A) = 1.

Theorem (Soundness) If Γ ` A then Γ  A.

8 / 29 For the base cases, we must verify the axioms. Here are truth tables for (wk) and (neg):

p q q → p p → (q → p) 0 0 1 1 p ¬p ¬¬p ¬¬p → p 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1

Proof implies truth

Recall that we write Γ  A if, for every assignment α : Prop → {0, 1}, if for every B ∈ Γ we have α(B) = 1 then α(A) = 1.

Theorem (Soundness) If Γ ` A then Γ  A. We will prove this by structural induction on a derivation of A from Γ.

8 / 29 Proof implies truth

Recall that we write Γ  A if, for every assignment α : Prop → {0, 1}, if for every B ∈ Γ we have α(B) = 1 then α(A) = 1.

Theorem (Soundness) If Γ ` A then Γ  A. We will prove this by structural induction on a derivation of A from Γ. For the base cases, we must verify the axioms. Here are truth tables for (wk) and (neg):

p q q → p p → (q → p) 0 0 1 1 p ¬p ¬¬p ¬¬p → p 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1

8 / 29 p q r A B C D C → D B → (C → D) 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1

Verification of axioms (continued)

For the axiom,

(dist) : ((p → (q → r)) → ((p → q) → (p → r)))

let us write: A : q → r C : p → q B : p → A D : p → r (so (dist) is B → (C → D))

9 / 29 Verification of axioms (continued)

For the axiom,

(dist) : ((p → (q → r)) → ((p → q) → (p → r)))

let us write: A : q → r C : p → q B : p → A D : p → r (so (dist) is B → (C → D))

p q r A B C D C → D B → (C → D) 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1

9 / 29 Exercise: Prove this for yourselves! Another way of structuring our inductive would be to have substitution as a bona fide rule: A (sub) σ(A) The proposition above would now just constitute one of our inductive cases. NB: While a substitution rule would yield an equivalent system to F in terms of provability, proofs can be much shorter.

A technicality: The substitution lemma

We should, for each our cases in an inductive argument, reason about all possible substitution instances of the axioms and rules. This technicality is taken care of by the following: Proposition If A is a and σ is a substitution, then σ(A) is also a tautology.

10 / 29 Another way of structuring our inductive argument would be to have substitution as a bona fide rule: A (sub) σ(A) The proposition above would now just constitute one of our inductive cases. NB: While a substitution rule would yield an equivalent system to F in terms of provability, proofs can be much shorter.

A technicality: The substitution lemma

We should, for each our cases in an inductive argument, reason about all possible substitution instances of the axioms and rules. This technicality is taken care of by the following: Proposition If A is a tautology and σ is a substitution, then σ(A) is also a tautology. Exercise: Prove this for yourselves!

10 / 29 NB: While a substitution rule would yield an equivalent system to F in terms of provability, proofs can be much shorter.

A technicality: The substitution lemma

We should, for each our cases in an inductive argument, reason about all possible substitution instances of the axioms and rules. This technicality is taken care of by the following: Proposition If A is a tautology and σ is a substitution, then σ(A) is also a tautology. Exercise: Prove this for yourselves! Another way of structuring our inductive argument would be to have substitution as a bona fide rule: A (sub) σ(A) The proposition above would now just constitute one of our inductive cases.

10 / 29 A technicality: The substitution lemma

We should, for each our cases in an inductive argument, reason about all possible substitution instances of the axioms and rules. This technicality is taken care of by the following: Proposition If A is a tautology and σ is a substitution, then σ(A) is also a tautology. Exercise: Prove this for yourselves! Another way of structuring our inductive argument would be to have substitution as a bona fide rule: A (sub) σ(A) The proposition above would now just constitute one of our inductive cases. NB: While a substitution rule would yield an equivalent system to F in terms of provability, proofs can be much shorter.

10 / 29 Proposition (Verifying ) If A and A → B are tautologies, then so is B.

Proof. Let α be an assignment. We have,

1 = α(A → B) by assumption = α(A) → α(B) by definition = 1 → α(B) by assumption = α(B) by inspection of the truth table for →

as required.

This completes our proof of the soundness theorem. In fact: Corollary () There is no formula A such that ` A and ` ¬A.

Inductive step

11 / 29 Proof. Let α be an assignment. We have,

1 = α(A → B) by assumption = α(A) → α(B) by definition = 1 → α(B) by assumption = α(B) by inspection of the truth table for →

as required.

This completes our proof of the soundness theorem. In fact: Corollary (Consistency) There is no formula A such that ` A and ` ¬A.

Inductive step

Proposition (Verifying modus ponens) If A and A → B are tautologies, then so is B.

11 / 29 This completes our proof of the soundness theorem. In fact: Corollary (Consistency) There is no formula A such that ` A and ` ¬A.

Inductive step

Proposition (Verifying modus ponens) If A and A → B are tautologies, then so is B.

Proof. Let α be an assignment. We have,

1 = α(A → B) by assumption = α(A) → α(B) by definition = 1 → α(B) by assumption = α(B) by inspection of the truth table for →

as required.

11 / 29 In fact: Corollary (Consistency) There is no formula A such that ` A and ` ¬A.

Inductive step

Proposition (Verifying modus ponens) If A and A → B are tautologies, then so is B.

Proof. Let α be an assignment. We have,

1 = α(A → B) by assumption = α(A) → α(B) by definition = 1 → α(B) by assumption = α(B) by inspection of the truth table for →

as required.

This completes our proof of the soundness theorem.

11 / 29 Inductive step

Proposition (Verifying modus ponens) If A and A → B are tautologies, then so is B.

Proof. Let α be an assignment. We have,

1 = α(A → B) by assumption = α(A) → α(B) by definition = 1 → α(B) by assumption = α(B) by inspection of the truth table for →

as required.

This completes our proof of the soundness theorem. In fact: Corollary (Consistency) There is no formula A such that ` A and ` ¬A.

11 / 29 Outline

1 Structural induction

2 Soundness

3 Completeness

4 Compactness

5 Questions and exercises

12 / 29 Consider the sound system consisting of the following single axiom and no rules:

p → p What’s wrong with this?

Proviso: proofs should give us nontrivial insight. Proofs are nondeterministic algorithms, so they should admit the ability to make ‘clever choices’. In the setting of pure logic, we can actually achieve the full of soundness: Theorem (Completeness) If Γ  A then Γ ` A.

This is much more dificult to prove than soundness. While simple proofs are known, we give a general method that works (almost) always.

A converse desideratum

13 / 29 What’s wrong with this?

Proviso: proofs should give us nontrivial insight. Proofs are nondeterministic algorithms, so they should admit the ability to make ‘clever choices’. In the setting of pure logic, we can actually achieve the full converse of soundness: Theorem (Completeness) If Γ  A then Γ ` A.

This is much more dificult to prove than soundness. While simple proofs are known, we give a general method that works (almost) always.

A converse desideratum

Consider the sound system consisting of the following single axiom and no rules:

p → p

13 / 29 Proviso: proofs should give us nontrivial insight. Proofs are nondeterministic algorithms, so they should admit the ability to make ‘clever choices’. In the setting of pure logic, we can actually achieve the full converse of soundness: Theorem (Completeness) If Γ  A then Γ ` A.

This is much more dificult to prove than soundness. While simple proofs are known, we give a general method that works (almost) always.

A converse desideratum

Consider the sound system consisting of the following single axiom and no rules:

p → p What’s wrong with this?

13 / 29 In the setting of pure logic, we can actually achieve the full converse of soundness: Theorem (Completeness) If Γ  A then Γ ` A.

This is much more dificult to prove than soundness. While simple proofs are known, we give a general method that works (almost) always.

A converse desideratum

Consider the sound system consisting of the following single axiom and no rules:

p → p What’s wrong with this?

Proviso: proofs should give us nontrivial insight. Proofs are nondeterministic algorithms, so they should admit the ability to make ‘clever choices’.

13 / 29 This is much more dificult to prove than soundness. While simple proofs are known, we give a general method that works (almost) always.

A converse desideratum

Consider the sound system consisting of the following single axiom and no rules:

p → p What’s wrong with this?

Proviso: proofs should give us nontrivial insight. Proofs are nondeterministic algorithms, so they should admit the ability to make ‘clever choices’. In the setting of pure logic, we can actually achieve the full converse of soundness: Theorem (Completeness) If Γ  A then Γ ` A.

13 / 29 A converse desideratum

Consider the sound system consisting of the following single axiom and no rules:

p → p What’s wrong with this?

Proviso: proofs should give us nontrivial insight. Proofs are nondeterministic algorithms, so they should admit the ability to make ‘clever choices’. In the setting of pure logic, we can actually achieve the full converse of soundness: Theorem (Completeness) If Γ  A then Γ ` A.

This is much more dificult to prove than soundness. While simple proofs are known, we give a general method that works (almost) always.

13 / 29 Typically, when proving metalogical results like completeness, we use the contrapositive formulation,

Γ 0 A =⇒ Γ 2 A which, by (neg) and deduction, is equivalent to:

Γ, ¬A 0 ⊥ =⇒ Γ, ¬A 2 ⊥

Let us call a set of formulae Γ is called consistent if Γ 0 ⊥, or equivalently for no formula A, Γ ` A and Γ ` ¬A.(Q: Why are these equivalent?) Thus, completeness is a consequence of the following: Theorem (Reformulation of Completeness) If Γ is consistent then Γ is satisfiable.

Exercise: Show that this reformulation, conversely, implies completeness.

Reformulating completeness

14 / 29 Let us call a set of formulae Γ is called consistent if Γ 0 ⊥, or equivalently for no formula A, Γ ` A and Γ ` ¬A.(Q: Why are these equivalent?) Thus, completeness is a consequence of the following: Theorem (Reformulation of Completeness) If Γ is consistent then Γ is satisfiable.

Exercise: Show that this reformulation, conversely, implies completeness.

Reformulating completeness

Typically, when proving metalogical results like completeness, we use the contrapositive formulation,

Γ 0 A =⇒ Γ 2 A which, by (neg) and deduction, is equivalent to:

Γ, ¬A 0 ⊥ =⇒ Γ, ¬A 2 ⊥

14 / 29 Thus, completeness is a consequence of the following: Theorem (Reformulation of Completeness) If Γ is consistent then Γ is satisfiable.

Exercise: Show that this reformulation, conversely, implies completeness.

Reformulating completeness

Typically, when proving metalogical results like completeness, we use the contrapositive formulation,

Γ 0 A =⇒ Γ 2 A which, by (neg) and deduction, is equivalent to:

Γ, ¬A 0 ⊥ =⇒ Γ, ¬A 2 ⊥

Let us call a set of formulae Γ is called consistent if Γ 0 ⊥, or equivalently for no formula A, Γ ` A and Γ ` ¬A.(Q: Why are these equivalent?)

14 / 29 Exercise: Show that this reformulation, conversely, implies completeness.

Reformulating completeness

Typically, when proving metalogical results like completeness, we use the contrapositive formulation,

Γ 0 A =⇒ Γ 2 A which, by (neg) and deduction, is equivalent to:

Γ, ¬A 0 ⊥ =⇒ Γ, ¬A 2 ⊥

Let us call a set of formulae Γ is called consistent if Γ 0 ⊥, or equivalently for no formula A, Γ ` A and Γ ` ¬A.(Q: Why are these equivalent?) Thus, completeness is a consequence of the following: Theorem (Reformulation of Completeness) If Γ is consistent then Γ is satisfiable.

14 / 29 Reformulating completeness

Typically, when proving metalogical results like completeness, we use the contrapositive formulation,

Γ 0 A =⇒ Γ 2 A which, by (neg) and deduction, is equivalent to:

Γ, ¬A 0 ⊥ =⇒ Γ, ¬A 2 ⊥

Let us call a set of formulae Γ is called consistent if Γ 0 ⊥, or equivalently for no formula A, Γ ` A and Γ ` ¬A.(Q: Why are these equivalent?) Thus, completeness is a consequence of the following: Theorem (Reformulation of Completeness) If Γ is consistent then Γ is satisfiable.

Exercise: Show that this reformulation, conversely, implies completeness.

14 / 29 NB: Soundness established that, in particular, ∅ is consistent. Lemma (Lindenbaum) For every consistent set of formulae Γ, there is a maximally consistent set Γ0 ⊇ Γ.

Proof.

Note that the set Form of formulae is countable, so let (Ai)i∈N be an enumeration of all the formulae.

Define Γ0 := Γ and inductively define Γi+1 as follows: ( Γi ∪ {Ai} if Γi ` Ai Γi+1 := Γi ∪ {¬Ai} otherwise

The point is to always define Γi such that it is consistent....

Maximally consistent sets

Definition (Maximal consistency) Γ is called maximally consistent if it is consistent and, for any formula A ∈/ Γ, Γ ∪ {A} is not consistent.

15 / 29 Lemma (Lindenbaum) For every consistent set of formulae Γ, there is a maximally consistent set Γ0 ⊇ Γ.

Proof.

Note that the set Form of formulae is countable, so let (Ai)i∈N be an enumeration of all the formulae.

Define Γ0 := Γ and inductively define Γi+1 as follows: ( Γi ∪ {Ai} if Γi ` Ai Γi+1 := Γi ∪ {¬Ai} otherwise

The point is to always define Γi such that it is consistent....

Maximally consistent sets

Definition (Maximal consistency) Γ is called maximally consistent if it is consistent and, for any formula A ∈/ Γ, Γ ∪ {A} is not consistent.

NB: Soundness established that, in particular, ∅ is consistent.

15 / 29 Proof.

Note that the set Form of formulae is countable, so let (Ai)i∈N be an enumeration of all the formulae.

Define Γ0 := Γ and inductively define Γi+1 as follows: ( Γi ∪ {Ai} if Γi ` Ai Γi+1 := Γi ∪ {¬Ai} otherwise

The point is to always define Γi such that it is consistent....

Maximally consistent sets

Definition (Maximal consistency) Γ is called maximally consistent if it is consistent and, for any formula A ∈/ Γ, Γ ∪ {A} is not consistent.

NB: Soundness established that, in particular, ∅ is consistent. Lemma (Lindenbaum) For every consistent set of formulae Γ, there is a maximally consistent set Γ0 ⊇ Γ.

15 / 29 Define Γ0 := Γ and inductively define Γi+1 as follows: ( Γi ∪ {Ai} if Γi ` Ai Γi+1 := Γi ∪ {¬Ai} otherwise

The point is to always define Γi such that it is consistent....

Maximally consistent sets

Definition (Maximal consistency) Γ is called maximally consistent if it is consistent and, for any formula A ∈/ Γ, Γ ∪ {A} is not consistent.

NB: Soundness established that, in particular, ∅ is consistent. Lemma (Lindenbaum) For every consistent set of formulae Γ, there is a maximally consistent set Γ0 ⊇ Γ.

Proof.

Note that the set Form of formulae is countable, so let (Ai)i∈N be an enumeration of all the formulae.

15 / 29 The point is to always define Γi such that it is consistent....

Maximally consistent sets

Definition (Maximal consistency) Γ is called maximally consistent if it is consistent and, for any formula A ∈/ Γ, Γ ∪ {A} is not consistent.

NB: Soundness established that, in particular, ∅ is consistent. Lemma (Lindenbaum) For every consistent set of formulae Γ, there is a maximally consistent set Γ0 ⊇ Γ.

Proof.

Note that the set Form of formulae is countable, so let (Ai)i∈N be an enumeration of all the formulae.

Define Γ0 := Γ and inductively define Γi+1 as follows: ( Γi ∪ {Ai} if Γi ` Ai Γi+1 := Γi ∪ {¬Ai} otherwise

15 / 29 Maximally consistent sets

Definition (Maximal consistency) Γ is called maximally consistent if it is consistent and, for any formula A ∈/ Γ, Γ ∪ {A} is not consistent.

NB: Soundness established that, in particular, ∅ is consistent. Lemma (Lindenbaum) For every consistent set of formulae Γ, there is a maximally consistent set Γ0 ⊇ Γ.

Proof.

Note that the set Form of formulae is countable, so let (Ai)i∈N be an enumeration of all the formulae.

Define Γ0 := Γ and inductively define Γi+1 as follows: ( Γi ∪ {Ai} if Γi ` Ai Γi+1 := Γi ∪ {¬Ai} otherwise

The point is to always define Γi such that it is consistent....

15 / 29 Proof. By induction on i. For the base case we have Γ0 = Γ which is consistent by assumption. For the inductive step, suppose Γi is consistent.

• If Γi ` Ai then Γi+1 = Γi ∪ {Ai}. So if Γi+1 is inconsistent, i.e. Γi, Ai ` ⊥, then Γi ` ¬Ai by deduction, implying that Γi is already inconsistent.

• If Γi 0 Ai then Γi+1 = Γi ∪ {¬Ai}. So if Γi+1 is inconsistent, i.e. Γi, ¬Ai ` ⊥, then Γi ` ¬¬Ai by deduction, and so Γi ` Ai by (neg).

Consistency in the Lindenbaum construction

Proposition For i ∈ N, each Γi is consistent.

16 / 29 For the base case we have Γ0 = Γ which is consistent by assumption. For the inductive step, suppose Γi is consistent.

• If Γi ` Ai then Γi+1 = Γi ∪ {Ai}. So if Γi+1 is inconsistent, i.e. Γi, Ai ` ⊥, then Γi ` ¬Ai by deduction, implying that Γi is already inconsistent.

• If Γi 0 Ai then Γi+1 = Γi ∪ {¬Ai}. So if Γi+1 is inconsistent, i.e. Γi, ¬Ai ` ⊥, then Γi ` ¬¬Ai by deduction, and so Γi ` Ai by (neg).

Consistency in the Lindenbaum construction

Proposition For i ∈ N, each Γi is consistent. Proof. By induction on i.

16 / 29 • If Γi 0 Ai then Γi+1 = Γi ∪ {¬Ai}. So if Γi+1 is inconsistent, i.e. Γi, ¬Ai ` ⊥, then Γi ` ¬¬Ai by deduction, and so Γi ` Ai by (neg).

Consistency in the Lindenbaum construction

Proposition For i ∈ N, each Γi is consistent. Proof. By induction on i. For the base case we have Γ0 = Γ which is consistent by assumption. For the inductive step, suppose Γi is consistent.

• If Γi ` Ai then Γi+1 = Γi ∪ {Ai}. So if Γi+1 is inconsistent, i.e. Γi, Ai ` ⊥, then Γi ` ¬Ai by deduction, implying that Γi is already inconsistent.

16 / 29 Consistency in the Lindenbaum construction

Proposition For i ∈ N, each Γi is consistent. Proof. By induction on i. For the base case we have Γ0 = Γ which is consistent by assumption. For the inductive step, suppose Γi is consistent.

• If Γi ` Ai then Γi+1 = Γi ∪ {Ai}. So if Γi+1 is inconsistent, i.e. Γi, Ai ` ⊥, then Γi ` ¬Ai by deduction, implying that Γi is already inconsistent.

• If Γi 0 Ai then Γi+1 = Γi ∪ {¬Ai}. So if Γi+1 is inconsistent, i.e. Γi, ¬Ai ` ⊥, then Γi ` ¬¬Ai by deduction, and so Γi ` Ai by (neg).

16 / 29 A consequence of the notion of proof is that consistency is preserved at limits: Proposition

If (∆i)i∈ is a consistent sequence of sets of formulae s.t. ∆0 ⊆ ∆1 ⊆ · · · , then SN ∆ := ∆i is also consistent. i∈N Proof sketch. Since proofs are finite objects, only a finite number of hypotheses from ∆ may be used in proofs of A and ¬A, which means that any contradiction would already be derivable from ∆i for some i ∈ N.

Limits of consistent chains

17 / 29 Proof sketch. Since proofs are finite objects, only a finite number of hypotheses from ∆ may be used in proofs of A and ¬A, which means that any contradiction would already be derivable from ∆i for some i ∈ N.

Limits of consistent chains

A consequence of the notion of proof is that consistency is preserved at limits: Proposition

If (∆i)i∈ is a consistent sequence of sets of formulae s.t. ∆0 ⊆ ∆1 ⊆ · · · , then SN ∆ := ∆i is also consistent. i∈N

17 / 29 Limits of consistent chains

A consequence of the notion of proof is that consistency is preserved at limits: Proposition

If (∆i)i∈ is a consistent sequence of sets of formulae s.t. ∆0 ⊆ ∆1 ⊆ · · · , then SN ∆ := ∆i is also consistent. i∈N Proof sketch. Since proofs are finite objects, only a finite number of hypotheses from ∆ may be used in proofs of A and ¬A, which means that any contradiction would already be derivable from ∆i for some i ∈ N.

17 / 29 Proposition (Maximality) Γ0 is maximally consistent.

Proof. Suppose there is a formula A ∈/ Γ0 such that Γ0 ∪ {A} is consistent. By assumption, A = Ak for some k ∈ N. We have ( 0 Γk ∪ {A} if Γk ` A Γ ⊇ Γk+1 = Γk ∪ {¬A} otherwise

0 • If Γk ` A then by definition A ∈ Γk+1 ⊆ Γ , contradiction. 0 0 • If Γk 0 A then by definition ¬A ∈ Γk+1 ⊆ Γ . But then Γ ` ¬A and so Γ0 ∪ {A} is not consistent, again a contradiction.

This completes the proof of Lindenbaum’s lemma.

Maximality in the Lindenbaum construction

0 S Let Γ := Γi i∈N

18 / 29 Proof. Suppose there is a formula A ∈/ Γ0 such that Γ0 ∪ {A} is consistent. By assumption, A = Ak for some k ∈ N. We have ( 0 Γk ∪ {A} if Γk ` A Γ ⊇ Γk+1 = Γk ∪ {¬A} otherwise

0 • If Γk ` A then by definition A ∈ Γk+1 ⊆ Γ , contradiction. 0 0 • If Γk 0 A then by definition ¬A ∈ Γk+1 ⊆ Γ . But then Γ ` ¬A and so Γ0 ∪ {A} is not consistent, again a contradiction.

This completes the proof of Lindenbaum’s lemma.

Maximality in the Lindenbaum construction

0 S Let Γ := Γi i∈N Proposition (Maximality) Γ0 is maximally consistent.

18 / 29 We have ( 0 Γk ∪ {A} if Γk ` A Γ ⊇ Γk+1 = Γk ∪ {¬A} otherwise

0 • If Γk ` A then by definition A ∈ Γk+1 ⊆ Γ , contradiction. 0 0 • If Γk 0 A then by definition ¬A ∈ Γk+1 ⊆ Γ . But then Γ ` ¬A and so Γ0 ∪ {A} is not consistent, again a contradiction.

This completes the proof of Lindenbaum’s lemma.

Maximality in the Lindenbaum construction

0 S Let Γ := Γi i∈N Proposition (Maximality) Γ0 is maximally consistent.

Proof. Suppose there is a formula A ∈/ Γ0 such that Γ0 ∪ {A} is consistent. By assumption, A = Ak for some k ∈ N.

18 / 29 0 • If Γk ` A then by definition A ∈ Γk+1 ⊆ Γ , contradiction. 0 0 • If Γk 0 A then by definition ¬A ∈ Γk+1 ⊆ Γ . But then Γ ` ¬A and so Γ0 ∪ {A} is not consistent, again a contradiction.

This completes the proof of Lindenbaum’s lemma.

Maximality in the Lindenbaum construction

0 S Let Γ := Γi i∈N Proposition (Maximality) Γ0 is maximally consistent.

Proof. Suppose there is a formula A ∈/ Γ0 such that Γ0 ∪ {A} is consistent. By assumption, A = Ak for some k ∈ N. We have ( 0 Γk ∪ {A} if Γk ` A Γ ⊇ Γk+1 = Γk ∪ {¬A} otherwise

18 / 29 0 0 • If Γk 0 A then by definition ¬A ∈ Γk+1 ⊆ Γ . But then Γ ` ¬A and so Γ0 ∪ {A} is not consistent, again a contradiction.

This completes the proof of Lindenbaum’s lemma.

Maximality in the Lindenbaum construction

0 S Let Γ := Γi i∈N Proposition (Maximality) Γ0 is maximally consistent.

Proof. Suppose there is a formula A ∈/ Γ0 such that Γ0 ∪ {A} is consistent. By assumption, A = Ak for some k ∈ N. We have ( 0 Γk ∪ {A} if Γk ` A Γ ⊇ Γk+1 = Γk ∪ {¬A} otherwise

0 • If Γk ` A then by definition A ∈ Γk+1 ⊆ Γ , contradiction.

18 / 29 This completes the proof of Lindenbaum’s lemma.

Maximality in the Lindenbaum construction

0 S Let Γ := Γi i∈N Proposition (Maximality) Γ0 is maximally consistent.

Proof. Suppose there is a formula A ∈/ Γ0 such that Γ0 ∪ {A} is consistent. By assumption, A = Ak for some k ∈ N. We have ( 0 Γk ∪ {A} if Γk ` A Γ ⊇ Γk+1 = Γk ∪ {¬A} otherwise

0 • If Γk ` A then by definition A ∈ Γk+1 ⊆ Γ , contradiction. 0 0 • If Γk 0 A then by definition ¬A ∈ Γk+1 ⊆ Γ . But then Γ ` ¬A and so Γ0 ∪ {A} is not consistent, again a contradiction.

18 / 29 Maximality in the Lindenbaum construction

0 S Let Γ := Γi i∈N Proposition (Maximality) Γ0 is maximally consistent.

Proof. Suppose there is a formula A ∈/ Γ0 such that Γ0 ∪ {A} is consistent. By assumption, A = Ak for some k ∈ N. We have ( 0 Γk ∪ {A} if Γk ` A Γ ⊇ Γk+1 = Γk ∪ {¬A} otherwise

0 • If Γk ` A then by definition A ∈ Γk+1 ⊆ Γ , contradiction. 0 0 • If Γk 0 A then by definition ¬A ∈ Γk+1 ⊆ Γ . But then Γ ` ¬A and so Γ0 ∪ {A} is not consistent, again a contradiction.

This completes the proof of Lindenbaum’s lemma.

18 / 29 Theorem (Reformulation of completeness, again) Any consistent set has a satisfying assignment.

Proof. Let Γ be consistent and Γ0 ⊇ Γ be a maximally consistent superset. By maximal consistency, for each p ∈ Prop we have that p ∈ Γ0 or ¬p ∈ Γ0. Define: ( 0 ¬p ∈ Γ0 α(p) := 1 p ∈ Γ0

By the soundness result, we thus have that α(A) = 1 for any A ∈ Γ0, i.e. Γ0 is satisfiable. Recall that this gives us the completeness result: Theorem (Completeness, again) If Γ  A then Γ ` A.

Completeness from Lindenbaum

19 / 29 Proof. Let Γ be consistent and Γ0 ⊇ Γ be a maximally consistent superset. By maximal consistency, for each p ∈ Prop we have that p ∈ Γ0 or ¬p ∈ Γ0. Define: ( 0 ¬p ∈ Γ0 α(p) := 1 p ∈ Γ0

By the soundness result, we thus have that α(A) = 1 for any A ∈ Γ0, i.e. Γ0 is satisfiable. Recall that this gives us the completeness result: Theorem (Completeness, again) If Γ  A then Γ ` A.

Completeness from Lindenbaum

Theorem (Reformulation of completeness, again) Any consistent set has a satisfying assignment.

19 / 29 By maximal consistency, for each p ∈ Prop we have that p ∈ Γ0 or ¬p ∈ Γ0. Define: ( 0 ¬p ∈ Γ0 α(p) := 1 p ∈ Γ0

By the soundness result, we thus have that α(A) = 1 for any A ∈ Γ0, i.e. Γ0 is satisfiable. Recall that this gives us the completeness result: Theorem (Completeness, again) If Γ  A then Γ ` A.

Completeness from Lindenbaum

Theorem (Reformulation of completeness, again) Any consistent set has a satisfying assignment.

Proof. Let Γ be consistent and Γ0 ⊇ Γ be a maximally consistent superset.

19 / 29 Define: ( 0 ¬p ∈ Γ0 α(p) := 1 p ∈ Γ0

By the soundness result, we thus have that α(A) = 1 for any A ∈ Γ0, i.e. Γ0 is satisfiable. Recall that this gives us the completeness result: Theorem (Completeness, again) If Γ  A then Γ ` A.

Completeness from Lindenbaum

Theorem (Reformulation of completeness, again) Any consistent set has a satisfying assignment.

Proof. Let Γ be consistent and Γ0 ⊇ Γ be a maximally consistent superset. By maximal consistency, for each p ∈ Prop we have that p ∈ Γ0 or ¬p ∈ Γ0.

19 / 29 By the soundness result, we thus have that α(A) = 1 for any A ∈ Γ0, i.e. Γ0 is satisfiable. Recall that this gives us the completeness result: Theorem (Completeness, again) If Γ  A then Γ ` A.

Completeness from Lindenbaum

Theorem (Reformulation of completeness, again) Any consistent set has a satisfying assignment.

Proof. Let Γ be consistent and Γ0 ⊇ Γ be a maximally consistent superset. By maximal consistency, for each p ∈ Prop we have that p ∈ Γ0 or ¬p ∈ Γ0. Define: ( 0 ¬p ∈ Γ0 α(p) := 1 p ∈ Γ0

19 / 29 Recall that this gives us the completeness result: Theorem (Completeness, again) If Γ  A then Γ ` A.

Completeness from Lindenbaum

Theorem (Reformulation of completeness, again) Any consistent set has a satisfying assignment.

Proof. Let Γ be consistent and Γ0 ⊇ Γ be a maximally consistent superset. By maximal consistency, for each p ∈ Prop we have that p ∈ Γ0 or ¬p ∈ Γ0. Define: ( 0 ¬p ∈ Γ0 α(p) := 1 p ∈ Γ0

By the soundness result, we thus have that α(A) = 1 for any A ∈ Γ0, i.e. Γ0 is satisfiable.

19 / 29 Completeness from Lindenbaum

Theorem (Reformulation of completeness, again) Any consistent set has a satisfying assignment.

Proof. Let Γ be consistent and Γ0 ⊇ Γ be a maximally consistent superset. By maximal consistency, for each p ∈ Prop we have that p ∈ Γ0 or ¬p ∈ Γ0. Define: ( 0 ¬p ∈ Γ0 α(p) := 1 p ∈ Γ0

By the soundness result, we thus have that α(A) = 1 for any A ∈ Γ0, i.e. Γ0 is satisfiable. Recall that this gives us the completeness result: Theorem (Completeness, again) If Γ  A then Γ ` A.

19 / 29 However it is striking in its generality. Similar methods work for: • First-order logic with respect to Henkin models. (next lecture!) • Modal logic with respect to frame properties. • Intuitionistic and intermediate with respect to frame properties.

In all these cases, it is usually the construction of a ‘model’ from a maximally consistent set that is dificult.

Generality of this method

The completeness method we outlined here was, to be honest, a little overkill for classical propositional logic.

20 / 29 Similar methods work for: • First-order logic with respect to Henkin models. (next lecture!) • Modal logic with respect to frame properties. • Intuitionistic and intermediate logics with respect to frame properties.

In all these cases, it is usually the construction of a ‘model’ from a maximally consistent set that is dificult.

Generality of this method

The completeness method we outlined here was, to be honest, a little overkill for classical propositional logic. However it is striking in its generality.

20 / 29 In all these cases, it is usually the construction of a ‘model’ from a maximally consistent set that is dificult.

Generality of this method

The completeness method we outlined here was, to be honest, a little overkill for classical propositional logic. However it is striking in its generality. Similar methods work for: • First-order logic with respect to Henkin models. (next lecture!) • Modal logic with respect to frame properties. • Intuitionistic and intermediate logics with respect to frame properties.

20 / 29 Generality of this method

The completeness method we outlined here was, to be honest, a little overkill for classical propositional logic. However it is striking in its generality. Similar methods work for: • First-order logic with respect to Henkin models. (next lecture!) • Modal logic with respect to frame properties. • Intuitionistic and intermediate logics with respect to frame properties.

In all these cases, it is usually the construction of a ‘model’ from a maximally consistent set that is dificult.

20 / 29 Outline

1 Structural induction

2 Soundness

3 Completeness

4 Compactness

5 Questions and exercises

21 / 29 We say that a set Γ is finitely satisfiable if every finite subset Γ0 ⊆ Γ is satisfiable. Theorem (Compactness) Every finitely satisfiable set Γ is, in fact, satisfiable.

Proof. We prove the contrapositive. Suppose Γ is not satisfiable, then by completeness it is inconsistent. However, again since proofs are finite, that means that this inconsistency can be derived from a finite subset Γ0 ⊆ Γ. By the soundness theorem it follows that Γ0 is not satisfiable.

Example format of an application of compactness: • For each n ∈ N it is possible to toss a coin n times and get heads each time. • Thus, by compactness, it is possible to toss a coin forever and only get heads! NB: In the propositional case, this is just an instance of the more general Tychonof compactness theorem from topology.

A curious corollary of completeness...

The following result is both simple and remarkably useful:

22 / 29 Proof. We prove the contrapositive. Suppose Γ is not satisfiable, then by completeness it is inconsistent. However, again since proofs are finite, that means that this inconsistency can be derived from a finite subset Γ0 ⊆ Γ. By the soundness theorem it follows that Γ0 is not satisfiable.

Example format of an application of compactness: • For each n ∈ N it is possible to toss a coin n times and get heads each time. • Thus, by compactness, it is possible to toss a coin forever and only get heads! NB: In the propositional case, this is just an instance of the more general Tychonof compactness theorem from topology.

A curious corollary of completeness...

The following result is both simple and remarkably useful: We say that a set Γ is finitely satisfiable if every finite subset Γ0 ⊆ Γ is satisfiable. Theorem (Compactness) Every finitely satisfiable set Γ is, in fact, satisfiable.

22 / 29 However, again since proofs are finite, that means that this inconsistency can be derived from a finite subset Γ0 ⊆ Γ. By the soundness theorem it follows that Γ0 is not satisfiable.

Example format of an application of compactness: • For each n ∈ N it is possible to toss a coin n times and get heads each time. • Thus, by compactness, it is possible to toss a coin forever and only get heads! NB: In the propositional case, this is just an instance of the more general Tychonof compactness theorem from topology.

A curious corollary of completeness...

The following result is both simple and remarkably useful: We say that a set Γ is finitely satisfiable if every finite subset Γ0 ⊆ Γ is satisfiable. Theorem (Compactness) Every finitely satisfiable set Γ is, in fact, satisfiable.

Proof. We prove the contrapositive. Suppose Γ is not satisfiable, then by completeness it is inconsistent.

22 / 29 Example format of an application of compactness: • For each n ∈ N it is possible to toss a coin n times and get heads each time. • Thus, by compactness, it is possible to toss a coin forever and only get heads! NB: In the propositional case, this is just an instance of the more general Tychonof compactness theorem from topology.

A curious corollary of completeness...

The following result is both simple and remarkably useful: We say that a set Γ is finitely satisfiable if every finite subset Γ0 ⊆ Γ is satisfiable. Theorem (Compactness) Every finitely satisfiable set Γ is, in fact, satisfiable.

Proof. We prove the contrapositive. Suppose Γ is not satisfiable, then by completeness it is inconsistent. However, again since proofs are finite, that means that this inconsistency can be derived from a finite subset Γ0 ⊆ Γ. By the soundness theorem it follows that Γ0 is not satisfiable.

22 / 29 NB: In the propositional case, this is just an instance of the more general Tychonof compactness theorem from topology.

A curious corollary of completeness...

The following result is both simple and remarkably useful: We say that a set Γ is finitely satisfiable if every finite subset Γ0 ⊆ Γ is satisfiable. Theorem (Compactness) Every finitely satisfiable set Γ is, in fact, satisfiable.

Proof. We prove the contrapositive. Suppose Γ is not satisfiable, then by completeness it is inconsistent. However, again since proofs are finite, that means that this inconsistency can be derived from a finite subset Γ0 ⊆ Γ. By the soundness theorem it follows that Γ0 is not satisfiable.

Example format of an application of compactness: • For each n ∈ N it is possible to toss a coin n times and get heads each time. • Thus, by compactness, it is possible to toss a coin forever and only get heads!

22 / 29 A curious corollary of completeness...

The following result is both simple and remarkably useful: We say that a set Γ is finitely satisfiable if every finite subset Γ0 ⊆ Γ is satisfiable. Theorem (Compactness) Every finitely satisfiable set Γ is, in fact, satisfiable.

Proof. We prove the contrapositive. Suppose Γ is not satisfiable, then by completeness it is inconsistent. However, again since proofs are finite, that means that this inconsistency can be derived from a finite subset Γ0 ⊆ Γ. By the soundness theorem it follows that Γ0 is not satisfiable.

Example format of an application of compactness: • For each n ∈ N it is possible to toss a coin n times and get heads each time. • Thus, by compactness, it is possible to toss a coin forever and only get heads! NB: In the propositional case, this is just an instance of the more general Tychonof compactness theorem from topology.

22 / 29 Definition (Orders) A partial order is a structure (X, ≤) such that, for all x, y, z ∈ X: • x ≤ x. • x ≤ y, y ≤ x =⇒ x = y. • x ≤ y, y ≤ z =⇒ x ≤ z. If, furthermore, for all x, y ∈ X either x ≤ y or y ≤ x, then we say that (X, ≤) is a total order.

Example

• (N, ≤) is a total order with a minimum element, 0. • (R, ≤) is a total order that is dense: whenever x < y there is z s.t. x < y < z. • (P(N), ⊆) is a partial order that is not total, but has a minimum element ∅ and a maximum element N. • (A∗, ) is a partial order that is not total, but has a minimum element ε.

Partial orders

23 / 29 Example

• (N, ≤) is a total order with a minimum element, 0. • (R, ≤) is a total order that is dense: whenever x < y there is z s.t. x < y < z. • (P(N), ⊆) is a partial order that is not total, but has a minimum element ∅ and a maximum element N. • (A∗, ) is a partial order that is not total, but has a minimum element ε.

Partial orders

Definition (Orders) A partial order is a structure (X, ≤) such that, for all x, y, z ∈ X: • x ≤ x. • x ≤ y, y ≤ x =⇒ x = y. • x ≤ y, y ≤ z =⇒ x ≤ z. If, furthermore, for all x, y ∈ X either x ≤ y or y ≤ x, then we say that (X, ≤) is a total order.

23 / 29 Partial orders

Definition (Orders) A partial order is a structure (X, ≤) such that, for all x, y, z ∈ X: • x ≤ x. • x ≤ y, y ≤ x =⇒ x = y. • x ≤ y, y ≤ z =⇒ x ≤ z. If, furthermore, for all x, y ∈ X either x ≤ y or y ≤ x, then we say that (X, ≤) is a total order.

Example

• (N, ≤) is a total order with a minimum element, 0. • (R, ≤) is a total order that is dense: whenever x < y there is z s.t. x < y < z. • (P(N), ⊆) is a partial order that is not total, but has a minimum element ∅ and a maximum element N. • (A∗, ) is a partial order that is not total, but has a minimum element ε.

23 / 29 Proof. By induction on |X|, the size of X. • For the base case, when X is empty, ≤ is trivially already total. • For the inductive step, let |X| = n + 1. Since X is finite, let x ∈ X be a minimal element, i.e. if y ≤ x then y = x. • By the inductive hypothesis, let ≤0 be a total order on X \{x} extending ≤. • Now construct the total order ≤00 on X extending ≤0 by setting:

x ≤00 y for all y ∈ X.

Linearising finite partial orders

Proposition For any finite partial order (X, ≤), there is a total order ≤0 on X that extends ≤, i.e. x ≤ y =⇒ x ≤0 y.

24 / 29 • For the base case, when X is empty, ≤ is trivially already total. • For the inductive step, let |X| = n + 1. Since X is finite, let x ∈ X be a minimal element, i.e. if y ≤ x then y = x. • By the inductive hypothesis, let ≤0 be a total order on X \{x} extending ≤. • Now construct the total order ≤00 on X extending ≤0 by setting:

x ≤00 y for all y ∈ X.

Linearising finite partial orders

Proposition For any finite partial order (X, ≤), there is a total order ≤0 on X that extends ≤, i.e. x ≤ y =⇒ x ≤0 y.

Proof. By induction on |X|, the size of X.

24 / 29 • For the inductive step, let |X| = n + 1. Since X is finite, let x ∈ X be a minimal element, i.e. if y ≤ x then y = x. • By the inductive hypothesis, let ≤0 be a total order on X \{x} extending ≤. • Now construct the total order ≤00 on X extending ≤0 by setting:

x ≤00 y for all y ∈ X.

Linearising finite partial orders

Proposition For any finite partial order (X, ≤), there is a total order ≤0 on X that extends ≤, i.e. x ≤ y =⇒ x ≤0 y.

Proof. By induction on |X|, the size of X. • For the base case, when X is empty, ≤ is trivially already total.

24 / 29 • By the inductive hypothesis, let ≤0 be a total order on X \{x} extending ≤. • Now construct the total order ≤00 on X extending ≤0 by setting:

x ≤00 y for all y ∈ X.

Linearising finite partial orders

Proposition For any finite partial order (X, ≤), there is a total order ≤0 on X that extends ≤, i.e. x ≤ y =⇒ x ≤0 y.

Proof. By induction on |X|, the size of X. • For the base case, when X is empty, ≤ is trivially already total. • For the inductive step, let |X| = n + 1. Since X is finite, let x ∈ X be a minimal element, i.e. if y ≤ x then y = x.

24 / 29 • Now construct the total order ≤00 on X extending ≤0 by setting:

x ≤00 y for all y ∈ X.

Linearising finite partial orders

Proposition For any finite partial order (X, ≤), there is a total order ≤0 on X that extends ≤, i.e. x ≤ y =⇒ x ≤0 y.

Proof. By induction on |X|, the size of X. • For the base case, when X is empty, ≤ is trivially already total. • For the inductive step, let |X| = n + 1. Since X is finite, let x ∈ X be a minimal element, i.e. if y ≤ x then y = x. • By the inductive hypothesis, let ≤0 be a total order on X \{x} extending ≤.

24 / 29 Linearising finite partial orders

Proposition For any finite partial order (X, ≤), there is a total order ≤0 on X that extends ≤, i.e. x ≤ y =⇒ x ≤0 y.

Proof. By induction on |X|, the size of X. • For the base case, when X is empty, ≤ is trivially already total. • For the inductive step, let |X| = n + 1. Since X is finite, let x ∈ X be a minimal element, i.e. if y ≤ x then y = x. • By the inductive hypothesis, let ≤0 be a total order on X \{x} extending ≤. • Now construct the total order ≤00 on X extending ≤0 by setting:

x ≤00 y for all y ∈ X.

24 / 29 Proof sketch. Let (X, ≤) be a partial order, and write propositional variables pxy for x, y ∈ X. Define the set Γ to consist of the following formulae:

1 pxy for every x, y ∈ X s.t. x ≤ y.

2 pxx for every x ∈ X.

3 ¬pxy ∨ ¬pyx for every x, y ∈ X with x 6= y.

4 pxy → pyz → pxz for every x, y, z ∈ X.

5 pxy ∨ pyx for every x, y ∈ X.

0 0 Let Γ ⊆ Γ be finite. Notice that Γ \{axioms of the form (5) : pxy ∨ pyx} is already satisfied by some finite fragment of (X, ≤). Applying the finite case of the theorem (i.e. the Proposition on the previous slide) to this fragment induces an assignment that satisfies all of Γ0. Hence Γ is finitely satisfiable so, by compactness, it is actually satisfiable, say by an assignment α. This, in turn, induces a total order on X extending ≤

Extending to the infinite case

Theorem Every partial order can be extended to a total order.

25 / 29 Define the set Γ to consist of the following formulae:

1 pxy for every x, y ∈ X s.t. x ≤ y.

2 pxx for every x ∈ X.

3 ¬pxy ∨ ¬pyx for every x, y ∈ X with x 6= y.

4 pxy → pyz → pxz for every x, y, z ∈ X.

5 pxy ∨ pyx for every x, y ∈ X.

0 0 Let Γ ⊆ Γ be finite. Notice that Γ \{axioms of the form (5) : pxy ∨ pyx} is already satisfied by some finite fragment of (X, ≤). Applying the finite case of the theorem (i.e. the Proposition on the previous slide) to this fragment induces an assignment that satisfies all of Γ0. Hence Γ is finitely satisfiable so, by compactness, it is actually satisfiable, say by an assignment α. This, in turn, induces a total order on X extending ≤

Extending to the infinite case

Theorem Every partial order can be extended to a total order.

Proof sketch. Let (X, ≤) be a partial order, and write propositional variables pxy for x, y ∈ X.

25 / 29 0 0 Let Γ ⊆ Γ be finite. Notice that Γ \{axioms of the form (5) : pxy ∨ pyx} is already satisfied by some finite fragment of (X, ≤). Applying the finite case of the theorem (i.e. the Proposition on the previous slide) to this fragment induces an assignment that satisfies all of Γ0. Hence Γ is finitely satisfiable so, by compactness, it is actually satisfiable, say by an assignment α. This, in turn, induces a total order on X extending ≤

Extending to the infinite case

Theorem Every partial order can be extended to a total order.

Proof sketch. Let (X, ≤) be a partial order, and write propositional variables pxy for x, y ∈ X. Define the set Γ to consist of the following formulae:

1 pxy for every x, y ∈ X s.t. x ≤ y.

2 pxx for every x ∈ X.

3 ¬pxy ∨ ¬pyx for every x, y ∈ X with x 6= y.

4 pxy → pyz → pxz for every x, y, z ∈ X.

5 pxy ∨ pyx for every x, y ∈ X.

25 / 29 Applying the finite case of the theorem (i.e. the Proposition on the previous slide) to this fragment induces an assignment that satisfies all of Γ0. Hence Γ is finitely satisfiable so, by compactness, it is actually satisfiable, say by an assignment α. This, in turn, induces a total order on X extending ≤

Extending to the infinite case

Theorem Every partial order can be extended to a total order.

Proof sketch. Let (X, ≤) be a partial order, and write propositional variables pxy for x, y ∈ X. Define the set Γ to consist of the following formulae:

1 pxy for every x, y ∈ X s.t. x ≤ y.

2 pxx for every x ∈ X.

3 ¬pxy ∨ ¬pyx for every x, y ∈ X with x 6= y.

4 pxy → pyz → pxz for every x, y, z ∈ X.

5 pxy ∨ pyx for every x, y ∈ X.

0 0 Let Γ ⊆ Γ be finite. Notice that Γ \{axioms of the form (5) : pxy ∨ pyx} is already satisfied by some finite fragment of (X, ≤).

25 / 29 Hence Γ is finitely satisfiable so, by compactness, it is actually satisfiable, say by an assignment α. This, in turn, induces a total order on X extending ≤

Extending to the infinite case

Theorem Every partial order can be extended to a total order.

Proof sketch. Let (X, ≤) be a partial order, and write propositional variables pxy for x, y ∈ X. Define the set Γ to consist of the following formulae:

1 pxy for every x, y ∈ X s.t. x ≤ y.

2 pxx for every x ∈ X.

3 ¬pxy ∨ ¬pyx for every x, y ∈ X with x 6= y.

4 pxy → pyz → pxz for every x, y, z ∈ X.

5 pxy ∨ pyx for every x, y ∈ X.

0 0 Let Γ ⊆ Γ be finite. Notice that Γ \{axioms of the form (5) : pxy ∨ pyx} is already satisfied by some finite fragment of (X, ≤). Applying the finite case of the theorem (i.e. the Proposition on the previous slide) to this fragment induces an assignment that satisfies all of Γ0.

25 / 29 Hence Γ is finitely satisfiable so, by compactness, it is actually satisfiable, say by an assignment α. This, in turn, induces a total order on X extending ≤

Extending to the infinite case

Theorem Every partial order can be extended to a total order.

Proof sketch. Let (X, ≤) be a partial order, and write propositional variables pxy for x, y ∈ X. Define the set Γ to consist of the following formulae:

1 pxy for every x, y ∈ X s.t. x ≤ y.

2 pxx for every x ∈ X.

3 ¬pxy ∨ ¬pyx for every x, y ∈ X with x 6= y.

4 pxy → pyz → pxz for every x, y, z ∈ X.

5 pxy ∨ pyx for every x, y ∈ X.

0 0 Let Γ ⊆ Γ be finite. Notice that Γ \{axioms of the form (5) : pxy ∨ pyx} is already satisfied by some finite fragment of (X, ≤). Applying the finite case of the theorem (i.e. the Proposition on the previous slide) to this fragment induces an assignment that satisfies all of Γ0.

25 / 29 Extending to the infinite case

Theorem Every partial order can be extended to a total order.

Proof sketch. Let (X, ≤) be a partial order, and write propositional variables pxy for x, y ∈ X. Define the set Γ to consist of the following formulae:

1 pxy for every x, y ∈ X s.t. x ≤ y.

2 pxx for every x ∈ X.

3 ¬pxy ∨ ¬pyx for every x, y ∈ X with x 6= y.

4 pxy → pyz → pxz for every x, y, z ∈ X.

5 pxy ∨ pyx for every x, y ∈ X.

0 0 Let Γ ⊆ Γ be finite. Notice that Γ \{axioms of the form (5) : pxy ∨ pyx} is already satisfied by some finite fragment of (X, ≤). Applying the finite case of the theorem (i.e. the Proposition on the previous slide) to this fragment induces an assignment that satisfies all of Γ0. Hence Γ is finitely satisfiable so, by compactness, it is actually satisfiable, say by an assignment α. This, in turn, induces a total order on X extending ≤

25 / 29 The compactness theorem has numerous fascinating consequences in combinatorics and algebra: Corollary (of Compactness)

• P(N) can be totally ordered in a manner consistent with ⊆. • The finite Ramsey theorem is a consequence of the infinite Ramsey theorem. • Assuming the finite four colour theorem, every infinite map can be coloured with only four colours. • König’s lemma: every infinite finitely branching tree has an infinite path.

Exercise: if, like me, you think this is cool, try proving these yourself! Tomorrow, Tom will mention some other consequences in a first-order setting.

Some powerful corollaries

26 / 29 Exercise: if, like me, you think this is cool, try proving these yourself! Tomorrow, Tom will mention some other consequences in a first-order setting.

Some powerful corollaries

The compactness theorem has numerous fascinating consequences in combinatorics and algebra: Corollary (of Compactness)

• P(N) can be totally ordered in a manner consistent with ⊆. • The finite Ramsey theorem is a consequence of the infinite Ramsey theorem. • Assuming the finite four colour theorem, every infinite map can be coloured with only four colours. • König’s lemma: every infinite finitely branching tree has an infinite path.

26 / 29 Tomorrow, Tom will mention some other consequences in a first-order setting.

Some powerful corollaries

The compactness theorem has numerous fascinating consequences in combinatorics and algebra: Corollary (of Compactness)

• P(N) can be totally ordered in a manner consistent with ⊆. • The finite Ramsey theorem is a consequence of the infinite Ramsey theorem. • Assuming the finite four colour theorem, every infinite map can be coloured with only four colours. • König’s lemma: every infinite finitely branching tree has an infinite path.

Exercise: if, like me, you think this is cool, try proving these yourself!

26 / 29 Some powerful corollaries

The compactness theorem has numerous fascinating consequences in combinatorics and algebra: Corollary (of Compactness)

• P(N) can be totally ordered in a manner consistent with ⊆. • The finite Ramsey theorem is a consequence of the infinite Ramsey theorem. • Assuming the finite four colour theorem, every infinite map can be coloured with only four colours. • König’s lemma: every infinite finitely branching tree has an infinite path.

Exercise: if, like me, you think this is cool, try proving these yourself! Tomorrow, Tom will mention some other consequences in a first-order setting.

26 / 29 Outline

1 Structural induction

2 Soundness

3 Completeness

4 Compactness

5 Questions and exercises

27 / 29 Summary of material for exercises, Lecture 2

Definition (Axioms and rules of F) Ths system F has three axioms and one inference rule modus ponens: (wk) p → (q → p) (dist)( p → (q → r)) → ((p → q) → (p → r)) p p → q (mp) (neg)(( p → ⊥) → ⊥) → p q

Notation We write Γ  A if, for any assignment α, if α(B) = 1 for all B ∈ Γ then α(A) = 1. We write Γ ` A if A is derivable from hypotheses Γ in the system F.

Theorem We have the following: • (Deduction). Γ, A ` B Γ ` A → B. • (Soundness). If Γ ` A then Γ  A. • (Completeness). If Γ  A then Γ ` A.

We say that two formulae A, B are equivalent if they have the same truth table. Equivalently, by the Theorem above, A  B and B  A, or A ` B and B ` A.

28 / 29 Exercises, Lecture 2

1 Show that the following forms of consistency are equivalent:

(1):Γ 0 ⊥ (2): for no formula A, Γ ` A and Γ ` ¬A (3): there is a formula A s.t. Γ 0 A

2 Show that the following formulas are equivalent,

((A → B) → C) → D (A → p) → (p → A) → ((p → B) → C) → D

where p does not occur in any of A, B, C, D. Hint: Under soundness and completeness, you may use either syntactic or semantic means, or a combination!

3 (Hard). A graph is a structure G = (V, E) where E ⊆ V × V. For k ∈ N we say that G is k-colourable if there is a ‘colouring’ function c : V → {1,..., k} such that, whenever (u, v) ∈ E we have c(u) 6= c(v). Show, using the compactness theorem, that a (possibly infinite) graph is k-colourable if and only if every finite subgraph of it is k-colourable.

29 / 29