Type theory MOC

Function types

Given types 𝐴 and 𝐵, the function type 𝐴 𝐵 contains mappings whose inputs are in 𝐴 and outputs are in 𝐵, i.e. functions. Under propositions as types, this corresponds to implication, since a term of 𝐴 𝐵 takes proofs of 𝐴 to proofs of 𝐵.

Standard presentation

In the cartesian calculus of substitutions we can introduce function types with the following typing rules. The formation, introduction, and elimination rules are

Γ𝐴Γ𝐵Γ𝐴Γ𝐵()Γ𝐵Γ.𝐴𝑏:𝐵[𝐩]Γ𝜆Γ,𝐴,𝐵(𝑏):𝐴𝐵(I) Γ𝑎:𝐴Γ𝑓:𝐴𝐵Γ𝐚𝐩𝐩Γ,𝐴,𝐵(𝑓,𝑎):𝐵(E)

while we also have the substitution naturality rules

Δ𝛾:ΓΓ𝐴Γ𝐵Δ(𝐴𝐵)[𝛾]=𝐴[𝛾]𝐵[𝛾](-N) Δ𝛾:ΓΓ𝐵Γ.𝐴𝑏:𝐵[𝐩]Γ𝜆(𝑏)[𝛾]=𝜆(𝑏[𝛾.𝐴]):𝐴[𝛾]𝐵[𝛾](I-N) Δ𝛾:ΓΓ𝑎:𝐴Γ𝑓:𝐴𝐵Δ𝐚𝐩𝐩(𝑓,𝑎)[𝛾]=𝐚𝐩𝐩(𝑓[𝛾],𝑎[𝛾]):𝐵[𝛾]

and judgemental computation rules for 𝛽-computation and 𝜂-unicity

Γ𝑎:𝐴Γ𝐵Γ.𝐴𝑏:𝐵[𝐩]Γ𝐚𝐩𝐩(𝜆(𝑏),𝑎)=𝑏[𝐢𝐝.𝑎]:𝐵(𝛽) Γ𝑓:𝐴𝐵Γ𝑓=𝜆(𝐚𝐩𝐩(𝑓[𝐩],𝐪)):𝐴𝐵(𝜂)

From Π-types

In the Cartesian calculus of substitutions with Π-types, it is not necessary to give separate typing rules to establish function types. Instead we have

Γ𝐴Γ.𝐴𝐩:Γ(W)Γ𝐵Γ.𝐴𝐵[𝐩]Γ𝚷(𝐴,𝐵[𝐩])(Π)

and so we can define 𝐴 𝐵 :=𝚷(𝐴,𝐵[𝐩]).

Derivation of above typing rules

For I we have

Γ.𝐴𝑏:𝐵[𝐩]Γ𝜆(𝑏):𝚷(𝐴,𝐵[𝐩])(ΠI)

so we take 𝜆Γ,𝐴,𝐵(𝑏) =𝜆Γ,𝐴,𝐵[𝐩](𝑏).

For E we have

Γ𝑎:𝐴Γ𝑓:𝚷(𝐴,𝐵[𝐩])Γ𝐚𝐩𝐩(𝑓,𝑎):𝐵[𝐩𝐢𝐝.𝑎](ΠE)Γ𝐚𝐩𝐩(𝑓,𝑎):𝐵(=𝛽𝐩)

so we take 𝐚𝐩𝐩Γ,𝐴,𝐵(𝑓,𝑎) =𝐚𝐩𝐩Γ,𝐴,𝐵[𝐩](𝑓,𝑎).

The derivations of -N, I-N, E-N, 𝛽, and 𝜂 follow directly from those of the 𝚷-type taking into account the equalities

𝐩𝐢𝐝.𝑎=𝐢𝐝,𝐩𝛾.𝑎[𝛾]=𝛾

which follow from 𝛽𝐩.

Internalizing judgemental structure

In terms of Internalizing judgemental structure, we have an operation

(Γ):Ty(Γ)×Ty(Γ)Ty(Γ)

natural in Γ with a family of bijections

𝜄Γ,𝐴,𝐵:Tm(Γ,𝐴Γ𝐵)Tm(Γ.𝐴,𝐵[𝐩])

also natural in Γ. Cf. the corresponding discussion for 𝚷-types.


#state/develop | #lang/en | #SemBr