First-order model checking in constant depth #
A structure for a relational first-order language L on the universe Fin n is determined by the
truth values of its atomic facts R(a₁, …, aₗ) (Cslib.Logic.FO.Atom, Cslib.Logic.FO.Model), and
every structure with n elements is isomorphic to one of these through an enumeration
(Cslib.Logic.FO.realize_iff_atomsOf). Expanding each universal quantifier into a conjunction over
the n elements turns a first-order formula into a formula of negations and unbounded fan-in
conjunctions and disjunctions over the atomic facts (ModelChecking.toUnbounded), which computes
whether the structure satisfies it (ModelChecking.eval_toUnbounded). Its depth is bounded
independently of n (ModelChecking.depth_toUnbounded_le) and its size is polynomial in n
(ModelChecking.size_toUnbounded_le). This is the easy, nonuniform half of the characterization
of AC⁰ by first-order logic Immerman, Chapter 5,
Barrington, Immerman and Straubing, for relational vocabularies
and without numerical predicates such as order or BIT; it reads as membership in AC⁰ once the
atomic facts are the input bits, which needs a relation symbol of positive arity for the number of
facts to grow with n.
Sentences are those of Mathlib's model theory (FirstOrder.Language.Sentence), and the statements
are about structures rather than an encoding of structures as bit strings.
The canonical ordered extension, including genuine 0, 1, and max constants and hardwired
≤ and BIT, is in CslibFrontier.Computability.Circuit.Boolean.FirstOrder.Ordered.
Main definitions #
Atomic facts Cslib.Logic.FO.Atom, models Cslib.Logic.FO.Model, and Cslib.Logic.FO.atomsOf
are provided by CslibFrontier.Logics.FirstOrder.Atom.
Cslib.Circuits.Boolean.ModelChecking.constUnbounded,Cslib.Circuits.Boolean.ModelChecking.toUnbounded: a Boolean constant and a first-order formula as formulas over the unbounded fan-in basis.Cslib.Circuits.Boolean.ModelChecking.foDepth,Cslib.Circuits.Boolean.ModelChecking.foSize: depth and node count of a first-order formula.
Main results #
Cslib.Circuits.Boolean.ModelChecking.exists_formula_realize_structure: every first-order sentence is decided on the structures withnelements by unbounded fan-in formulas of constant depth and polynomial size.Cslib.Circuits.Boolean.ModelChecking.leafSize_toUnbounded_le: the formulas have polynomially many leaves.
References #
- N. Immerman, Descriptive Complexity
- [D. A. M. Barrington, N. Immerman, H. Straubing, On uniformity within NC¹] [BIS90]
The constant b as a formula over the unbounded fan-in basis.
constUnbounded b evaluates to b on every input.
The compiled connectives #
Both the order-free compiler below and the ordered one
(CslibFrontier.Computability.Circuit.Boolean.FirstOrder.Ordered) compile atomic facts to inputs
or constants, an implication φ → ψ to ¬φ ∨ ψ, and a universal quantifier to a conjunction over
the n elements. The lemmas here give the semantics of these gadgets and the inductive steps of
the depth, size and leaf bounds, so that each compiler only handles its atomic formulas.
A constant has depth one.
A constant is a single operation node.
A constant has no input leaves.
The compiled implication ¬A ∨ B is true exactly when A implies B.
The compiled quantifier, a conjunction of n formulas, is true exactly when each is.
The compiled implication is two levels deeper than its arguments.
The compiled quantifier is one level deeper than its arguments.
The inductive step of the polynomial size bound for the compiled implication.
The inductive step of the polynomial leaf bound for the compiled implication.
A first-order formula, with values xs for its bound variables, as a formula over the
unbounded fan-in basis reading the atomic facts through e: atomic formulas are inputs or
constants, an implication is a disjunction with one negated argument, and a universal quantifier
is a conjunction over the n elements. A term of the relational language L is a variable
(Cslib.Logic.FO.termVar), here a bound one, with value given by xs.
The formula decides the first-order formula on the structure given by its atomic facts.
A measure of the depth of a first-order formula: atomic formulas count one, an implication two more than its arguments, and a quantifier one more than its body.
The number of nodes of a first-order formula.
Every first-order formula has positive node count.
The depth does not depend on the universe.
The size is polynomial in the universe.
The number of leaves is polynomial in the universe.
Arbitrary finite structures #
The translation of a sentence decides it on every structure, through its atomic facts.
First-order sentences are decided in constant depth: for a relational language, every
sentence is decided on the structures with n elements, given by their atomic facts, by a formula
of negations and unbounded fan-in conjunctions and disjunctions whose depth does not depend on n
and whose size is polynomial in n.
The same formula decides the sentence on every structure with n elements, through any
enumeration of it.