Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR fixes #13268 where `local macro` (and other local declarations) with compound names of depth ≥ 3 would silently lose their local entries. When `expandNamespacedDeclaration` rewrites e.g. `local macro (name := A.B.C) ...` into `namespace A.B.C; end_local_scope; ...; end A.B.C`, the compound `namespace A.B.C` pushes multiple scopes, but `end_local_scope` only marked the topmost scope as non-delimiting. This meant `addLocalEntry`'s stack traversal would stop at the first unmarked scope, and the local entry would be lost when the namespace scopes were popped. The fix parameterizes `end_local_scope` with a depth argument so it marks exactly the right number of scope levels as non-delimiting. `expandNamespacedDeclaration` now passes `ns.getNumParts` as the depth, and `expandInCmd` passes `1`. Closes #13268 |
||
|---|---|---|
| .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.