split fails with non-fvar discriminants and dependent motives
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Consider this
/--
error: Tactic `split` failed: Could not split an `if` or `match` expression in the goal
n : Nat
⊢ Fin.last n =
match id n with
| 0 => Fin.last 0
| n.succ => Fin.last (n + 1)
-/
#guard_msgs(pass trace, all) in
example (n : Nat) : Fin.last n = match (motive := ∀ n, Fin (n+1)) id n with
| 0 => Fin.last 0
| n + 1 => Fin.last (n + 1) := by
split <;> rfl
it works if the discriminant id n were a simple variable n.
This seems to be the core issue of underlying #10195, and is blocking #10268 and similar constructions.
Versions
Lean 4.25.0-nightly-2025-09-16
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the reproducer in the issue with Lean 4.25.0-nightly-2025-09-16 and inspect the implementation of the split tactic and its handling of dependent motives. Done means the example's split <;> rfl succeeds for the non-variable discriminant while preserving the existing behavior shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100