Documentation

Linglib.Core.ModelTheory.FiniteModel

Finite model checking for first-order structures #

Two pieces of substrate for studies that verify claims on small hand-built models:

def FirstOrder.Language.monadic (Sym : Type u_1) :
Language

The monadic language: arity-1 relation symbols Sym, nothing else.

Equations
  • FirstOrder.Language.monadic Sym = { Functions := fun (x : ) => Empty, Relations := fun (n : ) => match n with | 1 => Sym | x => PEmpty.{?u.1 + 1} }
Instances For
    @[implicit_reducible]
    def FirstOrder.Language.monadicStructure {Sym : Type u_1} {E : Type u_2} (holds : SymEProp) :
    (monadic Sym).Structure E

    Build a monadic-structure from a truth table for the symbols.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def FirstOrder.Language.monadicStructure.decRelMap {Sym : Type u_1} {E : Type u_2} (holds : SymEProp) [(s : Sym) → (e : E) → Decidable (holds s e)] (n : ) (r : (monadic Sym).Relations n) (v : Fin nE) :
      Decidable (Structure.RelMap r v)

      Atom decidability for a monadicStructure with a decidable table. As a named def so concrete interpretation families can supply it by unification (exact monadicStructure.decRelMap _) where synthesis would be stuck on a metavariable table.

      Equations
      Instances For
        @[instance_reducible]
        instance FirstOrder.Language.instDecidableRelMap_linglib {Sym : Type u_1} {E : Type u_2} (holds : SymEProp) [(s : Sym) → (e : E) → Decidable (holds s e)] (n : ) (r : (monadic Sym).Relations n) (v : Fin nE) :
        Decidable (Structure.RelMap r v)
        Equations
        def FirstOrder.Language.monadicWithConstants (Const : Type u_1) (Pred : Type u_2) :
        Language

        The monadic signature with individual constants: constant symbols Const and unary relation symbols Pred, defined directly (mathlib precedent: Language.graph; withConstants is the elementary-diagram device, not a signature constructor).

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[reducible, inline]
          abbrev FirstOrder.Language.monadicConst {Const : Type u_1} {Pred : Type u_2} (c : Const) :
          (monadicWithConstants Const Pred).Constants

          A constant as a symbol of the signature.

          Equations
          Instances For
            @[reducible, inline]
            abbrev FirstOrder.Language.monadicRel {Const : Type u_1} {Pred : Type u_2} (P : Pred) :
            (monadicWithConstants Const Pred).Relations 1

            A predicate as a relation symbol of the signature.

            Equations
            Instances For
              @[reducible]
              def FirstOrder.Language.monadicWithConstantsStructure {Const : Type u_1} {Pred : Type u_2} {Domain : Type u_3} (κ : ConstDomain) (V : PredDomainProp) :
              (monadicWithConstants Const Pred).Structure Domain

              The monadicWithConstants structure a constant interpretation and a predicate valuation induce.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[simp]
                theorem FirstOrder.Language.monadicWithConstantsStructure_relMap {Const : Type u_1} {Pred : Type u_2} {Domain : Type u_3} (κ : ConstDomain) (V : PredDomainProp) (P : Pred) (v : Fin 1Domain) :
                Structure.RelMap (monadicRel P) v V P (v 0)
                @[simp]
                theorem FirstOrder.Language.monadicWithConstantsStructure_funMap {Const : Type u_1} {Pred : Type u_2} {Domain : Type u_3} (κ : ConstDomain) (V : PredDomainProp) (c : Const) (v : Fin 0Domain) :
                Structure.funMap (monadicConst c) v = κ c
                @[instance_reducible]
                instance FirstOrder.Language.BoundedFormula.decRealize {L : Language} {M : Type u_4} [L.Structure M] [Fintype M] [DecidableEq M] [(n : ) → (r : L.Relations n) → (x : Fin nM) → Decidable (Structure.RelMap r x)] {α : Type u_5} {n : } (φ : L.BoundedFormula α n) (v : αM) (xs : Fin nM) :
                Decidable (φ.Realize v xs)

                Decidable realization on a finite structure with decidable atoms: structural recursion on the formula. decide kernel-reduces through it.

                Equations
                @[instance_reducible]
                instance FirstOrder.Language.Formula.decRealize {L : Language} {M : Type u_4} [L.Structure M] [Fintype M] [DecidableEq M] [(n : ) → (r : L.Relations n) → (x : Fin nM) → Decidable (Structure.RelMap r x)] {α : Type u_5} (φ : L.Formula α) (v : αM) :
                Decidable (φ.Realize v)
                Equations