A.2.4 Dependent function types (-types)
In §1.2 (http://planetmath.org/12functiontypes), we introduced non-dependent functions in order to define a family of types as a function , which then gives rise to a type of dependent functions . But with explicit contexts we may replace with the judgment
Consequently, we may define dependent functions directly, without reference to non-dependent ones. This way we follow the general principle that each type former, with its constants and rules, should be introduced independently of all other type formers. In fact, henceforth each type former is introduced systematically by:
a formation rule, stating when the type former can be applied;
some introduction rules, stating how to inhabit the type;
elimination rules, or an induction principle, stating how to use an element of the type;
computation rules, which are judgmental equalities explaining what happens when elimination rules are applied to results of introduction rules;
optional uniqueness principles, which are judgmental equalities explaining how every element of the type is uniquely determined by the results of elimination rules applied to it.
(See also \autorefrmk:introducing-new-concepts.)
For the dependent function type these rules are:
Γ ⊢A : _i Γ,x : A ⊢B : _iΓ ⊢∏_(x:A)B : _i
Γ,x : A ⊢b : B
Γ ⊢λ(x : A). b : ∏_(x:A)B
Γ ⊢f : ∏_(x:A)B
Γ ⊢a : A Γ ⊢f(a) : B[a/x] \inferrule*[right=-comp] Γ,x : A ⊢b : B
Γ ⊢a : A Γ ⊢(λ(x : A). b)(a) ≡b[a/x] : B[a/x] \inferrule*[right=-uniq] Γ ⊢f : ∏_(x:A)B Γ ⊢f ≡(λx. f(x)) : ∏_(x:A)B
When does not occur freely in so that does not depend on , we obtain as a special case the ordinary function type . We take this as the definition of .
We may abbreviate an expression as , with the understanding that the omitted type should be filled in appropriately before type-checking.
|Title||A.2.4 Dependent function types (-types)|