Skip to content

[Merged by Bors] - chore(Algebra/Group/Action/Units): better diamond example - #38703

Closed
kbuzzard wants to merge 1 commit into
leanprover-community:masterfrom
kbuzzard:kbuzzard-better-diamond-example
Closed

kbuzzard wants to merge 1 commit into
leanprover-community:masterfrom
kbuzzard:kbuzzard-better-diamond-example

Conversation

@kbuzzard

@kbuzzard kbuzzard commented Apr 29, 2026 •

Copy link
Copy Markdown
Member

A proposed core change to the instance priority of instSMulOfMul breaks current mathlib because it breaks the demonstration of the instance diamond in this file; the diamond becomes better hidden by the priority change. The new example is robust to all priority changes because it explicitly uses the different instances rather than using typeclass inference to find them. In particular it will not break if instSMulOfMul gets priority greater than the default priority in future versions of Lean (one can check this with local [instance 1100] instSMulOfMul before the code below; it still works, whereas master fails).


Open in Gitpod

@github-actions

Copy link
Copy Markdown

PR summary ccfee270d5

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
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.


No changes to technical debt.

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/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 Apr 29, 2026

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

Thanks 🎉

bors merge

@mathlib-triage mathlib-triage Bot added the ready-to-merge This PR has been sent to bors. label Apr 29, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
A proposed core change to the instance priority of `instSMulOfMul` breaks current mathlib because it breaks the demonstration of the instance diamond in this file; the diamond becomes better hidden by the priority change. The new example is robust to all priority changes because it explicitly uses the different instances rather than using typeclass inference to find them. In particular it will not break if `instSMulOfMul` gets priority greater than the default priority in future versions of Lean (one can check this with `local [instance 1100] instSMulOfMul` before the code below; it still works, whereas `master` fails).
@mathlib-bors

mathlib-bors Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore(Algebra/Group/Action/Units): better diamond example [Merged by Bors] - chore(Algebra/Group/Action/Units): better diamond example Apr 29, 2026
@mathlib-bors mathlib-bors Bot closed this Apr 29, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
#38703 accidentally deleted a docstring. This adds it back (it's still a useful comment).
mathlib-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
#38703 accidentally deleted a docstring. This adds it back (it's still a useful comment).
eric-wieser added a commit to eric-wieser/mathlib4 that referenced this pull request Apr 29, 2026
xroblot pushed a commit to xroblot/mathlib4 that referenced this pull request May 2, 2026
…-community#38703)

A proposed core change to the instance priority of `instSMulOfMul` breaks current mathlib because it breaks the demonstration of the instance diamond in this file; the diamond becomes better hidden by the priority change. The new example is robust to all priority changes because it explicitly uses the different instances rather than using typeclass inference to find them. In particular it will not break if `instSMulOfMul` gets priority greater than the default priority in future versions of Lean (one can check this with `local [instance 1100] instSMulOfMul` before the code below; it still works, whereas `master` fails).
xroblot pushed a commit to xroblot/mathlib4 that referenced this pull request May 2, 2026
leanprover-community#38703 accidentally deleted a docstring. This adds it back (it's still a useful comment).
gaetanserre pushed a commit to gaetanserre/mathlib4 that referenced this pull request May 5, 2026
…-community#38703)

A proposed core change to the instance priority of `instSMulOfMul` breaks current mathlib because it breaks the demonstration of the instance diamond in this file; the diamond becomes better hidden by the priority change. The new example is robust to all priority changes because it explicitly uses the different instances rather than using typeclass inference to find them. In particular it will not break if `instSMulOfMul` gets priority greater than the default priority in future versions of Lean (one can check this with `local [instance 1100] instSMulOfMul` before the code below; it still works, whereas `master` fails).
gaetanserre pushed a commit to gaetanserre/mathlib4 that referenced this pull request May 5, 2026
leanprover-community#38703 accidentally deleted a docstring. This adds it back (it's still a useful comment).
gasparattila pushed a commit to gasparattila/mathlib4 that referenced this pull request May 9, 2026
…-community#38703)

A proposed core change to the instance priority of `instSMulOfMul` breaks current mathlib because it breaks the demonstration of the instance diamond in this file; the diamond becomes better hidden by the priority change. The new example is robust to all priority changes because it explicitly uses the different instances rather than using typeclass inference to find them. In particular it will not break if `instSMulOfMul` gets priority greater than the default priority in future versions of Lean (one can check this with `local [instance 1100] instSMulOfMul` before the code below; it still works, whereas `master` fails).
gasparattila pushed a commit to gasparattila/mathlib4 that referenced this pull request May 9, 2026
leanprover-community#38703 accidentally deleted a docstring. This adds it back (it's still a useful comment).
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.

2 participants