Skip to content
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

"Failed to generate splitter" #5064

Closed
3 tasks done
Smaug123 opened this issue Aug 15, 2024 · 0 comments · Fixed by #6270
Closed
3 tasks done

"Failed to generate splitter" #5064

Smaug123 opened this issue Aug 15, 2024 · 0 comments · Fixed by #6270
Labels
bug Something isn't working P-medium We may work on this issue if we find the time

Comments

@Smaug123
Copy link
Contributor

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

simp and unfold are unable to unfold certain functions.

Context

Discussion on Zulip.

(Seen in the wild while editing a file in Mathlib.)

Steps to Reproduce

On https://live.lean-lang.org/, type the following:

def thingy : List (Nat ⊕ Nat) → List Bool
  | Sum.inr (n + 2) :: l => thingy l
  | _ => []
  termination_by l => l.length

theorem thingy_empty : thingy [] = [] := by
  unfold thingy

Expected behavior:
Error "Unsolved goals: [] = []"

Actual behavior:

failed to generate splitter for match auxiliary declaration 'thingy.match_1', unsolved subgoal:
case x
motive : List (Nat ⊕ Nat) → Sort u_1
x✝ : List (Nat ⊕ Nat)
h_1 : (n : Nat) → (l : List (Nat ⊕ Nat)) → motive (Sum.inr n.succ.succ :: l)
h_2 : (x : List (Nat ⊕ Nat)) → (∀ (n : Nat) (l : List (Nat ⊕ Nat)), x = Sum.inr n.succ.succ :: l → False) → motive x
head✝ : Nat ⊕ Nat
val✝ n✝ n : Nat
l : List (Nat ⊕ Nat)
n_eq : 0 = n + 1
⊢ False

Versions

Tested on "4.11.0-rc2" and on "4.12.0-nightly-2024-08-15".

Additional Information

Deleting the termination_by, or turning the 2 into a 1, makes this go away.

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@Smaug123 Smaug123 added the bug Something isn't working label Aug 15, 2024
@leanprover-bot leanprover-bot added the P-medium We may work on this issue if we find the time label Aug 16, 2024
kmill added a commit to kmill/lean4 that referenced this issue Dec 1, 2024
This PR fixes a bug that could cause the `injectivity` tactic to fail in reducible mode, which could cause unfolding lemma generation to fail. In particular, `Lean.Meta.isConstructorApp'?` was not aware that `n + 1` is equivalent to `Nat.succ n`.

Closes leanprover#5064
github-merge-queue bot pushed a commit that referenced this issue Dec 1, 2024
…ets (#6270)

This PR fixes a bug that could cause the `injectivity` tactic to fail in
reducible mode, which could cause unfolding lemma generation to fail
(used by tactics such as `unfold`). In particular,
`Lean.Meta.isConstructorApp'?` was not aware that `n + 1` is equivalent
to `Nat.succ n`.

Closes #5064
JovanGerb pushed a commit to JovanGerb/lean4 that referenced this issue Jan 21, 2025
…ets (leanprover#6270)

This PR fixes a bug that could cause the `injectivity` tactic to fail in
reducible mode, which could cause unfolding lemma generation to fail
(used by tactics such as `unfold`). In particular,
`Lean.Meta.isConstructorApp'?` was not aware that `n + 1` is equivalent
to `Nat.succ n`.

Closes leanprover#5064
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-medium We may work on this issue if we find the time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants