Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - refactor: Redefine pow in terms of iterate #1388

Closed
wants to merge 1 commit into from

Conversation

YaelDillies
Copy link
Collaborator

@YaelDillies YaelDillies commented Jan 6, 2023

In the Monoid instances for Function.End α, Equiv.Perm α, Monoid.End α, AddMonoid.End α, α →+* α, replace the default npowRec by a custom one in terms of Nat.iterate. Write the expected coercion lemmas.

As a consequence, I can delete the recently introduced file Algebra.Ring.Hom.IterateHom.

Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.231388.20Redefine.20pow.20in.20terms.20of.20iterate


Rehash of leanprover-community/mathlib3#18077

@YaelDillies YaelDillies added the mathlib3-pair This PR is a forward-port of a mathlib3 PR or part of one, either under review or recently merged label Jan 6, 2023
@kim-em kim-em added the awaiting-author A reviewer has asked the author a question or requested changes label Mar 26, 2023
@kim-em
Copy link
Contributor

kim-em commented Jul 17, 2023

@YaelDillies, the original mathlib3 PR is marked as too-late, now. I'm removing forward-port-placeholder and mathlib3-pair. Could you prepare it for review directly to mathlib4, or close?

@kim-em kim-em removed mathlib3-pair This PR is a forward-port of a mathlib3 PR or part of one, either under review or recently merged forward-port-placeholder labels Jul 17, 2023
@kim-em
Copy link
Contributor

kim-em commented Jul 17, 2023

Sorry, actually as this PR is empty I'll just close. Just open a new PR if you'd like to bring the material across.

@kim-em kim-em closed this Jul 17, 2023
@YaelDillies YaelDillies reopened this Apr 20, 2024
@YaelDillies YaelDillies added awaiting-review awaiting-CI t-algebra Algebra (groups, rings, fields, etc) and removed awaiting-author A reviewer has asked the author a question or requested changes labels Apr 20, 2024
@YaelDillies YaelDillies changed the title refactor: Redefine pow on Perm in terms of iterate refactor: Redefine pow in terms of iterate Apr 20, 2024
@urkud
Copy link
Member

urkud commented Apr 21, 2024

Let me repeat my concern from Lean3 PR:

Note that if we go forward with this refactor, the monoid structure on CategoryTheory.End (GroupCat.of G) will be no longer defeq to Monoid.End.monoid. I don't know whether we ever rely on this defeq.

@YaelDillies
Copy link
Collaborator Author

I don't understand how that's not fixable. Surely it's just a matter of tweaking the pow defeq in Monoid (CategoryTheory.End (GroupCat.of G))?

@urkud
Copy link
Member

urkud commented May 19, 2024

Monoid (CategoryTheory.End _) is defined uniformly for all categories, you can't fix pow for one category. If you want to be able to do that, then you need to include this data in the definition of Category.

@YaelDillies
Copy link
Collaborator Author

Yeah okay. I must say I don't think it's defeq's job to translate category-theoretic constructs to their group-theoretic equivalents.

The fact that we can do it in simple cases doesn't mean it extends indefinitely and indeed I would rather have a to_additive-like tactic to perform the translation rather than relying on cosmic alignment of definitions.

Right now, this translation sounds like a pretty niche use case anyway?

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-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 May 24, 2024
In the `Monoid` instances for `Function.End α`, `Equiv.Perm α`, `AddMonoid.End α`, `α →+* α`, replace the default `npowRec` by a custom one in terms of `Nat.iterate`. Write the expected coercion lemmas.

As a consequence, I can delete the recently introduced file `Algebra.Ring.Hom.IterateHom`.

fix Algebra.GroupPower.IterateHom

less brackets
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-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 May 24, 2024
@urkud
Copy link
Member

urkud commented May 26, 2024

The issue is not about translation. The issue is that we'll have 2 defeq types (X --> X for some categories) with propeq but not defeq instances about them.

@YaelDillies
Copy link
Collaborator Author

Well they're only defeq because one is a too-transparent type synonym of the other, right? Using that would be defeq abuse.

@urkud
Copy link
Member

urkud commented May 26, 2024

Could you please open a Zulip discussion? I don't want to merge this PR myself, but if another maintainer rules my objection as invalid/irrelevant, then I won't insist.

Copy link
Member

@jcommelin jcommelin 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 merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Jun 5, 2024
@kbuzzard
Copy link
Member

kbuzzard commented Jun 5, 2024

Note that the Zulip discussion is not publicly viewable

mathlib-bors bot pushed a commit that referenced this pull request Jun 5, 2024
In the `Monoid` instances for `Function.End α`, `Equiv.Perm α`, `Monoid.End α`, `AddMonoid.End α`, `α →+* α`, replace the default `npowRec` by a custom one in terms of `Nat.iterate`. Write the expected coercion lemmas.

As a consequence, I can delete the recently introduced file `Algebra.Ring.Hom.IterateHom`.

Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.231388.20Redefine.20pow.20in.20terms.20of.20iterate
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jun 5, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title refactor: Redefine pow in terms of iterate [Merged by Bors] - refactor: Redefine pow in terms of iterate Jun 5, 2024
@mathlib-bors mathlib-bors bot closed this Jun 5, 2024
@mathlib-bors mathlib-bors bot deleted the perm_pow_iterate branch June 5, 2024 09:14
grunweg pushed a commit that referenced this pull request Jun 7, 2024
In the `Monoid` instances for `Function.End α`, `Equiv.Perm α`, `Monoid.End α`, `AddMonoid.End α`, `α →+* α`, replace the default `npowRec` by a custom one in terms of `Nat.iterate`. Write the expected coercion lemmas.

As a consequence, I can delete the recently introduced file `Algebra.Ring.Hom.IterateHom`.

Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.231388.20Redefine.20pow.20in.20terms.20of.20iterate
AntoineChambert-Loir pushed a commit that referenced this pull request Jun 20, 2024
In the `Monoid` instances for `Function.End α`, `Equiv.Perm α`, `Monoid.End α`, `AddMonoid.End α`, `α →+* α`, replace the default `npowRec` by a custom one in terms of `Nat.iterate`. Write the expected coercion lemmas.

As a consequence, I can delete the recently introduced file `Algebra.Ring.Hom.IterateHom`.

Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.231388.20Redefine.20pow.20in.20terms.20of.20iterate
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
No open projects
Status: Awaiting mathlib3 review
Development

Successfully merging this pull request may close these issues.

7 participants