Principal Typings in a Restricted Intersection Type System for Beta Normal Forms with De Bruijn Indices
The lambda-calculus with de Bruijn indices assembles each alpha-class of lambda-terms in a unique term, using indices instead of variable names. Intersection types provide finitary type polymorphism and can characterise normalisable lambda-terms through the property that a term is normalisable if and only if it is typeable. To be closer to computations and to simplify the formalisation of the atomic operations involved in beta-contractions, several calculi of explicit substitution were developed mostly with de Bruijn indices. Versions of explicit substitutions calculi without types and with simple type systems are well investigated in contrast to versions with more elaborate type systems such as intersection types. In previous work, we introduced a de Bruijn version of the lambda-calculus with an intersection type system and proved that it preserves subject reduction, a basic property of type systems. In this paper a version with de Bruijn indices of an intersection type system originally introduced to characterise principal typings for beta-normal forms is presented. We present the characterisation in this new system and the corresponding versions for the type inference and the reconstruction of normal forms from principal typings algorithms. We briefly discuss the failure of the subject reduction property and some possible solutions for it.
💡 Research Summary
The paper investigates a restricted intersection type system tailored for β‑normal forms (β‑nfs) of the λ‑calculus expressed with de Bruijn indices. By adopting de Bruijn notation, each α‑equivalence class of λ‑terms is represented uniquely, eliminating the need for variable names and simplifying the handling of substitution. Intersection types, known for their finitary polymorphism, are employed to capture normalisation: a term is normalisable iff it is typable in an appropriate intersection type system.
The authors first recall the untyped λ‑calculus with de Bruijn indices, defining terms, free indices, and the β‑substitution mechanism that respects index shifting (lift) to avoid capture. They then introduce the set of restricted intersection types T, built from an infinite set of type variables A, the neutral element ω, function types U→T, and intersections U∧U, where ∧ is commutative, associative, and ω‑neutral. Contexts Γ are ordered lists of elements from U; the length of Γ coincides with the maximal free index sup(M) of the term being typed (Lemma 4). This tight correspondence between syntactic free indices and typing contexts is a cornerstone of the system.
Two typing systems are defined: SM (the full system) and SM_r (a restriction obtained by removing the generic var rule and limiting function types to the form σ₁→…→σ_k→α). The typing judgments have the shape M :h Γ ⊢ τ, meaning that term M has type τ under context Γ, where the “h” annotation records the number of free indices. Generation lemmas (Lemma 5) describe precisely how each syntactic form contributes to the shape of Γ and τ. For example, a variable n must be typed with Γ_n = τ; a λ‑abstraction λ·M receives a function type u→σ where u is the type of the bound index and σ is the type of M; an application n M₁…M_m yields a context that combines ω^{n‑1}·σ₁→…→σ_m→τ with the contexts of the arguments via intersection.
The central contribution is the proof that every β‑normal form admits a principal typing (PT) in SM_r. A principal typing is a most general typing from which all other typings of the same term can be obtained by type substitution and context weakening. To establish PT, the authors adapt the inference algorithm Infer from prior work on named variables to the de Bruijn setting. Infer proceeds recursively on the structure of a β‑nf: variables produce a context ω^{n‑1}.α and type α; λ‑abstractions infer the type of the body and either prepend a fresh arrow type or, if the body’s context already begins with a type, return ω→σ; applications infer each argument, then assemble a context consisting of ω^{n‑1} followed by the argument types and a fresh result type α, intersected with the arguments’ contexts. Fresh type variables guarantee non‑overlap, enabling a completeness proof.
However, the system does not satisfy the usual subject reduction (SR) property: typing is not preserved under β‑reduction. The paper presents a concrete counter‑example where a term (λ·1) 3 reduces to λ·1, but the typing of the original application cannot be transferred to the reduced term because the typing information for the argument (the constant 3) is lost. Similarly, subject expansion (SE) fails for analogous reasons. The authors discuss possible remedies, such as replacing the application rule →′e with a more permissive rule that types any application M N provided M has type ω→τ, or redefining the notion of free indices to retain sufficient typing information after reduction. They note that these fixes may compromise other desirable properties or deviate from the original design of SM.
In summary, the paper delivers:
- A de Bruijn‑based restricted intersection type system (SM_r) that captures principal typings for β‑normal forms.
- Formal generation lemmas linking term structure, free indices, and typing contexts.
- A sound and complete type inference algorithm (Infer) for β‑nfs, using fresh type variables.
- An analysis of the failure of subject reduction and expansion in this setting, together with suggested directions for restoring these properties.
The work contributes to the broader effort of integrating sophisticated type systems (intersection types) with explicit‑substitution calculi and de Bruijn representations, highlighting both the expressive power for characterising normalisation and the delicate balance required to maintain fundamental metatheoretic properties. Future research may explore extensions that recover SR while preserving PT, or adapt the approach to richer calculi with explicit substitutions.
Comments & Academic Discussion
Loading comments...
Leave a Comment