Skip to content

[Merged by Bors] - refactor: move the construction of ChosenFiniteProducts from finite products with ChosenFiniteProducts - #24679

Closed
YaelDillies wants to merge 3 commits into
masterfrom
move_chosen_finite_product_of_chosen_finite_products
Closed

YaelDillies wants to merge 3 commits into
masterfrom
move_chosen_finite_product_of_chosen_finite_products

Conversation

@YaelDillies

@YaelDillies YaelDillies commented May 8, 2025 •

Copy link
Copy Markdown
Contributor

Now that ChosenFiniteProducts extends MonoidalCategory, there is no point having the MonoidalCategory version separate from the ChosenFiniteProducts one.

MonoidalOfChosenFiniteProductsSynonym was described as an auxiliary type, so I simply deleted it without deprecation

From Toric


Open in Gitpod

@YaelDillies YaelDillies added t-category-theory Category theory toric Part of the ongoing formalisation of toric varieties labels May 8, 2025
@github-actions

github-actions Bot commented May 8, 2025 •

Copy link
Copy Markdown

PR summary e563b048e0

Import changes exceeding 2%

% File
+44.42% Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Basic
+30.74% Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Symmetric

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Basic 430 621 +191 (+44.42%)
Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Symmetric 475 621 +146 (+30.74%)
Mathlib.CategoryTheory.ChosenFiniteProducts 621 620 -1 (-0.16%)
Mathlib.Algebra.Category.Grp.LeftExactFunctor 907 906 -1 (-0.11%)
Mathlib.AlgebraicGeometry.Limits 2023 2022 -1 (-0.05%)
Import changes for all files
Files Import difference
135 files Mathlib.Algebra.Category.Grp.ChosenFiniteProducts Mathlib.Algebra.Category.Grp.LeftExactFunctor Mathlib.Algebra.Category.ModuleCat.Adjunctions Mathlib.Algebra.Category.ModuleCat.Presheaf.Free Mathlib.Algebra.Category.ModuleCat.Presheaf.Generator Mathlib.Algebra.Category.ModuleCat.Presheaf.Pullback Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackContinuous Mathlib.AlgebraicGeometry.AffineSpace Mathlib.AlgebraicGeometry.Cover.Over Mathlib.AlgebraicGeometry.Cover.Sigma Mathlib.AlgebraicGeometry.Fiber Mathlib.AlgebraicGeometry.GluingOneHypercover Mathlib.AlgebraicGeometry.IdealSheaf.Basic Mathlib.AlgebraicGeometry.IdealSheaf.Subscheme Mathlib.AlgebraicGeometry.IdealSheaf Mathlib.AlgebraicGeometry.Limits Mathlib.AlgebraicGeometry.Morphisms.AffineAnd Mathlib.AlgebraicGeometry.Morphisms.Affine Mathlib.AlgebraicGeometry.Morphisms.Basic Mathlib.AlgebraicGeometry.Morphisms.ClosedImmersion Mathlib.AlgebraicGeometry.Morphisms.Constructors Mathlib.AlgebraicGeometry.Morphisms.Etale Mathlib.AlgebraicGeometry.Morphisms.FinitePresentation Mathlib.AlgebraicGeometry.Morphisms.FiniteType Mathlib.AlgebraicGeometry.Morphisms.Finite Mathlib.AlgebraicGeometry.Morphisms.Flat Mathlib.AlgebraicGeometry.Morphisms.FormallyUnramified Mathlib.AlgebraicGeometry.Morphisms.Immersion Mathlib.AlgebraicGeometry.Morphisms.Integral Mathlib.AlgebraicGeometry.Morphisms.IsIso Mathlib.AlgebraicGeometry.Morphisms.OpenImmersion Mathlib.AlgebraicGeometry.Morphisms.Preimmersion Mathlib.AlgebraicGeometry.Morphisms.Proper Mathlib.AlgebraicGeometry.Morphisms.QuasiCompact Mathlib.AlgebraicGeometry.Morphisms.QuasiSeparated Mathlib.AlgebraicGeometry.Morphisms.RingHomProperties Mathlib.AlgebraicGeometry.Morphisms.Separated Mathlib.AlgebraicGeometry.Morphisms.Smooth Mathlib.AlgebraicGeometry.Morphisms.SurjectiveOnStalks Mathlib.AlgebraicGeometry.Morphisms.UnderlyingMap Mathlib.AlgebraicGeometry.Morphisms.UniversallyClosed Mathlib.AlgebraicGeometry.Morphisms.UniversallyInjective Mathlib.AlgebraicGeometry.Morphisms.UniversallyOpen Mathlib.AlgebraicGeometry.Noetherian Mathlib.AlgebraicGeometry.PointsPi Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Proper Mathlib.AlgebraicGeometry.PullbackCarrier Mathlib.AlgebraicGeometry.Pullbacks Mathlib.AlgebraicGeometry.RationalMap Mathlib.AlgebraicGeometry.ResidueField Mathlib.AlgebraicGeometry.Sites.BigZariski Mathlib.AlgebraicGeometry.Sites.Etale Mathlib.AlgebraicGeometry.Sites.MorphismProperty Mathlib.AlgebraicGeometry.Sites.Representability Mathlib.AlgebraicGeometry.Sites.Small Mathlib.AlgebraicGeometry.SpreadingOut Mathlib.AlgebraicGeometry.Stalk Mathlib.AlgebraicGeometry.ValuativeCriterion Mathlib.AlgebraicTopology.SimplicialCategory.Basic Mathlib.AlgebraicTopology.SimplicialCategory.SimplicialObject Mathlib.AlgebraicTopology.SimplicialNerve Mathlib.AlgebraicTopology.SimplicialSet.Monoidal Mathlib.CategoryTheory.Abelian.FreydMitchell Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Indization Mathlib.CategoryTheory.Abelian.Indization Mathlib.CategoryTheory.Action.Monoidal Mathlib.CategoryTheory.ChosenFiniteProducts.Cat Mathlib.CategoryTheory.ChosenFiniteProducts.FunctorCategory Mathlib.CategoryTheory.ChosenFiniteProducts.InfSemilattice Mathlib.CategoryTheory.ChosenFiniteProducts.Over Mathlib.CategoryTheory.ChosenFiniteProducts Mathlib.CategoryTheory.Closed.Cartesian Mathlib.CategoryTheory.Closed.Enrichment Mathlib.CategoryTheory.Closed.FunctorCategory.Basic Mathlib.CategoryTheory.Closed.FunctorToTypes Mathlib.CategoryTheory.Closed.Functor Mathlib.CategoryTheory.Closed.Ideal Mathlib.CategoryTheory.Closed.Types Mathlib.CategoryTheory.Closed.Zero Mathlib.CategoryTheory.Distributive.Cartesian Mathlib.CategoryTheory.Enriched.Basic Mathlib.CategoryTheory.Enriched.FunctorCategory Mathlib.CategoryTheory.Enriched.HomCongr Mathlib.CategoryTheory.Enriched.Limits.HasConicalLimits Mathlib.CategoryTheory.Enriched.Limits.HasConicalProducts Mathlib.CategoryTheory.Enriched.Limits.HasConicalPullbacks Mathlib.CategoryTheory.Enriched.Limits.HasConicalTerminal Mathlib.CategoryTheory.Enriched.Opposite Mathlib.CategoryTheory.Enriched.Ordinary.Basic Mathlib.CategoryTheory.Functor.FunctorHom Mathlib.CategoryTheory.Generator.Indization Mathlib.CategoryTheory.Monoidal.Cartesian.CommGrp_ Mathlib.CategoryTheory.Monoidal.Cartesian.CommMon_ Mathlib.CategoryTheory.Monoidal.Cartesian.Comon_ Mathlib.CategoryTheory.Monoidal.Cartesian.Grp_ Mathlib.CategoryTheory.Monoidal.Cartesian.Mod_ Mathlib.CategoryTheory.Monoidal.Cartesian.Mon_ Mathlib.CategoryTheory.Monoidal.CommGrp_ Mathlib.CategoryTheory.Monoidal.Grp_ Mathlib.CategoryTheory.Monoidal.Internal.Types.Basic Mathlib.CategoryTheory.Monoidal.Internal.Types.CommGrp_ Mathlib.CategoryTheory.Monoidal.Internal.Types.Grp_ Mathlib.CategoryTheory.Monoidal.Types.Basic Mathlib.CategoryTheory.Monoidal.Types.Coyoneda Mathlib.CategoryTheory.Preadditive.CommGrp_ Mathlib.CategoryTheory.Preadditive.Indization Mathlib.CategoryTheory.Sites.CartesianClosed Mathlib.CategoryTheory.Sites.ChosenFiniteProducts Mathlib.CategoryTheory.Sites.Monoidal Mathlib.Condensed.AB Mathlib.Condensed.CartesianClosed Mathlib.Condensed.Discrete.Characterization Mathlib.Condensed.Discrete.Module Mathlib.Condensed.Epi Mathlib.Condensed.Explicit Mathlib.Condensed.Light.AB Mathlib.Condensed.Light.CartesianClosed Mathlib.Condensed.Light.Epi Mathlib.Condensed.Light.Explicit Mathlib.Condensed.Light.Limits Mathlib.Condensed.Light.Module Mathlib.Condensed.Limits Mathlib.Condensed.Module Mathlib.Condensed.Solid Mathlib.RepresentationTheory.Character Mathlib.RepresentationTheory.Coinduced Mathlib.RepresentationTheory.FDRep Mathlib.RepresentationTheory.GroupCohomology.Basic Mathlib.RepresentationTheory.GroupCohomology.Functoriality Mathlib.RepresentationTheory.GroupCohomology.Hilbert90 Mathlib.RepresentationTheory.GroupCohomology.LowDegree Mathlib.RepresentationTheory.GroupCohomology.Resolution Mathlib.RepresentationTheory.Invariants Mathlib.RepresentationTheory.Rep Mathlib.RepresentationTheory.Tannaka
-1
Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Symmetric 146
Mathlib.CategoryTheory.Monoidal.OfChosenFiniteProducts.Basic 191

Declarations diff

+ instance : ChosenFiniteProducts Scheme := .ofHasFiniteProducts
+ ofHasFiniteProducts
- MonoidalOfChosenFiniteProductsSynonym
- braiding_naturality
- hexagon_forward
- hexagon_reverse
- instance : Category (MonoidalOfChosenFiniteProductsSynonym 𝒯 ℬ) := by
- instance : ChosenFiniteProducts Scheme := .ofFiniteProducts _
- instance : MonoidalCategory (MonoidalOfChosenFiniteProductsSynonym 𝒯 ℬ)
- monoidalOfChosenFiniteProducts
- symmetricOfChosenFiniteProducts
- symmetry

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
1554 -1 porting notes

Current commit e563b048e0
Reference commit 95bc7692a6

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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add the old authors to the new file? Thanks.

@b-mehta b-mehta 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.

I have to say I do find it cleaner to build the monoidal category, then upgrade that to a chosen finite products: it's something of an implementation choice that that's the current setup, and keeping monoidalOfChosenFiniteProducts (which admittedly has a bad name) makes it more understandable what's going on

@b-mehta b-mehta added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label May 14, 2025
@YaelDillies

Copy link
Copy Markdown
Contributor Author

I have to say I do find it cleaner to build the monoidal category, then upgrade that to a chosen finite products: it's something of an implementation choice that that's the current setup, and keeping monoidalOfChosenFiniteProducts (which admittedly has a bad name) makes it more understandable what's going on

After #24390, ChosenFiniteProducts won't be a thing anymore, as instead it will be called CartesianMonoidalCategory. Once that rename is done, I think it will be plenty clear what's going on in that construction?

@YaelDillies YaelDillies removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label May 14, 2025
@b-mehta b-mehta added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label May 14, 2025
@YaelDillies YaelDillies removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label May 14, 2025
@YaelDillies

Copy link
Copy Markdown
Contributor Author

it's something of an implementation choice that that's the current setup

I'm not so sure about that: MonoidalOfChosenFiniteProducts predates ChosenFiniteProducts by four years (cf leanprover-community/mathlib3#3995). There probably never was a conscious choice not to refactor it to output ChosenFiniteProducts.

@b-mehta

b-mehta commented May 14, 2025

Copy link
Copy Markdown
Contributor

There probably never was a conscious choice not to refactor it to output ChosenFiniteProducts.

That's not quite what I mean: instead I mean that until recently, ChosenFiniteProducts didn't extend MonoidalCategory, and so the refactor you're doing here wouldn't even make sense. It's the choice to have it as an extension that I'm saying is an implementation detail.

@b-mehta

b-mehta commented May 14, 2025

Copy link
Copy Markdown
Contributor

bors merge

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

Now that `ChosenFiniteProducts` extends `MonoidalCategory`, there is no point having the `MonoidalCategory` version separate from the `ChosenFiniteProducts` one.

`MonoidalOfChosenFiniteProductsSynonym` was described as an auxiliary type, so I simply deleted it without deprecation

From Toric
@mathlib-bors

mathlib-bors Bot commented May 14, 2025

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

@b-mehta

b-mehta commented May 14, 2025

Copy link
Copy Markdown
Contributor

Looks like this is the one causing the build failure

bors r-

@mathlib-bors

mathlib-bors Bot commented May 14, 2025

Copy link
Copy Markdown
Contributor

Canceled.

… products with `ChosenFiniteProducts`

Now that `ChosenFiniteProducts` extends `MonoidalCategory`, there is no point having the `MonoidalCategory` version separate from the `ChosenFiniteProducts` one.

From Toric
@ghost ghost removed the ready-to-merge This PR has been sent to bors. label May 14, 2025
@YaelDillies
YaelDillies force-pushed the move_chosen_finite_product_of_chosen_finite_products branch from 325a7c8 to 106802b Compare May 14, 2025 14:55
@YaelDillies YaelDillies added the auto-merge-after-CI Please do not add manually. Requests for a bot to merge automatically once CI is done. label May 14, 2025
@github-actions github-actions Bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label May 14, 2025
@ghost

ghost commented May 14, 2025

Copy link
Copy Markdown

As this PR is labelled auto-merge-after-CI, we are now sending it to bors:

bors merge

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

Now that `ChosenFiniteProducts` extends `MonoidalCategory`, there is no point having the `MonoidalCategory` version separate from the `ChosenFiniteProducts` one.

`MonoidalOfChosenFiniteProductsSynonym` was described as an auxiliary type, so I simply deleted it without deprecation

From Toric
@mathlib-bors

mathlib-bors Bot commented May 14, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title refactor: move the construction of ChosenFiniteProducts from finite products with ChosenFiniteProducts [Merged by Bors] - refactor: move the construction of ChosenFiniteProducts from finite products with ChosenFiniteProducts May 14, 2025
@mathlib-bors mathlib-bors Bot closed this May 14, 2025
@mathlib-bors
mathlib-bors Bot deleted the move_chosen_finite_product_of_chosen_finite_products branch May 14, 2025 15:58
jano-wol pushed a commit that referenced this pull request May 16, 2025
… products with `ChosenFiniteProducts` (#24679)

Now that `ChosenFiniteProducts` extends `MonoidalCategory`, there is no point having the `MonoidalCategory` version separate from the `ChosenFiniteProducts` one.

`MonoidalOfChosenFiniteProductsSynonym` was described as an auxiliary type, so I simply deleted it without deprecation

From Toric
bwehlin pushed a commit to bwehlin/mathlib4 that referenced this pull request May 31, 2025
… products with `ChosenFiniteProducts` (leanprover-community#24679)

Now that `ChosenFiniteProducts` extends `MonoidalCategory`, there is no point having the `MonoidalCategory` version separate from the `ChosenFiniteProducts` one.

`MonoidalOfChosenFiniteProductsSynonym` was described as an auxiliary type, so I simply deleted it without deprecation

From Toric
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-after-CI Please do not add manually. Requests for a bot to merge automatically once CI is done. large-import Automatically added label for PRs with a significant increase in transitive imports 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.

3 participants