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

[Merged by Bors] - feat(CategoryTheory/Closed/Enrichment): a closed monoidal category is enriched in itself #17326

Closed
wants to merge 41 commits into from

Conversation

daniel-carranza
Copy link
Collaborator

From a monoidal closed category V, construct an instance of EnrichedCategory V on V where the hom-objects are given by the internal homs of the closed structure.


First time contributor. I am still new to formalization, so I am open any and all suggestions! In particular, the proofs here are a bit long compared to most proofs I see in the library, and I'm not sure if it's couth to use the @[simp] attribute for some equalities here.

Remark: As I understand, the type of simplicial sets SSet.{v} also has an instance of EnrichedCategory SSet.{v} constructed in AlgebraicTopology/SimplicialCategory/SimplicialObject. This enrichment comes from viewing SSet.{v} as a category of simplicial objects, rather than as a closed monoidal category. I'm still a beginner, but could this cause any issues if a file imports both instances?

Open in Gitpod

@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Oct 1, 2024
Copy link

github-actions bot commented Oct 1, 2024

PR summary ee837dfade

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.CategoryTheory.Closed.Enrichment 574

Declarations diff

+ assoc
+ comp
+ compTranspose
+ compTranspose_eq
+ comp_eq
+ comp_id
+ id
+ id_comp
+ id_eq

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

@github-actions github-actions bot added the t-category-theory Category theory label Oct 1, 2024
Copy link
Contributor

@b-mehta b-mehta left a comment

Choose a reason for hiding this comment

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

This is in pretty good shape already for a first contribution! I've left a couple of style comments.
Note that the title of your PR shouldn't be capitalised, see https://leanprover-community.github.io/contribute/commit.html

Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
rw [uncurry_curry, uncurry_curry]; dsimp
rw [associator_inv_naturality_middle_assoc]
rw [← comp_whiskerRight_assoc]
rw [← uncurry_eq, uncurry_curry]
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I notice you use this particular pair of rewrites pretty often, and I'm guessing it does something like

(A ◁ curry g) ≫ (ihom.ev A).app X = g

Is there a reason the left-hand-side of this is appearing so often? I somewhat expect there's a cleaner way of going about this proof, although I can't be sure

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, this pair of rewrites is exactly that equality. The current proof is the best I could come up with in terms of cleaning on my end, but my hope is also that there should be a cleaner proof!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I experimented (locally on my machine) with making this a separate lemma inside the CategoryTheory/Closed/Monoidal.lean file with the simp attribute. The proof now goes through using a single simp wherever these two rewrites originally occurred. Is this a good candidate simp lemma to be added to the CategoryTheory/Closed/Monoidal file? (Posted on Zulip as well)

Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
@daniel-carranza daniel-carranza changed the title feat(CategoryTheory/Closed/Enrichment): A closed monoidal category is enriched in itself feat(CategoryTheory/Closed/Enrichment): a closed monoidal category is enriched in itself Oct 1, 2024
Copy link
Collaborator

@emilyriehl emilyriehl left a comment

Choose a reason for hiding this comment

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

@b-mehta is a way more expert reviewer than me. I'm curious about the answer to the dual instance question you raised. Maybe ask it on the zulip of @mckoen who provided the other instance (iirc)?

@b-mehta
Copy link
Contributor

b-mehta commented Oct 1, 2024

I think the dual instance could cause issues, but I don't know enough about the context of this to know what the correct solution is. I'd guess we'd like to only have one of them actually active on SSet, prove that they're the same or make the constructions so they're definitionally the same. But I don't know the maths here well enough to be sure (are they even the same, informally?). Asking on the zulip is definitely the correct thing to do.

@joelriou
Copy link
Collaborator

joelriou commented Oct 1, 2024

About the dual instance issue, I would suggest making the new instance in this PR a local or a scoped instance.

@daniel-carranza
Copy link
Collaborator Author

daniel-carranza commented Oct 1, 2024

I've implemented Joel's suggestion in the current version, but I created a Zulip chat to discuss this PR in the Infinity-Cosmos channel

@daniel-carranza
Copy link
Collaborator Author

@b-mehta @joelriou Sorry for the ping! I'm wondering if anyone could take another look at this PR for suggestions/how to move towards merging the changes - thank you in advance!

Copy link
Contributor

@b-mehta b-mehta left a comment

Choose a reason for hiding this comment

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

Sorry for the delay on this. It's in very good shape overall, I made a few readability suggestions and optional alternate proofs.

Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
Mathlib/CategoryTheory/Closed/Enrichment.lean Outdated Show resolved Hide resolved
@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes label Oct 17, 2024
@joelriou
Copy link
Collaborator

Most of the definitions and compatibilities in this PR could be phrased under the slightly weaker condition that only a few Closed X assumptions hold. Then, I believe that the definitions and lemmas should be moved to the file Closed.Monoidal along with the other compatibilities which were already obtained. Then, Closed.Enrichment should become a very short file which applies this API when MonoidalClosed holds.

daniel-carranza and others added 4 commits October 21, 2024 10:12
Co-authored-by: Bhavik Mehta <bhavikmehta8@gmail.com>
Co-authored-by: Bhavik Mehta <bhavikmehta8@gmail.com>
Co-authored-by: Bhavik Mehta <bhavikmehta8@gmail.com>
Co-authored-by: Bhavik Mehta <bhavikmehta8@gmail.com>
@joelriou
Copy link
Collaborator

joelriou commented Oct 24, 2024

After the kind of style suggestions are taken care of, I think this PR shall be ready.

@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes label Oct 24, 2024
daniel-carranza and others added 3 commits October 24, 2024 12:28
Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
@daniel-carranza
Copy link
Collaborator Author

Thank you!

@daniel-carranza daniel-carranza removed the awaiting-author A reviewer has asked the author a question or requested changes label Oct 24, 2024
Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
@joelriou
Copy link
Collaborator

Thanks!

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Oct 24, 2024
mathlib-bors bot pushed a commit that referenced this pull request Oct 24, 2024
… enriched in itself (#17326)

From a monoidal closed category V, construct an instance of `EnrichedCategory V` on V where the hom-objects are given by the internal homs of the closed structure.



Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
Co-authored-by: daniel-carranza <carranzajdaniel@gmail.com>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 24, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(CategoryTheory/Closed/Enrichment): a closed monoidal category is enriched in itself [Merged by Bors] - feat(CategoryTheory/Closed/Enrichment): a closed monoidal category is enriched in itself Oct 24, 2024
@mathlib-bors mathlib-bors bot closed this Oct 24, 2024
@mathlib-bors mathlib-bors bot deleted the enriched_from_closed branch October 24, 2024 22:20
mathlib-bors bot pushed a commit that referenced this pull request Nov 17, 2024
Let `C` be a category that is enriched over a monoidal category `V` in such a way that the category structure and the enriched category structure are compatible. Then, if `J` is a category and that `V` has certain limits, then the functor category `J ⥤ C` is also enriched over `V`.

(Plan: using #17326, we may use this for `C := C` closed monoidal in order to show that a category of functors `J ⥤ C` to a monoidal category is enriched over `C`, and, by applying this to all `Under X` categories for `X : C`, it should follow that `J ⥤ C` is also closed monoidal. This should give a more explicit approach as compared to  #16067.)



Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
TobiasLeichtfried pushed a commit that referenced this pull request Nov 21, 2024
Let `C` be a category that is enriched over a monoidal category `V` in such a way that the category structure and the enriched category structure are compatible. Then, if `J` is a category and that `V` has certain limits, then the functor category `J ⥤ C` is also enriched over `V`.

(Plan: using #17326, we may use this for `C := C` closed monoidal in order to show that a category of functors `J ⥤ C` to a monoidal category is enriched over `C`, and, by applying this to all `Under X` categories for `X : C`, it should follow that `J ⥤ C` is also closed monoidal. This should give a more explicit approach as compared to  #16067.)



Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! ready-to-merge This PR has been sent to bors. t-category-theory Category theory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants