-
Notifications
You must be signed in to change notification settings - Fork 235
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: rify tactic #7990
Conversation
PatrickMassot
commented
Oct 27, 2023
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.
seems okay to have around, but later we should revisit for improvements.
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 merge master and see if it still builds, and then I don't see why not merge it.
bors d+
✌️ PatrickMassot can now approve this pull request. To approve and merge a pull request, simply reply with |
bors merge |
Build failed:
|
-- `Nat.cast_sub` is already tagged as `norm_cast` but it does allow to use assumptions like | ||
-- `m < n` or more generally `m + k ≤ n`. We add two lemmas to increase the probability that | ||
-- `zify` will push through `ℕ` subtraction. | ||
|
||
variable {R : Type*} [AddGroupWithOne R] | ||
|
||
@[norm_cast] theorem Nat.cast_sub_of_add_le {m n k} (h : m + k ≤ n) : | ||
((n - m : ℕ) : R) = n - m := Nat.cast_sub (m.le_add_right k |>.trans h) | ||
|
||
@[norm_cast] theorem Nat.cast_sub_of_lt {m n} (h : m < n) : | ||
((n - m : ℕ) : R) = n - m := Nat.cast_sub h.le |
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.
Seems like this doesn't compile:
Error: ./././Mathlib/Tactic/Zify.lean:108:22: error: unknown identifier 'AddGroupWithOne'
Error: ./././Mathlib/Tactic/Zify.lean:111:19: error: unknown identifier 'R'
Error: ./././Mathlib/Tactic/Zify.lean:111:14: error: unknown identifier 'ℕ'
Error: ./././Mathlib/Tactic/Zify.lean:111:33: error: unknown constant 'Nat.cast_sub'
Error: ./././Mathlib/Tactic/Zify.lean:114:19: error: unknown identifier 'R'
Error: ./././Mathlib/Tactic/Zify.lean:114:14: error: unknown identifier 'ℕ'
Error: ./././Mathlib/Tactic/Zify.lean:114:33: error: unknown constant 'Nat.cast_sub'
Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
Co-authored-by: Timo <timorcb@gmail.com>
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
5be5db3
to
4042324
Compare
bors merge |
Pull request successfully merged into master. Build succeeded: |