Suppose you look after the platform at a company of five people, and you want, more than anything, never to be surprised by your own system. On Tuesday the finance director asks you to confirm something everyone takes for granted: that everybody earns less than their boss. The personnel table, Figure 6.1, is short enough to print.

EmployeeBossEngineer?Manager?Salary
ThorneThornenoyes200
FinchThornenoyes120
PrattThornenono95
BellFinchyesno90
ColeFinchyesno85
Figure 6.1. The personnel table on Tuesday.

You don’t check the claim row by row. Like anyone who has written SQL, you ask the database for the rows that break it:

SELECT e.name, b.name AS boss
FROM   staff e JOIN staff b ON e.boss = b.name
WHERE  NOT (b.salary > e.salary);

One row comes back: Thorne | Thorne. The chief executive is her own boss, and she doesn’t earn more than herself. You add AND e.name <>
'Thorne'
to the query, it returns nothing, and you reply that the claim holds.

The finance director answers with one line: “Can that ever stop being true?” This is a different question. The table changes continually as people are hired, promoted, or given rises. He does not want to know whether the claim is true now, but whether it is true of every table the personnel system can produce given the HR policy.

The story contains two ideas, and we should keep them apart from the start. One is that of a sentence being true here, of this table on this Tuesday. The other is that of a sentence being true everywhere the constraints allow, of every table that obeys them. The first is a matter of looking, and the query engine settles it in a fraction of a second. The second is a claim about infinitely many tables, most of which nobody will see, and no amount of looking settles it.

This chapter is about the two ideas and the connection between them. It asks three questions:

  • What does it mean for a sentence to be true of a system?

  • What does it mean for a sentence to follow from the requirements on a system, so that it is true of every system that meets them?

  • Is there a finite way to show that it does?

The first two questions are answered by definitions, and the third by a theorem, though the first rules of proof we try turn out to fall short. Section 6.1 makes a system into a mathematical object, a structure. Section 6.2 gives a language for talking about structures, and Section 6.3 defines when a sentence of that language is true in a structure. Section 6.4 defines what it is for a sentence to follow from others: to be true in every structure in which they are true. Section 6.5 tries the proofs we already have, Gentzen’s natural deduction system NJ: they never lead from true premisses to a false conclusion, but they miss some sentences that follow, all for want of a single law. Adding that law, the law of the excluded middle, gives the system NK (Section 6.6), and Section 6.7 proves it complete: a sentence follows from others exactly when it has a derivation from them in NK. Section 6.8 counts what the extra law costs.

6.1 Structures

Before the word true can mean anything, we must say what a sentence is true of. Engineers use the word system for almost anything with parts, and we begin from what the word covers rather than from a definition. Figure 6.2 lists five systems.

SystemThingsRelationsFunctions
The companyfive peopleis an engineer; is a manager; earns more thanthe boss of
Counting numbers0,1,2,…is less thansuccessor, +, ×
Server networkfour machinesis linked tonone
A programits statesis an error statethe next state
Truth valuestrue and falsenoneand, or, not
Figure 6.2. Five systems.

The five have nothing in common as subject matter, yet each comes in the same three pieces:

  • a collection of things;

  • some relations among the things, each true of some tuples of things and false of others;

  • some functions, each taking things and returning a thing.

Some systems also have a few things with names of their own: a company has the chief executive, the numbers have the starting number 0, and a program has the initial state.

Definition 6.1 (signature). A signature is the vocabulary that sentences about one kind of system may use: names for particular things, symbols for functions and symbols for relations, each with its number of places.

Formally, a signature is a quadruple Σ=(C,F,R,ar) in which

  • C, F and R are pairwise disjoint sets, whose elements are called constant symbols, function symbols and relation symbols respectively;

  • ar:F∪R→N is a function, the arity, with ar(f)≥1 for every f∈F.

A relation symbol of arity 0 is a propositional letter. The signature is countable if the set C∪F∪R is countable.

The arity says how many inputs each function or relation symbol takes. Given only the symbol f, nobody could tell whether it names a function of one variable, of two, or of a million.

Definition 6.2 (structure). A structure for a signature says which things there are and what each symbol of the signature means.

Formally, let Σ=(C,F,R,ar) be a signature. A Σ-structure is a pair M=(D,I) in which

  • D is a non-empty set, the domain of M;

  • I is a function with domain C∪F∪R, the interpretation, such that

    1. I(c)∈D for every c∈C;

    2. I(f) is a function from Dn to D for every f∈F with ar(f)=n;

    3. I(R)⊆Dn for every R∈R with ar(R)=n.

Here Dn is the set of n-tuples of elements of D; in particular D0={()}, whose one element is the empty tuple. We write ⟦c⟧M, ⟦f⟧M and ⟦R⟧M for I(c), I(f) and I(R).

A relation with n places is a table with n columns and one row for each tuple of which it holds, so a structure is a database: one table for each relation symbol, one lookup table for each function symbol, and a few named rows.1

Example 6.3 (the company). Harriet Ashworth looks after the platform at the company of the opening, and the personnel table of Figure 6.1 is hers. Its vocabulary is the company signature

ΣC=({ceo}, {boss}, {=,Eng,Mgr,Richer}, ar)

with ar(boss)=ar(Eng)=ar(Mgr)=1 and ar(=)=ar(Richer)=2. The formula Richer(x,y) is read “x earns more than y”. The symbol = is a two-place relation symbol like the others, written between its arguments as usual.

Tuesday’s table is the ΣC-structure C=(DC,IC) given by

DC={Thorne,Finch,Pratt,Bell,Cole},⟦ceo⟧C=Thorne,⟦boss⟧C={Thorne↦Thorne, Finch↦Thorne, Pratt↦Thorne,={Bell↦Finch, Cole↦Finch},⟦Eng⟧C={Bell,Cole},⟦Mgr⟧C={Thorne,Finch},⟦=⟧C={(d,d):d∈DC},⟦Richer⟧C={(d,e)∈DC2:sal(d)>sal(e)},

where sal:DC→N is the salary column of Figure 6.1.

The structure interprets = as identity, the relation of each person to herself. Nothing in the definition of a structure demands that, since = may be interpreted as any set of pairs, but every structure for the company signature that we describe interprets it as identity.

The salaries are all different, so exactly half of the twenty ordered pairs of different people are in ⟦Richer⟧C: ten pairs, from (Thorne, Finch) down to (Bell, Cole). The function sal is not part of the structure. The signature has no symbol for a salary, so the structure keeps only what the symbols can ask about: who earns more than whom.

Figure 6.3 draws the structure, with an arrow from each person to their boss; M marks a manager and E an engineer. Thorne’s loop is the row that Harriet’s first query returned.

An organisation chart of five people. Finch and Pratt each have an arrow to Thorne; Bell and Cole each have an arrow to Finch; Thorne has an arrow looping back to Thorne. Thorne and Finch are marked as managers, Bell and Cole as engineers.
Figure 6.3. The company C.

A structure with a finite domain can be listed, table by table, as a personnel table can. A structure with an infinite domain can be described but not printed, and how to describe one exactly is a delicate matter.2 The counting numbers of Figure 6.2 are of that kind.

Example 6.4 (the counting numbers). The counting numbers are a structure for the signature of arithmetic

ΣA=({0}, {s,+,×}, {<}, ar)

with ar(s)=1 and ar(+)=ar(×)=ar(<)=2.

The structure is N=(N,IN), traditionally called the standard model of arithmetic, where N={0,1,2,…} and

  • ⟦0⟧N is the number zero,

  • ⟦s⟧N(n)=n+1,

  • ⟦+⟧N and ⟦×⟧N are addition and multiplication,

  • ⟦<⟧N={(m,n)∈N2:m is less than n}.

Example 6.5 (the other three systems). The other three systems of Figure 6.2 are structures in the same way.

  • The server network has a domain of four machines and one two-place relation.

  • The program has a domain of states, a constant for the initial state, a one-place relation for the error states and a one-place function for the next state.

  • The truth values form a domain of two elements with three functions and no relations.

Remark 6.6 (non-empty domains). Almost every textbook requires the domain to be non-empty, and so do we. The requirement looks fussy, but it decides the truth of sentences such as “if everything is a manager, then something is a manager”. In an empty structure everything is a manager, since there is nothing that is not, and yet nothing is a manager, so the sentence would be false. The requirement rules this out.

Remark 6.7 (total functions). The functions of a structure are total: a function symbol is interpreted as a function that gives an element of the domain for every input from the domain. That is what makes every term name something: the boss of anybody’s boss is always somebody. A real system need not be so obliging, and where a value may be missing, a relation such as reports to can stand in for the function the boss of.

Example 6.8 (the company, cont’d: a near miss). Suppose the table left Thorne’s boss blank, since the chief executive has none. That is a sensible way to run a company, but the result is not a structure: ⟦boss⟧C would have a hole at Thorne, and a lookup table with a hole in it is not a function. Somebody had to choose a value for Thorne, and choosing Thorne herself is the reason Harriet’s first query returned a row.

6.2 Syntax

A structure can be asked questions, and this section builds the language to ask them in. We start from a signature Σ=(C,F,R,ar) and a countably infinite set Var of variables, x, y, z, x1, x2 and so on, disjoint from the symbols of Σ. Constants and variables name elements of the domain, and function symbols build new names from old ones.

Definition 6.9 (terms). The Σ-terms are given by the grammar

t::=x∣c∣f(t1,…,tn),

where x is a variable, c a constant symbol of Σ, and f a function symbol of Σ with ar(f)=n. We write TermΣ for the set of Σ-terms.

Example 6.10 (the company, cont’d: terms). In the company signature, ceo, boss(ceo), boss(boss(ceo)) and boss(x) are terms. In C the first three all name Thorne, and boss(x) names somebody only once we know who x is. The string boss(ceo,ceo) is not a term, since ar(boss)=1, and neither is Eng(ceo), which says something rather than naming something. In arithmetic, s(s(0)) and x+s(0) are terms.

Having named things, we want to say something about them. A relation applied to terms is the smallest such statement, and it is called an atomic formula: Richer(boss(x),x) says that the boss of x earns more than x, and ⊥ says something false outright. Atomic formulas are combined into complex ones by the logical symbols. We use Greek letters φ, ψ and χ for formulas, and Latin letters p and q for propositional letters.

Definition 6.11 (formulas). The Σ-formulas are given by the grammar

φ,ψ::=⊥∣R(t1,…,tn)∣(φ→ψ)∣(φ∧ψ)∣(φ∨ψ)∣∀xφ∣∃xφ,

where R is a relation symbol of Σ with ar(R)=n, the ti are Σ-terms, and x is a variable. We write FormΣ for the set of Σ-formulas.

The formulas ⊥ and R(t1,…,tn) are atomic. For a propositional letter p the atomic formula p() is written p. Three more symbols are abbreviations:

  • ¬φ is φ→⊥;

  • φ↔ψ is (φ→ψ)∧(ψ→φ);

  • when Σ contains =, the formula t1≠t2 is ¬(t1=t2).

Familiar two-place symbols are written between their arguments, as usual: x+y<z is the atomic formula <(+(x,y),z), and t1=t2 is =(t1,t2). Brackets are kept down by the usual conventions:

  • The outermost pair is dropped.

  • ∧ and ∨ take precedence over →, which groups to the right.

  • ¬ and the quantifiers ∀ and ∃ take precedence over everything else.

A symbol that takes precedence applies first, to as little of the formula as it can, just as × applies before + in 2+3×4.

Example 6.12 (reading the conventions). With propositional letters p, q and r:

  • ¬p∧q is (¬p)∧q, not ¬(p∧q);

  • p∧q→r is ((p∧q)→r);

  • p→q→r is (p→(q→r)).

A quantifier, too, covers as little as it can: in the company signature, ∀xEng(x)→Mgr(x) is (∀xEng(x))→Mgr(x), in which the quantifier covers only Eng(x). A quantifier meant to cover more is followed by brackets, as in ∀x(Eng(x)→Mgr(boss(x))), “every engineer reports to a manager”.

A formula with variables does not yet say anything definite. Richer(boss(x),x) is true or false according to who x is, whereas ∀xRicher(boss(x),x) makes one claim about the whole domain: everyone earns less than their boss. The next definition separates the variables whose values must be supplied from those that a quantifier has already taken charge of.

Definition 6.13 (free variables). The free variables of a term or formula are those whose values must be supplied before it names or says anything.

Formally, the set var(t) of variables of a term t is defined by recursion on the shape of t:

var(t):={{x}if t is a variable x,∅if t is a constant c,var(t1)∪⋯∪var(tn)if t is f(t1,…,tn).

The set FV(φ) of free variables of a formula φ is defined by recursion on the shape of φ, with ∘ any of →, ∧ and ∨, and Q either quantifier:

FV(φ):={∅if φ is ⊥,var(t1)∪⋯∪var(tn)if φ is R(t1,…,tn),FV(ψ)∪FV(χ)if φ is ψ∘χ,FV(ψ)∖{x}if φ is Qxψ.

An occurrence of x in φ is bound if it lies inside a part of φ of the form ∀xψ or ∃xψ, and free otherwise; the quantifier binds the occurrences of x in ψ.

Definition 6.14 (closed term; sentence). A term t is closed if var(t)=∅, and a formula φ is a sentence if FV(φ)=∅.

Example 6.15 (free and bound). In the company signature, ceo and boss(boss(ceo)) are closed terms, and boss(x) is not. Of the two formulas

Richer(boss(x),x)and∀xRicher(boss(x),x),

the first is not a sentence, since its one free variable is x, and the second is, since the last line of the definition of FV removes x.

In the formula

Eng(x)→∀xMgr(x)

the first occurrence of x is free and the other two are bound, so the formula is not a sentence.

Using the language is mostly translation, in both directions, and one choice causes most mistakes: which connective joins a quantifier to the condition that restricts it. “Every P …” restricts a universal quantifier, and the restriction goes in with →: for every x, if x is a P, then …. “Some P …” restricts an existential quantifier, and the restriction goes in with ∧: some x is a P and …. The rule of thumb, universal with → and existential with ∧, is reliable but not infallible.

Example 6.16 (the company, cont’d: four sentences in English). Figure 6.4 gives four sentences in the company signature, each with its English.

FormulaEnglish
∀xRicher(boss(x),x)everyone earns less than their boss
∀x(x≠ceo→Richer(boss(x),x))everyone except the chief executive earns less than their boss
∀x(Eng(x)→Mgr(boss(x)))every engineer reports to a manager
∃x(Mgr(x)∧boss(x)≠x)some manager has a boss other than themselves
Figure 6.4. Four sentences and their English.

The third and fourth sentences follow the rule of thumb. Written with ∧, the third becomes ∀x(Eng(x)∧Mgr(boss(x))), which says that everyone is an engineer, false of any firm that employs somebody else. Written with →, the fourth becomes ∃x(Mgr(x)→boss(x)≠x), which anyone who is not a manager makes true.

Proofs pass from a claim about anybody to the same claim about somebody in particular, as (∀E) does, and the other way round, as (∃I) does. The syntactic tool is substitution: put a term in place of x, so that Richer(boss(x),x) becomes Richer(boss(ceo),ceo), which says it of the chief executive. Substitution is an operation on strings, and truth is not defined through it (Remark 6.24 says why). It comes with a danger. The term put in may have variables of its own, and a quantifier in the formula can capture them, so that the result says something quite different. The definition of substitution is therefore followed by a second, of the condition that rules capture out.

Definition 6.17 (substitution). Substitution puts a term in place of the free occurrences of a variable.

Formally, let t be a term and x a variable. For a term u, the term u[t/x] is defined by recursion on the shape of u:

u[t/x]:={tif u is x,uif u is a variable y≠x or a constant,f(u1[t/x],…,un[t/x])if u is f(u1,…,un).

For a formula φ, the formula φ[t/x] is defined by recursion on the shape of φ, with ∘ any of →, ∧ and ∨, and Q either quantifier:

φ[t/x]:={⊥if φ is ⊥,R(u1[t/x],…,un[t/x])if φ is R(u1,…,un),ψ[t/x]∘χ[t/x]if φ is ψ∘χ,Qxψif φ is Qxψ,Qyψ[t/x]if φ is Qyψ with y≠x.

Definition 6.18 (substitutable). A term is substitutable for a variable when putting it in place of the variable lets no quantifier capture a variable of the term.

Formally, the term t is substitutable for x in φ if no free occurrence of x in φ lies inside a part of φ of the form ∀yψ or ∃yψ with y∈var(t).

Example 6.19 (the company, cont’d: substitution and capture). If φ is x≠ceo→Richer(boss(x),x), then φ[boss(ceo)/x] is boss(ceo)≠ceo→Richer(boss(boss(ceo)),boss(ceo)): the claim made of x is now made of the chief executive’s boss.

Substitutability rules out the one way in which substitution can go wrong. Let φ be ∃yRicher(y,x), “someone earns more than x”, and let t be boss(y). The recursion gives ∃yRicher(y,boss(y)), which says that someone earns more than their own boss, a different claim altogether: the y of the term has been captured by the quantifier. The condition forbids it, since the free occurrence of x lies inside ∃yRicher(y,x) and y∈var(boss(y)).

We write φ[t/x] only when t is substitutable for x in φ. A closed term always is, having no variables to capture.

The sentences of Figure 6.4 look as if they speak about a particular firm, and we have read them so. But nothing in this section says how a string of symbols speaks about anything, and so nothing here decides whether ∀xRicher(boss(x),x) is true. Nothing could, since the string mentions no structure: every structure for its signature reads it. The reading we have been doing by intuition needs a definition, and the next section gives it.

6.3 Satisfaction

A structure says what the symbols of a formula mean. It does not say what the variables stand for, and a formula with free variables is true or false only once something does.

Definition 6.20 (assignment). An assignment says what each variable stands for.

Formally, let M be a structure with domain D. An assignment into M is a function s:Var→D. For x∈Var and d∈D, the assignment s[d/x], “s with d for x”, is defined by

s[d/x](y):={dif y is x,s(y)if y≠x.

Together, a structure and an assignment settle what every term names and whether every formula is true.

Definition 6.21 (value of a term). The value of a term is the element it names, once a structure and an assignment are fixed.

Formally, let M be a structure with domain D, and s an assignment into M. The value ValsM(t)∈D of a term t in M under s is defined by recursion on the shape of t:

ValsM(t):={s(x)if t is a variable x,⟦c⟧Mif t is a constant c,⟦f⟧M(ValsM(t1),…,ValsM(tn))if t is f(t1,…,tn).

We write Vals(t) when the structure is clear.

Example 6.22 (the company, cont’d: the boss’s boss). In C, under an assignment s with s(x)=Cole, the term boss(boss(x)) has the value

Vals(boss(boss(x)))=⟦boss⟧C(⟦boss⟧C(Cole))=⟦boss⟧C(Finch)=Thorne.

The closed term boss(boss(ceo)) also has the value Thorne, and under every assignment.

We already know what the logical words mean in English, and the definition writes that meaning down, one kind of formula at a time: a conjunction is true when both conjuncts are, a disjunction when at least one disjunct is, and “for every x” when what follows holds whichever element x stands for. The structure enters only at the atomic formulas: R(t1,…,tn) is true when the things the terms name stand in the relation that R names.

Definition 6.23 (satisfaction). Satisfaction says when a formula is true in a structure under an assignment.

Formally, let M be a structure with domain D, and s an assignment into M. The relation M,s⊨φ, read “φ is true in M under s” or “M,s satisfies φ”, is defined by recursion on the shape of φ by the clauses of Figure 6.5, one for each kind of formula. There M,s⊭φ means that M,s⊨φ does not hold, and “or” is inclusive.3

The clauses of satisfaction, one per line. M, s satisfies R of t1 to tn iff the tuple of the values of t1 to tn under s is in the interpretation of R in M. M, s does not satisfy falsum. M, s satisfies psi and chi iff it satisfies psi and it satisfies chi. M, s satisfies psi or chi iff it satisfies psi or it satisfies chi. M, s satisfies psi implies chi iff it does not satisfy psi or it satisfies chi. M, s satisfies for all x psi iff M, s with d for x satisfies psi for every d in the domain. M, s satisfies there exists x psi iff M, s with d for x satisfies psi for some d in the domain.
Figure 6.5. Satisfaction.

The clause for ⊥ says that it is true nowhere. Since ¬φ is φ→⊥, the clause for → yields one for negation: M,s⊨¬φ if and only if M,s⊭φ.

The clause for → is a deliberate choice. It ignores any connection of content between the two halves, so that “if 2+2=5 then 1+1=3” is true, because its antecedent is false. Other readings of “if”, which ask for such a connection, have been studied, and none would make the truth of φ→ψ depend only on the truth of φ and of ψ. This one does, and that is what lets the definition decide an implication by deciding its two halves.

The quantifier clauses are where the assignment earns its keep. To decide whether ∀xψ is true, we must look at ψ with x standing for each element of the domain in turn, while every other variable keeps the value it had. The assignment s[d/x] is exactly that: s with x pointed at d and nothing else changed. Whatever s gave x before does not matter, since the quantifier has taken charge of x.4 The job falls to the assignment because a structure fixes once and for all what each constant symbol names, while a variable can stand for one element now and for another a moment later.

Remark 6.24 (unnamed elements). One might try to define truth by substitution instead: ∀xψ is true when ψ[t/x] is true for every closed term t, and ∃xψ when it is true for some. That would be wrong, because a domain can contain elements that no closed term names. Take the real numbers as a structure for a signature with a constant symbol 0, a one-place function symbol s and a two-place relation symbol <, read as zero, adding one and less than. Every closed term, 0, s(0), s(s(0)) and so on, names a natural number, and no natural number lies strictly between 0 and 1, yet ∃x(0<x∧x<s(0)) is true. An assignment reaches every element of the domain, named or not.

Example 6.25 (the company, cont’d: evaluating a universal sentence). Consider the sentence

∀x(x≠ceo→Richer(boss(x),x)).

Since C interprets = as identity, the atomic clause makes an equation t1=t2 true in it exactly when the two terms name the same person.

By the clause for the universal quantifier, it is true in C if, for each of the five people d, the formula x≠ceo→Richer(boss(x),x) is true under s[d/x]. Figure 6.6 has one row for each person.

dx≠ceo?⟦boss⟧C(d)Richer(boss(x),x)?the implication
ThornenoThorneno (200≯200)true (antecedent false)
FinchyesThorneyes (200>120)true
PrattyesThorneyes (200>95)true
BellyesFinchyes (120>90)true
ColeyesFinchyes (120>85)true
Figure 6.6. One row for each element of the domain.

Every row is true, so the sentence is true. Without the antecedent the Thorne row becomes false, so ∀xRicher(boss(x),x) is false in C, with Thorne as the counterexample. These are Harriet’s two queries again, now as two applications of a definition.

The Thorne row is the one people query: why is the implication true there, when its consequent is false? Read the sentence as a rule of the company: if you are not the chief executive, you earn less than your boss. A rule of that form is broken only by someone it applies to, and it does not apply to Thorne, so Thorne cannot break it. The clause for → says exactly this: an implication fails only when its antecedent is true and its consequent false.

Example 6.26 (the company, cont’d: evaluating a ∀∃-sentence). The sentence

∀x(Mgr(x)→∃y(boss(y)=x∧y≠x))

says that every manager manages someone other than themselves.

  • For the three people who are not managers, the implication is true at once.

  • For Thorne, the clause for the existential quantifier asks for one d whose boss is Thorne and who is not Thorne; Finch will do.

  • For Finch, Bell will do.

So the sentence is true in C.

The evidence has a characteristic shape: for the universal quantifier we examined every row, and for each existential quantifier we produced one witness.

On a finite structure the definition is also an algorithm: to decide whether a sentence is true, unfold it clause by clause. Each quantifier clause runs through the domain, so a sentence with k nested quantifiers, on a domain of n elements, needs about nk cases. On an infinite domain, such as the counting numbers, the quantifier clauses ask about infinitely many elements. The definition still makes sense, since it says what truth is, but it no longer tells us how to find it out.

The same sentence can be true in one structure and false in another: truth belongs to the pair of a sentence and a structure, not to the sentence alone.

Example 6.27 (one sentence, several structures). Take the signature with one two-place relation symbol R, and the sentence ∀x∃yR(x,y), “everything is R-related to something”.

  • In the company, with R read as earns more than, the sentence is false, since Cole earns more than nobody.

  • In the counting numbers, with R read as <, it is true, with n+1 as the witness for n.

  • In a network of three servers linked in a ring it is true.

  • In three servers linked one way in a line, a to b and b to c, it is false at c.

The one string receives two verdicts in four structures.

The same clauses cover the simplest formulas of all, those built from propositional letters, and there they reduce to something familiar.

Proposition 6.28 (propositional logic as a special case). Let φ be a formula built from propositional letters, ⊥ and the connectives, M a structure and s an assignment into M. Whether M,s⊨φ depends only on which letters M makes true.

Proof. A letter p is a relation symbol with no places, so ⟦p⟧M is a subset of D0={()}. That set has one element, the empty tuple, so the subset is either empty or everything, and the atomic clause makes p false or true accordingly, under every assignment. The clauses for ⊥ and the connectives compute the truth of φ from that of its parts. □

So for formulas built from letters a structure amounts to a choice of true or false for each letter, a valuation: a row of a truth table. With two letters there are four rows, and the clauses for the connectives compute the familiar tables. For p→q, writing T and F for true and false:

pqp→qTTTTFFFTTFFT

Propositional logic is the part of first-order logic in which every relation symbol has no places.

The definition asks for an assignment even when the formula is a sentence, yet a sentence has no free variables, and its truth ought not to depend on what they stand for. If it did, “true in this structure” would mean nothing until somebody chose an assignment, and a question such as whether everybody earns less than their boss would have no answer. The next lemma removes the worry.

Lemma 6.29 (relevance). Let s and s′ be assignments into M with s(x)=s′(x) for every x∈FV(φ). Then M,s⊨φ if and only if M,s′⊨φ.

In words: a formula cares only about the variables it leaves free.

Proof sketch.

  • Atomic formulas. The value of a term depends only on what the assignment does to its variables.

  • Connectives. The clauses for the connectives pass the claim straight down.

  • ∀xψ. The set FV(ψ) is included in FV(∀xψ)∪{x}, and s[d/x] and s′[d/x] agree on that set; so, by the induction hypothesis, ψ is true under the one exactly when it is true under the other, for every d.

  • ∃xψ. The existential case is the same.

Exercise 6.14 asks for the details. □

In particular, the truth of a sentence in M does not depend on the assignment. We write M⊨φ, read “φ is true in the structure M”, when M,s⊨φ for one assignment s, and hence for all.

Substitution was introduced to pass from a claim about anybody to the same claim about somebody in particular. The passage is safe only if φ[t/x] says about the thing t names exactly what φ says about x, and the next lemma shows that it does, provided nothing is captured.

Lemma 6.30 (substitution). If t is substitutable for x in φ, then M,s⊨φ[t/x] if and only if M,s[Vals(t)/x]⊨φ.

In words: putting the term t in for x has the same effect as letting x stand for whatever t names. Without the proviso the lemma fails: when a quantifier captures a variable of t, the formula φ[t/x] no longer says of the thing t names what φ says of x (Example 6.19 shows a case).

The proof, by induction on φ, is long and unilluminating, and we omit it, as most textbooks do; but the omission is of length, not of difficulty. The case of terms, on which the rest is built, is Exercise 6.15, which also asks where substitutability is used.

One feature of the definition looks too obvious to mention, yet its consequences are subtle and contentious. The clause for negation makes ¬φ true in M under s exactly when φ is not, so exactly one of φ and ¬φ is true, and by the clause for disjunction φ∨¬φ is true in every structure under every assignment, whatever φ says. This property of the definition, that every formula has exactly one of two truth values in a structure under an assignment, is called bivalence.

6.4 Entailment

Satisfaction answers a question about one structure and one assignment: is this formula true here? Often we want something else. We have no particular system in mind, only requirements that every acceptable system must meet, and we want to know what holds in every system that meets them: whether everybody earns less than their boss in every table a personnel system could ever accept, say.

A set of sentences that says what any acceptable system must satisfy, written down before any particular system is in view, is called a theory.

Definition 6.31 (theory; model). A theory is a set of sentences, and its models are the structures in which all its sentences are true.

Formally, a Σ-theory is a set of Σ-sentences. A Σ-structure M is a model of a Σ-theory Θ, or satisfies Θ, written M⊨Θ, if M⊨ψ for every ψ∈Θ.

Entailment is defined for sets of formulas, whose members may have free variables and are then true or false only under an assignment. For such a set Γ we write M,s⊨Γ when M,s⊨ψ for every ψ∈Γ, and say that M,s satisfies Γ. When Γ is a theory the assignment makes no difference, by the relevance lemma, and M,s⊨Γ says just that M is a model of Γ.

Remark 6.32 (structures and models). A structure is a mathematical object, and a model is always a model of something: the same structure may be a model of one theory and not of another. A structure with an assignment gets no name of its own; we write M,s and read M,s⊨φ as “φ is true in M under s”.

English also uses model in the opposite direction. A physicist who calls a set of equations a model of nature means that the equations describe the world. Here the world is the model, and the sentences describing it are the theory.

Definition 6.33 (entailment). A set of formulas entails a formula if the formula is true wherever all the members of the set are, and a formula entailed by the empty set is valid.

Formally, let Γ be a set of Σ-formulas and φ a Σ-formula. Then Γ entails φ, written Γ⊨φ, if M,s⊨φ for every Σ-structure M and every assignment s into M with M,s⊨Γ.

The formula φ is valid, written ⊨φ, if ∅⊨φ, that is, if M,s⊨φ for every Σ-structure M and every assignment s into M.5

When Θ is a theory and φ a sentence, Θ⊨φ says that φ is true in every model of Θ. Validity is entailment by the empty theory, of which every structure is a model, and it is rarely what we want. A claim such as “nobody but the person at the top is their own boss” is not valid, and nobody expects it to be: it holds, if it holds, because of the theory a system satisfies. The three notions differ in what they examine, as Figure 6.7 shows.

NotionMeansExamined
M,s⊨φφ is true in M under sone M,s
Γ⊨φM,s⊨φ for every M,s with M,s⊨Γthose satisfying Γ
⊨φM,s⊨φ for every M,sall
Figure 6.7. Three semantic notions.

Remark 6.34 (one symbol, three jobs). The symbol ⊨ now does three jobs, and what stands on its left says which.

  • With a structure and an assignment on the left, M,s⊨φ says that φ is true in M under s, and M,s⊨Γ that every member of Γ is.

  • With a structure alone, M⊨φ says that the sentence φ is true in it, and M⊨Θ that M is a model of the theory Θ.

  • With a set of formulas on the left (a list such as ψ,χ abbreviates the set), or nothing, Γ⊨φ and ⊨φ speak of every structure and every assignment at once.

So M⊨φ is a fact about one structure, and {ψ}⊨φ is a fact about all of them.

Example 6.35 (the company, cont’d: valid, and not valid). The sentence ∀xEng(x)→Eng(ceo) is valid: in every structure, if every element is in ⟦Eng⟧M, then so is ⟦ceo⟧M.

The sentence

∀xRicher(boss(x),x)

is not valid, since C falsifies it, but it is true in some structures: in the counting numbers, with ceo read as 0, boss as s, Richer as >, and Eng and Mgr as anything at all, everyone earns less than their boss. It is true in no finite company whose Richer comes from salaries, since the best-paid person cannot earn less than her boss.

A sentence true in C need not be valid, however natural it sounds. The sentence ∃xEng(x) is true in C and false in every company without engineers.

One relation symbol needs a theory of its own. A structure may interpret = as any set of pairs, but a system that compares names relies on two facts about identity: everything is equal to itself, and equals may be put for equals. Written as sentences, these facts are the equality axioms.

Definition 6.36 (equality axioms). The equality axioms of a signature say, in its own symbols, that = behaves as identity.

Formally, let Σ be a signature containing the two-place relation symbol =. The equality axioms of Σ are the Σ-sentences

  1. (Eq1)

    ∀x(x=x);

  2. (Eq2)

    ∀z1⋯∀zk(x=y→(φ→φ[y/x])), for every Σ-formula φ and all variables x and y such that y is substitutable for x in φ, where z1,…,zk are the free variables of x=y→(φ→φ[y/x]).

We write EqΣ for the set of them.

The list does not mention symmetry or transitivity, and need not: because (Eq2) allows every formula φ, both follow from (Eq1) and (Eq2) (Exercise 6.8).

A structure that interprets = as identity is normal. Every normal structure satisfies EqΣ. The axiom (Eq1) holds because everything is identical to itself, and each instance of (Eq2) holds by the substitution lemma, since under an assignment that gives x and y the same value, φ and φ[y/x] have the same truth value.

Example 6.37 (the company, cont’d: the theory of the personnel system). Harriet’s personnel system enforces, among others, two rules that can be written in the company signature:

R1: ∀x¬Richer(x,x),R2: ∀x(x≠ceo→Richer(boss(x),x)).

Nobody earns more than themselves, and everyone but the chief executive earns less than their boss.

The system also relies, without saying so, on the equality axioms EqΣC of the company signature, which its query engine uses whenever it compares two names. One instance of (Eq2) says that whoever equals someone who earns more than w also earns more than w:

ERicher: ∀u∀v∀w(u=v→(Richer(u,w)→Richer(v,w))),

obtained from the formula Richer(u,w) with u and v for x and y.

Let Θ be the set consisting of R1, R2 and EqΣC: the theory of the personnel system, in the company signature. A normal structure satisfies Θ exactly when both rules hold in it, that is, exactly when it is a table that the personnel system would accept as a possible state of the company. An entailment Θ⊨φ says that φ holds in every state the system can be in, which is what the finance director asked.

Remark 6.38 (equality as a logical symbol). Many presentations make = a logical symbol instead of a relation symbol, with two rules of its own: (=I) concludes t=t from nothing, and (=E) concludes φ[t2/x] from t1=t2 and φ[t1/x]. The two treatments derive the same formulas from the same hypotheses. Each equality axiom is derivable with the rules, using (→I) and (∀I), and each use of a rule can be replaced by an instance of (Eq1) or (Eq2) followed by (∀E) and (→E). Keeping = as a relation symbol leaves the logic, and every proof about it, unchanged.

Example 6.39 (the company, cont’d: an entailment). Sharpened a little, the finance director’s question is whether the theory guarantees that only the chief executive is her own boss:

Θ⊨∀x(boss(x)=x→x=ceo).

It does.

Let M be a model of Θ, and let d be an element of its domain with (⟦boss⟧M(d),d)∈⟦=⟧M, and suppose, for a contradiction, that (d,⟦ceo⟧M)∉⟦=⟧M. Then

(⟦boss⟧M(d),d)∈⟦Richer⟧Mby R2,(d,d)∈⟦Richer⟧Mby ERicher, with ⟦boss⟧M(d), d, d for u, v, w,which contradicts R1.

Hence (d,⟦ceo⟧M)∈⟦=⟧M, and since M and d were arbitrary, the entailment holds.

Example 6.40 (the company, cont’d: a non-entailment). Does the theory guarantee that no engineer is a manager, that is, does Θ⊨∀x(Eng(x)→¬Mgr(x)) hold? To show that an entailment fails, one structure suffices: a model of Θ in which the sentence is false.

Take the normal structure with domain {Ada}, in which

  • ceo names Ada;

  • boss sends Ada to Ada;

  • Eng and Mgr are both {Ada};

  • Richer is empty.

Then:

  • R1 holds because Richer is empty;

  • R2 holds because the only person is the chief executive, so its antecedent is never true;

  • the equality axioms hold because the structure is normal;

  • Ada is an engineer who is a manager.

The entailment therefore fails. The one-person company is a model of Θ in which the sentence is false, and so it is the counter-model that shows the failure.

The two kinds of answer are not on an equal footing. A non-entailment comes with a certificate, a structure, which anyone can check by evaluating sentences in it. An entailment comes with an argument, “let M be a model of the theory and d an element”, which is convincing but cannot be checked by running anything: it speaks of every model of the theory, of every size, including the infinite ones, and no loop runs over all of those (Examples 6.39 and 6.40 show one of each).

6.5 Soundness and Incompleteness of NJ

How can we certify that Γ⊨φ? Listing the structures that satisfy Γ and checking each one is out of the question: there are infinitely many, and most of them are infinite. What we want instead is a proof, a finite object showing that the commitments made by Γ yield φ, each step of which a program can check. Part 1 supplied one, Gentzen’s NJ. We write Γ⊢NJφ when some derivation in NJ has conclusion φ and all its open hypotheses in Γ.

Two notions of consequence are now available, Γ⊨φ and Γ⊢NJφ. The first quantifies over all structures and assignments, the second asks for one finite object, and they can be related in two ways:

  • Soundness: if Γ⊢NJφ, then Γ⊨φ.

  • Completeness: if Γ⊨φ, then Γ⊢NJφ.

Soundness says that derivations are safe: none leads from true hypotheses to a false conclusion. Completeness says that derivations are enough: whatever follows has one.

Example 6.41 (the company, cont’d: a derivation). The following derivation shows that nobody but the chief executive is her own boss:

Θ⊢NJ∀x(x≠ceo→boss(x)≠x).

In words: let x be anyone, and suppose that x is not the chief executive and that x is her own boss.

  • By R2, the boss of x earns more than x.

  • Since the boss of x is x, the equality axiom ERicher gives that x earns more than x.

  • By R1 that is absurd.

Hence x is not her own boss.

In the tree, a leaf labelled R1, R2 or ERicher is that hypothesis, and ≠ is short for an implication into ⊥. To save width we write t for the term boss(x), and since the tree is still too wide for the page, we give it in four pieces. The piece D1 instantiates ERicher three times and uses the hypothesis t=x:

ERicher∀v∀w(t=v→(Richer(t,w)→Richer(v,w)))∀E∀w(t=x→(Richer(t,w)→Richer(x,w)))∀Et=x→(Richer(t,x)→Richer(x,x))∀Et=xRicher(t,x)→Richer(x,x)→E

The piece D2 uses R2 and the hypothesis x≠ceo:

R2x≠ceo→Richer(t,x)∀Ex≠ceoRicher(t,x)→E

The piece E combines the two and meets R1:

R1¬Richer(x,x)∀ED1Richer(t,x)→Richer(x,x)D2Richer(t,x)Richer(x,x)→E⊥→E

Its open hypotheses are R1, R2, ERicher, x≠ceo and t=x. The last piece discharges the final two and generalises:

[x≠ceo]1  [t=x]2⋮E⊥t≠x→I,2x≠ceo→t≠x→I,1∀x(x≠ceo→boss(x)≠x)∀I

The (∀I) step is legal because, once both suppositions are discharged, the only open hypotheses are the sentences R1, R2 and ERicher.

The sentence the tree proves is not quite the finance director’s, ∀x(boss(x)=x→x=ceo). The two are true in the same structures, but they are different strings, and the tree proves only the first.

A derivation is the certificate we asked for: a finite object, each step of which a program can check against the rules.

Theorem 6.42 (soundness of NJ). For every set Γ of formulas and every formula φ, if Γ⊢NJφ then Γ⊨φ.

Proof. We prove a stronger statement about every derivation D, by induction on its construction: in every structure M under every assignment s, if all the open hypotheses of D are true, then so is its conclusion. The theorem is the case of a derivation whose open hypotheses lie in Γ.

There is one case for each rule, and each case asks the same question: if the premisses of the rule are true wherever their open hypotheses are, is the conclusion true wherever its open hypotheses are? Fix a structure M and an assignment s, and suppose that the open hypotheses of D are all true in M under s.

  • A hypothesis. The derivation is a single leaf φ, whose open hypothesis is φ itself, true by supposition.

  • (→I). The derivation D ends with φ→ψ, inferred from a derivation of ψ whose open hypotheses are those of D and possibly φ. If φ is false under s, then φ→ψ is true by its clause. If φ is true, then every open hypothesis above the step is true, so ψ is true by the induction hypothesis, and so is φ→ψ.

  • (∨E). The open hypotheses of the derivation of φ∨ψ are among those of D, so φ∨ψ is true, and hence φ or ψ is true. If φ is, every open hypothesis of the derivation of χ from [φ] is true, and so is χ. If ψ is, the same argument applies to the other derivation.

  • (∀I). The derivation D ends with ∀xφ, inferred from a derivation D′ of φ[y/x], where y is free in no open hypothesis and not free in ∀xφ. We must show that φ is true under s[d/x] for every d. Let d be an element of the domain and s′=s[d/y]. The open hypotheses do not mention y, so

    they remain true under s′by the relevance lemma,φ[y/x] is true under s′by the induction hypothesis,φ is true under s′[d/x]by the substitution lemma.

    That assignment differs from s[d/x] at most at y, and y is not free in φ unless it is x itself, so by relevance φ is true under s[d/x].

    The side condition was used to keep the open hypotheses true when y was moved to d. Had they said something about y, moving y might have made them false, and the induction hypothesis would have said nothing.

  • (∃E). The derivation of ∃xφ has its open hypotheses among those of D, so ∃xφ is true, and there is an element d with φ true under s[d/x]. Let s′=s[d/y]. The other open hypotheses above χ do not mention y, and y is not free in χ, so

    φ[y/x] is true under s′as in the previous case,the other open hypotheses are true under s′by relevance,χ is true under s′by the induction hypothesis,χ is true under sby relevance.

    The first step uses that y is not free in ∃xφ, unless it is x.

The remaining rules, (→E), (∧I), (∧E), (∨I), (⊥E), (∀E) and (∃I), discharge nothing and have no side condition on a variable, and each is checked by reading its clause in the definition of satisfaction, with the substitution lemma for (∀E) and (∃I). Exercise 6.13 treats two of them; the others are similar. □

Remark 6.43 (truth along a derivation). Soundness does not promise that every line of a derivation is true. A derivation reasons from suppositions, and a supposition may be false. The promise is that a line can be false only if one of its open hypotheses is. Listing the lines with their open hypotheses and their truth values in a structure under an assignment makes the promise visible, and it exposes a broken rule: the bad step is the first line that is false while all its open hypotheses are true.

Example 6.44 (reasoning from a supposition). From p∨q and ¬p the rule (∨E) derives q:

p∨q¬p[p]1⊥→Eq⊥E[q]1q∨E,1

Take a structure that makes both hypotheses true, so that p is false and q true. The branch on the left passes through two false lines, the supposition p and the line ⊥, and each has a false open hypothesis, the supposition p itself. Nothing has gone wrong. That branch reasons about a case this structure rules out, and (∨E) takes from it only the conclusion q, which the other branch also reaches.

Is NJ also complete? It is not. To show that a sentence has no derivation in NJ we use two properties of the rules.

Fact 6.45 (disjunction and existence properties).

  • If ⊢NJφ∨ψ, then ⊢NJφ or ⊢NJψ.

  • If ⊢NJ∃xφ, then ⊢NJφ[t/x] for some term t.

In words: a proof in NJ, from no hypotheses, of “φ or ψ” says which of the two holds, and a proof of “there is an x such that φ” names a term for x.

The reason fits in three sentences. Every derivation can be rewritten, step by step, into one with no detours, that is, no introduction rule followed at once by the elimination rule for the same symbol. A derivation with no detours and no open hypotheses ends with an introduction rule. For φ∨ψ that rule is (∨I), and the tree above it derives φ or derives ψ; for ∃xφ it is (∃I), and the tree above it derives φ[t/x] for a particular term t.6

Theorem 6.46 (incompleteness of NJ). For a propositional letter p, the sentence p∨¬p is valid, but ⊬NJp∨¬p. Hence there are sentences φ with ⊨φ and ⊬NJφ, and the converse of soundness fails for NJ.

Proof. The sentence is valid: in every structure under every assignment p is true or false, and in the second case ¬p is true. Now suppose that ⊢NJp∨¬p. By the disjunction property, NJ derives p or derives ¬p, and by soundness the disjunct it derives is valid. Neither is:

  • in a structure that makes p true, ¬p is false;

  • in one that makes p false, p is false.

□

The proof used soundness to pass from a derivation to validity, and two structures to take validity away. It used nothing about p except that a structure can make it true and another false, so the same proof works for every sentence φ of which that holds: NJ does not derive φ∨¬φ.

The sentence φ∨¬φ is the law of the excluded middle: every structure obeys it, and NJ lacks it. The rules come close, since they derive ¬¬(φ∨¬φ), but no rule leads from ¬¬φ to φ. The gap is no isolated freak, and the next example meets it again.

Remark 6.47 (two senses of incompleteness). The word incompleteness in the title of this section describes a proof system: a system is complete if it derives everything that is entailed, and incomplete if some entailment has no derivation. Chapter 8 uses it of theories instead: a theory is incomplete when some truth about its subject matter cannot be derived from it.

Example 6.48 (the company, cont’d: one negation too many). The finance director’s sentence is entailed by Θ (Example 6.39). Can NJ derive it?

Θ⊢NJ∀x(boss(x)=x→x=ceo)?

The argument of Example 6.39 went:

  • either x is the chief executive or not;

  • if so, done;

  • if not, absurdity.

The second half is the derivation of Example 6.41. The rules do not provide the first half, the either … or not. They do provide the following:

  • suppose x≠ceo;

  • then, as in Example 6.41, absurdity;

  • hence ¬(x≠ceo), which is ¬¬(x=ceo).

That is one negation too many. In every structure ¬¬(x=ceo) is true exactly when x=ceo, but no rule of NJ makes the last step, and no cleverer derivation finds a way round.7

6.6 Law of the Excluded Middle

The gap in NJ is a principle that every structure obeys: of a claim and its denial, one is true, and there is no third option in the middle. This is the law of the excluded middle (LEM), and it is more than two thousand years old.8 In a structure it holds because the clause for negation makes exactly one of φ and ¬φ true (bivalence); in a proof system it becomes a rule with no premisses, for every formula φ:

φ∨¬φLEM

The law is not the only principle that NJ lacks. Three more fall into the gap, each a schema with an instance for every choice of formulas:

¬¬φ→φ,((φ→ψ)→φ)→φ,¬∀x¬φ→∃xφ.
  • The first, double negation, says that what is not false is true;

  • the second, Peirce’s law,9 says much the same without negation;

  • the third says that if not everything lacks the property φ, then something has it.

Every instance of each is valid, as a check against the clauses shows, but NJ does not derive every instance: already ¬¬p→p, ((p→q)→p)→p and ¬∀x¬P(x)→∃xP(x), for propositional letters p, q and a relation symbol P, have no derivation (Exercise 6.10).

With the law added, all three become derivable. Here is double negation:

φ∨¬φLEM[φ]2[¬¬φ]1[¬φ]2⊥→Eφ⊥Eφ∨E,2¬¬φ→φ→I,1

We write (DN) for this derivation used as a step. The system with the law added is classical logic.

Definition 6.49 (NK). The system NK is NJ with the law of the excluded middle added as a rule with no premisses.

Formally, the derivations of NK are built by the rules of NJ together with the rule (LEM).

Every derivation of NJ is a derivation of NK, so Γ⊢NJφ implies Γ⊢NKφ. The letters are J for intuitionistisch and K for klassisch.10 One rule with no premisses looks like a small addition. The next example shows what it buys.

Example 6.50 (the company, cont’d: a derivation in NK). The finance director’s sentence is derivable in NK: Θ⊢NK∀x(boss(x)=x→x=ceo). The derivation is the argument of Example 6.39 written as a tree, and most of it is already built: the piece E of Example 6.41 derives ⊥ from x≠ceo and boss(x)=x, with R1, R2 and ERicher. The new step splits on x=ceo:

x=ceo∨x≠ceoLEM[x=ceo]2[x≠ceo]2[boss(x)=x]1E⊥x=ceo⊥Ex=ceo∨E,2boss(x)=x→x=ceo→I,1∀x(boss(x)=x→x=ceo)∀I

The left case of the (∨E) needs no work. The right case is the old derivation, followed by a step out of the contradiction, a step that the split makes worth taking. The (∀I) step is legal for the same reason as before: only R1, R2 and ERicher remain open.

Theorem 6.51 (soundness of NK). For every set Γ of formulas and every formula φ, if Γ⊢NKφ then Γ⊨φ.

Proof. The soundness proof for NJ goes through with one more case: a leaf φ∨¬φ, with no open hypotheses, must be true in every structure under every assignment. By bivalence it is: the clause for negation makes one of φ and ¬φ true. □

So far, so good: NK is sound, and it reaches sentences that NJ missed. But is one more rule enough? Soundness is half of the connection between ⊢NK and ⊨. The other half asks whether NK derives everything that follows, or whether further laws are missing.

6.7 Completeness of NK

Soundness puts derivability inside entailment: whatever NK derives from Γ is true in every model of Γ. For NJ the converse failed, and the law of the excluded middle was the missing step. For NK the converse holds.

Theorem 6.52 (completeness11). Let Σ be a countable signature, Γ a set of Σ-sentences and φ a Σ-sentence. If Γ⊨φ, then Γ⊢NKφ.

In words: whatever is true in every model of a theory can be derived from it in NK.

To show that Γ⊨φ implies Γ⊢NKφ, we prove the contrapositive: if Γ⊬NKφ, then some model of Γ makes φ false. We are handed a failure to derive and must build a structure from it. Two definitions name what the construction aims at.

Definition 6.53 (consistency; maximal consistency). A consistent set is one from which the rules cannot derive absurdity, and a maximal consistent set is a consistent set that takes a side on every sentence.

Formally, a set Γ of Σ-sentences is consistent if Γ⊬NK⊥, and inconsistent otherwise. It is maximal consistent if

  • it is consistent, and

  • for every Σ-sentence ψ, either ψ∈Γ or ¬ψ∈Γ.

Keep the two words apart. Consistent is about derivations: no derivation leads from the set to ⊥. Having a model is about structures: some structure makes the whole set true.

Soundness gives one direction at once, since a set with a model cannot derive ⊥, which is true in no structure. The proof below gives the other, and in this vocabulary that is the whole of the completeness theorem: every consistent set of sentences has a model. (Applied to Γ∪{¬φ}, this gives the theorem as stated, by Step 1 below.) The proof has five steps.

  1. Show that Γ∪{¬φ} is consistent.

  2. Add new constants, and sentences that make each of them a witness for an existential sentence.

  3. Extend the result to a maximal consistent set Δ.

  4. Build a structure from the closed terms of the language, so that its elements are pieces of syntax.

  5. Prove that a sentence is true in this structure exactly when it belongs to Δ. Since Γ and ¬φ are in Δ, the structure is the one we want.

Steps 2 and 4 are needed only for the quantifiers, so we first carry out the propositional case in full and then extend it.

Step 1

Lemma 6.54 (refuting the negation). If Γ⊬NKφ, then Γ∪{¬φ} is consistent.

Proof. If Γ∪{¬φ} derived ⊥, then Γ would derive ¬¬φ by (→I), and φ by (DN). □

Excluded middle enters the propositional proof here and nowhere else, through (DN), and here the proof breaks down for NJ. With Γ empty and φ the sentence p∨¬p, the lemma fails for NJ: the system does not derive p∨¬p, yet {¬(p∨¬p)} is inconsistent, by the tree that derived ¬¬(p∨¬p).

Steps 3 to 5, propositional case

Lemma 6.55 (Lindenbaum). Over a countable signature, every consistent set of sentences is contained in a maximal consistent set.

In words: a set of sentences that does not contradict itself can be enlarged until it takes a side on every question, and still not contradict itself.

Proof. List all the sentences of the signature as ψ0,ψ1,ψ2,…; they can be listed, because they are finite strings over a countable alphabet. Decide each sentence in turn: let Δ0=Γ and

Δn+1:={Δn∪{ψn}if that set is consistent,Δn∪{¬ψn}otherwise.

Let Δ=⋃n∈NΔn.

  • Every sentence or its negation belongs to Δ.

  • Each Δn is consistent: if both Δn∪{ψn} and Δn∪{¬ψn} derived ⊥, then by (→I) the set Δn would derive both ¬ψn and ¬¬ψn, and hence ⊥.

  • Finally, Δ is consistent, because a derivation of ⊥ from Δ uses finitely many hypotheses, all of which lie in some Δn.

□

The proof is not an algorithm. At each step it asks whether a set of sentences is consistent, and nothing in it says how that question is to be answered; it needs only that the question has an answer. The proof shows that Δ exists without constructing it. Nor is Δ unique: another order of the list can give another maximal consistent set. The lemma promises a maximal consistent set, not a particular one, and the completeness proof needs only one.

The next lemma shows, one connective at a time, that a maximal consistent set behaves like the set of truths of a single structure.

Lemma 6.56 (maximal consistent sets). Let Δ be maximal consistent. For all sentences ψ and χ:

  1. if Δ⊢NKψ, then ψ∈Δ; in particular, ⊥∉Δ;

  2. ψ∧χ∈Δ if and only if ψ∈Δ and χ∈Δ;

  3. ψ∨χ∈Δ if and only if ψ∈Δ or χ∈Δ;

  4. ψ→χ∈Δ if and only if ψ∉Δ or χ∈Δ.

Proof.

  • (i) If Δ derives ψ but ψ∉Δ, then ¬ψ∈Δ, and (→E) derives ⊥ from Δ. And ⊥∉Δ, since Δ is consistent.

  • (iii) If ψ∨χ∈Δ and neither ψ nor χ is, then ¬ψ and ¬χ are, and (∨E) derives ⊥ from the three. The converse follows from (∨I) and (i).

  • (iv) If ψ→χ and ψ are in Δ, then Δ derives χ by (→E), so χ∈Δ by (i). Conversely:

    • if χ∈Δ, then Δ derives ψ→χ by (→I), discharging nothing;

    • if ψ∉Δ, then ¬ψ∈Δ, from which, supposing ψ, (→E) gives ⊥ and (⊥E) gives χ, so Δ again derives ψ→χ.

    In either case (i) puts ψ→χ in Δ.

Part (ii) is Exercise 6.16. □

For a signature of propositional letters a structure amounts to a valuation, and the obvious one serves: make a letter true exactly when it belongs to Δ.

Lemma 6.57 (truth lemma, propositional). Let Δ be maximal consistent, and let v make a letter p true exactly when p∈Δ. For every formula ψ built from letters, ⊥ and the connectives, ψ is true under v if and only if ψ∈Δ.

Proof. By induction on ψ.

  • A letter. The claim is the definition of v.

  • ⊥. Neither side holds, by part (i) of the previous lemma.

  • ψ∨χ.

    the formula ψ∨χ is true under v⟺ψ or χ is⟺ψ∈Δ or χ∈Δby the induction hypothesis⟺ψ∨χ∈Δby (iii) above.
  • ψ∧χ and ψ→χ. The cases of ∧ and → are the same, with parts (ii) and (iv) of the lemma.

□

This completes the propositional case. If Γ⊬NKφ, then

Γ∪{¬φ} is consistent(Step 1),it is contained in a maximal consistent set Δ(Lindenbaum’s lemma),the valuation v of Δ makes all of Δ true(the truth lemma),

in particular every member of Γ and ¬φ. So the structure given by v satisfies Γ and makes φ false, and Γ⊭φ.

Example 6.58 (Lindenbaum’s construction on three letters). Let Γ={p∨q, q→r} and φ=r, and ask whether Γ entails r. Start the construction from Δ0={p∨q, q→r, ¬r}, which is consistent, and suppose that the list of sentences begins p,q,r.

  • Adding p leaves the set consistent, so p goes in.

  • Adding q does not, since q and q→r give r and ¬r is present, so ¬q goes in.

  • Adding r meets ¬r, so ¬r goes in again.

The valuation read off makes p true and q and r false, and it does make p∨q and q→r true and r false. The valuation was assembled, one letter at a time, from what the hypotheses could not rule out, and it shows that the entailment fails.

The first step asked whether {p∨q,q→r,¬r,p} is consistent, and we answered yes because this very valuation makes all of it true: the construction itself only asks.

Step 2: Henkin witnesses

Two things go wrong when the language has quantifiers, and the two new steps repair them. The first is that nothing yet says what the elements of the structure should be; the propositional case needed none. The answer is the boldest idea in the proof: the elements are the closed terms themselves. A constant c names the element c, the term boss(c) names the element boss(c), and so on, so that the structure is made of its own names.

The second problem is that a maximal consistent set may contain ∃xψ without any instance ψ[t/x]: the closed terms may not name enough elements.

Example 6.59 (the company, cont’d: an engineer with no name). In C every closed term names Thorne, since ceo is Thorne and Thorne is her own boss. The set of sentences true in C, which is maximal consistent, therefore contains ∃xEng(x) and also ¬Eng(t) for every closed term t. A structure built from the closed terms would contain no engineer, and the truth lemma would fail. This is the company’s version of Remark 6.24.

We must ensure that there are enough names and that every existential sentence in Δ has one of them as a witness.

Definition 6.60 (witness property). A set of sentences has the witness property if every existential sentence in it comes with a named instance.

Formally, a set Δ of Σ-sentences has the witness property if, for every sentence ∃xψ∈Δ, there is a constant symbol c of Σ with ψ[c/x]∈Δ.

Lemma 6.61 (generalisation on a new constant). If Γ⊢NKψ[c/x], where the constant c occurs neither in Γ nor in ψ, then Γ⊢NK∀xψ.

Proof sketch. In a derivation of ψ[c/x], replace c everywhere by a variable y that occurs nowhere in the derivation. No rule mentions c, so the result is still a derivation, now of ψ[y/x] from hypotheses in Γ, which do not mention y. One step of (∀I) completes it. □

Lemma 6.62 (Henkin witnesses). Let Σ be countable and Γ a consistent set of Σ-sentences.

  • Let Σ+ be Σ with new constant symbols c0,c1,c2,… added.

  • List the existential Σ+-sentences as ∃x0ψ0,∃x1ψ1,∃x2ψ2,….

  • For each n let θn be the sentence ∃xnψn→ψn[dn/xn], where dn is the first of the new constants that occurs neither in ψn nor in any of θ0,…,θn−1.

Then Γ∪{θ0,θ1,…} is consistent.

Proof. First, Γ remains consistent when derivations may use the new constants: replacing each new constant in a derivation of ⊥ from Γ by a variable that occurs nowhere in it yields a derivation of ⊥ from Γ over Σ, since no rule mentions a constant. Since a derivation of ⊥ uses finitely many hypotheses, it now suffices to show that if Γn=Γ∪{θ0,…,θn−1} is consistent, then so is Γn∪{θn}.

Suppose not. Then Γn derives ¬θn, the denial of an implication, and from the denial of an implication χ1→χ2 the rules of NJ alone derive ¬χ2 and ¬¬χ1 (Exercise 6.12). The constant dn occurs neither in Γn nor in ψn. So Γn derives

¬ψn[dn/xn] and ¬¬∃xnψnfrom ¬θn,∀xn¬ψnby generalisation on a new constant,¬∃xnψnby (∃E) and (∀E),⊥together with ¬¬∃xnψn.

Hence Γn is inconsistent, contrary to assumption. No use of excluded middle was needed. □

In words: every existential sentence may be given a named witness without risk of contradiction, provided that each name is new.

Remark 6.63 (why the witnesses must be new). The proviso is not fussiness, and two small sets show what it prevents. Let P and Q be one-place relation symbols and c a constant symbol. The set {∃xP(x), ¬P(c)} is consistent: every structure with an element of P that c does not name satisfies it. Had the witness for ∃xP(x) been the old constant c, the sentence added would be ∃xP(x)→P(c), and with it the set derives P(c) and ¬P(c). A name already in use carries information, and the witness may not have it.

Nor may two existential sentences share a new name. The set

{∃xP(x), ∃xQ(x), ¬∃x(P(x)∧Q(x))}

is consistent, since every structure with an element of P and a different element of Q, and nothing in both, satisfies it; give both existential sentences the witness c0, and the set derives P(c0)∧Q(c0), and so a contradiction. Exercise 6.17 asks for the details.

The condition is the one on the eigenvariable of (∃E), that it be a name about which nothing has been assumed, in another guise.

Now apply Lindenbaum’s lemma, over Σ+, to Γ∪{¬φ}∪{θ0,θ1,…}. The result is a maximal consistent set Δ of Σ+-sentences with the witness property. Indeed, if ∃xψ∈Δ, then ∃xψ is some ∃xnψn, the sentence θn is in Δ, and part (iv) of the lemma on maximal consistent sets puts ψn[dn/xn] in Δ.

Steps 3 to 5, first-order case

Definition 6.64 (term structure). The term structure of a set of sentences is made of the closed terms, related as the set says they are.

Formally, let Δ be a maximal consistent set of Σ+-sentences with the witness property. Its term structure is the Σ+-structure MΔ=(DΔ,IΔ) in which

  • DΔ is the set of closed Σ+-terms, and

  • for each constant symbol c, each function symbol f of arity n, and each relation symbol R of arity n of Σ+,

    ⟦c⟧MΔ=c,⟦f⟧MΔ(t1,…,tn)=f(t1,…,tn),⟦R⟧MΔ={(t1,…,tn)∈DΔn:R(t1,…,tn)∈Δ}.

The domain DΔ is not empty, since the new constants are closed terms. By induction on terms, every closed term t names itself: Vals(t)=t under every assignment s. Every element of the domain therefore has a name, and by the substitution lemma MΔ⊨∀xψ holds exactly when MΔ⊨ψ[t/x] for every closed term t, and MΔ⊨∃xψ exactly when MΔ⊨ψ[t/x] for some closed term t.

Lemma 6.65 (truth lemma). For every Σ+-sentence ψ, MΔ⊨ψ if and only if ψ∈Δ.

In words: in the structure made of names, a sentence is true exactly when Δ says it is.

Proof. By induction on the number of connectives and quantifiers in ψ. The induction is not on subformulas: ψ[t/x] is not a subformula of ∀xψ, but it has one quantifier fewer.

  • Atomic sentences. The claim is the definition of ⟦R⟧MΔ.

  • Connectives. Each follows from the induction hypothesis and the matching part of the lemma on maximal consistent sets: ψ∨χ is true exactly when ψ or χ is, so exactly when ψ∈Δ or χ∈Δ, so, by part (iii), exactly when ψ∨χ∈Δ; the cases of ∧ and → use parts (ii) and (iv) in the same way.

  • ∃xψ. The existential case is Exercise 6.16.

  • ∀xψ. If ∀xψ∈Δ, then every instance ψ[t/x]

    is derivable from Δby (∀E)hence belongs to Δhence is trueby the induction hypothesis;

    so ∀xψ is true.

    Conversely, suppose that ∀xψ∉Δ. Then

    ¬∀xψ∈Δ∃x¬ψ∈Δderivable in NK (Exercise 6.10)¬ψ[c/x]∈Δ for some cby the witness propertyψ[c/x]∉Δψ[c/x] is falseby the induction hypothesis∀xψ is false.

□

Excluded middle has now been used a second time, in the passage from ¬∀xψ to ∃x¬ψ, a relative of the quantifier principle ¬∀x¬φ→∃xφ that NJ could not derive.

Proof of the completeness theorem. Suppose that Γ⊬NKφ.

  • Then Γ∪{¬φ} is consistent (Step 1).

  • Add the witnesses (Step 2) and extend to a maximal consistent set Δ with the witness property (Step 3).

  • Its term structure (Step 4) makes every member of Δ true (Step 5), in particular every member of Γ, and ¬φ.

The new constants occur in neither Γ nor φ, so they can be forgotten: the structure (DΔ,IΔ↾(C∪F∪R)), the restriction of IΔ to the symbols of Σ, is a Σ-structure in which the same Σ-sentences are true. It satisfies Γ and makes φ false, so Γ⊭φ. □

The proof has a slightly impudent quality. Asked to show that a sentence true in every structure has a proof, we turned the sentences themselves into a structure made of words. Nothing in the definition of a structure forbids this, since a domain may be any non-empty set, and a set of strings is a set like any other.

Remark 6.66 (compactness and the Löwenheim–Skolem theorem). The proof yields two further results. If every finite subset of Γ has a model, so does Γ (compactness), since a derivation uses only finitely many hypotheses. And the structure the proof builds is made of terms, of which there are only countably many, so a set of sentences with a model has one whose domain can be listed as 0,1,2,… (the Löwenheim–Skolem theorem). Both say that first-order sentences discriminate less than one might hope.

Example 6.67 (the company, cont’d: the finance director’s two answers). Take Γ to be the theory Θ of the personnel system. By soundness and completeness, “true in every model of Θ” and “derivable from Θ in NK” are one relation, so the finance director’s question has two answers, and they are the same answer. The tables the system can produce interpret = as identity, and the next remark shows that looking only at such structures loses nothing.

Remark 6.68 (normal structures). Let Θ be a theory that contains the equality axioms of its signature. The term structure the proof builds need not be normal, since Δ may contain c=d for two different constants c and d. Because Θ contains the equality axioms, the defect can be repaired. Write t≈t′ when (t=t′)∈Δ. The axioms (Eq1) and (Eq2) make ≈ an equivalence relation (Exercise 6.8) that is compatible with the symbols: if ti≈ti′ for each i, then

  • f(t1,…,tn)≈f(t1′,…,tn′);

  • R(t1,…,tn)∈Δ exactly when R(t1′,…,tn′)∈Δ.

The ≈-classes of closed terms therefore form a normal structure in which exactly the same sentences are true. Hence if a sentence φ is true in every normal model of Θ, then Θ⊢NKφ. The equality axioms say everything about identity that a derivation can use, so looking only at normal structures loses nothing.12

6.8 Classical and Intuitionistic Logic

We now have two logics for one language. The system NJ is the logic of Part 1, whose proofs are programs. The system NK is complete for the structures of this chapter. They differ by a single rule, and the difference decides what a proof contains.

The law of the excluded middle closes the gap, and that is its gain: entailment, which quantifies over every structure, becomes derivability, which asks for a finite certificate. With the law in hand an argument by cases on any claim is available, whether or not anyone can tell which case holds. Adding a rule can only let more through, and what it lets through costs NK the two properties of Fact 6.45.

Remark 6.69 (the drinker principle). Take a signature with one one-place relation symbol Dr, think of the domain as the customers in a pub (there is at least one, since domains are not empty), and read Dr(x) as “x is drinking”. The sentence

∃x(Dr(x)→∀yDr(y))

says that there is someone in the pub such that, if they are drinking, everyone is.13

The principle sounds like a claim about a remarkable person, and so it is often suspected of being false. It is valid, by a two-line argument. Either everyone is drinking or someone is not. If everyone is, pick anyone: the consequent is true, so the implication is. If someone is not, pick that person: the antecedent is false, so the implication is true. There is no remarkable person, only a choice made differently in the two cases. The first case is where the non-empty domain is used; in an empty pub there would be nobody to pick, and the sentence would be false.

The system NJ does not derive this sentence, and this time the existence property is the reason. If it did, it would derive Dr(t)→∀yDr(y) for some term t. The signature has no constants and no function symbols, so t is a variable, say z. But Dr(z)→∀yDr(y) is false in a pub of two people under an assignment that sends z to the one who is drinking, so by soundness it has no derivation. Asked for someone, the rules of NJ insist on being told who. The argument above never says who: it says “this one if everyone is drinking, that one if not”, without knowing which case holds.

In a pub of five that is no defect, since one can go and look. Replace “drinking” by a property of numbers that nobody knows how to check, and the pub by all the counting numbers, and the same argument proves that a certain number exists without indicating how to find it, even in principle. That is why some people refuse to accept it.

Example 6.70 (a derivation of the drinker principle in NK). The drinker principle, which we write δ, is derivable in NK: ⊢NK∃x(Dr(x)→∀yDr(y)). The derivation splits on whether someone is not drinking. If someone is not, call them z; then z is the witness, because the antecedent fails for z. This is the derivation F1:

[∃y¬Dr(y)]1[¬Dr(z)]2[Dr(z)]3⊥→E∀yDr(y)⊥EDr(z)→∀yDr(y)→I,3δ∃Iδ∃E,2

If nobody is not drinking, then everyone is, and anyone at all, say x, is the witness. This is the derivation F2, in which the (→I) step discharges nothing, since ∀yDr(y) was reached without supposing Dr(x):

[¬∃y¬Dr(y)]1[¬Dr(y)]4∃y¬Dr(y)∃I⊥→E¬¬Dr(y)→I,4Dr(y)DN∀yDr(y)∀IDr(x)→∀yDr(y)→Iδ∃I

One step of (∨E) on an instance of (LEM) joins the two cases:

∃y¬Dr(y)∨¬∃y¬Dr(y)LEM[∃y¬Dr(y)]1F1δ[¬∃y¬Dr(y)]1F2δδ∨E,1

In F1 the witness is z, the person who is not drinking, and the (∃E) step is legal because z is free neither in δ, nor in ∃y¬Dr(y), nor in any other open hypothesis above δ. In F2 the witness is x, anyone at all. The (∀I) step is legal because y is not free in the only open hypothesis, ¬∃y¬Dr(y). The (∃I) step uses a variable as the witness, and that is where the non-empty domain is paid for.

Which case supplies the conclusion depends on which side of the (LEM) is true, and the derivation does not say.

Proposition 6.71 (loss of the disjunction and existence properties). The system NK has neither the disjunction property nor the existence property.

Proof.

  • Disjunction property. The system NK derives p∨¬p in one step, and it derives neither disjunct, since neither is valid and NK is sound.

  • Existence property. Take a signature whose only symbol is the one-place relation symbol Dr, so that every term is a variable. The system NK derives ∃x(Dr(x)→∀yDr(y)): split by (LEM) on ∃y¬Dr(y). If someone is not drinking, that person is a witness, since the antecedent fails for them. If not, everyone is drinking, by (DN), and every variable is a witness (Example 6.70 gives the tree). Consider the structure with two elements, a and b, in which Dr holds of a only, and an assignment that sends every variable to a. For every term t the formula Dr(t) is true and ∀yDr(y) is false, so Dr(t)→∀yDr(y) is false, and by soundness NK derives no such formula.

□

In NJ a proof of an existential sentence contains a witness, and the rules were designed so that it would: every derivation of ∃xφ from no hypotheses can be straightened into one that ends by exhibiting a term t. A proof in NK can conclude ∃xφ by showing that both answers to some question yield an x, without saying which answer is the true one. It certifies that something exists but no longer shows which thing.

Over a finite structure the price is nothing: whether φ or ¬φ holds there is settled by running through the domain, so an argument by cases on φ can always be completed by looking. The price is felt only over domains that nobody can run through, such as the counting numbers. Whether it is worth paying depends on what makes a sentence true, a question that the mathematics of this chapter can sharpen but not settle.

The mathematicians who refuse the law, the intuitionists, take the loss of witnesses to be the point. The law was abstracted, they argue, from reasoning about finite collections, where going through the list settles every question, and it was carried over unexamined to infinite collections, which nobody can go through.14

Goldbach’s conjecture says that every even number greater than 2 is the sum of two primes.15 Written with symbols for zero, successor, addition and multiplication, it is a sentence about the counting numbers, and by the definitions of this chapter it is true or false in the structure they form. To assert “Goldbach’s conjecture or its negation” is to claim, the intuitionists say, that the question is settled, or at least can be, when nobody has any idea how to settle it. For them mathematics is a construction carried out in the mind, and “true” can only mean “constructed”.16

Their logic gives the connectives meaning by proof conditions, what counts as a proof of a sentence, rather than by truth conditions.

  • A proof of φ∧ψ is a proof of each conjunct;

  • a proof of φ→ψ is a method that turns every proof of φ into a proof of ψ;

  • a proof of φ∨ψ is a proof of one disjunct together with which one;

  • a proof of ∃xφ is a particular x with a proof of φ for it.

On this reading the disjunction and existence properties of NJ are not accidents of the rules, waiting to be patched; they are what the connectives mean, and the rules of NJ write them down.17

Intuitionistic logic also has a semantics of its own: structures that grow in stages, which model a mathematician whose knowledge grows over time, and for which NJ is sound and complete.18 Each logic therefore has a semantics that it fits exactly, and the question becomes which semantics describes what mathematicians are doing.

The two logics are equally safe from contradiction: every theorem of classical arithmetic can be translated into a theorem of intuitionistic arithmetic, with ¬¬ inserted in the right places, so that if intuitionistic arithmetic is consistent, so is classical arithmetic.19 What separates the logics is meaning: what a sentence asserts, and what counts as a proof of it.

The strongest modern case for the intuitionist answer is an argument about language rather than about mathematics.20 The meaning of a sentence is fixed by how it is used, and a speaker’s grasp of that meaning must show itself in what the speaker can do: above all, in recognising a proof of the sentence when one is presented. But some truth conditions could obtain without anyone being able to recognise that they do, and no speaker could display a grasp of those. For mathematics, then, meaning is given by proof conditions, and the right logic is intuitionistic. Realists reply that we understand more than we can verify, and the debate is alive; Button and Walsh (2018) is a guide to its current state. Mathematics itself has also moved on: a great deal of analysis can be developed constructively without the philosophy, and classical mathematics reads that work as mathematics that happens to supply witnesses.21

The proof conditions came back, half a century on, as the reason the proofs of NJ can be read as programs. A proof of a disjunction is a value with a tag on it, so a proof of the law of the excluded middle would be a program that, given any claim at all, returns the right tag, and there is no such program. For this reason the proof assistants used to verify software today, such as Lean and Rocq, are built on intuitionistic type theories, and they let a user add the law as an axiom or, in Lean, through the axiom of choice.22 Figure 6.8 sets the two logics side by side.

NJ (intuitionistic)NK (classical)
Rulesnatural deduction as in Part 1those rules plus the law of the excluded middle
Meaning of a connectiveproof conditionstruth conditions
Semantics it fits exactlystructures that grow in stagesthe structures of this chapter
Complete for the structures of this chapternoyes
Disjunction and existence propertiesyesno
Proofs as programsyesonly with jumps
Figure 6.8. Two logics for one language.

The rest of this part of the course is classical, and that is a decision rather than a default. Its question is what holds in every structure, a question about truth, and the theorem that answers it, soundness and completeness together, is a theorem about NK. It fails for NJ, which is sound for the structures of this chapter but not complete for them. From here on we therefore work in a different logic from the one in which proofs are programs, and we have paid for completeness with the witnesses.

History

The logic of this chapter was built over half a century of argument about what mathematics may assume. Its language is, in modern dress, the one Gottlob Frege introduced in his Begriffsschrift of 1879.23 It was the first formal language with quantifiers, and it came with the first system of proof precise enough that checking a proof needs no understanding of what it is about, only a comparison of shapes. Every proof checker since descends from it.

Frege built it for a purpose. The nineteenth century had rebuilt the calculus on the arithmetic of the real numbers, and the real numbers on sets of rational numbers. Frege set out to finish the job by showing that arithmetic itself is logic: that the truths about numbers follow from laws of thought alone, so that mathematics rests on the firmest ground there is. This programme is logicism, and Frege carried it out in the two volumes of his Grundgesetze der Arithmetik (Frege, 1893).

In June 1902, with the second volume at the printer, a letter arrived from Bertrand Russell. One of Frege’s basic laws, Russell pointed out, allows a set of all sets that are not members of themselves; that set is a member of itself exactly when it is not, so the laws contradict one another.24

Russell’s paradox was one of several, and together they raised the question of what makes mathematics safe. Russell’s own answer was the theory of types, the ancestor of the type systems of programming languages. Two others bear on this chapter: David Hilbert’s, which kept classical mathematics whole and set out to prove it safe, and L. E. J. Brouwer’s, which rejected part of it, beginning with the law of the excluded middle. Section 6.8 describes the logic that Brouwer’s answer produced. Hilbert’s is told here.

Hilbert’s answer was to keep classical mathematics and secure it. Its proofs, he proposed, should be treated as finite strings of symbols, and their consistency proved by reasoning about those strings with methods so elementary that even Brouwer could not object. This is Hilbert’s programme, whose three questions are the rows of the scoreboard at the end of each chapter.

His ambition was large: “Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können” (no one shall drive us out of the paradise that Cantor created for us).25 A year later he put the same thought more bluntly: “Taking the principle of excluded middle from the mathematician would be the same, say, as proscribing the telescope to the astronomer or to the boxer the use of his fists.”26

He meant that classical mathematics was too valuable to give up, and most mathematicians since have agreed with him in practice, whatever their view of the philosophy. Hilbert’s reply is not an argument that Brouwer was wrong. It is an argument that his being right would cost a great deal.

Kurt Gödel answered one of Hilbert’s questions in his doctoral thesis of 1929, written when he was twenty-three: the completeness theorem of this chapter, proved for a Hilbert-style system rather than for NK. Two years later he showed that the consistency proof Hilbert wanted cannot be given, and the last chapter of this part of the course explains why.

The definition of satisfaction fits Frege’s view of truth. A sentence is about some things, and the things are there, determinate, whether or not anyone is looking. The sentence is true or false according to how they are, and it has its truth value before anyone finds out which value it is, and whether or not anyone ever does.27

Bivalence is no discovery about this picture. It was built into the definition of satisfaction when the clause for negation was written, and it says, in a single line, that every sentence has in every structure exactly one of two truth values.

Tarski gave this picture a precise form. His definition of truth, published in 1933, is the one of Section 6.3, and his definition of consequence, presented in 1935 at the Paris congress of the Unity of Science movement, is the one of Section 6.4. The second answered Carnap, who had tried in Logische Syntax der Sprache (Carnap, 1934) to define consequence by the shapes of sentences alone, without mentioning truth. Tarski used Gödel’s incompleteness theorem (Chapter 8) to show that no definition by finitely many rules of inference can do the job, and objected that Carnap’s own definition depends on special features of his language. Carnap, who had met Tarski in Vienna and Warsaw in 1930, became the most energetic convert to semantics and built his Introduction to Semantics (Carnap, 1942) on Tarski’s work. Others in the Vienna Circle, Otto Neurath above all, suspected that talk of truth was metaphysics returning by the back door. With these definitions Gödel’s theorem can be read as showing that, on this picture, the classical system is exactly right. On this view the law of the excluded middle is not a rule that we chose but a law of truth, and a proof system without it fails to see some truths. Gentzen’s NK of 1934 gave the proofs the form used here, and the proof of completeness in this chapter is Henkin’s of 1949. He found it by accident, as a graduate student at Princeton, while trying to prove something else, and he tells the story in Henkin (1996); it is now the proof in every textbook. Figure 6.9 collects the dates.

WhoWhenWhat
Frege1879quantifiers; proofs checked by their shape
Frege; Russell1893–1902logicism; the paradox in its laws
Hilbert1920sa programme to prove mathematics safe
Gödel1929completeness
Gödel1931incompleteness
Tarski1933; 1936definitions of truth and of consequence
Gentzen1934NJ and NK
Henkin1949the proof of completeness used here
Figure 6.9. Classical logic and its semantics: who did what.

Summary

A system is modelled as a structure: a non-empty set of things, with a meaning for each symbol of a signature. A sentence is true or false in a structure by a definition with one clause per symbol. Its two quantifier clauses loop over the domain, so on a finite structure the definition is an algorithm.

A theory entails a sentence when the sentence is true in every model of the theory; for a theory that describes a system, this means “true of every system that meets it”. The derivations of NJ are finite certificates, and they are sound: they never lead from truths to a falsehood. They do not reach every sentence that is entailed, and the whole of the gap is one law, excluded middle.

Adding excluded middle gives NK, which is sound and complete, so a theory entails a sentence exactly when the sentence has a derivation from it. The price is that a proof of an existential sentence no longer says what exists.

Exercises

The exercises run from practice to proof.

  • Exercises 6.1 to 6.6 use the definitions on particular sentences and structures;

  • Exercises 6.7 to 6.12 ask for derivations and for the arguments behind the claims about NJ and NK;

  • Exercises 6.13 to 6.17 fill in the proofs that the text left to the reader.

Exercise 6.1. Let Σ have a constant symbol c, a one-place function symbol f, one-place relation symbols P and Q, and two-place relation symbols R and =. Let A be the Σ-structure with domain {0,1,2,3,4} in which

  • c names 0;

  • f sends 0 to 0 and every other n to n−1;

  • P is {0,2,4} and Q is {1,3};

  • R is greater than, and = is identity.

Read P(x) as “x is even”, Q(x) as “x is odd”, R(x,y) as “x is greater than y” and f(x) as “the predecessor of x”. Translate the following into Σ, and say whether each is true in A:

  1. every even number is greater than every odd number;

  2. only 0 is the predecessor of its own predecessor.

Translate the following into English, and say whether each is true in A:

  1. ∀x(P(x)→∃y(Q(y)∧f(y)=x));

  2. ∃x∀y(x≠y→R(x,y)).

Exercise 6.2. Let Σ have a constant symbol c, a one-place function symbol f, one-place relation symbols P and Q, and a two-place relation symbol R. Let B be the Σ-structure with domain {1,2,3,4,5} in which c names 1, R is less than, and f, P and Q are given by the table

n12345f(n)11122in P?nononoyesyesin Q?yesyesnonono

Evaluate each of the following in B by a table with one row for each value of the outermost variable:

  1. ∀x(P(x)→Q(f(x)));

  2. ∀x(P(x)∨Q(x));

  3. ∃xR(x,f(x)).

Exercise 6.3. Let Σ have a constant symbol c, a one-place function symbol f and the two-place relation symbol =. Let A and B be the Σ-structures in which = is identity, c names 1, and

  • A has domain {1,2,3,4,5}, and f sends 1, 2 and 3 to 1 and sends 4 and 5 to 2;

  • B has domain {1,2,3,4}, and f sends 1 and 2 to 1 and sends 3 and 4 to 2.

Find a Σ-sentence that is true in A and false in B, and check both verdicts against the definition of satisfaction.

Exercise 6.4. Let Σ have a constant symbol c, a one-place function symbol f, a one-place relation symbol P and a two-place relation symbol R, and let φ be the formula

∀y(R(y,x)→P(y)).

Apply the recursion in the definition of substitution to put c, f(z) and f(y) in turn for x in φ, and say which of the three terms are substitutable for x in φ.

Exercise 6.5. Let Σ have a constant symbol c, a one-place function symbol f, one-place relation symbols P and Q, and the two-place relation symbol =. For each of the following, find a counter-model as small as you can make it, check it against the definition of satisfaction, and say why no smaller structure will do.

  1. ∃xP(x)⊨P(c);

  2. ∀x(P(x)∨Q(x))⊨∀xP(x)∨∀xQ(x);

  3. Q(c), ∀x(Q(x)→∃y(f(y)=x∧y≠x))⊨∃x(Q(x)∧x≠c), in structures that interpret = as identity.

Exercise 6.6. Let Σ have a constant symbol c, a one-place function symbol f, and two-place relation symbols R and =, and let Θ be the theory consisting of the two sentences

T1: ∀x¬R(x,x),T2: ∀x(x≠c→R(f(x),x)).

For each sentence, decide whether Θ entails it. If it does, give a derivation in NK; if not, give a counter-model in which = is identity.

  1. ¬R(c,c);

  2. ∀x(R(f(x),x)∨x=c);

  3. ∀x¬R(x,f(x));

  4. ∃xR(f(x),x).

Exercise 6.7. Give a derivation of Peirce’s law, ((φ→ψ)→φ)→φ, in NK, for all formulas φ and ψ.

Exercise 6.8. Let Σ be a signature containing the two-place relation symbol =, and EqΣ its equality axioms (Definition 6.36). Show that

EqΣ⊢NJ∀x∀y(x=y→y=x)

and

EqΣ⊢NJ∀x∀y∀z(x=y→(y=z→x=z)).

Exercise 6.9. Let P be a one-place relation symbol. Someone offers a derivation witnessing ∃xP(x)⊢NJ∀yP(y), as follows: from ∃xP(x), and the derivation of P(y) from the supposition [P(y)] (a single leaf), conclude P(y) by (∃E); then conclude ∀yP(y) by (∀I). Take the structure with domain {1,2} in which P is {1}, and an assignment sending y to 2. List the formulas of the derivation with their open hypotheses and truth values, as in Remark 6.43, find the first line that is false while all its open hypotheses are true, and say which side condition it breaks.

Exercise 6.10.

  1. Show that if NJ derived every instance of Peirce’s law, ((φ→ψ)→φ)→φ, it would derive p∨¬p.

  2. Show the same for every instance of ¬∀x¬ψ→∃xψ.

  3. Show that ¬∀xψ⊢NK∃x¬ψ for every formula ψ.

Exercise 6.11. In a signature with two constants a and b and a one-place relation symbol Dr, show that NK derives ∃x(Dr(x)→∀yDr(y)) but derives Dr(t)→∀yDr(y) for no term t. Why does it not help that there are now closed terms to choose from?

Exercise 6.12. Show that ¬(φ→ψ)⊢NJ¬ψ and ¬(φ→ψ)⊢NJ¬¬φ, and that ¬(φ→ψ)⊢NKφ. Does NJ derive the last?

Exercise 6.13. Write out the cases (∧E) and (∃I) of the soundness proof for NJ. Which lemma does the second case need?

Exercise 6.14. Prove the relevance lemma: first for terms (if s and s′ agree on var(t), then Vals(t)=Vals′(t)), and then for formulas, by induction.

Exercise 6.15.

  1. Prove, by induction on the term u, that if t is a term then

    Vals(u[t/x])=Vals[Vals(t)/x](u).
  2. Deduce from (a) the atomic case of the substitution lemma.

  3. Where would the induction for formulas use the hypothesis that t is substitutable for x?

Exercise 6.16.

  1. Prove part (ii) of the lemma on maximal consistent sets.

  2. Prove the existential case of the truth lemma, and say where the witness property is used.

Exercise 6.17. Let P and Q be one-place relation symbols and c0 a constant symbol, and let Γ be {∃xP(x), ∃xQ(x), ¬∃x(P(x)∧Q(x))}.

  1. Show that Γ is consistent.

  2. Show that Γ, together with ∃xP(x)→P(c0) and ∃xQ(x)→Q(c0), derives ⊥ in NJ.

  3. Which condition of the lemma on Henkin witnesses does the second added sentence break?

References

  • Errett Bishop. Foundations of Constructive Analysis. McGraw-Hill, New York, 1967.
  • L. E. J. Brouwer. Over de Grondslagen der Wiskunde. PhD thesis, Universiteit van Amsterdam, 1907.
  • L. E. J. Brouwer. De onbetrouwbaarheid der logische principes. Tijdschrift voor Wijsbegeerte, 2:152–158, 1908. English translation, “The unreliability of the logical principles”, in Brouwer, Collected Works, vol. 1, North-Holland, 1975.
  • Tim Button and Sean Walsh. Philosophy and Model Theory. Oxford University Press, Oxford, 2018.
  • Rudolf Carnap. Logische Syntax der Sprache. Springer, Wien, 1934.
  • Rudolf Carnap. Introduction to Semantics. Harvard University Press, Cambridge, MA, 1942.
  • E. F. Codd. A relational model of data for large shared data banks. Communications of the ACM, 13(6):377–387, 1970.
  • Michael Dummett. The philosophical basis of intuitionistic logic. In H. E. Rose and J. C. Shepherdson, editors, Logic Colloquium ’73, pages 5–40. North-Holland, Amsterdam, 1975.
  • Michael Dummett. Elements of Intuitionism. Oxford University Press, Oxford, second edition, 2000.
  • Anita Burdman Feferman and Solomon Feferman. Alfred Tarski: Life and Logic. Cambridge University Press, Cambridge, 2004.
  • Gottlob Frege. Begriffsschrift, eine der arithmetischen nachgebildete Formelsprache des reinen Denkens. Louis Nebert, Halle, 1879. English translation by S. Bauer-Mengelberg in J. van Heijenoort (ed.), From Frege to Gödel, Harvard University Press, 1967, pp. 1–82.
  • Gottlob Frege. Grundgesetze der Arithmetik. Hermann Pohle, Jena, 1893. Volume I 1893, volume II 1903.
  • Gottlob Frege. Der Gedanke. Eine logische Untersuchung. Beiträge zur Philosophie des deutschen Idealismus, 1:58–77, 1918. English translation, “The thought: a logical inquiry”, Mind 65 (1956), 289–311.
  • Gerhard Gentzen. Untersuchungen über das logische Schließen I, II. Mathematische Zeitschrift, 39:176–210, 405–431, 1934. Appeared 1934–35; English translation in The Collected Papers of Gerhard Gentzen, ed. M. E. Szabo, North-Holland, 1969.
  • Kurt Gödel. Die Vollständigkeit der Axiome des logischen Funktionenkalküls. Monatshefte für Mathematik und Physik, 37:349–360, 1930. Doctoral dissertation, Vienna, 1929.
  • Kurt Gödel. Zur intuitionistischen Arithmetik und Zahlentheorie. Ergebnisse eines mathematischen Kolloquiums, 4:34–38, 1933.
  • Timothy G. Griffin. A formulae-as-types notion of control. In Proceedings of the 17th ACM Symposium on Principles of Programming Languages (POPL), pages 47–58, 1990.
  • Leon Henkin. The completeness of the first-order functional calculus. Journal of Symbolic Logic, 14(3):159–166, 1949.
  • Leon Henkin. The discovery of my completeness proofs. Bulletin of Symbolic Logic, 2(2):127–158, 1996.
  • Arend Heyting. Die formalen Regeln der intuitionistischen Logik. Sitzungsberichte der Preussischen Akademie der Wissenschaften, Physikalisch-mathematische Klasse, pages 42–56, 1930.
  • David Hilbert. Über das Unendliche. Mathematische Annalen, 95:161–190, 1926. English translation in van Heijenoort (1967), pp. 367–392.
  • David Hilbert. Die Grundlagen der Mathematik. Abhandlungen aus dem Mathematischen Seminar der Hamburgischen Universität, 6:65–85, 1928. Lecture of 1927. English translation, “The foundations of mathematics”, in van Heijenoort (ed.), From Frege to Gödel, 1967, 464–479.
  • A. Kolmogoroff. Zur Deutung der intuitionistischen Logik. Mathematische Zeitschrift, 35:58–65, 1932.
  • A. N. Kolmogorov. O principe tertium non datur. Matematičeskij Sbornik, 32:646–667, 1925. English translation in van Heijenoort (1967), pp. 414–437.
  • Saul A. Kripke. A completeness theorem in modal logic. Journal of Symbolic Logic, 24(1):1–14, 1959.
  • Saul A. Kripke. Semantical analysis of intuitionistic logic I. In J. N. Crossley and M. A. E. Dummett, editors, Formal Systems and Recursive Functions, pages 92–130. North-Holland, Amsterdam, 1965.
  • Paolo Mancosu, editor. From Brouwer to Hilbert: The Debate on the Foundations of Mathematics in the 1920s. Oxford University Press, New York, 1998.
  • Open Logic Project. The Open Logic Text. https://openlogicproject.org, 2026. Release 9620cc7, 12 July 2026. Licensed CC BY 4.0.
  • Charles S. Peirce. On the algebra of logic: A contribution to the philosophy of notation. American Journal of Mathematics, 7(2):180–202, 1885.
  • Dag Prawitz. Natural Deduction: A Proof-Theoretical Study. Almqvist & Wiksell, Stockholm, 1965.
  • Raymond M. Smullyan. What Is the Name of This Book? Prentice-Hall, Englewood Cliffs, NJ, 1978.
  • Alfred Tarski. Der Wahrheitsbegriff in den formalisierten Sprachen. Studia Philosophica, 1:261–405, 1935. First published in Polish, 1933. English translation in Tarski, Logic, Semantics, Metamathematics, Oxford, 1956.
  • Alfred Tarski. Über den Begriff der logischen Folgerung. In Actes du Congrès International de Philosophie Scientifique, Paris 1935, volume VII, pages 1–11. Hermann, Paris, 1936.
  • Dirk van Dalen. The war of the frogs and the mice, or the crisis of the Mathematische Annalen. The Mathematical Intelligencer, 12(4):17–31, 1990.
  • Jean van Heijenoort, editor. From Frege to Gödel: A Source Book in Mathematical Logic, 1879–1931. Harvard University Press, Cambridge, MA, 1967.
  • Hermann Weyl. Über die neue Grundlagenkrise der Mathematik. Mathematische Zeitschrift, 10:39–79, 1921.

Notes

  1. The resemblance is no accident. Codd’s relational model of data (Codd, 1970), on which SQL rests, treats a database as a finite structure, and its query languages are first-order logic in other notation. ↩

  2. See Chapter 8. ↩

  3. This is Tarski’s definition of truth, from Tarski (1935), first published in Polish in 1933. Its point, for Tarski, was that truth for a formal language can be defined without circularity: the definition of “true” for ∀xφ uses “true” only for φ. It was written for mathematicians and philosophers, and forty years later it was the evaluator inside every database query engine. Tarski was born Alfred Teitelbaum and took the name Tarski in 1923. In August 1939 he left for a congress at Harvard, on the last ship to sail from Poland for the United States before the German invasion; from 1942 he taught at Berkeley (Feferman and Feferman, 2004). ↩

  4. Just as a local variable in a program hides an outer one of the same name. ↩

  5. This is Tarski’s definition of consequence (Tarski, 1936); the History tells how it answered Carnap’s. ↩

  6. Prawitz (1965) is the classic source. ↩

  7. Showing that no derivation exists needs a different kind of structure, which Section 6.8 describes. ↩

  8. Aristotle argues for it in Book Γ of the Metaphysics. In chapter 9 of On Interpretation he also raises the first recorded doubt about bivalence: is “there will be a sea battle tomorrow” already true or false today? ↩

  9. From Peirce (1885). Peirce, working at the same time as Frege and independently of him, also introduced quantifiers. ↩

  10. Gentzen named the two systems so in the paper that introduced them, Gentzen (1934). The usual explanation of the J is that German typography of the time treated the capitals I and J as one letter. Gentzen’s NK adds excluded middle as an axiom; a rule with no premisses, as here, comes to the same thing. ↩

  11. Gödel (1930) proved it for a Hilbert-style system. The proof given here is Henkin (1949)’s, and the History tells how both were found. ↩

  12. Open Logic Project (2026, §23.7) gives the details for any set of sentences that contains the equality axioms. ↩

  13. The name is from Smullyan (1978), who called it the drinking principle. Smullyan, a logician and a prolific inventor of logic puzzles, also performed as a professional magician. ↩

  14. Brouwer (1907) and Brouwer (1908), both in Dutch; the second is titled The unreliability of the logical principles. In the years that followed, Brouwer proved the theorems that made his name in topology, among them his fixed-point theorem, by exactly the kind of argument his philosophy rejected: the proof shows that a fixed point exists without showing how to find one. ↩

  15. Goldbach proposed a form of it in a letter to Euler in 1742, and Euler restated it in this form. It has been checked by computer for every even number up to 4×1018, which settles nothing. ↩

  16. The dispute was bitter. In 1921 Hermann Weyl, Hilbert’s former student, announced his conversion with the sentence “Brouwer, that is the revolution” (und Brouwer – das ist die Revolution) (Weyl, 1921); English translations of this paper, and of the other contributions to the debate, are collected in Mancosu (1998). Weyl later drifted back towards Hilbert. In 1928 Hilbert had Brouwer removed from the editorial board of the Mathematische Annalen, the leading journal of the day. Einstein, also on the board, refused to take sides and called the affair a Frosch-Mäusekrieg, a war of the frogs and the mice, after the ancient parody of Homer (van Dalen, 1990). ↩

  17. The rules were first written down by Kolmogorov (1925), for a fragment, and by Heyting (1930), in full; the explanation of the connectives is named after Brouwer, Heyting and Kolmogorov. Kolmogorov’s version (Kolmogoroff, 1932) reads formulas as problems: φ→ψ is the problem of solving ψ given a solution of φ. Gentzen’s NJ of 1934 is this logic in the form used here. ↩

  18. Kripke (1965). A structure with two stages, in which = grows from one stage to the next, makes the sentence of Example 6.48 fail, and that is how one shows that NJ cannot derive it. Kripke had published a completeness theorem for modal logic, by similar means, at the age of eighteen (Kripke, 1959). ↩

  19. Gödel (1933). Gentzen found the same translation independently, and withdrew his paper when Gödel’s appeared. ↩

  20. Dummett (1975); the book-length version is Dummett (2000). ↩

  21. Bishop (1967). ↩

  22. The separation is less clean than it looks. Griffin (1990) found that classical proofs are programs too, provided the programs may jump: the type of the control operator call/cc of Scheme is Peirce’s law. What such a program returns as a witness may later be taken back. ↩

  23. Frege (1879). Frege’s notation was two-dimensional, a branching diagram on the page, and almost nobody adopted it. The notation that survived descends instead from Peirce’s, by way of Schröder and Peano. ↩

  24. Frege added an afterword to the second volume, which begins: “Einem wissenschaftlichen Schriftsteller kann kaum etwas Unerwünschteres begegnen, als dass ihm nach Vollendung einer Arbeit eine der Grundlagen seines Baues erschüttert wird”: hardly anything less welcome can happen to a scientific writer than to have one of the foundations of his building shaken after the work is finished. Sixty years later Russell wrote that he knew of nothing to compare with Frege’s dedication to truth: with his life’s work collapsing, Frege “responded with intellectual pleasure clearly submerging any feelings of personal disappointment”. Both letters are in van Heijenoort (1967, pp. 124–128). ↩

  25. Hilbert (1926). ↩

  26. Hilbert (1928), quoted from the English translation in van Heijenoort (1967, p. 476). ↩

  27. Frege put it most directly in “The Thought”, Frege (1918), where a thought is true or false independently of whether anyone grasps it. ↩