-
Notifications
You must be signed in to change notification settings - Fork 297
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(algebra/order/to_interval_mod): Negate the definition of mem_Ioo_mod
#18912
Conversation
This PR/issue depends on: |
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.
Not sure why there are merge conflicts now ...
/-- `Imodeq p a b` means that `b` does not lie in the open interval `(a, a + p)` modulo `p`. | ||
Equivalently (as shown below), `b` is congruent to `a` modulo `p`, or `to_Ico_mod hp a` disagrees | ||
with `to_Ioc_mod hp a` at `b`, or `to_Ico_div hp a` disagrees with `to_Ioc_div hp a` at `b`. -/ | ||
def Imodeq (p a b : α) : Prop := ∀ z : ℤ, b - z • p ∉ set.Ioo a (a + 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.
Calling this definition Imodeq
sounds weird to me. If you want to unify with smodeq
in the future, wouldn't you take the RHS of Imodeq_iff_eq_mod_zmultiples
as the definition?
This PR looks good to me apart from this issue.
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.
If you want to unify with
smodeq
in the future, wouldn't you take the RHS ofImodeq_iff_eq_mod_zmultiples
as the definition?
Yes, absolutely; I just figured that was a much larger refactor than I wanted to make, as it flips the order of all the proofs below. If you want to do this in a follow-up, I'm happy to review; but we could also just leave it till after the port. I can do this as a follow-up, but it's orthogonal to #17743
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.
Another possible name would be archimedean.modeq
?
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.
Or add_comm_group.modeq
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.
What I meant is that I think Imodeq
is an acceptable name for (a : α ⧸ add_subgroup.zmultiples p) = b
(and add_comm_group.modeq
is reasonable too), but the name for the current definition should be something like not_mem_Ioo
in order to be descriptive. However, if you plan to replace the definition by (a : α ⧸ add_subgroup.zmultiples p) = b
in the future, then I think we should keep the current name, but we should also add the replacement as a TODO item in the docstring.
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.
FYI I am currently writing the API for
def modeq (p a b : α) : Prop := ∃ z : ℤ, b - a = z • p
…m_Ioo_mod` This replaces `mem_Ioo_mod hp a b` with `¬Imodeq p a b`, where `Imodeq` stands for `interval mod equal`. This is more consistent with `int.modeq`, `nat.modeq`, and `smodeq`. There's still some duplication here, but at least these four ideas are now conceptually aligned. This remove any lemmas of the form `¬Imodeq p a b ↔ _ ≠ _` as these are now trivial consequences of the `Imodeq p a b ↔ _ = _` versions,
79bdb72
to
5c94437
Compare
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com> Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
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.
Let's move forward with this.
maintainer merge
🚀 Pull request has been placed on the maintainer queue by YaelDillies. |
bors merge |
…m_Ioo_mod` (#18912) This replaces `mem_Ioo_mod hp a b` with `¬add_comm_group.modeq p a b`. This is more consistent with `int.modeq`, `nat.modeq`, and `smodeq`. There's still some duplication here, but at least these four ideas are now conceptually aligned. This remove any lemmas of the form `¬modeq p a b ↔ _ ≠ _` as these are now trivial consequences of the `modeq p a b ↔ _ = _` versions,
Pull request successfully merged into master. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
mem_Ioo_mod
mem_Ioo_mod
This replaces
mem_Ioo_mod hp a b
with¬add_comm_group.modeq p a b
.This is more consistent with
int.modeq
,nat.modeq
, andsmodeq
.There's still some duplication here, but at least these four ideas are now conceptually aligned.
This remove any lemmas of the form
¬modeq p a b ↔ _ ≠ _
as these are now trivial consequences of themodeq p a b ↔ _ = _
versions,