Prerequisites
Description
split fails when the discriminant of a match being split is a let variable.
Context
Writing a definition with partial_fixpoint. Consider:
def test : Nat :=
let a := 1
match a with | 0 => test | k + 1 => 0
partial_fixpoint
Steps to Reproduce
/--
error: Tactic `split` failed: Could not split an `if` or `match` expression in the goal
a : Nat := 3
⊢ (match a with
| 0 => 3
| k.succ => 3) =
3
---
trace: [split.failure] `split` tactic failed at
match a with
| 0 => 3
| k.succ => 3
Dependent elimination failed: Failed to solve equation
a = 0
-/
#guard_msgs in
example : let a := 3; (match a with | 0 | k + 1 => 3) = 3 := by
intro a
set_option trace.split.failure true in
split
Expected behavior: split produces a new state containing h : a = 0 or h : a = k.succ.
Actual behavior: split immediately tries to substitute the equation, resulting in the error.
Versions
Lean 4.31.0-nightly-2026-04-02
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Prerequisites
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
splitfails when the discriminant of amatchbeing split is a let variable.Context
Writing a definition with
partial_fixpoint. Consider:Steps to Reproduce
Expected behavior:
splitproduces a new state containingh : a = 0orh : a = k.succ.Actual behavior:
splitimmediately tries to substitute the equation, resulting in the error.Versions
Lean 4.31.0-nightly-2026-04-02
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.