This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(category_theory): monoidal natural transformations and discrete …
…monoidal categories (#4112) Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
- Loading branch information
Showing
10 changed files
with
210 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/- | ||
Copyright (c) 2020 Scott Morrison. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Scott Morrison | ||
-/ | ||
import category_theory.monoidal.natural_transformation | ||
import category_theory.discrete_category | ||
import algebra.group.hom | ||
|
||
/-! | ||
# Monoids as discrete monoidal categories | ||
The discrete category on a monoid is a monoidal category. | ||
Multiplicative morphisms induced monoidal functors. | ||
-/ | ||
|
||
universes u | ||
|
||
open category_theory | ||
open category_theory.discrete | ||
|
||
variables (M : Type u) [monoid M] | ||
|
||
namespace category_theory | ||
|
||
instance monoid_discrete : monoid (discrete M) := by { dsimp [discrete], apply_instance } | ||
|
||
instance : monoidal_category (discrete M) := | ||
{ tensor_unit := 1, | ||
tensor_obj := λ X Y, X * Y, | ||
tensor_hom := λ W X Y Z f g, eq_to_hom (by rw [eq_of_hom f, eq_of_hom g]), | ||
left_unitor := λ X, eq_to_iso (one_mul X), | ||
right_unitor := λ X, eq_to_iso (mul_one X), | ||
associator := λ X Y Z, eq_to_iso (mul_assoc _ _ _), } | ||
|
||
variables {M} {N : Type u} [monoid N] | ||
|
||
/-- | ||
A multiplicative morphism between monoids gives a monoidal functor between the corresponding | ||
discrete monoidal categories. | ||
-/ | ||
def discrete.monoidal_functor (F : M →* N) : monoidal_functor (discrete M) (discrete N) := | ||
{ obj := F, | ||
map := λ X Y f, eq_to_hom (F.congr_arg (eq_of_hom f)), | ||
ε := eq_to_hom F.map_one.symm, | ||
μ := λ X Y, eq_to_hom (F.map_mul X Y).symm, } | ||
|
||
variables {K : Type u} [monoid K] | ||
|
||
/-- | ||
The monoidal natural isomorphism corresponding to composing two multiplicative morphisms. | ||
-/ | ||
def discrete.monoidal_functor_comp (F : M →* N) (G : N →* K) : | ||
discrete.monoidal_functor F ⊗⋙ discrete.monoidal_functor G ≅ | ||
discrete.monoidal_functor (G.comp F) := | ||
{ hom := { app := λ X, 𝟙 _, }, | ||
inv := { app := λ X, 𝟙 _, }, } | ||
|
||
end category_theory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
src/category_theory/monoidal/natural_transformation.lean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/- | ||
Copyright (c) 2020 Scott Morrison. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Scott Morrison | ||
-/ | ||
import category_theory.monoidal.functor | ||
import category_theory.full_subcategory | ||
|
||
/-! | ||
# Monoidal natural transformations | ||
Natural transformations between (lax) monoidal functors must satisfy | ||
an additional compatibility relation with the tensorators: | ||
`F.μ X Y ≫ app (X ⊗ Y) = (app X ⊗ app Y) ≫ G.μ X Y`. | ||
(Lax) monoidal functors between a fixed pair of monoidal categories | ||
themselves form a category. | ||
-/ | ||
|
||
open category_theory | ||
|
||
universes v₁ v₂ v₃ u₁ u₂ u₃ | ||
|
||
open category_theory.category | ||
open category_theory.functor | ||
|
||
namespace category_theory | ||
|
||
open monoidal_category | ||
|
||
variables {C : Type u₁} [category.{v₁} C] [monoidal_category.{v₁} C] | ||
{D : Type u₂} [category.{v₂} D] [monoidal_category.{v₂} D] | ||
|
||
/-- | ||
A monoidal natural transformation is a natural transformation between (lax) monoidal functors | ||
additionally satisfying: | ||
`F.μ X Y ≫ app (X ⊗ Y) = (app X ⊗ app Y) ≫ G.μ X Y` | ||
-/ | ||
@[ext] | ||
structure monoidal_nat_trans (F G : lax_monoidal_functor C D) | ||
extends nat_trans F.to_functor G.to_functor := | ||
(unit' : F.ε ≫ app (𝟙_ C) = G.ε . obviously) | ||
(tensor' : ∀ X Y, F.μ _ _ ≫ app (X ⊗ Y) = (app X ⊗ app Y) ≫ G.μ _ _ . obviously) | ||
|
||
restate_axiom monoidal_nat_trans.tensor' | ||
attribute [simp, reassoc] monoidal_nat_trans.tensor | ||
restate_axiom monoidal_nat_trans.unit' | ||
attribute [simp, reassoc] monoidal_nat_trans.unit | ||
|
||
namespace monoidal_nat_trans | ||
|
||
/-- | ||
The identity monoidal natural transformation. | ||
-/ | ||
@[simps] | ||
def id (F : lax_monoidal_functor C D) : monoidal_nat_trans F F := | ||
{ ..(𝟙 F.to_functor) } | ||
|
||
instance (F : lax_monoidal_functor C D) : inhabited (monoidal_nat_trans F F) := ⟨id F⟩ | ||
|
||
/-- | ||
Vertical composition of monoidal natural transformations. | ||
-/ | ||
@[simps] | ||
def vcomp {F G H : lax_monoidal_functor C D} | ||
(α : monoidal_nat_trans F G) (β : monoidal_nat_trans G H) : monoidal_nat_trans F H := | ||
{ ..(nat_trans.vcomp α.to_nat_trans β.to_nat_trans) } | ||
|
||
instance category_lax_monoidal_functor : category (lax_monoidal_functor C D) := | ||
{ hom := monoidal_nat_trans, | ||
id := id, | ||
comp := λ F G H α β, vcomp α β, } | ||
|
||
instance category_monoidal_functor : category (monoidal_functor C D) := | ||
induced_category.category monoidal_functor.to_lax_monoidal_functor | ||
|
||
variables {E : Type u₃} [category.{v₃} E] [monoidal_category.{v₃} E] | ||
|
||
/-- | ||
Horizontal composition of monoidal natural transformations. | ||
-/ | ||
@[simps] | ||
def hcomp {F G : lax_monoidal_functor C D} {H K : lax_monoidal_functor D E} | ||
(α : monoidal_nat_trans F G) (β : monoidal_nat_trans H K) : | ||
monoidal_nat_trans (F ⊗⋙ H) (G ⊗⋙ K) := | ||
{ unit' := | ||
begin | ||
dsimp, simp, | ||
conv_lhs { rw [←K.to_functor.map_comp, α.unit], }, | ||
end, | ||
tensor' := λ X Y, | ||
begin | ||
dsimp, simp, | ||
conv_lhs { rw [←K.to_functor.map_comp, α.tensor, K.to_functor.map_comp], }, | ||
end, | ||
..(nat_trans.hcomp α.to_nat_trans β.to_nat_trans) } | ||
|
||
end monoidal_nat_trans | ||
|
||
end category_theory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters