Zulip Chat Archive
Stream: lean4
Topic: Bvars
Marcus Rossel (Dec 09 2022 at 20:20):
The Lean 4 Metaprogramming Book says:
If in our
Expr
, allbvar
s are bound, we say that theExpr
is closed. The process of replacing all instances of an unboundbvar
with anExpr
is called instantiation.
Seeing as "bvar" is shorthand for "bound variable", what is an "unbound bvar"?
Would an example of an unbound bvar be bvar 3
in?:
lam `x (const `Nat) (bvar 3)
Sebastian Ullrich (Dec 09 2022 at 20:58):
Yes, if you have a bvar n
nested under less than n
binders, that's what the Lean code calls a loose bound variable. "Unbound" is not a great term as you implied, yeah.
Marcus Rossel (Dec 09 2022 at 21:05):
(deleted)
Arthur Paulino (Dec 10 2022 at 00:55):
"free" variables is also used a lot
Sebastian Ullrich (Dec 10 2022 at 08:57):
fvar
s that reference the local context by name are something entirely different from loose bound variables that do not properly reference anything, we need to strictly delineate between the two
Trebor Huang (Dec 10 2022 at 08:58):
I'm not a number, I'm a free variable!
Jannis Limperg (Dec 19 2022 at 15:22):
I've changed this section of the meta book to hopefully avoid the terminological confusion.
Last updated: Dec 20 2023 at 11:08 UTC