-
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
feat(algebra/ordered_monoid): sub_neg_monoid (with_top R) #8889
Conversation
In this PR, I am attempting to define a general
but upon some more thought and encountering Is subtraction not definable unless working over a |
I simply don't understand this PR, and need more explanation/justification. As far as I understand, If anything, the change we should be making is to remove any existing instances like this, not adding more. |
Thank you for the comments Scott. My hope is to define |
I found myself wanting the analogous instance on |
|
||
lemma coe_sub (x y : α) : ((x - y : α) : with_top α) = x - y := rfl | ||
@[simp] lemma top_sub (x : with_top α) : (⊤ : with_top α) - x = ⊤ := rfl | ||
@[simp] lemma sub_top (x : with_top α) : x - ⊤ = ⊤ := |
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.
Note that we now already have a lemma with this name, but the definition of sub
is not the same! It's defined such that a - ⊤ = 0
instead of x - ⊤ = ⊤
as you have here
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 happy to trash this PR, I don't know the right way to implement this general instance.
Before, we had negation on the
with_top
type only in the case of alinear_ordered_add_comm_monoid_with_top
.But it is possible to provide a no-inverses
sub_neg_monoid (with_top R)
directly from anadd_group R
. We insert it earlier, keeping the same definition of negation.Some basic API is added as well.