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: port CategoryTheory.Monoidal.Linear #3112

Closed
wants to merge 5 commits into from

Conversation

mo271
Copy link
Collaborator

@mo271 mo271 commented Mar 26, 2023


Open in Gitpod

Mathbin -> Mathlib
fix certain import statements
move "by" to end of line
add import to Mathlib.lean
@mo271 mo271 added the mathlib-port This is a port of a theory file from mathlib. label Mar 26, 2023
@Parcly-Taxel Parcly-Taxel added the awaiting-review The author would like community review of the PR label Mar 26, 2023
@RemyDegenne
Copy link
Contributor

Thanks!
bors r+

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Mar 26, 2023
@RemyDegenne
Copy link
Contributor

bors r-
Wait, actually that unused argument is weird.

@bors
Copy link

bors bot commented Mar 26, 2023

Canceled.


variable (C : Type _) [Category C] [Preadditive C] [Linear R C]

variable [MonoidalCategory C] [MonoidalPreadditive C]
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this [MonoidalPreadditive C] is not used in the definition of the class MonoidalLinear, could you remove this variable declaration and add it to a section where is is needed? (I guess it is still needed somewhere).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I will have a look tomorrow!

Copy link
Contributor

Choose a reason for hiding this comment

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

You have a porting note saying that you removed an argument in a theorem because it was unused. This is weird because the lean3 linter should have complained as well in the original file. So I checked the lean3 file and indeed, we can remove the MonoidalPreadditive C hypothesis when creating the class, and then the argument becomes unused in the theorem. So you did the right thing.

But now we have that variable declaration at the head of the file, which makes the reader think that it is used everywhere, but only a subset of the results actually use it. In particular, the class definition just below does not use it. So it would be better for readability to declare the variable [MonoidalPreadditive C] where it is actually needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually now that I read the file docstring more carefully, it looks like we want to force the MonoidalLinear class to take a MonoidalPreadditive C argument: "A monoidal category is MonoidalLinear R if it is monoidal preadditive and tensor product of morphisms is R-linear in both factors.".
I am not familiar with the relevant math.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, I think that makes sense and gave it a try.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, I think that makes sense and gave it a try.

@RemyDegenne
Copy link
Contributor

bors d+

@bors
Copy link

bors bot commented Mar 26, 2023

✌️ mo271 can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@mo271
Copy link
Collaborator Author

mo271 commented Mar 26, 2023

Is there a way for me to see it?
I can't see the the error

@RemyDegenne RemyDegenne removed the ready-to-merge This PR has been sent to bors. label Mar 26, 2023
@mo271 mo271 added the awaiting-review The author would like community review of the PR label Mar 27, 2023
@RemyDegenne
Copy link
Contributor

Thanks again!
bors r+

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Mar 27, 2023
bors bot pushed a commit that referenced this pull request Mar 27, 2023
Co-authored-by: Moritz Firsching <firsching@google.com>
@bors
Copy link

bors bot commented Mar 27, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: port CategoryTheory.Monoidal.Linear [Merged by Bors] - feat: port CategoryTheory.Monoidal.Linear Mar 27, 2023
@bors bors bot closed this Mar 27, 2023
@bors bors bot deleted the port/CategoryTheory.Monoidal.Linear branch March 27, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated mathlib-port This is a port of a theory file from mathlib. ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants