Skip to content

deBruijn index usage in Lean is .bvar not # #180

@JadAbouHawili

Description

@JadAbouHawili

The explanation in Chapter 3(Expressions) uses #n for its examples , usage of .bvar in actual Lean code occurs once here

def addOne : Expr :=
  .lam `x nat
    (mkAppN (.const ``Nat.add []) #[.bvar 0, mkNatLit 1])
    BinderInfo.default

This caused me some confusion as I was trying to use the #n notation instead of .bvar n.

I would amend this if you agree that this would improve clarity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions