Day 1: new constants, witnesses and Lindenbaum's Lemma. Day 2: the term model, the Truth Lemma, the Completeness Theorem and the Compactness Theorem. Day 3: Turing machines and the undecidability of first-order logic.
By the end of this week you will be able to:
Today we begin the proof of the Completeness Theorem. As in propositional logic, we build a model of every consistent set. The new difficulty is that a model needs objects.
The Soundness Theorem (Theorem 13.22) says: if \(\Gamma\vdash\varphi\), then \(\Gamma\models\varphi\). This week we prove the converse, the Completeness Theorem: if \(\Gamma\models\varphi\), then \(\Gamma\vdash\varphi\). Throughout the week \(\Gamma\) is a set of sentences, as in the Soundness Theorem.
We prove the contrapositive, and the plan is the plan of Week 10 (Figure 1).
In Week 10 step 3 was easy: a valuation only has to assign truth values, and \(p\) was made true exactly when \(p\in\Gamma'\). A structure needs a domain. The only objects that a set of sentences provides are the terms of its language, so the domain will be made of closed terms. Two things can go wrong.
The remedy for (a) is to add new constant symbols to the language and to use them as names for the objects that existential sentences require. This is today's subject. The remedy for (b) is to take classes of terms as elements; this is done on Day 2.
Definition 13.17 and Lemma 13.18 are the definitions and facts of Week 10 with the new \(\vdash\). The propositional facts about consistency were proved from the Deduction Theorem, and for sentences the Deduction Theorem holds without a condition (Corollary 13.15). So they carry over.
Let \(\Gamma\) be a set of sentences and \(\varphi\) a sentence.
Proof. These are Proposition 10.4, Proposition 10.5(b) and Proposition 10.1(b). Their proofs use (L1) to (L3), MP and the Deduction Theorem for the assumptions \(\varphi\) and \(\neg\varphi\). Both are sentences, so Corollary 13.15 applies in place of Theorem 9.9. □
Consistency refers to deductions, and a deduction is a sequence of formulas of a fixed language. When the language matters we say "consistent in \(\mathcal L(\mathcal S)\)".
Let \(\mathcal S\) be a signature. We assume from now on that \(\mathcal S\) has finitely many symbols, or that its symbols can be listed as a sequence; all signatures of this course are of this kind. Let
\(\mathcal S'=\mathcal S\cup\{d_1,d_2,d_3,\dots\}\)
where \(d_1,d_2,\dots\) are new constant symbols. Nothing is assumed about a new constant. The next lemma says that for this reason a new constant behaves in deductions like a variable.
Let \(\Gamma\) be a set of formulas, \(\psi\) a formula and \(d\) a constant symbol that occurs neither in \(\Gamma\) nor in \(\psi\). If \(\Gamma\vdash\psi[d/x]\), then \(\Gamma\vdash\forall x\,\psi\).
Proof. Let \(\chi_1,\dots,\chi_n\) be a deduction of \(\psi[d/x]\) from \(\Gamma\). Choose a variable \(z\) that occurs nowhere in this deduction and not in \(\psi\). For a formula \(\chi\) write \(\chi^z\) for the result of replacing every occurrence of \(d\) in \(\chi\) by \(z\). We show that \(\chi_1^z,\dots,\chi_n^z\) is again a deduction from \(\Gamma\), by going through the cases of Definition 13.2.
The last line is \((\psi[d/x])^z\). Since \(d\) does not occur in \(\psi\), this is \(\psi[z/x]\). Hence \(\Gamma\vdash\psi[z/x]\). The free occurrences of \(z\) in \(\psi[z/x]\) stand exactly where \(x\) was free in \(\psi\), so \(x\) is free for \(z\) in \(\psi[z/x]\), and \(\psi[z/x][x/z]\) is \(\psi\). By Lemma 13.6(a), \(\Gamma\vdash\psi\), and Gen gives \(\Gamma\vdash\forall x\,\psi\). □
Let \(\Gamma=\{\forall x\,(P(x)\to Q(x)),\ \forall x\,P(x)\}\) and let \(d\) be a new constant. A deduction of \(Q(d)\) from \(\Gamma\):
Replace \(d\) by a new variable \(z\) on every line. Lines 1 and 2 do not change. Lines 3 and 5 become the instances of (L10) with \(t:=z\), and lines 4, 6 and 7 are still obtained by MP. The result is a deduction of \(Q(z)\) from \(\Gamma\), and Gen gives \(\forall z\,Q(z)\), from which \(\forall x\,Q(x)\) follows. Compare Example 13.4: there the same deduction was written with the variable \(x\) in the place of \(d\).
The condition that \(d\) does not occur in \(\Gamma\) is needed. From \(\{P(c)\}\) we can deduce \(P(c)\), and we cannot deduce \(\forall x\,P(x)\).
If a set \(\Gamma\) of sentences of \(\mathcal L(\mathcal S)\) is consistent in \(\mathcal L(\mathcal S)\), then it is consistent in \(\mathcal L(\mathcal S')\).
Proof. Suppose there are deductions of \(\varphi\) and of \(\neg\varphi\) from \(\Gamma\) in \(\mathcal L(\mathcal S')\). Only finitely many new constants occur in them. Replace each of them, in both deductions, by its own new variable. As in the proof of Lemma 14.3, the results are deductions from \(\Gamma\); they contain no new constants, so they are deductions in \(\mathcal L(\mathcal S)\), and they end in a formula and its negation. So \(\Gamma\) is inconsistent in \(\mathcal L(\mathcal S)\). □
In an ordinary proof, after showing that an object with a property exists, we say "let \(d\) be such an object" and continue with \(d\). The next lemma says that this step never leads to a contradiction, provided that \(d\) is a new name.
Let \(\Gamma\) be a consistent set of sentences and \(\exists x\,\psi\) a sentence with \(\Gamma\vdash\exists x\,\psi\). Let \(d\) be a constant symbol that occurs neither in \(\Gamma\) nor in \(\psi\). Then \(\Gamma\cup\{\psi[d/x]\}\) is consistent.
Proof. Suppose \(\Gamma\cup\{\psi[d/x]\}\) is inconsistent. We show that then \(\Gamma\) is inconsistent.
So \(\Gamma\) deduces \(\exists x\,\psi\) and its negation. □
Steps 3 and 4 are the pattern "Gen, then (L15)" of Example 13.8, with Lemma 14.3 doing the work of Gen for the constant \(d\).
A set \(\Gamma'\) of sentences has the witness property if for every sentence \(\exists x\,\psi\) in \(\Gamma'\) there is a closed term \(t\) with \(\psi[t/x]\in\Gamma'\). The term \(t\) is called a witness for \(\exists x\,\psi\).
For example, \(\{\exists x\,P(x),\ \neg P(c),\ P(d_1)\}\) has the witness property, with the witness \(d_1\). The set \(\{\exists x\,P(x),\ \neg P(c)\}\) does not have it.
A set \(\Gamma\) of sentences of a language \(\mathcal L\) is maximally consistent (in \(\mathcal L\)) if \(\Gamma\) is consistent and \(\Gamma\cup\{\varphi\}\) is inconsistent for every sentence \(\varphi\) of \(\mathcal L\) that is not in \(\Gamma\).
This is Definition 10.6 for sentences. The two basic properties have the same proofs as in Week 10 (Propositions 10.8 and 10.9), with Proposition 14.2 in place of Proposition 10.5. If \(\Gamma\) is maximally consistent, then for all sentences \(\varphi\):
Let \(\mathcal B\) be a structure in which every element is the value of a closed term, and let \(\mathrm{Th}(\mathcal B)\) be the set of all sentences that are true in \(\mathcal B\). Then \(\mathrm{Th}(\mathcal B)\) is maximally consistent and has the witness property.
The sentences of \(\mathcal L(\mathcal S')\) can be listed as \(\varphi_1,\varphi_2,\varphi_3,\dots\) so that every sentence appears. The argument is the one of Lemma 10.12: list the symbols of \(\mathcal S'\) and the variables in one sequence; for each \(n\) there are finitely many sentences with at most \(n\) symbols that use only the first \(n\) symbols of this sequence; list these finite sets one after the other.
Let \(\Gamma\) be a consistent set of sentences of \(\mathcal L(\mathcal S)\). Then there is a set \(\Gamma'\supseteq\Gamma\) of sentences of \(\mathcal L(\mathcal S')\) that is maximally consistent in \(\mathcal L(\mathcal S')\) and has the witness property.
Proof. Fix a list \(\varphi_1,\varphi_2,\dots\) of all sentences of \(\mathcal L(\mathcal S')\). Define \(\Gamma_0=\Gamma\), and for \(n\ge0\):
Such a \(d\) always exists: no new constant occurs in \(\Gamma_0\), and each stage adds at most two sentences, so only finitely many new constants occur in \(\Gamma_n\cup\{\varphi_{n+1}\}\). Let \(\Gamma'=\bigcup_{n\ge0}\Gamma_n\).
Claim 1: each \(\Gamma_n\) is consistent. \(\Gamma_0\) is consistent in \(\mathcal L(\mathcal S')\) by Corollary 14.5. Suppose \(\Gamma_n\) is consistent. In the first two cases \(\Gamma_{n+1}\) is consistent by its definition. In the third case \(\Gamma_n\cup\{\exists x\,\psi\}\) is consistent, it deduces \(\exists x\,\psi\), and \(d\) occurs neither in it nor in \(\psi\). By Lemma 14.6, \(\Gamma_{n+1}\) is consistent.
Claim 2: \(\Gamma'\) is consistent. As in Lemma 10.13: two deductions of \(\psi\) and \(\neg\psi\) from \(\Gamma'\) use finitely many members of \(\Gamma'\), and these all lie in one \(\Gamma_N\), which would then be inconsistent.
Claim 3: \(\Gamma'\) is maximally consistent. Let \(\varphi\notin\Gamma'\) be a sentence, say \(\varphi=\varphi_k\). It was not added at stage \(k\), so \(\Gamma_{k-1}\cup\{\varphi_k\}\) is inconsistent, and so is the larger set \(\Gamma'\cup\{\varphi\}\).
Claim 4: \(\Gamma'\) has the witness property. Let \(\exists x\,\psi\in\Gamma'\), say \(\exists x\,\psi=\varphi_k\). The set \(\Gamma_{k-1}\cup\{\varphi_k\}\) is a subset of \(\Gamma'\), so it is consistent. Hence at stage \(k\) the third case applied, and \(\psi[d/x]\) was added for some constant \(d\). □
Signature: \(P\) and \(c\) as in Example 14.1(a), and \(\Gamma=\{\exists x\,P(x),\ \neg P(c)\}\). Suppose the list of sentences of \(\mathcal L(\mathcal S')\) begins with
\(\varphi_1=P(c),\quad\varphi_2=\exists x\,P(x),\quad\varphi_3=\neg P(d_1),\quad\varphi_4=(c=d_1).\)
| Stage | Sentence | Decision | Result |
|---|---|---|---|
| 1 | \(P(c)\) | \(\Gamma_0\cup\{P(c)\}\) contains \(P(c)\) and \(\neg P(c)\): inconsistent. Skip. | \(\Gamma_1=\Gamma\) |
| 2 | \(\exists x\,P(x)\) | Already in \(\Gamma_1\), so adding it keeps the set consistent. It begins with \(\exists\): add a witness. The first new constant not yet used is \(d_1\). | \(\Gamma_2=\Gamma\cup\{P(d_1)\}\) |
| 3 | \(\neg P(d_1)\) | \(\Gamma_2\) contains \(P(d_1)\): inconsistent. Skip. | \(\Gamma_3=\Gamma_2\) |
| 4 | \(c=d_1\) | From \(c=d_1\) and \(P(d_1)\) we deduce \(P(c)\) (Proposition 13.10(b), (d)); with \(\neg P(c)\) this is inconsistent. Skip. | \(\Gamma_4=\Gamma_2\) |
After four stages the set says that there is an object with the name \(d_1\), that it has the property \(P\), and, since \(c=d_1\) was skipped, the final set \(\Gamma'\) will contain \(\neg(c=d_1)\): the witness is different from \(c\). The obstacle of Example 14.1(a) is gone.
Self-check only. Nothing here counts towards your grade.
The signature has unary relation symbols \(P,Q\) and a constant symbol \(c\). At some stage the set is \(\Gamma_n=\{\forall x\,(P(x)\to Q(x)),\ \neg Q(c),\ \exists x\,P(x),\ P(d_1)\}\). For each candidate for \(\varphi_{n+1}\) choose what the construction of Lemma 14.11 does.
(a) Skipped. From \(\forall x\,(P(x)\to Q(x))\) and \(P(c)\) we deduce \(Q(c)\), and \(\neg Q(c)\) is in \(\Gamma_n\).
(b) Added, with a witness. \(\Gamma_n\cup\{\exists x\,\neg Q(x)\}\) is consistent: it has the model with domain \(\{0,1\}\), \(c\) and \(d_1\) interpreted as \(0\) and \(1\), \(P\) as \(\{1\}\) and \(Q\) as \(\{1\}\). The sentence begins with \(\exists\), and \(d_1\) is already used, so \(\neg Q(d_2)\) is added.
(c) Added, without a witness. \(Q(d_1)\) is deducible from \(\Gamma_n\), so adding it keeps the set consistent. It does not begin with \(\exists\).
(d) Skipped. \(\Gamma_n\) deduces \(Q(d_1)\), and from \(c=d_1\) and \(Q(d_1)\) we deduce \(Q(c)\).
(e) Added, without a witness. The sentence \(\neg\exists x\,(P(x)\wedge\neg Q(x))\) is deducible from \(\forall x\,(P(x)\to Q(x))\), so the set stays consistent. The sentence begins with \(\neg\), not with \(\exists\).
In Week 10 the membership rules (Proposition 10.10) said that membership in a maximally consistent set follows the truth table of each connective. Now there are two more rules, for the quantifiers. One deduction is needed first.
For every formula \(\psi\): \(\ \vdash\neg\forall x\,\psi\to\exists x\,\neg\psi\).
Proof.
Line 1 is (L14) with \(t:=x\). Line 7 is an instance of (L11) because \(x\) is not free in \(\neg\exists x\,\neg\psi\). □
This is the deduction that corresponds to the law \(\neg\forall x\,\varphi\equiv\exists x\,\neg\varphi\) of Proposition 12.27. The idea is on lines 1 to 8: if nothing is a counterexample, then \(\psi\) holds for an arbitrary \(x\), hence for all \(x\).
Let \(\Gamma'\) be a set of sentences of \(\mathcal L(\mathcal S')\) that is maximally consistent and has the witness property. Let \(\varphi,\psi\) be sentences, and let \(\theta\) be a formula with no free variable other than \(x\). "Closed term" means closed term of \(\mathcal L(\mathcal S')\).
Proof. (a), (b) and (c) are proved as in Proposition 10.10. Each proof shows \(\Gamma'\vdash\chi\) for a sentence \(\chi\) and concludes \(\chi\in\Gamma'\).
(d) In Week 10, \(\vee\) was an abbreviation. Now it is a symbol with the axioms (L7) to (L9), and the rule needs a new proof. (\(\Leftarrow\)) If \(\varphi\in\Gamma'\), then (L7) and MP give \(\Gamma'\vdash\varphi\vee\psi\); if \(\psi\in\Gamma'\), use (L8). (\(\Rightarrow\)) Suppose \(\varphi\vee\psi\in\Gamma'\), \(\varphi\notin\Gamma'\) and \(\psi\notin\Gamma'\). By (a), \(\neg\varphi\in\Gamma'\) and \(\neg\psi\in\Gamma'\). Let \(\chi\) be any sentence. By Lemma 9.5(a) and MP, \(\Gamma'\vdash\varphi\to\chi\) and \(\Gamma'\vdash\psi\to\chi\). The instance \((\varphi\to\chi)\to((\psi\to\chi)\to((\varphi\vee\psi)\to\chi))\) of (L9) and MP three times give \(\Gamma'\vdash\chi\). This holds for every \(\chi\), so \(\Gamma'\) is inconsistent, a contradiction.
(e) (\(\Rightarrow\)) This is the witness property. (\(\Leftarrow\)) Let \(\theta[t/x]\in\Gamma'\). A closed term is free for \(x\) in every formula, so \(\theta[t/x]\to\exists x\,\theta\) is an instance of (L14). By MP, \(\Gamma'\vdash\exists x\,\theta\), so \(\exists x\,\theta\in\Gamma'\).
(f) (\(\Rightarrow\)) Let \(\forall x\,\theta\in\Gamma'\) and let \(t\) be a closed term. Then \(\forall x\,\theta\to\theta[t/x]\) is an instance of (L10), and MP gives \(\theta[t/x]\in\Gamma'\). (\(\Leftarrow\)) We prove the contrapositive. Let \(\forall x\,\theta\notin\Gamma'\). By (a), \(\neg\forall x\,\theta\in\Gamma'\). By Lemma 14.13 and MP, \(\Gamma'\vdash\exists x\,\neg\theta\), so \(\exists x\,\neg\theta\in\Gamma'\). By the witness property there is a closed term \(t\) with \(\neg\theta[t/x]\in\Gamma'\). By (a), \(\theta[t/x]\notin\Gamma'\). So not every closed term \(t\) has \(\theta[t/x]\in\Gamma'\). □
Rules (e) and (f) are the clauses of Definition 12.23 for \(\exists\) and \(\forall\), with "closed term" in place of "element" and "\(\in\Gamma'\)" in place of "true". The directions (e)(\(\Rightarrow\)) and (f)(\(\Leftarrow\)) are the two places where the witness property is used.
In the signature of Example 14.1(a) the set \(\{P(c),\ \neg\forall x\,P(x)\}\) is consistent: it has a model with two elements. Extend it to a set \(\Delta\) that is maximally consistent in \(\mathcal L(\mathcal S)\), without new constants. The only closed term is \(c\), and \(P(c)\in\Delta\). So \(P(t)\in\Delta\) for every closed term \(t\), and still \(\forall x\,P(x)\notin\Delta\).
Let \(\Gamma'\) be maximally consistent with the witness property, in a signature whose closed terms are the constants \(c,d_1,d_2,\dots\) only. Suppose \(P(c)\notin\Gamma'\), and \(P(d_i)\in\Gamma'\) for every \(i\).
Self-check only. Nothing here counts towards your grade.
The signature has a unary relation symbol \(P\), a binary relation symbol \(E\) and no function symbols. The set \(\Gamma'\) is maximally consistent and has the witness property. Its closed terms are the constants \(c,d_1,d_2\) (to keep the exercise finite, suppose there are no other constants). Among the atomic sentences without \(=\), exactly the following five are in \(\Gamma'\):
\(P(c),\quad P(d_1),\quad E(c,d_1),\quad E(d_1,d_2),\quad E(d_2,d_2),\)
Every other atomic sentence without \(=\), for example \(P(d_2)\) or \(E(c,c)\), is not in \(\Gamma'\). Decide for each sentence whether it is in \(\Gamma'\), using Proposition 14.14.
(a) In \(\Gamma'\): \(P(d_2)\notin\Gamma'\), so \(\neg P(d_2)\in\Gamma'\) by (a), and (e) applies with \(t:=d_2\).
(b) In \(\Gamma'\): by (f), check \(\exists y\,E(t,y)\) for \(t=c,d_1,d_2\). The witnesses are \(d_1\), \(d_2\), \(d_2\).
(c) Not in \(\Gamma'\): by (e) we would need a closed term \(t\) with \(E(s,t)\in\Gamma'\) for all \(s\). No term works: \(E(c,c)\), \(E(d_1,d_1)\) and \(E(c,d_2)\) are not in \(\Gamma'\).
(d) In \(\Gamma'\): for \(t=c\) and \(t=d_1\) the consequent \(\exists y\,E(t,y)\wedge\neg E(t,t)\) is in \(\Gamma'\); for \(t=d_2\) the antecedent \(P(d_2)\) is not in \(\Gamma'\), so the implication is, by (b).
(e) Not in \(\Gamma'\): \(\forall x\,P(x)\notin\Gamma'\) because \(P(d_2)\notin\Gamma'\), and \(\exists x\,E(x,c)\notin\Gamma'\) because no atomic sentence \(E(t,c)\) is in \(\Gamma'\). By (d) the disjunction is not in \(\Gamma'\).
(f) In \(\Gamma'\): \(\forall x\,E(x,x)\notin\Gamma'\) since \(E(c,c)\notin\Gamma'\); by (a) its negation is in \(\Gamma'\).
Today we turn a maximally consistent set with witnesses into a structure, read truth off membership, and obtain the Completeness Theorem and the Compactness Theorem.
Throughout today \(\Gamma'\) is a set of sentences of \(\mathcal L(\mathcal S')\) that is maximally consistent and has the witness property, as provided by Lemma 14.11. "Closed term" means closed term of \(\mathcal L(\mathcal S')\), and "rule (a)" to "rule (f)" are the membership rules of Proposition 14.14.
The domain of the structure will be made of the closed terms of \(\mathcal L(\mathcal S')\). There is at least one, the constant \(d_1\). Two closed terms must give the same element when \(\Gamma'\) says that they are equal.
For closed terms \(s,t\) of \(\mathcal L(\mathcal S')\) we write \(s\sim t\) if the sentence \(s=t\) is in \(\Gamma'\).
Proof. (a) Reflexive: \(\vdash t=t\) by Proposition 13.10(a), so \(t=t\in\Gamma'\). Symmetric: if \(s=t\in\Gamma'\), then Proposition 13.10(b) and MP give \(\Gamma'\vdash t=s\), so \(t=s\in\Gamma'\). Transitive: if \(s=t\) and \(t=r\) are in \(\Gamma'\), then Proposition 13.10(c) and MP twice give \(s=r\in\Gamma'\).
(b) We change one argument at a time. For the first argument, let \(\varphi\) be the atomic formula \(f(s_1,s_2,\dots,s_n)=f(z,s_2,\dots,s_n)\). Then \(\varphi[s_1/z]\) is \(f(s_1,\dots,s_n)=f(s_1,\dots,s_n)\), which is in \(\Gamma'\) by (a), and \(\varphi[t_1/z]\) is \(f(s_1,s_2,\dots,s_n)=f(t_1,s_2,\dots,s_n)\). By Proposition 13.10(d) and MP twice, the second sentence is in \(\Gamma'\). So \(f(s_1,s_2,\dots,s_n)\sim f(t_1,s_2,\dots,s_n)\). In the same way we replace \(s_2\) by \(t_2\), and so on; transitivity connects the steps.
(c) Again one argument at a time, with the atomic formula \(r(z,s_2,\dots,s_n)\): if \(r(s_1,s_2,\dots,s_n)\in\Gamma'\) and \(s_1=t_1\in\Gamma'\), then Proposition 13.10(d) gives \(r(t_1,s_2,\dots,s_n)\in\Gamma'\). The converse direction uses \(t_1\sim s_1\). □
We write \([t]\) for the equivalence class of \(t\), the set of all closed terms \(s\) with \(s\sim t\). So \([s]=[t]\) if and only if \(s=t\in\Gamma'\).
The term model of \(\Gamma'\) is the \(\mathcal S'\)-structure \(\mathcal A\) with
The last two clauses refer to the terms \(t_i\), and the same class has many members. By Lemma 14.17(b) and (c) the result does not depend on which members are chosen, so the definition makes sense. The domain is not empty.
For every closed term \(t\) of \(\mathcal L(\mathcal S')\): \(\ [\![t]\!]_{\mathcal A}=[t]\).
Proof. By induction on \(t\). For a constant, \([\![c]\!]_{\mathcal A}=c^{\mathcal A}=[c]\). For \(t=f(t_1,\dots,t_n)\): \([\![t]\!]_{\mathcal A}=f^{\mathcal A}([\![t_1]\!]_{\mathcal A},\dots,[\![t_n]\!]_{\mathcal A}) =f^{\mathcal A}([t_1],\dots,[t_n])=[f(t_1,\dots,t_n)]\), by Definition 12.21, the induction hypothesis and Definition 14.18. □
So every element of \(\mathcal A\) is the value of a closed term. This is the situation of Example 14.10.
Signature: a constant symbol \(c\), a unary function symbol \(f\) and a unary relation symbol \(P\). Suppose \(\Gamma'\) contains
\(f(f(c))=c,\qquad\neg(f(c)=c),\qquad P(c),\qquad\neg P(f(c)),\qquad d_i=c\ \text{ for every }i.\)
Self-check only. Nothing here counts towards your grade.
Signature: a constant symbol \(c\) and a unary function symbol \(f\). Write \(f^k(c)\) for \(f\) applied \(k\) times to \(c\), so \(f^0(c)\) is \(c\). The set \(\Gamma'\) contains
\(f^3(c)=c,\qquad\neg(f(c)=c),\qquad d_i=c\ \text{ for every }i.\)
Decide for each pair of terms whether they are in the same class, and enter the number of elements of the term model.
From \(f^3(c)\sim c\) and Lemma 14.17(b), \(f^{k+3}(c)\sim f^k(c)\) for every \(k\). So \(f^m(c)\) and \(f^n(c)\) are in the same class when \(m-n\) is divisible by \(3\), and every closed term is equivalent to one of \(c\), \(f(c)\), \(f^2(c)\).
These three are pairwise inequivalent. If \(f^2(c)\sim c\), apply \(f\): \(f^3(c)\sim f(c)\), so \(c\sim f(c)\), which contradicts \(\neg(f(c)=c)\in\Gamma'\). If \(f^2(c)\sim f(c)\), apply \(f\): \(f^3(c)\sim f^2(c)\), so \(c\sim f^2(c)\), which was just excluded. And \(f(c)\not\sim c\) is given.
So (a) no, (b) no, (c) yes, (d) yes, (e) no, and the term model has \(3\) elements.
Let \(\mathcal A\) be the term model of \(\Gamma'\). For every sentence \(\varphi\) of \(\mathcal L(\mathcal S')\): \[\mathcal A\models\varphi\quad\text{if and only if}\quad\varphi\in\Gamma'.\]
Proof. By induction on the number of connectives and quantifiers in \(\varphi\).
\(\varphi\) is \(r(t_1,\dots,t_n)\). \(\mathcal A\models r(t_1,\dots,t_n)\) iff \(([\![t_1]\!]_{\mathcal A},\dots,[\![t_n]\!]_{\mathcal A})\in r^{\mathcal A}\) iff \(([t_1],\dots,[t_n])\in r^{\mathcal A}\) (Lemma 14.19) iff \(r(t_1,\dots,t_n)\in\Gamma'\) (Definition 14.18).
\(\varphi\) is \(t_1=t_2\). \(\mathcal A\models t_1=t_2\) iff \([\![t_1]\!]_{\mathcal A}=[\![t_2]\!]_{\mathcal A}\) iff \([t_1]=[t_2]\) iff \(t_1=t_2\in\Gamma'\).
\(\varphi\) is \(\neg\psi\), \(\psi\to\chi\), \(\psi\wedge\chi\) or \(\psi\vee\chi\). As in Lemma 10.16. For example, \(\mathcal A\models\neg\psi\) iff \(\mathcal A\not\models\psi\) iff \(\psi\notin\Gamma'\) (induction hypothesis) iff \(\neg\psi\in\Gamma'\) (rule (a)). The other three use rules (b), (c) and (d).
\(\varphi\) is \(\forall x\,\theta\).
| \(\mathcal A\models\forall x\,\theta\) | ||
| iff | \(\mathcal A\models\theta[\bar a/x]\) for every \(a\in A\) | Definition 12.23 |
| iff | \(\mathcal A\models\theta[t/x]\) for every closed term \(t\) | Lemmas 14.19 and 13.19 |
| iff | \(\theta[t/x]\in\Gamma'\) for every closed term \(t\) | induction hypothesis |
| iff | \(\forall x\,\theta\in\Gamma'\) | rule (f) |
For the second step: every element \(a\) of \(A\) is \([t]\) for a closed term \(t\), and \([t]\) is the value of \(t\); by Lemma 13.19 the sentences \(\theta[\bar a/x]\) and \(\theta[t/x]\) have the same truth value in \(\mathcal A\). For the third step: \(\theta[t/x]\) is a sentence of \(\mathcal L(\mathcal S')\) with one quantifier fewer than \(\varphi\).
\(\varphi\) is \(\exists x\,\theta\). The same chain with "some" in place of "every" and rule (e) in place of rule (f). □
As in Week 10 the proof is short because the membership rules did the work. Each case of the induction is one membership rule, and the two quantifier cases are the two places where witnesses are needed.
Every consistent set \(\Gamma\) of sentences of \(\mathcal L(\mathcal S)\) has a model.
Proof. By Lemma 14.11 there is a set \(\Gamma'\supseteq\Gamma\) of sentences of \(\mathcal L(\mathcal S')\) that is maximally consistent and has the witness property. Let \(\mathcal A\) be its term model. By the Truth Lemma every member of \(\Gamma'\) is true in \(\mathcal A\), in particular every member of \(\Gamma\). The structure \(\mathcal A\) is an \(\mathcal S'\)-structure. Forget the interpretations of \(d_1,d_2,\dots\); what remains is an \(\mathcal S\)-structure with the same domain, and the sentences of \(\Gamma\), which do not contain the new constants, have the same truth values in it. □
Let \(\Gamma\) be a set of sentences and \(\varphi\) a formula. If \(\Gamma\models\varphi\), then \(\Gamma\vdash\varphi\).
Proof. First let \(\varphi\) be a sentence. We prove the contrapositive. Suppose \(\Gamma\nvdash\varphi\). By Proposition 14.2(a), \(\Gamma\cup\{\neg\varphi\}\) is consistent. By Theorem 14.22 it has a model \(\mathcal A\). Then \(\mathcal A\models\Gamma\) and \(\mathcal A\not\models\varphi\), so \(\Gamma\not\models\varphi\).
Now let \(\varphi\) have the free variables \(x_1,\dots,x_n\). By Definition 12.25, \(\Gamma\models\varphi\) means \(\Gamma\models\forall x_1\cdots\forall x_n\,\varphi\). By the first part, \(\Gamma\vdash\forall x_1\cdots\forall x_n\,\varphi\). Now (L10) with \(t:=x_i\) and MP, applied \(n\) times, remove the quantifiers: \(\Gamma\vdash\varphi\). □
Let \(\Gamma\) be a set of sentences and \(\varphi\) a formula.
Proof. (a) is Theorem 13.22 together with Theorem 14.23, and (b) is the case \(\Gamma=\varnothing\). (c) is Corollary 13.23(b) together with Theorem 14.22. □
The theorem was proved by Kurt Gödel in 1929. The proof given here, with new constants as witnesses, is due to Leon Henkin (1949).
A theorem of group theory is a sentence that is true in every group, that is, a sentence \(\varphi\) with \(\Gamma_{\mathrm{gr}}\models\varphi\). A proof in group theory is, when all steps are written out, a deduction from \(\Gamma_{\mathrm{gr}}\). Soundness says that what is proved is true in every group. Completeness says that every sentence that is true in every group has a proof, and the fifteen axiom schemes and two rules of Definition 13.1 are enough for it. No further logical principle is ever needed. The same holds for every theory given by first-order axioms.
The model built in Theorem 14.22 is small. The closed terms of \(\mathcal L(\mathcal S')\) can be listed in a sequence, so the domain of the term model is finite or can be listed as \(a_1,a_2,a_3,\dots\). Hence every consistent set of sentences (in a signature of the kind we consider) has a model whose domain is finite or listable. This is the Löwenheim–Skolem Theorem.
A deduction has finitely many lines, so it uses finitely many assumptions (Lemma 10.25; the proof is the same for first-order deductions). With Corollary 14.24 this becomes a statement about models, exactly as in Week 10.
A set \(\Gamma\) of sentences has a model if and only if every finite subset of \(\Gamma\) has a model.
Proof. (\(\Rightarrow\)) A model of \(\Gamma\) is a model of every subset. (\(\Leftarrow\)) Suppose \(\Gamma\) has no model. By Corollary 14.24(c), \(\Gamma\) is inconsistent: \(\Gamma\vdash\psi\) and \(\Gamma\vdash\neg\psi\) for some \(\psi\). The two deductions use finitely many members of \(\Gamma\); let \(\Gamma_0\) be the set of these. Then \(\Gamma_0\) is a finite inconsistent subset of \(\Gamma\), and by Corollary 13.23(b) it has no model. □
If \(\Gamma\models\varphi\), then there is a finite set \(\Gamma_0\subseteq\Gamma\) with \(\Gamma_0\models\varphi\).
Proof. \(\Gamma\vdash\varphi\) by completeness; the deduction uses a finite \(\Gamma_0\subseteq\Gamma\), so \(\Gamma_0\vdash\varphi\); then \(\Gamma_0\models\varphi\) by soundness. □
The statement of the Compactness Theorem mentions no deductions, and its proof depends on them. Its first application answers the question left open at the end of Week 12. Recall the sentence \(\lambda_{\ge n}\), which is true in a structure exactly when the domain has at least \(n\) elements.
Proof. (a) Let \(\Gamma=\Sigma\cup\{\lambda_{\ge n}:n\ge1\}\). A finite subset \(\Gamma_0\) of \(\Gamma\) contains finitely many of the sentences \(\lambda_{\ge n}\); let \(N\) be the largest \(n\) that occurs. By assumption \(\Sigma\) has a finite model with at least \(N\) elements, and this is a model of \(\Gamma_0\). By the Compactness Theorem \(\Gamma\) has a model \(\mathcal A\). It is a model of \(\Sigma\), and it satisfies \(\lambda_{\ge n}\) for every \(n\), so it is infinite.
(b) Such a set would have finite models of every size, and by (a) an infinite model.
(c) If \(\sigma\) were true exactly in the infinite structures, then \(\neg\sigma\) would be true exactly in the finite ones, which contradicts (b). □
So the infinite set \(\{\lambda_{\ge n}:n\ge1\}\) of Week 12 cannot be replaced by one sentence, and for "finite" not even an infinite set of sentences is enough.
Signature: constant symbols \(c_1,c_2,c_3,\dots\) and a binary relation symbol \(<\). Let \(\Gamma\) consist of the axioms of a strict linear order (irreflexive, transitive, any two different elements are comparable) and the sentences \(c_{n+1}<c_n\) for all \(n\ge1\).
This remark is not needed for the homework. Let \(\mathrm{Th}(\mathcal N)\) be the set of all sentences of \(\mathcal L(\mathcal S_{\mathrm{ar}})\) that are true in the natural numbers \(\mathcal N\). Add one new constant symbol \(c\), and let \[\Gamma=\mathrm{Th}(\mathcal N)\cup\{0<c,\ \ 1<c,\ \ 1+1<c,\ \ (1+1)+1<c,\ \dots\}.\] A finite subset of \(\Gamma\) contains finitely many of the new sentences, and it is true in \(\mathcal N\) when \(c\) is interpreted as a large enough number. By the Compactness Theorem \(\Gamma\) has a model \(\mathcal M\). Every sentence that is true in the natural numbers is true in \(\mathcal M\), and \(\mathcal M\) has an element, the value of \(c\), that is larger than \(0,1,2,3,\dots\). So no set of first-order sentences, not even the set of all true ones, describes the natural numbers completely.
Self-check only. Nothing here counts towards your grade.
Choose the correct statement in each item.
(a) \(\Gamma\) has a model. Every finite subset contains \(\lambda_{\ge n}\) for finitely many \(n\) and is true in a large enough finite structure, or in any infinite one. The models of \(\Gamma\) are the infinite structures.
(b) \(\Gamma\) has no model, and the finite subset \(\{\lambda_{\ge3},\ \neg\lambda_{\ge2}\}\) already has none. The theorem is not needed to see this, but it guarantees that such a finite subset exists whenever there is no model.
(c) Some finite subset entails \(\varphi\). This is Corollary 14.27. A deduction uses finitely many assumptions.
(d) \(\Sigma\) has an infinite model, by Theorem 14.28(a). It may have finite models as well, and it does.
Today we show that no algorithm decides whether a first-order sentence is valid. The proof translates the run of a Turing machine into first-order sentences.
A decision problem is a question with a yes-or-no answer for each input from an infinite collection of inputs. An algorithm decides the problem if for every input it stops after finitely many steps with the correct answer. If such an algorithm exists, the problem is decidable.
Hilbert and Ackermann asked in 1928 for an algorithm that decides the validity of first-order sentences; this is the Entscheidungsproblem, the decision problem. In 1936 Alonzo Church and Alan Turing proved, independently, that there is none. To prove that no algorithm exists, one first needs a precise definition of "algorithm". Turing's definition is the following.
A Turing machine \(M\) consists of
The machine works on a tape that is divided into cells. The tape has a first cell and continues to the right without end. Each cell holds one letter. A head stands on one cell. If the machine is in state \(q\), the head reads the letter \(a\), and \(\delta(q,a)=(r,b,D)\), then the machine writes \(b\) into the cell, moves the head one cell in direction \(D\), and goes into state \(r\). A head on the first cell that is told to move left stays where it is. If the table has no entry for \((q,a)\), the machine stops.
At every moment only finitely many cells have been used; all cells further to the right are blank. So the whole situation can be written down with two strings.
A configuration is a triple \((q,u,v)\) of a state \(q\) and two strings \(u,v\) of letters. It describes the following situation (Figure 3): the machine is in state \(q\); \(u\) lists the cells to the left of the head, starting next to the head and going left; \(v\) lists the cell under the head and the cells to its right, as far as they have been used. If \(v\) is the empty string \(\varepsilon\), the head stands on a blank cell that has not been used yet.
The table entry \(\delta(q,a)=(r,b,D)\) allows the following steps, for all strings \(u,v\) and all letters \(c\):
| Entry | Situation | Step |
|---|---|---|
| \((r,b,\mathrm R)\) | the head reads \(a\) | \((q,\ u,\ av)\ \Rightarrow\ (r,\ bu,\ v)\) |
| \((r,b,\mathrm L)\) | the head reads \(a\), with \(c\) to its left | \((q,\ cu,\ av)\ \Rightarrow\ (r,\ u,\ cbv)\) |
| \((r,b,\mathrm L)\) | the head reads \(a\) on the first cell | \((q,\ \varepsilon,\ av)\ \Rightarrow\ (r,\ \varepsilon,\ bv)\) |
If \(a\) is the blank, the same entry also applies when \(v\) is empty, because an unused cell is blank:
| Entry | Situation | Step |
|---|---|---|
| \((r,b,\mathrm R)\) | the head is on an unused cell | \((q,\ u,\ \varepsilon)\ \Rightarrow\ (r,\ bu,\ \varepsilon)\) |
| \((r,b,\mathrm L)\) | unused cell, with \(c\) to its left | \((q,\ cu,\ \varepsilon)\ \Rightarrow\ (r,\ u,\ cb)\) |
| \((r,b,\mathrm L)\) | unused first cell | \((q,\ \varepsilon,\ \varepsilon)\ \Rightarrow\ (r,\ \varepsilon,\ b)\) |
The initial configuration for an input string \(w\) is \((q_0,\varepsilon,w)\): the input is written at the beginning of the tape and the head is on the first cell. A configuration is reachable (for the input \(w\)) if it can be obtained from the initial configuration by finitely many steps, possibly none. \(M\) accepts \(w\) if a configuration with the state \(q_{\mathrm{acc}}\) is reachable.
With \(u\) written in this order, the letter next to the head is the first letter of \(u\), and a step changes \(u\) and \(v\) only at their beginnings. For a given configuration at most one step is possible, so the machine is deterministic.
The machine \(M_1\) has the alphabet \(\{a,\sqcup\}\), the states \(q_0,q_1,q_{\mathrm{acc}}\) and three table entries:
\(\delta(q_0,a)=(q_1,a,\mathrm R),\qquad\delta(q_1,a)=(q_{\mathrm{acc}},a,\mathrm R),\qquad \delta(q_1,\sqcup)=(q_0,a,\mathrm L).\)
Every algorithm that has ever been proposed can be carried out by a Turing machine, and "decidable by an algorithm" is understood as "decidable by a Turing machine that always stops". The basic negative result is the following.
There is no algorithm that, given a Turing machine \(M\) and an input \(w\), decides whether \(M\) accepts \(w\).
The proof belongs to a course on computability. Its idea fits into four sentences. A Turing machine is a finite table, so it can be written down as a string and given as an input to a machine. If an algorithm decided acceptance, we could build a machine \(D\) that, given the table of a machine \(M\), accepts exactly when \(M\) does not accept its own table. Now give \(D\) its own table: \(D\) accepts it exactly when \(D\) does not accept it. This is impossible, so the algorithm does not exist.
Fix a Turing machine \(M\) and an input \(w\). We describe the run of \(M\) on \(w\) in a first-order language. The signature \(\mathcal S_M\) has
Every string has a closed term. For a string \(s\) we write \(\underline{s}\) for its term: \(\underline{\varepsilon}\) is \(e\), and \(\underline{as}\) is \(f_a(\underline{s})\). For example, \(\underline{bab}\) is \(f_b(f_a(f_b(e)))\). The intended reading of \(R_q(\underline u,\underline v)\) is: the configuration \((q,u,v)\) is reachable.
\(\Gamma_{M,w}\) is the following finite set of sentences of \(\mathcal L(\mathcal S_M)\).
The acceptance sentence is \(\alpha:=\exists x\,\exists y\,R_{q_{\mathrm{acc}}}(x,y)\).
Each sentence is one row of the tables in Definition 14.32, with variables \(x,y\) for the strings \(u,v\). The set is finite because the table and the alphabet are finite.
For the machine of Example 14.33 and the input \(aa\), the set \(\Gamma_{M_1,aa}\) has nine sentences.
| From | Sentence |
|---|---|
| start | \(R_{q_0}(e,f_a(f_a(e)))\) |
| \(\delta(q_0,a)=(q_1,a,\mathrm R)\) | \(\sigma_1:\ \forall x\,\forall y\,(R_{q_0}(x,f_a(y))\to R_{q_1}(f_a(x),y))\) |
| \(\delta(q_1,a)=(q_{\mathrm{acc}},a,\mathrm R)\) | \(\sigma_2:\ \forall x\,\forall y\,(R_{q_1}(x,f_a(y))\to R_{q_{\mathrm{acc}}}(f_a(x),y))\) |
| \(\delta(q_1,\sqcup)=(q_0,a,\mathrm L)\) | \(\forall x\,\forall y\,(R_{q_1}(f_a(x),f_\sqcup(y))\to R_{q_0}(x,f_a(f_a(y))))\) |
| \(\forall x\,\forall y\,(R_{q_1}(f_\sqcup(x),f_\sqcup(y))\to R_{q_0}(x,f_\sqcup(f_a(y))))\) | |
| \(\forall y\,(R_{q_1}(e,f_\sqcup(y))\to R_{q_0}(e,f_a(y)))\) | |
| \(\forall x\,(R_{q_1}(f_a(x),e)\to R_{q_0}(x,f_a(f_a(e))))\) | |
| \(\forall x\,(R_{q_1}(f_\sqcup(x),e)\to R_{q_0}(x,f_\sqcup(f_a(e))))\) | |
| \(R_{q_1}(e,e)\to R_{q_0}(e,f_a(e))\) |
The two right-moving entries read \(a\), which is not the blank, and give one sentence each. The left-moving entry reads the blank and gives six: the letter \(c\) to the left of the head can be \(a\) or \(\sqcup\), or the head is on the first cell; and each of these three cases occurs with a used and with an unused head cell.
Self-check only. Nothing here counts towards your grade.
The alphabet is \(\{a,b,\sqcup\}\). For each table entry and situation choose the sentence of Definition 14.35 that describes it.
(a) The step is \((q,u,av)\Rightarrow(r,bu,v)\): the letter \(a\) is removed from the front of \(v\), and the written letter \(b\) is put in front of \(u\), because after the move it is the cell next to the head on the left. The sentence is \(\forall x\,\forall y\,(R_q(x,f_a(y))\to R_r(f_b(x),y))\).
(b) The step is \((q,bu,av)\Rightarrow(r,u,bbv)\) for \(c=b\): the head moves onto the cell that held \(c=b\), so \(c\) leaves \(u\) and goes to the front of \(v\), followed by the written letter \(b\). The sentence is \(\forall x\,\forall y\,(R_q(f_b(x),f_a(y))\to R_r(x,f_b(f_b(y))))\).
(c) The head is on an unused cell, so \(v\) is empty and its term is \(e\). The step is \((q,u,\varepsilon)\Rightarrow(r,au,\varepsilon)\), and the sentence is \(\forall x\,(R_q(x,e)\to R_r(f_a(x),e))\).
Self-check only. Nothing here counts towards your grade.
The alphabet is \(\{a,b,\sqcup\}\). For each tape, enter the terms \(\underline u\) and \(\underline v\) of
its configuration \((q,u,v)\). Type fa(fb(e)) for \(f_a(f_b(e))\) and e for the
constant \(e\).
(a) This is the tape of Figure 3: \(u=ba\) and \(v=bab\), so \(\underline u=f_b(f_a(e))\) and \(\underline v=f_b(f_a(f_b(e)))\).
(b) The head is on the first cell, so \(u\) is empty: \(\underline u=e\) and \(\underline v=f_a(f_a(f_b(e)))\).
(c) The head is on the first unused cell, so \(v\) is empty. To the left of the head are \(a,a,b\) in tape order, so \(u=baa\): \(\underline u=f_b(f_a(f_a(e)))\) and \(\underline v=e\).
If \((q,u,v)\Rightarrow(r,u',v')\) is a step of \(M\), then \(\ \Gamma_{M,w}\vdash R_q(\underline u,\underline v)\to R_r(\underline{u'},\underline{v'})\).
Proof. Take a step by an entry \((r,b,\mathrm R)\) with a used head cell: \((q,u,av)\Rightarrow(r,bu,v)\). The set \(\Gamma_{M,w}\) contains the sentence \(\sigma=\forall x\,\forall y\,(R_q(x,f_a(y))\to R_r(f_b(x),y))\).
| 1 | \(\sigma\) | (assump.) |
| 2 | \(\sigma\to\forall y\,(R_q(\underline u,f_a(y))\to R_r(f_b(\underline u),y))\) | (L10), \(t:=\underline u\) |
| 3 | \(\forall y\,(R_q(\underline u,f_a(y))\to R_r(f_b(\underline u),y))\) | (1,2 MP) |
| 4 | \(\forall y\,(R_q(\underline u,f_a(y))\to R_r(f_b(\underline u),y))\to(R_q(\underline u,f_a(\underline v))\to R_r(f_b(\underline u),\underline v))\) | (L10), \(t:=\underline v\) |
| 5 | \(R_q(\underline u,f_a(\underline v))\to R_r(f_b(\underline u),\underline v)\) | (3,4 MP) |
The terms \(\underline u\) and \(\underline v\) are closed, so lines 2 and 4 are instances of (L10). By the definition of the terms, \(f_a(\underline v)\) is \(\underline{av}\) and \(f_b(\underline u)\) is \(\underline{bu}\). So line 5 is \(R_q(\underline u,\underline{av})\to R_r(\underline{bu},\underline v)\). The other five kinds of steps are treated in the same way with their sentences; a sentence with one quantifier needs (L10) once, and the sentence without quantifiers is already the implication. □
For every Turing machine \(M\) and every input \(w\), the following are equivalent.
Proof. (a) \(\Rightarrow\) (b). Let \((q_0,\varepsilon,w)=C_0\Rightarrow C_1\Rightarrow\cdots\Rightarrow C_n\) be the steps that lead to a configuration \(C_n=(q_{\mathrm{acc}},u,v)\). Write \(\rho_i\) for the sentence \(R_q(\underline s,\underline t)\) that belongs to \(C_i=(q,s,t)\). Then \(\rho_0\) is the start sentence, a member of \(\Gamma_{M,w}\). By Lemma 14.37, \(\Gamma_{M,w}\vdash\rho_i\to\rho_{i+1}\) for each \(i\), and MP gives \(\Gamma_{M,w}\vdash\rho_1\), then \(\rho_2\), and finally \(\Gamma_{M,w}\vdash R_{q_{\mathrm{acc}}}(\underline u,\underline v)\). Two instances of (L14) with the closed terms \(\underline v\) and \(\underline u\), \[R_{q_{\mathrm{acc}}}(\underline u,\underline v)\to\exists y\,R_{q_{\mathrm{acc}}}(\underline u,y) \qquad\text{and}\qquad \exists y\,R_{q_{\mathrm{acc}}}(\underline u,y)\to\exists x\,\exists y\,R_{q_{\mathrm{acc}}}(x,y),\] and MP twice give \(\Gamma_{M,w}\vdash\alpha\).
(b) \(\Rightarrow\) (c) is the Soundness Theorem.
(c) \(\Rightarrow\) (a). Consider the following \(\mathcal S_M\)-structure \(\mathcal A\). Its domain is the set of all strings of letters. The constant \(e\) is interpreted as the empty string, and \(f_a^{\mathcal A}(s)=as\). So the value of the term \(\underline s\) is the string \(s\). Finally, \[(u,v)\in R_q^{\mathcal A}\quad\text{iff}\quad\text{the configuration }(q,u,v)\text{ is reachable for the input }w.\] Every member of \(\Gamma_{M,w}\) is true in \(\mathcal A\). The start sentence says that \((q_0,\varepsilon,w)\) is reachable, which is true with no steps. Take the sentence \(\forall x\,\forall y\,(R_q(x,f_a(y))\to R_r(f_b(x),y))\) of an entry \((r,b,\mathrm R)\). Its truth in \(\mathcal A\) means: for all strings \(u,v\), if \((q,u,av)\) is reachable, then \((r,bu,v)\) is reachable. This holds, because \((q,u,av)\Rightarrow(r,bu,v)\) is a step. The other sentences are true for the same reason: each of them was written down from a row of Definition 14.32.
So \(\mathcal A\) is a model of \(\Gamma_{M,w}\). By (c), \(\mathcal A\models\alpha\). This means that there are strings \(u,v\) with \((u,v)\in R_{q_{\mathrm{acc}}}^{\mathcal A}\), that is, a reachable configuration with the state \(q_{\mathrm{acc}}\). So \(M\) accepts \(w\). □
The two halves of the proof use the two sides of logic. If the machine accepts, we write a deduction, and the deduction is a copy of the computation. If the machine does not accept, the structure \(\mathcal A\) is a countermodel.
The machine \(M_1\) accepts \(aa\) in two steps (Example 14.33(a)). The deduction of \(\alpha\) from \(\Gamma_{M_1,aa}\) uses the start sentence and the sentences \(\sigma_1,\sigma_2\) of Example 14.36. We write \(\underline a\) for \(f_a(e)\) and \(\underline{aa}\) for \(f_a(f_a(e))\), and \(R_{\mathrm{acc}}\) for \(R_{q_{\mathrm{acc}}}\).
| 1 | \(R_{q_0}(e,\underline{aa})\) | (assump.) |
| 2 | \(\sigma_1\) | (assump.) |
| 3 | \(\sigma_2\) | (assump.) |
| 4 | \(\sigma_1\to\forall y\,(R_{q_0}(e,f_a(y))\to R_{q_1}(f_a(e),y))\) | (L10) |
| 5 | \(\forall y\,(R_{q_0}(e,f_a(y))\to R_{q_1}(f_a(e),y))\) | (2,4 MP) |
| 6 | \(\forall y\,(R_{q_0}(e,f_a(y))\to R_{q_1}(f_a(e),y))\to(R_{q_0}(e,\underline{aa})\to R_{q_1}(\underline a,\underline a))\) | (L10) |
| 7 | \(R_{q_0}(e,\underline{aa})\to R_{q_1}(\underline a,\underline a)\) | (5,6 MP) |
| 8 | \(R_{q_1}(\underline a,\underline a)\) | (1,7 MP) |
| 9 | \(\sigma_2\to\forall y\,(R_{q_1}(\underline a,f_a(y))\to R_{\mathrm{acc}}(f_a(\underline a),y))\) | (L10) |
| 10 | \(\forall y\,(R_{q_1}(\underline a,f_a(y))\to R_{\mathrm{acc}}(f_a(\underline a),y))\) | (3,9 MP) |
| 11 | \(\forall y\,(R_{q_1}(\underline a,f_a(y))\to R_{\mathrm{acc}}(f_a(\underline a),y))\to(R_{q_1}(\underline a,\underline a)\to R_{\mathrm{acc}}(\underline{aa},e))\) | (L10) |
| 12 | \(R_{q_1}(\underline a,\underline a)\to R_{\mathrm{acc}}(\underline{aa},e)\) | (10,11 MP) |
| 13 | \(R_{\mathrm{acc}}(\underline{aa},e)\) | (8,12 MP) |
| 14 | \(R_{\mathrm{acc}}(\underline{aa},e)\to\exists y\,R_{\mathrm{acc}}(\underline{aa},y)\) | (L14) |
| 15 | \(\exists y\,R_{\mathrm{acc}}(\underline{aa},y)\) | (13,14 MP) |
| 16 | \(\exists y\,R_{\mathrm{acc}}(\underline{aa},y)\to\exists x\,\exists y\,R_{\mathrm{acc}}(x,y)\) | (L14) |
| 17 | \(\exists x\,\exists y\,R_{\mathrm{acc}}(x,y)\) | (15,16 MP) |
Lines 1, 8 and 13 are the three configurations \((q_0,\varepsilon,aa)\), \((q_1,a,a)\), \((q_{\mathrm{acc}},aa,\varepsilon)\) of the computation. Lines 4 to 8 are the first step and lines 9 to 13 the second, each with five lines as in Lemma 14.37. On line 6 the term for \(y\) is \(\underline a\), and \(f_a(\underline a)\) is \(\underline{aa}\); on line 11 the term for \(y\) is \(e\), and \(f_a(e)\) is \(\underline a\). Lines 14 to 17 say that an accepting configuration exists.
For the empty input the situation is the opposite (Example 14.33(c)). In the structure \(\mathcal A\) of the proof, only the pair of two empty strings is in \(R_{q_0}^{\mathcal A}\), and \(R_{q_1}^{\mathcal A}\) and \(R_{q_{\mathrm{acc}}}^{\mathcal A}\) are empty. All sentences of \(\Gamma_{M_1,\varepsilon}\) are true in it and \(\alpha\) is false. So \(\Gamma_{M_1,\varepsilon}\nvdash\alpha\).
There is no algorithm that decides whether a first-order sentence is valid.
Proof. Let \(\gamma_1,\dots,\gamma_k\) be the members of \(\Gamma_{M,w}\), and let \[\Phi_{M,w}:=(\gamma_1\wedge\cdots\wedge\gamma_k)\to\alpha.\] A structure is a model of \(\Gamma_{M,w}\) exactly when the conjunction is true in it. So \(\Gamma_{M,w}\models\alpha\) if and only if \(\Phi_{M,w}\) is valid, and by Theorem 14.38, \[M\text{ accepts }w\quad\text{if and only if}\quad\models\Phi_{M,w}.\] The sentence \(\Phi_{M,w}\) can be written down mechanically from the table of \(M\) and the string \(w\). Suppose an algorithm decided validity. Then the following would be an algorithm for the acceptance problem: given \(M\) and \(w\), write down \(\Phi_{M,w}\) and decide whether it is valid. This contradicts Theorem 14.34. □
Proof. (a) With \(\Gamma=\varnothing\) such an algorithm would decide whether \(\vdash\varphi\), which is the same as validity (Corollary 14.24(b)).
(b) By Example 14.30(b) a machine can print all valid sentences. If a second machine printed all sentences that are not valid, we could decide validity: given \(\varphi\), run both machines side by side and wait until \(\varphi\) appears in one of the two lists. □
Table 1 collects what the last three weeks have shown about a theory given by a set \(\Gamma\) of first-order axioms, such as the theory of groups.
| Week | Result | What it says about mathematics |
|---|---|---|
| 12 | the language; \(\Gamma\models\varphi\) | A statement of a theory is a first-order sentence. A theorem is a sentence that is true in every model of the axioms. |
| 13 | deductions; Soundness | A proof is a deduction from the axioms. What is proved is true in every model. |
| 14 | Completeness | What is true in every model has a proof. Proof and truth in all models have the same extent. |
| 14 | Compactness | A theorem depends on finitely many axioms. Some properties, such as being finite, cannot be expressed by first-order axioms. |
| 14 | Undecidability | No algorithm decides whether a sentence has a proof. A machine can check a proof; it cannot replace the search for one. |
If a theorem is true, a proof of it exists, and a machine that prints all deductions will find it in the end. If a statement is not a theorem, no general method reveals this. Finding a proof, or a structure that refutes the statement, is left to the mathematician.
| Claim | Holds? (yes / no) | If not: domain | If not: interpretation of E |
|---|---|---|---|
| (i) | |||
| (ii) |
The signature has unary relation symbols \(P,Q\) and a constant symbol \(c\).
Let \(\Gamma'\) be a maximally consistent set of sentences with the witness property, as in Proposition 14.14.
Signature: a constant symbol \(c\), a unary function symbol \(g\) and a binary relation symbol \(E\). Let \(\Gamma'\) be a maximally consistent set of sentences of \(\mathcal L(\mathcal S')\) with the witness property that contains
\(g(g(g(c)))=g(c),\qquad\neg(g(g(c))=c),\qquad\neg(g(c)=c),\qquad\neg(g(g(c))=g(c)),\qquad d_i=c\ \text{ for every }i,\)
and, among the atomic sentences \(E(s,t)\) with \(s,t\) from \(c,\ g(c),\ g(g(c))\), exactly \(E(c,g(c))\), \(E(g(c),g(g(c)))\) and \(E(g(g(c)),g(c))\).
| Element | \(g^{\mathcal A}\) of this element | Elements it is \(E^{\mathcal A}\)-related to |
|---|---|---|
| 1st | ||
| 2nd | ||
| 3rd |
Signature: a binary relation symbol \(E\). A structure is called connected in at most \(n\) steps if for all elements \(a,b\) there are \(k\le n\) and elements \(a=a_0,a_1,\dots,a_k=b\) with \((a_i,a_{i+1})\in E^{\mathcal A}\) for all \(i<k\).