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