natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory
Dependent type theory is the flavor of type theory that admits dependent types.
Its categorical semantics is in locally cartesian closed categories , where a dependent type
is interpreted as a morphism , hence an object in the slice category .
Then change of context corresponds to base change in . See also dependent sum and dependent product.
Dependent type systems are heavily used for software certification.
Dependent type theory itself support various foundations of mathematics via the propositions as some types interpretation of dependent type theory, where propositions are the types where every two elements are equal
Suppose that a dependent type theory has a separate type judgment as well as dependent product types, dependent sum types, identity types, weak function extensionality, propositional truncations, empty type, unit type, sum types. All the operations in predicate logic are derivable from said type formers:
universal quantification is the dependent product type of families of propositions due to weak function extensionality
similarly, implication is the function type of two propositions due to weak function extensionality, and function types are just dependent product types of a constant family of types
logical conjunction is the product type of two propositions, and product types are just dependent sum types of a constant family of types
existential quantification is the propositional truncation of dependent sum types
logical disjunction is the propositional truncation of sum types
falsehood is the empty type
truth is the unit type
excluded middle and the law of double negation is stated as an inference rule about propositions
Then
One can add a cumulative hierarchy to the dependent type theory and work entirely in the cumulative hierarchy for material set theory
One can add a category of sets to the dependent type theory and work entirely in the category of sets for structural set theory
One can add a type universe satisfying certain axioms and axiom schemata, such as universe extensionality, closure under identity types, closure under dependent sum types, closure under dependent product types, propositional resizing, replacement, infinity, and choice, to the dependent type theory and work entirely in the universe for univalent type theory or univalent foundations. Adding internal universe types as small object classifiers as well as all higher inductive and coinductive types to the universe results in homotopy type theory.
One can add a Russell type of all propositions and a natural numbers type and work in the dependent type theory itself for higher-order logic.
type theory | category theory |
---|---|
syntax | semantics |
judgment | diagram |
type | object in category |
term | element |
dependent type | object in slice category |
term in context | generalized elements/element in slice category |
The functors
, that form a category of contexts of a dependent type theory;
that forms the internal language of a locally cartesian closed category
constitute an equivalence of categories
This (Seely, theorem 6.3). It is somewhat more complicated than this, because we need to strictify the category theory to match the category theory; see categorical model of dependent types. For a more detailed discussion see at relation between type theory and category theory.
There is an important distinction between extensional type theories and intensional ones. The meanings of these words is probably clearest when dealing with function types, such as an exponential , but also arises in respect to quotient types and identity types.
A function type is said to be extensional if whenever are functions such that for all , then in fact as elements of . This clearly corresponds to the modeling of function types by function sets in the set-theoretic semantics, or more generally by exponential objects in the categorical semantics discussed above. The uniqueness clause of the defining assertion of an exponential object, i.e. that any map factors through a unique map , precisely models this “extensionality” property. Thus, the standard categorical semantics is most closely allied to type theories which have such an “extensionality” axiom.
By contrast, suppose that and are interpreted by data types in some programming language, and is interpreted by some type of computable functions from . Of course, many differently coded functions can have the same “extensional behavior,” i.e. the same output for any given input, but we may still want to distinguish between these functions because they may not share other properties (such as running time or complexity). Thus, this type is not extensional—equality of functions, as elements of , is “implementation-sensitive,” a finer measure than mere equality on all inputs. We say instead that these function types are intensional.
In type theory, extensional function-types generally come with both a “-rule,” which specifies the computational behavior of a -abstraction (i.e. ), and an “-rule,” which specifies that a -abstraction is determined by its behavior (i.e. ). In the categorical semantics, the first specifies the existence of factorizations, while the second requires them to be unique. In intensional type theory, we generally keep the -rule (it is certainly natural from a computational standpoint) but discard the -rule. Thus, one natural sort of semantics for intensional type theory is valued in a category with “weak exponentials,” i.e. objects which satisfy the existence but not uniqueness property of an exponential (and similarly for dependent type theory with -types and weak dependent products).
Intensional type theory is also popular among adherents of constructive mathematics and especially predicative mathematics, because of its computational content. Per Martin-Löf‘s original dependent type theory is often presented from this perspective.
When viewing intensional type theory as a foundation for mathematics (rather than, say, a syntax for reasoning about computer programs), it is natural to view the types as representing presets, rather than sets. This is in line with the classical constructivist viewpoint that “a set is defined by a collection of things together with an equality relation.” Note that in intensional type theory, the “equality” between terms is free to be the “syntactic” equality, which is entirely computable and preserved by everything in sight. In particular, if we adopt the viewpoint of propositions as types, then “the axiom of choice is trivially valid” for functions between types (i.e. presets) since to assert that something exists is to give an element of a sum type, which is exactly to give a witness and thereby a way to choose such a thing.
If we then define “sets” to be types equipped with equality relations (sometimes called setoids), then the sets will have more familiar properties, such as existence of extensional exponentials (obtained by equipping the intensional exponentials with an extensional equality relation), as well as the existence of quotient sets. (The existence of quotient types is often assumed in extensional type theory, but not in intensional type theory.) In categorical terms, the syntactic category of an intensional type theory has only weak exponentials (resp. dependent products), but that is sufficient to ensure that its free exact completion has actual exponentials (resp. dependent products). Note also that free exact completions always also validate COSHEP, since every object of the starting category (here the category of types) is projective. This matches the above observations about the axiom of choice.
(to be written…)
Relation between identity types and path space objects in a category with weak equivalences.
(to be written…)
dependent type theory
dependent type theoretic methods in natural language semantics
spartan type theory?
For original references see at Martin-Löf dependent type theory, such as:
also published as:
Gentle exposition of the basic principles:
Introductory accounts:
Simon Thompson, §6.3 in: Type Theory and Functional Programming, Addison-Wesley (1991) [ISBN:0-201-41667-0, webpage, pdf]
Bart Jacobs, Chapter 10 in: Categorical Logic and Type Theory, Studies in Logic and the Foundations of Mathematics 141, Elsevier (1998) [ISBN:978-0-444-50170-7, pdf, webpage]
(emphasis on the categorical model of dependent types)
Introduction with parallel details on using proof assistants:
for Coq:
Adam Chlipala, Certified programming with dependent types, MIT Press 2013 [ISBN:9780262026659, pdf, book webpage]
Théo Winterhalter, Formalisation and Meta-Theory of Type Theory, Nantes (2020) [pdf, github]
for Agda:
Ulf Norell, Dependently Typed Programming in Agda, p. 230-266 in: Advanced Functional Programming AFP 2008. Lecture Notes in Computer Science 5832 (2009) [doi:10.1007/978-3-642-04652-0_5, pdf]
Agda Tutorial: Introduction to dependent type theory (webpage)
Original discussion of dependent type theory as the internal language of locally cartesian closed categories is in
A formal definition of dependent type theories beyond Martin-Löf dependent type theory:
On (essentially algebraic) formulations of dependent type theory (see here at categorical models of dependent type theory):
An algebraic treatment of dependent type theory, analogous to algebraic set theory, is in
For more see the references at Martin-Löf dependent type theory.
Last revised on May 20, 2025 at 09:21:34. See the history of this page for a list of all contributions to it.