lean4-htt/src/Lean/Meta/Tactic/LinearArith
Joachim Breitner e2983e44ef
perf: use with_reducible in special-purpose decreasing_trivial macros (#3991)
Because of the last-added-tried-first rule for macros, all the special
purpose `decreasing_trivial` rules are tried for most recursive
definitions out there, and because they use `apply` and `assumption`
with default transparency may cause some definitoins to be unfolded over
and over again.

A quick test with one of the functions in the leansat project shows that
elaboration time goes down from 600ms to 375ms when using
```
decreasing_by all_goals decreasing_with with_reducible decreasing_trivial
```
instead of
```
decreasing_by all_goals decreasing_with decreasing_trivial
```

This change uses `with_reducible` in most of these macros.

This means that these tactics will no longer work when the
relations/definitions they look for is hidden behind a definition.
This affected in particular `Array.sizeOf_get`, which now has a
companion `sizeOf_getElem`.

In addition, there were three tactics using `apply` to apply Nat-related
lemmas
that we now expect `omega` to solve. We still need them when building
`Init` modules
that don’t have access to `omega`, but they now live in
`decreasing_trivial_pre_omega`,
meant to be only used internally.
2024-04-29 15:12:27 +00:00
..
Nat refactor: Offset.lean and related files (#3614) 2024-03-05 19:40:15 -08:00
Basic.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Main.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Nat.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Simp.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Solver.lean perf: use with_reducible in special-purpose decreasing_trivial macros (#3991) 2024-04-29 15:12:27 +00:00