Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
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
.claude doc: document nightly infrastructure in release command (#12129) 2026-01-24 00:06:44 +00:00
.github fix: CI CMakeLists.txt version check extracts wrong value (#12131) 2026-01-24 00:34:31 +00:00
doc doc: write a guideline for tactic docstrings (#11406) 2026-01-06 04:40:20 +00:00
images
releases_drafts
script chore: check reference-manual release notes title in release checklist (#12130) 2026-01-24 00:33:53 +00:00
src feat: add simpArrowTelescope for compact proofs of arrow simplification (#12152) 2026-01-25 20:43:59 +00:00
stage0 chore: update stage0 2026-01-23 18:35:59 +00:00
tests feat: add simpArrowTelescope for compact proofs of arrow simplification (#12152) 2026-01-25 20:43:59 +00:00
.gitattributes
.gitignore
.gitpod.Dockerfile
.gitpod.yml
.ignore
CMakeLists.txt
CMakePresets.json
CODEOWNERS
CONTRIBUTING.md
flake.lock
flake.nix
lean-toolchain
lean.code-workspace
LICENSE
LICENSES
README.md
RELEASES.md

This is the repository for Lean 4.

About

Installation

See Install Lean.

Contributing

Please read our Contribution Guidelines first.

Building from Source

See Building Lean.