7.3  Soundness for Predicate Logic

This section is optional, and nothing outside it depends on it: Section 7.2 stated soundness for predicate logic without proof, and the rest of the book uses that statement. The results below build on one another, so they carry no optional marker of their own; the section as a whole is the unit a reader may skip. Here is the proof. It is Chapter 4’s proof of Theorem 4.7.2 with six new cases, one for each quantifier and equality rule, and it is worth reading for one reason above all: each side condition of Sections 5.3 to 5.7 is used in the case of its own rule, and there one can see what would go wrong without it. The section proves a lemma about substitution and its corollary on renaming bound variables, then the theorem, then the corollary that turns every counter-model of Section 7.2 into a proof that no derivation exists.

7.3.1. What carries over, and what is new

Chapter 4 proved that whatever the rules of Chapters 1 and 2 derive is true in every row where the premises are true. The proof had four steps (Steps 1–4 of the proof of Theorem 4.7.2). It reduced to derivations in the primitive rules; it proved a claim for every line, not only the last, namely Γk⊨φk, where Γk is the context of line k; it did so by strong induction on k, one case per rule; and it read off the claim for the last line. We follow the same four steps. Step 2 is an induction, and the checklist of Section 4.2 applies to it as it applied to Chapter 4’s: the claim stated for every line, the cases, and what each case may use. Three things change.

The formulas. Lines now carry first-order formulas (Definition 5.2.2), and ⊨ is the entailment of Definition 7.1.4: Γk⊨φk says that every structure M and assignment ℓ with M,ℓ⊨Γk satisfy φk. Assignments are not optional here. Lines inside a flagged box can mention the box’s name, a variable such as x0, free; such a line is then not a sentence, and its truth depends on the value of x0. This is why Section 5.4 insisted that fresh names are always variables, never constants: the proof below changes their values.

The rules. The primitive rules are the thirteen of Chapter 4’s list (Section 4.7) and six new ones: ∀E (Definition 5.3.1), ∀I (Definition 5.4.1), ∃I (Definition 5.5.1), ∃E (Definition 5.6.1), =I and =E (Definition 5.7.1). Two of the new rules cite a box, the flagged box of ∀I and the ∃E box, so the box rules are now seven: Chapter 4’s five, and ∀I and ∃E. The other four new rules cite only lines and join the one-step rules.

Second readingDerived rules and ‘arith’, written out

Derived rules and “arith”. As in Step 1 of Theorem 4.7.2, a line citing a derived rule abbreviates a pasted derivation in primitive rules. This covers Chapter 2’s derived rules (Definition 2.3.1), whose derivations have no flagged boxes and apply to first-order formulas as they stand, and the bounded rules of Proposition 6.1.1, each of which Section 6.1 expanded into a displayed block of unbounded steps whose side conditions hold whenever the bounded ones do, and the one-line “(sym)” and “(trans)” of Section 5.7 (Proposition 5.7.1), each of which abbreviates its three-line derivation from =I and =E with the given terms pasted in. Those derivations have no boxes, and each φ they use is an equation, with no quantifier, so every term is free for its variable and the side conditions of Definition 5.7.1 hold. It also covers the shortcuts of Chapter 6. A law of Section 6.2 used as one line (QN, NIm, VI, the passage and distribution laws), and a derivable formula written as a line, abbreviate their printed derivations, pasted in with each flag renamed to a name new to the whole derivation, as “The laws as one line” (Section 6.2, after Proposition 6.2.1) argues. A TAUT line abbreviates the block of primitive steps that Proposition 6.3.1 provides, pasted in the same way (Section 6.3). In each case the side conditions of ∀I and ∃E still hold inside the pasted block. A line justified “arith” is not a rule at all: it records an arithmetic fact. Written out, it is a universally quantified arithmetic sentence taken as an extra premise, whose bound variables are distinct and appear nowhere else in the derivation, instantiated by ∀E at the terms on the line and applied by →E, as Section 5.4 did explicitly when it turned the premises of a Chapter 1 derivation into universal statements. That choice of bound variables means that no fresh name of the derivation appears in the new premise, so the side conditions of ∀I and ∃E still hold, and that every term on the line is free for the variable it replaces at each ∀E step. So a derivation with “arith” lines is a derivation in primitive rules from its premises together with those arithmetic sentences, and soundness speaks about that derivation.

Renaming. Section 5.2 took, as a convention, that formulas differing only by renaming bound variables say the same thing, so a derivation may write a line, or apply a rule to a cited line, in a renamed form. This is not a rule either. Corollary 7.3.2 below shows that a formula and any renamed form of it are satisfied by exactly the same structures and assignments, so such a step changes nothing in the proof, which may take every line in the form its rule displays.

7.3.2. Contexts, once more

The context Γk of line k is still the list of the premises together with the assumptions of every box containing line k (Section 4.7, before Lemma 4.7.1). A flagged box of ∀I has no assumption, so it adds nothing to the context of the lines inside it. The ∃E box opens with its assumption φ[x0/x], which does join the context.

Section 5.4 extended Definition 1.4.2 to flagged boxes and kept its scope rule and its notion of availability word for word; two boxes are still disjoint or one inside the other. So Lemma 4.7.1 (a), whose proof uses only the scope rule, holds as it stands: if line i is available at line k, then Γi⊆Γk.

Part (b) needs one extension, since its statement names “the assumption of that box”. It becomes: if line k is justified by a box rule citing the box from line a to line b, then Γb is Γk together with the assumption of that box if it has one, and Γb is Γk if it is a flagged box without an assumption. The proof of (b) in Section 4.7 is unchanged. It showed that the boxes containing line b are exactly the cited box and the boxes containing line k, and for that it used one fact about box rules: the last line of the cited box is a line of that box itself, not of a box inside it. The two new box rules demand the same: ∀I requires φ[x0/x] to be the last line of the flagged box, a line of that box itself (Definition 5.4.1), and ∃E requires χ to be the last line of the box itself (Definition 5.6.1). So the boxes containing line b are the cited box and those containing line k, and the context of line b adds to Γk only the cited box’s assumption, if any. When a flagged box immediately contains another box and is cited from the first line of that inner box, as the citation convention of Section 5.4 says, the argument is the same: the cited box runs from that line to its last line, and its last line lies in no box inside it.

Here is the derivation of Proposition 5.6.2, with its contexts.

1∃x∀yR(x,y)
2y0x0∀yR(x0,y)asm, for ∃E
3R(x0,y0)∀E 2
4∃xR(x,y0)∃I 3
5∃xR(x,y0)∃E 1, 2–4
6∀y∃xR(x,y)∀I 2–5
Line Boxes containing it Context
1 none ∃x∀yR(x,y)
2, 3, 4 flagged y0 (2–5); ∃E box x0 (2–4) ∃x∀yR(x,y), ∀yR(x0,y)
5 flagged y0 (2–5) ∃x∀yR(x,y)
6 none ∃x∀yR(x,y)

Line 6 cites the flagged box 2–5, which has no assumption, and indeed Γ5=Γ6. Line 5 cites the ∃E box 2–4, and Γ4 is Γ5 with its assumption ∀yR(x0,y) added. Line 3 mentions x0 and y0 free, and line 4 mentions y0 free, while its context mentions x0 free, through the assumption ∀yR(x0,y): the claim Γ4⊨∃xR(x,y0) is about every structure and every value of x0 and y0 that makes the context true.

7.3.3. Substitution and satisfaction

Five of the six new rules write a substitution: ∀E and ∃I write φ[t/x] for a term t, in their conclusion or premise; =E writes one in both; and ∀I and ∃E write φ[x0/x] for the fresh name. To handle them we need to know what φ[t/x] means in a structure. The natural guess is that substituting the term t for x has the same effect as giving x the value of t. Section 5.2 showed that this can fail: in ∃y(y>x), putting y+1 for x blindly gives ∃y(y>y+1), which is false in Z, while giving x the value of y+1, whatever it is, leaves ∃y(y>x) true. The y of the term was captured. The lemma says that capture is the only thing that can go wrong.

Lemma 7.3.1 (Substitution Lemma)

Let M be a structure, ℓ an assignment in M, φ a formula, x a variable, and t a term that is free for x in φ (Definition 5.2.6). Write a:=tM,ℓ. Then M,ℓ⊨φ[t/x]if and only ifM,ℓ[x↦a]⊨φ.

Idea. First terms: substituting t for x in a term s and then evaluating is the same as evaluating s with x set to the value of t. Then structural induction on φ, for all assignments at once, since the quantifier clauses change the assignment. Atomic formulas follow from the claim for terms, and connectives pass straight through. The only real case is ∀yφ with x free in it. The substitution goes inside, and (S6) sets y to each d in turn. For the induction hypothesis to help, the value of t must not change when y does, and that is exactly what “free for” guarantees: y does not occur in t.

Proof. Fix M, x and t. For an assignment ℓ, write aℓ:=tM,ℓ.

Terms. We show, for every term s and every assignment ℓ, that (s[t/x])M,ℓ=sM,ℓ[x↦aℓ], by structural induction on s (Definition 5.2.1). If s is the variable x, then s[t/x] is t, with value aℓ, and sM,ℓ[x↦aℓ]=ℓ[x↦aℓ](x)=aℓ (Definition 7.1.2). If s is another variable y, then s[t/x] is y, and both sides are ℓ(y), since ℓ[x↦aℓ] changes only x. If s is a constant c, both sides are cM. If s is f(s1,…,sn), then s[t/x] is f(s1[t/x],…,sn[t/x]) (Definition 5.2.5), and applying fM to the values, which agree by the hypothesis for s1,…,sn, gives equal results.

Formulas. We prove, by structural induction on φ, the property B(φ): if t is free for x in φ, then for every assignment ℓ, M,ℓ⊨φ[t/x] if and only if M,ℓ[x↦aℓ]⊨φ. Two facts are used throughout. If t is free for x in ¬φ or in φ∘ψ, it is free for x in the parts, by the recursive description of “free for” after Definition 5.2.6 in Section 5.2. And by Definition 5.2.5, substitution passes through connectives: (¬φ)[t/x] is ¬(φ[t/x]), and (φ∘ψ)[t/x] is φ[t/x]∘ψ[t/x].

Atomic formulas. R(s1,…,sn)[t/x] is R(s1[t/x],…,sn[t/x]). By the claim for terms, the tuple of values of the si[t/x] under ℓ is the tuple of values of the si under ℓ[x↦aℓ], so (S1) of Definition 7.1.3 gives the same answer on both sides. Equations s1=s2 are the same with (S2). For ⊥, ⊥[t/x] is ⊥, and neither side holds (S3).

Connectives. For φ∧ψ: by B(φ) and B(ψ), M,ℓ⊨φ[t/x] if and only if M,ℓ[x↦aℓ]⊨φ, and likewise for ψ; (S5) combines the two answers in the same way on both sides. The cases ¬, ∨, →, ↔ are the same with (S4) and the other parts of (S5).

Universal quantifier, x not free in ∀yφ. This happens when y is the variable x, or when x is not free in φ. Then (∀yφ)[t/x] is ∀yφ itself, since there is no free occurrence of x to replace (Section 5.2 proved that ψ[t/x]=ψ whenever x is not free in ψ). The assignments ℓ and ℓ[x↦aℓ] differ at most at x, which is not free in ∀yφ; so by Lemma 7.1.1, M,ℓ⊨∀yφ if and only if M,ℓ[x↦aℓ]⊨∀yφ, which is B(∀yφ).

Universal quantifier, x free in ∀yφ. Then y is not x, and x is free in φ. Every free occurrence of x in ∀yφ lies in the scope of ∀y, so, as t is free for x in ∀yφ, the variable y does not occur in t, and t is free for x in φ (Definition 5.2.6, and its recursive description in Section 5.2). By Definition 5.2.5, (∀yφ)[t/x] is ∀y(φ[t/x]). Let d∈D. Since y does not occur in t, the assignments ℓ and ℓ[y↦d] agree on every variable of t, so aℓ[y↦d]=aℓ, by the claim for terms in the proof of Lemma 7.1.1. Since x and y are different variables, ℓ[y↦d][x↦aℓ]=ℓ[x↦aℓ][y↦d]. Hence, using B(φ) for the assignment ℓ[y↦d] in the second step, M,ℓ⊨∀y(φ[t/x])⟺for every d∈D, M,ℓ[y↦d]⊨φ[t/x]⟺for every d∈D, M,ℓ[y↦d][x↦aℓ]⊨φ⟺for every d∈D, M,ℓ[x↦aℓ][y↦d]⊨φ⟺M,ℓ[x↦aℓ]⊨∀yφ, where the first and last steps are (S6). This is B(∀yφ).

Existential quantifier. The same two subcases, with (S7) in place of (S6) and “for some d” in place of “for every d”.

Every clause of Definition 5.2.2 is covered, so B(φ) holds for every formula. This proves the lemma.

The hypothesis “free for” was used once, in the second quantifier case, to get aℓ[y↦d]=aℓ. The capture example shows what happens without it. In the structure on Z with >, +, and 1 as usual, take φ=∃y(y>x) and t=y+1, which is not free for x in φ. The blind substitution is ∃y(y>y+1), false under every assignment. But M,ℓ[x↦a]⊨∃y(y>x) holds for every a∈Z, with witness a+1. The two sides of the lemma disagree, and the reason is visible in the displayed chain: when (S7) sets y to a new value, the value of y+1 moves with it.

Quick check. Let M be the structure on Z with <, +, and 1 as usual, φ=∀z(x<z→y<z), t=y+1, and let ℓ(x)=3, ℓ(y)=5. Is t free for x in φ? Compute both sides of Lemma 7.3.1.

Solution. Yes: the only quantifier in φ is ∀z, and z does not occur in y+1. Here a=tM,ℓ=6. The right side asks whether M,ℓ[x↦6]⊨φ: every z>6 is >5, so yes. The left side is φ[t/x]=∀z(y+1<z→y<z) under ℓ: every z>6 is >5, so yes. Both sides hold, as the lemma says. (Under ℓ itself, φ is false: z=4 has 3<4 and not 5<4. The lemma compares φ[t/x] with φ at the new value of x, not at the old one.)

The lemma also pays a debt of Section 5.2, which took renaming of bound variables inside a formula as a convention and left its justification in terms of meaning to this section.

Corollary 7.3.2 (Renaming Keeps Meaning)

Let φ be a formula and y,z variables, with z not appearing in φ (Section 5.2). Let M be a structure for the symbols of φ, with domain D.

  • (a) For every assignment ℓ, M,ℓ⊨∀yφ if and only if M,ℓ⊨∀zφ[z/y], and M,ℓ⊨∃yφ if and only if M,ℓ⊨∃zφ[z/y].
  • (b) If ψ′ arises from a formula ψ by such a renaming of one quantifier anywhere inside ψ (Section 5.2), then for every structure M for the symbols of ψ and every assignment ℓ in it, M,ℓ⊨ψ if and only if M,ℓ⊨ψ′.

Proof. (a) If z is y, then φ[y/y] is φ and there is nothing to prove. Let z be a variable other than y. Since z does not appear in φ, no quantifier of φ is on z, so z is free for y in φ (Definition 5.2.6). Let d∈D. Under ℓ[z↦d] the term z has value d, so Lemma 7.3.1 gives: M,ℓ[z↦d]⊨φ[z/y] if and only if M,ℓ[z↦d][y↦d]⊨φ. The assignments ℓ[z↦d][y↦d] and ℓ[y↦d] differ at most at z, which does not appear in φ; by Lemma 7.1.1, the last statement holds if and only if M,ℓ[y↦d]⊨φ. So M,ℓ[z↦d]⊨φ[z/y] if and only if M,ℓ[y↦d]⊨φ, for every d∈D. Now (S6) gives the statement for ∀, and (S7) the statement for ∃.

(b) By structural induction on ψ, for all assignments at once, since the quantifier clauses change the assignment. If the renamed quantifier is the outermost symbol of ψ, this is (a). Otherwise ψ is not atomic, and the renaming takes place inside one immediate part of ψ, which it turns into a formula satisfied by the same assignments, by the induction hypothesis; the other parts are unchanged. If ψ is ¬α or α∘β, (S4) or (S5) then gives the same answer for ψ and ψ′ under every ℓ. If ψ is ∀wα or ∃wα, with the renaming inside α, then ψ′ is ∀wα′ or ∃wα′, and α, α′ are satisfied by the same assignments ℓ[w↦d], so (S6) or (S7) gives the same answer for ψ and ψ′.

Several renamings one after another are covered by applying (b) once for each.

7.3.4. The soundness theorem

We can now state the theorem that Section 7.2 took on trust.

Theorem 7.3.3 (Soundness for Predicate Logic)

Let Γ be a list of formulas and ψ a formula. If Γ⊢ψ with the rules of Chapters 1 and 2 and the quantifier and equality rules of Sections 5.3 to 5.7, then Γ⊨ψ (Definition 7.1.4).

Idea. The steps are those of Chapter 4’s proof (Steps 1–4 of Theorem 4.7.2).

① Reduce to derivations in the primitive rules.

② Prove Γk⊨φk for every line k, by strong induction on k (Theorem 4.2.2): fix a structure M and an assignment ℓ satisfying Γk, and show that they satisfy φk.

③ The cases. Premises, assumptions, and the thirteen propositional rules go through word for word, because (S3)–(S5) are Chapter 4’s clauses. ∀E, ∃I, and =E are Lemma 7.3.1, used once or twice. =I is (S2). The two box rules are the heart of the proof, and they both use the same trick: change the value of the fresh name. In ∀I, to show ∀xφ under ℓ, take any d, and set x0 to d; the context does not notice, because x0 is not in it, so the box’s last line φ[x0/x] holds there, and moving d from x0 to x gives φ under ℓ[x↦d]. In ∃E, set x0 to the witness d that ∃xφ provides; the box’s assumption holds there, so its last line χ holds there, and since χ does not mention x0, it holds under ℓ as well.

④ The last line lies in no box, so its context is the premises.

Before reading on: in the ∀I case below, the assignment ℓ[x0↦d] must still satisfy the context Γk, and at the end the conclusion must come back from ℓ[x0↦d][x↦d] to ℓ[x↦d]. Which clause of the side condition of ∀I does each step use?

Proof. Step 1 (reduction). Suppose Γ⊢ψ. By the subsection “What carries over, and what is new”, there is a derivation of ψ in the primitive rules whose premises all belong to Γ. (A derivation with “arith” lines is of this kind only for the list of its premises together with the arithmetic sentences A those lines stand for, as explained there. The theorem applies to it with the list Γ,A in place of Γ, and gives Γ,A⊨ψ: truth in every structure that satisfies Γ and A. The sentences A hold, for instance, when the arithmetic symbols have their usual meaning on R, as in Section 7.1.) Fix one, with lines 1,…,n, formulas φk, and contexts Γk. Let Σ be the finite set of constants, function symbols and predicate symbols that occur in some line of it. A line may contain symbols that occur neither in Γ nor in ψ, as c does in the line P(c) between ∀xP(x) and ∃xP(x); so the induction is run over structures that interpret every symbol of Σ, and Step 4 returns to the structures of Definition 7.1.4.

Step 2 (the induction). For k∈N, let S(k) be: if 1≤k≤n, then every structure M that interprets every symbol of Σ and every assignment ℓ in M with M,ℓ⊨Γk satisfy M,ℓ⊨φk. In Steps 2 and 3, “structure” means a structure that interprets every symbol of Σ, and possibly more. We prove S(k) for all k by Theorem 4.2.2. For k=0 and k>n, S(k) holds vacuously. Let 1≤k≤n and assume S(j) for every j<k. Every line and box that line k cites is available at line k, so lies before it (Definition 1.4.2); hence the hypothesis holds for every cited line and for the last line of every cited box. Let M be a structure, with domain D, and ℓ an assignment with M,ℓ⊨Γk. We show M,ℓ⊨φk. Two consequences of the hypothesis do the bookkeeping, as in the proof of Theorem 4.7.2. If line k cites line i, then Γi⊆Γk by Lemma 4.7.1 (a), so M,ℓ⊨Γi, and S(i) gives (∗)M,ℓ⊨φifor every line i cited by line k. If line k cites, by a box rule, the box from line a to line b, then by Lemma 4.7.1 (b), extended in the subsection “Contexts, once more”, and S(b): (∗∗)every structure and assignment satisfying Γk and the box’s assumption, if any, satisfy φb.

Step 3 (the cases).

Claim. If line k is a premise, an assumption, or justified by one of the thirteen primitive rules of Chapters 1 and 2, then M,ℓ⊨φk.

Proof of Claim. Claims 1–3 in the proof of Theorem 4.7.2 treat these cases. Each step there uses only (∗), (∗∗), the fact that a premise or an assumption belongs to its own context, and the clauses (V1)–(V6) of Definition 4.4.2. Clauses (S3)–(S5) of Definition 7.1.3 are (V1)–(V6) with “v makes φ true” replaced by “M,ℓ⊨φ”. Making that replacement throughout, the proofs of those claims prove this one, case by case.

Claim. If line k is justified by ∀E, ∃I, =I, or =E, then M,ℓ⊨φk.

Proof of Claim. ∀E. Line k is φ[t/x], citing a line holding ∀xφ, with t free for x in φ. By (∗), M,ℓ⊨∀xφ, so by (S6), M,ℓ[x↦d]⊨φ for every d∈D, in particular for d=tM,ℓ. By Lemma 7.3.1, which applies because t is free for x in φ, M,ℓ⊨φ[t/x].

∃I. Line k is ∃xφ, citing a line holding φ[t/x], with t free for x in φ. By (∗), M,ℓ⊨φ[t/x]. By Lemma 7.3.1, M,ℓ[x↦d]⊨φ with d=tM,ℓ∈D. So d is the element (S7) asks for, and M,ℓ⊨∃xφ.

=I. Line k is t=t. The two sides have the same value tM,ℓ, so (S2) holds.

=E. Line k is φ[t2/x], citing lines holding t1=t2 and φ[t1/x], with t1 and t2 free for x in φ. By (∗) and (S2), t1M,ℓ and t2M,ℓ are the same element d; and M,ℓ⊨φ[t1/x]. By Lemma 7.3.1 for t1, M,ℓ[x↦d]⊨φ. By Lemma 7.3.1 for t2, read from right to left, M,ℓ⊨φ[t2/x].

Claim. If line k is justified by ∀I or ∃E, then M,ℓ⊨φk.

Proof of Claim. ∀I. Line k is ∀xφ, citing a flagged box with name x0 and no assumption, whose last line b holds φ[x0/x]. The side condition of Definition 5.4.1 says that at line k the name x0 appears in no premise and in no assumption of a box still open at line k, and not in ∀xφ. The premises and the assumptions of the boxes open at line k are exactly the formulas of Γk, so

  • (i) x0 appears in no formula of Γk; and

  • (ii) x0 does not appear in ∀xφ, so x0 is not the variable x, and x0 does not appear in φ.

The flagged box has no assumption, so (∗∗) says: every structure and assignment satisfying Γk satisfy φ[x0/x].

Let d∈D; we show M,ℓ[x↦d]⊨φ. Put ℓ′:=ℓ[x0↦d]. It differs from ℓ at most at x0, which by (i) is free in no formula of Γk; so by Lemma 7.1.1, M,ℓ′⊨Γk. This is where the fresh-name condition is used: changing the value of x0 cannot disturb anything we assumed. By (∗∗), M,ℓ′⊨φ[x0/x]. By (ii), x0 does not appear in φ, so no quantifier of φ is on x0, and the term x0 is free for x in φ (Definition 5.2.6). Its value under ℓ′ is d, so Lemma 7.3.1 gives M,ℓ[x0↦d][x↦d]⊨φ. The assignments ℓ[x0↦d][x↦d] and ℓ[x↦d] agree at x, where both give d, and at every variable other than x and x0, where both give the value ℓ gives. They can differ only at x0, which by (ii) does not appear in φ. By Lemma 7.1.1, M,ℓ[x↦d]⊨φ. Since d∈D was arbitrary, (S6) gives M,ℓ⊨∀xφ.

∃E. Line k is χ, citing a line h holding ∃xφ and a box with name x0 that opens with the assumption φ[x0/x] and ends with χ. The side condition of Definition 5.6.1 says that x0 appears neither in χ, nor in ∃xφ, nor in any premise, nor in any assumption of a box still open at line k. So

  • (i) x0 appears in no formula of Γk;

  • (ii) x0 is not x, and does not appear in φ;

  • (iii) x0 does not appear in χ.

By (∗∗), every structure and assignment satisfying Γk and φ[x0/x] satisfy χ.

By (∗) for line h, M,ℓ⊨∃xφ; by (S7), choose d∈D with M,ℓ[x↦d]⊨φ. Put ℓ′:=ℓ[x0↦d]. First, M,ℓ′⊨Γk, by (i) and Lemma 7.1.1, as in the ∀I case. Second, M,ℓ′⊨φ[x0/x]. Indeed, ℓ′[x↦d]=ℓ[x0↦d][x↦d] and ℓ[x↦d] differ at most at x0, which by (ii) does not appear in φ, so M,ℓ′[x↦d]⊨φ by Lemma 7.1.1; the term x0 is free for x in φ by (ii), and has value d under ℓ′, so Lemma 7.3.1 gives M,ℓ′⊨φ[x0/x]. This is where “x0 not in ∃xφ” is used. By (∗∗), M,ℓ′⊨χ. Finally, ℓ′ and ℓ differ at most at x0, which by (iii) does not appear in χ, so M,ℓ⊨χ by Lemma 7.1.1. This is where “x0 not in χ” is used.

The three claims cover every way a line can be justified, so S(k) holds, and by Theorem 4.2.2 S(k) holds for every line k of the derivation.

Step 4 (the last line). The last line n lies in no box (Definition 1.4.2), so Γn consists of premises only, and φn=ψ. Let M be a structure for the symbols occurring in Γ and ψ, with domain D, and ℓ an assignment with M,ℓ⊨Γ. Expand M to a structure M′ with the same domain and the same meanings, which also interprets the symbols of Σ that M does not, so that M′ interprets every symbol of Σ: fix some e∈D, which exists because D is non-empty (M1), and give each new constant the value e, each new function symbol, of arity m say, the function Dm→D with constant value e, and each new predicate symbol the empty relation. Then ℓ is an assignment in M′, and by the remark after Definition 7.1.4 (the clauses of Definition 7.1.3 consult only the symbols of the formula at hand), each formula of Γ, and ψ, is satisfied by M′,ℓ exactly when it is satisfied by M,ℓ. Every premise belongs to Γ, so M′,ℓ⊨Γn; by S(n), M′,ℓ⊨ψ; and so M,ℓ⊨ψ. This proves Γ⊨ψ.

The answer to the prompt: the first step uses the clauses “no premise” and “no open assumption”, which together say that x0 is not in Γk; the second uses “not in ∀xφ”. The last line φ[x0/x] of the box, which may mention x0 as often as it likes, plays no part in either. That is the precise sense in which “let x0 be arbitrary” works: whatever value x0 is given, what we know still holds, so what we proved about x0 holds at that value.

The ∃E case uses the same move with the opposite purpose. There the value of x0 is not arbitrary; it is set to the witness d. What makes that legitimate is that nothing else knows about x0 (condition (i)), that the assumption φ[x0/x] then holds at the witness (condition (ii)), and that the result χ forgets it again (condition (iii)).

7.3.5. Counter-models prove non-derivability

The corollary is the one Section 7.2 used, now with a proof.

Corollary 7.3.4 (Counter-models)

Let Γ be a list of formulas and ψ a formula. If some structure M and assignment ℓ satisfy every formula of Γ and do not satisfy ψ, then Γ⊬ψ.

Proof. The pair M,ℓ shows that Γ⊨ψ fails (Definition 7.1.4). If Γ⊢ψ held, Theorem 7.3.3 would give Γ⊨ψ. So Γ⊢ψ does not hold.

If the derivations in question may use “arith” lines, a counter-model must also satisfy the arithmetic sentences those lines stand for (Step 1 of the proof of Theorem 7.3.3), for instance by giving the arithmetic symbols their usual meaning.

Every counter-model of Section 7.2 is now a proof that no derivation exists.

  • By Example (The swap of ∃ and ∀), ∀y∃xR(x,y)⊬∃x∀yR(x,y). The converse search of Proposition 5.6.2 stalled at two lines, a ∀I blocked by an open assumption and an ∃E blocked by its conclusion; now we know that no other route could have succeeded.
  • The two-element structure with PM={a}, QM={b} gives ∃xP(x)∧∃xQ(x)⊬∃x(P(x)∧Q(x)) and ∀x(P(x)∨Q(x))⊬∀xP(x)∨∀xQ(x): the one-way laws of Proposition 6.2.6 are one-way.
  • ∃xP(x)⊬P(c), which Exercise (C2: A witness is not a name, used later) could only explain informally.
  • P(x0)⊬∀xP(x), by the structure on Z with PM the even integers and ℓ(x0)=2: generalizing over a name in a premise is not merely forbidden, it would be unsound.
  • The passage laws of Proposition 6.2.7 need x not free in ψ: with x free, ⊬∃xP(x)→P(x), by the counter-model of Exercise (B1: Three counter-models, used later) (iii), which names an assignment.

Remark. The converse of Theorem 7.3.3 is also true: if Γ⊨ψ, then Γ⊢ψ. This is the completeness theorem for predicate logic, proved by Gödel in 1929. Its proof needs to build a structure out of the formulas themselves, and it is beyond this book; nothing here depends on it.

Remark. One difference from Chapter 4 remains even with completeness: there is no truth table to check. Whether a sentence of predicate logic is derivable cannot, in general, be decided by any mechanical procedure (Church and Turing, 1936). A failed search and a missing counter-model can both go on for ever.

7.3.6. Every side condition is a case of the proof

The side conditions of Sections 5.3 to 5.7 were introduced one at a time, each with a counterexample. The proof above shows that they are all the same kind of thing: each is used in the case of its own rule, and dropping it breaks a step of that case. Each counterexample of Sections 5.3 to 5.7 can be read as a failed case:

  • generalizing over a name in a premise, as in “P(x0)⊢∀xP(x)” (Section 5.4): the ∀I case fails at “M,ℓ[x0↦d]⊨Γk”, since changing x0 changes the premise P(x0);
  • generalizing over a name in an open assumption, as in “from x0>0, ∀x(x>0)” (Section 5.4): the same step, with the assumption x0>0 in Γk;
  • a name that leaks into the conclusion of ∀I, as in Exercise (C1: The conclusion clause of for-all-introduction, used later): the last step of the ∀I case, since x0 now occurs in φ;
  • treating the witness as arbitrary, by ∀I over its name inside its ∃E box (Section 5.6): the ∀I case again, since the box’s assumption is in Γk;
  • letting the witness escape its box, or giving a second witness a name already in an open assumption (Section 5.6): the ∃E case, at condition (iii) or (i);
  • a capture in ∀E (Section 5.3) or ∃I (Section 5.5): the ∀E or ∃I case, where Lemma 7.3.1 does not apply; Exercise C2 and the solution to Exercise B1 give false conclusions;
  • a capture in =E, as in a=y, ∃y(y<a)⊢∃y(y<y) (Section 5.7): the =E case, where Lemma 7.3.1 does not apply to t2.

Warning. A side condition is not mere bookkeeping: a derivation that breaks one is not covered by Theorem 7.3.3, and it can reach a false line, as the counter-model to P(x0)⊢∀xP(x) in the previous subsection shows for the first item of the list.

Quick check. Exercise (C2: Find the error, used later) gives a derivation of ∃x(P(x)∧Q(x))⊢∃xP(x) whose ∃E box ends in P(x0); the line after the box is P(x0) by ∃E, and the last line is ∃xP(x) by ∃I. Which case of the proof of Theorem 7.3.3 fails, at which step, and for which line? Give a structure and an assignment showing that the claim Γk⊨φk is false for that line.

Solution. The ∃E case fails, at its last step: χ=P(x0) contains x0, so condition (iii) is false, and “M,ℓ′⊨χ” cannot be carried back from ℓ′=ℓ[x0↦d] to ℓ. The line concerned is the illegal ∃E line P(x0), whose context is the premise alone. Take D={a,b}, PM=QM={a} and ℓ(x0)=b: the premise ∃x(P(x)∧Q(x)) holds (witness a), and P(x0) fails, since b∉PM. The final conclusion ∃xP(x) is still true in this structure, as it is in every structure satisfying the premise; the fault is in the line before it.

7.3.7. Exercises

A. Check your understanding

Exercise (A1)

These parts are about the proof of Theorem 7.3.3.

  • (a) In the ∀I case, name the two places where the side condition of ∀I is used, and say which clause each uses.
  • (b) The derivation below breaks the side condition of ∃E: its conclusion P(x0) contains the fresh name. Which step of the ∃E case fails? Give a structure and an assignment in which the premise holds and line 3 does not.
  • (c) Give the idea of the proof in two sentences.
  • (d) Why does the claim Γk⊨φk quantify over assignments, and not only over structures? Point to a line of the derivation of Proposition 5.6.2 printed in this section.
1∃xP(x)
2x0P(x0)asm, for ∃E
3P(x0)∃E 1, 2–2

Solution. (a) First, to show that ℓ[x0↦d] still satisfies Γk: this uses “x0 appears in no premise and in no assumption of a box open at line k”, which together say that x0 is in no formula of Γk, so Lemma 7.1.1 applies. Second, to pass from ℓ[x0↦d][x↦d] to ℓ[x↦d] (and, before that, to know that x0 is free for x in φ): this uses “x0 does not appear in ∀xφ”.

(b) The last step: from M,ℓ[x0↦d]⊨χ to M,ℓ⊨χ, which needs x0 not in χ. Take D={a,b}, PM={a}, ℓ(x0)=b. The premise ∃xP(x) holds, with witness a; line 3, P(x0), fails, since ℓ(x0)=b∉PM. Inside the box, under ℓ[x0↦a], line 2 holds; the proof would carry it back to ℓ, and that is exactly what fails.

(c) Every line of a derivation is satisfied by every structure and assignment that satisfy its context, by strong induction on the line, with one case per rule. The quantifier box rules are handled by changing the value of the fresh name, which the side conditions guarantee the context and the conclusion cannot notice.

(d) Lines inside boxes contain free variables, the fresh names, and their truth depends on the values of those variables. Line 3, R(x0,y0), is not a sentence: in the structure on Z with R read as <, it is satisfied when ℓ(x0)=1, ℓ(y0)=2, and not when ℓ(x0)=2, ℓ(y0)=1. The ∀I and ∃E cases work precisely by changing such values.

B. Practice

Exercise (B1: The ∃I case)

Write out the ∃I case of the proof of Theorem 7.3.3 in full: state what is known about the cited line, and show M,ℓ⊨∃xφ, naming the reason for each step. Where is “t free for x in φ” used?

Solution. Line k is ∃xφ, by ∃I citing a line i holding φ[t/x], where t is free for x in φ (Definition 5.5.1). Let M be a structure interpreting every symbol of the derivation (as in Step 2), with domain D, and ℓ an assignment with M,ℓ⊨Γk. Line i is available at line k, so Γi⊆Γk by Lemma 4.7.1 (a), and M,ℓ⊨Γi. Since i<k, the induction hypothesis S(i) gives M,ℓ⊨φ[t/x]. Let d:=tM,ℓ, an element of D. Because t is free for x in φ, Lemma 7.3.1 applies and gives M,ℓ[x↦d]⊨φ. By (S7) of Definition 7.1.3, with the element d, M,ℓ⊨∃xφ.

“Free for” is used exactly once, to apply Lemma 7.3.1. Without it the step fails: from ∀yR(y,y), read as (∀yR(x,y))[y/x], an “∃I” would give ∃x∀yR(x,y), and in the structure on Z with R read as ≤ the first is true and the second (“there is a least integer”) false.

Exercise (B2: Three non-derivability results)

Use the following counter-models from Section 7.2 to state three non-derivability results, citing Corollary 7.3.4, and check in each case that the structure (and assignment) satisfy every premise and not the conclusion.

Solution. (a) D={a,b}, RM={(a,a),(b,b)}. The premise ∀y∃xR(x,y) holds (for y=a take x=a, for y=b take x=b); the conclusion ∃x∀yR(x,y) fails (x=a fails at y=b, x=b at y=a). Both are sentences, so any assignment will do. By Corollary 7.3.4, ∀y∃xR(x,y)⊬∃x∀yR(x,y).

(b) D={a,b}, PM={a}, QM={b}. The premise ∀x¬Q(x)→∀x¬P(x) holds, since its hypothesis fails at b; the conclusion ∀x(P(x)→Q(x)) fails at a. By Corollary 7.3.4, ∀x¬Q(x)→∀x¬P(x)⊬∀x(P(x)→Q(x)).

(c) D={a,b}, PM={a}, with an assignment ℓ(x)=b. There are no premises, so the condition on premises holds trivially. The formula ∃xP(x)→P(x) fails under ℓ: its hypothesis holds (witness a) and its conclusion, with x free, has value b∉PM. By Corollary 7.3.4, with Γ empty, ⊬∃xP(x)→P(x). Here the assignment is essential: under ℓ(x)=a the formula holds, and the structure alone would not have been a counter-model.

C. Going deeper

Exercise (C1: The ∃E case)

Write out the ∃E case of the proof of Theorem 7.3.3 in full, from memory: the data of line k, the side condition, what the induction hypothesis gives for the cited line and the cited box, and the argument, naming at each step which clause of the side condition it uses.

Solution (Hint 1). The tool is the assignment ℓ[x0↦d], where d is a witness for ∃xφ under ℓ. You will need Lemma 7.1.1 three times and Lemma 7.3.1 once.

Solution (Hint 2). Start: “Let M be a structure interpreting every symbol of the derivation, with domain D, and ℓ an assignment with M,ℓ⊨Γk. By the induction hypothesis for line h and Lemma 4.7.1 (a), M,ℓ⊨∃xφ, so choose d∈D with M,ℓ[x↦d]⊨φ.”

Solution. Data. Line k is χ, by ∃E citing a line h holding ∃xφ and a box with name x0, from line a (the assumption φ[x0/x]) to line b (the formula χ). Side condition (Definition 5.6.1): x0 appears neither in χ, nor in ∃xφ, nor in a premise, nor in an assumption of a box still open at line k.

What the hypothesis gives. Line h is available at line k, so Γh⊆Γk (Lemma 4.7.1 (a)), and S(h) holds: every structure interpreting every symbol of the derivation, and every assignment satisfying Γh, satisfy ∃xφ. The box is cited by a box rule, so its last line has context Γk,φ[x0/x] (Lemma 4.7.1 (b), extended in the subsection “Contexts, once more”), and S(b) says that every such structure and assignment satisfying Γk and φ[x0/x] satisfy χ.

The argument. Let M be a structure interpreting every symbol of the derivation (as in Step 2), with domain D, and ℓ an assignment with M,ℓ⊨Γk. Then M,ℓ⊨Γh, so M,ℓ⊨∃xφ; by (S7), choose d∈D with M,ℓ[x↦d]⊨φ. Let ℓ′:=ℓ[x0↦d].

  1. M,ℓ′⊨Γk. The formulas of Γk are the premises and the assumptions of the boxes open at line k; by the side condition, x0 appears in none of them. ℓ′ differs from ℓ only at x0, so Lemma 7.1.1 applies to each formula of Γk.
  2. M,ℓ′⊨φ[x0/x]. Since x0 does not appear in ∃xφ, it is not x and does not appear in φ. So ℓ′[x↦d] and ℓ[x↦d] differ at most at x0, which is not in φ, and M,ℓ′[x↦d]⊨φ by Lemma 7.1.1. The term x0 is free for x in φ, as no quantifier of φ is on x0, and x0M,ℓ′=d; so Lemma 7.3.1 gives M,ℓ′⊨φ[x0/x].
  3. By 1, 2 and the hypothesis for the box, M,ℓ′⊨χ.
  4. ℓ′ and ℓ differ only at x0, which does not appear in χ; by Lemma 7.1.1, M,ℓ⊨χ.

Since M and ℓ were arbitrary, this proves S(k).

Marking scheme. (10 points)

  • 2: states the data and the full side condition, and the context Γk,φ[x0/x] of the box’s last line.
  • 2: obtains a witness d from the cited line through the induction hypothesis and (S7), and sets x0 to d.
  • 2: shows the new assignment still satisfies Γk, using “x0 in no premise and no open assumption”.
  • 2: shows the new assignment satisfies φ[x0/x], using “x0 not in ∃xφ” and the substitution lemma.
  • 2: applies the hypothesis for the box, and returns to ℓ using “x0 not in χ”.

A proof that treats the box’s assumption and the context in the other order earns the same points. Fatal errors (0 for the step): setting x0 to an arbitrary element rather than the witness; concluding M,ℓ⊨χ directly from M,ℓ′⊨χ without the condition on χ.

Exercise (C2: “Free for” is needed)

Show that the side condition “t is free for x in φ” of ∀E cannot be dropped. Give a two-line “derivation” that uses ∀E with a term that is not free for x, a structure in which its premise is true and its conclusion false, and the step of the proof of Lemma 7.3.1 that fails.

Solution (Hint 1). Look for a premise ∀xφ in which φ contains a quantifier ∀y and x occurs free inside its scope; instantiate at t=y.

Solution (Hint 2). Try φ=¬∀y(y≤x), “x is not an upper bound of everything”, in a structure with no largest element.

Solution. Take φ=¬∀y(y≤x) and t=y. The free occurrence of x in φ lies in the scope of ∀y, and y occurs in t, so t is not free for x in φ. Ignoring this, ∀E would allow:

1∀x¬∀y(y≤x)
2¬∀y(y≤y)∀E 1

In (Z,≤), the premise says “for every integer x, not every integer y is ≤x”, that is, no integer is largest: for each x, the integer x+1 is not ≤x. It is true. The conclusion says “not every integer y has y≤y”, which is false, since ≤ is reflexive. So the premise is true and the conclusion false, and a rule allowing this step would be unsound.

The step of Lemma 7.3.1 that fails is the second quantifier case, applied to ∀y(y≤x): it needs y not in t, so that the value of t does not change when (S6) sets y to each d. Here t=y, and its value is the new d each time: ∀y(y≤y) compares each d with itself, while ∀y(y≤x) at the value a of t compares each d with the fixed a. The legal route renames first (Section 5.2): ∀x¬∀z(z≤x), and then ∀E at y gives ¬∀z(z≤y), which is true in (Z,≤) under every assignment.

Marking scheme. (10 points)

  • 3: a premise and a ∀E step at a term that is not free for x, with the capture identified.
  • 4: a structure, with the premise checked true and the conclusion checked false.
  • 3: names the quantifier case of Lemma 7.3.1 and the fact it needs (y not in t).

Fatal errors (0 for the step): a “counter-model” in which the premise is false; a step in which t is in fact free for x.