Second-Order Logic and Beyond/Skolem Functions and Many-Sorted Logic

Lesson 9.21,838 words

Skolem Functions and Many-Sorted Logic

Skolem functions replace existential quantifiers with named witnesses, putting any first-order formula into a prenex form with all existentials — now over functions — pulled to the front. The Skolemized formula is equisatisfiable with the original, which reduces satisfiability to universal sentences and, through Herbrand expansions, to sentential logic.

╌╌╌╌

A Skolem function names the witness that an existential quantifier only promises. Replacing by a function of the preceding universally bound variables reorganizes any first-order formula into a rigid prenex shape: all existentials, now over functions, pulled ahead of a block of universals over a quantifier-free matrix. Here the second-order quantifiers leave first-order logic exactly as strong as it was and serve only as bookkeeping. Existential quantifiers are the obstacle to that shape, and Skolem functions remove them.

Throughout, write to mean that and are logically equivalent — each logically implies the other, so they hold in exactly the same structures under the same assignments.

Naming witnesses

Consider

The right-hand form uses a one-place function variable . Read from right to left the equivalence is trivial: if some function makes hold for all , then for each the value witnesses . Read left to right it uses choice. Suppose a structure with assignment satisfies . Then for each there is at least one with . Choosing one such for every defines a function with , and then .

A Skolem function selects one witness per input. Where the original formula only promises that some witness exists for each x, the function names the choice, turning an existential over points into one function.

The argument iterates. Given a prenex formula whose quantifier prefix mixes universals and existentials, take the leftmost existential that is preceded by some universals, and replace its variable by a function of exactly those preceding universally quantified variables. Starting from

stays as an individual existential (nothing precedes it); becomes ; becomes . The result is

with every existential — now over individuals and functions — pulled to the front of a block of universals over a quantifier-free matrix.

The target shape. All existential quantifiers, over individuals and Skolem functions, form a front block; a block of universal individual quantifiers follows; the matrix is quantifier-free.

Equisatisfiability and undecidability

Skolem form still carries second-order quantifiers, but for questions of satisfiability they can be dropped. Replacing each existentially quantified function variable by a fresh function symbol removes the second-order prefix, at the cost of logical equivalence — but not at the cost of satisfiability.

Take 's Skolem normal form and read each existential function variable as a new function symbol ; a zero-place existential individual becomes a new constant. The resulting universal satisfies in the expanded language, and any model of extends to a model of by interpreting the new symbols as Skolem functions. So and are, in Enderton's phrase, equally satisfiable. Applying the same corollary to yields an existential formula that is valid if and only if is valid.

These reductions carry the general satisfiability and validity problems to syntactically restricted fragments — universal sentences for satisfiability, existential sentences for validity — and the undecidability of the general problem transfers to those fragments.

The proof is a reduction. Given any , the equisatisfiability corollary applied to effectively produces an existential sentence valid exactly when is valid. A decision procedure for existential validity would then decide arbitrary validity, contradicting Church's theorem. Function variables can be replaced by predicate variables here, using a more elaborate prefix; the analogue reduces satisfiability to formulas with predicate symbols.

Herbrand expansions

The equisatisfiability corollary reduces satisfiability to universal sentences. Herbrand's method takes one further step: the satisfiability of a set of universal sentences reduces — in a weaker, sentential sense — to satisfiability in sentential logic. The construction makes a set of universal sentences generate its own model out of pure syntax.

The carrier is the Herbrand universe: the set of all terms in the language. With one variable and function symbols , it contains

every term buildable from by the function symbols.

The Herbrand universe as a term tree. Each node is a term; applying a function symbol descends one level. The universe is the set of all these syntactic objects, taken as points of a structure that names themselves.

Let be the set of all instances of the universal sentences — drop every universal quantifier and substitute Herbrand terms for the freed variables. Each instance is quantifier-free, so it can be read as a formula of sentential logic in which the atomic formulas play the part of sentence symbols. Two cases split the outcome.

  • Case I — is unsatisfiable in sentential logic. Then the original set is unsatisfiable in first-order logic. A universal sentence implies all of its instances, so any first-order model of the set would yield a truth assignment satisfying , which does not exist.
  • Case II — is satisfiable in sentential logic, by some truth assignment . Then builds a first-order model. Its universe is the Herbrand universe; function symbols are interpreted autonymously, each term naming itself, ; and a predicate is interpreted by , with exactly when . The identity assignment then satisfies every universal sentence.

The construction echoes the completeness proof: a model is assembled from syntax, terms serving as their own denotations. It also yields alternate proofs of first-order compactness and the enumerability of validity that bypass the deductive calculus entirely. In Case I, sentential compactness gives a finite unsatisfiable subset of , from which first-order compactness follows. And enumerating while checking finite subsets by truth tables recovers the enumerability of validity: a valid makes some finite stage unsatisfiable and detectable, while an invalid drives an endless model construction.

Many-sorted logic

Ordinary mathematics routinely runs several kinds of variable at once: Greek letters for ordinals, capitals for sets, lowercase for elements, each ranging over its own domain. Many-sorted logic makes that practice precise, and general structures recast second-order logic inside it.

Fix a nonempty set of sorts. The alphabet is typed throughout.

  • Variables. For each sort , variables ranging over the universe of sort .
  • Quantifiers. A universal quantifier for each sort .
  • Predicate symbols. For each arity and each tuple of sorts , a set of -place predicate symbols of that sort.
  • Constant symbols. For each sort , a set of constant symbols of sort .
  • Function symbols. For each , a set of -place function symbols taking arguments of sorts and returning a value of sort .
  • Equality. For some sorts , an equality symbol comparing two terms of sort .

Every term receives a unique sort by the typing rules, and an atomic formula is well formed only when the terms' sorts match the predicate's. A many-sorted structure supplies a nonempty universe for each sort and interprets the symbols respecting types: for a predicate, for a function, and for a constant. Truth and satisfaction are defined as expected, with reading for all members of the universe of sort . Because there is no cross-sort equality, whether the universes overlap is immaterial — any many-sorted structure is elementarily equivalent to one with pairwise disjoint universes.

A two-sorted structure. Points and lines occupy separate universes; the incidence predicate relates a point-sort argument to a line-sort argument. Nothing forces the universes to overlap.

Reduction to one sort

Many-sorted logic is a convenience, not an extension: everything it can express is already expressible with a single sort. Fix a one-sorted language with all the predicate, constant, and function symbols of the many-sorted language, plus one new one-place predicate symbol for each sort — the predicate is of sort . A syntactic translation rewrites each sorted quantifier by relativizing it to its sort predicate:

replacing by an ordinary variable , and every by plain . Semantically, a many-sorted becomes a one-sorted whose universe is the union , with interpreted as the slice .

The one-sorted encoding. The separate sort universes are poured into one universe, and each is recovered as the extension of its sort predicate, which relativizes the quantifiers.

The translation is faithful, and one direction is immediate.

The converse needs care, because a one-sorted structure need not come from a many-sorted one: its sort predicates might be empty or not closed under the functions. A finite set of one-sorted sentences rules that out — asserting each is nonempty and that the function symbols respect sorts — and any model of converts back into a many-sorted structure. The two lemmas combine into the exact bridge.

Because is finite (indeed recursive) and the translation is effective, the good behavior of one-sorted logic transfers wholesale. Compactness, enumerability of validity, and Löwenheim–Skolem all hold for many-sorted logic, each proved by pushing the problem through and to the one-sorted theorem and pulling the model back.

TheoremOne-sorted sourceMany-sorted version
Compactnessfirst-order compactnessevery finitely satisfiable set of many-sorted sentences has a model
Enumerabilityvalidity is r.e.valid many-sorted sentences are r.e.
Löwenheim–Skolemcountable elementary submodela many-sorted structure has a countable elementarily equivalent one

This pattern — encode a richer logic as many-sorted first-order logic, relativize its quantifiers to sort predicates, inherit the metatheorems — is exactly how general structures turn the badly behaved standard second-order semantics into the tame general semantics.1

Footnotes

  1. Enderton, §4.2 (Skolem functions, the Skolem normal form theorem, Corollaries 42A–42B, Herbrand expansions and Herbrand's theorem) and §4.3 (many-sorted syntax and structures, the translation to one-sorted logic, Lemmas 43A–43B, Theorem 43C, and the inherited compactness, enumerability, and Löwenheim–Skolem theorems).

╌╌ END ╌╌