Documentation

DescriptiveComplexity.Problems.Epr.Defs

EPR: satisfiability of an ∃*∀* sentence #

The Bernays–Schönfinkel–Ramsey class (Lewis 1980): is the given ∃*∀* sentence satisfiable? A sentence of that shape has no function symbols and its quantifier prefix is a block of existentials followed by a block of universals, so it is satisfiable exactly when it has a model with one element per existential variable – a small model, of which the sentence nevertheless speaks exponentially much, since a clause is checked at every assignment of its universal variables. That gap is the whole of the problem's complexity, and it is why the class sits at NEXPTIME rather than at NP.

The encoding #

An instance is a flat description, with no parse tree at all:

Nothing here is a chain or a tree, so the encoding needs no order of its own – unlike DescriptiveComplexity.FINSAT, whose parse DAG has to be acyclic. That is what a prenex form with a quantifier-free matrix buys.

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 defined on the encoding directly, and being quantifier-free the matrix needs no fixed point: one clause per kind of literal is the whole truth definition.

A model is a finite nonempty type M, an interpretation I : A → (A → M) → Prop reading a symbol and an assignment of argument positions – required to be local, so that I s is a relation of the arity of s rather than of the whole universe – and a witness e for the existential variables. The sentence holds when every assignment of the universal variables satisfies every clause.

Equality is not part of the encoding. The class is NEXPTIME-complete either way, and a reduction that wants equality can carry its own equality symbol with the axioms it needs.

Relation symbols of the language of encoded ∃*∀* sentences in conjunctive normal form.

  • evar : eprRel 1

    evar x: the variable x is existentially quantified.

  • cl : eprRel 1

    cl c: c is a clause of the matrix.

  • inCl : eprRel 2

    inCl c l: the literal l occurs in the clause c.

  • posL : eprRel 2

    posL l s: the literal l is the positive atom of the symbol s.

  • negL : eprRel 2

    negL l s: the literal l is the negated atom of the symbol s.

  • arg : eprRel 3

    arg l p x: the argument of the literal l at the position p is the variable x.

  • sig : eprRel 2

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

Instances For
    Dependency graph
    Dependency graph
    def FirstOrder.Language.instDecidableEqEprRel.decEq {a✝ : } (x✝ x✝¹ : eprRel a✝) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      Dependency graph

      The relational vocabulary of encoded ∃*∀* sentences: a set of clauses of literals over relation symbols, with the existential variables marked.

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

        The symbol marking existential variables.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]

          The symbol marking clauses.

          Equations
          Instances For
            Dependency graph
            @[reducible, inline]

            The symbol giving the literals of a clause.

            Equations
            Instances For
              Dependency graph
              @[reducible, inline]

              The symbol of positive literals.

              Equations
              Instances For
                Dependency graph
                @[reducible, inline]

                The symbol of negated literals.

                Equations
                Instances For
                  Dependency graph
                  @[reducible, inline]

                  The symbol giving the arguments of a literal.

                  Equations
                  Instances For
                    Dependency graph
                    @[reducible, inline]

                    The symbol giving the signature of a relation symbol.

                    Equations
                    Instances For
                      Dependency graph

                      Reading the encoding #

                      Dependency graph
                      Dependency graph
                      Dependency graph
                      Dependency graph
                      Dependency graph

                      The argument of the literal l at the position p is the variable x.

                      Equations
                      Instances For
                        Dependency graph
                        Dependency graph

                        Satisfaction #

                        noncomputable def DescriptiveComplexity.Epr.eprVal {A M : Type} [FirstOrder.Language.epr.Structure A] (e u : AM) :
                        AM

                        The value of a variable: the witness chosen for it if it is existentially quantified, and the assignment being tested otherwise. Every variable the encoding does not mark counts as universally quantified, which is what lets the encoding get away with one mark instead of two.

                        Equations
                        Instances For
                          Dependency graph
                          def DescriptiveComplexity.Epr.LitTrue {A M : Type} [FirstOrder.Language.epr.Structure A] (I : A(AM)Prop) (v : AM) (l : A) :

                          A literal is true: its symbol holds (or fails, for a negated literal) of an assignment of the argument positions matching the environment on the arguments the encoding declares.

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

                            Well-formedness, folded into the yes-instances as DescriptiveComplexity.FINSAT's is: an atom names one variable at each argument position, and names one at every position of its symbol's signature.

                            Both are what makes an atom an atom, and both are needed for the small-model property (DescriptiveComplexity.Epr.selfModel_of_eprSatOn): an atom whose arguments are ambiguous, or missing where the signature asks for one, reads differently on a universe the sentence has collapsed than on the instance itself.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              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
                                def DescriptiveComplexity.Epr.MatrixTrue {A M : Type} [FirstOrder.Language.epr.Structure A] (I : A(AM)Prop) (v : AM) :

                                The matrix holds at an environment: every clause has a true literal.

                                Equations
                                Instances For
                                  Dependency graph

                                  The problem #

                                  The encoded ∃*∀* sentence is satisfiable: some finite nonempty universe carries a local interpretation of the relation symbols and a witness for the existential variables under which every assignment of the universal variables satisfies every clause.

                                  Finiteness of the model costs nothing: a satisfiable ∃*∀* sentence has a model with one element per existential variable, which is what DescriptiveComplexity.Problems.Epr.Membership proves and uses.

                                  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 and its interpretation composed with the isomorphism, exactly as for DescriptiveComplexity.FINSAT.

                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    Dependency graph
                                    def DescriptiveComplexity.Epr.mapI {A B : Type} [FirstOrder.Language.epr.Structure A] [FirstOrder.Language.epr.Structure B] (e : FirstOrder.Language.epr.Equiv A B) {M : Type} (I : A(AM)Prop) :
                                    B(BM)Prop

                                    The interpretation the image carries: read the symbol back through the isomorphism.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      Dependency graph
                                      theorem DescriptiveComplexity.Epr.litTrue_map {A B : Type} [FirstOrder.Language.epr.Structure A] [FirstOrder.Language.epr.Structure B] (e : FirstOrder.Language.epr.Equiv A B) {M : Type} {I : A(AM)Prop} {v : AM} {l : A} (h : LitTrue I v l) :
                                      LitTrue (mapI e I) (fun (y : B) => v (e.symm y)) (e l)
                                      Dependency graph
                                      Dependency graph
                                      Dependency graph
                                      Dependency graph
                                      Dependency graph

                                      Well-formedness transports along an isomorphism.

                                      Dependency graph

                                      Satisfiability transports along an isomorphism: the model is carried over unchanged, its interpretation read back through the isomorphism.

                                      Dependency graph

                                      Satisfiability of an ∃*∀* sentence. The instance is the sentence, in prenex form with a conjunctive-normal-form matrix; the question is whether it has a model.

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