Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR optimizes the handling of `match_same_ctor.het` to make it emit nice match trees as opposed to unoptimized CPS style code. `match_same_ctor.het` is essentially a specialized kind of matcher where we know that two objects are built from the same constructor and we wish to call a continuation on their data. This means for every constructor that contains data `het` takes one closure as an argument. Then after matching on one of the objects every closure but the one relevant for the match is released in every match arm, causing quadratic code generation. This PR ensures that the `het` declarations get inlined and then further processed by ordinary matcher and casesOn compilation, thereby removing all of the continuations from the compiled code. |
||
|---|---|---|
| .claude | ||
| .github | ||
| .vscode | ||
| doc | ||
| images | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| lean-toolchain | ||
| LICENSE | ||
| LICENSES | ||
| README.md | ||
| RELEASES.md | ||
This is the repository for Lean 4.
About
- Quickstart
- Homepage
- Theorem Proving Tutorial
- Functional Programming in Lean
- Documentation Overview
- Language Reference
- Release notes starting at v4.0.0-m3
- Examples
- External Contribution Guidelines
Installation
See Install Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.