Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR fixes an issue where `exact?` would not suggest private declarations defined in the current module. ## Problem When using `exact?` in a file with private declarations, those private declarations were not being suggested even though they are valid and accessible: ```lean module axiom P : Prop private axiom p : P example : P := by exact? -- error: could not find lemma ``` The problem was that `blacklistInsertion` in `LazyDiscrTree` was filtering out all declarations whose names matched `isInternalDetail`, which includes private names due to their `_private.Module.0.name` structure. ## Solution The fix adds a helper function `isPrivateNameOf` that checks if a private declaration belongs to a specific module. The `blacklistInsertion` function now allows private declarations belonging to the current module (`env.header.mainModule`) to pass through the filter. Private declarations from imported modules are still filtered out, as they may reference internal declarations that aren't accessible (which would cause processing errors). Zulip discussion: https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/.60exact.3F.60.20and.20private.20declarations/near/564586152 🤖 Prepared with Claude Code --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .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.