You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Could be a duplicate of #4548 or any of the other "unknown free variable" issues, but I'm a beginner at Lean so I can't verify.)
This MWE causes the Lean compiler to throw an error, unknown free variable '_fvar.639', at the definition of goList:
inductiveTree : Type where
| leaf
| node (p : Nat) (brs : List Tree)
defTree.substNats (M: Tree) (σ : Nat → Nat) : Tree :=
let rec go M : Tree := match M with
| .leaf => leaf
| .node p brs =>
let rec goList: List Tree → List Tree -- unknown free variable '_fvar.639'
| [] => []
| M :: Ms => go M :: goList Ms
.node (σ p) (goList brs)
go M
Had a brief look: We get the error also with partial, and we don’t get it when using where:
inductive Tree : Type where
| leaf
| node (p : Nat) (brs : List Tree)
def Tree.substNats (M: Tree) (σ : Nat → Nat) : Tree := go M
where
go M : Tree := match M with
| .leaf => leaf
| .node p brs =>
.node (σ p) (goList brs)
goList: List Tree → List Tree
| [] => []
| M :: Ms => go M :: goList Ms
So it seems related to the elaboration of let rec specifically. Didn’t look further.
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
(Could be a duplicate of #4548 or any of the other "unknown free variable" issues, but I'm a beginner at Lean so I can't verify.)
This MWE causes the Lean compiler to throw an error,
unknown free variable '_fvar.639'
, at the definition ofgoList
:Context
Prior discussion on Zulip: https://leanprover.zulipchat.com/#narrow/channel/113489-new-members/topic/Termination.20check.20bug.3F.20unknown.20free.20variable.20'_fvar.2E35433'
Versions
The text was updated successfully, but these errors were encountered: