Documentation

DescriptiveComplexity.Problems.FinSat.Defs

FINSAT: finite satisfiability of a first-order sentence #

The problem of Trakhtenbrot's theorem (Trakhtenbrot 1950, Libkin 2004, ch. 9): does the given first-order sentence have a finite model? This file carries the instance encoding – a sentence, presented as a finite structure – and its semantics; membership in RE and RE-hardness live in the sibling files, and the completeness theorem in DescriptiveComplexity.Problems.FinSat.

The encoding #

An instance is a parse DAG in negation normal form. Its elements play several roles at once – nodes, variables, relation symbols, argument positions – and nothing forces those roles to be disjoint:

Negation normal form is not a matter of economy: with negation confined to the leaves the value of a node is monotone in the values of its children, so satisfaction is a least fixed point (DescriptiveComplexity.FinSat.Gval, below) and no well-founded recursion on a decoded parse tree is needed anywhere. Every first-order formula has a negation normal form, and the hardness reduction produces one directly.

The semantics #

There is deliberately no decoding into a FirstOrder.Language.Sentence: the relation symbols of the encoded sentence are elements of the instance, so the decoded vocabulary would depend on the instance. Satisfaction is instead defined on the encoding, Tarski-style, by DescriptiveComplexity.FinSat.gstep – one clause per node kind, which is what a reader has to check anyway – iterated on a fuel counter (DescriptiveComplexity.FinSat.gval) and closed up (DescriptiveComplexity.FinSat.Gval).

A model is a finite nonempty type M together with an interpretation I : A → (A → M) → Prop reading a symbol and an assignment of argument positions, required to be local: I s may only look at the positions of the signature of s. Locality is what makes I s a relation of the arity of s rather than of the whole universe, and what makes the negative-atom clause unambiguous.

DescriptiveComplexity.FINSAT then holds of an instance when it is well-formed and the universal closure of the encoded formula has a finite model. Taking the universal closure costs nothing – the sentences the reduction produces are closed – and avoids conditioning on “every variable is bound by an ancestor”, which is a reachability property and so not first-order.

What is and is not claimed #

RE is the logically defined class of DescriptiveComplexity.RecursivelyEnumerable (definability in ∃SO[new]), so completeness of FINSAT for it is a statement about that logic. It becomes undecidability of finite satisfiability only through the bridge to Mathlib's computability layer (DescriptiveComplexity.finsat_not_computable).

Relation symbols of the language of encoded first-order sentences in negation normal form.

  • le : finsatRel 2

    le x y: the order of the syntax.

  • andN : finsatRel 1

    andN g: the node g is the conjunction of its children.

  • orN : finsatRel 1

    orN g: the node g is the disjunction of its children.

  • allN : finsatRel 1

    allN g: the node g universally quantifies its bound variable.

  • exN : finsatRel 1

    exN g: the node g existentially quantifies its bound variable.

  • child : finsatRel 2

    child g c: the node c is one of the children of the node g.

  • bind : finsatRel 2

    bind g x: the quantifier node g binds the variable x.

  • eqL : finsatRel 3

    eqL g x y: the node g is the literal x = y.

  • neqL : finsatRel 3

    neqL g x y: the node g is the literal x ≠ y.

  • posL : finsatRel 2

    posL g s: the node g is a positive atom of the relation symbol s.

  • negL : finsatRel 2

    negL g s: the node g is a negated atom of the relation symbol s.

  • arg : finsatRel 3

    arg g p x: the argument of the atom g at position p is the variable x.

  • sig : finsatRel 2

    sig s p: the relation symbol s has an argument position p.

  • root : finsatRel 1

    root g: the node g is the root of the encoded sentence.

Instances For
    Dependency graph
    Dependency graph
    def FirstOrder.Language.instDecidableEqFinsatRel.decEq {a✝ : } (x✝ x✝¹ : finsatRel a✝) :
    Decidable (x✝ = x✝¹)
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Dependency graph

      The relational vocabulary of encoded first-order sentences: a parse DAG in negation normal form, ordered by the order of its own syntax.

      Equations
      Instances For
        Dependency graph
        Dependency graph
        @[reducible, inline]

        The order symbol of the syntax.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]

          The symbol marking conjunction nodes.

          Equations
          Instances For
            Dependency graph
            @[reducible, inline]

            The symbol marking disjunction nodes.

            Equations
            Instances For
              Dependency graph
              @[reducible, inline]

              The symbol marking universal quantifier nodes.

              Equations
              Instances For
                Dependency graph
                @[reducible, inline]

                The symbol marking existential quantifier nodes.

                Equations
                Instances For
                  Dependency graph
                  @[reducible, inline]

                  The symbol of the child relation of the parse DAG.

                  Equations
                  Instances For
                    Dependency graph
                    @[reducible, inline]

                    The symbol binding a variable to a quantifier node.

                    Equations
                    Instances For
                      Dependency graph
                      @[reducible, inline]

                      The symbol of positive equality literals.

                      Equations
                      Instances For
                        Dependency graph
                        @[reducible, inline]

                        The symbol of negated equality literals.

                        Equations
                        Instances For
                          Dependency graph
                          @[reducible, inline]

                          The symbol of positive atoms.

                          Equations
                          Instances For
                            Dependency graph
                            Dependency graph
                            @[reducible, inline]

                            The symbol giving the arguments of an atom.

                            Equations
                            Instances For
                              Dependency graph
                              @[reducible, inline]

                              The symbol giving the signature of a relation symbol.

                              Equations
                              Instances For
                                Dependency graph
                                @[reducible, inline]

                                The symbol marking the root node.

                                Equations
                                Instances For
                                  Dependency graph

                                  Reading the encoding #

                                  Dependency graph

                                  x strictly precedes y in the order of the syntax.

                                  Equations
                                  Instances For
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph

                                    The argument of the atom g at position p is the variable x.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      Dependency graph
                                      Dependency graph

                                      Well-formedness #

                                      Little is required of an instance, and all of it is first-order: the order symbol is a linear order and children come strictly earlier in it – so the parse DAG is acyclic, on a finite instance well-founded – together with the shape of an atom, which carries one symbol and exactly one argument at each position of that symbol's signature. Nothing is required of the kinds of a node nor of the multiplicity of binders: the semantics below reads every clause of gstep as a disjunction, so a node with two kinds simply means the disjunction of its two readings, and the membership kernel can mirror gstep clause by clause.

                                      The atom conditions are the ones that cannot be dispensed with, and their reason is the membership proof rather than the semantics: there the model's interpretation of a symbol is recovered from the guessed truth values of the atoms, and two atoms of the same symbol whose arguments have the same values must therefore have the same truth value – which they need not, if an atom may carry two symbols, or lack an argument at a position its symbol declares.

                                      Well-formedness of an encoded sentence: the order symbol is a linear order and the parse DAG descends along it.

                                      • ord_refl (x : A) : Ord x x

                                        The order of the syntax is reflexive.

                                      • ord_trans (x y z : A) : Ord x yOrd y zOrd x z

                                        The order of the syntax is transitive.

                                      • ord_antisymm (x y : A) : Ord x yOrd y xx = y

                                        The order of the syntax is antisymmetric.

                                      • ord_total (x y : A) : Ord x y Ord y x

                                        The order of the syntax is total.

                                      • child_lt (g c : A) : ChildG g cOrdLt c g

                                        Children come strictly earlier: the parse DAG is acyclic.

                                      • arg_fun (g p x x' : A) : ArgG g p xArgG g p x'x = x'

                                        An atom has at most one argument at each position.

                                      • atom_sym (g s s' : A) : PosG g s NegG g sPosG g s' NegG g s's = s'

                                        An atom has at most one relation symbol.

                                      • arg_sig (g s p x : A) : PosG g s NegG g sArgG g p xSigG s p

                                        An atom only has arguments at the positions of its symbol's signature.

                                      • arg_tot (g s p : A) : PosG g s NegG g sSigG s p∃ (x : A), ArgG g p x

                                        An atom has an argument at every position of its symbol's signature.

                                      Instances For
                                        Dependency graph

                                        Environments #

                                        noncomputable def DescriptiveComplexity.FinSat.upd {A M : Type} (v : AM) (x : A) (d : M) :
                                        AM

                                        Updating an environment at one variable. (Classical: the instance is a bare type, with no decidable equality.)

                                        Equations
                                        Instances For
                                          Dependency graph
                                          @[simp]
                                          theorem DescriptiveComplexity.FinSat.upd_self {A M : Type} (v : AM) (x : A) (d : M) :
                                          upd v x d x = d
                                          Dependency graph
                                          theorem DescriptiveComplexity.FinSat.upd_of_ne {A M : Type} (v : AM) {x z : A} (d : M) (h : z x) :
                                          upd v x d z = v z
                                          Dependency graph

                                          Satisfaction #

                                          gstep is the Tarskian truth definition of a node, one clause per kind of node, with the values of the children supplied by the parameter rec. It is monotone in rec – this is what negation normal form buys – so iterating it from the everywhere-false valuation gives an increasing sequence whose union Gval is the least fixed point, and on a well-formed instance the fixed point is unique (DescriptiveComplexity.FinSat.Membership).

                                          noncomputable def DescriptiveComplexity.FinSat.gstep {A M : Type} [FirstOrder.Language.finsat.Structure A] (I : A(AM)Prop) (rec : (AM)AProp) (v : AM) (g : A) :

                                          One unfolding of the truth definition: the value of the node g under the environment v, given the values rec of the nodes below it. A conjunction node holds when all its children do, a disjunction node when one of them does, a quantifier node when all (respectively one) of the values of its bound variable make all (one of) its children hold; a literal reads the environment, an atom the interpretation I, on an assignment w of the argument positions matching the environment on the arguments of the atom.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            Dependency graph
                                            theorem DescriptiveComplexity.FinSat.gstep_mono {A M : Type} [FirstOrder.Language.finsat.Structure A] (I : A(AM)Prop) {rec rec' : (AM)AProp} (h : ∀ (v : AM) (g : A), rec v grec' v g) (v : AM) (g : A) :
                                            gstep I rec v ggstep I rec' v g

                                            The truth definition is monotone in the values of the nodes below: no clause of DescriptiveComplexity.FinSat.gstep uses rec negatively, because negation is confined to the leaves.

                                            Dependency graph
                                            noncomputable def DescriptiveComplexity.FinSat.gval {A M : Type} [FirstOrder.Language.finsat.Structure A] (I : A(AM)Prop) :
                                            (AM)AProp

                                            Satisfaction, by iteration: gval I k v g is the k-th approximant of the truth of the node g under the environment v.

                                            Equations
                                            Instances For
                                              Dependency graph
                                              @[simp]
                                              theorem DescriptiveComplexity.FinSat.gval_succ {A M : Type} [FirstOrder.Language.finsat.Structure A] (I : A(AM)Prop) (k : ) :
                                              gval I (k + 1) = gstep I (gval I k)
                                              Dependency graph
                                              def DescriptiveComplexity.FinSat.Gval {A M : Type} [FirstOrder.Language.finsat.Structure A] (I : A(AM)Prop) (v : AM) (g : A) :

                                              The node g holds under the environment v: the least fixed point of the truth definition, reached because a finite parse DAG has finite depth.

                                              Equations
                                              Instances For
                                                Dependency graph
                                                theorem DescriptiveComplexity.FinSat.gval_mono {A M : Type} [FirstOrder.Language.finsat.Structure A] (I : A(AM)Prop) (k : ) (v : AM) (g : A) :
                                                gval I k v ggval I (k + 1) v g
                                                Dependency graph
                                                theorem DescriptiveComplexity.FinSat.gval_of_le {A M : Type} [FirstOrder.Language.finsat.Structure A] (I : A(AM)Prop) {k k' : } (hk : k k') (v : AM) (g : A) (h : gval I k v g) :
                                                gval I k' v g
                                                Dependency graph
                                                theorem DescriptiveComplexity.FinSat.gval_le_Gval {A M : Type} [FirstOrder.Language.finsat.Structure A] (I : A(AM)Prop) {k : } {v : AM} {g : A} (h : gval I k v g) :
                                                Gval I v g
                                                Dependency graph

                                                An interpretation is local when the value of a symbol depends only on the arguments its signature declares.

                                                Equations
                                                Instances For
                                                  Dependency graph

                                                  The problem #

                                                  The encoded sentence has a finite model: the instance is well-formed and there is a finite nonempty universe with a local interpretation of the relation symbols under which every environment satisfies the root – that is, a finite model of the universal closure of the encoded formula.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    Dependency graph

                                                    Isomorphism-invariance #

                                                    Everything the semantics reads is a relation of the instance, so an isomorphism transports it. The model is carried over unchanged, its interpretation composed with the isomorphism (DescriptiveComplexity.FinSat.mapI); the substance is the transport of gval, an induction on the fuel with one step per clause of the truth definition. Only one direction is proved: the converse is the same statement at the inverse isomorphism.

                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph

                                                    The positive-or-negative reading of an atom transports along an isomorphism.

                                                    Dependency graph

                                                    The same transports read backwards, at the inverse isomorphism: the shape every field of DescriptiveComplexity.FinSat.isWF_map needs.

                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph

                                                    The interpretation of the symbols, transported along an isomorphism of instances: the model is unchanged, and its interpretation reads the symbol and the argument positions through the isomorphism.

                                                    Equations
                                                    Instances For
                                                      Dependency graph
                                                      Dependency graph
                                                      theorem DescriptiveComplexity.FinSat.mapI_apply {A B : Type} [FirstOrder.Language.finsat.Structure A] [FirstOrder.Language.finsat.Structure B] (e : FirstOrder.Language.finsat.Equiv A B) {M : Type} (I : A(AM)Prop) (s : A) (w : AM) :
                                                      (mapI e I (e s) fun (b : B) => w (e.symm b)) I s w

                                                      Reading the transported interpretation at a transported argument is reading the original one.

                                                      Dependency graph
                                                      theorem DescriptiveComplexity.FinSat.upd_map {A B : Type} [FirstOrder.Language.finsat.Structure A] [FirstOrder.Language.finsat.Structure B] (e : FirstOrder.Language.finsat.Equiv A B) {M : Type} (v : AM) (x : A) (d : M) :
                                                      (fun (b : B) => upd v x d (e.symm b)) = upd (fun (b : B) => v (e.symm b)) (e x) d
                                                      Dependency graph
                                                      theorem DescriptiveComplexity.FinSat.gval_map {A B : Type} [FirstOrder.Language.finsat.Structure A] [FirstOrder.Language.finsat.Structure B] (e : FirstOrder.Language.finsat.Equiv A B) {M : Type} (I : A(AM)Prop) (k : ) (v : AM) (g : A) :
                                                      gval I k v ggval (mapI e I) k (fun (b : B) => v (e.symm b)) (e g)

                                                      Satisfaction transports along an isomorphism, one clause of the truth definition at a time.

                                                      Dependency graph

                                                      The problem transports along an isomorphism (one direction; the converse is this statement at e.symm).

                                                      Dependency graph

                                                      FINSAT: does the encoded first-order sentence have a finite model? Trakhtenbrot's problem, and the first RE-complete problem of the catalog.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        Dependency graph