-
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(tactic/zify): move nat propositions to int #3108
Conversation
The name |
How is this related to |
It goes in the opposite direction: example (a b : ℤ) (h : a ≥ 0) : a = b :=
begin
lift a to ℕ using h,
/- a : ℕ, b : ℤ ⊢ ↑a = b -/
end
|
I really like this (type of) tactic. But maybe we also want |
Yes, it's possible, but there are enough complications that I'd prefer to leave it for a future PR. This one blocks the linarith refactor and I'd like to get that finished. |
Similar to my comment on #3109, maybe this should be mentioned in the doc string / doc entry to |
Done and done, thanks Bryan! |
bors r+ |
Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
Pull request successfully merged into master. Build succeeded: |
…#3108) Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
I've broken a chunk of the
linarith
preprocessing into a standalone tactic. IIRC @kbuzzard has talked about doing this by hand before.Sometimes you're trying to prove a proposition about nats but it would be more convenient to treat them as ints so you can subtract them.
zify
will insert some casts and try to simplify things for you. It uses a new attribute@[zify]
to insert the casts, andpush_cast
to do the simplification. It's extensible: throw@[zify]
on a lemma of the right shape and it will take care of those propositions for you too.