Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR fixes a `(kernel) declaration has metavariables` error that occurred when a `by` tactic was used in a dependent inductive type index that refers to a previous index: ```lean axiom P : Prop axiom Q : P → Prop -- Previously gave: (kernel) declaration has metavariables 'Foo' inductive Foo : (h : P) → (Q (by exact h)) → Prop ``` The root cause: `elabDepArrow` calls `mkForallFVars [h_fvar] body` before the `by` tactic's metavariable `?m` is resolved. Since `h_fvar` is in `?m`'s local context, `elimMVarDeps` creates a delayed assignment `?newMVar #[h_fvar] := ?m`. After `synthesizeSyntheticMVarsNoPostponing` assigns `?m := h_fvar`, `instantiateMVars` can resolve the delayed assignment (substituting `h_fvar` with the actual argument, `bvar 0`, in the pending value), yielding the correct type `∀ (h : P), Q (bvar 0) → Prop`. The fix is to call `instantiateMVars` on the header type right after `synthesizeSyntheticMVarsNoPostponing` in `elabHeadersAux`. Fixes #12543. 🤖 This PR was created with [Claude Code](https://claude.ai/claude-code). Co-authored-by: Claude Sonnet 4.6 <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.