lean4-htt/tests/lean/run/structuralEqns2.lean
Leonardo de Moura 9fe0d28107 fix: do not split on if-then-else terms when generating equation theorems
Reason: avoid unnecessary case-analysis explosion
It is also unnecessary since we only refine the `below` and `F`
arguments over `match`-expressions.

This fixes the last case at issue #998
```
attribute [simp] BinaryHeap.heapifyDown
```

closes #998
2022-02-09 17:43:35 -08:00

29 lines
470 B
Text

import Lean
open Lean
open Lean.Meta
def tst (declName : Name) : MetaM Unit := do
IO.println (← getUnfoldEqnFor? declName)
def g (i j : Nat) : Nat :=
if i < 5 then 0 else
match j with
| Nat.zero => 1
| Nat.succ j => g i j
#eval tst ``g
#check g._eq_1
#check g._eq_2
#check g._unfold
def h (i j : Nat) : Nat :=
let z :=
match j with
| Nat.zero => 1
| Nat.succ j => h i j
z + z
#eval tst ``h
#check h._eq_1
#check h._eq_2
#check h._unfold