Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR replaces the eager equation realization that was triggered by non-default values of equation-affecting options (like `backward.eqns.nonrecursive`) with a `MapDeclarationExtension` that stores non-default option values at definition time. These values are then restored when equations are lazily realized, so the same equations are produced regardless of when generation occurs. Restoring the options is done via a new `withEqnOptions` helper in `Lean.Meta.Eqns`. Because `realizeConst` overrides the caller's options with the options saved in its `RealizationContext` — which are empty for imported constants — the helper must also be applied inside the `realizeConst` callbacks in `mkSimpleEqThm`, `mkEqns` (in `Elab/PreDefinition/Eqns.lean`), `getConstUnfoldEqnFor?`, and `Structural.mkUnfoldEq`. Without that, equation generation code that reads eqn-affecting options inside the realize callback would see the caller-independent defaults rather than the values stored in `eqnOptionsExt` — so the store-at-definition-time behavior would not carry across module boundaries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .github | ||
| .vscode | ||
| doc | ||
| images | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| AGENTS.md | ||
| 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.