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
Unpacking Subtype leads to recursor error #2102
Comments
…nprover/lean4#2102 and right now means manual touch-ups of the generated code (grep for )
@nomeata I explored this issue a bit. The problem is the auxiliary g''.match_1 g'' -- <<< This is the problematic occurrence
T tl
(fun (x : { x : List T // g'' T tl = some x }) => Option (List T)) x
fun (x : List T) (h : g'' T tl = some x) => some x When Lean generates the auxiliary |
One maybe bearable work-around is to let-abstract the recursive call:
I am not sure if it is possible or wise to try to do such a transformation automatically during elaboration. I am facing a related problem when generating induction principles, and For reference, this is
|
Prerequisites
Description
In the presence of
Subtype
and a destructuring let-binding, the recursor seems to be incorrectly synthesized before being sent off to the kernel.Thanks to @JamesGallicchio and @digama0 for helping reproduce this error. Link to original Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/naming.20hypotheses.20when.20using.20do-notation/near/326891317 onwards
Versions
Lean (version 4.0.0-nightly-2023-01-29, commit 38a0d1e, Release) (OSX)
The text was updated successfully, but these errors were encountered: