Zulip Chat Archive

Stream: lean4

Topic: Split Decidable goal


Chris B (May 23 2022 at 02:47):

Is there a way to use split when the goal is an instance of decidable? Naively invoking split with the goal below gives me the error tactic 'split' failed:

  Decidable
    (match (x, y) with
    | (ctor s₁, ctor s₂) => ¬s₁ = s₂
    | x => False)

James Gallicchio (May 23 2022 at 04:43):

is this thread potentially related?

Leonardo de Moura (May 23 2022 at 19:07):

@Chris B split was originally written to synthesize proofs, not code. I just pushed a commit that removes this restriction. The generated code for your example looks reasonable. I added your example to the test suite.
https://github.com/leanprover/lean4/commit/2fc23a2a2b3d61e917d41de504577156d01ee227

Leonardo de Moura (May 23 2022 at 19:08):

BTW, I still have to improve the split error message. It is not very informative.

Chris B (May 23 2022 at 20:12):

Thank you!


Last updated: Dec 20 2023 at 11:08 UTC