Lean Kernel Arena (Preview) / bugs/loose-bvar-value

Test "bugs/loose-bvar-value"

Expected: ✋ reject · Size: 2.7 KB · Lines: 48 · lean4export: 3.1.0 · Lean: 4.34.1 · 📄 Declaration

A definition whose value is a loose bound variable, met before it is checked.

The export is that of

def f.{u} (α : Sort u) : Sort u := α
inductive T (γ : f Type) : Type
  | mk : γ → T γ

with the value of f replaced by the bound variable #0, which no binder binds. A value with a loose bound variable is not a well-formed term, so a checker must reject f.

A checker that checks an inductive declaration as soon as it meets it, but defers definitions, reaches f first through T.mk: the type of its field must be a sort, so f Type is reduced, and unfolding f gives #0 Type. Pestka looked the variable up in an empty environment, found #0 again, and hung until it was fixed.

Found by a differential run of Pestka against other checkers, which also showed that a loose bound variable in a value stops sokonanoda with an internal error, and makes nanoda, nanoclo and nanobruijn panic (their runners here report any failure as a rejection).

Checker Result ⏱️ 🧠
gruszka ✋ 1.78 ms 65.9 MB
nano-lean ✋ 0.488 ms 13.8 MB
pestka ✋ 2.01 ms 16.7 MB
con-leche ✋ 3.89 ms 22.4 MB
con-ron ✋ 28.3 ms 43.3 MB
nucleus 🚫 23.6 ms 13.8 MB
official ✋ 42.1 ms 113.0 MB