-
Notifications
You must be signed in to change notification settings - Fork 350
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
Rewrite fails to find instance correctly #2736
Labels
bug
Something isn't working
Comments
This is actually a more general issue with typeclass synthesis, and is not limited to open Lean Meta Elab Tactic in
elab "elab_term_then_synth " stx:term : tactic => withMainContext do
let e ← Term.withSynthesize do Tactic.elabTerm stx none true
logInfoAt stx m!"{e}"
example {a b : Nat} : (a + 1) * b = a * b + b :=
have := add_one_mul a b -- works
by elab_term_then_synth add_one_mul -- failed to synthesize instance: RightDistribClass ?m Note that the above is just used to mimic open Lean Meta Elab Tactic in
elab "elab_term " stx:term : tactic => withMainContext do
let e ← Tactic.elabTerm stx none
logInfoAt stx m!"{e}"
example {a b : Nat} : (a + 1) * b = a * b + b :=
have := add_one_mul a b -- works
by elab_term add_one_mul -- failed to synthesize instance: RightDistribClass ?m |
leodemoura
added a commit
that referenced
this issue
Jul 1, 2024
Closes #2736 See comment at `ExprDefEq.lean` for explanation. Side effects: - Improved error messages in two tests. - Had to improve `getSuccesses` procedure at `App.lean`. It now discards candidates that contain postponed elaboration problems. If it is too disruptive for Mathlib, we should try to discard the ones that have postponed metavariables.
leodemoura
added a commit
that referenced
this issue
Jul 2, 2024
Closes #2736 See comment at `ExprDefEq.lean` for explanation. Side effects: - Improved error messages in two tests. - Had to improve `getSuccesses` procedure at `App.lean`. It now discards candidates that contain postponed elaboration problems. If it is too disruptive for Mathlib, we should try to discard the ones that have postponed metavariables.
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 2, 2024
Closes #2736 See comment at `ExprDefEq.lean` for explanation. Side effects: - Improved error messages in two tests. - Had to improve `getSuccesses` procedure at `App.lean`. It now discards candidates that contain postponed elaboration problems. If it is too disruptive for Mathlib, we should try to discard the ones that have postponed metavariables.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Description
Rewrite fails to identify an instance argument
Context
Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/regression.20in.20rw
Thanks to @semorrison for making it mathlib-free.
Steps to Reproduce
Expected behavior: The rewrite should succeed and close the goal.
Actual behavior: The rewrite fails, giving error "failed to synthesize instance RightDistribClass"
Versions
Lean (version 4.2.0-rc4, commit 819b5ea, Release)
MacOS
Additional Information
None
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: