Repository navigation
[Merged by Bors] - feat: CommAlgCat is cocartesian-monoidal - #25365
YaelDillies wants to merge 2 commits into
Conversation
PR summary 12bf70911dImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
| instance : MonoidalCategory (CommAlgCat.{u} R)ᵒᵖ where | ||
| tensorObj S T := op <| of R (S.unop ⊗[R] T.unop) | ||
| whiskerLeft S {T₁ T₂} f := .op <| ofHom (Algebra.TensorProduct.map (.id _ _) f.unop.hom) | ||
| whiskerRight {S₁ S₂} f T := .op <| ofHom (Algebra.TensorProduct.map f.unop.hom (.id _ _)) | ||
| tensorHom {S₁ S₂ T₁ T₂} f g := .op <| ofHom (map f.unop.hom g.unop.hom) | ||
| tensorUnit := .op (.of R R) | ||
| associator {S T U} := .op <| isoMk (Algebra.TensorProduct.assoc R R _ _ _).symm | ||
| leftUnitor S := .op <| isoMk (Algebra.TensorProduct.lid R _).symm | ||
| rightUnitor _ := .op <| isoMk (Algebra.TensorProduct.rid R R _).symm | ||
| tensorHom_def := by intros; ext <;> rfl | ||
| tensor_id := by intros; ext <;> rfl | ||
| tensor_comp := by intros; ext <;> rfl | ||
| whiskerLeft_id := by intros; ext <;> rfl | ||
| id_whiskerRight := by intros; ext <;> rfl | ||
| associator_naturality := by intros; ext <;> rfl | ||
| leftUnitor_naturality := by intros; rfl | ||
| rightUnitor_naturality := by intros; rfl | ||
| pentagon := by intros; ext <;> rfl | ||
| triangle := by intros; ext <;> rfl |
There was a problem hiding this comment.
I understand that to make sense of a cocartesian monoidal category you need to put the monoidal structure on the opposite category, but we do have CategoryTheory.monoidalCategoryOp (you need an extra import to make this work), so this proof could be something like
| instance : MonoidalCategory (CommAlgCat.{u} R)ᵒᵖ where | |
| tensorObj S T := op <| of R (S.unop ⊗[R] T.unop) | |
| whiskerLeft S {T₁ T₂} f := .op <| ofHom (Algebra.TensorProduct.map (.id _ _) f.unop.hom) | |
| whiskerRight {S₁ S₂} f T := .op <| ofHom (Algebra.TensorProduct.map f.unop.hom (.id _ _)) | |
| tensorHom {S₁ S₂ T₁ T₂} f g := .op <| ofHom (map f.unop.hom g.unop.hom) | |
| tensorUnit := .op (.of R R) | |
| associator {S T U} := .op <| isoMk (Algebra.TensorProduct.assoc R R _ _ _).symm | |
| leftUnitor S := .op <| isoMk (Algebra.TensorProduct.lid R _).symm | |
| rightUnitor _ := .op <| isoMk (Algebra.TensorProduct.rid R R _).symm | |
| tensorHom_def := by intros; ext <;> rfl | |
| tensor_id := by intros; ext <;> rfl | |
| tensor_comp := by intros; ext <;> rfl | |
| whiskerLeft_id := by intros; ext <;> rfl | |
| id_whiskerRight := by intros; ext <;> rfl | |
| associator_naturality := by intros; ext <;> rfl | |
| leftUnitor_naturality := by intros; rfl | |
| rightUnitor_naturality := by intros; rfl | |
| pentagon := by intros; ext <;> rfl | |
| triangle := by intros; ext <;> rfl | |
| letI : MonoidalCategory (CommAlgCat.{u} R) := | |
| { tensorObj S T := of R (S ⊗[R] T) | |
| whiskerLeft _ {_ _} f := ofHom (Algebra.TensorProduct.map (.id _ _) f.hom) | |
| whiskerRight {_ _} f T := ofHom (Algebra.TensorProduct.map f.hom (.id _ _)) | |
| tensorHom {_ _ _ _} f g := ofHom (map f.hom g.hom) | |
| tensorUnit := .of R R | |
| associator {_ _ _} := isoMk (Algebra.TensorProduct.assoc R R _ _ _) | |
| leftUnitor _ := isoMk (Algebra.TensorProduct.lid R _) | |
| rightUnitor _ := isoMk (Algebra.TensorProduct.rid R R _) | |
| pentagon _ _ _ _ := by dsimp; ext <;> rfl | |
| triangle _ _ := by sorry | |
| associator_naturality _ _ _ := by ext <;> rfl } | |
| monoidalCategoryOp |
and I’d argue that the monoidal structure on CommAlgCat.{u} R itself that I gave in the letI is something we could want on its own.
For reasons I don’t fully understand, though, a rfl for the triangle field does not want to go through, while it does for the opposite. So there’s something fishy.
Also, rather than making Quiver.Hom.unop_inj a local ext, maybe #25914 is onto something that would make automation better for the proofs if instead we only go with the "opposite category only" structure?
I recall seeing #21603 introducing chosen finite coproducts. Now that cartesian monoidal categories have replaced chosen finite products, maybe it could be worth looking into salvaging this, and then rather define a CocartesianMonoidalCategory instance on CommAlg.{u} R rather than a CartesianMonoidalCategory one on its opposite?
Also, and sorry to ask if this is obvious, but presumably the monoidal structure on CommAlgCat could be obtained by transfering a monoidal structure along an equivalence with CommMon_ ModuleCat + a general monoidal structure on CommMon_ C for a symetric monoidal category C (and such structures are always cocartesian monoidal).
Is the reason you’re not going with that is that it gives bad defeqs?
There was a problem hiding this comment.
This also wasn’t explicitly stated in my first comment, but defining first a monoidal structure on CommAlgCat and then on its opposite via monoidalCategoryOp does not change any of long list of defeqs you state below.
There was a problem hiding this comment.
@erdOne was against this when I suggested it because it induces duplication. His philosophy is that if C is cocartesian-monoidal, then Cᵒᵖ is cartesian-monoidal and you should just use that instead of introducing two ways to talk about things
There was a problem hiding this comment.
rather than making Quiver.Hom.unop_inj a local ext, maybe #25914 is onto something that would make automation better for the proofs if instead we only go with the "opposite category only" structure?
Indeed, and that's why Eric cut the grass under my feet by opening that PR
There was a problem hiding this comment.
presumably the monoidal structure on
CommAlgCatcould be obtained by transfering a monoidal structure along an equivalence withCommMon_ ModuleCat+ a general monoidal structure onCommMon_ Cfor a symetric monoidal categoryC(and such structures are always cocartesian monoidal).
Is the reason you’re not going with that is that it gives bad defeqs?
Yes, exactly. We really want CommAlgCat R to be "[CommRing A] + [Algebra R A], but bundled" so that we can leverage the category theory library to prove things about unbundled commutative algebras, and vice-versa
There was a problem hiding this comment.
May I convince you that replacing
CartesianMonoidalCategory (CommAlgCat R)ᵒᵖwithCocartesianMonoidalCategory (CommAlgCat R)can be done in a later refactor? Right now my job is to disentangle this mess, and you can see thatToric.Mathlib.Algebra.Category.CommAlgCat.Monoidalis quite high up in there.
If the argument behind wanting things this way is "I need this now and like this to accomodate my downstream project", this is a "how much mathlib should accomodate downstream projects" situation. I am not qualified to have any opinion here, and only maintainers are qualified to.
If maintainers decide that this is fine to get this as is and refactor later, so be it, and I’ll work on the refactor (although I’d still ask you to make the braided monoidal structure on CommAlgCat R rather than on its opposite, again via instance inferring you lose nothing).
Otherwise, we first add the relevant API.
Tl;dr don’t ask me to take a decision based on "what a downstream project needs", this is not my role.
There was a problem hiding this comment.
One of the point of
CartesianMonoidalCategoryis to get defeqs onliftandtoUnitand I don't think people would be happy to make them intoNonempty. (I'm not sure if this is what you are suggesting)
I’m not exactly suggesting this, as said, my experiments making it CocartesianMonoidal and let the CartesianMonoidal on the opposite be infered showed that you get the same defeqs.
There was a problem hiding this comment.
I will raise a question in the reviewers chat. In the mean time can @YaelDillies refactor out the braided monoidal structure on CommAlgCat R since (I think) we have a consensus on this and this could be done now without waiting for any refactor.
There was a problem hiding this comment.
(just in case, my experiments with CocartesianMonoidal are available in this branch in my fork)
There was a problem hiding this comment.
can @YaelDillies refactor out the braided monoidal structure on
CommAlgCat R
Done
de8d037 to
15e3a9b
Compare
|
Apart from admittedly nitpicks about how vars are handled (and perhaps one identation), up to the decision about waiting on a |
|
This pull request has conflicts, please merge |
Construct the cocartesian-monoidal category structure on `CommAlgCat R` explicitly from the tensor product. From Toric Co-authored-by: Andrew Yang <[email protected]> Co-authored-by: Michał Mrugała <[email protected]> Co-authored-by: Christian Merten <[email protected]>
85e3e6f to
20d7ee1
Compare
|
Did you guys reach a decision on a |
|
No clear-cut decision emerged from the higher ups. Except for the thing about CocartesianMonoidal, it’s good to go I think. So instead of stalling this more than it should have been, I’m willing to agree to |
|
Sorry for the delay between this and my last comment, I wanted to have a last look before putting it on the queue. As said, I’ll work on maintainer merge |
|
🚀 Pull request has been placed on the maintainer queue by robin-carlier. |
Construct the cocartesian-monoidal category structure on `CommAlgCat R` explicitly from the tensor product. From Toric Co-authored-by: Andrew Yang <[email protected]> Co-authored-by: Michał Mrugała <[email protected]> Co-authored-by: Christian Merten <[email protected]>
|
Pull request successfully merged into master. Build succeeded: |
CommAlgCat is cocartesian-monoidalCommAlgCat is cocartesian-monoidal
Construct the cocartesian-monoidal category structure on `CommAlgCat R` explicitly from the tensor product. From Toric Co-authored-by: Andrew Yang <[email protected]> Co-authored-by: Michał Mrugała <[email protected]> Co-authored-by: Christian Merten <[email protected]>
Construct the cocartesian-monoidal category structure on `CommAlgCat R` explicitly from the tensor product. From Toric Co-authored-by: Andrew Yang <[email protected]> Co-authored-by: Michał Mrugała <[email protected]> Co-authored-by: Christian Merten <[email protected]>
Construct the cocartesian-monoidal category structure on `CommAlgCat R` explicitly from the tensor product. From Toric Co-authored-by: Andrew Yang <[email protected]> Co-authored-by: Michał Mrugała <[email protected]> Co-authored-by: Christian Merten <[email protected]>
Construct the cocartesian-monoidal category structure on
CommAlgCat Rexplicitly from the tensor product.From Toric
Co-authored-by: Andrew Yang [email protected]
Co-authored-by: Michał Mrugała [email protected]
Co-authored-by: Christian Merten [email protected]