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] - perf(CategoryTheory/Limits/Shapes): reorder instance arguments #22968

Closed
wants to merge 1 commit into from

Conversation

JovanGerb
Copy link
Collaborator

This PR is in the same spirit as #22953.

The problem is that some instances about category theoretical limits have silly side conditions that end up searching through the whole algebraic type class hierarchy. This PR attempts to keep the type class search limited to category theoretical type classes.


Open in Gitpod

@JovanGerb JovanGerb added the bench-after-CI Once the PR passes CI, comment `!bench` on the PR label Mar 15, 2025
Copy link

PR summary 878372cd2a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ instance (priority := 100) hasColimitsOfShape_of_hasFiniteColimits [HasFiniteColimits C]
+ instance [HasCountableColimits C] (J : Type*) [Category.{v} J] [CountableCategory J] :
+ instance [HasCountableCoproducts C] (J : Type*) [Countable J] : HasCoproductsOfShape J C
- instance (priority := 100) hasColimitsOfShape_of_hasFiniteColimits (J : Type w) [SmallCategory J]
- instance [Category.{v} J] [CountableCategory J] [HasCountableColimits C] : HasColimitsOfShape J C
- instance [HasCountableCoproducts C] : HasCoproductsOfShape J C

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.


No changes to technical debt.

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

@github-actions github-actions bot added the t-category-theory Category theory label Mar 15, 2025
@leanprover-community-mathlib4-bot
Copy link
Collaborator

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 878372c.
There were significant changes against commit 4104be5:

  Benchmark                            Metric         Change
  ==========================================================
+ ~Mathlib.Condensed.Discrete.Module   instructions   -11.4%

Copy link

File Instructions %
build -45.985⬝10⁹ (-0.02%)
lint -18.558⬝10⁹ (-0.24%)
6 files, Instructions -2.0⬝10⁹
File Instructions %
Mathlib.Condensed.Light.AB -1.27⬝10⁹ (-11.14%)
Mathlib.CategoryTheory.Limits.Final -1.485⬝10⁹ (-0.71%)
Mathlib.Condensed.Discrete.Colimit -1.604⬝10⁹ (-1.21%)
Mathlib.Condensed.Light.Module -1.612⬝10⁹ (-12.99%)
Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Basic -1.744⬝10⁹ (-5.98%)
Mathlib.Algebra.Category.ModuleCat.AB -1.871⬝10⁹ (-21.69%)
File Instructions %
Mathlib.Condensed.Light.Epi -5.815⬝10⁹ (-11.59%)
Mathlib.Condensed.AB -6.137⬝10⁹ (-23.77%)
Mathlib.Condensed.Discrete.Characterization -7.970⬝10⁹ (-14.75%)
Mathlib.Condensed.Discrete.Module -13.118⬝10⁹ (-11.35%)
CI run

@github-actions github-actions bot removed the bench-after-CI Once the PR passes CI, comment `!bench` on the PR label Mar 16, 2025
@joelriou
Copy link
Collaborator

Thanks!

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the ready-to-merge This PR has been sent to bors. label Mar 16, 2025
mathlib-bors bot pushed a commit that referenced this pull request Mar 16, 2025
This PR is in the same spirit as #22953.

The problem is that some instances about category theoretical limits have silly side conditions that end up searching through the whole algebraic type class hierarchy. This PR attempts to keep the type class search limited to category theoretical type classes.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Mar 16, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title perf(CategoryTheory/Limits/Shapes): reorder instance arguments [Merged by Bors] - perf(CategoryTheory/Limits/Shapes): reorder instance arguments Mar 16, 2025
@mathlib-bors mathlib-bors bot closed this Mar 16, 2025
@mathlib-bors mathlib-bors bot deleted the limit_shapes_instances branch March 16, 2025 06:27
qawbecrdtey added a commit that referenced this pull request Mar 17, 2025
…vProdLpPiLp` (#22993)

* feat: scalar tower instances for quotients (#22951)

We already have the `SMulCommClass` and `IsScalarTower` versions for `RingQuot`; this develops them for `Con` and `RingCon`, with the eventual aim of replacing `RingQuot` with `RingCon.Quotient`.

* chore(Order/Group/Abs): use `@[to_additive]` (#22468)

* feat(FieldTheory/Finite/Basic): lemmas about the prime subfield in positive characteristic (#22843)

This PR adds some elementary results about the prime subfield of a characteristic p field, e.g., size is p, elements are integer multiples of one, and elements are characterized by being fixed by the p-th power map.

* docs(Data/Real/EReal): fix capitalization error (#22943)

Changes `Ereal` to `EReal` in the module docstring for `Data/Real/EReal`.

* chore(Ideal/Quotient): change `Fintype` to `Finite` (#22947)

As discussed [here](#22902 (comment))

* feat: add `norm_num` extensions for factorials (#8832)

Add `norm_num` extensions to evaluate `Nat.factorial`, `Nat.ascFactorial` and `Nat.descFactorial`.



Co-authored-by: Eric Wieser <[email protected]>

* perf(CategoryTheory/Limits/Shapes): reorder instance arguments (#22968)

This PR is in the same spirit as #22953.

The problem is that some instances about category theoretical limits have silly side conditions that end up searching through the whole algebraic type class hierarchy. This PR attempts to keep the type class search limited to category theoretical type classes.

* feat(LinearAlgebra/FreeModule/CardQuotient): compute indices of subgroups via determinant (#22940)

* feat: API for continuous extension of meromorphic functions (#22867)

Defines the normal form of meromorphic functions and provides API for continuous extension, as discussed [on Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/API.20for.20continuous.20extension.20of.20meromorphic.20functions). More material will be provided in upcoming PRs.

This material is used in [Project VD](https://github.com/kebekus/ProjectVD), which aims to formalize Value Distribution Theory for meromorphic functions on the complex plane.

* feat(Data/Complex/Trigonometric): closer upper bound for cos 1 (#22945)

cos 1 is approximately 0.5403..., so this bound is fairly tight.

Co-authored-by: Vlad Tsyrklevich <[email protected]>

* chore: move `List.Lex` lemmas out of the `List.Lex` namespace (#22935)

This better matches the naming convention.

* working on it.

* Added sup_disjSum and inf_disjSum.

* Finished one branch.

* Finished proof.

---------

Co-authored-by: Eric Wieser <[email protected]>
Co-authored-by: Yury G. Kudryashov <[email protected]>
Co-authored-by: Scott Carnahan <[email protected]>
Co-authored-by: plp127 <[email protected]>
Co-authored-by: Xavier Roblot <[email protected]>
Co-authored-by: Sebastian Zimmer <[email protected]>
Co-authored-by: JovanGerb <[email protected]>
Co-authored-by: Stefan Kebekus <[email protected]>
Co-authored-by: Vlad Tsyrklevich <[email protected]>
Co-authored-by: Vlad Tsyrklevich <[email protected]>
Co-authored-by: Yaël Dillies <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants