|
| 1 | +/- |
| 2 | +Copyright (c) 2020 Scott Morrison. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Scott Morrison |
| 5 | +-/ |
| 6 | +import category_theory.monoidal.category |
| 7 | + |
| 8 | +/-! |
| 9 | +# The category of monoids in a monoidal category, and modules over an internal monoid. |
| 10 | +-/ |
| 11 | + |
| 12 | +universes v u |
| 13 | + |
| 14 | +open category_theory |
| 15 | + |
| 16 | +variables (C : Type u) [category.{v} C] [monoidal_category.{v} C] |
| 17 | + |
| 18 | +/-- |
| 19 | +A monoid object internal to a monoidal category. |
| 20 | +
|
| 21 | +When the monoidal category is preadditive, this is also sometimes called an "algebra object". |
| 22 | +-/ |
| 23 | +structure Mon_ := |
| 24 | +(X : C) |
| 25 | +(one : 𝟙_ C ⟶ X) |
| 26 | +(mul : X ⊗ X ⟶ X) |
| 27 | +(one_mul' : (one ⊗ 𝟙 X) ≫ mul = (λ_ X).hom . obviously) |
| 28 | +(mul_one' : (𝟙 X ⊗ one) ≫ mul = (ρ_ X).hom . obviously) |
| 29 | +-- Obviously there is some flexibility stating this axiom. |
| 30 | +-- This one has left- and right-hand sides matching the statement of `monoid.mul_assoc`, |
| 31 | +-- and chooses to place the associator on the right-hand side. |
| 32 | +-- The heuristic is that unitors and associators "don't have much weight". |
| 33 | +(mul_assoc' : (mul ⊗ 𝟙 X) ≫ mul = (α_ X X X).hom ≫ (𝟙 X ⊗ mul) ≫ mul . obviously) |
| 34 | + |
| 35 | +restate_axiom Mon_.one_mul' |
| 36 | +restate_axiom Mon_.mul_one' |
| 37 | +restate_axiom Mon_.mul_assoc' |
| 38 | +attribute [simp, reassoc] Mon_.one_mul Mon_.mul_one Mon_.mul_assoc |
| 39 | + |
| 40 | +namespace Mon_ |
| 41 | + |
| 42 | +variables {C} |
| 43 | + |
| 44 | +variables {M : Mon_ C} |
| 45 | + |
| 46 | +lemma assoc_flip : (𝟙 M.X ⊗ M.mul) ≫ M.mul = (α_ M.X M.X M.X).inv ≫ (M.mul ⊗ 𝟙 M.X) ≫ M.mul := |
| 47 | +by simp |
| 48 | + |
| 49 | +/-- A morphism of monoid objects. -/ |
| 50 | +@[ext] |
| 51 | +structure hom (M N : Mon_ C) := |
| 52 | +(hom : M.X ⟶ N.X) |
| 53 | +(one_hom' : M.one ≫ hom = N.one . obviously) |
| 54 | +(mul_hom' : M.mul ≫ hom = (hom ⊗ hom) ≫ N.mul . obviously) |
| 55 | + |
| 56 | +restate_axiom hom.one_hom' |
| 57 | +restate_axiom hom.mul_hom' |
| 58 | +attribute [simp, reassoc] hom.one_hom hom.mul_hom |
| 59 | + |
| 60 | +/-- The identity morphism on a monoid object. -/ |
| 61 | +@[simps] |
| 62 | +def id (M : Mon_ C) : hom M M := |
| 63 | +{ hom := 𝟙 M.X, } |
| 64 | + |
| 65 | +instance hom_inhabited (M : Mon_ C) : inhabited (hom M M) := ⟨id M⟩ |
| 66 | + |
| 67 | +/-- Composition of morphisms of monoid objects. -/ |
| 68 | +@[simps] |
| 69 | +def comp {M N O : Mon_ C} (f : hom M N) (g : hom N O) : hom M O := |
| 70 | +{ hom := f.hom ≫ g.hom, } |
| 71 | + |
| 72 | +instance : category (Mon_ C) := |
| 73 | +{ hom := λ M N, hom M N, |
| 74 | + id := id, |
| 75 | + comp := λ M N O f g, comp f g, } |
| 76 | + |
| 77 | +@[simp] lemma id_hom' (M : Mon_ C) : (𝟙 M : hom M M).hom = 𝟙 M.X := rfl |
| 78 | +@[simp] lemma comp_hom' {M N K : Mon_ C} (f : M ⟶ N) (g : N ⟶ K) : |
| 79 | + (f ≫ g : hom M K).hom = f.hom ≫ g.hom := rfl |
| 80 | + |
| 81 | +/-- The forgetful functor from monoid objects to the ambient category. -/ |
| 82 | +def forget : Mon_ C ⥤ C := |
| 83 | +{ obj := λ A, A.X, |
| 84 | + map := λ A B f, f.hom, } |
| 85 | + |
| 86 | +end Mon_ |
| 87 | + |
| 88 | +-- PROJECT: lax monoidal functors `C ⥤ D` induce functors `Mon_ C ⥤ Mon_ D`. |
| 89 | + |
| 90 | +variables {C} |
| 91 | + |
| 92 | +/-- A module object for a monoid object, all internal to some monoidal category. -/ |
| 93 | +structure Mod (A : Mon_ C) := |
| 94 | +(X : C) |
| 95 | +(act : A.X ⊗ X ⟶ X) |
| 96 | +(one_act' : (A.one ⊗ 𝟙 X) ≫ act = (λ_ X).hom . obviously) |
| 97 | +(assoc' : (A.mul ⊗ 𝟙 X) ≫ act = (α_ A.X A.X X).hom ≫ (𝟙 A.X ⊗ act) ≫ act . obviously) |
| 98 | + |
| 99 | +restate_axiom Mod.one_act' |
| 100 | +restate_axiom Mod.assoc' |
| 101 | +attribute [simp, reassoc] Mod.one_act Mod.assoc |
| 102 | + |
| 103 | +namespace Mod |
| 104 | + |
| 105 | +variables {A : Mon_ C} (M : Mod A) |
| 106 | + |
| 107 | +lemma assoc_flip : (𝟙 A.X ⊗ M.act) ≫ M.act = (α_ A.X A.X M.X).inv ≫ (A.mul ⊗ 𝟙 M.X) ≫ M.act := |
| 108 | +by simp |
| 109 | + |
| 110 | +/-- A morphism of module objects. -/ |
| 111 | +@[ext] |
| 112 | +structure hom (M N : Mod A) := |
| 113 | +(hom : M.X ⟶ N.X) |
| 114 | +(act_hom' : M.act ≫ hom = (𝟙 A.X ⊗ hom) ≫ N.act . obviously) |
| 115 | + |
| 116 | +restate_axiom hom.act_hom' |
| 117 | +attribute [simp, reassoc] hom.act_hom |
| 118 | + |
| 119 | +/-- The identity morphism on a module object. -/ |
| 120 | +@[simps] |
| 121 | +def id (M : Mod A) : hom M M := |
| 122 | +{ hom := 𝟙 M.X, } |
| 123 | + |
| 124 | +instance hom_inhabited (M : Mod A) : inhabited (hom M M) := ⟨id M⟩ |
| 125 | + |
| 126 | +/-- Composition of module object morphisms. -/ |
| 127 | +@[simps] |
| 128 | +def comp {M N O : Mod A} (f : hom M N) (g : hom N O) : hom M O := |
| 129 | +{ hom := f.hom ≫ g.hom, } |
| 130 | + |
| 131 | +instance : category (Mod A) := |
| 132 | +{ hom := λ M N, hom M N, |
| 133 | + id := id, |
| 134 | + comp := λ M N O f g, comp f g, } |
| 135 | + |
| 136 | +@[simp] lemma id_hom' (M : Mod A) : (𝟙 M : hom M M).hom = 𝟙 M.X := rfl |
| 137 | +@[simp] lemma comp_hom' {M N K : Mod A} (f : M ⟶ N) (g : N ⟶ K) : |
| 138 | + (f ≫ g : hom M K).hom = f.hom ≫ g.hom := rfl |
| 139 | + |
| 140 | +variables (A) |
| 141 | + |
| 142 | +/-- A monoid object as a module over itself. -/ |
| 143 | +@[simps] |
| 144 | +def regular : Mod A := |
| 145 | +{ X := A.X, |
| 146 | + act := A.mul, } |
| 147 | + |
| 148 | +instance : inhabited (Mod A) := ⟨regular A⟩ |
| 149 | + |
| 150 | +open category_theory.monoidal_category |
| 151 | + |
| 152 | +/-- |
| 153 | +A morphism of monoid objects induces a "restriction" or "comap" functor |
| 154 | +between the categories of module objects. |
| 155 | +-/ |
| 156 | +@[simps] |
| 157 | +def comap {A B : Mon_ C} (f : A ⟶ B) : Mod B ⥤ Mod A := |
| 158 | +{ obj := λ M, |
| 159 | + { X := M.X, |
| 160 | + act := (f.hom ⊗ 𝟙 M.X) ≫ M.act, |
| 161 | + one_act' := |
| 162 | + begin |
| 163 | + slice_lhs 1 2 { rw [←comp_tensor_id], }, |
| 164 | + rw [f.one_hom, one_act], |
| 165 | + end, |
| 166 | + assoc' := |
| 167 | + begin |
| 168 | + -- oh, for homotopy.io in a widget! |
| 169 | + slice_rhs 2 3 { rw [id_tensor_comp_tensor_id, ←tensor_id_comp_id_tensor], }, |
| 170 | + rw id_tensor_comp, |
| 171 | + slice_rhs 4 5 { rw Mod.assoc_flip, }, |
| 172 | + slice_rhs 3 4 { rw associator_inv_naturality, }, |
| 173 | + slice_rhs 2 3 { rw [←tensor_id, associator_inv_naturality], }, |
| 174 | + slice_rhs 1 3 { rw [iso.hom_inv_id_assoc], }, |
| 175 | + slice_rhs 1 2 { rw [←comp_tensor_id, tensor_id_comp_id_tensor], }, |
| 176 | + slice_rhs 1 2 { rw [←comp_tensor_id, ←f.mul_hom], }, |
| 177 | + rw [comp_tensor_id, category.assoc], |
| 178 | + end, }, |
| 179 | + map := λ M N g, |
| 180 | + { hom := g.hom, |
| 181 | + act_hom' := |
| 182 | + begin |
| 183 | + dsimp, |
| 184 | + slice_rhs 1 2 { rw [id_tensor_comp_tensor_id, ←tensor_id_comp_id_tensor], }, |
| 185 | + slice_rhs 2 3 { rw ←g.act_hom, }, |
| 186 | + rw category.assoc, |
| 187 | + end }, } |
| 188 | + |
| 189 | +-- Lots more could be said about `comap`, e.g. how it interacts with |
| 190 | +-- identities, compositions, and equalities of monoid object morphisms. |
| 191 | + |
| 192 | +end Mod |
| 193 | + |
| 194 | +/-! |
| 195 | +Projects: |
| 196 | +* Check that `Mon_ Mon ≌ CommMon`, via the Eckmann-Hilton argument. |
| 197 | + (You'll have to hook up the cartesian monoidal structure on `Mon` first, available in #3463) |
| 198 | +* Check that `Mon_ Top ≌ [bundled topological monoids]`. |
| 199 | +* Check that `Mon_ AddCommGroup ≌ Ring`. |
| 200 | + (You'll have to hook up the monoidal structure on `AddCommGroup`. |
| 201 | + Currently we have the monoidal structure on `Module R`; perhaps one could specialize to `R = ℤ` |
| 202 | + and transport the monoidal structure across an equivalence? This sounds like some work!) |
| 203 | +* Check that `Mon_ (Module R) ≌ Algebra R`. |
| 204 | +* Show that if `C` is braided (see #3550) then `Mon_ C` is naturally monoidal. |
| 205 | +* Can you transport this monoidal structure to `Ring` or `Algebra R`? |
| 206 | + How does it compare to the "native" one? |
| 207 | +-/ |
0 commit comments