Type theory MOC

Type theory

A type theory is a form of formal system concerning the construction of types and terms of given types. Usually we are interested in dependent type theories, where types themselves may be parameterized by terms. Type theories are as diverse as their applications, ranging from foundations of mathematics to programming languages.

Type theory vs set theory

The differences between a type theory and a set theory may not be obvious at a glance. The distinction is best understood in terms of the attitude with which type theory is approached:

Basic features of a type theory

Usually a type theory is developed as a deductive system with contexts, so we have judgements such as

for “ is a well-formed context,” “ is a well-formed type in the context ,” and “ is a (well-typed) term of type in context ” respectively.

Often there are also judgements for Judgemental equality of types and terms, and together with contexthood, typehood, and typing these form the five basic judgements of a type theory.1

Dependent or non-dependent

If the type theory being developed is not a dependent type theory, there is some redundancy in the syntax as defined here, since every typehood judgement thesis is valid in the empty context. Accordingly, when we are specifically in such a theory we will only write

for the judgement “ is a type.” Since it is more general, most notes will use the dependent notation.

To actually populate the theory, one needs to define types, and their terms. In a dependent type theory, a type is typically defined by four (sets of) inference rules:

  1. a formation rule says what is needed to define a type in a context;
  2. introduction rules says what is needed to define a term of a type;
  3. elimination rules says how terms of a type can be used; and
  4. if we have judgemental equality, computation rules define how introduction and elimination rules interact with respect to judgemental equality.

For an example, see the Type of booleans.

Formalization

There are several ways to formalize a type theory. The approach taken by these notes is the Calculus of substitutions.


#state/tidy | #lang/en | #SemBr

Footnotes

  1. In some non-dependent type theories typehood and contexthood can be part of the definition of the ambient formal language and hence these judgements are redundant.