Documentation

Linglib.Theories.Syntax.Minimalism.Formal.MCB2023.FreeMagmaEquiv

The isomorphism #

SyntacticObject ≃ FreeMagma LIToken — the core bridge

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

    Mul instance: Merge is the magma operation #

    Merge is literally FreeMagma multiplication under the isomorphism (definitional)

    Magma homomorphism #

    Universal property #

    SyntacticObject satisfies the same universal property as FreeMagma: any function LIToken → M (where M is a magma) extends uniquely to a magma homomorphism SyntacticObject →ₙ* M.

    Universal property: lift a function LIToken → M to a magma hom SO →ₙ* M

    Equations
    Instances For
      theorem Minimalism.SyntacticObject.liftMagma_leaf {M : Type u_1} [Mul M] (f : LITokenM) (tok : LIToken) :
      (liftMagma f) (leaf tok) = f tok
      theorem Minimalism.SyntacticObject.liftMagma_node {M : Type u_1} [Mul M] (f : LITokenM) (a b : SyntacticObject) :
      (liftMagma f) (a.node b) = (liftMagma f) a * (liftMagma f) b

      Containment ↔ proper subterm #

      Connect contains (Containment.lean) with subterm structure in the free magma.

      An SO is a proper subterm of another iff it appears strictly within it

      Instances For

        Immediate containment implies proper subterm

        Containment implies proper subterm

        Proper subterm implies containment

        Containment = proper subterm (the key bridge theorem)

        nodeCount is preserved by the isomorphism

        Bridge to FreeMagma.length #

        FreeMagma.length counts leaves (1 for .of, sum for .mul), matching SyntacticObject.leafCount exactly under the isomorphism. This gives access to mathlib's FreeMagma.length_pos for free.

        SO.leafCount = FreeMagma.length under the isomorphism

        leafCount is always positive — derived from mathlib's FreeMagma.length_pos