Exercise 8

Published

November 5, 2026

1 Soundness

Show local soundness properties for the cases we didn’t show in lecture (\(\exists L\), and \(\forall L\))

2 Completeness, algorithmically (optional)

Implement the backwards proof search algorithm from class.

This is totally optional, I just thought it might be a fun idea if interested (I haven’t done it myself).

3 Completeness and Incompleteness

The incompleteness theorem says for any set of axioms, \(F\), that satisfy some conditions, there exists a sentence \(\varphi\) such that \(F \not \proves \varphi\), and \(F \not \proves \neg \varphi\).

Explain in two sentences or less why this does not contradict the completeness theorem.

Solution

The completeness theorem guarantees a proof of \(\varphi\) whenever \(\varphi\) is true in all models of \(F\). Hence, the \(\varphi\) given in the incompleteness theorem is true in some models of \(F\) and false in others.

4 Applications of Compactness

Do exercises 9-12 and exercise 15 here.

Note: 9 was done in lecture. 12 is optional.

4.1 Finiteness

Show that there is not a first-order sentence \(A\) such that \(A\) is true exactly in the finite structures.

Solution

By contradiction, suppose \(A\) was such a sentence.

Introduce additional constants \(c_1,c_2,...\)

Consider the set \(B = \{c_i \neq c_j : i \neq j\}\).

Then every finite subset of \(\set{A} \cup B\) is satisfiable since we can always take a large enough finite model to ensure that all the sentences of the form \(c_i \neq c_j\) are satisfied. Then, by the compactness theorem, \(\set{A} \cup B\) is satisfiable, but any model for \(\set{A} \cup B\) cannot be finite.

5 Models and Theories

5.1

Show that for a finite structure \(\cM\) in a finite language, \(\text{Th}(\cM)\) is decidable.

Solution

For a given sentence \(\varphi\) in the language, we need to decide if \(\cM \models \varphi\).

We simply follow the definition of satisfaction and recursively check, carrying a variable assignment when evaluating subformulas and terms.

Since there are finitely many constants, functions, and relations, we can store their interpretations as finite lookup tables.

By structural induction on formulas.

For the base case \(\varphi = R(t_1,\ldots,t_n)\), we use the variable assignment and the interpretations of functions and constants to compute the value of each term, then check whether the resulting tuple belongs to \(R^{\cM}\). For the equality case \(\varphi = t_1 = t_2\), we compute the values of both terms and check whether they are the same domain element.

The inductive step follows the definition of satisfaction. For connectives, we combine the truth values of the subformulas. For quantifiers, we use a for loop over the finite domain, updating the assignment of the quantified variable: an existential formula is true if its subformula is true for some domain element, and a universal formula is true if its subformula is true for every domain element.

5.2

Why doesn’t this work if the language is not finite?

Solution

Let \(K \subseteq \mathbb{N}\) be an undecidable set. Consider a language with unary relation symbols \(P_0,P_1,\ldots\), and a structure \(\cM\) with domain \(\{a\}\), where \[ P_n^{\cM} = \begin{cases} \{a\} & \text{if } n \in K, \\ \varnothing & \text{if } n \notin K. \end{cases} \] Then \(\cM \models \exists x\,P_n(x)\) if and only if \(n \in K\). If \(\text{Th}(\cM)\) were decidable, we could decide membership in \(K\) by constructing the sentence \(\exists x\,P_n(x)\) and checking whether it belongs to \(\text{Th}(\cM)\). This is a contradiction.

The problem is the base case: although the domain is finite, there is no algorithm that determines the interpretation of \(P_n\) given \(n\). With a finite language, all symbol interpretations can be stored in finitely many finite lookup tables. An infinite language also works if its syntax and symbol interpretations are uniformly computable.

5.3

Show that \[\{\varphi : \varphi \text{ has a finite model}\}\] is recognizable.

Solution

On input \(\varphi\), extract all of the constants, functions, and relations that appear in \(\varphi\). Note that this is a finite language since \(\varphi\) is a finite string.

For each \(n \geq 1\), enumerate all interpretations of these symbols on the domain \(\{1,\ldots,n\}\). There are finitely many such interpretations for each \(n\). For each resulting structure, use the model-checking procedure from the previous question, with its interpretation tables as input, to check whether \(\varphi\) is true. Accept as soon as a model is found.

Every finite model for this finite language is isomorphic to one of the structures considered, so this procedure accepts exactly when \(\varphi\) has a finite model.