Documentation

Mathlib.Algebra.Category.Semigrp.Basic

Category instances for Mul, Add, Semigroup and AddSemigroup #

We introduce the bundled categories:

along with the relevant forgetful functors between them.

This closely follows Mathlib/Algebra/Category/MonCat/Basic.lean.

TODO #

structure AddMagmaCat :
Type (u + 1)

The category of additive magmas and additive magma morphisms.

  • carrier : Type u

    The underlying additive magma.

  • str : Add self
Instances For
    structure MagmaCat :
    Type (u + 1)

    The category of magmas and magma morphisms.

    • carrier : Type u

      The underlying magma.

    • str : Mul self
    Instances For
      @[reducible, inline]
      abbrev MagmaCat.of (M : Type u) [Mul M] :

      Construct a bundled MagmaCat from the underlying type and typeclass.

      Equations
        Instances For
          @[reducible, inline]
          abbrev AddMagmaCat.of (M : Type u) [Add M] :

          Construct a bundled AddMagmaCat from the underlying type and typeclass.

          Equations
            Instances For
              structure AddMagmaCat.Hom (A B : AddMagmaCat) :

              The type of morphisms in AddMagmaCat R.

              Instances For
                theorem AddMagmaCat.Hom.ext {A B : AddMagmaCat} {x y : A.Hom B} (hom' : x.hom' = y.hom') :
                x = y
                theorem AddMagmaCat.Hom.ext_iff {A B : AddMagmaCat} {x y : A.Hom B} :
                x = y x.hom' = y.hom'
                structure MagmaCat.Hom (A B : MagmaCat) :

                The type of morphisms in MagmaCat R.

                Instances For
                  theorem MagmaCat.Hom.ext {A B : MagmaCat} {x y : A.Hom B} (hom' : x.hom' = y.hom') :
                  x = y
                  theorem MagmaCat.Hom.ext_iff {A B : MagmaCat} {x y : A.Hom B} :
                  x = y x.hom' = y.hom'
                  @[reducible, inline]
                  abbrev MagmaCat.Hom.hom {X Y : MagmaCat} (f : X.Hom Y) :
                  X →ₙ* Y

                  Turn a morphism in MagmaCat back into a MulHom.

                  Equations
                    Instances For
                      @[reducible, inline]
                      abbrev AddMagmaCat.Hom.hom {X Y : AddMagmaCat} (f : X.Hom Y) :
                      X →ₙ+ Y

                      Turn a morphism in AddMagmaCat back into an AddHom.

                      Equations
                        Instances For
                          @[reducible, inline]
                          abbrev MagmaCat.ofHom {X Y : Type u} [Mul X] [Mul Y] (f : X →ₙ* Y) :
                          of X of Y

                          Typecheck a MulHom as a morphism in MagmaCat.

                          Equations
                            Instances For
                              @[reducible, inline]
                              abbrev AddMagmaCat.ofHom {X Y : Type u} [Add X] [Add Y] (f : X →ₙ+ Y) :
                              of X of Y

                              Typecheck an AddHom as a morphism in AddMagmaCat.

                              Equations
                                Instances For
                                  def MagmaCat.Hom.Simps.hom (X Y : MagmaCat) (f : X.Hom Y) :
                                  X →ₙ* Y

                                  Use the ConcreteCategory.hom projection for @[simps] lemmas.

                                  Equations
                                    Instances For

                                      The results below duplicate the ConcreteCategory simp lemmas, but we can keep them for dsimp.

                                      theorem MagmaCat.ext {X Y : MagmaCat} {f g : X Y} (w : ∀ (x : X), (CategoryTheory.ConcreteCategory.hom f) x = (CategoryTheory.ConcreteCategory.hom g) x) :
                                      f = g
                                      theorem AddMagmaCat.ext {X Y : AddMagmaCat} {f g : X Y} (w : ∀ (x : X), (CategoryTheory.ConcreteCategory.hom f) x = (CategoryTheory.ConcreteCategory.hom g) x) :
                                      f = g
                                      theorem MagmaCat.coe_of (M : Type u) [Mul M] :
                                      (of M) = M
                                      theorem AddMagmaCat.coe_of (M : Type u) [Add M] :
                                      (of M) = M
                                      @[simp]
                                      theorem MagmaCat.hom_comp {M N T : MagmaCat} (f : M N) (g : N T) :
                                      @[simp]
                                      theorem MagmaCat.hom_ext {M N : MagmaCat} {f g : M N} (hf : Hom.hom f = Hom.hom g) :
                                      f = g
                                      theorem AddMagmaCat.hom_ext {M N : AddMagmaCat} {f g : M N} (hf : Hom.hom f = Hom.hom g) :
                                      f = g
                                      theorem AddMagmaCat.hom_ext_iff {M N : AddMagmaCat} {f g : M N} :
                                      theorem MagmaCat.hom_ext_iff {M N : MagmaCat} {f g : M N} :
                                      @[simp]
                                      theorem MagmaCat.hom_ofHom {M N : Type u} [Mul M] [Mul N] (f : M →ₙ* N) :
                                      @[simp]
                                      theorem AddMagmaCat.hom_ofHom {M N : Type u} [Add M] [Add N] (f : M →ₙ+ N) :
                                      @[simp]
                                      theorem MagmaCat.ofHom_hom {M N : MagmaCat} (f : M N) :
                                      @[simp]
                                      theorem AddMagmaCat.ofHom_hom {M N : AddMagmaCat} (f : M N) :
                                      @[simp]
                                      theorem MagmaCat.ofHom_comp {M N P : Type u} [Mul M] [Mul N] [Mul P] (f : M →ₙ* N) (g : N →ₙ* P) :
                                      @[simp]
                                      theorem AddMagmaCat.ofHom_comp {M N P : Type u} [Add M] [Add N] [Add P] (f : M →ₙ+ N) (g : N →ₙ+ P) :
                                      theorem MagmaCat.ofHom_apply {X Y : Type u} [Mul X] [Mul Y] (f : X →ₙ* Y) (x : X) :
                                      theorem AddMagmaCat.ofHom_apply {X Y : Type u} [Add X] [Add Y] (f : X →ₙ+ Y) (x : X) :
                                      @[simp]
                                      theorem MagmaCat.mulEquiv_coe_eq {X Y : Type u_1} [Mul X] [Mul Y] (e : X ≃* Y) :
                                      Hom.hom (ofHom e) = e
                                      @[simp]
                                      theorem AddMagmaCat.addEquiv_coe_eq {X Y : Type u_1} [Add X] [Add Y] (e : X ≃+ Y) :
                                      Hom.hom (ofHom e) = e
                                      structure AddSemigrp :
                                      Type (u + 1)

                                      The category of additive semigroups and semigroup morphisms.

                                      Instances For
                                        structure Semigrp :
                                        Type (u + 1)

                                        The category of semigroups and semigroup morphisms.

                                        Instances For
                                          @[reducible, inline]
                                          abbrev Semigrp.of (M : Type u) [Semigroup M] :

                                          Construct a bundled Semigrp from the underlying type and typeclass.

                                          Equations
                                            Instances For
                                              @[reducible, inline]

                                              Construct a bundled AddSemigrp from the underlying type and typeclass.

                                              Equations
                                                Instances For
                                                  structure AddSemigrp.Hom (A B : AddSemigrp) :

                                                  The type of morphisms in AddSemigrp R.

                                                  Instances For
                                                    theorem AddSemigrp.Hom.ext {A B : AddSemigrp} {x y : A.Hom B} (hom' : x.hom' = y.hom') :
                                                    x = y
                                                    theorem AddSemigrp.Hom.ext_iff {A B : AddSemigrp} {x y : A.Hom B} :
                                                    x = y x.hom' = y.hom'
                                                    structure Semigrp.Hom (A B : Semigrp) :

                                                    The type of morphisms in Semigrp R.

                                                    Instances For
                                                      theorem Semigrp.Hom.ext {A B : Semigrp} {x y : A.Hom B} (hom' : x.hom' = y.hom') :
                                                      x = y
                                                      theorem Semigrp.Hom.ext_iff {A B : Semigrp} {x y : A.Hom B} :
                                                      x = y x.hom' = y.hom'
                                                      @[reducible, inline]
                                                      abbrev Semigrp.Hom.hom {X Y : Semigrp} (f : X.Hom Y) :
                                                      X →ₙ* Y

                                                      Turn a morphism in Semigrp back into a MulHom.

                                                      Equations
                                                        Instances For
                                                          @[reducible, inline]
                                                          abbrev AddSemigrp.Hom.hom {X Y : AddSemigrp} (f : X.Hom Y) :
                                                          X →ₙ+ Y

                                                          Turn a morphism in AddSemigrp back into an AddHom.

                                                          Equations
                                                            Instances For
                                                              @[reducible, inline]
                                                              abbrev Semigrp.ofHom {X Y : Type u} [Semigroup X] [Semigroup Y] (f : X →ₙ* Y) :
                                                              of X of Y

                                                              Typecheck a MulHom as a morphism in Semigrp.

                                                              Equations
                                                                Instances For
                                                                  @[reducible, inline]
                                                                  abbrev AddSemigrp.ofHom {X Y : Type u} [AddSemigroup X] [AddSemigroup Y] (f : X →ₙ+ Y) :
                                                                  of X of Y

                                                                  Typecheck an AddHom as a morphism in AddSemigrp.

                                                                  Equations
                                                                    Instances For
                                                                      def Semigrp.Hom.Simps.hom (X Y : Semigrp) (f : X.Hom Y) :
                                                                      X →ₙ* Y

                                                                      Use the ConcreteCategory.hom projection for @[simps] lemmas.

                                                                      Equations
                                                                        Instances For

                                                                          The results below duplicate the ConcreteCategory simp lemmas, but we can keep them for dsimp.

                                                                          theorem Semigrp.ext {X Y : Semigrp} {f g : X Y} (w : ∀ (x : X), (CategoryTheory.ConcreteCategory.hom f) x = (CategoryTheory.ConcreteCategory.hom g) x) :
                                                                          f = g
                                                                          theorem AddSemigrp.ext {X Y : AddSemigrp} {f g : X Y} (w : ∀ (x : X), (CategoryTheory.ConcreteCategory.hom f) x = (CategoryTheory.ConcreteCategory.hom g) x) :
                                                                          f = g
                                                                          theorem Semigrp.coe_of (R : Type u) [Semigroup R] :
                                                                          (of R) = R
                                                                          theorem AddSemigrp.coe_of (R : Type u) [AddSemigroup R] :
                                                                          (of R) = R
                                                                          @[simp]
                                                                          theorem Semigrp.hom_comp {X Y T : Semigrp} (f : X Y) (g : Y T) :
                                                                          @[simp]
                                                                          theorem Semigrp.hom_ext {X Y : Semigrp} {f g : X Y} (hf : Hom.hom f = Hom.hom g) :
                                                                          f = g
                                                                          theorem AddSemigrp.hom_ext {X Y : AddSemigrp} {f g : X Y} (hf : Hom.hom f = Hom.hom g) :
                                                                          f = g
                                                                          theorem Semigrp.hom_ext_iff {X Y : Semigrp} {f g : X Y} :
                                                                          theorem AddSemigrp.hom_ext_iff {X Y : AddSemigrp} {f g : X Y} :
                                                                          @[simp]
                                                                          theorem Semigrp.hom_ofHom {X Y : Type u} [Semigroup X] [Semigroup Y] (f : X →ₙ* Y) :
                                                                          @[simp]
                                                                          theorem AddSemigrp.hom_ofHom {X Y : Type u} [AddSemigroup X] [AddSemigroup Y] (f : X →ₙ+ Y) :
                                                                          @[simp]
                                                                          theorem Semigrp.ofHom_hom {X Y : Semigrp} (f : X Y) :
                                                                          @[simp]
                                                                          theorem AddSemigrp.ofHom_hom {X Y : AddSemigrp} (f : X Y) :
                                                                          @[simp]
                                                                          theorem Semigrp.ofHom_comp {X Y Z : Type u} [Semigroup X] [Semigroup Y] [Semigroup Z] (f : X →ₙ* Y) (g : Y →ₙ* Z) :
                                                                          theorem Semigrp.ofHom_apply {X Y : Type u} [Semigroup X] [Semigroup Y] (f : X →ₙ* Y) (x : X) :
                                                                          @[simp]
                                                                          theorem Semigrp.mulEquiv_coe_eq {X Y : Type u_1} [Semigroup X] [Semigroup Y] (e : X ≃* Y) :
                                                                          Hom.hom (ofHom e) = e
                                                                          @[simp]
                                                                          theorem AddSemigrp.addEquiv_coe_eq {X Y : Type u_1} [AddSemigroup X] [AddSemigroup Y] (e : X ≃+ Y) :
                                                                          Hom.hom (ofHom e) = e
                                                                          def MulEquiv.toMagmaCatIso {X Y : Type u} [Mul X] [Mul Y] (e : X ≃* Y) :

                                                                          Build an isomorphism in the category MagmaCat from a MulEquiv between Muls.

                                                                          Equations
                                                                            Instances For

                                                                              Build an isomorphism in the category AddMagmaCat from an AddEquiv between Adds.

                                                                              Equations
                                                                                Instances For
                                                                                  @[simp]

                                                                                  Build an isomorphism in the category Semigroup from a MulEquiv between Semigroups.

                                                                                  Equations
                                                                                    Instances For

                                                                                      Build an isomorphism in the category AddSemigroup from an AddEquiv between AddSemigroups.

                                                                                      Equations
                                                                                        Instances For

                                                                                          Build a MulEquiv from an isomorphism in the category MagmaCat.

                                                                                          Equations
                                                                                            Instances For

                                                                                              Build an AddEquiv from an isomorphism in the category AddMagmaCat.

                                                                                              Equations
                                                                                                Instances For
                                                                                                  def CategoryTheory.Iso.semigrpIsoToMulEquiv {X Y : Semigrp} (i : X Y) :
                                                                                                  X ≃* Y

                                                                                                  Build a MulEquiv from an isomorphism in the category Semigroup.

                                                                                                  Equations
                                                                                                    Instances For

                                                                                                      Build an AddEquiv from an isomorphism in the category AddSemigroup.

                                                                                                      Equations
                                                                                                        Instances For

                                                                                                          multiplicative equivalences between Muls are the same as (isomorphic to) isomorphisms in MagmaCat

                                                                                                          Equations
                                                                                                            Instances For

                                                                                                              additive equivalences between Adds are the same as (isomorphic to) isomorphisms in AddMagmaCat

                                                                                                              Equations
                                                                                                                Instances For

                                                                                                                  multiplicative equivalences between Semigroups are the same as (isomorphic to) isomorphisms in Semigroup

                                                                                                                  Equations
                                                                                                                    Instances For

                                                                                                                      additive equivalences between AddSemigroups are the same as (isomorphic to) isomorphisms in AddSemigroup

                                                                                                                      Equations
                                                                                                                        Instances For

                                                                                                                          Ensure that forget₂ CommMonCat MonCat automatically reflects isomorphisms. We could have used CategoryTheory.HasForget.ReflectsIso alternatively.

                                                                                                                          Once we've shown that the forgetful functors to type reflect isomorphisms, we automatically obtain that the forget₂ functors between our concrete categories reflect isomorphisms.