Documentation

Complexity.Computability.Circuit.Boolean.FirstOrder

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ₗ) (ModelChecking.Atom, ModelChecking.Model), and every structure with n elements is isomorphic to one of these through an enumeration (ModelChecking.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.

Main definitions #

Main results #

References #

The atomic facts of a structure for L on Fin n: a relation symbol and a tuple of elements.

Instances For

    The universe Fin n with the structure whose true atomic facts are those given by x.

    Instances For

      The constant b as a formula over the unbounded fan-in basis.

      Instances For

        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.

        Instances For

          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.

          Instances For

            The number of nodes of a first-order formula.

            Instances For

              The depth does not depend on the universe.

              theorem Cslib.Circuits.Boolean.ModelChecking.size_toUnbounded_le {L : FirstOrder.Language} [L.IsRelational] {n N : ℕ} (e : Atom L n ≃ Fin N) {k : ℕ} (φ : L.BoundedFormula Empty k) (xs : Fin k → Fin n) :
              (toUnbounded e φ xs).size ≤ foSize φ * (n + 2) ^ foSize φ

              The size is polynomial in the universe.

              The number of leaves is polynomial in the universe.

              Arbitrary finite structures #

              noncomputable def Cslib.Circuits.Boolean.ModelChecking.atomsOf {L : FirstOrder.Language} {n : ℕ} {M : Type u_1} [L.Structure M] (e : M ≃ Fin n) :
              Atom L n → Bool

              The atomic facts of a structure on M, read through an enumeration e of M by Fin n.

              Instances For

                An enumeration of M is an isomorphism onto the structure with the atomic facts of M.

                Instances For

                  A structure satisfies a sentence exactly when the structure with its atomic facts does.

                  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.