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

feat(CategoryTheory): Distributive Categories #20182

Open
wants to merge 70 commits into
base: master
Choose a base branch
from

Conversation

sinhp
Copy link
Collaborator

@sinhp sinhp commented Dec 22, 2024

feat: Monoidal and cartesian distributive categories

This PR defines monoidal and cartesian distributive categories, develop the API, and prove some main results. We show a closed monoidal category is distributive.

We also show that, for a category C with binary coproducts, the category of endofunctors C ⥤ C is left distributive. This requires the following new file which develops a convenient API for the binary (co)products in the functor categories:
CategoryTheory/Limits/FunctorCategory/Shapes/BinaryProducts

In Mathlib/CategoryTheory/Distributive/Cartesian.lean we show that the coproduct coprojections are monic in a cartesian distributive category.


Open in Gitpod

@github-actions github-actions bot added the t-category-theory Category theory label Dec 22, 2024
Copy link

github-actions bot commented Dec 22, 2024

messageFile.md

@sinhp sinhp requested a review from TwoFX December 22, 2024 16:34
@sinhp sinhp added the good first issue Good for newcomers label Dec 22, 2024
@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes label Dec 23, 2024
@sinhp sinhp removed the awaiting-author A reviewer has asked the author a question or requested changes label Dec 25, 2024
sinhp added 2 commits January 26, 2025 11:34
 remove #[Mathlib.CategoryTheory.Monoidal.OfHasFiniteProducts]
@joelriou joelriou changed the title Distributive Categories feat(CategoryTheory): Distributive Categories Jan 27, 2025

/-- The evaluation of a binary product of functors at an object is isomorphic to
the product of the evaluations at that object. -/
noncomputable def prodObjIso (X Y : K ⥤ C) (k : K) : (X ⨯ Y).obj k ≅ (X.obj k) ⨯ (Y.obj k) :=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you use the definitions in this file somewhere else in this PR? If not, could you remove it from this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file does not seem to be needed anymore. I just removed the whole file which is about binary product and coproduction in the functor category.

@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes label Jan 27, 2025
@sinhp sinhp removed the awaiting-author A reviewer has asked the author a question or requested changes label Jan 27, 2025
## References
- [J.R.B.Cockett, Introduction to distributive categories, 1992][]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add this to docs/references.bib?

@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes label Jan 28, 2025
@sinhp sinhp removed the awaiting-author A reviewer has asked the author a question or requested changes label Jan 28, 2025
mathlib-bors bot pushed a commit that referenced this pull request Jan 28, 2025
…eorder category of a meet-semilattice with a top element (#21094)

The preorder category of a meet-semilattice `C` with a top element has chosen finite products. 

Motivation: I plan to use the induced monoidal structure to show that the preorder category of a distributive lattice is distributive. See this PR on Monoidal and cartesian distributive categories: #20182
@sinhp sinhp removed the request for review from TwoFX January 30, 2025 16:00
Comment on lines 59 to 60
abbrev CartesianDistributive :=
IsMonoidalLeftDistrib C
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be defined as IsMonoidalDistrib, and the next instance should be a lemma.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is if a user wants to prove something is CartesianDistributive they only need to supply the left distrib data
preservesBinaryCoproducts_tensorLeft, and the right should be filled in by default since we are in symmetric situation. In above, we decided to make the following instance into a lemma, so I don't think right distrib is inferred from left by default for CartesianDistributive.

SymmetricCategory.isMonoidalDistrib_of_isMonoidalLeftDistrib

So, I implemented your suggestion together the following mk definition:

def mkOfIsMonoidalLeftDistrib [IsMonoidalLeftDistrib C] : CartesianDistributive C :=
  SymmetricCategory.isMonoidalDistrib_of_isMonoidalLeftDistrib

Let me know if you had some other idea.

IsMonoidalRightDistrib C where
preservesBinaryCoproducts_tensorRight X := by
refine {
preservesColimit := by
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not it possible to use preservesBinaryCoproducts_of_isIso_coprodComparison?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, it became 8 lines shorter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers t-category-theory Category theory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants