Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
L 6a7bed94d3
fix: kernel exception from fvars left from ?m a b instantiation (#4410)
Closes #4375

The following example raises `error: (kernel) declaration has free
variables '_example'`:
```lean
example: Nat → Nat :=
  let a : Nat := Nat.zero
  fun (_ : Nat) =>
    let b : Nat := Nat.zero
    (fun (_ : a = b) => 0) (Eq.refl a)
```

During elaboration of `0`, `elabNumLit` creates a synthetic mvar
`?_uniq.16` which gets abstracted by `elabFun` to `?_uniq.16 :=
?_uniq.50 _uniq.6 _uniq.12`. The `isDefEq` to `instOfNatNat 0` results
in:
```
?_uniq.50 :=
  fun (x._@.4375._hyg.13 : Nat) =>
    let b : Nat := Nat.zero
    fun (x._@.4375._hyg.23 : Eq.{1} Nat _uniq.4 b) =>
      instOfNatNat 0
```

This has a free variable `_uniq.4` which was `a`.

When the application of `?_uniq.50` to `#[#2, #0]` is instantiated, the
`let b : Nat := Nat.zero` blocks the beta-reduction and `_uniq.4`
remains in the expression.

fix: add `(useZeta := true)` here:

ea46bf2839/src/Lean/MetavarContext.lean (L567)
2024-06-10 19:02:27 +00:00
.github chore: CI: pr-release: install elan (#4361) 2024-06-05 08:20:57 +00:00
doc chore: simplify lean4checker step in release checklist (#4355) 2024-06-05 04:14:36 +00:00
images
nix feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
releases_drafts chore: clear releases_drafts for start of 4.10.0 (#4377) 2024-06-06 23:45:54 +00:00
script chore: add ./script/rebase-stage0.sh (#3984) 2024-05-02 12:26:25 +00:00
src fix: kernel exception from fvars left from ?m a b instantiation (#4410) 2024-06-10 19:02:27 +00:00
stage0 chore: update stage0 2024-06-07 13:59:22 +02:00
tests fix: kernel exception from fvars left from ?m a b instantiation (#4410) 2024-06-10 19:02:27 +00:00
.gitattributes chore: Do not hide stage0/src/stdlib_flags.h from diffs 2023-09-13 19:29:25 +02:00
.gitignore chore: update tests to account for .lake 2023-11-13 20:31:24 -05:00
.ignore chore: ignore stage0/ (for rg etc.) 2022-03-18 15:28:20 +01:00
CMakeLists.txt chore: update-stage0-commit cmake target (#3692) 2024-04-04 13:35:53 +00:00
CMakePresets.json chore: modernize build instructions (#4032) 2024-05-23 10:55:07 +00:00
CODEOWNERS chore: update code owners 2024-04-24 10:16:16 +02:00
CONTRIBUTING.md doc: Adjust contributor's docs to squash merging (#2927) 2023-11-21 10:13:43 +00:00
flake.lock chore: test results as job summary (#3715) 2024-03-27 10:14:33 +00:00
flake.nix chore: replace shell.nix with a devShell in flake.nix (#3717) 2024-03-21 13:24:01 +00:00
lean-toolchain doc: VS Code dev setup (#2961) 2023-11-30 08:35:03 +00:00
lean.code-workspace chore: add the lean4 extension to the vscode workspace (#3059) 2023-12-14 08:58:21 +00:00
LICENSE
LICENSES
README.md doc: mention build doc source location (#4045) 2024-05-01 22:42:54 +00:00
RELEASES.md chore: begin development cycle for v4.10.0 (#4374) 2024-06-06 12:06:13 +00:00

This is the repository for Lean 4.

About

Installation

See Setting Up Lean.

Contributing

Please read our Contribution Guidelines first.

Building from Source

See Building Lean (documentation source: doc/make/index.md).