Skip to content

[Merged by Bors] - chore: standardise names for coercions from morphism classes to morphisms - #43367

Closed
grunweg wants to merge 9 commits into
leanprover-community:masterfrom
grunweg:staralgequiv-experiment
Closed

[Merged by Bors] - chore: standardise names for coercions from morphism classes to morphisms#43367
grunweg wants to merge 9 commits into
leanprover-community:masterfrom
grunweg:staralgequiv-experiment

Conversation

@grunweg

@grunweg grunweg commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Following item (2) in #31365, the definition which implements the coercion from a morphism class FooHomClass to FooHoms should be called FooHom.ofClass.

  • the name is easy to remember and guess
  • it matches the existing names we have for the corresponding declarations for subobjects
  • when Lean expects a FooHom, you can write .ofClass f.

Make five more morphism classes follow this pattern.


Open in Gitpod

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

PR summary 6947e22e01

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ OrderIso.ofClass
+ StarAlgEquiv.ofClass
+ StarAlgEquivClass.instCoeHead
+ StarAlgEquivClass.toStarAlgEquiv
+ _root_.NonUnitalStarAlgHom.ofClass
+ _root_.NonUnitalStarRingHom.ofClass
+ _root_.OrderHom.ofClass
+ _root_.StarAlgHom.ofClass
+ _root_.StarRingEquiv.ofClass
+ instance : PreservesFiniteColimits (OrderHom.ofClass f).toFunctor
+ instance : PreservesFiniteLimits (OrderHom.ofClass f).toFunctor
- instCoeHead
- instance : PreservesFiniteColimits (toOrderHom f).toFunctor
- instance : PreservesFiniteLimits (toOrderHom f).toFunctor
- toStarAlgEquiv

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

  • +15 new declarations
  • −8 removed declarations
+CategoryTheory.Limits.CompleteLattice.instPreservesFiniteColimitsToFunctorOfClass
-CategoryTheory.Limits.CompleteLattice.instPreservesFiniteColimitsToFunctorToOrderHom
+CategoryTheory.Limits.CompleteLattice.instPreservesFiniteLimitsToFunctorOfClass
-CategoryTheory.Limits.CompleteLattice.instPreservesFiniteLimitsToFunctorToOrderHom
+NonUnitalStarAlgHom.ofClass
+NonUnitalStarAlgHom.ofClass.congr_simp
-NonUnitalStarAlgHomClass.toNonUnitalStarAlgHom.congr_simp
+NonUnitalStarRingHom.ofClass
+OrderHom.ofClass
+OrderHom.ofClass.congr_simp
-OrderHomClass.toOrderHom.congr_simp
+OrderIso.ofClass
+OrderIso.ofClass.congr_simp
-OrderIsoClass.toOrderIso.congr_simp
+StarAlgEquiv.ofClass
+StarAlgEquiv.ofClass.congr_simp
-StarAlgEquivClass.toStarAlgEquiv.congr_simp
+StarAlgHom.ofClass
+StarAlgHom.ofClass.congr_simp
-StarAlgHomClass.toStarAlgHom.congr_simp
+StarRingEquiv.ofClass
+StarRingEquiv.ofClass.congr_simp
-StarRingEquivClass.toStarRingEquiv.congr_simp

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

Current commit 6947e22e01
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).

@mcdoll

mcdoll commented Sep 3, 2026

Copy link
Copy Markdown
Member

Thanks!
maintainer merge

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Sep 3, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts 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 4, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@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 6, 2026
@eric-wieser

Copy link
Copy Markdown
Member

bors d+

Looks great, thanks for splitting into a bitesize piece!

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

mathlib-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

✌️ grunweg can now approve this pull request until 2026-09-21 07:03 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.

@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Sep 7, 2026
@grunweg grunweg added the auto-merge-after-CI Please do not add manually. Requests for a bot to merge automatically once CI is done. label Sep 7, 2026
@mathlib-auto-merge

Copy link
Copy Markdown

As this PR is labelled auto-merge-after-CI, we are now sending it to bors:

bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Sep 7, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 7, 2026
…isms (#43367)

Following item (2) in #31365, the definition which implements the coercion from a morphism class `FooHomClass` to `FooHoms` should be called `FooHom.ofClass`.
- the name is easy to remember and guess
- it matches the existing names we have for the corresponding declarations for subobjects
- when Lean expects a `FooHom`, you can write `.ofClass f`.

Make five more morphism classes follow this pattern.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 7, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

@mathlib-bors mathlib-bors Bot removed the bors-staging This PR is currently being built by bors on the staging branch. label Sep 7, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Sep 7, 2026
…isms (#43367)

Following item (2) in #31365, the definition which implements the coercion from a morphism class `FooHomClass` to `FooHoms` should be called `FooHom.ofClass`.
- the name is easy to remember and guess
- it matches the existing names we have for the corresponding declarations for subobjects
- when Lean expects a `FooHom`, you can write `.ofClass f`.

Make five more morphism classes follow this pattern.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Sep 7, 2026
@mathlib-bors

mathlib-bors Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title chore: standardise names for coercions from morphism classes to morphisms [Merged by Bors] - chore: standardise names for coercions from morphism classes to morphisms Sep 7, 2026
@mathlib-bors mathlib-bors Bot closed this Sep 7, 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 Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-after-CI Please do not add manually. Requests for a bot to merge automatically once CI is done. bors-staging This PR is currently being built by bors on the staging branch. ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants