Skip to content

[Merged by Bors] - refactor(CategoryTheory): Make ChosenFiniteProducts extend MonoidalCategory - #24399

Closed
erdOne wants to merge 28 commits into
masterfrom
erd1/chosenFiniteProductBye
Closed

erdOne wants to merge 28 commits into
masterfrom
erd1/chosenFiniteProductBye

Conversation

@erdOne

@erdOne erdOne commented Apr 26, 2025 •

Copy link
Copy Markdown
Member

There are cases where we have an existing monoidal structure on a category, which turns out to be cartesian monoidal in certain situations. The existing design cannot support such scenarios, as the monoidal category instance is currently forced to come from monoidalOfChosenFiniteProducts. We refactor ChosenFiniteProducts to instead extend MonoidalCategory, and to contain extra data that the existing monoidal structure is cartesian. The plan is to rename ChosenFiniteProducts to CartesianMonoidalCategory in a follow up PR.

Examples of such cases include

  1. If C is a monoidal category, then Cᵒᵖ has a canonical monoidal structure. It is cartesian when e.g. C = Ab.
  2. If C is a monoidal category, then Mon_ C has a canonical monoidal structure. It is cartesian when C is.

Also see https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Bimon.20C.20.3D.20Mon.20C.20when.20C.20is.20cartesian-monoidal

From Toric


Open in Gitpod

YaelDillies and others added 7 commits April 26, 2025 15:49
Define cartesian-monoidal categories as braided monoidal categories whose tensor unit is terminal and whose tensor product is the cartesian product.

In the long run, this will replace (most of) the uses of `ChosenFiniteProducts`.

From Toric
…ions (#24389)

Split the definitions and lemmas about orthogonal projections from `Mathlib.Geometry.Euclidean.Basic` (plus some pieces in `Mathlib.Geometry.Euclidean.Circumcenter`) into a separate file `Mathlib.Geometry.Euclidean.Projection`.

No definitions, statements or proofs are changed, just moved from one place to another (plus `shake`, plus fixing up the results of `shake` including import removals that worked but weren't pointed out by `shake`).
@github-actions

github-actions Bot commented Apr 26, 2025 •

Copy link
Copy Markdown

PR summary e9d41cf744

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

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) = (8.00, 0.01)
Current number Change Type
907 -8 erw

Current commit e9d41cf744
Reference commit cb0f568cf5

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).

@erdOne erdOne added the t-category-theory Category theory label Apr 27, 2025
@YaelDillies YaelDillies added the toric Part of the ongoing formalisation of toric varieties label Apr 27, 2025

@YaelDillies YaelDillies left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you please thoroughly motivate the refactor in the PR description, for historical purposes?

@YaelDillies YaelDillies added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Apr 27, 2025
@erdOne erdOne removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Apr 27, 2025
@joelriou joelriou added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Apr 28, 2025
@YaelDillies

Copy link
Copy Markdown
Contributor

Should we refactor monoidalOfHasFiniteProducts to return CartesianMonoidalCategory?

@YaelDillies

YaelDillies commented May 4, 2025 •

Copy link
Copy Markdown
Contributor

I have done so. It's currently in the diff of #24390, but I will move be to a new PR in due time.

@erdOne erdOne added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. labels May 7, 2025
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label May 7, 2025
@joelriou

joelriou commented May 7, 2025

Copy link
Copy Markdown
Contributor

Thanks!

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label May 7, 2025
mathlib-bors Bot pushed a commit that referenced this pull request May 7, 2025
…lCategory` (#24399)

There are cases where we have an existing monoidal structure on a category, which turns out to be cartesian monoidal in certain situations. The existing design cannot support such scenarios, as the monoidal category instance is currently forced to come from `monoidalOfChosenFiniteProducts`. We refactor `ChosenFiniteProducts` to instead extend `MonoidalCategory`, and to contain extra data that the existing monoidal structure is cartesian. The plan is to rename `ChosenFiniteProducts` to `CartesianMonoidalCategory` in a follow up PR.

Examples of such cases include
1. If `C` is a monoidal category, then `Cᵒᵖ` has a canonical monoidal structure. It is cartesian when e.g. `C = Ab`.
2. If `C` is a monoidal category, then `Mon_ C` has a canonical monoidal structure. It is cartesian when `C` is.

Also see https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Bimon.20C.20.3D.20Mon.20C.20when.20C.20is.20cartesian-monoidal

From Toric



Co-authored-by: Andrew Yang <[email protected]>
Co-authored-by: Joseph Myers <[email protected]>
Co-authored-by: Andrew Yang <[email protected]>
@mathlib-bors

mathlib-bors Bot commented May 7, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title refactor(CategoryTheory): Make ChosenFiniteProducts extend MonoidalCategory [Merged by Bors] - refactor(CategoryTheory): Make ChosenFiniteProducts extend MonoidalCategory May 7, 2025
@mathlib-bors mathlib-bors Bot closed this May 7, 2025
@mathlib-bors
mathlib-bors Bot deleted the erd1/chosenFiniteProductBye branch May 7, 2025 21:14
YaelDillies added a commit that referenced this pull request May 8, 2025
mathlib-bors Bot pushed a commit that referenced this pull request May 8, 2025
tannerduve pushed a commit that referenced this pull request May 13, 2025
…lCategory` (#24399)

There are cases where we have an existing monoidal structure on a category, which turns out to be cartesian monoidal in certain situations. The existing design cannot support such scenarios, as the monoidal category instance is currently forced to come from `monoidalOfChosenFiniteProducts`. We refactor `ChosenFiniteProducts` to instead extend `MonoidalCategory`, and to contain extra data that the existing monoidal structure is cartesian. The plan is to rename `ChosenFiniteProducts` to `CartesianMonoidalCategory` in a follow up PR.

Examples of such cases include
1. If `C` is a monoidal category, then `Cᵒᵖ` has a canonical monoidal structure. It is cartesian when e.g. `C = Ab`.
2. If `C` is a monoidal category, then `Mon_ C` has a canonical monoidal structure. It is cartesian when `C` is.

Also see https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Bimon.20C.20.3D.20Mon.20C.20when.20C.20is.20cartesian-monoidal

From Toric



Co-authored-by: Andrew Yang <[email protected]>
Co-authored-by: Joseph Myers <[email protected]>
Co-authored-by: Andrew Yang <[email protected]>
tannerduve pushed a commit that referenced this pull request May 13, 2025
bwehlin pushed a commit to bwehlin/mathlib4 that referenced this pull request May 31, 2025
…lCategory` (leanprover-community#24399)

There are cases where we have an existing monoidal structure on a category, which turns out to be cartesian monoidal in certain situations. The existing design cannot support such scenarios, as the monoidal category instance is currently forced to come from `monoidalOfChosenFiniteProducts`. We refactor `ChosenFiniteProducts` to instead extend `MonoidalCategory`, and to contain extra data that the existing monoidal structure is cartesian. The plan is to rename `ChosenFiniteProducts` to `CartesianMonoidalCategory` in a follow up PR.

Examples of such cases include
1. If `C` is a monoidal category, then `Cᵒᵖ` has a canonical monoidal structure. It is cartesian when e.g. `C = Ab`.
2. If `C` is a monoidal category, then `Mon_ C` has a canonical monoidal structure. It is cartesian when `C` is.

Also see https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Bimon.20C.20.3D.20Mon.20C.20when.20C.20is.20cartesian-monoidal

From Toric



Co-authored-by: Andrew Yang <[email protected]>
Co-authored-by: Joseph Myers <[email protected]>
Co-authored-by: Andrew Yang <[email protected]>
bwehlin pushed a commit to bwehlin/mathlib4 that referenced this pull request May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-category-theory Category theory toric Part of the ongoing formalisation of toric varieties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants