Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(CategoryTheory/Monoidal): typeclasses Functor.LaxMonoidal, Functor.OplaxMonoidal and Functor.Monoidal #17904

Open
wants to merge 83 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
1f25abd
refactor
joelriou Oct 12, 2024
df206c1
wip
joelriou Oct 12, 2024
cabacc8
removed Mathlib/CategoryTheory/Monoidal/Functorial.lean
joelriou Oct 12, 2024
a327656
fixing imports
joelriou Oct 12, 2024
dc454ba
fixing the build
joelriou Oct 12, 2024
5fad806
fixing the build
joelriou Oct 13, 2024
de95d93
wip
joelriou Oct 13, 2024
800a82b
fixing the build
joelriou Oct 13, 2024
ebf4598
fixing the build
joelriou Oct 13, 2024
ea64ced
feat(CategoryTheory/Products): adding an ext lemma for morphisms in p…
joelriou Oct 14, 2024
dd67da4
fixing the build
joelriou Oct 14, 2024
edc5d94
fix
joelriou Oct 14, 2024
b56ea0e
fixing the build
joelriou Oct 14, 2024
a8f87d7
Merge remote-tracking branch 'origin/fix-prod-categories-hom' into fu…
joelriou Oct 14, 2024
1a063e6
fix
joelriou Oct 14, 2024
699004c
wip
joelriou Oct 14, 2024
90decf8
wip
joelriou Oct 14, 2024
b31ce5b
chore(CategoryTheory/Adjunction): homEquiv_unit is made local simp only
joelriou Oct 15, 2024
e881927
fix
joelriou Oct 15, 2024
c33b227
Merge remote-tracking branch 'origin/adjunction-nosimp-homequiv' into…
joelriou Oct 15, 2024
ecf68a3
fixing the build
joelriou Oct 15, 2024
f226922
fixing the build
joelriou Oct 15, 2024
265ae22
fixing the build
joelriou Oct 15, 2024
50d3e69
Merge remote-tracking branch 'origin/adjunction-nosimp-homequiv' into…
joelriou Oct 16, 2024
9d82a70
wip
joelriou Oct 16, 2024
9b44114
wip
joelriou Oct 16, 2024
c3d5e1f
wip
joelriou Oct 16, 2024
8d3bd2f
fix
joelriou Oct 16, 2024
abc740c
fix
joelriou Oct 16, 2024
cd78929
fix
joelriou Oct 16, 2024
7658c4b
fixing the build
joelriou Oct 16, 2024
6d84c22
fixing the build
joelriou Oct 16, 2024
1ca7bef
fixing the build
joelriou Oct 16, 2024
24d1b6e
fix
joelriou Oct 16, 2024
a2d9d86
fix
joelriou Oct 17, 2024
38a3394
fixing the build
joelriou Oct 17, 2024
3ab4f79
wip
joelriou Oct 17, 2024
d2c3775
wip
joelriou Oct 17, 2024
9c766fb
wip
joelriou Oct 17, 2024
33c4612
fixing the build
joelriou Oct 17, 2024
d04f3c4
wip
joelriou Oct 17, 2024
c31c07d
wip
joelriou Oct 17, 2024
42b13d2
fixing the build
joelriou Oct 18, 2024
3e2dac7
fixing the build
joelriou Oct 18, 2024
a963a3e
fixing the build
joelriou Oct 18, 2024
dfc5da5
fixing the build
joelriou Oct 18, 2024
0ab220e
fixing the build
joelriou Oct 18, 2024
392ba58
fixing the build
joelriou Oct 18, 2024
f7f9b56
removed sorries
joelriou Oct 18, 2024
ee2d432
Merge remote-tracking branch 'origin' into functor-monoidal-refactor-…
joelriou Oct 18, 2024
4dca67f
removed Monoidal/Functorial.lean
joelriou Oct 18, 2024
951bbc5
Update Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean
joelriou Oct 18, 2024
98dd7a0
Update Mathlib/CategoryTheory/Monoidal/Functor.lean
joelriou Oct 18, 2024
e3eef69
Update Mathlib/CategoryTheory/Monoidal/Braided/Basic.lean
joelriou Oct 18, 2024
8fc645c
Update Mathlib/CategoryTheory/Monoidal/Functor.lean
joelriou Oct 18, 2024
27bb015
Update Mathlib/CategoryTheory/Monoidal/Functor.lean
joelriou Oct 18, 2024
403eea6
Update Mathlib/CategoryTheory/Monoidal/Functor.lean
joelriou Oct 18, 2024
6ff39e1
Update Mathlib/CategoryTheory/Monoidal/Functor.lean
joelriou Oct 18, 2024
6023181
Update Mathlib/CategoryTheory/Monoidal/Functor.lean
joelriou Oct 18, 2024
ae961bb
Update Mathlib/CategoryTheory/Monoidal/Functor.lean
joelriou Oct 18, 2024
95ab1c9
Update Mathlib/CategoryTheory/Monoidal/NaturalTransformation.lean
joelriou Oct 18, 2024
c92b624
cleaning up
joelriou Oct 18, 2024
db50785
fix
joelriou Oct 18, 2024
cc82785
Merge remote-tracking branch 'origin' into functor-monoidal-refactor-…
joelriou Oct 18, 2024
6a379a1
fix
joelriou Oct 18, 2024
997d1f4
removed unnecesssary line
joelriou Oct 19, 2024
1cb8a4b
removed commented line
joelriou Oct 19, 2024
c956ded
Merge remote-tracking branch 'origin' into functor-monoidal-refactor-…
joelriou Oct 19, 2024
268ce8e
inverse of a monoidal category equivalence
joelriou Oct 19, 2024
51e5c4b
Update Mathlib/CategoryTheory/Monoidal/Functor.lean
joelriou Oct 22, 2024
3294488
Update Mathlib/CategoryTheory/Monoidal/Functor.lean
joelriou Oct 22, 2024
409b169
Merge remote-tracking branch 'origin' into functor-monoidal-refactor-…
joelriou Oct 22, 2024
1bc507c
fix
joelriou Oct 22, 2024
8500e0c
increasing the speed
joelriou Oct 22, 2024
47d230f
Merge remote-tracking branch 'origin' into functor-monoidal-refactor-…
joelriou Oct 22, 2024
1cc34fc
Merge remote-tracking branch 'origin' into functor-monoidal-refactor-…
joelriou Oct 22, 2024
42b3f7b
improving the speed
joelriou Oct 22, 2024
58ea18e
improving the speed
joelriou Oct 22, 2024
e3bebf6
Merge remote-tracking branch 'origin' into functor-monoidal-refactor-…
joelriou Oct 24, 2024
f2afe20
Merge remote-tracking branch 'origin' into functor-monoidal-refactor-…
joelriou Oct 24, 2024
533da36
fixing the build
joelriou Oct 24, 2024
cb130a4
Merge remote-tracking branch 'origin' into functor-monoidal-refactor-…
joelriou Oct 31, 2024
f60f6d3
fixing the build
joelriou Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,6 @@ import Mathlib.CategoryTheory.Monoidal.Free.Basic
import Mathlib.CategoryTheory.Monoidal.Free.Coherence
import Mathlib.CategoryTheory.Monoidal.Functor
import Mathlib.CategoryTheory.Monoidal.FunctorCategory
import Mathlib.CategoryTheory.Monoidal.Functorial
import Mathlib.CategoryTheory.Monoidal.Hopf_
import Mathlib.CategoryTheory.Monoidal.Internal.FunctorCategory
import Mathlib.CategoryTheory.Monoidal.Internal.Limits
Expand Down
8 changes: 1 addition & 7 deletions Mathlib/Algebra/Category/AlgebraCat/Monoidal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,8 @@ noncomputable instance instMonoidalCategory : MonoidalCategory (AlgebraCat.{u} R
leftUnitor_eq := fun _ => TensorProduct.ext' (fun _ _ => rfl)
rightUnitor_eq := fun _ => TensorProduct.ext' (fun _ _ => rfl) }

variable (R) in
/-- `forget₂ (AlgebraCat R) (ModuleCat R)` as a monoidal functor. -/
def toModuleCatMonoidalFunctor : MonoidalFunctor (AlgebraCat.{u} R) (ModuleCat.{u} R) := by
unfold instMonoidalCategory
exact Monoidal.fromInduced (forget₂ (AlgebraCat R) (ModuleCat R)) _

instance : (toModuleCatMonoidalFunctor R).Faithful :=
forget₂_faithful _ _
example : (forget₂ (AlgebraCat R) (ModuleCat R)).Monoidal := inferInstance

end

Expand Down
13 changes: 3 additions & 10 deletions Mathlib/Algebra/Category/AlgebraCat/Symmetric.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,13 @@ variable {R : Type u} [CommRing R]
namespace AlgebraCat

instance : BraidedCategory (AlgebraCat.{u} R) :=
braidedCategoryOfFaithful (toModuleCatMonoidalFunctor R)
braidedCategoryOfFaithful (forget₂ (AlgebraCat R) (ModuleCat R))
(fun X Y => (Algebra.TensorProduct.comm R X Y).toAlgebraIso)
(by aesop_cat)

variable (R) in
/-- `forget₂ (AlgebraCat R) (ModuleCat R)` as a braided functor. -/
@[simps toMonoidalFunctor]
def toModuleCatBraidedFunctor : BraidedFunctor (AlgebraCat.{u} R) (ModuleCat.{u} R) where
toMonoidalFunctor := toModuleCatMonoidalFunctor R

instance : (toModuleCatBraidedFunctor R).Faithful :=
forget₂_faithful _ _
instance : (forget₂ (AlgebraCat R) (ModuleCat R)).Braided where

instance instSymmetricCategory : SymmetricCategory (AlgebraCat.{u} R) :=
symmetricCategoryOfFaithful (toModuleCatBraidedFunctor R)
symmetricCategoryOfFaithful (forget₂ (AlgebraCat R) (ModuleCat R))

end AlgebraCat
8 changes: 4 additions & 4 deletions Mathlib/Algebra/Category/CoalgebraCat/ComonEquivalence.lean
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ theorem tensorObj_comul (K L : CoalgebraCat R) :
rw [ofComonObjCoalgebraStruct_comul]
dsimp only [Equivalence.symm_inverse, comonEquivalence_functor, toComon_obj]
simp only [Comon_.monoidal_tensorObj_comul, toComonObj_X, ModuleCat.of_coe, toComonObj_comul,
tensor_μ_eq_tensorTensorTensorComm]
tensorμ_eq_tensorTensorTensorComm]
rfl

theorem tensorHom_toLinearMap (f : M →ₗc[R] N) (g : P →ₗc[R] Q) :
Expand Down Expand Up @@ -147,7 +147,7 @@ theorem comul_tensorObj :
dsimp only [Equivalence.symm_inverse, comonEquivalence_functor, toComon_obj,
instCoalgebraStruct_comul]
simp only [Comon_.monoidal_tensorObj_comul, toComonObj_X, of_carrier, of_isAddCommGroup,
of_isModule, toComonObj_comul, of_instCoalgebra, tensor_μ_eq_tensorTensorTensorComm]
of_isModule, toComonObj_comul, of_instCoalgebra, tensorμ_eq_tensorTensorTensorComm]
rfl

theorem comul_tensorObj_tensorObj_right :
Expand All @@ -163,7 +163,7 @@ theorem comul_tensorObj_tensorObj_right :
dsimp only [Equivalence.symm_inverse, comonEquivalence_functor, toComon_obj]
simp only [instMonoidalCategoryStruct_tensorObj, ModuleCat.MonoidalCategory.tensorObj,
ModuleCat.coe_of, Comon_.monoidal_tensorObj_comul, toComonObj_X, of_carrier, of_isAddCommGroup,
of_isModule, toComonObj_comul, of_instCoalgebra, tensor_μ_eq_tensorTensorTensorComm]
of_isModule, toComonObj_comul, of_instCoalgebra, tensorμ_eq_tensorTensorTensorComm]
rfl

theorem comul_tensorObj_tensorObj_left :
Expand All @@ -179,7 +179,7 @@ theorem comul_tensorObj_tensorObj_left :
dsimp only [Equivalence.symm_inverse, comonEquivalence_functor, toComon_obj]
simp only [instMonoidalCategoryStruct_tensorObj, ModuleCat.MonoidalCategory.tensorObj,
ModuleCat.coe_of, Comon_.monoidal_tensorObj_comul, toComonObj_X, of_carrier, of_isAddCommGroup,
of_isModule, toComonObj_comul, of_instCoalgebra, tensor_μ_eq_tensorTensorTensorComm]
of_isModule, toComonObj_comul, of_instCoalgebra, tensorμ_eq_tensorTensorTensorComm]
rfl

theorem counit_tensorObj :
Expand Down
24 changes: 6 additions & 18 deletions Mathlib/Algebra/Category/FGModuleCat/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ instance monoidalPredicate_module_finite :
prop_id := Module.Finite.self R
prop_tensor := @fun X Y _ _ => Module.Finite.tensorProduct R X Y

instance : MonoidalCategory (FGModuleCat R) := by
instance instMonoidalCategory : MonoidalCategory (FGModuleCat R) := by
dsimp [FGModuleCat]
infer_instance

Expand All @@ -167,24 +167,12 @@ instance : MonoidalLinear R (FGModuleCat R) := by
dsimp [FGModuleCat]
infer_instance

/-- The forgetful functor `FGModuleCat R ⥤ Module R` as a monoidal functor. -/
def forget₂Monoidal : MonoidalFunctor (FGModuleCat R) (ModuleCat.{u} R) :=
MonoidalCategory.fullMonoidalSubcategoryInclusion _
/-- The forgetful functor `FGModuleCat R ⥤ Module R` is a monoidal functor. -/
instance : (forget₂ (FGModuleCat.{u} R) (ModuleCat.{u} R)).Monoidal :=
fullSubcategoryInclusionMonoidal _

instance forget₂Monoidal_faithful : (forget₂Monoidal R).Faithful := by
dsimp [forget₂Monoidal]
-- Porting note (#11187): was `infer_instance`
exact FullSubcategory.faithful _

instance forget₂Monoidal_additive : (forget₂Monoidal R).Additive := by
dsimp [forget₂Monoidal]
-- Porting note (#11187): was `infer_instance`
exact Functor.fullSubcategoryInclusion_additive _

instance forget₂Monoidal_linear : (forget₂Monoidal R).Linear R := by
dsimp [forget₂Monoidal]
-- Porting note (#11187): was `infer_instance`
exact Functor.fullSubcategoryInclusionLinear _ _
instance : (forget₂ (FGModuleCat.{u} R) (ModuleCat.{u} R)).Additive where
instance : (forget₂ (FGModuleCat.{u} R) (ModuleCat.{u} R)).Linear R where

theorem Iso.conj_eq_conj {V W : FGModuleCat R} (i : V ≅ W) (f : End V) :
Iso.conj i f = LinearEquiv.conj (isoToLinearEquiv i) f :=
Expand Down
Loading
Loading