The Simply Typed Lambda Calculus
Derive function types from application and abstraction rules and use self-application to expose a finite-type constraint.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
The context records types of free variables
In context \(\Gamma\), if \(e\) has type \(B\) after adding assumption \(x:A\), then \(\lambda x.e\) has type \(A\to B\) in \(\Gamma\). Application combines a term of type \(A\to B\) with one of type \(A\) to get type \(B\). For example, \(\lambda x.x\) can have type \(\mathrm{Bool}\to\mathrm{Bool}\) under a Boolean choice for the parameter.
Self-application forces incompatible finite structure
To type \(x\,x\) with a single type \(T\) for \(x\), the left occurrence requires \(T=T\to B\) for some result type \(B\). No finite simple type has that shape. This is the same recursive equation rejected by the occurs check. The proof-rule view in natural deduction reads the function type as implication. Type inference solves such constraints automatically where a solution exists.[1][2]