Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 7013e5b

Browse files
committed
feat(category_theory/internal): commutative monoid objects (#4186)
This reprises a series of our recent PRs on monoid objects in monoidal categories, developing the same material for commutative monoid objects in braided categories. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 5b143ff commit 7013e5b

File tree

11 files changed

+598
-139
lines changed

11 files changed

+598
-139
lines changed

src/category_theory/monad/equiv_mon.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Adam Topaz
55
-/
66
import category_theory.monad.bundled
77
import category_theory.monoidal.End
8-
import category_theory.monoidal.internal
8+
import category_theory.monoidal.Mon_
99
import category_theory.category.Cat
1010

1111
/-!
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
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.braided
7+
import category_theory.monoidal.Mon_
8+
9+
/-!
10+
# The category of commutative monoids in a braided monoidal category.
11+
-/
12+
13+
universes v₁ v₂ u₁ u₂
14+
15+
open category_theory
16+
open category_theory.monoidal_category
17+
18+
variables (C : Type u₁) [category.{v₁} C] [monoidal_category.{v₁} C] [braided_category.{v₁} C]
19+
20+
/--
21+
A commutative monoid object internal to a monoidal category.
22+
-/
23+
structure CommMon_ extends Mon_ C :=
24+
(mul_comm' : (β_ _ _).hom ≫ mul = mul . obviously)
25+
26+
restate_axiom CommMon_.mul_comm'
27+
attribute [simp, reassoc] CommMon_.mul_comm
28+
29+
namespace CommMon_
30+
31+
/--
32+
The trivial commutative monoid object. We later show this is initial in `CommMon_ C`.
33+
-/
34+
@[simps]
35+
def trivial : CommMon_ C :=
36+
{ mul_comm' := begin dsimp, rw [braiding_left_unitor, unitors_equal], end
37+
..Mon_.trivial C }
38+
39+
instance : inhabited (CommMon_ C) := ⟨trivial C⟩
40+
41+
variables {C} {M : CommMon_ C}
42+
43+
instance : category (CommMon_ C) :=
44+
induced_category.category CommMon_.to_Mon_
45+
46+
@[simp] lemma id_hom (A : CommMon_ C) : Mon_.hom.hom (𝟙 A) = 𝟙 A.X := rfl
47+
@[simp] lemma comp_hom {R S T : CommMon_ C} (f : R ⟶ S) (g : S ⟶ T) :
48+
Mon_.hom.hom (f ≫ g) = f.hom ≫ g.hom := rfl
49+
50+
section
51+
variables (C)
52+
53+
/-- The forgetful functor from commutative monoid objects to monoid objects. -/
54+
@[derive [full, faithful]]
55+
def forget₂_Mon_ : CommMon_ C ⥤ Mon_ C :=
56+
induced_functor CommMon_.to_Mon_
57+
58+
@[simp] lemma forget₂_Mon_obj_one (A : CommMon_ C) : ((forget₂_Mon_ C).obj A).one = A.one := rfl
59+
@[simp] lemma forget₂_Mon_obj_mul (A : CommMon_ C) : ((forget₂_Mon_ C).obj A).mul = A.mul := rfl
60+
@[simp] lemma forget₂_Mon_map_hom {A B : CommMon_ C} (f : A ⟶ B) :
61+
((forget₂_Mon_ C).map f).hom = f.hom := rfl
62+
63+
end
64+
65+
instance unique_hom_from_trivial (A : CommMon_ C) : unique (trivial C ⟶ A) :=
66+
Mon_.unique_hom_from_trivial A.to_Mon_
67+
68+
open category_theory.limits
69+
70+
instance : has_initial (CommMon_ C) :=
71+
has_initial_of_unique (trivial C)
72+
73+
end CommMon_
74+
75+
namespace category_theory.lax_braided_functor
76+
77+
variables {C} {D : Type u₂} [category.{v₂} D] [monoidal_category.{v₂} D] [braided_category.{v₂} D]
78+
79+
/--
80+
A lax braided functor takes commutative monoid objects to commutative monoid objects.
81+
82+
That is, a lax braided functor `F : C ⥤ D` induces a functor `CommMon_ C ⥤ CommMon_ D`.
83+
-/
84+
@[simps]
85+
def map_CommMon (F : lax_braided_functor C D) : CommMon_ C ⥤ CommMon_ D :=
86+
{ obj := λ A,
87+
{ mul_comm' :=
88+
begin
89+
dsimp,
90+
have := F.braided,
91+
slice_lhs 1 2 { rw ←this, },
92+
slice_lhs 2 3 { rw [←category_theory.functor.map_comp, A.mul_comm], },
93+
end,
94+
..F.to_lax_monoidal_functor.map_Mon.obj A.to_Mon_ },
95+
map := λ A B f, F.to_lax_monoidal_functor.map_Mon.map f, }
96+
97+
variables (C) (D)
98+
99+
/-- `map_CommMon` is functorial in the lax braided functor. -/
100+
def map_CommMon_functor : (lax_braided_functor C D) ⥤ (CommMon_ C ⥤ CommMon_ D) :=
101+
{ obj := map_CommMon,
102+
map := λ F G α,
103+
{ app := λ A,
104+
{ hom := α.app A.X, } } }
105+
106+
end category_theory.lax_braided_functor
107+
108+
namespace CommMon_
109+
110+
open category_theory.lax_braided_functor
111+
112+
namespace equiv_lax_braided_functor_punit
113+
114+
/-- Implementation of `CommMon_.equiv_lax_braided_functor_punit`. -/
115+
@[simps]
116+
def lax_braided_to_CommMon : lax_braided_functor (discrete punit) C ⥤ CommMon_ C :=
117+
{ obj := λ F, (F.map_CommMon : CommMon_ _ ⥤ CommMon_ C).obj (trivial (discrete punit)),
118+
map := λ F G α, ((map_CommMon_functor (discrete punit) C).map α).app _ }
119+
120+
/-- Implementation of `CommMon_.equiv_lax_braided_functor_punit`. -/
121+
@[simps]
122+
def CommMon_to_lax_braided : CommMon_ C ⥤ lax_braided_functor (discrete punit) C :=
123+
{ obj := λ A,
124+
{ obj := λ _, A.X,
125+
map := λ _ _ _, 𝟙 _,
126+
ε := A.one,
127+
μ := λ _ _, A.mul,
128+
map_id' := λ _, rfl,
129+
map_comp' := λ _ _ _ _ _, (category.id_comp (𝟙 A.X)).symm, },
130+
map := λ A B f,
131+
{ app := λ _, f.hom,
132+
naturality' := λ _ _ _, by { dsimp, rw [category.id_comp, category.comp_id], },
133+
unit' := f.one_hom,
134+
tensor' := λ _ _, f.mul_hom, }, }
135+
136+
/-- Implementation of `CommMon_.equiv_lax_braided_functor_punit`. -/
137+
@[simps {rhs_md:=semireducible}]
138+
def unit_iso :
139+
𝟭 (lax_braided_functor (discrete punit) C) ≅ lax_braided_to_CommMon C ⋙ CommMon_to_lax_braided C :=
140+
nat_iso.of_components (λ F, lax_braided_functor.mk_iso
141+
(monoidal_nat_iso.of_components
142+
(λ _, F.to_lax_monoidal_functor.to_functor.map_iso (eq_to_iso (by ext)))
143+
(by tidy) (by tidy) (by tidy)))
144+
(by tidy)
145+
146+
/-- Implementation of `CommMon_.equiv_lax_braided_functor_punit`. -/
147+
@[simps {rhs_md:=semireducible}]
148+
def counit_iso : CommMon_to_lax_braided C ⋙ lax_braided_to_CommMon C ≅ 𝟭 (CommMon_ C) :=
149+
nat_iso.of_components (λ F, { hom := { hom := 𝟙 _, }, inv := { hom := 𝟙 _, } })
150+
(by tidy)
151+
152+
end equiv_lax_braided_functor_punit
153+
154+
open equiv_lax_braided_functor_punit
155+
156+
/--
157+
Commutative monoid objects in `C` are "just" braided lax monoidal functors from the trivial
158+
braided monoidal category to `C`.
159+
-/
160+
@[simps]
161+
def equiv_lax_braided_functor_punit : lax_braided_functor (discrete punit) C ≌ CommMon_ C :=
162+
{ functor := lax_braided_to_CommMon C,
163+
inverse := CommMon_to_lax_braided C,
164+
unit_iso := unit_iso C,
165+
counit_iso := counit_iso C, }
166+
167+
end CommMon_

src/category_theory/monoidal/Mod.lean

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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.Mon_
7+
8+
/-!
9+
# The category of module objects over a monoid object.
10+
-/
11+
12+
universes v₁ v₂ u₁ u₂
13+
14+
open category_theory
15+
open category_theory.monoidal_category
16+
17+
variables (C : Type u₁) [category.{v₁} C] [monoidal_category.{v₁} C]
18+
19+
variables {C}
20+
21+
/-- A module object for a monoid object, all internal to some monoidal category. -/
22+
structure Mod (A : Mon_ C) :=
23+
(X : C)
24+
(act : A.X ⊗ X ⟶ X)
25+
(one_act' : (A.one ⊗ 𝟙 X) ≫ act = (λ_ X).hom . obviously)
26+
(assoc' : (A.mul ⊗ 𝟙 X) ≫ act = (α_ A.X A.X X).hom ≫ (𝟙 A.X ⊗ act) ≫ act . obviously)
27+
28+
restate_axiom Mod.one_act'
29+
restate_axiom Mod.assoc'
30+
attribute [simp, reassoc] Mod.one_act Mod.assoc
31+
32+
namespace Mod
33+
34+
variables {A : Mon_ C} (M : Mod A)
35+
36+
lemma assoc_flip : (𝟙 A.X ⊗ M.act) ≫ M.act = (α_ A.X A.X M.X).inv ≫ (A.mul ⊗ 𝟙 M.X) ≫ M.act :=
37+
by simp
38+
39+
/-- A morphism of module objects. -/
40+
@[ext]
41+
structure hom (M N : Mod A) :=
42+
(hom : M.X ⟶ N.X)
43+
(act_hom' : M.act ≫ hom = (𝟙 A.X ⊗ hom) ≫ N.act . obviously)
44+
45+
restate_axiom hom.act_hom'
46+
attribute [simp, reassoc] hom.act_hom
47+
48+
/-- The identity morphism on a module object. -/
49+
@[simps]
50+
def id (M : Mod A) : hom M M :=
51+
{ hom := 𝟙 M.X, }
52+
53+
instance hom_inhabited (M : Mod A) : inhabited (hom M M) := ⟨id M⟩
54+
55+
/-- Composition of module object morphisms. -/
56+
@[simps]
57+
def comp {M N O : Mod A} (f : hom M N) (g : hom N O) : hom M O :=
58+
{ hom := f.hom ≫ g.hom, }
59+
60+
instance : category (Mod A) :=
61+
{ hom := λ M N, hom M N,
62+
id := id,
63+
comp := λ M N O f g, comp f g, }
64+
65+
@[simp] lemma id_hom' (M : Mod A) : (𝟙 M : hom M M).hom = 𝟙 M.X := rfl
66+
@[simp] lemma comp_hom' {M N K : Mod A} (f : M ⟶ N) (g : N ⟶ K) :
67+
(f ≫ g : hom M K).hom = f.hom ≫ g.hom := rfl
68+
69+
variables (A)
70+
71+
/-- A monoid object as a module over itself. -/
72+
@[simps]
73+
def regular : Mod A :=
74+
{ X := A.X,
75+
act := A.mul, }
76+
77+
instance : inhabited (Mod A) := ⟨regular A⟩
78+
79+
/-- The forgetful functor from module objects to the ambient category. -/
80+
def forget : Mod A ⥤ C :=
81+
{ obj := λ A, A.X,
82+
map := λ A B f, f.hom, }
83+
84+
open category_theory.monoidal_category
85+
86+
/--
87+
A morphism of monoid objects induces a "restriction" or "comap" functor
88+
between the categories of module objects.
89+
-/
90+
@[simps]
91+
def comap {A B : Mon_ C} (f : A ⟶ B) : Mod B ⥤ Mod A :=
92+
{ obj := λ M,
93+
{ X := M.X,
94+
act := (f.hom ⊗ 𝟙 M.X) ≫ M.act,
95+
one_act' :=
96+
begin
97+
slice_lhs 1 2 { rw [←comp_tensor_id], },
98+
rw [f.one_hom, one_act],
99+
end,
100+
assoc' :=
101+
begin
102+
-- oh, for homotopy.io in a widget!
103+
slice_rhs 2 3 { rw [id_tensor_comp_tensor_id, ←tensor_id_comp_id_tensor], },
104+
rw id_tensor_comp,
105+
slice_rhs 4 5 { rw Mod.assoc_flip, },
106+
slice_rhs 3 4 { rw associator_inv_naturality, },
107+
slice_rhs 2 3 { rw [←tensor_id, associator_inv_naturality], },
108+
slice_rhs 1 3 { rw [iso.hom_inv_id_assoc], },
109+
slice_rhs 1 2 { rw [←comp_tensor_id, tensor_id_comp_id_tensor], },
110+
slice_rhs 1 2 { rw [←comp_tensor_id, ←f.mul_hom], },
111+
rw [comp_tensor_id, category.assoc],
112+
end, },
113+
map := λ M N g,
114+
{ hom := g.hom,
115+
act_hom' :=
116+
begin
117+
dsimp,
118+
slice_rhs 1 2 { rw [id_tensor_comp_tensor_id, ←tensor_id_comp_id_tensor], },
119+
slice_rhs 2 3 { rw ←g.act_hom, },
120+
rw category.assoc,
121+
end }, }
122+
123+
-- Lots more could be said about `comap`, e.g. how it interacts with
124+
-- identities, compositions, and equalities of monoid object morphisms.
125+
126+
end Mod

0 commit comments

Comments
 (0)