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(category_theory): finite products give a monoidal structure #1340

Merged
merged 38 commits into from Sep 4, 2019

Conversation

semorrison
Copy link
Collaborator

This is an alternative to @cipher1024's #1337, defining cartesian categories.

In this approach, we just use has_finite_products C to express that C is cartesian, and then directly give the construction of a monoidal structure on C 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 the simp lemmas provided by the limits library!

Again, this needs some documentation, assuming it's agreed this is the right path.

@cipher1024
Copy link
Collaborator

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.

@semorrison
Copy link
Collaborator Author

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. Top for bundled topological spaces). On the other hand, it is slightly clunky for talking about relationships between abstract categories (for which we would instead want to bundle the categories).

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.

@cipher1024
Copy link
Collaborator

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 variable (C : Type u) [𝒞 : category.{v} C] include 𝒞 into variable (C : Cat.{u v}). In the case of monoidal categories, it also brings down the number of instance you have to assume by one and the class monoidal_category can be resolved without ambiguity because both universes are specified in Cat.{u v}.

@semorrison
Copy link
Collaborator Author

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!

@semorrison semorrison changed the title feat(category_theory): finite products give a monoidal structure (merge #1338 and #1339 first) feat(category_theory): finite products give a monoidal structure (merge #1339 first) Aug 23, 2019
@semorrison semorrison changed the title feat(category_theory): finite products give a monoidal structure (merge #1339 first) feat(category_theory): finite products give a monoidal structure Aug 31, 2019
@semorrison
Copy link
Collaborator Author

There's nothing particularly more that I want to add now; hopefully this is pretty straightforward.

@cipher1024
Copy link
Collaborator

It looks good to me

@jcommelin jcommelin added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Sep 4, 2019
@mergify mergify bot merged commit 5d59e8b into master Sep 4, 2019
@mergify mergify bot deleted the monoidal_of_has_products branch September 4, 2019 13:00
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants