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
,
- if
M N : ModuleCat R
, simply usef
; - if
M : ModuleCat R
andN
is an unbundledR
-module, use↿f
orasHomLeft f
; - if
M
is an unbundledR
-module andN : ModuleCat R
, use↾f
orasHomRight f
; - if
M
andN
are unbundledR
-modules, use↟f
orasHom f
.
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
.
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.
- carrier : Type v
the underlying type of an object in
ModuleCat R
- isAddCommGroup : AddCommGroup ↑self
- isModule : Module R ↑self
Instances For
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
- ModuleCatMax R = ModuleCat R
Instances For
Equations
- ModuleCat.instCoeSortType R = { coe := ModuleCat.carrier }
Equations
Equations
- ModuleCat.instFunLikeHomCarrier R = LinearMap.instFunLike
Equations
- ⋯ = ⋯
Equations
- One or more equations did not get rendered due to their size.
Equations
- ModuleCat.instAddCommGroupObjForget R = inferInstance
Equations
- ModuleCat.instModuleObjForget R = inferInstance
Equations
- One or more equations did not get rendered due to their size.
The object in the category of R-modules associated to an R-module
Equations
- ModuleCat.of R X = ModuleCat.mk X
Instances For
Typecheck a LinearMap
as a morphism in Module R
.
Equations
- ModuleCat.ofHom f = f
Instances For
Equations
- ModuleCat.instInhabited R = { default := ModuleCat.of R PUnit.{?u.15 + 1} }
Equations
- ModuleCat.ofUnique R = i
Forgetting to the underlying type and then building the bundled object returns the original module.
Equations
- M.ofSelfIso = { hom := CategoryTheory.CategoryStruct.id M, inv := CategoryTheory.CategoryStruct.id M, hom_inv_id := ⋯, inv_hom_id := ⋯ }
Instances For
Equations
- ⋯ = ⋯
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
- ModuleCat.«term↟_» = Lean.ParserDescr.node `ModuleCat.term↟_ 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "↟") (Lean.ParserDescr.cat `term 1024))
Instances For
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
- ModuleCat.«term↾_» = Lean.ParserDescr.node `ModuleCat.term↾_ 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "↾") (Lean.ParserDescr.cat `term 1024))
Instances For
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
- ModuleCat.«term↿_» = Lean.ParserDescr.node `ModuleCat.term↿_ 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "↿") (Lean.ParserDescr.cat `term 1024))
Instances For
Build an isomorphism in the category Module R
from a LinearEquiv
between Module
s.
Equations
- e.toModuleIso = { hom := ↑e, inv := ↑e.symm, hom_inv_id := ⋯, inv_hom_id := ⋯ }
Instances For
Build an isomorphism in the category ModuleCat R
from a LinearEquiv
between Module
s.
Equations
- e.toModuleIso'Left = e.toModuleIso
Instances For
Build an isomorphism in the category ModuleCat R
from a LinearEquiv
between Module
s.
Equations
- e.toModuleIso'Right = e.toModuleIso
Instances For
Build a LinearEquiv
from an isomorphism in the category ModuleCat R
.
Equations
- i.toLinearEquiv = LinearEquiv.ofLinear i.hom i.inv ⋯ ⋯
Instances For
linear equivalences between Module
s 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
Equations
- ModuleCat.instAddCommGroupHom = LinearMap.addCommGroup
Equations
- ModuleCat.instPreadditive = { homGroup := inferInstance, add_comp := ⋯, comp_add := ⋯ }
Equations
- ⋯ = ⋯
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
Instances For
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
- ModuleCat.mkOfSMul' x = A
Instances For
Equations
- ModuleCat.instAddCommGroupαMkOfSMul' φ = id inferInstance
Equations
- ModuleCat.instSMulαAddCommGroupMkOfSMul' φ = { smul := fun (r : R) (x : ↑A) => (let_fun this := φ r; this) x }
Equations
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
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
- ModuleCat.homMk φ hφ = { toFun := ⇑φ, map_add' := ⋯, map_smul' := ⋯ }
Instances For
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
@[simp]
lemmas for LinearMap.comp
and categorical identities.