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(group_theory/monoid_localization): flip the direction of multiplication #15584

Closed
wants to merge 38 commits into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Jul 21, 2022

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.


Open in Gitpod

cc @@jjaassoonn

…tiplication

This will allow `localization` and `module_localization` to be defeq.
Mathematically this makes no difference.
@eric-wieser eric-wieser added the awaiting-CI The author would like to see what CI has to say before doing more work. label Jul 21, 2022
@eric-wieser eric-wieser requested a review from a team as a code owner December 11, 2022 16:48
@eric-wieser eric-wieser added the awaiting-review The author would like community review of the PR label Dec 12, 2022
@riccardobrasca
Copy link
Member

I think this is a good idea to have localization and module_localization defeq. Can you please fix the conflict? Thanks!

Copy link
Collaborator

@alreadydone alreadydone left a 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.

src/algebraic_geometry/projective_spectrum/scheme.lean Outdated Show resolved Hide resolved
src/algebraic_geometry/structure_sheaf.lean Outdated Show resolved Hide resolved
src/field_theory/ratfunc.lean Show resolved Hide resolved
src/field_theory/ratfunc.lean Show resolved Hide resolved
src/ring_theory/localization/at_prime.lean Outdated Show resolved Hide resolved
src/ring_theory/localization/basic.lean Show resolved Hide resolved
src/ring_theory/localization/basic.lean Show resolved Hide resolved
@alreadydone alreadydone added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Dec 27, 2022
eric-wieser and others added 3 commits January 9, 2023 12:42
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'
Copy link
Member Author

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?

Copy link
Collaborator

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.

@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jan 12, 2023
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',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
rw [mul_comm, mul_assoc, mul_comm _ ↑m', ← pow_succ, ← mul_pow] at hm',
rw [← mul_left_comm, ← pow_succ, ← mul_pow] at hm',

Comment on lines +349 to +350
haveI : smul_comm_class R M M :=
⟨λ r m₁ m₂, by simp_rw [smul_eq_mul, mul_comm m₁, smul_mul_assoc]⟩,
Copy link
Collaborator

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:

Suggested change
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?

Copy link
Member Author

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.

Copy link
Collaborator

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.

Copy link
Member Author

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

src/field_theory/ratfunc.lean Show resolved Hide resolved
@alreadydone
Copy link
Collaborator

maintainer merge

@github-actions
Copy link

🚀 Pull request has been placed on the maintainer queue by alreadydone.

@riccardobrasca
Copy link
Member

Thanks!

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Jan 22, 2023
bors bot pushed a commit that referenced this pull request Jan 22, 2023
…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>
@bors
Copy link

bors bot commented Jan 22, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title refactor(group_theory/monoid_localization): flip the direction of multiplication [Merged by Bors] - refactor(group_theory/monoid_localization): flip the direction of multiplication Jan 22, 2023
@bors bors bot closed this Jan 22, 2023
@bors bors bot deleted the eric-wieser/localization-comm branch January 22, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants