Given a definition `foo`, they were previously called `foo._unfold` until 4.7.0. We tried to rename them to `foo.def`, but it created too many issues in the Mathlib repo. We decided to rename it again to `foo.eq_def`. The new name is also consistent with the `eq_<idx>` theorems generated for different "cases". That is, `foo.eq_def` is the equality theorem for the whole definition, and `foo.eq_<idx>` is the equality theorem for case `<idx>`. cc @semorrison
19 lines
293 B
Text
19 lines
293 B
Text
import Lean
|
|
|
|
open Lean
|
|
open Lean.Meta
|
|
def tst (declName : Name) : MetaM Unit := do
|
|
IO.println (← getUnfoldEqnFor? declName)
|
|
|
|
def f (x : Nat) : Nat :=
|
|
if h : x = 0 then
|
|
1
|
|
else
|
|
f (x - 1) * 2
|
|
decreasing_by
|
|
apply Nat.pred_lt
|
|
exact h
|
|
|
|
#eval tst ``f
|
|
#check f.eq_1
|
|
#check f.eq_def
|