Math 2.0

Mathematical logic and foundations Definition

De Bruijn index

Builds on Lambda calculus

Definition

The nameless terms are defined by these rules.

  1. Every integer n≥1n \ge 1 is a nameless term, called an index.
  2. If MM is a nameless term, then λ M\lambda\, M is a nameless term.
  3. If MM and NN are nameless terms, then (M N)(M\, N) is a nameless term.

Let MM be a closed term of the lambda calculus. Its de Bruijn form is obtained by deleting the variable after each λ\lambda and replacing each variable occurrence by an index. The index of an occurrence of xx is nn when its binder λx\lambda x is the nn-th abstraction enclosing the occurrence, counting outward from the occurrence.

Remarks

Example: λx. λy. λz. x z (y z)\lambda x.\, \lambda y.\, \lambda z.\, x\, z\, (y\, z) becomes λ λ λ 3 1 (2 1)\lambda\, \lambda\, \lambda\, 3\, 1\, (2\, 1). The occurrence of xx has the three abstractions λz\lambda z, λy\lambda y, λx\lambda x around it, counting outward, and its binder is the third.

Non-example: λ λ 1\lambda\, \lambda\, 1 is not the de Bruijn form of λx. λy. x\lambda x.\, \lambda y.\, x. Counting outward from xx, the first enclosing abstraction is λy\lambda y, so the index of xx is 22, and the form is λ λ 2\lambda\, \lambda\, 2. Counting from the outside instead gives de Bruijn levels, a different convention.

Two closed terms are α\alpha-equivalent exactly when they have the same de Bruijn form. For terms with free variables, one fixes a list of the free variables and continues the count past the outermost abstraction. Beta reduction becomes (λ M) N→M[1:=N](\lambda\, M)\, N \to M[1 := N], where the substitution must shift the indices of free variables in NN and decrement those of MM.

Reading path

To understand this page from the ground up, read these 2 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Lambda calculus concept
  2. De Bruijn index definition

Further reading

  1. Web https://en.wikipedia.org/wiki/De_Bruijn_index
About this page
TagC04B73NK6T
URIm2://C04B73NK6T
Kinddefinition
WritingW0 stub
MSC03B40, 68N18
DefinesDe Bruijn index
UsesLambda calculus
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.