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
      @[implicit_reducible]
      @[implicit_reducible]
      @[reducible, inline]
      abbrev MagmaCat.of (M : Type u) [Mul M] :

      Construct a bundled MagmaCat from the underlying type and typeclass.

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

        Construct a bundled AddMagmaCat from the underlying type and typeclass.

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

          The type of morphisms in AddMagmaCat R.

          Instances For
            theorem AddMagmaCat.Hom.ext_iff {A B : AddMagmaCat} {x y : A.Hom B} :
            x = y โ†” x.hom' = y.hom'
            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_iff {A B : MagmaCat} {x y : A.Hom B} :
              x = y โ†” x.hom' = y.hom'
              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.

              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.

                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.

                  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.

                    Instances For
                      def MagmaCat.Hom.Simps.hom (X Y : MagmaCat) (f : X.Hom Y) :
                      โ†‘X โ†’โ‚™* โ†‘Y

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

                      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.ext_iff {X Y : MagmaCat} {f g : X โŸถ Y} :
                        f = g โ†” โˆ€ (x : โ†‘X), (CategoryTheory.ConcreteCategory.hom f) x = (CategoryTheory.ConcreteCategory.hom g) x
                        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
                        theorem MagmaCat.hom_ext_iff {M N : MagmaCat} {f g : M โŸถ N} :
                        f = g โ†” Hom.hom f = Hom.hom g
                        theorem AddMagmaCat.hom_ext_iff {M N : AddMagmaCat} {f g : M โŸถ N} :
                        f = g โ†” Hom.hom f = Hom.hom g
                        @[simp]
                        theorem MagmaCat.hom_ofHom {M N : Type u} [Mul M] [Mul N] (f : M โ†’โ‚™* N) :
                        Hom.hom (ofHom f) = f
                        @[simp]
                        theorem AddMagmaCat.hom_ofHom {M N : Type u} [Add M] [Add N] (f : M โ†’โ‚™+ N) :
                        Hom.hom (ofHom f) = f
                        @[simp]
                        theorem MagmaCat.ofHom_hom {M N : MagmaCat} (f : M โŸถ N) :
                        ofHom (Hom.hom f) = f
                        @[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
                        @[implicit_reducible]
                        instance MagmaCat.instInhabited :
                        Inhabited MagmaCat
                        @[implicit_reducible]
                        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
                            @[implicit_reducible]
                            @[implicit_reducible]
                            @[reducible, inline]
                            abbrev Semigrp.of (M : Type u) [Semigroup M] :

                            Construct a bundled Semigrp from the underlying type and typeclass.

                            Instances For
                              @[reducible, inline]

                              Construct a bundled AddSemigrp from the underlying type and typeclass.

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

                                The type of morphisms in AddSemigrp R.

                                Instances For
                                  theorem AddSemigrp.Hom.ext_iff {A B : AddSemigrp} {x y : A.Hom B} :
                                  x = y โ†” x.hom' = y.hom'
                                  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
                                    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.

                                    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.

                                      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.

                                        Instances For
                                          @[reducible, inline]

                                          Typecheck an AddHom as a morphism in AddSemigrp.

                                          Instances For
                                            def Semigrp.Hom.Simps.hom (X Y : Semigrp) (f : X.Hom Y) :
                                            โ†‘X โ†’โ‚™* โ†‘Y

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

                                            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 AddSemigrp.ext_iff {X Y : AddSemigrp} {f g : X โŸถ Y} :
                                              f = g โ†” โˆ€ (x : โ†‘X), (CategoryTheory.ConcreteCategory.hom f) x = (CategoryTheory.ConcreteCategory.hom g) x
                                              theorem Semigrp.ext_iff {X Y : Semigrp} {f g : X โŸถ Y} :
                                              f = g โ†” โˆ€ (x : โ†‘X), (CategoryTheory.ConcreteCategory.hom f) x = (CategoryTheory.ConcreteCategory.hom g) x
                                              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
                                              theorem AddSemigrp.hom_ext_iff {X Y : AddSemigrp} {f g : X โŸถ Y} :
                                              f = g โ†” Hom.hom f = Hom.hom g
                                              theorem Semigrp.hom_ext_iff {X Y : Semigrp} {f g : X โŸถ Y} :
                                              f = g โ†” Hom.hom f = Hom.hom g
                                              @[simp]
                                              theorem Semigrp.hom_ofHom {X Y : Type u} [Semigroup X] [Semigroup Y] (f : X โ†’โ‚™* Y) :
                                              Hom.hom (ofHom f) = f
                                              @[simp]
                                              theorem Semigrp.ofHom_hom {X Y : Semigrp} (f : X โŸถ Y) :
                                              ofHom (Hom.hom f) = f
                                              @[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
                                              @[implicit_reducible]
                                              instance Semigrp.instInhabited :
                                              Inhabited Semigrp
                                              @[implicit_reducible]
                                              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.

                                              Instances For
                                                def AddEquiv.toAddMagmaCatIso {X Y : Type u} [Add X] [Add Y] (e : X โ‰ƒ+ Y) :

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

                                                Instances For
                                                  @[simp]
                                                  theorem MulEquiv.toMagmaCatIso_hom {X Y : Type u} [Mul X] [Mul Y] (e : X โ‰ƒ* Y) :

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

                                                  Instances For

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

                                                    Instances For
                                                      def CategoryTheory.Iso.magmaCatIsoToMulEquiv {X Y : MagmaCat} (i : X โ‰… Y) :
                                                      โ†‘X โ‰ƒ* โ†‘Y

                                                      Build a MulEquiv from an isomorphism in the category MagmaCat.

                                                      Instances For

                                                        Build an AddEquiv from an isomorphism in the category AddMagmaCat.

                                                        Instances For
                                                          def CategoryTheory.Iso.semigrpIsoToMulEquiv {X Y : Semigrp} (i : X โ‰… Y) :
                                                          โ†‘X โ‰ƒ* โ†‘Y

                                                          Build a MulEquiv from an isomorphism in the category Semigroup.

                                                          Instances For

                                                            Build an AddEquiv from an isomorphism in the category AddSemigroup.

                                                            Instances For
                                                              def mulEquivIsoMagmaIso {X Y : Type u} [Mul X] [Mul Y] :

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

                                                              Instances For

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

                                                                Instances For

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

                                                                  Instances For

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

                                                                    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.