Documentation

Mathlib.Algebra.Category.ModuleCat.Semi

The category of R-modules #

If R is a semiring, SemimoduleCat.{v} R is the category of bundled R-semimodules with carrier in the universe v. We show that it is preadditive and show that being an isomorphism and monomorphism are equivalent to being a linear equivalence and an injective linear map respectively.

Implementation details #

To construct an object in the category of R-semimodules from a type M with an instance of the Module typeclass, write of R M. There is a coercion in the other direction. The roundtrip ↑(of R M) is definitionally equal to M itself (when M is a type with Module instance), and so is of R ↑M (when M : SemimoduleCat R M).

The morphisms are given their own type, not identified with LinearMap. There is a cast from morphisms in Module R to linear maps, written f.hom (SemimoduleCat.Hom.hom). To go from linear maps to morphisms in Module R, use SemimoduleCat.ofHom.

Similarly, given an isomorphism f : M ≅ N use f.toLinearEquiv and given a linear equiv f : M ≃ₗ[R] N, use f.toModuleIso.

structure SemimoduleCat (R : Type u) [Semiring R] :
Type (max u (v + 1))

The category of R-semimodules 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 isAddCommMonoid structure (contrary to what we do for all module structures in mathlib), which creates some difficulties down the road.

Instances For
    @[reducible, inline]
    abbrev SemimoduleCat.of (R : Type u) [Semiring R] (X : Type v) [AddCommMonoid X] [Module R X] :

    The object in the category of R-algebras associated to a type equipped with the appropriate typeclasses. This is the preferred way to construct a term of SemimoduleCat R.

    Equations
      Instances For
        theorem SemimoduleCat.coe_of (R : Type u) [Semiring R] (X : Type v) [Semiring X] [Module R X] :
        (of R X) = X
        structure SemimoduleCat.Hom {R : Type u} [Semiring R] (M N : SemimoduleCat R) :

        The type of morphisms in SemimoduleCat R.

        • hom' : M →ₗ[R] N

          The underlying linear map.

        Instances For
          theorem SemimoduleCat.Hom.ext_iff {R : Type u} {inst✝ : Semiring R} {M N : SemimoduleCat R} {x y : M.Hom N} :
          x = y x.hom' = y.hom'
          theorem SemimoduleCat.Hom.ext {R : Type u} {inst✝ : Semiring R} {M N : SemimoduleCat R} {x y : M.Hom N} (hom' : x.hom' = y.hom') :
          x = y
          @[reducible, inline]
          abbrev SemimoduleCat.Hom.hom {R : Type u} [Semiring R] {A B : SemimoduleCat R} (f : A.Hom B) :
          A →ₗ[R] B

          Turn a morphism in SemimoduleCat back into a LinearMap.

          Equations
            Instances For
              @[reducible, inline]
              abbrev SemimoduleCat.ofHom {R : Type u} [Semiring R] {X Y : Type v} [AddCommMonoid X] [Module R X] [AddCommMonoid Y] [Module R Y] (f : X →ₗ[R] Y) :
              of R X of R Y

              Typecheck a LinearMap as a morphism in SemimoduleCat.

              Equations
                Instances For
                  def SemimoduleCat.Hom.Simps.hom {R : Type u} [Semiring R] (A B : SemimoduleCat R) (f : A.Hom B) :
                  A →ₗ[R] B

                  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 SemimoduleCat.hom_ext {R : Type u} [Semiring R] {M N : SemimoduleCat R} {f g : M N} (hf : Hom.hom f = Hom.hom g) :
                      f = g
                      theorem SemimoduleCat.hom_ext_iff {R : Type u} [Semiring R] {M N : SemimoduleCat R} {f g : M N} :

                      Convenience shortcut for SemimoduleCat.hom_bijective.injective.

                      Convenience shortcut for SemimoduleCat.hom_bijective.surjective.

                      @[simp]
                      theorem SemimoduleCat.hom_ofHom {R : Type u} [Semiring R] {X Y : Type v} [AddCommMonoid X] [Module R X] [AddCommMonoid Y] [Module R Y] (f : X →ₗ[R] Y) :
                      @[simp]
                      theorem SemimoduleCat.ofHom_hom {R : Type u} [Semiring R] {M N : SemimoduleCat R} (f : M N) :
                      @[simp]
                      theorem SemimoduleCat.ofHom_comp {R : Type u} [Semiring R] {M N O : Type v} [AddCommMonoid M] [AddCommMonoid N] [AddCommMonoid O] [Module R M] [Module R N] [Module R O] (f : M →ₗ[R] N) (g : N →ₗ[R] O) :
                      def SemimoduleCat.homEquiv {R : Type u} [Semiring R] {M N : SemimoduleCat R} :
                      (M N) (M →ₗ[R] N)

                      SemimoduleCat.Hom.hom bundled as an Equiv.

                      Equations
                        Instances For
                          @[simp]
                          theorem SemimoduleCat.of_coe (R : Type u) [Semiring R] (X : SemimoduleCat R) :
                          of R X = X

                          Reinterpreting a linear map in the category of R-modules

                          Equations
                            Instances For
                              def LinearEquiv.toModuleIsoₛ {R : Type u} [Semiring R] {X₁ X₂ : Type v} {g₁ : AddCommMonoid X₁} {g₂ : AddCommMonoid 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
                                  @[simp]
                                  theorem LinearEquiv.toModuleIsoₛ_inv {R : Type u} [Semiring R] {X₁ X₂ : Type v} {g₁ : AddCommMonoid X₁} {g₂ : AddCommMonoid X₂} {m₁ : Module R X₁} {m₂ : Module R X₂} (e : X₁ ≃ₗ[R] X₂) :
                                  @[simp]
                                  theorem LinearEquiv.toModuleIsoₛ_hom {R : Type u} [Semiring R] {X₁ X₂ : Type v} {g₁ : AddCommMonoid X₁} {g₂ : AddCommMonoid X₂} {m₁ : Module R X₁} {m₂ : Module R X₂} (e : X₁ ≃ₗ[R] X₂) :
                                  def CategoryTheory.Iso.toLinearEquivₛ {R : Type u} [Semiring R] {X Y : SemimoduleCat R} (i : X Y) :
                                  X ≃ₗ[R] Y

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

                                  Equations
                                    Instances For

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

                                      Equations
                                        Instances For
                                          instance SemimoduleCat.instAddHom {R : Type u} [Semiring R] {M N : SemimoduleCat R} :
                                          Add (M N)
                                          Equations
                                            @[simp]
                                            theorem SemimoduleCat.hom_add {R : Type u} [Semiring R] {M N : SemimoduleCat R} (f g : M N) :
                                            instance SemimoduleCat.instZeroHom {R : Type u} [Semiring R] {M N : SemimoduleCat R} :
                                            Zero (M N)
                                            Equations
                                              @[simp]
                                              theorem SemimoduleCat.hom_zero {R : Type u} [Semiring R] {M N : SemimoduleCat R} :
                                              instance SemimoduleCat.instSMulNatHom {R : Type u} [Semiring R] {M N : SemimoduleCat R} :
                                              SMul (M N)
                                              Equations
                                                @[simp]
                                                theorem SemimoduleCat.hom_nsmul {R : Type u} [Semiring R] {M N : SemimoduleCat R} (n : ) (f : M N) :
                                                Hom.hom (n f) = n Hom.hom f
                                                @[deprecated SemimoduleCat.hom_nsmul (since := "2026-01-06")]
                                                theorem SemimoduleCat.hom_zsmul {R : Type u} [Semiring R] {M N : SemimoduleCat R} (n : ) (f : M N) :
                                                Hom.hom (n f) = n Hom.hom f

                                                Alias of SemimoduleCat.hom_nsmul.

                                                @[simp]
                                                theorem SemimoduleCat.hom_sum {R : Type u} [Semiring R] {M N : SemimoduleCat R} {ι : Type u_1} (f : ι → (M N)) (s : Finset ι) :
                                                Hom.hom (∑ is, f i) = is, Hom.hom (f i)
                                                def SemimoduleCat.homAddEquiv {R : Type u} [Semiring R] {M N : SemimoduleCat R} :
                                                (M N) ≃+ (M →ₗ[R] N)

                                                SemimoduleCat.Hom.hom bundled as an additive equivalence.

                                                Equations
                                                  Instances For
                                                    @[simp]
                                                    theorem SemimoduleCat.homAddEquiv_apply {R : Type u} [Semiring R] {M N : SemimoduleCat R} (f : M.Hom N) :
                                                    instance SemimoduleCat.instSMulHom {R : Type u} [Semiring R] {M N : SemimoduleCat R} {S : Type u_1} [Monoid S] [DistribMulAction S N] [SMulCommClass R S N] :
                                                    SMul S (M N)
                                                    Equations
                                                      @[simp]
                                                      theorem SemimoduleCat.hom_smul {R : Type u} [Semiring R] {M N : SemimoduleCat R} {S : Type u_1} [Monoid S] [DistribMulAction S N] [SMulCommClass R S N] (s : S) (f : M N) :
                                                      Hom.hom (s f) = s Hom.hom f
                                                      instance SemimoduleCat.Hom.instModule {R : Type u} [Semiring R] {M N : SemimoduleCat R} {S : Type u_1} [Semiring S] [Module S N] [SMulCommClass R S N] :
                                                      Module S (M N)
                                                      Equations
                                                        def SemimoduleCat.homLinearEquiv {R : Type u} [Semiring R] {M N : SemimoduleCat R} {S : Type u_1} [Semiring S] [Module S N] [SMulCommClass R S N] :
                                                        (M N) ≃ₗ[S] M →ₗ[R] N

                                                        SemimoduleCat.Hom.hom bundled as a linear equivalence.

                                                        Equations
                                                          Instances For
                                                            @[simp]
                                                            theorem SemimoduleCat.homLinearEquiv_symm_apply {R : Type u} [Semiring R] {M N : SemimoduleCat R} {S : Type u_1} [Semiring S] [Module S N] [SMulCommClass R S N] (a✝ : M →ₗ[R] N) :
                                                            @[simp]
                                                            theorem SemimoduleCat.homLinearEquiv_apply {R : Type u} [Semiring R] {M N : SemimoduleCat R} {S : Type u_1} [Semiring S] [Module S N] [SMulCommClass R S N] (a✝ : M N) :
                                                            def SemimoduleCat.Algebra.instModuleCarrier {S₀ : Type u₀} [CommSemiring S₀] {S : Type u} [Semiring S] [Algebra S₀ S] {M : SemimoduleCat S} :
                                                            Module S₀ M

                                                            Let S be an S₀-algebra. Then S-modules are modules over S₀.

                                                            Equations
                                                              Instances For
                                                                theorem SemimoduleCat.Iso.homCongr_eq_arrowCongr {S : Type u} [CommSemiring S] {X Y X' Y' : SemimoduleCat S} (i : X X') (j : Y Y') (f : X Y) :
                                                                def SemimoduleCat.ofHom₂ {R : Type u_1} [CommSemiring R] {M N P : SemimoduleCat R} (f : M →ₗ[R] N →ₗ[R] P) :
                                                                M of R (N P)

                                                                Turn a bilinear map into a homomorphism.

                                                                Equations
                                                                  Instances For
                                                                    @[simp]
                                                                    theorem SemimoduleCat.ofHom₂_hom_apply_hom {R : Type u_1} [CommSemiring R] {M N P : SemimoduleCat R} (f : M →ₗ[R] N →ₗ[R] P) (a✝ : M) :
                                                                    Hom.hom ((Hom.hom (ofHom₂ f)) a✝) = f a✝
                                                                    def SemimoduleCat.Hom.hom₂ {R : Type u_1} [CommSemiring R] {M N P : SemimoduleCat R} (f : M of R (N P)) :
                                                                    M →ₗ[R] N →ₗ[R] P

                                                                    Turn a homomorphism into a bilinear map.

                                                                    Equations
                                                                      Instances For
                                                                        @[simp]
                                                                        theorem SemimoduleCat.Hom.hom₂_apply {R : Type u_1} [CommSemiring R] {M N P : SemimoduleCat R} (f : M of R (N P)) (a✝ : M) :
                                                                        (hom₂ f) a✝ = (ofHom homLinearEquiv).hom' (f.hom' a✝)
                                                                        @[simp]
                                                                        theorem SemimoduleCat.Hom.hom₂_ofHom₂ {R : Type u_1} [CommSemiring R] {M N P : SemimoduleCat R} (f : M →ₗ[R] N →ₗ[R] P) :
                                                                        @[simp]
                                                                        theorem SemimoduleCat.ofHom₂_hom₂ {R : Type u_1} [CommSemiring R] {M N P : SemimoduleCat R} (f : M of R (N P)) :

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