Documentation

Linglib.Core.Algebra.FreeCommMagma

The free commutative magma #

FreeCommMagma α is the free magma on α modulo the congruence generated by commutativity: the nonassociative commutative products of generators, Marcolli, Chomsky and Berwick's binary unordered rooted trees with leaves in α. lift is the universal property, by which maps from α into a commutative magma correspond to magma homomorphisms out of FreeCommMagma α. [UPSTREAM] candidate for Mathlib/Algebra/Free.lean.

Main definitions #

Main results #

References #

def FreeMagma.commCon (α : Type u) :
Con (FreeMagma α)

The congruence on the free magma generated by commutativity.

Equations
  • FreeMagma.commCon α = conGen fun (x y : FreeMagma α) => ∃ (a : FreeMagma α) (b : FreeMagma α), x = a * b ∧ y = b * a
Instances For
    @[simp]
    theorem FreeMagma.commCon_of_iff {α : Type u} {a : α} {y : FreeMagma α} :
    (commCon α) (of a) y ↔ y = of a
    theorem FreeMagma.lift_congr {α : Type u} {M : Type v} [CommMagma M] (f : α → M) {x y : FreeMagma α} (h : (commCon α) x y) :
    (lift f) x = (lift f) y
    def FreeCommMagma (α : Type u) :

    The free commutative magma on α, the free magma modulo commutativity.

    Equations
    Instances For
      @[instance_reducible]
      instance FreeCommMagma.instMul {α : Type u} :
      Mul (FreeCommMagma α)
      Equations
      @[instance_reducible]
      instance FreeCommMagma.instCommMagma {α : Type u} :
      CommMagma (FreeCommMagma α)
      Equations
      def FreeCommMagma.ofMagma {α : Type u} :
      FreeMagma α →ₙ* FreeCommMagma α

      The projection from the free magma, forgetting the bracketing order.

      Equations
      Instances For
        def FreeCommMagma.of {α : Type u} (a : α) :

        The generator a.

        Equations
        Instances For
          @[instance_reducible]
          instance FreeCommMagma.instInhabited {α : Type u} [Inhabited α] :
          Inhabited (FreeCommMagma α)
          Equations
          @[simp]
          theorem FreeCommMagma.ofMagma_of {α : Type u} (a : α) :
          ofMagma (FreeMagma.of a) = of a
          theorem FreeCommMagma.ofMagma_surjective {α : Type u} :
          Function.Surjective ⇑ofMagma
          theorem FreeCommMagma.inductionOn {α : Type u} {motive : FreeCommMagma α → Prop} (x : FreeCommMagma α) (of : ∀ (a : α), motive (of a)) (mul : ∀ (x y : FreeCommMagma α), motive x → motive y → motive (x * y)) :
          motive x
          theorem FreeCommMagma.hom_ext {α : Type u} {M : Type v} [Mul M] {f g : FreeCommMagma α →ₙ* M} (h : ∀ (a : α), f (of a) = g (of a)) :
          f = g

          Magma homomorphisms out of a free commutative magma agreeing on the generators are equal.

          theorem FreeCommMagma.hom_ext_iff {α : Type u} {M : Type v} [Mul M] {f g : FreeCommMagma α →ₙ* M} :
          f = g ↔ ∀ (a : α), f (of a) = g (of a)
          def FreeCommMagma.lift {α : Type u} {M : Type v} [CommMagma M] :
          (α → M) ≃ (FreeCommMagma α →ₙ* M)

          The universal property of the free commutative magma: maps from α into a commutative magma correspond to magma homomorphisms out of FreeCommMagma α.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[simp]
            theorem FreeCommMagma.lift_of {α : Type u} {M : Type v} [CommMagma M] (f : α → M) (a : α) :
            (lift f) (of a) = f a
            @[simp]
            theorem FreeCommMagma.lift_comp_of {α : Type u} {M : Type v} [CommMagma M] (f : α → M) :
            ⇑(lift f) ∘ of = f
            @[simp]
            theorem FreeCommMagma.lift_ofMagma {α : Type u} {M : Type v} [CommMagma M] (f : α → M) (x : FreeMagma α) :
            (lift f) (ofMagma x) = (FreeMagma.lift f) x
            @[simp]
            theorem FreeCommMagma.lift_symm_apply {α : Type u} {M : Type v} [CommMagma M] (F : FreeCommMagma α →ₙ* M) :
            lift.symm F = ⇑F ∘ of
            def FreeCommMagma.map {α : Type u} {β : Type v} (f : α → β) :

            The functorial action on generators.

            Equations
            Instances For
              @[simp]
              theorem FreeCommMagma.map_of {α : Type u} {β : Type v} (f : α → β) (a : α) :
              (map f) (of a) = of (f a)
              theorem FreeCommMagma.of_injective {α : Type u} :
              Function.Injective of