A Modular Type-checking algorithm for Type Theory with Singleton Types and Proof Irrelevance

A Modular Type-checking algorithm for Type Theory with Singleton Types   and Proof Irrelevance
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

We define a logical framework with singleton types and one universe of small types. We give the semantics using a PER model; it is used for constructing a normalisation-by-evaluation algorithm. We prove completeness and soundness of the algorithm; and get as a corollary the injectivity of type constructors. Then we give the definition of a correct and complete type-checking algorithm for terms in normal form. We extend the results to proof-irrelevant propositions.


💡 Research Summary

The paper presents a comprehensive study of a dependent type theory that simultaneously incorporates singleton types and proof‑irrelevant propositions, together with a single Russell‑style universe of small types. The authors structure their work around two calculi, λSing and λIrr, expressed as generalized algebraic theories (GATs) to emphasize modularity. λSing features dependent function spaces, singleton types {t} A, and a universe U closed under function spaces and singletons. λIrr drops singletons but adds natural numbers, strong Σ‑types, and proof‑irrelevant proposition types, allowing the encoding of subset‑type style constructions while preserving the η‑rule.

The semantic foundation is a PER (partial equivalence relation) model. Types and terms are interpreted as PERs over a semantic domain, and equality is defined as PER equivalence. Using this model, the authors devise a normalization‑by‑evaluation (NbE) algorithm that avoids the classic fresh‑variable problem. Their NbE proceeds in two phases: an η‑expansion phase performed inside the semantics (denoted ↓) and a read‑back phase (R) that reconstructs a syntactic β‑η‑normal form, indexed by the number of already‑used variables. This approach requires only a standard PER model, sidestepping the need for liftable de Bruijn terms, Kripke semantics, or other sophisticated machinery.

Two fundamental meta‑theoretical properties of NbE are proved:

  1. Completeness: If a judgment t = t₀ is derivable in the type theory, then NbE(t) and NbE(t₀) are syntactically identical normal forms.
  2. Soundness: For any term t, the equality t = NbE(t) is derivable, i.e., NbE preserves the equational theory.

Both proofs are carried out using logical relations built on the PER model. As a corollary, the authors obtain the injectivity of type constructors: for example, Fun A B = Fun A′ B′ implies A = A′ and B = B′.

Leveraging the normal forms, the paper defines a bidirectional type‑checking algorithm that works on terms already in normal form. Neutral terms (those whose head is a variable) are handled by a type‑inference phase, while normal forms are checked directly. The algorithm respects the special rules for singletons (sing‑eq‑i and sing‑eq‑el) which guarantee that all inhabitants of a singleton are equal and that η‑expansion for singletons is sound. For proof‑irrelevant propositions, the checker discards the proof term itself, checking only the resulting type, thereby achieving a subset‑type discipline without compromising decidability.

The authors also discuss implementation details, providing Haskell code for both the NbE evaluator and the type‑checking algorithm in the appendices. The code demonstrates how the read‑back function can be written as a simple recursion indexed by a natural number, confirming the practicality of the theoretical design.

In summary, the paper makes several notable contributions:

  • It introduces a modular presentation of a dependent type theory that combines singleton types, a Russell‑style universe, natural numbers, Σ‑types, and proof‑irrelevant propositions.
  • It constructs a PER‑based semantics that supports a clean NbE algorithm free of fresh‑variable complications.
  • It proves soundness and completeness of NbE, and derives injectivity of type constructors as a corollary.
  • It provides a correct and complete bidirectional type‑checking algorithm for normal forms, handling both singleton and proof‑irrelevant constructs.
  • It supplies concrete Haskell implementations, bridging theory and practice.

These results advance the state of the art in type‑theoretic foundations for proof assistants such as Agda, Coq, and Epigram, especially in contexts where singleton types and proof irrelevance are essential for expressive specifications and efficient proof development.


Comments & Academic Discussion

Loading comments...

Leave a Comment