Skip to content

[Merged by Bors] - feat(Algebra/Group): some API lemmas for powMonoidHom#36458

Closed
MichaelStollBayreuth wants to merge 13 commits intoleanprover-community:masterfrom
MichaelStollBayreuth:MS_API_powMonoidHom_1
Closed

[Merged by Bors] - feat(Algebra/Group): some API lemmas for powMonoidHom#36458
MichaelStollBayreuth wants to merge 13 commits intoleanprover-community:masterfrom
MichaelStollBayreuth:MS_API_powMonoidHom_1

Conversation

@MichaelStollBayreuth
Copy link
Copy Markdown
Contributor

@MichaelStollBayreuth MichaelStollBayreuth commented Mar 10, 2026

This adds a few lemmas about powMonoidHom/nsmulAddMonoidHom and one convenience lemma that says that the range (as a MonoidHom/AddMonoidHom) of a MulEquiv/AddEquiv is the top subobject.

It also defines the isomorphism ((i : ι) → A i) ⧸ (powMonoidHom n).range ≃* ((i : ι) → A i ⧸ (powMonoidHom n).range) and its additive version.


Open in Gitpod

@MichaelStollBayreuth MichaelStollBayreuth added the t-algebra Algebra (groups, rings, fields, etc) label Mar 10, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 10, 2026

PR summary 7d8e8ab565

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Algebra.Group.Subgroup.Ker 411 412 +1 (+0.24%)
Import changes for all files
Files Import difference
9 files Mathlib.Algebra.Group.Graph Mathlib.Algebra.Group.Subgroup.Ker Mathlib.GroupTheory.Coprod.Basic Mathlib.GroupTheory.FreeGroup.Basic Mathlib.GroupTheory.FreeGroup.IsFreeGroup Mathlib.GroupTheory.FreeGroup.Orbit Mathlib.GroupTheory.FreeGroup.Reduce Mathlib.GroupTheory.NoncommCoprod Mathlib.GroupTheory.Subgroup.Saturated
1

Declarations diff

+ map_range_powMonoidHom
+ mulEquivPiModRangePowMonoidHom
+ mulEquivPiModRangePowMonoidHom_apply
+ range_castAddHom
+ range_eq_top
+ range_nsmulAddMonoidHom
+ subgroupOf_map_powMonoidHom_eq_range
- Int.range_castAddHom

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

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

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./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).

/-- The multiplication-by-`n` map commutes with isomorphisms. -/]
lemma powMonoidHom_comm (e : M ≃* N) (n : ℕ) :
(e : M →* N).comp (powMonoidHom n) = (powMonoidHom n).comp e := by
ext1
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.

I think we should just use ext, so not to suggest that we need a particular depth.

Suggested change
ext1
ext

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.

I thought ext1 is more efficient as it doesn't have to check whether further extensionality lemmas can be applied after the first. Are there guidelines regarding this?

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.

Following the discussion on Zulip (#mathlib4 > ext1 vs. ext @ 💬) I have now changed ext1 to ext : 1.
@Vierkantor Is this OK for you now? I'd like to get this in; I have a follow-up PR that depends on it...

@Vierkantor Vierkantor added the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 11, 2026
@MichaelStollBayreuth
Copy link
Copy Markdown
Contributor Author

@Vierkantor Thanks! I've implemented your suggestions except ext1 --> ext. See my question above.

@MichaelStollBayreuth MichaelStollBayreuth removed the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 11, 2026
@dagurtomas dagurtomas removed their assignment Mar 19, 2026
@dagurtomas dagurtomas requested a review from Vierkantor March 19, 2026 17:05
map and the product of the quotients by the images of the multiplication-by-`n` maps
on the factors. -/ ]
noncomputable
def mulEquivPiModRangePowMonoidHom {ι : Type*} (A : ι → Type*) [∀ i, CommGroup (A i)] (n : ℕ) :
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.

Can you add a small API around this definition? Also, I wonder if it can generalized to a product of morphisms in a useful way.

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.

What kind of API lemmas are you thinking of?

The point here is that powMonoidHom n is a "universal" endomorphism of abelian groups.

To generalize this, one needs to

  • define the "product MonoidHom" ((i : ι) → (A i →* B i)) → (((i : ι) → A i) →* ((i : ι) → B i)), which doesn't seem to be there yet;
  • prove the general result (with the range of the product hom in the quotient on the left);
  • show that the product hom of powMonoidHom n is again powMonoidHom n;
  • deduce the definition as given.

While I agree that this could be useful, it smells a bit of mission creep. I could add a TODO.

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.

The generalization is maybe too long for this PR, but the API saying what the map actually does on classes should be easy.

Copy link
Copy Markdown
Contributor Author

@MichaelStollBayreuth MichaelStollBayreuth Mar 23, 2026

Choose a reason for hiding this comment

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

OK; I'll add _apply and _apply_apply lemmas (made simp).

By now I also have code for the generalization (~50 lines); I'll make another PR for that after this is merged.

(The _apply_apply lemma is proved by simp using _apply, so should not be necessary.)

Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Thanks!

bors r+

@mathlib-triage mathlib-triage bot added the ready-to-merge This PR has been sent to bors. label Mar 26, 2026
mathlib-bors bot pushed a commit that referenced this pull request Mar 26, 2026
This adds a few lemmas about `powMonoidHom`/`nsmulAddMonoidHom` and one convenience lemma that says that the range (as a `MonoidHom`/`AddMonoidHom`) of a `MulEquiv`/`AddEquiv` is the top subobject.

It also defines the isomorphism `((i : ι) → A i) ⧸ (powMonoidHom n).range ≃* ((i : ι) → A i ⧸ (powMonoidHom n).range)` and its additive version.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Mar 26, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(Algebra/Group): some API lemmas for powMonoidHom [Merged by Bors] - feat(Algebra/Group): some API lemmas for powMonoidHom Mar 26, 2026
@mathlib-bors mathlib-bors bot closed this Mar 26, 2026
justus-springer pushed a commit to justus-springer/mathlib4 that referenced this pull request Mar 28, 2026
…munity#36458)

This adds a few lemmas about `powMonoidHom`/`nsmulAddMonoidHom` and one convenience lemma that says that the range (as a `MonoidHom`/`AddMonoidHom`) of a `MulEquiv`/`AddEquiv` is the top subobject.

It also defines the isomorphism `((i : ι) → A i) ⧸ (powMonoidHom n).range ≃* ((i : ι) → A i ⧸ (powMonoidHom n).range)` and its additive version.
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.

5 participants