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] - feat: port Algebra.Hom.Iterate #1133

Closed
wants to merge 5 commits into from

Conversation

winstonyin
Copy link
Collaborator

@winstonyin winstonyin commented Dec 20, 2022

No description provided.

@winstonyin winstonyin added awaiting-review The author would like community review of the PR mathlib-port This is a port of a theory file from mathlib. labels Dec 20, 2022
theorem smul_iterate [MulAction G H] : ((· • ·) a : H → H)^[n] = (· • ·) (a ^ n) :=
funext fun b =>
Nat.recOn n (by dsimp only; rw [iterate_zero, id.def, pow_zero, one_smul G b])
fun n ih => by dsimp only; rw [iterate_succ', comp_apply, ih, pow_succ, mul_smul]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need dsimp only before rw works. This is happening quite frequently.

variable [Monoid G] (a : G) (n : ℕ)

@[simp, to_additive]
theorem smul_iterate [MulAction G H] : ((· • ·) a : H → H)^[n] = (· • ·) (a ^ n) :=
Copy link
Member

Choose a reason for hiding this comment

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

(· • ·) a is not a faithful port of (•) a which means Smul.smul a

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would you recommend (· • ·) a or Smul.smul a during port?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've changed them to (a • ·) or (a * ·)

@kbuzzard
Copy link
Member

kbuzzard commented Dec 21, 2022

I've just added all the #aligns which to_additive doesn't generate. If anyone knows how to make leanprover-community/mathport#209 happen sooner, that would be great!

variable [Semigroup G] {a b c : G}

-- Porting note: need `dsimp only`, see https://leanprover.zulipchat.com/#narrow/stream/
-- 287929-mathlib4/topic/dsimp.20before.20rw/near/317063489
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, the issue is https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/dsimp.20before.20rw/near/317064195 : (a * ·) t expands to (fun x ↦ a * x) t in lean 4, but ((*)a) t expands to a * t in lean 3, meaning that sometimes you have to dsimp only in Lean 4 to get back on track. You could mention this in the porting note but that's what's going on.

Copy link
Member

@kbuzzard kbuzzard left a comment

Choose a reason for hiding this comment

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

This PR is fine. Thanks!

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

@semorrison semorrison added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Dec 22, 2022
bors bot pushed a commit that referenced this pull request Dec 22, 2022
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
@bors
Copy link

bors bot commented Dec 22, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: port Algebra.Hom.Iterate [Merged by Bors] - feat: port Algebra.Hom.Iterate Dec 22, 2022
@bors bors bot closed this Dec 22, 2022
@bors bors bot deleted the algebra_hom_iterate branch December 22, 2022 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mathlib-port This is a port of a theory file from mathlib. ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants