Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR adds a clone of the `mvcgen` tactic based on `SymM` and evaluates it based on a ported `add_sub_cancel` benchmark. Notably, it can reuse all the existing `@[spec]`-annotated theorems to generate VCs. (It doesn't do control-flow splitting, simp rules on the program expression or handling of lets; we'll get there.) It is quite fast already, with the kernel being the bottle-neck: ``` goal_50: 69.524305 ms, kernel: 155.327778 ms goal_100: 93.834221 ms, kernel: 407.370786 ms goal_150: 131.364098 ms, kernel: 762.936720 ms goal_200: 169.577172 ms, kernel: 1181.199093 ms goal_250: 206.421738 ms, kernel: 1707.539380 ms ``` ``` goal_200: 169.458637 ms, kernel: 1186.221085 ms goal_400: 322.819718 ms, kernel: 3791.613854 ms goal_600: 474.929013 ms, kernel: 7763.373757 ms goal_800: 634.379422 ms, kernel: 13107.810430 ms ``` It is best compared to the `solveUsingSym <n> false true` measurements of the SymM `add_sub_cancel` benchmark (`false`: without intermediate eager simplification). For `n=200`, it reports ``` goal_200: 779.482300 ms, kernel: 742.097404 ms ``` suggesting that the generated proof term could be improved for kernel reduction. (TODO.) I'm unsure whether `solveUsingSym` is run in interpreted mode, so take the >400% speedup with a grain of salt. We can definitely conclude that VC generation time is currently not a bottleneck compared to kernel checking time. Plot for discharging goals of sizes 100..800: <img width="1000" height="600" alt="Code_Generated_Image(1)" src="https://github.com/user-attachments/assets/90e76a45-fa46-4d02-912a-c3355e2aa094" /> Plot comparing Kernel and Goal time: <img width="1000" height="600" alt="Code_Generated_Image(2)" src="https://github.com/user-attachments/assets/5849ba0f-1d83-4f2d-98dd-fa65b840bb4e" /> |
||
|---|---|---|
| .claude | ||
| .github | ||
| 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 | ||
| lean.code-workspace | ||
| 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.