Type theory MOC

let declaration

In formal type theory and the design of functional programming languages, let declarations are a syntactic augmentation for internally expressing a substitution in-term. Specifically, the instance of the substitution rule

Ξ“βŠ’π‘Ž:𝐴Γ,π‘₯:π΄βŠ’π‘:π΅Ξ“βŠ’π‘[π‘Ž/π‘₯]:𝐡[π‘Ž/π‘₯](S)

is superseded by

Ξ“βŠ’π‘Ž:𝐴Γ,π‘₯:𝐴,Ξ”βŠ’π‘:π΅Ξ“βŠ’letΒ π‘₯β†π‘ŽΒ in 𝑏:𝐡[π‘Ž/π‘₯](let)

In the former, both the in-term and in-type substitution occur at the level of the metatheory, whereas in the latter the in-term substitution occurs in the theory itself. Note this is different to the Ξ -type which internalizes substitition in terms as a type, although Ξ  types can be used to achieve similar things. To ensure metatheoretic substitution still agrees with substitution via a let declaration, we impose the judgemental equality

Ξ“βŠ’π‘Ž:𝐴Γ,π‘₯:𝐴,Ξ”βŠ’π‘:π΅Ξ“βŠ’letΒ π‘₯β†π‘ŽΒ in 𝑏=𝑏[π‘Ž/π‘₯]:𝐡[π‘Ž/π‘₯](let𝛽)

Beyond syntactic nicety, let declarations can be used to formulate induction rules for a positive type independently from a Ξ -type, see e.g. Ξ£ type.


tidy | en | SemBr