|
| 1 | +/- |
| 2 | +Copyright (c) 2023 Eric Wieser. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Eric Wieser |
| 5 | +-/ |
| 6 | +import Mathlib.CategoryTheory.Monoidal.Braided |
| 7 | +import Mathlib.CategoryTheory.Monoidal.Transport |
| 8 | +import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic |
| 9 | +import Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat |
| 10 | +import Mathlib.LinearAlgebra.QuadraticForm.TensorProduct.Isometries |
| 11 | + |
| 12 | +/-! |
| 13 | +# The monoidal category structure on quadratic R-modules |
| 14 | +
|
| 15 | +The monoidal structure is simply the structure on the underlying modules, where the tensor product |
| 16 | +of two modules is equipped with the form constructed via `QuadraticForm.tmul`. |
| 17 | +
|
| 18 | +As with the monoidal structure on `ModuleCat`, |
| 19 | +the universe level of the modules must be at least the universe level of the ring, |
| 20 | +so that we have a monoidal unit. |
| 21 | +For now, we simplify by insisting both universe levels are the same. |
| 22 | +
|
| 23 | +## Implementation notes |
| 24 | +
|
| 25 | +This file essentially mirrors `Mathlib/Algebra/Category/AlgebraCat/Monoidal.lean`. |
| 26 | +-/ |
| 27 | + |
| 28 | +suppress_compilation |
| 29 | + |
| 30 | +open CategoryTheory |
| 31 | + |
| 32 | +universe v u |
| 33 | + |
| 34 | +variable {R : Type u} [CommRing R] [Invertible (2 : R)] |
| 35 | + |
| 36 | +namespace QuadraticModuleCat |
| 37 | + |
| 38 | +open QuadraticForm |
| 39 | + |
| 40 | +namespace instMonoidalCategory |
| 41 | + |
| 42 | +/-- Auxiliary definition used to build `QuadraticModuleCat.instMonoidalCategory`. -/ |
| 43 | +@[simps! form] |
| 44 | +noncomputable abbrev tensorObj (X Y : QuadraticModuleCat.{u} R) : QuadraticModuleCat.{u} R := |
| 45 | + of (X.form.tmul Y.form) |
| 46 | + |
| 47 | +/-- Auxiliary definition used to build `QuadraticModuleCat.instMonoidalCategory`. |
| 48 | +
|
| 49 | +We want this up front so that we can re-use it to define `whiskerLeft` and `whiskerRight`. -/ |
| 50 | +noncomputable abbrev tensorHom {W X Y Z : QuadraticModuleCat.{u} R} (f : W ⟶ X) (g : Y ⟶ Z) : |
| 51 | + tensorObj W Y ⟶ tensorObj X Z := |
| 52 | + ⟨f.toIsometry.tmul g.toIsometry⟩ |
| 53 | + |
| 54 | +/-- Auxiliary definition used to build `QuadraticModuleCat.instMonoidalCategory`. -/ |
| 55 | +noncomputable abbrev associator (X Y Z : QuadraticModuleCat.{u} R) : |
| 56 | + tensorObj (tensorObj X Y) Z ≅ tensorObj X (tensorObj Y Z) := |
| 57 | + ofIso (tensorAssoc X.form Y.form Z.form) |
| 58 | + |
| 59 | +open MonoidalCategory |
| 60 | + |
| 61 | +theorem forget₂_map_associator_hom (X Y Z : QuadraticModuleCat.{u} R) : |
| 62 | + (forget₂ (QuadraticModuleCat R) (ModuleCat R)).map (associator X Y Z).hom = |
| 63 | + (α_ X.toModuleCat Y.toModuleCat Z.toModuleCat).hom := rfl |
| 64 | + |
| 65 | +theorem forget₂_map_associator_inv (X Y Z : QuadraticModuleCat.{u} R) : |
| 66 | + (forget₂ (QuadraticModuleCat R) (ModuleCat R)).map (associator X Y Z).inv = |
| 67 | + (α_ X.toModuleCat Y.toModuleCat Z.toModuleCat).inv := rfl |
| 68 | + |
| 69 | +end instMonoidalCategory |
| 70 | + |
| 71 | +open instMonoidalCategory |
| 72 | + |
| 73 | +set_option maxHeartbeats 400000 in |
| 74 | +noncomputable instance instMonoidalCategory : MonoidalCategory (QuadraticModuleCat.{u} R) := |
| 75 | + Monoidal.induced |
| 76 | + (forget₂ (QuadraticModuleCat R) (ModuleCat R)) |
| 77 | + { tensorObj := instMonoidalCategory.tensorObj |
| 78 | + μIsoSymm := fun X Y => Iso.refl _ |
| 79 | + whiskerLeft := fun X _ _ f => tensorHom (𝟙 _) f |
| 80 | + whiskerRight := @fun X₁ X₂ (f : X₁ ⟶ X₂) Y => tensorHom f (𝟙 _) |
| 81 | + tensorHom := tensorHom |
| 82 | + tensorUnit' := of (sq (R := R)) |
| 83 | + εIsoSymm := Iso.refl _ |
| 84 | + associator := associator |
| 85 | + associator_eq := fun X Y Z => by |
| 86 | + dsimp only [forget₂_obj, forget₂_map_associator_hom] |
| 87 | + simp only [eqToIso_refl, Iso.refl_trans, Iso.refl_symm, Iso.trans_hom, tensorIso_hom, |
| 88 | + Iso.refl_hom, MonoidalCategory.tensor_id] |
| 89 | + erw [Category.id_comp, Category.comp_id, MonoidalCategory.tensor_id, Category.comp_id] |
| 90 | + rfl |
| 91 | + leftUnitor := fun X => ofIso (tensorLId X.form) |
| 92 | + rightUnitor := fun X => ofIso (tensorRId X.form) } |
| 93 | + |
| 94 | +variable (R) in |
| 95 | +/-- `forget₂ (QuadraticModuleCat R) (ModuleCat R)` as a monoidal functor. -/ |
| 96 | +def toModuleCatMonoidalFunctor : MonoidalFunctor (QuadraticModuleCat.{u} R) (ModuleCat.{u} R) := |
| 97 | + Monoidal.fromInduced (forget₂ (QuadraticModuleCat R) (ModuleCat R)) _ |
| 98 | + |
| 99 | +instance : Faithful (toModuleCatMonoidalFunctor R).toFunctor := |
| 100 | + forget₂_faithful _ _ |
| 101 | + |
| 102 | +end QuadraticModuleCat |
0 commit comments