## 4.6. The Completeness Theorem

### Existence of countable term algebras

For any countable algebraic language L with at least a constant and a non-constant, finding a countable ground term L-algebra (necessarily infinite) amonts to defining a ground term L-algebra structure on ℕ, which is a bijection from Lℕ to ℕ.
Splitting L as CD where C is the set of constants, and D is the rest of symbols, we have Lℕ = C∪(Dℕ). But C and D are countable (either finite or infinite), and Dℕ is a union over D of disjoint sets with explicitly definable bijections with ℕ (such as the bns we saw). In any case, a bijection between C∪(Dℕ) and ℕ can be found without problem.
In practice, such bijections from Lℕ to ℕ happen to be ground term L-algebra structures because ∀(s,x)∈Dℕ, ∀i<ns, xi<s(x) which would be contradicted by the smallest element outside MinL ℕ. ∎

### Interpretation of first-order formulas

Trying to extend the formal construction of the interpretation of terms in algebras, to the case of formulas interpreted in systems, the difficulty is to cope with the interpretation of quantifiers (or generally binders, if we wish to still generalize).
A possibility, is to switch to a view over all variables as bound throughout the formula: from the concept of interpretation hvET of a term T in an algebra E for every interpretation v of its set V of variables, the family (hv)vEV is re-curried into a function from T to EEV. So, a first-order formula interpreted in a system E can be understood as a term interpreted in an algebra with maybe two base types : the sets OpE and RelE of all operations and all relations in E; or split as two sequences of types, OpE(n) and RelE(n). We might not need the full sets of these, but at least, an algebra of these (a subset stable by all needed logical operations).
We took unions over ℕ for the case we would need to see "all possible formulas" as terms interpreted in one same algebra.

### The Completeness Theorem

Provability is expressible in arithmetic as the existence of a number which encodes a proof, made of one existential quantifier that is unbounded in the sense of arithmetic (∃ p, ) where p is an encoding of the proof, and inside is a formula where all quantifiers are bounded, i.e. with finite range (∀x < (...), ...), expressing a verification of this proof.

Let us now prove the Completeness theorem commented in 1.9.

Theorem. First-order logic has a proving system both sound and complete in the following equivalent senses
• Any consistent first-order theory T with countable language has a countable model.
• Any formula true in all countable models of such a theory is deducible from its axioms.
Sketch of proof of the first statement (implicitly suggesting how such a proving system is possible, though not necessarily suggesting the most elegant solution; not using the axiom of choice, anyway out of topic):

Reduce T to a single-type theory T1 simulating the use of types by relevant unary predicate symbols and axioms, but without requiring all objects to belong to some type. Thus, the axiom (∃x, 1) can be added to T1 without harm (it still allows types to be empty).
Axioms of T1 can then be re-written in prenex form, that is chains of quantifiers applied to quantifier-free formulas (using equivalences from 2.3 and 2.5 simplified for a nonempty model).
Interpret the symbol = in axioms as an ordinary predicate symbol, with the axioms of equality [1.11].

Replace each occurrence of ∃ in an axiom by the use of an additional operator symbol K, for example

(∀x,x', ∃y, ∀z, A(x,x',y,z)) ⇢ (∀x,x',∀z, A(x,x',K(x,x'), z)).

Let M be the ground term algebra over the language of operator symbols enriched as just described. Reinterpreting all ∀ in axioms as the use of axiom schemas (one axiom for each replacement of variables by a tuple of elements of M), gives a propositional theory T2 (its axioms are composed of logical connectives over Boolean variables), whose set of Boolean variables is PM where P is the set of predicate symbols in the theory plus the "equality" symbol.
Observe that T2 is still consistent, as any contradiction in T2 (= finite set of axioms not satisfied by any tuple of Boolean values of their variables) would provide a contradiction in T1, as follows:
 From all subterms occurring in used axioms of T2, list without repetition all those whose root is a symbol S which was added to the language when converting some axiom ∀x,∃y,∀z,∃u, A(x,y,z,u) of T1, into the axiom ∀x,z, A(x,K(x),z, S(x,z)) in T2. Successively replace them all by variables in T1: for terms S(t0,t1) and S(t0,t2) (where t0, t1, t2 ∈ M), the reasoning in T1 will say "Let y such that ∀z,∃u, A(t0,y,z,u); let u1 such that A(t0,y,t1,u1); let u2 such that A(t0,y,t2,u2);" and use the contradiction in T2 where y replaces K(t0), u1 replaces S(t0,t1) and u2 replaces S(t0,t2).
Recursively by a chosen enumeration of PM as a countable set, add one by one to the axioms, each of these Boolean variables if it is consistent with previously accepted axioms, so that all get values without contradiction.
Then the quotient of M by the equivalence relation of "equality", forms a model (with the "true equality"). ∎

As this construction depends on an arbitrary order between formulas, different choices give different models, which may be non-isomorphic and even have different properties reflecting the undecidability of the theory's formulas.

Deduction of the second statement from the first :
TA
T ∪ {¬A} is inconsistent
T ∪ {¬A} has no countable model
A is true in all countable models of T.  ∎

Comparing the results of the completeness theorem with Cantor's theorem gives this paradox :
If set theory is consistent then it has countable models, though it sees some sets there, such as ℘(ℕ), as uncountable.
• A countable model U interprets the powerset "℘(E)" of an infinite "set" EU as the "set" P of all objects in U which play the role of subsets of E (but may differ from these when U is non-standard); as P is meta-countable, it cannot exhaust the uncountable meta-powerset of "all" subsets of E.
• As P is meta-countable, it externally has a bijection with ℕ or U; but such bijections "do not exist" (have no representatives) as objects in U.
Rigorously speaking, when the powerset axiom says that the class of subsets of E is a set written ℘(E), it can only determine the interpretation of the functor ℘ relatively to (depending on) the universe where its open quantifiers are interpreted: «all subsets of E existing in this universe are in ℘(E)». In the other interpretation of what it means for a class to be a set, this would mean that the universe already contains "really all" subsets of E, forming the supposedly "true" set ℘(E) which will stay fixed in any further expansion of the universe. However, for the powerset of an infinite set, this wish cannot be expressed in first-order logic nor any other conceivable mathematical formalism: there is no way to talk about meta-sets that "cannot be found" in this universe but would «exist elsewhere» (in any mysterious bigger universe) to exclude them from there. (Only one aspect of this idea can be formalized as the axiom schema of specification).

Set theory and foundations of mathematics
1. First foundations of mathematics
2. Set theory (continued)
3. Algebra 1
4. Arithmetic and first-order foundations
4.1. Algebraic terms
4.2. Term algebras
4.3. Integers and recursion
4.4. Presburger Arithmetic
4.5. Finiteness and countability
4.6. The Completeness Theorem
4.7. Non-standard models of Arithmetic
4.8. Developing theories : definitions
4.9. Constructions
5. Second-order foundations
6. Foundations of Geometry