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?

Definitions answer the first two questions. A theorem answers the third, though the first rules of proof we try turn out to fall short. Section 6.1 fixes the language in which sentences about a system are written. Section 6.2 makes a system into a mathematical object, a structure, and Section 6.3 defines when a sentence is true in one. 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, those of Gentzen’s natural deduction system NJ, and shows that they never lead from true premisses to a false conclusion. Section 6.6 finds that they miss some sentences that follow, all for want of a single law, and adds it: the law of the excluded middle, which gives the system NK. Section 6.7 proves NK 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 Syntax

The finance director’s claim is about one company, but the rules of the personnel system are not: they are meant to hold of every table the system can produce, of five people or five hundred, and each such table must be able to read them. So the claim cannot be written in terms of Thorne and Finch. It needs a vocabulary that any table of the right shape can interpret in its own way: a name for the chief executive, whoever she is, a symbol for the boss of, symbols for is an engineer and earns more than. Such a vocabulary is a signature, and it is the one new thing in this section. Given a signature, we name things (terms), we say things about the things named (atomic formulas), and we combine what we have said (formulas). That is the whole language, and its definitions follow one straight after another.

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.

To speak of a thing without naming it (anyone, something), the language has, besides the symbols of the signature, a countably infinite set Var of variables, x, y, z, x1, x2 and so on, disjoint from the symbols of every signature.

Definition 6.2 (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.

A term names something. A relation symbol applied to terms says something about the things named. That is the smallest statement the language can make, an atomic formula; ⊥ 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.3 (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.

That is the language. The next two examples give the two signatures that the rest of this chapter uses most.

Example 6.4 (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.

The terms ceo, boss(ceo) and boss(boss(ceo)) name the chief executive, her boss, and her boss’s boss, whoever those turn out to be; boss(x) names the boss of whoever 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: it is an atomic formula, “the chief executive is an engineer”, and so is Richer(boss(x),x), “the boss of x earns more than x”. Figure 6.2 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.2. Four sentences and their English.

The first is the finance director’s claim and the second is the claim with Thorne’s row allowed for. Nothing in them mentions Thorne: they are written in the signature, and any company that can read the signature can read them.

Example 6.5 (the counting numbers). The counting numbers 0,1,2,… are spoken of in the signature of arithmetic

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

with ar(s)=1 and ar(+)=ar(×)=ar(<)=2; the symbol s is read “the successor of”, the number after. The terms 0, s(0), s(s(0)), … are the numerals, one name for each number, and x+s(0) names the number after whatever x is. The formula x<s(x) says that x is less than its successor, the sentence ∀x∃y(x<y) that every number has a bigger one, and ¬∃x(x<0) that nothing is less than zero.

Remark 6.6 (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”.

Remark 6.7 (“every” goes with →, “some” with ∧). 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 third and fourth sentences of Figure 6.2 follow the rule. 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. The rule of thumb is reliable but not infallible.

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

The second notion turns a claim about anybody into a claim about somebody in particular. From “everyone earns less than their boss” anyone concludes that the chief executive earns less than hers, and the rule (∀E) of NJ makes the same move on the page: it puts a term in place of the variable, so that Richer(boss(x),x) becomes Richer(boss(ceo),ceo). This is substitution, an operation on strings, and it has 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. A last definition says when that cannot happen.

Definition 6.8 (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.9 (closed term; sentence). A term t is closed if var(t)=∅, and a formula φ is a sentence if FV(φ)=∅.

Definition 6.10 (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.11 (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).

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

Example 6.12 (the company, cont’d: variables). 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 x is free in it, 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.

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. In Eng(x)→∀xMgr(x), putting ceo in for x gives Eng(ceo)→∀xMgr(x), by the fourth line of the definition: only the free occurrence is replaced.

Capture is 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 term is not substitutable, since the free occurrence of x lies inside ∃yRicher(y,x) and y∈var(boss(y)).

The sentences of Figure 6.2 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 company: it is written in a signature, and every company that can read the signature reads it in its own way. To say when a sentence is true, we must first say what it is true of.

6.2 Structures

What a sentence is true of has two parts: what the symbols of the signature are taken to mean, and among what things. 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.3 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.3. 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. The relations, the functions and the named things are exactly what a signature has symbols for, and a structure is a system seen through a signature: it says which things there are and what each symbol means among them.

Definition 6.13 (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.14 (the company, cont’d: Tuesday’s table as a structure). 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.4 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.4. 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.3 have an infinite domain.

Example 6.15 (the counting numbers, cont’d: the structure). The counting numbers are the ΣA-structure 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.16 (the other three systems). The other three systems of Figure 6.3 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.17 (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 the empty structure out.

Remark 6.18 (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.19 (the company, cont’d: a near miss). Suppose the table left Thorne’s boss blank, since the chief executive has none. Leaving it blank is sensible, 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 they chose Thorne herself, which is why Harriet’s first query returned a row.

6.3 Satisfaction

A structure says what the symbols of a formula mean, and we already know what the logical words mean in English: 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 definition of truth writes that meaning down, one kind of formula at a time. 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.

One thing is still missing. A structure does not say what the variables stand for, and a formula with free variables, such as Richer(boss(x),x), is true or false only once they have been given values. So three definitions are needed, one after another: what the variables stand for, an assignment; what a term names, its value; and when a formula is true, satisfaction.

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.

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.

Definition 6.22 (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 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 formula ψ itself is left as it is: the clause changes the assignment, and puts no term into ψ. The structure could not do this job: it 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.

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.

The same clauses cover the simplest formulas of all, those built from propositional letters with ⊥ and the connectives, and there they reduce to something familiar. A propositional 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 ⟦p⟧M is either empty or all of D0, and the atomic clause makes p false or true accordingly. The assignment plays no part, since p has no terms. The clauses for ⊥ and the connectives then compute the truth of a formula from the truth of its parts.

So for a formula built from letters, whether M,s⊨φ depends only on which letters M makes true. For such formulas a structure amounts to a choice of true or false for each letter, a valuation. Propositional logic is the part of first-order logic in which every relation symbol has no places, and its structures are, in effect, the rows of a truth table.

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 the variables 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.23 (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 is how a proof passes from a claim about anybody to the same claim about somebody in particular. Satisfaction makes the same passage in its own way: the clause for ∀ lets x stand for each element in turn, by changing the assignment. Proofs are to be judged by truth, so the two passages had better agree: putting the term t in for x should come to the same as letting x stand for whatever t names. The next lemma says that they agree, provided no quantifier of φ captures a variable of t.

Lemma 6.24 (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.12 shows a case).

The proof, by induction on φ, is long and unilluminating, though not difficult, and we omit it, as most textbooks do. 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.

Remark 6.25 (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.

Remark 6.26 (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.

Example 6.27 (the company, cont’d: truth in Tuesday’s table). Work in C, under an assignment s. If 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, whatever s is, since the first line of the definition of value is never reached.

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, the sentence is true in C under s exactly when, 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, and no row consulted s: each replaced whatever s gave x by d. 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 that puzzles readers: 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.

A sentence with two quantifiers needs a witness inside each row. 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 e whose boss is Thorne and who is not Thorne; Finch will do.

  • For Finch, Bell will do.

So this sentence is true in C too. The evidence has a characteristic shape: for the universal quantifier we examined every row, and for each existential quantifier we produced one witness.

Example 6.28 (propositional logic). Take two letters, p and q. There are four valuations, one for each row below, and the clauses of Figure 6.5 compute the column of each connective from the columns of its parts. Writing T and F for true and false:

pq¬pp∧qp∨qp→qTTFTTTTFFFTFFTTFTTFFTFFT

The column for ¬p comes from the clause for → with ⊥, which is false in every row, as consequent. The column for p→q is false in one row only, the row in which p is true and q false.

A longer formula is evaluated the same way, part by part. For “if p implies q, and q is false, then p is false”:

pqp→q¬q(p→q)∧¬q¬p((p→q)∧¬q)→¬pTTTFFFTTFFTFFTFTTFFTTFFTTTTT

The last column is true in every row. Since every structure, under every assignment, gives p and q the truth values of one of the four rows, the formula is true in every structure under every assignment, whatever else its signature contains.

The formula (p→q)→(q→p), by contrast, is false in the third row: p→q is true there and q→p false. A structure that makes p false and q true falsifies it, and four rows were enough to find one. With n letters there are 2n rows to check.

6.4 Entailment

Satisfaction answers a question about one structure and one assignment: is this formula true here? Often, though, 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. So two definitions are needed: one for the requirements and the systems that meet them, and one for what follows from the requirements.

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.29 (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 Γ.

Definition 6.30 (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.

The two possible answers to “does Γ entail φ?” call for different kinds of evidence, and the two kinds are not on an equal footing. To show that an entailment fails, one structure suffices: a structure and an assignment that satisfy Γ and make φ false. That is a certificate, which anyone can check by evaluating formulas in it. To show that an entailment holds, one needs an argument, “let M be a model of the theory and d an element”, which can be 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. The last two examples of the section each show an entailment and a non-entailment.

Remark 6.31 (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.

Remark 6.32 (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.

Remark 6.33 (the conditional of science). The word “implies” is ambiguous in English, and English forms conditionals of several kinds. The clause for → fixes one of them: the law-like indicative conditional, the “if” with which mathematics and science state their laws. Newton’s first law is one: if a body is in motion, then it stays in motion unless an external force acts on it. Does the law hold of a body at rest? Of course it does. A law is a claim about everything, and a body at rest is a case it does not apply to; the law does not become false because it does not apply. It is broken only by a case it does apply to, a body in motion that stops with no force acting on it.

Read this way, a conditional is false only when its antecedent is true and its consequent false, which is the clause for →. Followed through, the reading arrives at two validities that look odd at first sight:

¬φ→(φ→ψ)andψ→(φ→ψ).

A case in which the antecedent fails does not break a law, whatever the consequent says, and neither does a case in which the consequent holds, whatever the antecedent says. So “if 2+2=5, then 1+1=3” is true, and “if n is even, then n2 is even” holds of every n, odd ones included.

This is not the conditional of conversation, which often promises a connection between its two halves, and still less the subjunctive or counterfactual, “if I had left earlier, I would have caught the bus”, whose antecedent is known to be false and which is nevertheless a substantial claim, about what would have followed. No clause that decides φ→ψ from the truth values of φ and ψ alone could capture those, and the definition of satisfaction needs exactly that: it decides an implication by deciding its two halves.6 The History tells how the clause came to be chosen, and why the two validities above have been called the paradoxes of material implication.

Remark 6.34 (the equality axioms). The symbol = is a two-place relation symbol like any other, and a structure may interpret it as any set of pairs. A system that compares names relies on two facts about identity, though: everything is equal to itself, and equals may be put for equals. Written as sentences of a signature Σ that contains =, these facts are the equality axioms of Σ:

  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, and every normal structure is a model of 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.

Remark 6.35 (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.36 (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.

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), from the formula Richer(u,w) with u and v for x and y, 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))).

Let Θ be the set consisting of R1, R2 and EqΣC: the theory of the personnel system, in the company signature. A normal structure is a model of Θ 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.

An entailment. Sharpened a little, the finance director’s question is whether the theory guarantees that nobody but the chief executive is her own boss:

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

It does. Let M be a model of Θ, and let d be an element of its domain with (d,⟦ceo⟧M)∉⟦=⟧M, so that x≠ceo is true under s[d/x]. Suppose that (⟦boss⟧M(d),d)∈⟦=⟧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.

So (⟦boss⟧M(d),d)∉⟦=⟧M: the formula boss(x)≠x is true under s[d/x], and so is the implication. For an element d with (d,⟦ceo⟧M)∈⟦=⟧M the implication is true by its clause. Since M and d were arbitrary, the entailment holds.

A non-entailment. Does the theory guarantee that no engineer is a manager, that is, does Θ⊨∀x(Eng(x)→¬Mgr(x)) hold? It does not. 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 one-person company is a model of Θ in which the sentence is false, and so the entailment fails.

The two answers have the two shapes the section described: the entailment needed an argument about an arbitrary model, and the non-entailment needed only one small structure, which anyone can check.

Example 6.38 (the counting numbers, cont’d: a theory of order). In the signature of arithmetic, let Θ< be the theory with the two sentences

O1: ∀x¬(x<x),O2: ∀x∀y∀z(x<y∧y<z→x<z).

Nothing is less than itself, and “less than” passes along chains. The counting numbers are a model of Θ<: no number is less than itself, and if l<m and m<n then l<n.

An entailment. The theory entails that “less than” never runs both ways:

Θ<⊨∀x∀y(x<y→¬(y<x)).

Let M be a model of Θ<, and d and e elements with (d,e)∈⟦<⟧M. Suppose that (e,d)∈⟦<⟧M as well. Then (d,d)∈⟦<⟧M, by O2 with d, e, d for x, y, z, and that contradicts O1. So (e,d)∉⟦<⟧M, the implication is true for d and e, and since M, d and e were arbitrary, the entailment holds.

A non-entailment. The sentence ∀x∃y(x<y), “every number has a bigger one”, is true in the counting numbers, but Θ< does not entail it. Take the structure with one element a, in which 0 names a, the function symbols s, + and × send everything to a, and < is empty. Then O1 holds, since nothing is less than anything; O2 holds, since its antecedent is never true; and ∀x∃y(x<y) is false at a.

So being true in the counting numbers is one thing, and following from a theory that the counting numbers satisfy is another: N satisfies many sentences that Θ< leaves open. Whether some theory settles every truth about N is the question of Chapter 8.

6.5 Soundness 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, each step of which a program can check, showing that the commitments made by Γ yield φ. Part 1 supplied a system of such proofs, Gentzen’s NJ. We write Γ⊢NJφ when some derivation in NJ has conclusion φ and all its open hypotheses in Γ, and OH(D) for the set of open hypotheses of a derivation D. A derivation is the certificate we asked for: a finite object, each step of which a program can check against the rules.

Two notions of consequence are now available, Γ⊨φ and Γ⊢NJφ. The first quantifies over all structures and assignments; the second asks for one finite object. 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 a derivation. This section proves the first.

Induction on derivations

Soundness is a claim about every derivation, and there are infinitely many derivations, of every size. A claim about every counting number is proved by induction: show it for 0, show that it passes from each n to n+1, and it holds for every number, since every number is reached from 0 by adding 1 again and again. Derivations are built in the same way, from leaves by rules, and the same method applies to them.

A derivation of NJ is either a single leaf, which is a hypothesis, or a rule applied to one, two or three smaller derivations, its immediate subderivations. Drawn as in Part 1, each smaller derivation is a triangle, with its name inside and its conclusion at the point, and the rule is a bar beneath them. The derivation that (→E) builds from D1 and D2, for instance, is

Two triangles, D1 concluding phi implies psi and D2 concluding phi, side by side above a bar labelled arrow elimination, with psi beneath.

Every derivation is reached by starting from leaves and adding one rule at a time. So to show that some property holds of every derivation, it is enough to show two things:

  • the base: the property holds of every single leaf;

  • the steps: for each rule, if the property holds of the immediate subderivations, then it holds of the derivation that the rule builds from them.

The supposition in a step, that the property holds of the smaller derivations, is the induction hypothesis. The base gives the property for the leaves; the steps then give it for every derivation with one rule, then for every derivation with two, and so on, so it holds for all of them. The relevance lemma was proved in the same way, by induction on formulas, with the atomic formulas as the base and one step for each connective and quantifier.

Which property? It cannot be “the conclusion is true”: a derivation reasons from suppositions, and a supposition may be false, and so may everything drawn from it. It cannot speak of a fixed set Γ either, since the open hypotheses change as a derivation grows: (→I) discharges one, so a subderivation may have an open hypothesis that the whole derivation lacks. The property must speak of each derivation’s own open hypotheses. For a derivation D with conclusion φ:

(S)  for every structure M and every assignment s into M, if every formula of OH(D) is true in M under s, then so is φ.

In words: the conclusion of a derivation can be false only where one of its open hypotheses is.

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

Proof. We show (S) for every derivation of NJ, by induction on derivations. The theorem follows from it: if Γ⊢NJφ, some derivation D has conclusion φ and OH(D)⊆Γ; if M,s⊨Γ, then every formula of OH(D) is true in M under s, and (S) makes φ true.

In each step below, the derivation D is displayed with its immediate subderivations as triangles. The induction hypothesis is that (S) holds for the subderivations. We fix a structure M and an assignment s, suppose that every formula of OH(D) is true in M under s, and show that the conclusion of D is.

For the connectives, how the formulas φ, ψ and χ are built does not matter. All that is used is whether each is true or false under s, and what the clause for the connective says, so in those steps the reader may think of φ, ψ and χ as propositional letters, each simply true or false. The quantifier rules are different: they look inside a formula, and they need the relevance and substitution lemmas.

The base. The derivation is a single leaf φ, whose only open hypothesis is φ itself, and φ is true by supposition.

The steps for the connectives.

  • (→I). The derivation D is

    A triangle D-prime, with phi in square brackets on its top edge, concluding psi, above a bar labelled arrow introduction, with phi implies psi beneath.

    and OH(D) is OH(D′) with φ removed. If φ is false under s, then φ→ψ is true by the clause for →, whether or not ψ is. If φ is true, then every formula of OH(D′) is true, since each is φ or in OH(D); so ψ is true by the induction hypothesis for D′, and φ→ψ is true by the clause for →.

  • (→E). The derivation D is the one displayed before the theorem, and OH(D) is OH(D1)∪OH(D2). Every formula of both sets is true under s, so by the induction hypothesis φ→ψ and φ are true. By the clause for →, φ is false or ψ is true; φ is true, so ψ is.

  • (∧I). The derivation D is

    Two triangles, D1 concluding phi and D2 concluding psi, above a bar labelled and introduction, with phi and psi beneath.

    and OH(D) is OH(D1)∪OH(D2). By the induction hypothesis φ and ψ are true, and by the clause for ∧ so is φ∧ψ.

  • (∧E). The derivation D is

    A triangle D-prime concluding phi and psi, above a bar labelled and elimination, with phi beneath.

    or the same with ψ beneath, and OH(D) is OH(D′). By the induction hypothesis φ∧ψ is true, and by the clause for ∧ both φ and ψ are.

  • (∨I). The derivation D is

    A triangle D-prime concluding phi, above a bar labelled or introduction, with phi or psi beneath.

    or the same with ψ in the triangle, and OH(D) is OH(D′). By the induction hypothesis φ is true, and by the clause for ∨ so is φ∨ψ.

  • (∨E). The derivation D is

    Three triangles above one bar labelled or elimination: D0 concluding phi or psi; D1, with phi in square brackets on its top edge, concluding chi; and D2, with psi in square brackets on its top edge, concluding chi. Beneath the bar, chi.

    and OH(D) is OH(D0), together with OH(D1) without φ and OH(D2) without ψ. The formulas of OH(D0) are true, so φ∨ψ is true by the induction hypothesis, and by the clause for ∨, φ is true or ψ is. If φ is, every formula of OH(D1) is true, since each is φ or in OH(D), and χ is true by the induction hypothesis for D1. If ψ is, the same argument applies to D2.

  • (⊥E). The derivation D is

    A triangle D-prime concluding falsum, above a bar labelled falsum elimination, with phi beneath.

    and OH(D) is OH(D′). By the induction hypothesis ⊥ is true under s, which its clause forbids. So no M,s makes every formula of OH(D) true, and (S) holds for D because there is no case to check.

The steps for the quantifiers.

  • (∀E). The derivation D is

    A triangle D-prime concluding for all x phi, above a bar labelled for-all elimination, with phi with t for x beneath.

    with t substitutable for x in φ, and OH(D) is OH(D′). By the induction hypothesis ∀xφ is true under s, so by the clause for ∀ the formula φ is true under s[d/x] for every element d, in particular for d=Vals(t), and by the substitution lemma φ[t/x] is true under s.

  • (∃I). The derivation D is

    A triangle D-prime concluding phi with t for x, above a bar labelled exists introduction, with there exists x phi beneath.

    with t substitutable for x in φ, and OH(D) is OH(D′). By the induction hypothesis φ[t/x] is true under s, by the substitution lemma φ is true under s[Vals(t)/x], and by the clause for ∃, with d=Vals(t), the formula ∃xφ is true under s.

  • (∀I). The derivation D is

    A triangle D-prime concluding phi with y for x, above a bar labelled for-all introduction, with for all x phi beneath.

    where y is free in no formula of OH(D′), which is OH(D), and not free in ∀xφ. We must show that φ is true under s[d/x] for every element d. Let d be an element and s′=s[d/y]. Since y is free in no formula of OH(D′),

    the formulas of OH(D′) are true under s′by relevance,φ[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 kept the open hypotheses true when the value of y was changed to d. Had y been free in one of them, the change might have made it false, and the induction hypothesis would have told us nothing about s′.

  • (∃E). The derivation D is

    Two triangles above one bar labelled exists elimination: D1 concluding there exists x phi, and D2, with phi with y for x in square brackets on its top edge, concluding chi. Beneath the bar, chi.

    where y is free neither in χ, nor in ∃xφ, nor in the formulas of OH(D2) other than φ[y/x]; and OH(D) is OH(D1) together with OH(D2) without φ[y/x]. By the induction hypothesis for D1, ∃xφ is true, so there is an element d with φ true under s[d/x]. Let s′=s[d/y]. Then

    φ[y/x] is true under s′by relevance and substitution,the rest of OH(D2) is true under s′by relevance,χ is true under s′by the induction hypothesis,χ is true under sby relevance.

    The first line uses that y is not free in ∃xφ, unless it is x; the second that y is free in no other open hypothesis; the last that y is not free in χ.

This completes the induction, and with it the proof. □

Four rules carried all the weight. Two discharge a supposition, (→I) and (∨E), and there the open hypotheses of the whole are fewer than those of the parts. Two have a side condition on a variable, (∀I) and (∃E), and there the relevance and substitution lemmas were needed. The other seven follow from the clause for their connective or quantifier, two of them with the substitution lemma as well. Exercise 6.13 tries the method on a rule that is not sound, to see where it breaks.

Example 6.40 (the company, cont’d: a derivation). The entailment of Example 6.37 has a derivation:

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

It is the argument of that example written as a tree. 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. Compare the tree with the argument of Example 6.37: “let d be an element” is the (∀I) at the root, “suppose that” is each (→I), and “by R2” is a (∀E) followed by a (→E). By soundness the tree is a second proof of the entailment, and one that a program can check.

6.6 The Law of the Excluded Middle

Is NJ also complete? It is not.

Theorem 6.41 (incompleteness of NJ). There are a set of formulas Γ and a formula φ such that Γ⊨φ but Γ⊬NJφ.

The proof uses a property of NJ proved in Part 1: a derivation of a disjunction from no hypotheses can be straightened into one that ends with (∨I), and so it says which disjunct holds.

Fact 6.42 (disjunction property, from Part 1). If ⊢NJψ∨χ, then ⊢NJψ or ⊢NJχ.

Proof of the theorem. Take Γ empty, and φ the sentence p∨¬p for a propositional letter p.

The sentence is valid. In every structure, under every assignment, p is true or false, and when it is false, ¬p is true.

It has no derivation in NJ. Suppose that ⊢NJp∨¬p. By the disjunction property (Fact 6.42), 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 some structure makes it true and another makes it 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 not confined to excluded middle: the next example meets it again.

Remark 6.43 (two senses of incompleteness). The word incompleteness in the theorem 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.44 (the company, cont’d: one negation too many). The finance director could have put his question the other way round: not “nobody but the chief executive is her own boss” but “whoever is their own boss is the chief executive”,

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

The two sentences are true in the same structures, each being the other’s contrapositive, and Θ entails the second as it entails the first. Let M be a model of Θ and d an element with (⟦boss⟧M(d),d)∈⟦=⟧M. Then:

  • either d is the chief executive or not;

  • if so, there is nothing to show;

  • if not, the argument of Example 6.37 gives a contradiction, so d is the chief executive after all.

Can NJ derive it?

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

The rules do not provide the either … or not. They do provide the following:

  • suppose boss(x)=x and x≠ceo;

  • then, as in Example 6.40, absurdity;

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

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

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.45 (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.46 (the company, cont’d: a derivation in NK). The sentence of Example 6.44 is derivable in NK: Θ⊢NK∀x(boss(x)=x→x=ceo). The derivation is the argument of that example written as a tree, and most of it is already built: the piece E of Example 6.40 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 of ⊥, followed by (⊥E) to reach x=ceo, the conclusion both cases of the split must share. The (∀I) step is legal for the same reason as before: only R1, R2 and ERicher remain open.

Theorem 6.47 (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, the rule (LEM): its conclusion φ∨¬φ rests on no open hypotheses, so it must be true in every structure under every assignment. By bivalence it is: the clause for negation makes one of φ and ¬φ true. □

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.48 (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.

How might one prove such a thing? The theorem is an implication, and its antecedent is the hard side to use. Γ⊨φ says that φ is true in every model of Γ, and a proof would have to start from that and arrive at a derivation, a finite object that the antecedent gives no hint of. The standard move when an antecedent is hard to use is to prove the contrapositive instead:

if Γ⊬NKφ then Γ⊭φ.

The antecedent is now a failure to derive, which seems to carry no information at all, but the conclusion has become easier to reach. Γ⊭φ asks only for one structure, a model of Γ in which φ is false, and a single structure is something we can hope to build.

Both sides of the contrapositive can be rephrased in terms of one set, Γ∪{¬φ}. The conclusion says that some structure satisfies every member of Γ and falsifies φ; by the clause for negation, a structure falsifies φ exactly when it satisfies ¬φ, so the conclusion says that Γ∪{¬φ} has a model. The antecedent says that φ has no derivation from Γ, and it too is a fact about Γ∪{¬φ}: that ⊥ has no derivation from it. For if the set derived ⊥, (→I) would turn that derivation into one of ¬¬φ from Γ, and (DN) into one of φ. A set from which ⊥ cannot be derived has a name.

Definition 6.49 (consistency). A consistent set is one from which the rules cannot derive absurdity.

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

Keep the two notions 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 already gives one direction: a set with a model is consistent, since ⊥ is true in no structure and a derivation of it would make ⊥ true in the model. We record the two rephrasings as a lemma.

Lemma 6.50 (two reformulations). Let Γ be a set of sentences and φ a sentence.

  1. Γ⊭φ if and only if Γ∪{¬φ} has a model.

  2. Γ⊬NKφ if and only if Γ∪{¬φ} is consistent.

Proof.

  • (i) A structure is a model of Γ in which φ is false exactly when it is a model of Γ and of ¬φ, by the clause for negation.

  • (ii) If Γ∪{¬φ} derived ⊥, then Γ would derive ¬¬φ by (→I), and φ by (DN). Conversely, if Γ derived φ, then Γ∪{¬φ} would derive ⊥ by (→E).

□

Put together, the contrapositive reads: if Γ∪{¬φ} is consistent, then it has a model. The set Γ∪{¬φ} is just some set of sentences, and nothing about how it arose will be of any use in building its model. So we may as well drop the Γ and the φ and prove the statement for every set of sentences. Figure 6.8 records the chain of rephrasings.

Four statements in a column, each rewritten into the next. First, completeness: if Gamma entails phi then Gamma derives phi in NK. Arrow labelled contrapositive. Second: if Gamma does not derive phi then Gamma does not entail phi. Arrow labelled by the two reformulations, (ii) on the left and (i) on the right. Third: if Gamma together with not phi is consistent then it has a model. Arrow labelled: forget where the set came from. Fourth, model existence: if Theta is consistent then Theta has a model.
Figure 6.8. From completeness to model existence.

Lemma 6.51 (model existence). Let Σ be a countable signature. Every consistent set of Σ-sentences has a model.

In words: a theory that does not contradict itself describes something. The lemma is the whole of the completeness theorem in another form, and the rest of the section proves it. Completeness follows from it at once.

Proof of the completeness theorem, from the lemma. Suppose that Γ⊬NKφ. Then

Γ∪{¬φ} is consistentby reformulation (ii),Γ∪{¬φ} has a modelby the model existence lemma,Γ⊭φby reformulation (i).

This is the contrapositive of the theorem. □

A theory that behaves like a model

We are handed a consistent set of sentences Θ and must produce a structure in which every one of them is true. The only material in sight is Θ itself, so we build the structure out of what Θ says. Its elements will be the names that the signature provides, the closed terms, and a relation will hold of some names exactly when Θ says that it does. A constant c will name the element c, the term boss(c) the element boss(c), and so on: the structure is made of its own names. This is the boldest idea in the proof, and the rest of the section makes it work.

For which theories can it work? Look at the set of sentences true in a structure in which every element has a name. Satisfaction says how that set behaves: it contains ψ∧χ exactly when it contains both conjuncts, ψ∨χ exactly when it contains at least one disjunct, ∀xψ exactly when it contains every instance ψ[t/x], and so on through the clauses. A theory that behaved in the same way would carry all the information that a structure carries, and nothing more would be needed to read a structure off it. So we make the clauses into a definition.

Definition 6.52 (model-like theory). A model-like theory treats the connectives and quantifiers as satisfaction does, with membership in place of truth and closed terms in place of elements.

Formally, a set Θ of Σ-sentences is model-like if the clauses of Figure 6.9 hold for all Σ-sentences ψ and χ, and, in the two quantifier clauses, for every Σ-formula ψ whose only free variable is x.

The clauses of a model-like theory, one per line. Falsum is not in Theta. psi and chi is in Theta iff psi is in Theta and chi is in Theta. psi or chi is in Theta iff psi is in Theta or chi is in Theta. psi implies chi is in Theta iff psi is not in Theta or chi is in Theta. For all x psi is in Theta iff psi with t for x is in Theta for every closed term t. There exists x psi is in Theta iff psi with t for x is in Theta for some closed term t.
Figure 6.9. The clauses of a model-like theory.

Set Figure 6.9 beside Figure 6.5: it is the definition of satisfaction with “∈Θ” in place of “M,s⊨”, and closed terms in place of elements of the domain. In words, a model-like theory is the list of truths of a structure, kept by someone who has the list and nothing else. Since it behaves like a model, we may as well make it into one.

Definition 6.53 (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 signature with at least one constant symbol, and Θ a set of Σ-sentences. The term structure of Θ 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 is not empty, since the signature has a constant symbol. By induction on terms, every closed term t names itself: Vals(t)=t under every assignment s. So every element of the domain 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. The difficulty of an element without a name cannot arise, because the elements are the names.

Lemma 6.54 (truth lemma). Let Σ have at least one constant symbol and Θ be a model-like set of Σ-sentences. 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.) In each case a clause of satisfaction meets the matching clause of Figure 6.9.

  • Atomic sentences. Since every closed term names itself, MΘ⊨R(t1,…,tn) exactly when (t1,…,tn)∈⟦R⟧MΘ, that is, by the definition of ⟦R⟧MΘ, exactly when R(t1,…,tn)∈Θ.

  • ⊥. Neither side holds: ⊥ is true nowhere, and ⊥∉Θ.

  • ψ∨χ.

    MΘ⊨ψ∨χiffMΘ⊨ψ or MΘ⊨χby the clause of satisfaction for ∨iffψ∈Θ or χ∈Θby the induction hypothesisiffψ∨χ∈Θby the clause for ∨ of Figure 6.9.
  • ψ∧χ and ψ→χ. The same, with the clauses for ∧ and →.

  • ∀xψ.

    MΘ⊨∀xψiffMΘ⊨ψ[t/x] for every closed tsince every element is a nameiffψ[t/x]∈Θ for every closed tby the induction hypothesisiff∀xψ∈Θby the clause for ∀ of Figure 6.9.
  • ∃xψ. The same, with “some” for “every”.

□

Corollary 6.55 (a model-like theory has a model). Over a signature with at least one constant symbol, every model-like set of sentences Θ has a model, its term structure MΘ.

Proof. By the truth lemma, every member of Θ is true in MΘ. □

What a consistent theory already has

The question is now how to turn a given consistent theory into a model-like one. Some of the work is free. Call a set of sentences Θ closed under derivation if every sentence that NK derives from Θ is in Θ. Closing a consistent theory costs nothing: add everything it derives, and the result is still consistent, since whatever the enlarged set derives, the original set already derived. A consistent theory closed under derivation already satisfies half of Figure 6.9, and each half-clause comes from a single rule.

Lemma 6.56 (what closure gives). Let Θ be consistent and closed under derivation. Then, for all sentences ψ and χ and every formula ψ whose only free variable is x:

  1. ⊥∉Θ;

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

  3. if ψ∈Θ or χ∈Θ, then ψ∨χ∈Θ;

  4. if ψ→χ∈Θ and ψ∈Θ, then χ∈Θ; and if χ∈Θ, then ψ→χ∈Θ;

  5. if ∀xψ∈Θ, then ψ[t/x]∈Θ for every closed term t;

  6. if ψ[t/x]∈Θ for some closed term t, then ∃xψ∈Θ.

Proof. Part (i) is consistency, since a leaf ⊥ would be a derivation of ⊥. In each other part, the rule named derives the sentence that the part says is in Θ from the sentences it is said to follow from, and closure puts it in Θ:

  • (ii) (∧E) from left to right, (∧I) from right to left;

  • (iii) (∨I);

  • (iv) (→E), and (→I) discharging nothing;

  • (v) (∀E);

  • (vi) (∃I).

□

What is missing is the other half of four clauses:

  • ∨: from ψ∨χ∈Θ to ψ∈Θ or χ∈Θ;

  • →: from ψ∉Θ to ψ→χ∈Θ;

  • ∃: from ∃xψ∈Θ to some instance ψ[t/x]∈Θ;

  • ∀: from every instance ψ[t/x]∈Θ to ∀xψ∈Θ.

These four halves come down to two pieces of information that a theory can lack and a structure cannot: which disjunct, and which witness. A consistent theory can contain p∨q without p or q, and ∃xP(x) without any P(t). The first two halves need a theory that decides every sentence, and the Lindenbaum construction supplies one. The last two need named witnesses, and the Henkin construction supplies them.

Deciding every sentence: the Lindenbaum construction

Definition 6.57 (maximal consistency). A maximal consistent set is a consistent set that takes a side on every sentence.

Formally, a set Δ of Σ-sentences is maximal consistent if

  • it is consistent, and

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

Lemma 6.58 (Lindenbaum). Let Σ be countable. Every consistent set Θ of Σ-sentences is contained in a maximal consistent set of Σ-sentences, which we write L(Θ).

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 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 L(Θ)=⋃n∈NΔn.

  • Every sentence or its negation belongs to L(Θ), since ψn was decided at step n.

  • Each Δn is consistent, by induction on n. The set Δ0=Θ is consistent by hypothesis. If Δn is consistent, so is Δn+1: if both Δn∪{ψn} and Δn∪{¬ψn} derived ⊥, then by (→I) the set Δn would derive both ¬ψn and ¬¬ψn, and hence ⊥.

  • So L(Θ) is consistent: a derivation of ⊥ from it uses finitely many hypotheses, and they all 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 the question is to be answered; it needs only that the question has an answer. So the proof shows that L(Θ) exists without constructing it. Nor is the result unique, since another order of the list can give another maximal consistent set; L(Θ) names the result for one list, fixed once and for all, and the proof needs only one.

A set that takes a side on every sentence supplies the two propositional clauses.

Lemma 6.59 (maximal consistent sets). Let Δ be maximal consistent. Then

  1. Δ is closed under derivation;

  2. if ψ∨χ∈Δ, then ψ∈Δ or χ∈Δ;

  3. if ψ∉Δ, then ψ→χ∈Δ.

In words: a maximal consistent set satisfies every clause of Figure 6.9 except, perhaps, the two for the quantifiers.

Proof. In each part, suppose the conclusion fails and derive ⊥ from Δ, against consistency.

  • (i) If Δ derives ψ but ψ∉Δ, then ¬ψ∈Δ, and (→E) derives ⊥.

  • (ii) If ψ∨χ∈Δ and neither disjunct is, then ¬ψ and ¬χ are, and (∨E) derives ⊥ from the three.

  • (iii) If ψ∉Δ, then ¬ψ∈Δ. From a supposition ψ, the rule (→E) gives ⊥ and (⊥E) gives χ, so (→I) derives ψ→χ from Δ, and it is in Δ by (i).

□

Together with the lemma on what closure gives, this lemma leaves only the quantifier clauses. They can fail in a maximal consistent set, because the closed terms may not name enough elements: the set may contain ∃xψ and the negation of every instance of ψ (Example 6.68 at the end of the section shows a case).

Naming the witnesses: the Henkin construction

The remedy is to add names: a new constant symbol for every existential sentence, and a sentence that makes it the witness, ∃xψ→ψ[c/x]. Provided that each name is new, the enlarged set stays consistent. The lemma that says so rests on a fact about derivations: a constant about which nothing is assumed is as good as a variable.

Lemma 6.60 (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.61 (Henkin). 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 the set

H(Θ):=Θ∪{θ0,θ1,θ2,…}

of Σ+-sentences is consistent.

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

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. A derivation of ⊥ uses finitely many hypotheses, so it is enough to show that every Θn=Θ∪{θ0,…,θn−1} is consistent. We do so by induction on n. The set Θ0=Θ is consistent, as just shown; it remains to show that if Θn is consistent, then so is Θn∪{θn}, which is Θn+1.

Suppose that Θn∪{θn} is inconsistent. 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. □

Remark 6.62 (why the witnesses must be new). Two small sets show what the proviso 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 would derive P(c) and ¬P(c). A name already in use carries information, and a witness must carry none.

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) in another guise: the witness must be a name about which nothing has been assumed.

Once the witnesses are named, a maximal consistent set supplies the two quantifier clauses.

Lemma 6.63 (the quantifier clauses). Let Δ be a maximal consistent set of Σ+-sentences that contains H(Θ). Then, for every Σ+-formula ψ whose only free variable is x:

  1. if ∃xψ∈Δ, then ψ[t/x]∈Δ for some closed term t;

  2. if ψ[t/x]∈Δ for every closed term t, then ∀xψ∈Δ.

Proof. Recall that Δ is closed under derivation, by the lemma on maximal consistent sets.

  • (i) The sentence ∃xψ is some ∃xnψn of the list, and θn∈H(Θ)⊆Δ. By (→E), Δ derives ψn[dn/xn], which is in Δ by closure, and dn is a closed term.

  • (ii) Suppose that every instance ψ[t/x] is in Δ but ∀xψ is not. Then

    ¬∀xψ∈Δsince Δ takes a side,∃x¬ψ∈Δby Exercise 6.10 and closure,¬ψ[t/x]∈Δ for some closed tby (i),

    and with ψ[t/x]∈Δ the rule (→E) derives ⊥, against consistency.

□

Putting it together

Henkin’s construction names the witnesses, Lindenbaum’s then decides every sentence, and the three lemmas just proved say that the result is model-like. Figure 6.10 draws the route.

A pipeline of five boxes from left to right. Theta: consistent, over Sigma. Arrow labelled Henkin. H of Theta: consistent, over Sigma plus, every existential sentence has a named witness. Arrow labelled Lindenbaum. L of H of Theta: maximal consistent, so model-like. Arrow labelled term structure. The term structure of L of H of Theta: true equals member, by the truth lemma. Arrow labelled forget the new constants. A Sigma-structure that is a model of Theta.
Figure 6.10. From a consistent theory to a model.

Proof of the model existence lemma. Let Θ be a consistent set of Σ-sentences, with Σ countable.

  1. H(Θ) is a consistent set of Σ+-sentences, by the Henkin lemma, and Σ+ is countable, having gained countably many constants.

  2. Δ=L(H(Θ)) is a maximal consistent set of Σ+-sentences containing H(Θ), by Lindenbaum’s lemma.

  3. Δ is model-like over Σ+. It is consistent, and closed under derivation by the lemma on maximal consistent sets, so the lemma on what closure gives supplies half of every clause of Figure 6.9. The lemma on maximal consistent sets supplies the missing halves for ∨ and →, and the lemma on the quantifier clauses those for ∃ and ∀.

  4. The term structure MΔ exists, since Σ+ has constant symbols, and by the truth lemma a Σ+-sentence is true in it exactly when it belongs to Δ. In particular every member of Θ is true in MΔ, since Θ⊆H(Θ)⊆Δ.

  5. The new constants occur in no sentence of Θ, so they can be forgotten: the structure (DΔ,IΔ↾(C∪F∪R)), the restriction of IΔ to the symbols of Σ, is a Σ-structure. The clauses of satisfaction for a Σ-sentence look only at the symbols of Σ, so the same Σ-sentences are true in it, and it is a model of Θ.

□

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.64 (where excluded middle was used). The law entered the proof in two places, and nowhere else: in reformulation (ii), through (DN), and in the lemma on the quantifier clauses, in the passage from ¬∀xψ to ∃x¬ψ, a relative of the principle ¬∀x¬φ→∃xφ that NJ could not derive. At the first of these the argument already breaks down for NJ. With Γ empty and φ the sentence p∨¬p, reformulation (ii) fails for NJ: the system does not derive p∨¬p, yet {¬(p∨¬p)} is inconsistent, by the tree that derives ¬¬(p∨¬p).

Remark 6.65 (compactness and the Löwenheim–Skolem theorem). The proof yields two further results. If every finite subset of Γ has a model, so does Γ (compactness). For if Γ had no model, it would be inconsistent, by the model existence lemma; a derivation of ⊥ from Γ uses only finitely many hypotheses, so some finite subset of Γ would be inconsistent, and by soundness it would have no model. 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 tell structures apart less well than one might hope.

Remark 6.66 (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

Example 6.67 (the Lindenbaum 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 would not: q and q→r give r, which clashes with ¬r, so ¬q goes in.

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

A structure that makes p true and q and r false, as the three decisions say, does make p∨q and q→r true and r false. The decisions were taken, one letter at a time, from what the hypotheses could not rule out, and they show that the entailment fails.

The first step asked whether {p∨q,q→r,¬r,p} is consistent. We answered yes because this very structure makes all of it true; the construction itself only asks the question and does not say how to answer it.

Example 6.68 (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 is maximal consistent, since it has a model and takes a side on every sentence. It contains ∃xEng(x), and also ¬Eng(t) for every closed term t, so the clause for ∃ of Figure 6.9 fails in it: the set is not model-like. Its term structure would contain no engineer. This is the company’s version of the remark on unnamed elements.

Example 6.69 (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 remark on normal structures shows that looking only at such structures loses nothing.

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 between derivability and entailment, 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 add derivations, and the new derivations cost NK two properties that NJ has in Part 1. One is the disjunction property (Fact 6.42), used in the proof that NJ is incomplete. The other, also proved in Part 1, says that a proof of “there is an x such that φ” from no hypotheses names a term for x.

Fact 6.70 (existence property, from Part 1). If ⊢NJ∃xφ, then ⊢NJφ[t/x] for some term t.

Remark 6.71 (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, one drinking and one not, 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 mathematicians refuse to accept the argument.

Example 6.72 (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 instance of (LEM) is true, and the derivation does not say.

Proposition 6.73 (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.72 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, see the loss of witnesses as the heart of the matter. 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 each connective its meaning by proof conditions, which say 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, the argument concludes, 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 still open; 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 mathematicians read 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, which let a user add the law as an axiom or, in Lean, through the axiom of choice.22 Figure 6.11 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.11. 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 his language 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. The section on classical and intuitionistic logic describes the logic that Brouwer’s answer produced. Hilbert’s is told here.

Hilbert proposed to secure classical mathematics by treating its proofs as finite strings of symbols and proving their consistency 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 does not argue that Brouwer was wrong, only that Brouwer’s 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.

The clause for the conditional is older than the rest of the definition. Philo of Megara, around 300 BC, held that a conditional is false only when it leads from a truth to a falsehood, against his teacher Diodorus Cronus, who asked that it never could; the dispute is known through Sextus Empiricus. Frege’s conditional is Philo’s, and Russell called it material implication. Its consequences have been called paradoxes ever since (see the remark on the conditional of science): on the material reading a true sentence is implied by anything, ψ→(φ→ψ), a false one implies anything, ¬φ→(φ→ψ), and of any two sentences one implies the other, (φ→ψ)∨(ψ→φ). All three are valid, though “implies” in English seems to promise a connection between the two sentences. C. I. Lewis took the paradoxes for a defect and in 1912 proposed a strict implication, on which φ implies ψ when it is impossible that φ hold and ψ fail; the relevance logics of the 1950s to 1970s went further and asked that the antecedent actually be used in reaching the consequent.28 Defenders of the material reading answer that the paradoxes mix up what a conditional says with what makes it worth saying, and that the conditional of a law, which holds even of the cases it does not apply to, is exactly the material one; Williamson (2020) is a recent defence of this kind.

Tarski gave this picture a precise form. His definition of truth, published in 1933, is our definition of satisfaction, and his definition of consequence, presented in 1935 at the Paris congress of the Unity of Science movement, is our definition of entailment. 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 completeness 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.12 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.12. 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 for each kind of formula. 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. 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. Soundness says that in a correct derivation no line is false while all its open hypotheses are true; find the first line of this derivation that is false while 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.

  1. Someone proposes a rule (∨E′) that concludes φ from φ∨ψ, with no case analysis. Try to write its case in the soundness proof, say where the attempt breaks, and give a structure that shows the rule unsound.

  2. The derived step (DN) concludes φ from ¬¬φ. Write the case it would have in the soundness proof if it were a rule. Which clause of satisfaction does the case use, and why does the same case not go through for a rule concluding φ from ¬φ?

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. Write out the case ∃xψ of the truth lemma.

  2. Let Δ be the set of sentences true in a structure M in which every element is named by a closed term. Show that Δ is model-like. Where is the hypothesis on names 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 Henkin lemma does the second added sentence break?

References

  • Alan Ross Anderson and Nuel D. Belnap, Jr. Entailment: The Logic of Relevance and Necessity, volume I. Princeton University Press, Princeton, NJ, 1975.
  • 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.
  • C. I. Lewis. Implication and the algebra of logic. Mind, 21(84):522–531, 1912.
  • 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.
  • Stephen Read. Relevant Logic: A Philosophical Examination of Inference. Basil Blackwell, Oxford, 1988.
  • 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.
  • Timothy Williamson. Suppose and Tell: The Semantics and Heuristics of Conditionals. Oxford University Press, Oxford, 2020.

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. That the indicative conditional of English is, after all, the material one is defended by Williamson (2020): we assess a conditional by supposing its antecedent and judging its consequent, a reliable but fallible habit, and the habit, not the truth condition, is what makes “if 2+2=5, then 1+1=3” sound wrong. ↩

  7. Showing that no derivation exists needs a different kind of structure, described in the section on classical and intuitionistic logic. ↩

  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.44 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. ↩

  28. Lewis (1912); Anderson and Belnap (1975); Read (1988) is a readable account. ↩