Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR adds a `match.maxCounterExamples` option (default 5) to bound the number of "missing cases" counter-examples the match compiler generates. When the match compiler runs out of alternatives for a variable, it case-splits to explore missing cases. Previously, this would recursively split all inductive-typed fields of each constructor, leading to O(K^fields) counter-examples for types with K constructors per field. For nested incomplete matches on types like `Op w` (20 constructors with `Operand w` fields having 8 constructors each), this produced thousands of counter-examples and took several seconds. The fix checks the counter-example count in `isConstructorTransition`: once the limit is reached and there are no remaining alternatives, the match compiler stops exploring further case splits. The error message notes when output has been truncated and names the option. The existing protection against infinite recursion on recursive types is preserved. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .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.