Iowa Type Theory Commute

Arithmetic operations in simply typed lambda calculus

May 04, 2024 Aaron Stump Season 5 Episode 3
Arithmetic operations in simply typed lambda calculus
Iowa Type Theory Commute
More Info
Iowa Type Theory Commute
Arithmetic operations in simply typed lambda calculus
May 04, 2024 Season 5 Episode 3
Aaron Stump

It is maybe not so well known that arithmetic operations -- at least some of them -- can be implemented in simply typed lambda calculus (STLC).  Church-encoded numbers can be given the simple type (A -> A) -> A -> A, for any simple type A.  If we abbreviate that type as Nat_A, then addition and multiplication can both be typed in STLC, at type Nat_A -> Nat_A -> Nat_A.  Interestingly, things change with exponentiation, which we will consider in the next episode.

Show Notes

It is maybe not so well known that arithmetic operations -- at least some of them -- can be implemented in simply typed lambda calculus (STLC).  Church-encoded numbers can be given the simple type (A -> A) -> A -> A, for any simple type A.  If we abbreviate that type as Nat_A, then addition and multiplication can both be typed in STLC, at type Nat_A -> Nat_A -> Nat_A.  Interestingly, things change with exponentiation, which we will consider in the next episode.