-
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] - feat(algebra/ordered_sub): define truncated subtraction in general #8503
Conversation
@@ -467,166 +468,137 @@ end | |||
@[simp] lemma pred_one_add (n : ℕ) : pred (1 + n) = n := | |||
by rw [add_comm, add_one, pred_succ] | |||
|
|||
/-! ### `sub` -/ |
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 is the motivation for deleting some lemmas and keeping some with a new proof?
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 goal is to remove (basically) all of them, and only use the lemmas that are proven for general types. But I'll do that in future PRs (that is what I meant by "Remove the lemmas specific to each individual type").
I currently replace the proof to show that we have the general lemma.
I have already removed a couple of lemmas, but I'll do the rest in future PRs
section ordered_add_comm_monoid | ||
variables {a b c d : α} [partial_order α] [add_comm_monoid α] [has_sub α] [has_ordered_sub α] | ||
|
||
@[simp] lemma sub_le_iff_right : a - b ≤ c ↔ a ≤ c + b := |
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 you explain how you selected this set of lemmas for the remainder of the file? Is it based on what we have already proven for ℕ + any intermediate results needed for them?
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.
It was mostly the stuff proven for nat
;
Some of it was proven for another specific type like ennreal
;
Some of the lemmas were variations on already existing lemmas (for example: for nat
and iff
was proven, and contravariant_class
is needed for one direction. That results in 3 lemmas: the direction that always holds without assumptions, the iff
under an add_le_cancellable
assumption and the iff
under an contravariant_class
assumption);
Some of the lemmas are analogues of subtraction lemmas from ordered_group
(often with additional assumptions in this file).
Thanks for the review! |
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.
LGTM! Thanks 🐙 🎉
bors d+
src/algebra/ordered_monoid.lean
Outdated
|
||
|
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.
Are these intentional?
✌️ fpvandoorn can now approve this pull request. To approve and merge a pull request, simply reply with |
bors merge |
…8503) * Define and prove properties of truncated subtraction in general * We currently only instantiate it for `nat`. The other types (`multiset`, `finsupp`, `nnreal`, `ennreal`, ...) will be in future PRs. Todo in future PRs: * Provide `has_ordered_sub` instances for all specific cases * Remove the lemmas specific to each individual type Co-authored-by: Floris van Doorn <fpv@andrew.cmu.edu>
Pull request successfully merged into master. Build succeeded: |
nat
. The other types (multiset
,finsupp
,nnreal
,ennreal
, ...) will be in future PRs.Todo in future PRs:
has_ordered_sub
instances for all specific cases