Lambda calculus forms terms from variables, abstraction, and application, and computes by substitution.
A lambda model interprets variables, lambda application and lambda abstraction so that capture-avoiding substitution agrees with environments and all beta equivalence equations hold. A reflexive domain gives such an interpretation. Validity of eta conversion requires an extra inverse law and does not follow merely from a retraction.
A pointed complete partial order is reflexive when there are Scott continuous maps and with . Define and interpret lambda abstraction using . The inverse law gives beta soundness; additionally gives eta soundness.
Let ordered by subset. Encode a finite subset and output by a natural number . Define and . Every Scott continuous map satisfies , proving that application is the projection of a retraction. Lambda abstraction has graph .
The interpretation of a lambda term in the graph model of lambda calculus is the union of the interpretations of all its finite Böhm approximants. Every finite indexed interpretation reduces monotonically to an indexed normal approximant. Taking the union over all occurrence indices gives one inclusion; replacing subterms by bottom and using beta soundness gives the other. This identifies denotational information with finite observable parts of a Böhm tree.
An indexed lambda term assigns a natural number to every subterm occurrence; one also admits a constant with empty interpretation. In the graph model of lambda calculus, every syntax constructor is interpreted as usual and then intersected with at its occurrence index . All indexed interpretations are finite subsets of the unindexed interpretation, and their directed union recovers that interpretation.
Use the binary finite-set encoding and Cantor code . Contracting gives the substituted body with its root index lowered by taking the minimum with , replacing each occurrence by a copy of with root index . A zero-indexed abstraction instead substitutes and gives the body root index zero. Indices strictly budget the argument information that can be used by application. Finite-witness inequalities for the pairing code prove that indexed reduction increases the interpretation, although it can decrease the underlying Böhm tree.
A lambda term is a variable, an abstraction , or an application , formed recursively from lambda terms and .
Application applies the lambda term to the lambda term . It associates to the left: . Together with variables and lambda abstraction, it generates all lambda terms.
A lambda abstraction binds the variable in the lambda term . In the simply typed lambda calculus, if under , the abstraction has type ; this is the implication introduction rule under the Curry-Howard correspondence.
The untyped lambda calculus forms terms from variables, abstraction, and application without assigning types.
Eta conversion expresses extensionality for a lambda abstraction whose fresh argument is only passed to a function. The side condition prevents removal of a genuine dependency. In a categorical model with , the inverse laws for currying and evaluation validate this conversion as well as beta reduction.
Combinatory logic describes computation by application and fixed combinator constants, eliminating bound variables through bracket abstraction. Its intensional weak reduction does not identify every pair of terms that becomes beta-equivalent after translation into lambda calculus.
Bracket abstraction removes a free variable from a combinatory logic term. The displayed clauses are applied in that order, giving and . Under the standard lambda expansions of , the result is beta-equivalent to . The recursive translation of lambda terms therefore preserves variables and application and reflects weak equivalence, but need not preserve all beta equivalences.
A finite applicative expression over free variables and the combinator constants , with application associating to the left. One may instead take as the abbreviation . There is no variable binder in this syntax.
Weak combinatory reduction closes the displayed contractions under application contexts. Weak equivalence is its reflexive, symmetric, transitive closure. The adjective distinguishes this syntactic reduction from an extensional rule equating functions that agree after an extra argument. A weak normal form has no subexpression matching a contraction rule; a partially applied combinator can be such a normal form.
A lambda term has head normal form when it beta-reduces to a term with a variable at the head. The argument terms need not be in beta-normal form. A term with no head normal form cannot be beta-equivalent to a Church numeral.
The Böhm tree of an unsolvable lambda term is . If is a head normal form, its Böhm tree has root label and ordered children . The tree may be infinite. Church-Rosser theorem and alpha equivalence make this independent of the selected head reduct.
A finite Böhm approximant is or a finite lambda term in the grammar , obtained by pruning a Böhm tree. Equivalently it is a beta-bottom normal form obtained from a beta-equivalent term by replacing subterms by ; bottom reduction contracts and to . Its interpretation in the graph model of lambda calculus is included in that of the original term.
A Böhm transformation is a finite composition of capture-avoiding substitutions and lambda applications to chosen auxiliary terms. It can extract a finite-address subtree of a Böhm tree as a substitution instance of the corresponding argument term.
For a finite path in a Böhm tree, choose at least the head arity at every preceding node. Replace relevant variables by . After exposing each node, supply its initial bound variables with , pad its arguments to , and apply the projection selecting the next child. Each step returns that child with accumulated substitutions, so iteration reaches a substitution instance of the chosen subtree. Tupling preserves all children until selection, even when the same variable occurs at several nodes.
Two distinct closed lambda terms in normal form for both beta reduction and eta conversion admit a separating context that maps them respectively to the two Church Booleans. Finite Böhm trees and the Böhm-out lemma isolate their first genuine head disagreement. The qualification about eta conversion matters: distinct beta-normal forms that are eta-equivalent cannot be separated this way.
An unsolvable lambda term has no head normal form, equivalently it is not a solvable lambda term. Capture-avoiding substitution and lambda application preserve unsolvability: until a head variable appears, head contractions proceed within the original term and cannot inspect the supplied terms.
A closed lambda term is easy if adjoining to the equations of beta equivalence remains nontrivial for every closed lambda term . If is easy, then is easy for every closed : use the consistent equation to obtain . Since is not easy and solvability produces by applications, easy terms are unsolvable. The converse need not hold.
A lambda term is solvable if its closure by lambda abstractions over its free variables can be applied to finitely many closed lambda terms to obtain in beta equivalence. This is equivalent to having a head normal form. A head variable in a head normal form can be replaced by a projection returning ; conversely standardization theorem for beta reduction traces any successful head computation back to a head variable of the original term.
A reduction relation has the diamond property if and imply a common one-step successor . For relations allowing an identity step, the same definition includes zero-length joins. A finite grid of these diamonds proves confluence of . Ordinary one-step beta reduction fails this property because contracting before duplication can save two separate contractions.
A reduction relation has the Church-Rosser property when its equivalence relation generated by forward and backward steps satisfies . It is equivalent to confluence of . The Church-Rosser theorem establishes it for beta reduction.
Parallel beta reduction permits simultaneous reduction in the body of a lambda abstraction and both sides of an application, together with when and . Variables reduce to themselves. Its capture-avoiding substitution lemma is . Its transitive closure equals ordinary finite beta reduction, while its one-step diamond property yields the Church-Rosser theorem.
Define , , and develop an application by contracting its root when that root is syntactically a beta-redex: . Otherwise . Newly created root redexes need not be contracted. Induction with the substitution lemma proves that if , then . Thus any two parallel reducts share this reduct.
Normal-order beta reduction contracts the leftmost outermost beta-redex. If a lambda term has a beta-normal form, this strategy reaches it. It is useful for implementing Church Boolean conditionals because an unused branch can be discarded before it is evaluated.
A finite beta reduction can be rearranged into standard order, contracting earlier residual redexes before later ones. In particular, a lambda term with a head normal form reaches one by head reduction, and a term with a beta-normal form reaches it by normal-order beta reduction. Head reduction contracts the outermost redex on the left application spine, including under initial lambda abstractions.
If an untyped lambda term has a beta-normal form, leftmost outermost beta reduction reaches a normal form. Thus an infinite normal-order computation certifies the absence of a beta-normal form. This is the normalization result needed to make a lambda simulation respect undefined outputs.
Capture-avoiding substitution replaces the free occurrences of in by , renaming bound variables when necessary so that free variables of do not become bound.
Beta equivalence is the smallest equivalence relation containing beta reduction; equivalently, when a finite sequence of beta reductions and reversed beta reductions connects and .
Beta equivalence is semidecidable: enumerate finite conversion proofs. It is not decidable. A proposed total numeral-valued classifier of two nonempty disjoint beta equivalence classes can be reversed by a Church Boolean selector; a self-quoting fixed point of this reversal then belongs to the opposite class from the classifier output.
The omega combinator is the divergent untyped lambda calculus termwhose only beta reduction reproduces .
Put and . Then . Unlike the Curry fixed-point combinator, every finite reduct retains a closed subterm . Contracting this subterm recreates one; every other generated redex substitutes a variable and preserves it. The Church-Rosser theorem therefore proves .
With , the combinator satisfies . Every finite reduct of is, up to alpha equivalence, : the remaining copy of is its only beta-redex.
Every lambda term has a fixed point: the termsatisfies . Equivalently, a fixed-point combinator such assatisfies for every .
The set of fixed-point combinators is recursively enumerable. Enumerate closed lambda terms and finite proofs of beta equivalence, and output whenever a proof of appears for a fresh variable .
Two lambda terms are alpha-equivalent when they differ only by consistent renaming of bound variables.
If a lambda term beta-reduces to both and , then and beta-reduce to a common term. Consequently two beta-equivalent beta-normal forms are alpha-equivalent.
The simply typed lambda calculus assigns arrow types to variables, abstractions, and applications according to syntax-directed typing rules.
A typed lambda term carries a type derivation under a context of typed free variables. The rules for variables, abstraction, and application correspond to assumptions, the implication introduction rule, and the implication elimination rule under the Implicational Curry-Howard correspondence. General fixed-point combinators belong to the untyped lambda calculus; self-application cannot be given a finite simple type.
Every well-typed term in the simply typed lambda calculus has some finite beta-reduction sequence ending in a beta-normal form.
Church encoding represents data and operations as terms of the lambda calculus. A Church numeral represents a natural number by repeated function application; a Church Boolean selects one of two arguments.
Church numeral successor, addition, multiplication, and exponentiation are represented by , , , and . The last term takes the base first and the exponent second. Its outer abstractions preserve the usual numeral normal form at exponent zero, implementing , including . At base type , exponentiation uses an exponent at Church type and a base at .
The lambda termreturns the Church Boolean on and on every positive Church numeral. Zero iterations leave the initial true value, while at least one iteration replaces it by false. Normal-order beta reduction evaluates a numeral conditional without evaluating an unchosen branch.
With the Church Booleans and , encode a pair byThen and the second projection similarly returns . Pairing an iteration counter with a computed value implements primitive recursion using only Church numeral iteration.
Using a fixed-point combinator, Church Boolean conditionals, a zero test, and a predecessor term, lambda-definable and giveNormal-order beta reduction evaluates only the selected conditional branch, so this term implements primitive recursion on Church numerals.
If total functions and are represented by lambda terms , defineandAfter iterations the Church pair holds , proved by mathematical induction using the defining recursion equations. Consequently represents the total primitive recursive function . This statement concerns total inputs and total recursion constituents; it is not an unguarded composition theorem for arbitrary partial functions.
A partial function is lambda-definable when one lambda term maps Church numerals in its domain to the numeral of the output and produces no numeral on inputs outside its domain.
Every partial computable function is represented on Church numerals by a closed untyped lambda calculus term. First represent all primitive recursive functions using zero, successor, projections, composition and lambda definition of primitive recursion by pair iteration. Apply the Kleene normal form theorem and search successive history codes with a fixed-point combinator. Test the represented total predicate using a Church numeral zero test; return the decoded output only on the true branch. If no history passes, normal-order head reduction continues the search indefinitely and the term has no head normal form, so cannot be in beta equivalence with a Church numeral. This avoids the incorrect assumption that a lazy outer function must evaluate a divergent argument in an unguarded composition.
Represent total machine configuration transitions and tests on Church numerals and Church pairs, then use a fixed-point combinator to iterate until the halting test selects the output. Normal-order beta reduction follows the computation. A nonhalting machine gives an infinite required reduction, so the normal-order normalization theorem rules out a numeral normal form.
The term beta-reduces to for every Church numeral . If its first argument has no head normal form, the whole application has no head normal form. Nesting this operation forces each represented inner computation before applying an outer function, implementing composition of partial functions even when an outer projection would discard an argument. The same guard makes lambda definition of primitive recursion strict in the preceding recursive value.
For a lambda-definable partial , a fixed-point search term tests and returns the first for which . If no such value is reached, reduction produces no Church numeral. This realizes unbounded minimization and therefore makes every partial recursive function lambda-definable.
An expression in normal form admits no further reductions. A term is strongly normalizing when every reduction sequence from it terminates; weak normalization requires only one terminating sequence. Strong normalization theorem for simply typed lambda calculus establishes the stronger property for well-typed terms.
This theorem establishes strong normalization in the normal form sense. Every well-typed simply typed lambda term admits no infinite beta-reduction sequence.
Articles by others on the same topic
Lambda calculus is a formal system in mathematical logic and computer science for expressing computation based on function abstraction and application. It was developed by Alonzo Church in the 1930s as part of his work on the foundations of mathematics. The key components of lambda calculus include: 1. **Variables**: These are symbols that can stand for values. 2. **Function Abstraction**: A lambda expression can describe anonymous functions.