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_indexes in future ifDiscrTrees 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_indexto the RHS of equalities, but were already possible to trigger by usingsimp [<- _]on existing theorems withno_indexon the LHS.