Skip to content

[Merged by Bors] - refactor: make several NonUnitalAlgHom definitions take a particular algebra homomorphism - #43579

Closed
grunweg wants to merge 11 commits into
leanprover-community:masterfrom
grunweg:concrete-classes-wip
Closed

[Merged by Bors] - refactor: make several NonUnitalAlgHom definitions take a particular algebra homomorphism#43579
grunweg wants to merge 11 commits into
leanprover-community:masterfrom
grunweg:concrete-classes-wip

Conversation

@grunweg

@grunweg grunweg commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

as opposed to a NonUnitalAlgHomClass.
Specifically, this PR changes NonUnitalSubalgebra.{map, comap} as well as NonUnitalAlgHom.{range,rangeRestrict,codRestrict,equalizer}.

Since this removes all uses of a bundled morphism class, we also remove the assocated variable lines
and align them with standard mathlib style.

Adapt (almost) all theorems about them to take in a concrete morphism also.

This follows the general patterns established in #31365:

we should restrict definitions to explicit morphisms, instead of morphism classes in order to avoid proliferating definitions.

Given a definition Bar that takes FooHom as an argument, a theorem whose statement involves Bar should only ever be written for FooHoms and never FooHomClasses. Indeed in the latter case, the statement would require the coercion from the morphism class to the morphism, thereby making it less general.


Continuation of #43377.

Open in Gitpod

@grunweg grunweg added the tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

PR summary c31a893819

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

++-- codRestrict
++-- coe_range
++-- mem_range_self

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

⚠️ No declarations diff yet: there is no built master snapshot at this PR's merge-base (typically a bors-batch intermediate that CI never built). Merge master into this PR and push to refresh.


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

Current commit c31a893819
Reference commit 38f65a093a

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 Sep 8, 2026
Comment thread Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean Outdated
Comment thread Mathlib/Algebra/Star/NonUnitalSubalgebra.lean Outdated
@themathqueen themathqueen added awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. labels Sep 8, 2026
Comment thread Mathlib/Algebra/Star/NonUnitalSubalgebra.lean Outdated
Comment thread Mathlib/Algebra/Star/NonUnitalSubalgebra.lean Outdated
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Sep 8, 2026
Comment thread Mathlib/Algebra/Star/NonUnitalSubalgebra.lean Outdated
Comment thread Mathlib/Algebra/Star/NonUnitalSubalgebra.lean Outdated
grunweg and others added 2 commits September 8, 2026 22:52
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
Comment thread Mathlib/Algebra/Star/NonUnitalSubalgebra.lean Outdated
@grunweg grunweg removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Sep 8, 2026
Co-authored-by: Monica Omar <23701951+themathqueen@users.noreply.github.com>
Comment thread Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean Outdated
Comment thread Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean Outdated

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

Looks good! Thanks!

maintainer delegate

@github-actions

github-actions Bot commented Sep 9, 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 9, 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 9, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
…algebra homomorphism (#43579)

as opposed to a `NonUnitalAlgHomClass`.
Specifically, this PR changes `NonUnitalSubalgebra.{map, comap}` as well as `NonUnitalAlgHom.{range,rangeRestrict,codRestrict,equalizer}`.

Since this removes all uses of a bundled morphism class, we also remove the assocated variable lines
and align them with standard mathlib style.

Adapt (almost) all theorems about them to take in a concrete morphism also.

This follows the general patterns established in #31365:
> we should restrict definitions to explicit morphisms, instead of morphism classes in order to avoid proliferating definitions.

> Given a definition Bar that takes FooHom as an argument, a theorem whose statement involves Bar should only ever be written for FooHoms and never FooHomClasses. Indeed in the latter case, the statement would require the coercion from the morphism class to the morphism, thereby making it less general.
@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Sep 9, 2026
@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 9, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 9, 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 9, 2026
@grunweg

grunweg commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

CI error looks intermittent and unrelated:
bors merge

@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 Sep 9, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
…algebra homomorphism (#43579)

as opposed to a `NonUnitalAlgHomClass`.
Specifically, this PR changes `NonUnitalSubalgebra.{map, comap}` as well as `NonUnitalAlgHom.{range,rangeRestrict,codRestrict,equalizer}`.

Since this removes all uses of a bundled morphism class, we also remove the assocated variable lines
and align them with standard mathlib style.

Adapt (almost) all theorems about them to take in a concrete morphism also.

This follows the general patterns established in #31365:
> we should restrict definitions to explicit morphisms, instead of morphism classes in order to avoid proliferating definitions.

> Given a definition Bar that takes FooHom as an argument, a theorem whose statement involves Bar should only ever be written for FooHoms and never FooHomClasses. Indeed in the latter case, the statement would require the coercion from the morphism class to the morphism, thereby making it less general.
@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 9, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 9, 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 9, 2026
@bryangingechen

Copy link
Copy Markdown
Contributor

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 Sep 9, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 9, 2026
…algebra homomorphism (#43579)

as opposed to a `NonUnitalAlgHomClass`.
Specifically, this PR changes `NonUnitalSubalgebra.{map, comap}` as well as `NonUnitalAlgHom.{range,rangeRestrict,codRestrict,equalizer}`.

Since this removes all uses of a bundled morphism class, we also remove the assocated variable lines
and align them with standard mathlib style.

Adapt (almost) all theorems about them to take in a concrete morphism also.

This follows the general patterns established in #31365:
> we should restrict definitions to explicit morphisms, instead of morphism classes in order to avoid proliferating definitions.

> Given a definition Bar that takes FooHom as an argument, a theorem whose statement involves Bar should only ever be written for FooHoms and never FooHomClasses. Indeed in the latter case, the statement would require the coercion from the morphism class to the morphism, thereby making it less general.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 9, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title refactor: make several NonUnitalAlgHom definitions take a particular algebra homomorphism [Merged by Bors] - refactor: make several NonUnitalAlgHom definitions take a particular algebra homomorphism Sep 9, 2026
@mathlib-bors mathlib-bors Bot closed this Sep 9, 2026
@grunweg
grunweg deleted the concrete-classes-wip branch September 9, 2026 22:37
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) tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants