Math 2.0

Mathematical logic and foundations Definition

Simply typed lambda calculus

Builds on Lambda calculusType systemBeta reduction

Definition

Fix a set BB of base types and a countable set of variables. The simple types are given by the grammar τ::=b∣τ→τ\tau ::= b \mid \tau \to \tau with b∈Bb \in B. The terms are given by the grammar t::=x∣λx:τ. t∣t tt ::= x \mid \lambda x{:}\tau.\, t \mid t\, t, where xx is a variable and τ\tau is a simple type. A context Γ\Gamma is a finite list x1:τ1,…,xn:τnx_1 : \tau_1, \dots, x_n : \tau_n of distinct variables with types. The typing relation Γ⊢t:τ\Gamma \vdash t : \tau is the least relation closed under these three rules.

  1. Variable: if x:τx : \tau occurs in Γ\Gamma, then Γ⊢x:τ\Gamma \vdash x : \tau.
  2. Abstraction: if Γ,x:σ⊢t:τ\Gamma, x : \sigma \vdash t : \tau, then Γ⊢(λx:σ. t):σ→τ\Gamma \vdash (\lambda x{:}\sigma.\, t) : \sigma \to \tau.
  3. Application: if Γ⊢t:σ→τ\Gamma \vdash t : \sigma \to \tau and Γ⊢u:σ\Gamma \vdash u : \sigma, then Γ⊢t u:τ\Gamma \vdash t\, u : \tau.

The simply typed lambda calculus is this typing system together with beta reduction (λx:σ. t) u→t[u/x](\lambda x{:}\sigma.\, t)\, u \to t[u/x] on typed terms.

Remarks

Example: for a base type bb, the term λf:b→b. λx:b. f (f x)\lambda f{:}b \to b.\, \lambda x{:}b.\, f\,(f\, x) has type (b→b)→b→b(b \to b) \to b \to b. The check: in the context f:b→b,x:bf : b \to b, x : b, rule 1 gives f:b→bf : b \to b and x:bx : b. Rule 3 gives f x:bf\, x : b, then f (f x):bf\,(f\, x) : b by rule 3 again, and two uses of rule 2 give the arrow type.

Non-example: no annotation makes λx:σ. x x\lambda x{:}\sigma.\, x\, x typable. Rule 3 would need σ=σ→τ\sigma = \sigma \to \tau for some τ\tau, and no finite type equals a longer type that contains it.

The arrow associates to the right, so σ→τ→ρ\sigma \to \tau \to \rho means σ→(τ→ρ)\sigma \to (\tau \to \rho). The form above, with types written on bound variables, is the Church style. In the Curry style, terms are untyped and the rules assign types to them. It is one instance of a type system.

Reading path

To understand this page from the ground up, read these 4 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Beta reduction concept
  2. Lambda calculus concept
  3. Type system concept
  4. Simply typed lambda calculus definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Simply_typed_lambda_calculus
About this page
TagZTQWFHH1ZA
URIm2://ZTQWFHH1ZA
Kinddefinition
WritingW0 stub
MSC03B40, 68N18, 03B38
DefinesSimply typed lambda calculus
UsesLambda calculus, Type system, Beta reduction
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.