Documentation

Linglib.Syntax.Minimalist.SyntacticObject.Lift

The universal property of the syntactic-object carrier #

Leaf data valued in a commutative magma with zero extends to a morphism of magmas out of SyntacticObject (lift, the FreeMagma.lift analogue), and two such morphisms agreeing on the leaves are equal (hom_ext). The zero absorbs the off-carrier arities, so one total algebra (mergeAlgebra) drives the fold, the quotient descent, and the subtype restriction once and for all: consumers supply a lexical-leaf value and a trace value, and inherit Perm-invariance from mul_comm via List.Perm.congr_arity₂ — no bespoke step induction.

Main declarations #

Main results #

def Minimalist.SyntacticObject.mergeAlgebra {β : Type u_1} [Mul β] [Zero β] ( : LITokenβ) (τ : β) :
SOLabelList ββ

The node algebra of a magma-with-zero: lexical leaf ↦ , trace leaf ↦ τ, bare binary node ↦ *, off-carrier arities ↦ 0.

Equations
Instances For
    theorem Minimalist.SyntacticObject.mergeAlgebra_perm {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) (a : SOLabel) {l₁ l₂ : List β} (h : l₁.Perm l₂) :
    mergeAlgebra τ a l₁ = mergeAlgebra τ a l₂

    mergeAlgebra is invariant under permutation of the daughter values: only the binary shape is order-sensitive, and there mul_comm applies.

    def Minimalist.SyntacticObject.liftN {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) :

    The induced algebra on the nonplanar carrier: the catamorphism descends by mergeAlgebra_perm.

    Equations
    Instances For
      @[simp]
      theorem Minimalist.SyntacticObject.liftN_mk {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) (p : RoseTree SOLabel) :
      theorem Minimalist.SyntacticObject.liftN_node {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) (a b : RootedTree.Nonplanar SOLabel) :
      liftN τ (RootedTree.Nonplanar.node (Sum.inr ()) {a, b}) = liftN τ a * liftN τ b

      The nonplanar magma law: Merge multiplies values.

      def Minimalist.SyntacticObject.liftFun {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) (s : SyntacticObject) :
      β

      The induced map on syntactic objects, unbundled — computable, decide-friendly.

      Equations
      Instances For
        @[simp]
        theorem Minimalist.SyntacticObject.liftFun_lexLeaf {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) (tok : LIToken) :
        liftFun τ (lexLeaf tok) = tok
        @[simp]
        theorem Minimalist.SyntacticObject.liftFun_traceLeaf {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) :
        liftFun τ traceLeaf = τ
        @[simp]
        theorem Minimalist.SyntacticObject.liftFun_node {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) (l r : SyntacticObject) :
        liftFun τ (l.node r) = liftFun τ l * liftFun τ r
        noncomputable def Minimalist.SyntacticObject.lift {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) :
        SyntacticObject →ₙ* β

        The universal property, existence half (cf. FreeMagma.lift): leaf data extends to a morphism of magmas out of the carrier.

        Equations
        Instances For
          @[simp]
          theorem Minimalist.SyntacticObject.lift_apply {β : Type u_1} [CommMagma β] [Zero β] ( : LITokenβ) (τ : β) (s : SyntacticObject) :
          (lift τ) s = liftFun τ s
          theorem Minimalist.SyntacticObject.hom_ext {β : Type u_1} [Mul β] {f g : SyntacticObject →ₙ* β} (hlex : ∀ (tok : LIToken), f (lexLeaf tok) = g (lexLeaf tok)) (htrace : f traceLeaf = g traceLeaf) :
          f = g

          The universal property, uniqueness half: morphisms agreeing on the leaves are equal.