Commit 2025-01-01 21:42 9232fbe1
View on Github →refactor: add an ofNat() elaborator (#20169)
ofNat(n)
is a shorthand for no_index (OfNat.ofNat n)
.
Its purpose is:
- To make it easier to remember to write the
no_index
- To add a place to put a hoverable docstrings explaining the complexities
- To make it easier to remove the
no_index
es in future ifDiscrTree
s stops needing them aroundofNat
(https://github.com/leanprover/lean4/issues/2867). This is not exhaustive, but is a step in the right direction. For now, I only target (some of) the declarations with aSee note [no_index around OfNat.ofNat]
. Some theorem statements have been corrected in passing. This exposed two Lean bugs relating to not usingExpr.consumeMData
: - leanprover/lean4#6438
- leanprover/lean4#6467
These are made more likely by this PR adding
no_index
to the RHS of equalities, but were already possible to trigger by usingsimp [<- _]
on existing theorems withno_index
on the LHS.