Documentation

Mathlib.Algebra.Category.ModuleCat.Basic

The category of R-modules #

Module.{v} R is the category of bundled R-modules with carrier in the universe v. We show that it is preadditive and show that being an isomorphism, monomorphism and epimorphism is equivalent to being a linear equivalence, an injective linear map and a surjective linear map, respectively.

Implementation details #

To construct an object in the category of R-modules from a type M with an instance of the Module typeclass, write of R M. There is a coercion in the other direction.

Similarly, there is a coercion from morphisms in Module R to linear maps.

Porting note: the next two paragraphs should be revised.

Unfortunately, Lean is not smart enough to see that, given an object M : Module R, the expression of R M, where we coerce M to the carrier type, is definitionally equal to M itself. This means that to go the other direction, i.e., from linear maps/equivalences to (iso)morphisms in the category of R-modules, we have to take care not to inadvertently end up with an of R M where M is already an object. Hence, given f : M →ₗ[R] N,

Similarly, given f : M ≃ₗ[R] N, use toModuleIso, toModuleIso'Left, toModuleIso'Right or toModuleIso', respectively.

The arrow notations are localized, so you may have to open ModuleCat (or open scoped ModuleCat) to use them. Note that the notation for asHomLeft clashes with the notation used to promote functions between types to morphisms in the category Type, so to avoid confusion, it is probably a good idea to avoid having the locales Module and CategoryTheory.Type open at the same time.

If you get an error when trying to apply a theorem and the convert tactic produces goals of the form M = of R M, then you probably used an incorrect variant of asHom or toModuleIso.

structure ModuleCat (R : Type u) [Ring R] :
Type (max u (v + 1))

The category of R-modules and their morphisms.

Note that in the case of R = ℤ, we can not impose here that the -multiplication field from the module structure is defeq to the one coming from the isAddCommGroup structure (contrary to what we do for all module structures in mathlib), which creates some difficulties down the road.

Instances For
    @[inline, reducible]
    abbrev ModuleCatMax (R : Type u₁) [Ring R] :
    Type (max u₁ ((max v₁ v₂) + 1))

    An alias for ModuleCat.{max u₁ u₂}, to deal around unification issues. Since the universe the ring lives in can be inferred, we put that last.

    Equations
    Instances For
      Equations
      Equations
      • One or more equations did not get rendered due to their size.
      theorem ModuleCat.ext (R : Type u) [Ring R] {M : ModuleCat R} {N : ModuleCat R} {f₁ : M N} {f₂ : M N} (h : ∀ (x : M), f₁ x = f₂ x) :
      f₁ = f₂
      Equations
      • One or more equations did not get rendered due to their size.
      def ModuleCat.of (R : Type u) [Ring R] (X : Type v) [AddCommGroup X] [Module R X] :

      The object in the category of R-modules associated to an R-module

      Equations
      Instances For
        def ModuleCat.ofHom {R : Type u} [Ring R] {X : Type v} {Y : Type v} [AddCommGroup X] [Module R X] [AddCommGroup Y] [Module R Y] (f : X →ₗ[R] Y) :

        Typecheck a LinearMap as a morphism in Module R.

        Equations
        Instances For
          @[simp]
          theorem ModuleCat.ofHom_apply {R : Type u} [Ring R] {X : Type v} {Y : Type v} [AddCommGroup X] [Module R X] [AddCommGroup Y] [Module R Y] (f : X →ₗ[R] Y) (x : X) :
          (ModuleCat.ofHom f) x = f x
          instance ModuleCat.ofUnique (R : Type u) [Ring R] {X : Type v} [AddCommGroup X] [Module R X] [i : Unique X] :
          Equations
          @[simp]
          theorem ModuleCat.of_coe (R : Type u) [Ring R] (X : ModuleCat R) :
          ModuleCat.of R X = X
          theorem ModuleCat.coe_of (R : Type u) [Ring R] (X : Type v) [AddCommGroup X] [Module R X] :
          (ModuleCat.of R X) = X
          def ModuleCat.ofSelfIso {R : Type u} [Ring R] (M : ModuleCat R) :
          ModuleCat.of R M M

          Forgetting to the underlying type and then building the bundled object returns the original module.

          Equations
          Instances For
            @[simp]
            theorem ModuleCat.id_apply {R : Type u} [Ring R] {M : ModuleCat R} (m : M) :
            @[simp]
            theorem ModuleCat.coe_comp {R : Type u} [Ring R] {M : ModuleCat R} {N : ModuleCat R} {U : ModuleCat R} (f : M N) (g : N U) :
            theorem ModuleCat.comp_def {R : Type u} [Ring R] {M : ModuleCat R} {N : ModuleCat R} {U : ModuleCat R} (f : M N) (g : N U) :
            @[simp]
            theorem ModuleCat.forget_map {R : Type u} [Ring R] {M : ModuleCat R} {N : ModuleCat R} (f : M N) :
            def ModuleCat.asHom {R : Type u} [Ring R] {X₁ : Type v} {X₂ : Type v} [AddCommGroup X₁] [Module R X₁] [AddCommGroup X₂] [Module R X₂] :
            (X₁ →ₗ[R] X₂)(ModuleCat.of R X₁ ModuleCat.of R X₂)

            Reinterpreting a linear map in the category of R-modules.

            Equations
            • ModuleCat.asHom = id
            Instances For

              Reinterpreting a linear map in the category of R-modules

              Equations
              Instances For
                def ModuleCat.asHomRight {R : Type u} [Ring R] {X₁ : Type v} [AddCommGroup X₁] [Module R X₁] {X₂ : ModuleCat R} :
                (X₁ →ₗ[R] X₂)(ModuleCat.of R X₁ X₂)

                Reinterpreting a linear map in the category of R-modules.

                Equations
                • ModuleCat.asHomRight = id
                Instances For

                  Reinterpreting a linear map in the category of R-modules.

                  Equations
                  Instances For
                    def ModuleCat.asHomLeft {R : Type u} [Ring R] {X₂ : Type v} {X₁ : ModuleCat R} [AddCommGroup X₂] [Module R X₂] :
                    (X₁ →ₗ[R] X₂)(X₁ ModuleCat.of R X₂)

                    Reinterpreting a linear map in the category of R-modules.

                    Equations
                    • ModuleCat.asHomLeft = id
                    Instances For

                      Reinterpreting a linear map in the category of R-modules.

                      Equations
                      Instances For
                        @[simp]
                        theorem LinearEquiv.toModuleIso_inv {R : Type u} [Ring R] {X₁ : Type v} {X₂ : Type v} {g₁ : AddCommGroup X₁} {g₂ : AddCommGroup X₂} {m₁ : Module R X₁} {m₂ : Module R X₂} (e : X₁ ≃ₗ[R] X₂) :
                        @[simp]
                        theorem LinearEquiv.toModuleIso_hom {R : Type u} [Ring R] {X₁ : Type v} {X₂ : Type v} {g₁ : AddCommGroup X₁} {g₂ : AddCommGroup X₂} {m₁ : Module R X₁} {m₂ : Module R X₂} (e : X₁ ≃ₗ[R] X₂) :
                        def LinearEquiv.toModuleIso {R : Type u} [Ring R] {X₁ : Type v} {X₂ : Type v} {g₁ : AddCommGroup X₁} {g₂ : AddCommGroup X₂} {m₁ : Module R X₁} {m₂ : Module R X₂} (e : X₁ ≃ₗ[R] X₂) :

                        Build an isomorphism in the category Module R from a LinearEquiv between Modules.

                        Equations
                        Instances For
                          @[inline, reducible]
                          abbrev LinearEquiv.toModuleIso' {R : Type u} [Ring R] {M : ModuleCat R} {N : ModuleCat R} (i : M ≃ₗ[R] N) :
                          M N

                          Build an isomorphism in the category Module R from a LinearEquiv between Modules.

                          Equations
                          Instances For
                            @[inline, reducible]
                            abbrev LinearEquiv.toModuleIso'Left {R : Type u} [Ring R] {X₂ : Type v} {X₁ : ModuleCat R} [AddCommGroup X₂] [Module R X₂] (e : X₁ ≃ₗ[R] X₂) :
                            X₁ ModuleCat.of R X₂

                            Build an isomorphism in the category ModuleCat R from a LinearEquiv between Modules.

                            Equations
                            Instances For
                              @[inline, reducible]
                              abbrev LinearEquiv.toModuleIso'Right {R : Type u} [Ring R] {X₁ : Type v} [AddCommGroup X₁] [Module R X₁] {X₂ : ModuleCat R} (e : X₁ ≃ₗ[R] X₂) :
                              ModuleCat.of R X₁ X₂

                              Build an isomorphism in the category ModuleCat R from a LinearEquiv between Modules.

                              Equations
                              Instances For
                                def CategoryTheory.Iso.toLinearEquiv {R : Type u} [Ring R] {X : ModuleCat R} {Y : ModuleCat R} (i : X Y) :
                                X ≃ₗ[R] Y

                                Build a LinearEquiv from an isomorphism in the category ModuleCat R.

                                Equations
                                Instances For
                                  @[simp]
                                  theorem linearEquivIsoModuleIso_inv {R : Type u} [Ring R] {X : Type u} {Y : Type u} [AddCommGroup X] [AddCommGroup Y] [Module R X] [Module R Y] (i : ModuleCat.of R X ModuleCat.of R Y) :
                                  linearEquivIsoModuleIso.inv i = CategoryTheory.Iso.toLinearEquiv i
                                  @[simp]
                                  theorem linearEquivIsoModuleIso_hom {R : Type u} [Ring R] {X : Type u} {Y : Type u} [AddCommGroup X] [AddCommGroup Y] [Module R X] [Module R Y] (e : X ≃ₗ[R] Y) :
                                  linearEquivIsoModuleIso.hom e = LinearEquiv.toModuleIso e
                                  def linearEquivIsoModuleIso {R : Type u} [Ring R] {X : Type u} {Y : Type u} [AddCommGroup X] [AddCommGroup Y] [Module R X] [Module R Y] :

                                  linear equivalences between Modules are the same as (isomorphic to) isomorphisms in ModuleCat

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    Equations
                                    • ModuleCat.instAddCommGroupHomModuleCatToQuiverToCategoryStructModuleCategory = LinearMap.addCommGroup
                                    Equations
                                    • ModuleCat.instPreadditiveModuleCatModuleCategory = { homGroup := inferInstance, add_comp := , comp_add := }

                                    The scalar multiplication on an object of ModuleCat R considered as a morphism of rings from R to the endomorphisms of the underlying abelian group.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      @[simp]
                                      theorem ModuleCat.smulNatTrans_apply_app (R : Type u) [Ring R] (r : R) (M : ModuleCat R) :

                                      The scalar multiplication on ModuleCat R considered as a morphism of rings to the endomorphisms of the forgetful functor to AddCommGroupCat).

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Given A : AddCommGroupCat and a ring morphism R →+* End A, this is a type synonym for A, on which we shall define a structure of R-module.

                                        Equations
                                        Instances For
                                          Equations
                                          @[simp]
                                          theorem ModuleCat.mkOfSMul'_smul {R : Type u} [Ring R] {A : AddCommGroupCat} (φ : R →+* CategoryTheory.End A) (r : R) (x : (ModuleCat.mkOfSMul' φ)) :
                                          r x = (let_fun this := φ r; this) x
                                          @[inline, reducible]

                                          Given A : AddCommGroupCat and a ring morphism R →+* End A, this is an object in ModuleCat R, whose underlying abelian group is A and whose scalar multiplication is given by R.

                                          Equations
                                          Instances For
                                            @[simp]
                                            theorem ModuleCat.mkOfSMul_smul {R : Type u} [Ring R] {A : AddCommGroupCat} (φ : R →+* CategoryTheory.End A) (r : R) :

                                            Constructor for morphisms in ModuleCat R which takes as inputs a morphism between the underlying objects in AddCommGroupCat and the compatibility with the scalar multiplication.

                                            Equations
                                            • ModuleCat.homMk φ = { toAddHom := { toFun := φ, map_add' := }, map_smul' := }
                                            Instances For