Nominal Type Theory by Nullary Internal Parametricity
There are many ways to represent the syntax of a language with binders. In particular, nominal frameworks are metalanguages that feature (among others) name abstraction types, which can be used to specify the type of binders. The resulting syntax representation (nominal data types) makes alpha-equivalent terms equal, and features a name-invariant induction principle. It is known that name abstraction types can be presented either as existential or universal quantification on names. On the one hand, nominal frameworks use the existential presentation for practical reasoning since the user is allowed to match on a name-term pattern where the name is bound in the term. However inference rules for existential name abstraction are cumbersome to specify/implement because they must keep track of information about free and bound names at the type level. On the other hand, universal name abstractions are easier to specify since they are treated not as pairs, but as functions consuming fresh names. Yet the ability to pattern match on such functions is seemingly lost. In this work we show that this ability and others are recovered in a type theory consisting of (1) nullary ($0$-ary) internally parametric type theory (nullary PTT) (2) a type of names and a novel name induction principle (3) nominal data types. This extension of nullary PTT can act as a legitimate nominal framework. Indeed it has universal name abstractions, nominal pattern matching, a freshness type former, name swapping and local-scope operations and (non primitive) existential name abstractions. We illustrate how term-relevant nullary parametricity is used to recover nominal pattern matching. Our main example involves synthetic Kripke parametricity.
💡 Research Summary
This paper proposes a novel foundational theory for nominal frameworks, which are metalanguages used to represent the syntax of languages with binders. The central innovation is the use of “Nullary Internally Parametric Type Theory (nullary PTT)” as the underlying substrate.
Nominal frameworks traditionally feature “name abstraction” types to represent binders. These can be presented in two semantically equivalent but syntactically different ways: existential quantification (convenient for user-level pattern matching but complex to implement due to tracking freshness at the type level) and universal quantification (simple to specify as functions consuming fresh names, but seemingly losing the crucial ability to pattern match).
The authors observe that universal name abstraction types have the same structure as the “bridge types” (@N ⊸ A) in nullary (0-ary) PTT, where @N is a “bridge interval” and the function is affine (cannot duplicate its argument). They therefore build their system by starting from a variant of Cavallo and Harper’s parametric cubical type theory, setting the arity to zero. To this core nullary PTT, they add a first-class type of names, Nm, constructed from @N and equipped with a powerful novel dependent eliminator called “name induction” (ind_Nm). This principle allows case analysis on a name n relative to a fresh name variable x, determining whether n is exactly x or if x is fresh in n.
The theory satisfies a “Structure Abstraction Principle (SAP)”, a collection of equivalences showing how the name abstraction type former (@N ⊸ -) commutes with other type formers. For standard type formers (like functions and products), the SAP gives expected distributive laws. Crucially, for the name type itself, it yields (@N ⊸ Nm) ≃ 1 + Nm, provable via name induction. Most importantly, the SAP also holds for user-defined nominal datatypes (e.g., lambda terms Ltm). For Ltm, SAP provides an equivalence between (@N ⊸ Ltm) and a derived type Ltm1, which is like Ltm but with an extra “hole” constructor. This equivalence is the key to recovering practical “nominal pattern matching”: a function of type (@N ⊸ Ltm) can be translated via this equivalence to a value of type Ltm1, on which standard induction/pattern matching can be performed, effectively allowing the user to inspect the bound structure.
The paper systematically demonstrates (Section 3) how all standard components of nominal frameworks—universal and (derived) existential name abstraction, typal freshness, name swapping, and local-scope operations—can be defined within this extended nullary PTT. Example functions defined via nominal recursion are provided (Section 4), including one where proving correctness requires computing the function’s nullary parametricity translation, showcasing “term-relevant” parametricity.
The work provides a coherent and elegant foundation that combines the implementational simplicity of universal abstractions with the practical utility of pattern matching. Since relational parametric cubical type theory has been implemented in proof assistants like Agda, this work offers a clear path toward a practical implementation of a full-featured nominal type theory.
Comments & Academic Discussion
Loading comments...
Leave a Comment