Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR switches `normalizeInstance` from using `isMetaSection` to the existing `declName?` pattern (already used by `unsafe` in `BuiltinNotation.lean` and `private_decl%` in `BuiltinTerm.lean`) for determining whether aux defs should be marked `meta`. #13043 used `isMetaSection` to determine whether `normalizeInstance` aux defs should be marked `meta`. This caused `deriving` in meta sections to fail: the deriving handler doesn't mark the instance itself as meta, so the non-meta instance couldn't access its meta-marked aux defs: ``` Invalid definition `instInhabitedLibraryNote`, may not access declaration `instInhabitedLibraryNote._aux_1` marked as `meta` ``` The `declName?` pattern inherits meta status from the parent declaration rather than the scope. This correctly handles both cases: - **`inferInstanceAs`**: parent declaration is marked meta by `processHeaders`, so `declName?.any (isMarkedMeta env)` is true and aux defs are correctly marked meta - **`deriving`**: `declName?` is `none` (the deriving handler runs outside `withDeclName`), so `isMeta` is `false` and aux defs are not marked meta — matching the instance itself, which the deriving handler also does not mark meta Found while adapting Batteries to nightly-2026-03-23. 🤖 Prepared with Claude Code --------- Co-authored-by: Claude Opus 4.6 (1M context) <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.