Documentation

Complexitylib.DescriptiveComplexity.SecondOrder.Semantics

Second-order logic: semantics #

Satisfaction of a second-order formula needs, besides the first-order element environment Env, a relation environment REnv interpreting each relation variable in the de Bruijn context rctx as a relation of its arity on the universe. Second-order quantifiers range over all such relations, extending the relation environment with rCons.

This is step 2 of the Fagin decomposition (roadmap L6). The FO fragment embeds faithfully: SOFormula.ofFormula_sat shows the embedding preserves satisfaction, so first-order truth is a special case of second-order truth (SOSentence.models_ofFormula).

Main definitions and results #

A relation-variable assignment: interprets each relation variable in rctx as a relation of its arity on the universe Fin card.

Equations
Instances For
    def Complexity.DescriptiveComplexity.rCons {card k : Nat} {rctx : List Nat} (S : (Fin kFin card)Prop) (ρ : REnv card rctx) :
    REnv card (k :: rctx)

    Extend a relation environment with a fresh arity-k relation at index 0.

    Equations
    Instances For

      The empty relation environment (no relation variables).

      Equations
      Instances For
        def Complexity.DescriptiveComplexity.SOFormula.Sat {V : Vocabulary} (A : FinStruct V) {rctx : List Nat} {n : Nat} :
        Env A.card nREnv A.card rctxSOFormula V rctx nProp

        Satisfaction of a second-order formula in a structure under element and relation environments. Second-order quantifiers range over all relations of the quantified arity.

        Equations
        Instances For

          A structure models a second-order sentence under the empty environments.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Complexity.DescriptiveComplexity.SOFormula.ofFormula_sat {V : Vocabulary} (A : FinStruct V) {rctx : List Nat} (ρ : REnv A.card rctx) {n : Nat} (φ : Formula V n) (σ : Env A.card n) :
            Sat A σ ρ (ofFormula φ rctx) Formula.Sat A σ φ

            The first-order embedding preserves satisfaction. An FO formula embedded into second-order logic is satisfied under (σ, ρ) exactly when the original is satisfied under σ — the relation environment ρ is irrelevant, since the embedded formula never mentions relation variables.

            First-order truth is a special case of second-order truth. A structure models an FO sentence iff it models its second-order embedding.