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(group_theory/monoid_localization): flip the direction of multiplication #15584
Conversation
…tiplication This will allow `localization` and `module_localization` to be defeq. Mathematically this makes no difference.
I think this is a good idea to have |
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.
Sorry, the review request got buried in my mailbox for 2 weeks and only resurfaced due to @riccardobrasca's latest comment. I've now taken a detailed look at the PR, and marked apparent "regressions" (where proofs get longer, etc.) along the way. These are foremost notes to myself and not to imply anything negative about the PR; I just wanted to understand what's going on, and it would be nice if you could say a few words to clarify things for me. I'm in favor of bringing module and ring localizations closer and I'd like to see it merged, and surely the PR shortens a lot of proofs as well.
Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
@@ -137,18 +137,18 @@ of `∀ {p q a : K[X]} (hq : q ≠ 0) (ha : a ≠ 0), f (a * p) (a * q) = f p q) | |||
-/ | |||
@[irreducible] protected def lift_on {P : Sort v} (x : ratfunc K) | |||
(f : ∀ (p q : K[X]), P) | |||
(H : ∀ {p q p' q'} (hq : q ∈ K[X]⁰) (hq' : q' ∈ K[X]⁰), p * q' = p' * q → | |||
(H : ∀ {p q p' q'} (hq : q ∈ K[X]⁰) (hq' : q' ∈ K[X]⁰), q' * p = q * p' → |
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.
@jjaassoonn, do you remember why you changed this in dfcc120?
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 tested the original version. Without flipping p and q, the H q.2 q’.2
on line 143 would not compile.
simp only [mul_assoc, zero_mul] at hm', | ||
rw [mul_comm, ← pow_succ, ← mul_pow] at hm', | ||
simp only [mul_assoc, zero_mul, mul_zero] at hm', | ||
rw [mul_comm, mul_assoc, mul_comm _ ↑m', ← pow_succ, ← mul_pow] at hm', |
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.
rw [mul_comm, mul_assoc, mul_comm _ ↑m', ← pow_succ, ← mul_pow] at hm', | |
rw [← mul_left_comm, ← pow_succ, ← mul_pow] at hm', |
haveI : smul_comm_class R M M := | ||
⟨λ r m₁ m₂, by simp_rw [smul_eq_mul, mul_comm m₁, smul_mul_assoc]⟩, |
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.
Could be replaced by this:
haveI : smul_comm_class R M M := | |
⟨λ r m₁ m₂, by simp_rw [smul_eq_mul, mul_comm m₁, smul_mul_assoc]⟩, | |
rw [mul_comm ↑t, mul_comm ↑t, mul_comm b, mul_comm b'] at ht ⊢, |
A bit weird that we suddenly need commutativity here; is this indicating we should but haven't flipped the direction somewhere?
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.
A bit weird that we suddenly need commutativity here; is this indicating we should but haven't flipped the direction somewhere?
Ah, it seems that actually the right fix is to replace is_scalar_tower R M M
by smul_comm_class R M M
. Do you want me to go ahead and do that? Note this PR is getting dangerously close to the porting tide.
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.
Sorry what I suggested doesn't work as is: I should say the last three lines could be replaced by
rw [mul_comm ↑t, mul_comm ↑t, mul_comm b, mul_comm b'] at ht ⊢,
simp only [smul_mul_assoc, ht],
However, I agree that it's better to change the hypothesis to smul_comm_class
, and this golf works against that, so I'm happy with the current proof. It's up to you whether to make the change; if not, feel free to merge after fixing the conflict.
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 think I'll just leave a TODO comment
57b7a4a
to
80cfeb8
Compare
maintainer merge |
🚀 Pull request has been placed on the maintainer queue by alreadydone. |
Thanks! bors merge |
…tiplication (#15584) In a future PR, this will allow `localization` and `module_localization` to be defeq. Mathematically this makes no difference. For now, only the primed `localization.r'` is defeq to `localized_module.r`. Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com>
Pull request successfully merged into master. Build succeeded: |
In a future PR, this will allow
localization
andmodule_localization
to be defeq.Mathematically this makes no difference.
For now, only the primed
localization.r'
is defeq tolocalized_module.r
.cc @@jjaassoonn