Skip to content

feat(CategoryTheory/Monoidal): premonoidal categories - #21488

Closed
imbrem wants to merge 10 commits into
masterfrom
premonoidal-category
Closed

imbrem wants to merge 10 commits into
masterfrom
premonoidal-category

Conversation

@imbrem

@imbrem imbrem commented Feb 6, 2025 •

Copy link
Copy Markdown
Contributor

Add support for premonoidal categories


Still want to add support for:

  • Premonoidal braided/symmetric categories
  • The monoidal coherence theorem, which I've already ported in my discretion library
  • The coherence tactic, which should work fine for premonoidal categories too
    but wanted to get this in front of reviewers ASAP to make sure my general approach was alright

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 Feb 6, 2025
@github-actions

github-actions Bot commented Feb 6, 2025 •

Copy link
Copy Markdown

PR summary 17d1969148

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.CategoryTheory.Monoidal.Opposite 308 303 -5 (-1.62%)
Import changes for all files
Files Import difference
Mathlib.CategoryTheory.Monoidal.Opposite -5

Declarations diff

+ Central
+ Central.comp
+ Central.eqToHom
+ Central.id
+ Central.inv
+ Central.iso_comp
+ Central.iso_hom_of_inv
+ Central.iso_inv_of_hom
+ Central.iso_refl
+ Central.iso_symm
+ Central.leftTensorIso
+ Central.leftTensorIso_def
+ Central.ltimes
+ Central.ofMonoidal
+ Central.rightTensorIso
+ Central.rightTensorIso_def
+ Central.rtimes
+ Central.tensorHom
+ Central.tensorIso
+ Central.whiskerLeft
+ Central.whiskerLeftIso
+ Central.whiskerRight
+ Central.whiskerRightIso
+ PremonoidalCategory
+ braiding_inv_naturality_ltimes
+ braiding_inv_naturality_rtimes
+ braiding_naturality_ltimes
+ braiding_naturality_rtimes
+ central_helper
+ central_iff
+ inv_ltimes
+ inv_rtimes
+ inv_tensor_eq_rtimes
+ ltimes
+ ltimesIso
+ ltimesIso_def
+ ltimes_isIso
+ ofTensorComp
+ rtimes
+ rtimesIso
+ rtimesIso_def
+ rtimes_isIso
+ synthPremonoidalError
+ tensor_comp
+ tensor_eq_ltimes
+ tensor_id
+ whisker_exchange_helper
- comp_whiskerRight
- whiskerLeft_comp
- whisker_exchange

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.


Decrease in tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type
1657 -1 porting notes

Current commit 17d1969148
Reference commit ce412ec13b

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@yuma-mizuno
yuma-mizuno self-requested a review February 6, 2025 02:05
@imbrem

imbrem commented Feb 8, 2025

Copy link
Copy Markdown
Contributor Author

I have now added support for braided/symmetric premonoidal categories, as well as the monoidal_coherence and some cases of the monoidal tactic

@imbrem imbrem changed the title Added premonoidal categories feat(CategoryTheory/Monoidal): added premonoidal categories Feb 9, 2025
@imbrem imbrem added the t-category-theory Category theory label Feb 9, 2025
@YaelDillies YaelDillies changed the title feat(CategoryTheory/Monoidal): added premonoidal categories feat(CategoryTheory/Monoidal): premonoidal categories Mar 17, 2025
@YaelDillies

Copy link
Copy Markdown
Contributor

(note that the contribution guide says to use present, not past, for PR titles and description)

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 3, 2025
@grunweg

grunweg commented Apr 5, 2025

Copy link
Copy Markdown
Contributor

Thanks for your PR. Can you merge the master branch, please? Right now, your PR has a merge conflict, meaning it won't show up in the review queue. (I see your PR has been waiting for review for a long time now: having it appear in the queue increases the chances a reviewer sees this.)

@kim-em kim-em added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Apr 7, 2025
@kim-em

kim-em commented Apr 7, 2025

Copy link
Copy Markdown
Contributor

I've added awaiting-author, both for the merge conflict, and to follow up on Yuma's suggestions at https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Premonoidal.20categories/with/495386468

@imbrem imbrem removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Apr 7, 2025
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 7, 2025
@imbrem

imbrem commented Apr 7, 2025

Copy link
Copy Markdown
Contributor Author

Since leanprover/lean4#6769 has been solved, I was wondering whether, if I need to split up this PR, I should try to do it with default parameters rather than the ofTensorHom constructor.

@YaelDillies

YaelDillies commented Apr 7, 2025 •

Copy link
Copy Markdown
Contributor

This PR is huge. Is there any chance you can split it? Eg here is a potential split:

  1. One PR to define PremonoidalCategory
  2. One PR to make MonoidalCategory extend it, and fix downstream uses
  3. One PR to weaken MonoidalCategory to PremonoidalCategory where possible

You can (and should!) of course refer to this parent PR in the child PRs, to demonstrate that everything works, but the first PRs should usually be moderate in size.

@imbrem

imbrem commented Apr 8, 2025

Copy link
Copy Markdown
Contributor Author

@YaelDillies I'll try to write a split PR using the default parameter approach, since it's probably cleaner, then!

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 9, 2025
@leanprover-community-bot-assistant

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please merge master and resolve them.

@joneugster

Copy link
Copy Markdown
Member

Mathlib has moved to PRs from forks. This PR is still from a branch of the main repository and will soon be closed! Please migrate the content to a fork and reopen a PR from there if you wish to do so. See Zulip topic for more instructions. Thank you for contributing to mathlib!

@joneugster joneugster added the will-close-soon Unless something changes, we will close this PR soon label Sep 19, 2026
@joneugster joneugster closed this Oct 24, 2026
@YaelDillies
YaelDillies deleted the premonoidal-category branch October 24, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-category-theory Category theory will-close-soon Unless something changes, we will close this PR soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants