lean4-htt/tests/lean/run/6067.lean
Leonardo de Moura 4a69643858
fix: nontermination while generating equation lemmas for match-expressions (#6180)
This PR fixes a non-termination bug that occurred when generating the
match-expression equation theorems. The bug was triggered when the proof
automation for the equation theorem repeatedly applied `injection(` to
the same local declaration, as it could not be removed due to forward
dependencies. See issue #6067 for an example that reproduces this issue.

closes #6067
2024-11-23 00:06:34 +00:00

26 lines
576 B
Text

inductive Impl where
| inner (l r : Impl)
| leaf
namespace Impl
inductive Balanced : Impl → Prop where
| leaf : Balanced leaf
@[inline]
def balanceLErase (r : Impl) (hrb : Balanced r) : Impl :=
match r with
| leaf => .leaf
| l@(inner _ _) =>
match l with
| leaf => .leaf
| r@(inner ll lr) =>
if true then
match ll, lr with
| inner _ _, inner _ _ => .leaf
| _, _ => .leaf
else .leaf
theorem size_balanceLErase {r : Impl} {hrb} : (balanceLErase r hrb) = .leaf := by
simp only [balanceLErase]
sorry