Documentation

Mathlib.ModelTheory.Encoding

Encodings and Cardinality of First-Order Syntax #

Main Definitions #

Main Results #

TODO #

def FirstOrder.Language.Term.listEncode {L : Language} {α : Type u'} :
L.Term αList (α (i : ) × L.Functions i)

Encodes a term as a list of variables and function symbols.

Equations
    Instances For
      def FirstOrder.Language.Term.listDecode {L : Language} {α : Type u'} :
      List (α (i : ) × L.Functions i)List (L.Term α)

      Decodes a list of variables and function symbols as a list of terms.

      Equations
        Instances For

          An encoding of terms as lists.

          Equations
            Instances For
              @[simp]
              @[simp]
              @[simp]
              theorem FirstOrder.Language.Term.encoding_decode {L : Language} {α : Type u'} (l : List (α (i : ) × L.Functions i)) :
              Term.encoding.decode l = (do let a(listDecode l).head? pure (some a)).join
              def FirstOrder.Language.BoundedFormula.listEncode {L : Language} {α : Type u'} {n : } :
              L.BoundedFormula α nList ((k : ) × L.Term (α Fin k) (n : ) × L.Relations n )

              Encodes a bounded formula as a list of symbols.

              Equations
                Instances For
                  def FirstOrder.Language.BoundedFormula.sigmaAll {L : Language} {α : Type u'} :
                  (n : ) × L.BoundedFormula α n(n : ) × L.BoundedFormula α n

                  Applies the forall quantifier to an element of (Σ n, L.BoundedFormula α n), or returns default if not possible.

                  Equations
                    Instances For
                      @[simp]
                      theorem FirstOrder.Language.BoundedFormula.sigmaAll_apply {L : Language} {α : Type u'} {n : } {φ : L.BoundedFormula α (n + 1)} :
                      sigmaAll n + 1, φ = n, φ.all
                      def FirstOrder.Language.BoundedFormula.sigmaImp {L : Language} {α : Type u'} :
                      (n : ) × L.BoundedFormula α n(n : ) × L.BoundedFormula α n(n : ) × L.BoundedFormula α n

                      Applies imp to two elements of (Σ n, L.BoundedFormula α n), or returns default if not possible.

                      Equations
                        Instances For
                          @[simp]
                          theorem FirstOrder.Language.BoundedFormula.sigmaImp_apply {L : Language} {α : Type u'} {n : } {φ ψ : L.BoundedFormula α n} :
                          sigmaImp n, φ n, ψ = n, φ.imp ψ

                          Decodes a list of symbols as a list of formulas.

                          @[irreducible]
                          def FirstOrder.Language.BoundedFormula.listDecode {L : Language} {α : Type u'} :
                          List ((k : ) × L.Term (α Fin k) (n : ) × L.Relations n )List ((n : ) × L.BoundedFormula α n)

                          Decodes a list of symbols as a list of formulas.

                          Equations
                            Instances For
                              @[simp]
                              theorem FirstOrder.Language.BoundedFormula.listDecode_encode_list {L : Language} {α : Type u'} (l : List ((n : ) × L.BoundedFormula α n)) :
                              listDecode (List.flatMap (fun (φ : (n : ) × L.BoundedFormula α n) => φ.snd.listEncode) l) = l

                              An encoding of bounded formulas as lists.

                              Equations
                                Instances For