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(category_theory): finite products give a monoidal structure #1340
Conversation
I think I saw somewhere that you already considered using bundled categories instead of a type class. Do you have a link to a conversation about it? This seems like a situation where bundled categories would simplify things. |
I don't recall any particular place where this choice was analysed carefully. Essentially, the current design is optimised for talking about existing bundled algebraic gadgets, but that have interesting structure between instances (e.g. tensor products, kernels, etc.). The reason it works well for this is that the category structures all live in typeclasses, so the primary objects you talk about are the objects of the category (e.g. I don't think there's any particular obstacle to also developing bundled categories alongside what is already in mathlib. However I haven't felt much need for it so far; I'd be curious to hear why you think they would have been easier here. |
The main reason I'd consider it is for the universe level issue with type class resolution. It might be worth considering type classes for small categories only (are all the interesting algebraic instances small categories?) and bundled categories for the rest. That turns |
I see. Actually, it's the other way round --- the interesting algebraic instances are all large categories, but I don't think that causes any problem. I'll think about this, but I'm also not really sure where to investigating! |
There's nothing particularly more that I want to add now; hopefully this is pretty straightforward. |
It looks good to me |
…nprover-community#1340) * providing minimal API for limits of special shapes * apis for special shapes * start * fintype instances * copy-paste from monoidal-categories-reboot * associators, unitors, braidings for binary product * minor * minor * map * minor * instances * blah * chore(category_theory/monoidal): monoidal_category doesn't extend category * minor * minor * assoc lemma * coprod * done? * fix import * names * cleanup * fix reassoc * comments * comments
This is an alternative to @cipher1024's #1337, defining cartesian categories.
In this approach, we just use
has_finite_products C
to express thatC
is cartesian, and then directly give the construction of a monoidal structure onC
from this. I think the construction I given here is pretty close to minimal --- we say only what needs to be said, and all the theorems are proved by thesimp
lemmas provided by the limits library!Again, this needs some documentation, assuming it's agreed this is the right path.