You have 3 free guides left 😟
Unlock your guides
You have 3 free guides left 😟
Unlock your guides

12.2 Lambda calculus and proof normalization

3 min readaugust 7, 2024

Lambda calculus is a formal system for expressing computation through function abstraction and . It provides a simple yet powerful foundation for studying computability, programming languages, and proof theory, connecting abstract mathematics with practical computer science.

In this section, we explore lambda calculus basics, its properties, and its relationship to proofs. We'll see how lambda terms encode data and computation, and how concepts like normalization and the Curry-Howard correspondence link lambda calculus to logic and programming.

Lambda Calculus Basics

Syntax and Evaluation Rules

Top images from around the web for Syntax and Evaluation Rules
Top images from around the web for Syntax and Evaluation Rules
  • Lambda terms consist of variables, abstractions (anonymous functions), and applications
    • Variables are single letters used to represent values (x, y, z)
    • Abstractions are functions defined using the symbol followed by a and a body (λx.M where M is another lambda term)
    • Applications represent the application of a function to an argument (M N where M and N are lambda terms)
  • is the process of evaluating an application by substituting the argument for the bound variable in the function body
    • Example: (λx.x) y β\beta-reduces to y by replacing all occurrences of x with y in the function body
  • allows renaming bound variables in a lambda term without changing its meaning
    • Example: λx.x and λy.y are equivalent terms related by α\alpha-conversion
  • is a lambda term that cannot be further reduced using β\beta-reduction
    • Terms in normal form represent fully evaluated expressions

Encoding Data and Computation

  • Church encodings allow representing data types like booleans, numbers, and pairs using lambda terms
    • Church booleans: true = λx.λy.x, false = λx.λy.y
    • Church numerals: 0 = λf.λx.x, 1 = λf.λx.f x, 2 = λf.λx.f (f x), ...
  • Lambda calculus is Turing complete can express any computable function
    • Recursive functions can be defined using fixed-point combinators (Y combinator)
    • Example: factorial = λf.λn.if (isZero n) 1 (multiply n (f (pred n)))

Properties of Lambda Calculus

Confluence and Uniqueness of Normal Forms

  • states that if a term can be reduced to two different terms, there exists a common term to which both can be reduced
    • Implies : reduction order does not affect final result
    • Example: (λx.x x) (λy.y) β\beta-reduces to (λy.y) (λy.y) regardless of evaluation order
  • Uniqueness of normal forms is a consequence of the Church-Rosser theorem
    • If a term has a normal form, it is unique up to α\alpha-conversion

Termination and Decidability

  • property holds for some variants of lambda calculus (simply typed lambda calculus)
    • Guarantees that every reduction sequence terminates in a normal form
    • Implies decidability of normalization and type checking
  • Untyped lambda calculus is not strongly normalizing some terms have infinite reduction sequences
    • Example: (λx.x x) (λx.x x) β\beta-reduces to itself indefinitely
    • Undecidable to determine if an arbitrary term has a normal form

Lambda Calculus and Proofs

Correspondence with Natural Deduction

  • Cut elimination in natural deduction corresponds to β\beta-reduction in lambda calculus
    • Cut rule allows using a lemma (intermediate proof) in a larger proof
    • Elimination of cuts yields a direct proof analogous to a normal form
  • Typed lambda calculus assigns types to lambda terms, restricting well-formed expressions
    • Simple types: τ::=αττ\tau ::= \alpha \mid \tau \to \tau (base types and function types)
    • Well-typed terms cannot "go wrong" during evaluation (type soundness)
  • Curry-Howard correspondence relates proofs in intuitionistic logic to typed lambda terms
    • Propositions correspond to types, proofs correspond to terms
    • Example: ABA \to B corresponds to the type of functions from AA to BB
    • Proof normalization (cut elimination) corresponds to β\beta-reduction

Applications in Programming Languages

  • languages (Haskell, ML) are based on typed lambda calculus
    • Higher-order functions, type inference, pattern matching, lazy evaluation
  • Dependently typed languages (Coq, Agda) extend the Curry-Howard correspondence
    • Types can depend on values, allowing expressing precise specifications
    • Proofs of program properties can be expressed and checked within the language
  • Proof assistants (Isabelle, Lean) use lambda calculus as a foundation for formal reasoning
    • Proofs are represented as lambda terms, can be checked and manipulated programmatically
    • Enable formalization of mathematics and verification of software/hardware
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.
Glossary
Glossary