Skip to content

[Merged by Bors] - chore(RingTheory/LocalRing/ResidueField/Ideal): increase simp prio, analogous to #22215#22753

Closed
JovanGerb wants to merge 1 commit intomasterfrom
algebraMap_residueField_eq_zero
Closed

[Merged by Bors] - chore(RingTheory/LocalRing/ResidueField/Ideal): increase simp prio, analogous to #22215#22753
JovanGerb wants to merge 1 commit intomasterfrom
algebraMap_residueField_eq_zero

Conversation

@JovanGerb
Copy link
Copy Markdown
Contributor

@JovanGerb JovanGerb commented Mar 10, 2025

This PR increases the simp priority of a lemma to avoid a simpNF timeout. It is analogous to #22215. It is needed to fix the nightly-with-mathlib build.

Edit: this has been cherry-picked to the nightly-testing branch.


Open in Gitpod

@JovanGerb
Copy link
Copy Markdown
Contributor Author

Note that the following comment is now not valid anymore:

/- If made an instance, causes timeouts synthesizing `FaithfulSMul R I.ResidueField` at
`Ideal.algebraMap_residueField_eq_zero` and `Ideal.ker_algebraMap_residueField` during
simpNF linting. -/
lemma Module.finite_of_isArtinianRing [IsJacobsonRing R] [IsArtinianRing A] :
    Module.Finite R A :=

Should this now be made an instance?

@github-actions
Copy link
Copy Markdown

PR summary 4955224a12

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.


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-algebra Algebra (groups, rings, fields, etc) label Mar 10, 2025
@ghost
Copy link
Copy Markdown

ghost commented Mar 10, 2025

!bench

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit 4955224.
There were no significant changes against commit 63a7be5.

@github-actions
Copy link
Copy Markdown

File Instructions %
build -7.652⬝10⁹ (+0.00%)
lint -6.681⬝10⁹ (-0.08%)
Mathlib.RingTheory.Spectrum.Prime.Polynomial -8.89⬝10⁹ (-5.75%)
CI run

Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

The change looks fine; I don't feel qualified to answer the question posed in the comment: can somebody else take a look?
maintainer delegate?

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by grunweg.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Mar 10, 2025
@mattrobball
Copy link
Copy Markdown
Contributor

mattrobball commented Mar 10, 2025

Note that the following comment is now not valid anymore:

/- If made an instance, causes timeouts synthesizing `FaithfulSMul R I.ResidueField` at
`Ideal.algebraMap_residueField_eq_zero` and `Ideal.ker_algebraMap_residueField` during
simpNF linting. -/
lemma Module.finite_of_isArtinianRing [IsJacobsonRing R] [IsArtinianRing A] :
    Module.Finite R A :=

Should this now be made an instance?

Fun test would be: for each instance added in a PR

  • get the general arguments to the instance
  • time synthesis before and after for the general problem with import Mathlib
  • report the differences

You wouldn't need two toolchains since you can de-instance the new one.

But I am happy to punt this question to a separate PR. The documentation is good enough to remind us we still have an un-resolved problem.

@mattrobball
Copy link
Copy Markdown
Contributor

bors merge

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Mar 10, 2025
mathlib-bors bot pushed a commit that referenced this pull request Mar 10, 2025
… analogous to #22215 (#22753)

This PR increases the `simp` priority of a lemma to avoid a `simpNF` timeout. It is analogous to #22215. It is needed to fix the nightly-with-mathlib build.

Edit: this has been cherry-picked to the nightly-testing branch.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Mar 10, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(RingTheory/LocalRing/ResidueField/Ideal): increase simp prio, analogous to #22215 [Merged by Bors] - chore(RingTheory/LocalRing/ResidueField/Ideal): increase simp prio, analogous to #22215 Mar 10, 2025
@mathlib-bors mathlib-bors bot closed this Mar 10, 2025
@mathlib-bors mathlib-bors bot deleted the algebraMap_residueField_eq_zero branch March 10, 2025 13:59
@JovanGerb
Copy link
Copy Markdown
Contributor Author

  • time synthesis before and after for the general problem with import Mathlib

I had some trouble understanding what you mean. I think you mean a sort of analogue to the simpNF linter, where we run type class search on the general pattern where we would expect the particular instance to apply (but we don't supply the type class conditions).

So in this example it would measure how much time synthesizing (and failing) [IsJacobsonRing R] [IsArtinianRing A] takes for fixed R and A.

@mattrobball
Copy link
Copy Markdown
Contributor

Here I would mean something like

import Mathlib 

variable (R : Type*)  (M : Type*) [Semiring R]  [AddCommMonoid M] [Module R M]

set_option trace.profiler true in
#synth Module.Finite R M 

attribute [-instance] Module.finite_of_isArtinianRing

set_option trace.profiler true in
#synth Module.Finite R M 

I am more concerned with slow failing searches than making existing successful searches worse.

tukamilano pushed a commit that referenced this pull request Mar 20, 2025
… analogous to #22215 (#22753)

This PR increases the `simp` priority of a lemma to avoid a `simpNF` timeout. It is analogous to #22215. It is needed to fix the nightly-with-mathlib build.

Edit: this has been cherry-picked to the nightly-testing branch.
idontgetoutmuch pushed a commit to idontgetoutmuch/mathlib4 that referenced this pull request Apr 7, 2025
… analogous to leanprover-community#22215 (leanprover-community#22753)

This PR increases the `simp` priority of a lemma to avoid a `simpNF` timeout. It is analogous to leanprover-community#22215. It is needed to fix the nightly-with-mathlib build.

Edit: this has been cherry-picked to the nightly-testing branch.
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-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants