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
                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
                  @[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) :

                          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) :

                              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
                                      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
                                      @[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 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
                                                    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
                                                      @[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) :

                                                              Typecheck a MulHom as a morphism in Semigrp.

                                                              Equations
                                                                Instances For
                                                                  @[reducible, inline]

                                                                  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
                                                                          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
                                                                          @[simp]
                                                                          theorem Semigrp.ofHom_hom {X Y : Semigrp} (f : X โŸถ Y) :
                                                                          @[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

                                                                          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

                                                                                  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
                                                                                          def CategoryTheory.Iso.magmaCatIsoToMulEquiv {X Y : MagmaCat} (i : X โ‰… Y) :
                                                                                          โ†‘X โ‰ƒ* โ†‘Y

                                                                                          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.

                                                                                                                          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.