Skip to content

[Merged by Bors] - feat(Tactic/Ring): handle ℤ-scalar multiplication in the ring tactic - #29782

Closed
hrmacbeth wants to merge 4 commits into
masterfrom
ring-zsmul
Closed

hrmacbeth wants to merge 4 commits into
masterfrom
ring-zsmul

Conversation

@hrmacbeth

@hrmacbeth hrmacbeth commented Sep 18, 2025 •

Copy link
Copy Markdown
Member

ring handles ℕ-scalar multiplication; it seems like an accidental omission that it doesn't handle ℤ-scalar multiplication. This PR adds that feature. Everything is directly adapted from the ℕ case.

A notable use case for this feature: often abel_nf output contains ℤ-scalar multiplication, so it's important that this can be handled if needed in subsequent ring calls.


Open in Gitpod

@hrmacbeth hrmacbeth added the t-meta Tactics, attributes or user commands label Sep 18, 2025
@github-actions

github-actions Bot commented Sep 18, 2025 •

Copy link
Copy Markdown

PR summary 432a037a7f

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Topology.Category.Profinite.Nobeling.Span 1648 1649 +1 (+0.06%)
Import changes for all files
Files Import difference
Mathlib.Topology.Category.Profinite.Nobeling.Span 1

Declarations diff

+ Cache.int
+ evalZSMul
+ instCommSemiringInt
+ intCast_add
+ intCast_mul
+ intCast_negOfNat_Int
+ intCast_zero
+ natCast_int
+ smul_eq_intCast
+ smul_int
+ sℤ
+ zsmul_congr

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

@hrmacbeth
hrmacbeth marked this pull request as ready for review September 18, 2025 20:13
Comment thread Mathlib/Tactic/Ring/Basic.lean Resolved
Comment thread Mathlib/Tactic/Ring/Basic.lean Resolved
@adomani

adomani commented Sep 19, 2025

Copy link
Copy Markdown
Contributor

!bench

@adomani adomani 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 never used myself Qq, but everything in this PR looks good!

Comment thread Mathlib/Tactic/Ring/Basic.lean Resolved

@Vierkantor Vierkantor 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.

Otherwise, looks good to me, thanks!

@leanprover-bot

Copy link
Copy Markdown

Here are the benchmark results for commit abcf549.
There were no significant changes against commit 937c094.

@github-actions

Copy link
Copy Markdown
File Instructions %
build +3.65⬝10⁹ (+0.00%)
Mathlib.Tactic.Ring.Basic +6.506⬝10⁹ (+8.74%)
Mathlib.Topology.Category.Profinite.Nobeling.Span +1.93⬝10⁹ (+6.27%)
CI run Lakeprof report

@adomani adomani 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 am happy with the current state and I think that this is already an improvement.

@Vierkantor, I am going to delegate you, in case you are not convinced by Heather's argument! 😄

bors d=Vierkantor

Comment thread MathlibTest/ring.lean Resolved
@mathlib-bors

mathlib-bors Bot commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

✌️ Vierkantor can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Sep 22, 2025
@Vierkantor

Copy link
Copy Markdown
Contributor

I think the error you're getting is something transient, but it is blocking bors on other PRs. So I can't bors r+ this yet.

bors d=@hrmacbeth

@mathlib-bors

mathlib-bors Bot commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

✌️ hrmacbeth can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@Vierkantor

Copy link
Copy Markdown
Contributor

Thanks for the PR!

@hrmacbeth

Copy link
Copy Markdown
Member Author

bors r+

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Sep 22, 2025
mathlib-bors Bot pushed a commit that referenced this pull request Sep 22, 2025
#29782)

`ring` handles ℕ-scalar multiplication; it seems like an accidental omission that it doesn't handle ℤ-scalar multiplication. This PR adds that feature. Everything is directly adapted from the ℕ case.

A notable use case for this feature: often `abel_nf` output contains ℤ-scalar multiplication, so it's important that this can be handled if needed in subsequent `ring` calls.
@mathlib-bors

mathlib-bors Bot commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(Tactic/Ring): handle ℤ-scalar multiplication in the ring tactic [Merged by Bors] - feat(Tactic/Ring): handle ℤ-scalar multiplication in the ring tactic Sep 22, 2025
@mathlib-bors mathlib-bors Bot closed this Sep 22, 2025
@mathlib-bors
mathlib-bors Bot deleted the ring-zsmul branch September 22, 2025 11:55
joelriou pushed a commit to joelriou/mathlib4 that referenced this pull request Oct 2, 2025
leanprover-community#29782)

`ring` handles ℕ-scalar multiplication; it seems like an accidental omission that it doesn't handle ℤ-scalar multiplication. This PR adds that feature. Everything is directly adapted from the ℕ case.

A notable use case for this feature: often `abel_nf` output contains ℤ-scalar multiplication, so it's important that this can be handled if needed in subsequent `ring` calls.
zhuyizheng pushed a commit to zhuyizheng/mathlib4 that referenced this pull request Oct 2, 2025
leanprover-community#29782)

`ring` handles ℕ-scalar multiplication; it seems like an accidental omission that it doesn't handle ℤ-scalar multiplication. This PR adds that feature. Everything is directly adapted from the ℕ case.

A notable use case for this feature: often `abel_nf` output contains ℤ-scalar multiplication, so it's important that this can be handled if needed in subsequent `ring` calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants