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
In dependent type theory, a dependent product type , for a dependent type is the type of “dependently typed functions” assigning to each an element of .
In a model of the type theory in categorical semantics, this is a dependent product. In set theory, it is an element of an indexed product.
It includes function types as the special case when is not dependent on , product types as a special case when is the type of Booleans, and dependent sequence types as a special case when is the natural numbers type.
The inference rules for dependent function types (aka “dependent product types” or “-types”):
Like any type constructor in type theory, a dependent product type is specified by rules saying when we can introduce it as a type, how to construct terms of that type, how to use or “eliminate” terms of that type, and how to compute when we combine the constructors with the eliminators.
The type formation rule for dependent product type is:
Dependent product types are almost always defined as negative types. In this presentation, primacy is given to the eliminators. The natural eliminator of a dependent product type says that we can apply it to any input:
The constructor is then determined as usual for a negative type: to construct a term of , we have to specify how it behaves when applied to any input. In other words, we should have a term of type containing a free variable . This yields the usual “-abstraction” constructor:
The beta-reduction rule is the obvious one, saying that when we evaluate a -abstraction, we do it by substituting for the bound variable.
If we want an eta-conversion rule, the natural one says that every dependently typed function is a -abstraction:
It is also possible to present dependent product types as a positive type. However, this requires a stronger metatheory, such as a logical framework. We use the same constructor (-abstraction), but now the eliminator says that to define an operation using a function, it suffices to say what to do in the case that that function is a lambda abstraction.
This rule cannot be formulated in the usual presentation of type theory, since it involves a “higher-order judgment”: the context of the term involves a “term of type containing a free variable ”. However, it is possible to make sense of it. In dependent type theory, we need additionally to allow to depend on .
The natural -reduction rule for this eliminator is
and its -conversion rule looks something like
Here is a term containing a free variable of type . By substituting for , we obtain a term of type which depends on “a term containing a free variable ”. We then apply the positive eliminator at , and the -rule says that this can be computed by just substituting for in .
As usual, the positive and negative formulations are equivalent in a suitable sense. They have the same constructor, while we can formulate the eliminators in terms of each other:
The conversion rules also correspond.
In dependent type theory, this definition of only gives us a properly typed dependent eliminator if the negative dependent product type satisfies -conversion. As usual, if it satisfies propositional eta-conversion then we can transport along that instead—and conversely, the dependent eliminator allows us to prove propositional -conversion. This is the content of Propositions 3.5, 3.6, and 3.7 in (Garner).
In the same way that one could define equivalence types as types of one-to-one correspondences and function types as types of anafunctions, one could define dependent function types as types of dependent anafunctions. This requires both identity types and heterogeneous identity types being defined first, which we shall write as and respectively for , , , , and . We use Agda notation for dependent function types rather than the dependent product type notation or in this section.
Rules for dependent function types
By the rules for dependent pair types and dependent function types, one could derive that
which is precisely the statement that is a dependent anafunction for all dependent functions .
The standard rules for type-formation, term introduction/elimination and computation of dependent product type are listed for instance in part I of
See also:
On the categorical semantics of dependent product types as relative right adjoints to context extension in comprehension categories:
Last revised on May 19, 2023 at 22:08:25. See the history of this page for a list of all contributions to it.