2Mon𝒲𝒾𝓀𝒾

Simply Typed πœ†-calculus

Simply typed πœ†-calculus, also known as STLC, is the most basic type system on can equip πœ†-calculus with.

On the logical side, STLC corresponds to propositional logic. On the semantic side, STLC corresponds to cartesian-closed categories.

Definition

Syntax

For this section, assume we have a (possibly infinite) set 𝒯︀ of atomic types. A type 𝜏 is defined by the following grammar:

πœβ‰”π‘‡βˆˆπ’―οΈ€|πœβ†’πœ

We equip the previewΞ»-calculus with the following type system.

π‘₯:πœβˆˆΞ“
Ξ“βŠ’π‘₯:𝜏
Ax
Ξ“,π‘₯:πœβŠ’π‘‘:πœβ€²
Ξ“βŠ’πœ†π‘₯.𝑑:πœβ†’πœβ€²
Ξ“βŠ’π‘’:πœβ†’πœβ€²Ξ“βŠ’π‘£:𝜏
Ξ“βŠ’π‘’π‘£:πœβ€²

Semantics

Let π’žοΈ€ be a previewcartesian closed category, and a function 𝜌:π’―οΈ€β†’π’žοΈ€ that maps atomic types to objects of π’žοΈ€. We can define an interpretation βŸ¦βˆ’βŸ§ going from types to objects of π’žοΈ€, as well as, for any open term 𝑑 such that Ξ“βŠ’π‘‘:𝜏, we have

βŸ¦π‘‘βŸ§:βŸ¦Ξ“βŸ§β†’βŸ¦πœβŸ§

defined by induction on the typing derivation, where

⟦π‘₯1:𝜏1,…,π‘₯𝑛:πœπ‘›βŸ§=⟦𝜏1βŸ§Γ—β‹―Γ—βŸ¦πœπ‘›βŸ§
Axiom
by definition of a product, there exists a projection βŸ¦Ξ“βŸ§β†’βŸ¦πœβŸ§ if π‘₯:πœβˆˆΞ“
Abstraction
by induction hypothesis, we have constructed a morphism βŸ¦π‘‘βŸ§:βŸ¦Ξ“βŸ§Γ—βŸ¦πœβŸ§βŸΆβŸ¦πœβ€²βŸ§. By adjunction, this corresponds exactly to a morphism βŸ¦πœ†π‘₯.π‘‘βŸ§=πœ†(βŸ¦π‘‘βŸ§):βŸ¦Ξ“βŸ§βŸΆβŸ¦πœβŸ§β‡’βŸ¦πœβ€²βŸ§.
Application
by induction hypothesis, we have βŸ¦π‘’βŸ§:βŸ¦Ξ“βŸ§βŸΆβŸ¦πœβŸ§β‡’βŸ¦πœβ€²βŸ§ and βŸ¦π‘£βŸ§:βŸ¦Ξ“βŸ§βŸΆβŸ¦πœβŸ§. By adjunction, the former morphism corresponds exactly to a app(βŸ¦π‘’βŸ§):βŸ¦Ξ“βŸ§Γ—βŸ¦πœβŸ§βŸΆβŸ¦πœβ€²βŸ§. Therefore, we have

Meta-theory

Strong normalization

Theorem Strong normalization Soit 𝑑 un terme (potentiellement ouvert), tel qu’il existe un type 𝜏 et un environnement Ξ“ tels que

Ξ“βŠ’π‘‘:𝜏

𝑑 est fortement normalisant.

In order prove this highly non-trivial result, we need to define an interpretation of types ⟦𝜏⟧, by induction on 𝜏11 Note that, while it might be more intuitive would be to enforce that, if π‘’βˆˆβŸ¦πœβŸ§, then 𝑒:𝜏. This would work, but it turns out this assumption is never used in the rest of the proof, and would add unnecessary complexity.:

  • βŸ¦π‘‡βŸ§β‰”{𝑒:Term|𝑒 is strongly normalizing}
  • βŸ¦πœβ†’πœβ€²βŸ§β‰”{𝑒:Term|βˆ€π‘£βˆˆβŸ¦πœβŸ§,π‘’π‘£βˆˆβŸ¦πœβ€²βŸ§}