Reference. Multimodal Dependent Type Theory

We introduce MTT, a dependent type theory which supports multiple modalities. MTT is parametrized by a mode theory which specifies a collection of modes, modalities, and transformations between them. We show that different choices of mode theory allow us to use the same type theory to compute and reason in many modal situations, including guarded recursion, axiomatic cohesion, and parametric quantification. We reproduce examples from prior work in guarded recursion and axiomatic cohesion, thereby demonstrating that MTT constitutes a simple and usable syntax whose instantiations intuitively correspond to previous handcrafted modal type theories. In some cases, instantiating MTT to a particular situation unearths a previously unknown type theory that improves upon prior systems. Finally, we investigate the metatheory of MTT. We prove the consistency of MTT and establish canonicity through an extension of recent type-theoretic gluing techniques. These results hold irrespective of the choice of mode theory, and thus apply to a wide variety of modal situations.

Cite

Cite as @gratzerNutyzBirkedal2021 (helia, typst) · \cite{gratzerNutyzBirkedal2021} (LaTeX)
BibTeX
bibtex · 12 lines
@article{gratzerNutyzBirkedal2021,
 title = {{Multimodal Dependent Type Theory}},
 author = {Daniel Gratzer and G. A. Kavvos and Andreas Nuyts and Lars Birkedal},
 year = {2021},
 doi = {10.46298/lmcs-17(3:11)2021},
 url = {https://lmcs.episciences.org/7713},
 journal = {{Logical Methods in Computer Science}},
 volume = {17},
 keywords = {Computer Science - Logic in Computer Science},
 month = {July},
  number = {3}
}
hayagriva YAML (typst)
yaml · 17 lines
gratzerNutyzBirkedal2021:
  type: article
  title: '{Multimodal Dependent Type Theory}'
  author:
  - Gratzer, Daniel
  - Kavvos, G. A.
  - Nuyts, Andreas
  - Birkedal, Lars
  date: 2021-07
  url: https://lmcs.episciences.org/7713
  serial-number:
    doi: 10.46298/lmcs-17(3:11)2021
  parent:
    type: periodical
    title: '{Logical Methods in Computer Science}'
    issue: 3
    volume: 17
Cited by (14)

Normalization for multimodal type theory gratzer-2026-normalization

We prove normalization for MTT, a general multimodal dependent type theory capable of expressing modal type theories for guarded recursion, internalized parametricity, and various other prototypical modal situations. We prove that deciding type checking and conversion in MTT can be reduced to deciding the equality of modalities in the underlying modal situation, immediately yielding a type checking algorithm for all instantiations of MTT in the literature. This proof uses a generalization of synthetic Tait computability – an abstract approach to gluing proofs – to account for modalities. This extension is based on MTT itself, so that this proof also constitutes a significant case study of MTT.
DOI · arXiv

From Semantics to Syntax: A Type Theory for Comprehension Categories najmaei-2026-from

Recent models of intensional type theory have been constructed in algebraic weak factorization systems (AWFSs). AWFSs give rise to comprehension categories that feature non-trivial morphisms between types; these morphisms are not used in the standard interpretation of Martin-Löf type theory in comprehension categories. We develop a type theory that internalizes morphisms between types, reflecting this semantic feature back into syntax. Our type theory comes with Π-, Σ-, and identity types. We discuss how it can be viewed as an extension of Martin-Löf type theory with coercive subtyping, as sketched by Coraglia and Emmenegger. We furthermore define semantic structure that interprets our type theory and prove a soundness result. Finally, we exhibit many examples of the semantic structure, yielding a plethora of interpretations.
PDF · DOI · arXiv · pldb

The Yoneda embedding in simplicial type theory gratzer-2025-the

DOI · arXiv

Intrinsic Verification of Parsers and Formal Grammar Theory in Dependent Lambek Calculus intrinsic-verification-of-parsers

We present Dependent Lambek Calculus (Lambek𝙳), a domain-specific dependent type theory for verified parsing and formal grammar theory. In Lambek𝙳, linear types are used as a syntax for formal grammars, and parsers can be written as linear terms. The linear typing restriction provides a form of intrinsic verification that a parser yields only valid parse trees for the input string. We demonstrate the expressivity of this system by showing that the combination of inductive linear types and dependency on non-linear data can be used to encode commonly used grammar formalisms such as regular and context-free grammars as well as traces of various types of automata. Using these encodings, we define parsers for regular expressions using deterministic automata, as well as examples of verified parsers of context-free grammars.

We present a denotational semantics of our type theory that interprets the linear types as functions from strings to sets of abstract parse trees and terms as parse transformers. Based on this denotational semantics, we have made a prototype implementation of Lambek𝙳 using a shallow embedding in the Agda proof assistant. All of our examples parsers have been implemented in this prototype implementation.

PDF · DOI · arXiv (extended version) · Source code · pldb

A Modal Deconstruction of Löb Induction gratzer-2025-a

We present a novel analysis of the fundamental Löb induction principle from guarded recursion. Taking advantage of recent work in modal type theory and univalent foundations, we derive Löb induction from a simpler and more conceptual set of primitives. We then capitalize on these insights to present Gatsby, the first guarded type theory capturing the rich modal structure of the topos of trees alongside Löb induction without immediately precluding canonicity or normalization. We show that Gatsby can recover many prior approaches to guarded recursion and use its additional power to improve on prior examples. We crucially rely on homotopical insights and Gatsby constitutes a new application of univalent foundations to the theory of programming languages.
PDF · DOI · pldb

Displayed type theory and semi-simplicial types kolomatskaia-2025-displayed

We introduce Displayed Type Theory (dTT) , a multi-modal homotopy type theory with discrete and simplicial modes. In the intended semantics, the discrete mode is interpreted by a model for an arbitrary ∞ -topos, while the simplicial mode is interpreted by Reedy fibrant augmented semi-simplicial diagrams in that model. This simplicial structure is represented inside the theory by a primitive notion of display or dependency , guarded by modalities, yielding a partially-internal form of unary parametricity. Using the display primitive, we then give a coinductive definition, at the simplicial mode, of a type of semi-simplicial types. Roughly speaking, a semi-simplicial type consists of a type together with, for each , a displayed semi-simplicial type over . This mimics how simplices can be generated geometrically through repeated cones, and is made possible by the display primitive at the simplicial mode. The discrete part of then yields the usual infinite indexed definition of semi-simplicial types, both semantically and syntactically. Thus, dTT enables working with semi-simplicial types in full semantic generality.
DOI · arXiv

Unifying cubical and multimodal type theory aagaard-2024-unifying

In this paper we combine the principled approach to modalities from multimodal type theory (MTT) with the computationally well-behaved realization of identity types from cubical type theory (CTT). The result – cubical modal type theory (Cubical MTT) – has the desirable features of both systems. In fact, the whole is more than the sum of its parts: Cubical MTT validates desirable extensionality principles for modalities that MTT only supported through ad hoc means. We investigate the semantics of Cubical MTT and provide an axiomatic approach to producing models of Cubical MTT based on the internal language of topoi and use it to construct presheaf models. Finally, we demonstrate the practicality and utility of this axiomatic approach to models by constructing a model of (cubical) guarded recursion in a cubical version of the topos of trees. We then use this model to justify an axiomatization of Löb induction and thereby use Cubical MTT to smoothly reason about guarded recursion.
DOI · arXiv

Directed univalence in simplicial homotopy type theory gratzer-2024-directed

Simplicial type theory extends homotopy type theory with a directed path type which internalizes the notion of a homomorphism within a type. This concept has significant applications both within mathematics – where it allows for synthetic (higher) category theory – and programming languages – where it leads to a directed version of the structure identity principle. In this work, we construct the first types in simplicial type theory with non-trivial homomorphisms. We extend simplicial type theory with modalities and new reasoning principles to obtain triangulated type theory in order to construct the universe of discrete types 𝒮︀. We prove that homomorphisms in this type correspond to ordinary functions of types i.e., that 𝒮︀ is directed univalent. The construction of 𝒮︀ is foundational for both of the aforementioned applications of simplicial type theory. We are able to define several crucial examples of categories and to recover important results from category theory. Using 𝒮︀, we are also able to define various types whose usage is guaranteed to be functorial. These provide the first complete examples of the proposed directed structure identity principle.
arXiv

Strange new universes: Proof assistants and synthetic foundations shulman-2024-strange

Existing computer programs called proof assistants can verify the correctness of mathematical proofs but their specialized proof languages present a barrier to entry for many mathematicians. Large language models have the potential to lower this barrier, enabling mathematicians to interact with proof assistants in a more familiar vernacular. Among other advantages, this may allow mathematicians to explore radically new kinds of mathematics using an LLM-powered proof assistant to train their intuitions as well as ensure their arguments are correct. Existing proof assistants have already played this role for fields such as homotopy type theory.
DOI

Internal Parametricity, without an Interval altenkirch-2024-internal

Parametricity is a property of the syntax of type theory implying, e.g., that there is only one function having the type of the polymorphic identity function. Parametricity is usually proven externally, and does not hold internally. Internalising it is difficult because once there is a term witnessing parametricity, it also has to be parametric itself and this results in the appearance of higher dimensional cubes. In previous theories with internal parametricity, either an explicit syntax for higher cubes is present or the theory is extended with a new sort for the interval. In this paper we present a type theory with internal parametricity which is a simple extension of Martin-Löf type theory: there are a few new type formers, term formers and equations. Geometry is not explicit in this syntax, but emergent: the new operations and equations only refer to objects up to dimension 3. We show that this theory is modelled by presheaves over the BCH cube category. Fibrancy conditions are not needed because we use span-based rather than relational parametricity. We define a gluing model for this theory implying that external parametricity and canonicity hold. The theory can be seen as a special case of a new kind of modal type theory, and it is the simplest setting in which the computational properties of higher observational type theory can be demonstrated.
PDF · DOI · arXiv · pldb

Semantics of multimodal adjoint type theory shulman-2023-semantics

We show that contrary to appearances, Multimodal Type Theory (MTT) over a 2-category M can be interpreted in any M-shaped diagram of categories having, and functors preserving, M-sized limits, without the need for extra left adjoints. This is achieved by a construction called “co-dextrification” that co-freely adds left adjoints to any such diagram, which can then be used to interpret the “context lock” functors of MTT. Furthermore, if any of the functors in the diagram have right adjoints, these can also be internalized in type theory as negative modalities in the style of FitchTT. We introduce the name Multimodal Adjoint Type Theory (MATT) for the resulting combined general modal type theory. In particular, we can interpret MATT in any finite diagram of toposes and geometric morphisms, with positive modalities for inverse image functors and negative modalities for direct image functors.
DOI · arXiv

UNDER LOCK AND KEY: A PROOF SYSTEM FOR A MULTIMODAL LOGIC kavvos-2023-under

We present a proof system for a multimode and multimodal logic, which is based on our previous work on modal Martin-Löf type theory. The specification of modes, modalities, and implications between them is given as a mode theory, i.e., a small 2-category. The logic is extended to a lambda calculus, establishing a Curry–Howard correspondence.
DOI · arXiv

mitten: A Flexible Multimodal Proof Assistant stassen-2023-mitten

Recently, there has been a growing interest in type theories which include modalities, unary type constructors which need not commute with substitution. Here we focus on MTT [Daniel Gratzer et al., 2021], a general modal type theory which can internalize arbitrary collections of (dependent) right adjoints [Birkedal et al., 2020]. These modalities are specified by mode theories [Licata and Shulman, 2016], 2-categories whose objects corresponds to modes, morphisms to modalities, and 2-cells to natural transformations between modalities. We contribute a defunctionalized NbE algorithm which reduces the type-checking problem for MTT to deciding the word problem for the mode theory. The algorithm is restricted to the class of preordered mode theories - mode theories with at most one 2-cell between any pair of modalities. Crucially, the normalization algorithm does not depend on the particulars of the mode theory and can be applied without change to any preordered collection of modalities. Furthermore, we specify a bidirectional syntax for MTT together with a type-checking algorithm. We further contribute mitten, a flexible experimental proof assistant implementing these algorithms which supports all decidable preordered mode theories without alteration.
DOI

A Stratified Approach to Löb Induction gratzer-2022-a

Guarded type theory extends type theory with a handful of modalities and constants to encode productive recursion. While these theories have seen widespread use, the metatheory of guarded type theories, particularly guarded dependent type theories remains underdeveloped. We show that integrating Löb induction is the key obstruction to unifying guarded recursion and dependence in a well-behaved type theory and prove a no-go theorem sharply bounding such type theories. Based on these results, we introduce GuTT: a stratified guarded type theory. GuTT is properly two type theories, sGuTT and dGuTT. The former contains only propositional rules governing Löb induction but enjoys decidable type-checking while the latter extends the former with definitional equalities. Accordingly, dGuTT does not have decidable type-checking. We prove, however, a novel guarded canonicity theorem for dGuTT, showing that programs in dGuTT can be run. These two type theories work in concert, with users writing programs in sGuTT and running them in dGuTT.
DOI
Cites 84 works (9 here)
With notes (9)

Modalities in homotopy type theory rijke-2020-modalities

Univalent homotopy type theory (HoTT) may be seen as a language for the category of ∞-groupoids. It is being developed as a new foundation for mathematics and as an internal language for (elementary) higher toposes. We develop the theory of factorization systems, reflective subuniverses, and modalities in homotopy type theory, including their construction using a “localization” higher inductive type. This produces in particular the (𝑛-connected, 𝑛-truncated) factorization system as well as internal presentations of subtoposes, through lex modalities. We also develop the semantics of these constructions.
DOI · arXiv

Implementing a modal dependent type theory gratzer-2019-implementing

Modalities are everywhere in programming and mathematics! Despite this, however, there are still significant technical challenges in formulating a core dependent type theory with modalities. We present a dependent type theory MLTT 🔒 supporting the connectives of standard Martin-Löf Type Theory as well as an S4 -style necessity operator. MLTT 🔒 supports a smooth interaction between modal and dependent types and provides a common basis for the use of modalities in programming and in synthetic mathematics. We design and prove the soundness and completeness of a type checking algorithm for MLTT 🔒 , using a novel extension of normalization by evaluation. We have also implemented our algorithm in a prototype proof assistant for MLTT 🔒 , demonstrating the ease of applying our techniques.
PDF · DOI · pldb

Gluing for Type Theory GluingForTypeTheory

The relationship between categorical gluing and proofs using the logical relation technique is folklore. In this paper we work out this relationship for Martin-Löf type theory and show that parametricity and canonicity arise as special cases of gluing. The input of gluing is two models of type theory and a pseudomorphism between them and the output is a displayed model over the first model. A pseudomorphism preserves the categorical structure strictly, the empty context and context extension up to isomorphism, and there are no conditions on preservation of type formers. We look at three examples of pseudomorphisms: the identity on the syntax, the interpretation into the set model and the global section functor. Gluing along these result in syntactic parametricity, semantic parametricity and canonicity, respectively.
DOI

Productive coprogramming with guarded recursion atkey-2013-productive

PDF · DOI · pldb

Homotopy Type Theory: Univalent Foundations of Mathematics hottbook

Web · arXiv

First steps in synthetic guarded domain theory: step-indexing in the topos of trees birkedalFirstStepsSGDT2012

We present the topos S of trees as a model of guarded recursion. We study the internal dependently-typed higher-order logic of S and show that S models two modal operators, on predicates and types, which serve as guards in recursive definitions of terms, predicates, and types. In particular, we show how to solve recursive type equations involving dependent types. We propose that the internal logic of S provides the right setting for the synthetic construction of abstract versions of step-indexed models of programming languages and program logics. As an example, we show how to construct a model of a programming language with higher-order store and recursive types entirely inside the internal logic of S. Moreover, we give an axiomatic categorical treatment of models of synthetic guarded domain theory and prove that, for any complete Heyting algebra A with a well-founded basis, the topos of sheaves over A forms a model of synthetic guarded domain theory, generalizing the results for S.
DOI

Applicative programming with effects mcbride-2008-applicative

In this article, we introduce Applicative functors – an abstract characterisation of an applicative style of effectful programming, weaker than Monads and hence more widespread. Indeed, it is the ubiquity of this programming pattern that drew us to the abstraction. We retrace our steps in this article, introducing the applicative pattern by diverse examples, then abstracting it to define the Applicative type class and introducing a bracket notation that interprets the normal application syntax in the idiom of an Applicative functor. Furthermore, we develop the properties of applicative functors and the generic operations they support. We close by identifying the categorical structure of applicative functors and examining their relationship both with Monads and with Arrow.
PDF · DOI · pldb

A judgmental reconstruction of modal logic pfenning-2001-a

DOI

Syntax and semantics of dependent types Hofmann_1997

DOI
External (75)
  • Modal dependent type theory and dependent right adjoints (2020)
  • Multimodal Dependent Type Theory (LICS 2020 conference version) (2020)
  • Dual-Context Calculi for Modal Logic (2020)
  • Canonicity and normalization for dependent type theory (2019)
  • Simply ratt: A fitch-style modal calculus for reactive programming without space leaks (2019)
  • Normalization-by-evaluation for modal dependent type theory (technical report) (2019)
  • Modalities, cohesion, and information flow (2019)
  • Constructing quotient inductive-inductive types (2019)
  • Menkar (software, github.com/anuyts/menkar) (2019)
  • Quantitative program reasoning with graded modal types (2019)
  • A type theory for defining logics and proofs (2019)
  • Algebraic type theory and universe hierarchies (2019)
  • A general framework for the semantics of type theory (2019)
  • Natural model semantics for comonadic and adjoint type theory: Extended abstract (2019)
  • Natural models of homotopy type theory (2018)
  • Fitch-Style Modal Lambda Calculi (2018)
  • A generalized modality for recursion (2018)
  • Internal Universes in Models of Homotopy Type Theory (2018)
  • The Clocks They Are Adjunctions Denotational Semantics for Clocked Type Theory (2018)
  • Degrees of relatedness: A unified framework for parametricity, irrelevance, ad hoc polymorphism, intersections, unions and algebra in dependent type theory (2018)
  • Algebraic models of dependent type theory (2018)
  • Presheaf models of relational modalities in dependent type theory (2018)
  • Axioms for Modelling Cubical Type Theory in a Topos (2018)
  • Brouwer’s fixed-point theorem in real-cohesive homotopy type theory (2018)
  • The clocks are ticking: No more delays! (2017)
  • Differential Cohesive Type Theory (Extended Abstract) (2017)
  • A Fibrational Framework for Substructural and Modal Logics (2017)
  • Parametric quantifiers for dependent type theory (2017)
  • Normalisation by Evaluation for Dependent Types (2016)
  • Guarded Dependent Type Theory with Coinductive Types (2016)
  • Combining effects and coeffects via grading (2016)
  • Adjoint Logic with a 2-Category of Modes (2016)
  • Category Theory in Context (2016)
  • A contextual logical framework (2015)
  • A model of guarded recursion with clock synchronisation (2015)
  • Programming and reasoning with guarded recursion for coinductive types (2015)
  • Fibrational modal type theory (2015)
  • Univalence for inverse diagrams and homotopy canonicity (2015)
  • The biequivalence of locally cartesian closed categories and martin-löf type theories (2014)
  • A type theory for productive coprogramming via guarded recursion (2014)
  • Categorical homotopy theory (2014)
  • Guard Your Daggers and Traces: On The Equational Properties of Guarded (Co-)recursion (2013)
  • Presheaf model of type theory (2013)
  • Differential cohomology in a cohesive infinity-topos (2013)
  • On Irrelevance and Algorithmic Equality in Predicative Type Theory (2012)
  • Discrete generalised polynomial functors (ICALP 2012 talk slides) (2012)
  • Call-By-Push-Value: A Functional/Imperative Synthesis (2012)
  • Notes on Universes in Type Theory (2012)
  • Quantum gauge field theory in cohesive homotopy type theory (2012)
  • Multi-level contextual type theory (2011)
  • Treatise on Intuitionistic Type Theory (2011)
  • A Judgmental Deconstruction of Modal Logic (2009)
  • Polarised subtyping for sized types (2008)
  • Contextual Modal Type Theory (2008)
  • A Polymorphic Lambda-Calculus with Sized Higher-Order Types (2006)
  • Intensionality, extensionality, and proof irrelevance in modal type theory (2001)
  • On an intuitionistic modal logic (2000)
  • A modality for recursion (2000)
  • Local type inference (2000)
  • On universes in type theory (1998)
  • Lifting Grothendieck universes (1997)
  • An algorithm for type-checking dependent types (1996)
  • Internal type theory (1996)
  • On the unity of logic (1993)
  • Type theory and recursion (1993)
  • Logic Programming with Focusing Proofs in Linear Logic (1992)
  • Substitution calculus (lecture notes) (1992)
  • Sheaves in geometry and logic : a first introduction to topos theory (1992)
  • Notions of computation and monads (1991)
  • Substitution up to isomorphism (1990)
  • An analysis of girard’s paradox (1986)
  • The free adjunction (1986)
  • Generalised Algebraic Theories and Contextual Categories (1978)
  • Categories for the Working Mathematician (1978)
  • Natural Deduction: a proof-theoretical study (1965)
gratzerNutyzBirkedal2021 reference entries/refs/gratzerNutyzBirkedal2021/gratzerNutyzBirkedal2021.hel