HepLean Documentation

Mathlib.Algebra.Category.ModuleCat.Basic

The category of R-modules #

ModuleCat.{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 : ModuleCat 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 ModuleCat 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
    @[reducible, inline]
    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
      instance ModuleCat.instFunLikeHomCarrier (R : Type u) [Ring R] {M : ModuleCat R} {N : ModuleCat R} :
      FunLike (M N) M N
      Equations
      instance ModuleCat.instLinearMapClassHomCarrier (R : Type u) [Ring R] {M : ModuleCat R} {N : ModuleCat R} :
      LinearMapClass (M N) R M N
      Equations
      • =
      Equations
      • One or more equations did not get rendered due to their size.
      theorem ModuleCat.ext_iff {R : Type u} [Ring R] {M : ModuleCat R} {N : ModuleCat R} {f₁ : M N} {f₂ : M N} :
      f₁ = f₂ ∀ (x : M), f₁ x = f₂ x
      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
        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
        @[simp]
        theorem ModuleCat.ofSelfIso_hom {R : Type u} [Ring R] (M : ModuleCat R) :
        @[simp]
        theorem ModuleCat.ofSelfIso_inv {R : Type u} [Ring R] (M : ModuleCat R) :
        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
            @[deprecated ModuleCat.asHom]
            def ModuleCat.ofHom {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₂)

            Alias of ModuleCat.asHom.


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

            Equations
            Instances For

              Reinterpreting a linear map in the category of R-modules

              Equations
              Instances For
                @[simp]
                theorem ModuleCat.asHom_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.asHom f) x = f x
                @[deprecated ModuleCat.asHom_apply]
                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.asHom f) x = f x

                Alias of ModuleCat.asHom_apply.

                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₂) :
                        e.toModuleIso.inv = e.symm
                        @[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₂) :
                        e.toModuleIso.hom = e
                        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
                        • e.toModuleIso = { hom := e, inv := e.symm, hom_inv_id := , inv_hom_id := }
                        Instances For
                          @[reducible, inline]
                          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
                          • i.toModuleIso' = i.toModuleIso
                          Instances For
                            @[reducible, inline]
                            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
                            • e.toModuleIso'Left = e.toModuleIso
                            Instances For
                              @[reducible, inline]
                              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
                              • e.toModuleIso'Right = e.toModuleIso
                              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 = i.toLinearEquiv
                                  @[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 = e.toModuleIso
                                  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
                                  • linearEquivIsoModuleIso = { hom := fun (e : X ≃ₗ[R] Y) => e.toModuleIso, inv := fun (i : ModuleCat.of R X ModuleCat.of R Y) => i.toLinearEquiv, hom_inv_id := , inv_hom_id := }
                                  Instances For
                                    instance ModuleCat.instAddCommGroupHom {R : Type u} [Ring R] {M : ModuleCat R} {N : ModuleCat R} :
                                    Equations
                                    • ModuleCat.instAddCommGroupHom = LinearMap.addCommGroup
                                    Equations
                                    • ModuleCat.instPreadditive = { homGroup := inferInstance, add_comp := , comp_add := }
                                    Equations
                                    • ModuleCat.instLinear = { homModule := fun (x x_1 : ModuleCat S) => LinearMap.module, smul_comp := , comp_smul := }
                                    theorem ModuleCat.Iso.homCongr_eq_arrowCongr {S : Type u} [CommRing S] {X : ModuleCat S} {Y : ModuleCat S} {X' : ModuleCat S} {Y' : ModuleCat S} (i : X X') (j : Y Y') (f : X Y) :
                                    (i.homCongr j) f = (i.toLinearEquiv.arrowCongr j.toLinearEquiv) f
                                    theorem ModuleCat.Iso.conj_eq_conj {S : Type u} [CommRing S] {X : ModuleCat S} {X' : ModuleCat S} (i : X X') (f : CategoryTheory.End X) :
                                    i.conj f = i.toLinearEquiv.conj f

                                    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
                                    • M.smul = { toFun := fun (r : R) => { toFun := fun (m : M) => r m, map_zero' := , map_add' := }, map_one' := , map_mul' := , map_zero' := , map_add' := }
                                    Instances For
                                      @[simp]
                                      theorem ModuleCat.smulNatTrans_apply_app (R : Type u) [Ring R] (r : R) (M : ModuleCat R) :
                                      ((ModuleCat.smulNatTrans R) r).app M = M.smul r

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

                                      Equations
                                      • ModuleCat.smulNatTrans R = { toFun := fun (r : R) => { app := fun (M : ModuleCat R) => M.smul r, naturality := }, map_one' := , map_mul' := , map_zero' := , map_add' := }
                                      Instances For

                                        Given A : AddCommGrp 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 : AddCommGrp} (φ : R →+* CategoryTheory.End A) (r : R) (x : (ModuleCat.mkOfSMul' φ)) :
                                          r x = (let_fun this := φ r; this) x
                                          @[reducible, inline]

                                          Given A : AddCommGrp 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 : AddCommGrp} (φ : R →+* CategoryTheory.End A) (r : R) :
                                            (ModuleCat.mkOfSMul φ).smul r = φ r
                                            @[simp]

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

                                            Equations
                                            Instances For
                                              instance ModuleCat.instReflectsIsomorphismsForget {R : Type u} [Ring R] :
                                              (CategoryTheory.forget (ModuleCat R)).ReflectsIsomorphisms
                                              Equations
                                              • =

                                              @[simp] lemmas for LinearMap.comp and categorical identities.

                                              @[simp]
                                              theorem LinearMap.comp_id_moduleCat {R : Type u_1} [Ring R] {G : ModuleCat R} {H : Type u} [AddCommGroup H] [Module R H] (f : G →ₗ[R] H) :
                                              @[simp]
                                              theorem LinearMap.id_moduleCat_comp {R : Type u_1} [Ring R] {G : Type u} [AddCommGroup G] [Module R G] {H : ModuleCat R} (f : G →ₗ[R] H) :