Semantics of type theory
The semantics of type theory involves several closely related types of models, which are constructed and studied in order to justify axioms and new type theories, and to use type theory as an internal language for categories, higher categories and other mathematical structures.
Types of models
Categories with families
Let denote the category of families of sets: an object is a family where each is a set, and a morphism is a function together with, for each , a function . (This category is equivalent to the arrow category of through the functor that sends a function to the family , with the natural action on morphisms.)
A category with families (CwF) consists of the following data:[1][2][3]
- A category, whose class of objects is denoted and whose class of morphisms from to is denoted . The objects are called contexts and the morphisms are called substitutions.
- A contravariant functor from the category of contexts to . The image of a context is denoted . The elements of are called types in context , and the elements of are called terms of type (in context ). The image of a substitution is a morphism in . Its component is denoted by , and for each , its component is also denoted .
- A terminal object in the category of contexts, called the empty context and denoted . (Some authors omit this requirement.[4])
- For each context and for each type , a representing object for the presheaf on the slice category that sends a substitution to the set (with action on a morphism given by ), along with a natural isomorphism witnessing that this object represents the presheaf. This representing object consists of a context denoted , called the extension of by , along with a substitution called weakening. The natural isomorphism sends a substitution and a term to a substitution denoted , called the extension of by .
Fully unfolding the requirements results in the following presentation of CwFs as a generalized algebraic theory.[5] (The notation stands for the dependent product , and curly braces denote arguments which are left implicit for readability.)
Other
Other notions of models include comprehension categories, categories with attributes and contextual categories.[4]
Interpretation of type formers
Main models
Models of type theory include the standard model (or set model),[1][3], the term model (or syntactic model, or initial model),[1][3], the setoid model,[citation needed] the groupoid model,[6] the simplicial set model,[7] and several models in cubical sets starting with the BCH (Bezem–Coquand–Huber) model.[8]
References
- ↑ 1.0 1.1 1.2 Hofmann, Martin (1997). "Syntax and semantics of dependent types". Extensional constructs in intensional type theory. London: Springer. doi:10.1007/978-1-4471-0963-1_2. ISBN 978-1-4471-0963-1.
- ↑ Gratzer, Daniel; Angiuli, Carlo. Principles of dependent type theory. https://www.danielgratzer.com/papers/type-theory-book.pdf. Retrieved 2025-11-21.
- ↑ 3.0 3.1 3.2 Gratzer, Daniel. "Denotational semantics of type theory". https://www.danielgratzer.com/papers/2023-semantics-primer-lecture-notes.pdf.
- ↑ 4.0 4.1 Categorical semantics of dependent type theory in nLab
- ↑ Generalized algebraic theory in nLab
- ↑ Hofmann, Martin; Streicher, Thomas (1994). "The groupoid model refutes uniqueness of identity proofs". LICS 1994. IEEE Computer Society Press.
- ↑ Kapulkin, Chris; LeFanu Lumsdaine, Peter (2012). "The simplicial model of univalent foundations (after Voevodsky)". Journal of the European Mathematical Society. doi:10.4171/JEMS/1050.
- ↑ Bezem, Marc; Coquand, Thierry; Huber, Simon (2014). "A model of type theory in cubical sets". TYPES 2013. 26. Schloss Daghstuhl — Leibniz Zentrum für Informatik. ISBN 978-3-939897-72-9. https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.TYPES.2013.107.
