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: let apply_fun
use CoeFun
and dependent functions
#2890
Conversation
Co-authored-by: Scott Morrison <scott@tqft.net>
@semorrison The Who would have thought example (f : ℤ ≃ ℤ) (a b : ℕ) (h : a = b) : True := by
apply_fun f at h
guard_hyp h : f a = f b -- coercions on `f`, `a`, and `b`! |
bors merge |
Changes `apply_fun` to use the main function application elaborator, then uses `Lean.MVarId.congrN` to solve for a congruence proof. This means that `apply_fun f at h` should work whenever `f` applies to both sides of the equation `h` (even when coercions need to be involved).
Pull request successfully merged into master. Build succeeded: |
apply_fun
use CoeFun
and dependent functionsapply_fun
use CoeFun
and dependent functions
Changes
apply_fun
to use the main function application elaborator, then usesLean.MVarId.congrN
to solve for a congruence proof. This means thatapply_fun f at h
should work wheneverf
applies to both sides of the equationh
(even when coercions need to be involved).