Skip to content

chore: rename SemilinearMapClass.semilinearMap to LinearMap.ofClass - #43376

Open
grunweg wants to merge 9 commits into
leanprover-community:masterfrom
grunweg:semilinearmap-ofclass
Open

chore: rename SemilinearMapClass.semilinearMap to LinearMap.ofClass#43376
grunweg wants to merge 9 commits into
leanprover-community:masterfrom
grunweg:semilinearmap-ofclass

Conversation

@grunweg

@grunweg grunweg commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This rename is a small part of #31365, step (2) and the analogue of #43368 for semi-linear maps.

In addition, this PR goes one step further by removing the existing LinearMap.ofClass: both definitions mean the same, so we only need one. Note that neither LinearMap nor SemilinearMap is a definition, and LinearMapClass is defined in terms of SemilinearMapClass.

Rename a few lemmas using ofClass, so their names match the naming convention.
And delete LinearMap.coe_semilinearMap, which would have been misnamed now, as an exact duplicate of the now-called LinearMap.coe_ofClass.


Open in Gitpod

@grunweg
grunweg requested a review from mcdoll September 3, 2026 06:29
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

PR summary 4b21aa9501

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ LinearMapClass.linearMap
+ SemilinearMapClass.semilinearMap
+ coe_ofClass
+ ofClass_eq_toLinearMap
+ ofClass_injective
+ toLinearMap_eq_ofClass
- instCoeToLinearMap
- linearMap
- semilinearMap

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

  • +6 new declarations
  • −3 removed declarations
+LinearEquiv.toLinearMap_eq_ofClass
+LinearMap.coe_ofClass
+LinearMap.ofClass.congr_simp
+LinearMap.ofClass_injective
-LinearMapClass.instCoeToLinearMap
+Representation.IntertwiningMap.ofClass_eq_toLinearMap
-SemilinearMapClass.semilinearMap.congr_simp
+instIsLocalizedModuleTensorProductOfClassAlgHomToAlgHom
-instIsLocalizedModuleTensorProductSemilinearMapAlgHomToAlgHom

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

Current commit 4b21aa9501
Reference commit a4d9f2fdd2

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-ring-theory Ring theory label Sep 3, 2026
@grunweg grunweg changed the title chore: rename SemiinearMapClass.semilinearMap to SemilinearMap.ofClass chore: rename SemilinearMapClass.semilinearMap to SemilinearMap.ofClass Sep 3, 2026
@mcdoll

mcdoll commented Sep 3, 2026

Copy link
Copy Markdown
Member

I think your deprecation is not correct, see the bot above

@mcdoll mcdoll added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 3, 2026
Comment thread Mathlib/Algebra/Module/LinearMap/Defs.lean Outdated
@grunweg

grunweg commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Good catch! Should be fixed now.

@grunweg grunweg removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 3, 2026
Comment thread Mathlib/RepresentationTheory/Intertwining.lean
Comment thread Mathlib/Algebra/Module/LinearMap/Defs.lean Outdated
@github-actions github-actions Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 3, 2026
@grunweg
grunweg force-pushed the semilinearmap-ofclass branch from 573303e to 4996b16 Compare September 7, 2026 07:03
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 7, 2026

/-- The range of a linear map from a finite module is finite. -/
instance range [Module.Finite R M] (f : M →ₗ[R] N) : Module.Finite R f.range :=
of_surjective (SemilinearMapClass.semilinearMap f).rangeRestrict

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This proof was just unnecessarily convoluted: the SemilinearMapClass.semilinearMap was already doing nothing.

Comment thread Mathlib/Algebra/Module/LinearMap/Defs.lean Outdated
@grunweg grunweg added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 7, 2026
theorem coe_semilinearMap {F : Type*} [FunLike F M M₃] [SemilinearMapClass F σ M M₃] (f : F) :
((f : M →ₛₗ[σ] M₃) : M → M₃) = f :=
rfl
@[deprecated (since := "2026-09-07")] alias coe_semilinearMap := coe_ofClass

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These statements were exact duplicates even before this PR.

@grunweg grunweg changed the title chore: rename SemilinearMapClass.semilinearMap to SemilinearMap.ofClass chore: rename SemilinearMapClass.semilinearMap to LinearMap.ofClass Sep 7, 2026
@grunweg

grunweg commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

I have reworked the PR.
-awaiting-author

@github-actions github-actions Bot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 7, 2026
Comment thread Mathlib/Algebra/Module/LinearMap/Defs.lean Outdated
Comment thread Mathlib/RingTheory/Bialgebra/Convolution.lean Outdated
Comment thread Mathlib/RingTheory/Bialgebra/Convolution.lean Outdated
Comment thread Mathlib/Algebra/Module/LinearMap/Defs.lean Outdated
grunweg and others added 2 commits September 7, 2026 13:31
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
@themathqueen themathqueen added t-algebra Algebra (groups, rings, fields, etc) and removed t-ring-theory Ring theory labels Sep 7, 2026
Comment thread Mathlib/Algebra/Module/LinearMap/Defs.lean

@themathqueen themathqueen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

maintainer delegate

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

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

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Sep 7, 2026
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>

@j-loreaux j-loreaux 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.

Thanks!

bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Sep 8, 2026
@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Sep 8, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 8, 2026
…43376)

This rename is a small part of #31365, step (2) and the analogue of #43368 for semi-linear maps.

In addition, this PR goes one step further by removing the existing `LinearMap.ofClass`: both definitions mean the same, so we only need one. Note that neither `LinearMap` nor `SemilinearMap` is a definition, and `LinearMapClass` is defined in terms of `SemilinearMapClass`.

Rename a few lemmas using `ofClass`, so their names match the naming convention.
And delete `LinearMap.coe_semilinearMap`, which would have been misnamed now, as an exact duplicate of the now-called `LinearMap.coe_ofClass`.
@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 Sep 8, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Build failed:

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 Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-requeue This PR was on the bors queue but came off after a build failure or other issue. t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants