lean4-htt/tests/lean/run/issue9646.lean
Joachim Breitner df9ca20339
perf: create unfolding theorem for wf-rec in one go (#9646)
This PR uses a more simple approach to proving the unfolding theorem for
a function defined by well-founded recursion. Instead of looping a bunch
of tactics, it uses simp in single-pass mode to (try to) exactly undo
the changes done in `WF.Fix`, using a dedicated theorem that pushes the
extra argument in for each matcher (or `casesOn`).

Improves performance for recursive functions with large `match`
statements, as in #9598.
2025-08-02 15:26:02 +00:00

11 lines
203 B
Text

/-!
Checks that that the wfrec unfold theorem can be generated even if the
function type is not manifestly a forall.
-/
def T := Nat → Nat
def f : T
| 0 => 0
| n + 1 => f n + 1
termination_by n => n