-
Notifications
You must be signed in to change notification settings - Fork 298
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(group_theory/exponent): exponent G = ⨆ g : G, order_of g #10767
Conversation
I finished that one sorry! |
🎉 Great news! Looks like all the dependencies have been resolved:
💡 To add or remove a dependency please update this issue/PR description. Brought to you by Dependent Issues (:robot: ). Happy coding! |
end | ||
|
||
@[to_additive] | ||
lemma exponent_eq_zero_of_order_zero {g : G} (hg : order_of g = 0) : exponent G = 0 := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the name rather be exponent_eq_zero_of_order_of_eq_zero
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like in the rest of the file, order
has been used interchangably with order_of
; I can change it but I prefer snappier names (at least as much as possible within the naming conventions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename order_of
to order
? And update all the names? (Not in this PR, of course.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be in favour of that!
Co-authored-by: Johan Commelin <johan@commelin.net>
src/group_theory/exponent.lean
Outdated
|
||
variable [cancel_comm_monoid G] | ||
|
||
@[to_additive] lemma exponent_eq_Sup_order_of (h : ∀ g : G, 0 < order_of g) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you see any way to split/golf this proof? Intuitively, I think it looks a lot longer than I would expect a proof of this result to be. But I haven't loaded it into VScode yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my only thoughts are that the first half could maybe be made into a private lemma, and the second half could be turned into a calc
; but I'm fairly bad at calc. If you want me to turn the first edge case into a separate lemma, though, I can do that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the order arguments were a lot more finicky here than I expected; I wish I could just say "if g
has order not dividing t
(which maximises the group's order), then g*t
clearly has larger order"; but this statement requires a fair bit more care than I thought
I've extracted the first half of the big proof into a lemma. Because I think it is a generally useful statement. |
thanks! it does look very useful, now that you extracted it. I think I sped up the proof a lot, the main culprit was |
pow_add, pow_add, pow_one, ←mul_assoc, ←mul_assoc, nat.div_mul_cancel, mul_assoc, | ||
lt_mul_iff_one_lt_right $ h t, ←pow_succ'], | ||
exact one_lt_pow hp.1.one_lt a.succ_ne_zero, | ||
exact hpk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really confused as to why, but if you put this hpk
where it belongs in the monster rw
(after nat.div_mul_cancel
) then the rewrite fails completely. ¯\_(ツ)_/¯
src/group_theory/exponent.lean
Outdated
variable [cancel_comm_monoid G] | ||
|
||
@[to_additive] lemma exponent_eq_Sup_order_of (h : ∀ g : G, 0 < order_of g) : | ||
exponent G = Sup (set.range (order_of : G → ℕ)) := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use supr
for Sup (set.range _)
. It's definitionally the same but comes with nice notation and lemmas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, I didn't know about this. Is there an alternative for finset
as well, or should I just leave that as max'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just ended up just rw supr
at the start; it seems to me that for proving things about it the Sup
API is a bit better. But the csupr
induction seemed cool; if I was rewriting the proof, I'd probably use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🎉
bors merge
Precursor to #10692. Co-authored-by: Eric <37984851+ericrbg@users.noreply.github.com> Co-authored-by: Johan Commelin <johan@commelin.net>
Pull request successfully merged into master. Build succeeded: |
Precursor to #10692.
My brain is too frazzled right now, but here's a proof with one sorry of the same fact without thefintype
requirement (forfintype
,order_of_pos
immediately gets us back to this version).