Terms () in the de Bruijn notation are either variables (), or have one of two wagon prefixes. The abstractor wagon, written , corresponds to the usual λ-binder of the λ calculus, and the applicator wagon, written , corresponds to the argument in an application in the λ calculus.
Terms in the traditional syntax can be converted to the de Bruijn notation by defining an inductive function for which:
All operations on λ-terms commute with respect to the translation. For example, the usual β-reduction,
A feature of this notation is that abstractor and applicator wagons of β-redexes are paired like parentheses. For example, consider the stages in the β-reduction of the term , where the redexes are underlined:
Thus, if one views the applicator as an open paren ('
(') and the abstractor as a close paren ('
)'), then the pattern in the above term is '
(()())'. De Bruijn called an applicator and its corresponding abstractor in this interpretation partners, and wagons without partners bachelors. A sequence of wagons, which he called a segment, is well balanced if all its wagons are partnered.
In a well balanced segment, the partnered wagons may be moved around arbitrarily and, as long as parity is not destroyed, the meaning of the term stays the same. For example, in the above example, the applicator can be brought to its abstractor , or the abstractor to the applicator. In fact, all commutatives and permutative conversions on lambda terms may be described simply in terms of parity-preserving reorderings of partnered wagons. One thus obtains a generalised conversion primitive for λ-terms in the de Bruijn notation.
Several properties of λ-terms that are difficult to state and prove using the traditional notation are easily expressed in the de Bruijn notation. For example, in a type-theoretic setting, one can easily compute the canonical class of types for a term in a typing context, and restate the type checking problem to one of verifying that the checked type is a member of this class. De Bruijn notation has also been shown to be useful in calculi for explicit substitution in pure type systems.