Skip to content

[Merged by Bors] - chore: replace numeric projections in Mathlib/Algebra/* - #45722

Closed
thorimur wants to merge 2 commits into
leanprover-community:masterfrom
thorimur:num-proj-lint-skimmer-algebra
Closed

thorimur wants to merge 2 commits into
leanprover-community:masterfrom
thorimur:num-proj-lint-skimmer-algebra

Conversation

@thorimur

@thorimur thorimur commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

This PR replaces numeric projections with their field names in Mathlib/Algebra/* in preparation for the upcoming numeric projections linter in #45389.


This PR converts numeric projections into the following field names:

Details
 app,
 cast_eq_zero_iff,
 cone,
 cont,
 elim,
 exists_of_eq,
 exists_pair_ne,
 ge,
 genWeightSpace_ne_bot',
 head,
 hom',
 hom_inv_id,
 im,
 inj',
 inv,
 invFun,
 inv_hom_id,
 inv_val,
 isColimit,
 isOpen_preimage,
 isTopologicalAddGroup,
 isUnit_or_isUnit,
 le,
 left,
 left_cancellation,
 lower',
 map_add,
 map_add_const',
 map_smul,
 map_units,
 monotone',
 mulSaturated,
 nodup,
 not_isUnit,
 obj,
 out,
 prop,
 property,
 pt,
 re,
 right,
 smul_mem',
 surj,
 tail,
 toAddSubmonoid,
 toBialgHom',
 toCoalgHom',
 toComma,
 toFun,
 toIsComplex,
 topologicalSpace,
 upper',
 val,
 val_inv,
 zero

All parts of the diff of this PR are replacements of a numeric projection with an identifier component, or are whitespace changes.

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

PR summary 711d6c8aca

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ instance (A : FGAlgCat R) : Algebra.FiniteType R A.obj := A.property
+ instance (M : TopModuleCat R) : IsTopologicalAddGroup M := M.isTopologicalAddGroup
+ instance (M : TopModuleCat R) : TopologicalSpace M := M.topologicalSpace
+ instance : IsTorsionFree R R where isSMulRegular _r hr := hr.left
+ instance : IsTorsionFree Rᵐᵒᵖ R where isSMulRegular _r hr := hr.unop.right
- instance (A : FGAlgCat R) : Algebra.FiniteType R A.1 := A.2
- instance (M : TopModuleCat R) : IsTopologicalAddGroup M := M.3
- instance (M : TopModuleCat R) : TopologicalSpace M := M.2
- instance : IsTorsionFree R R where isSMulRegular _r hr := hr.1
- instance : IsTorsionFree Rᵐᵒᵖ R where isSMulRegular _r hr := hr.unop.2

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.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 711d6c8).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.
No changes to weak technical debt.

Current commit 711d6c8aca
Reference commit e293c42021

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.py 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 Nov 5, 2026
@grunweg

grunweg commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

To me, seeing .toFun has a bit of a code smell, but the ones in this PR seem not obviously wrong. I think we can merge this.
bors d+

@mathlib-bors mathlib-bors Bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Nov 8, 2026
@mathlib-bors

mathlib-bors Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

✌️ thorimur can now approve this pull request until 2026-11-22 09:05 UTC (in 2 weeks). To approve and merge, reply with bors r+. More detailed instructions are available here.

⚠️ This delegation only covers changes within Archive/**, Counterexamples/**, docs/**, DownstreamTest/**, Mathlib/**, MathlibTest/**, Wanted/**, widget/**, Archive.lean, Counterexamples.lean, docs.lean, Mathlib.lean, Wanted.lean; an author commit touching anything else will revoke it. Bors also revokes it if a later push changes too many files for it to check the full list — even if it stays within scope.

@thorimur

thorimur commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

bors r+

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Nov 9, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Nov 9, 2026
This PR replaces numeric projections with their field names in Mathlib/Algebra/* in preparation for the upcoming numeric projections linter in #45389.
@mathlib-bors mathlib-bors Bot added bors-staging This PR is currently being built by bors on the staging branch. awaiting-requeue This PR was on the bors queue but came off after a build failure or other issue. labels Nov 9, 2026
@mathlib-bors

mathlib-bors Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Timed out.

Fix if necessary, and then someone with permission can run bors r+ or bors retry.

@mathlib-bors mathlib-bors Bot removed ready-to-merge This PR has been sent to bors. bors-staging This PR is currently being built by bors on the staging branch. labels Nov 9, 2026
@thorimur

thorimur commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

I'm guessing this was github's recent incidents? Not sure, though. Let's try again and see what happens.

bors r+

@mathlib-bors mathlib-bors Bot added ready-to-merge This PR has been sent to bors. and removed awaiting-requeue This PR was on the bors queue but came off after a build failure or other issue. labels Nov 9, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Nov 9, 2026
This PR replaces numeric projections with their field names in Mathlib/Algebra/* in preparation for the upcoming numeric projections linter in #45389.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Nov 9, 2026
@mathlib-bors

mathlib-bors Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title chore: replace numeric projections in Mathlib/Algebra/* [Merged by Bors] - chore: replace numeric projections in Mathlib/Algebra/* Nov 9, 2026
@mathlib-bors mathlib-bors Bot closed this Nov 9, 2026
@mathlib-bors mathlib-bors Bot removed the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Nov 9, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Nov 18, 2026
Takes num-proj-lint-skimmer-algebra (#45722) from upstream/master, where it has landed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. 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