Documentation

Mathlib.Algebra.Category.MonCat.Colimits

The category of monoids has all colimits. #

We do this construction knowing nothing about monoids. In particular, I want to claim that this file could be produced by a python script that just looks at what Lean 3's #print monoid printed a long time ago (it no longer looks like this due to the addition of npow fields):

structure monoid : Type u → Type u
fields:
monoid.mul : Π {M : Type u} [self : monoid M], M → M → M
monoid.mul_assoc : ∀ {M : Type u} [self : monoid M] (a b c : M), a * b * c = a * (b * c)
monoid.one : Π {M : Type u} [self : monoid M], M
monoid.one_mul : ∀ {M : Type u} [self : monoid M] (a : M), 1 * a = a
monoid.mul_one : ∀ {M : Type u} [self : monoid M] (a : M), a * 1 = a

and if we'd fed it the output of Lean 3's #print comm_ring, this file would instead build colimits of commutative rings.

A slightly bolder claim is that we could do this with tactics, as well.

Note: Monoid and CommRing are no longer flat structures in Mathlib4, and so #print Monoid gives the less clear

inductive Monoid.{u} : Type u → Type u
number of parameters: 1
constructors:
Monoid.mk : {M : Type u} →
  [toSemigroup : Semigroup M] →
    [toOne : One M] →
      (∀ (a : M), 1 * a = a) →
        (∀ (a : M), a * 1 = a) →
          (npow : ℕ → M → M) →
            autoParam (∀ (x : M), npow 0 x = 1) _auto✝ →
              autoParam (∀ (n : ℕ) (x : M), npow (n + 1) x = x * npow n x) _auto✝¹ → Monoid M

We build the colimit of a diagram in MonCat by constructing the free monoid on the disjoint union of all the monoids in the diagram, then taking the quotient by the monoid laws within each monoid, and the identifications given by the morphisms in the diagram.

An inductive type representing all monoid expressions (without relations) on a collection of types indexed by the objects of J.

Instances For

    The relation on Prequotient saying when two expressions are equal because of the monoid laws, or because one element is mapped to another by a morphism in the diagram.

    Instances For

      The setoid corresponding to monoid expressions modulo monoid relations and identifications.

      Equations

      The underlying type of the colimit of a diagram in MonCat.

      Equations
      Instances For
        @[simp]
        theorem MonCat.Colimits.quot_one {J : Type v} [CategoryTheory.SmallCategory J] (F : CategoryTheory.Functor J MonCat) :
        Quot.mk Setoid.r MonCat.Colimits.Prequotient.one = 1

        The bundled monoid giving the colimit of a diagram.

        Equations
        Instances For

          The function from a given monoid in the diagram to the colimit monoid.

          Equations
          Instances For

            The monoid homomorphism from a given monoid in the diagram to the colimit monoid.

            Equations
            Instances For
              @[simp]
              theorem MonCat.Colimits.cocone_naturality_components {J : Type v} [CategoryTheory.SmallCategory J] (F : CategoryTheory.Functor J MonCat) (j : J) (j' : J) (f : j j') (x : (F.obj j)) :

              The cocone over the proposed colimit monoid.

              Equations
              Instances For

                The function from the free monoid on the diagram to the cone point of any other cocone.

                Equations
                Instances For

                  The function from the colimit monoid to the cone point of any other cocone.

                  Equations
                  Instances For

                    The monoid homomorphism from the colimit monoid to the cone point of any other cocone.

                    Equations
                    Instances For

                      Evidence that the proposed colimit is the colimit.

                      Equations
                      Instances For