The monoidal category structure on R-modules #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Mostly this uses existing machinery in linear_algebra.tensor_product.
We just need to provide a few small missing pieces to build the
monoidal_category instance.
The symmetric_category instance is in algebra.category.Module.monoidal.symmetric
to reduce imports.
Note the universe level of the modules must be at least the universe level of the ring, so that we have a monoidal unit. For now, we simplify by insisting both universe levels are the same.
We construct the monoidal closed structure on Module R in
algebra.category.Module.monoidal.closed.
If you're happy using the bundled Module R, it may be possible to mostly
use this as an interface and not need to interact much with the implementation details.
(implementation) tensor product of R-modules
Equations
- Module.monoidal_category.tensor_obj M N = Module.of R (tensor_product R ↥M ↥N)
(implementation) the associator for R-modules
Equations
- Module.monoidal_category.associator M N K = (tensor_product.assoc R ↥M ↥N ↥K).to_Module_iso
The associator_naturality and pentagon lemmas below are very slow to elaborate.
We give them some help by expressing the lemmas first non-categorically, then using
convert _aux using 1 to have the elaborator work as little as possible.
(implementation) the left unitor for R-modules
Equations
(implementation) the right unitor for R-modules
Equations
Equations
- Module.monoidal_category = {tensor_obj := Module.monoidal_category.tensor_obj _inst_1, tensor_hom := Module.monoidal_category.tensor_hom _inst_1, tensor_id' := _, tensor_comp' := _, tensor_unit := Module.of R R semiring.to_module, associator := Module.monoidal_category.associator _inst_1, associator_naturality' := _, left_unitor := Module.monoidal_category.left_unitor _inst_1, left_unitor_naturality' := _, right_unitor := Module.monoidal_category.right_unitor _inst_1, right_unitor_naturality' := _, pentagon' := _, triangle' := _}
Remind ourselves that the monoidal unit, being just R, is still a commutative ring.