-
Notifications
You must be signed in to change notification settings - Fork 298
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(data/zmod): a lemma on zmod.val_min_abs
on negations
#17584
Conversation
src/data/zmod/basic.lean
Outdated
{ exfalso, exact h'' (nat.le_half_of_half_lt_sub (not_le.mp h')) } | ||
end | ||
|
||
lemma val_min_abs_neg_of_eq_half {n : ℕ} {a : zmod n} (ha : 2 * a.val = n) : |
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.
Just to check; eq_half
is a deliberate naming of 2 * a.val = n
even though it doesn't actually mention / 2
; as opposed to being left over from a previous iteration?
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.
Yes, but only due to me not being able to come up with a good alternative. ...of_two_mul_eq
maybe?
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.
Thanks!
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
I did some refactors at this branch, introducing new lemmas to golf existing proofs and the main result of this PR without using the two lemmas in nat.order.basic. You may adopt whatever you think is good, or I could open another PR. |
@alreadydone Looks good, I'll pull this into this one! By the way, do you have a good idea on how to prove |
@javra I worked out a proof in this commit. |
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.
Thanks 🎉
bors merge
Hmm, there are merge conflicts. bors r- |
✌️ javra can now approve this pull request. To approve and merge a pull request, simply reply with |
Canceled. |
bors r+ |
Pull request successfully merged into master. Build succeeded: |
zmod.val_min_abs
on negationszmod.val_min_abs
on negations
And two necessary lemmas about
nat
, courtesy of @kmill .Co-authored-by: Kyle Miller @kmill