lean4-htt/tests/bench/sym
Leonardo de Moura ba8c2ed4ee
feat: add simpArrowTelescope for compact proofs of arrow simplification (#12152)
This PR adds `simpArrowTelescope`, a simproc that simplifies telescopes
of non-dependent arrows (p₁ → p₂ → ... → q) while avoiding quadratic
proof growth.

When using `Expr.forallE` to represent nested implications, each nesting
level bumps de Bruijn indices in subterms, destroying sharing even with
hash-consing. For example, a free variable `x` gets different de Bruijn
representations at each depth, causing proof terms to grow.

`simpArrowTelescope` works by:

- Converting arrows to `Arrow p q` (a definitional wrapper)
- Simplifying each component
- Converting back to `→` form

Since `Arrow` arguments are not under binders, subterms remain identical
across nesting levels and can be shared.

The `simp_4` benchmark demonstrates the improvement:

With `forallE`: ~160ms, proof_size ≈ 173k
With `Arrow`: ~43ms, proof_size ≈ 16k
Tradeoff: `simpArrowTelescope` misses simplifications that depend on the
arrow structure (e.g., `p → p` to `True`), since post-methods aren't
applied to intermediate arrows. Thus, it is not used by default. to use
it, one has to set `simpArrowTelescope` as a `pre`-method.
2026-01-25 20:43:59 +00:00
..
add_sub_cancel.lean feat: add Goal API for SymM + grind (#12143) 2026-01-24 20:30:08 +00:00
meta_simp_1.lean chore: include free variables (#11894) 2026-01-04 18:51:18 +00:00
meta_simp_2.lean test: benchmarks for lambda-telescopes (#11929) 2026-01-08 00:20:03 +00:00
meta_simp_4.lean feat: simpForall and simpArrow in Sym.simp (#11950) 2026-01-09 06:20:04 +00:00
shallow_add_sub_cancel.lean feat: add Goal API for SymM + grind (#12143) 2026-01-24 20:30:08 +00:00
shallow_add_sub_cancel_grind.lean test: local rewrite with Sym.simp (#12147) 2026-01-25 01:32:50 +00:00
simp_1.lean perf: optimize congruence proof construction in Sym.simp (#11974) 2026-01-11 23:00:19 +00:00
simp_2.lean test: benchmarks for lambda-telescopes (#11929) 2026-01-08 00:20:03 +00:00
simp_3.lean perf: optimize kernel type-checking for have-telescope simplification in Sym.simp (#11967) 2026-01-11 02:20:47 +00:00
simp_4.lean feat: add simpArrowTelescope for compact proofs of arrow simplification (#12152) 2026-01-25 20:43:59 +00:00