In mathematical logic, the lambda calculus (also written as λ-calculus) is a formal system for expressing computation based on function abstraction and application using variable binding and substitution. Untyped lambda calculus, the topic of this article, is a universal machine, i.e. a model of computation that can be used to simulate any Turing machine (and vice versa). It was introduced by the mathematician Alonzo Church in the 1930s as part of his research into the foundations of mathematics. In 1936, Church found a formulation which was logically consistent, and documented it in 1940.
Definition
The lambda calculus consists of a language of lambda terms, which are defined by a formal syntax, and a set of transformation rules for manipulating those terms. In BNF, the syntax is e::=x∣λx.e∣ee, where variables x,y,z range over an infinite set of names. Terms M,N,t,s,e,f range over all lambda terms. This corresponds to the following inductive definition:
A variable x is a valid lambda term. An abstraction is a lambda term (λx.t) where t is a lambda term, referred to as the abstraction's body, and x is the abstraction's parameter variable, An application is a lambda term (ts) where t and s are lambda terms. A lambda term is syntactically valid if it can be obtained by repeated application of these three rules. For convenience, parentheses can often be omitted when writing a lambda term—see Lambda calculus definition § Notation for details. Within lambda terms, any occurrence of a variable that is not a parameter of some enclosing λ is said to be free. Any free occurrence of x in a term M is bound in λx.M. Any free occurrence of any other variable within M remains free in λx.M. For example, in the term xy, both x and y occur free. In (λx.xy), y is free, but x in the body (i.e. after the dot) is not free, and is said to be bound (to the parameter). While y is free in (λx.xy), it is bound in (λy.λx.xy). There are two occurrences of x in (λy.(λx.xy)x) – one is bound, and the other is free. FV(M) is the set of free variables of M, i.e. such variables that occur free in M at least once. It can be defined inductively as follows:
FV(x)={x} FV(M1M2)=FV(M1)∪FV(M2) FV(λx.M)=FV(M)∖{x} The notation M[x:=N] denotes capture-avoiding substitution: substituting N for every free occurrence of x in M, while avoiding variable capture. This operation is defined inductively as follows:
x[x:=N]=N; y[x:=N]=y if y≠x. (M1M2)[x:=N]=(M1[x:=N])(M2[x:=N]). (λy.M)[x:=N] has three cases: If y=x, becomes λx.M (x is bound; no change). If y∉FV(N), becomes λy.(M[x:=N]). If y∈FV(N), first α-rename λy.M to λy′.(M[y:=y′]) with y′ fresh to avoid name collisions, then continue as above. It becomes (λy′.(M[y:=y′]))[x:=N] with y′∉FV(M)∪FV(N). There are several notions of "equivalence" and "reduction" that make it possible to reduce lambda terms to equivalent lambda terms.
α-conversion captures the intuition that the particular choice of a bound variable, in an abstraction, does not (usually) matter. If y∉FV(M), then the terms λx.M and λy.M[x:=y] are considered alpha-equivalent, written λx.M≡αλy.M[x:=y]. The equivalence relation is the smallest congruence relation on lambda terms generated by this rule. For instance, λx.x and λy.y are alpha-equivalent lambda terms. The β-reduction rule states that a β-redex, an application of the form (λx.t)s, reduces to the term t[x:=s]. For example, for every s, (λx.x)s→x[x:=s]=s. This demonstrates that λx.x really is the identity. Similarly, (λx.y)s→y[x:=s]=y, which demonstrates that λx.y is a constant function. η-conversion expresses extensionality and converts between λx.fx and f whenever x does not appear free in f. It is often omitted in many treatments of lambda calculus. The term redex, short for reducible expression, refers to subterms that can be reduced by one of the reduction rules. For example, (λx.M)N is a β-redex in expressing the substitution of N for x in M. The expression to which a redex reduces is called its reduct; the reduct of λx.MN is M[x:=N].
Explanation and applications Lambda calculus is Turing complete, that is, it is a universal model of computation that can be used to simulate any Turing machine. Its namesake, the Greek letter lambda (λ), is used in lambda expressions and lambda terms to denote binding a variable in a function. Lambda calculus may be untyped or typed. In typed lambda calculus, functions can be applied only if they are capable of accepting the given input's "type" of data. Typed lambda calculi are strictly weaker than the untyped lambda calculus, which is the primary subject of this article, in the sense that typed lambda calculi can express less than the untyped calculus can. On the other hand, more things can be proven with typed lambda calculi. For example, in simply typed lambda calculus, it is a theorem that every evaluation strategy terminates for every simply typed lambda-term, whereas evaluation of untyped lambda-terms need not terminate (see below). One reason there are many different typed lambda calculi has been the desire to do more (of what the untyped calculus can do) without giving up on being able to prove strong theorems about the calculus. Lambda calculus has applications in many different areas in mathematics, philosophy, linguistics, and computer science. Lambda calculus has played an important role in the development of the theory of programming languages. Functional programming languages implement lambda calculus. Lambda calculus is also a current research topic in category theory.
History Lambda calculus was introduced by mathematician Alonzo Church in the 1930s as part of an investigation into the foundations of mathematics. The original system was shown to be logically inconsistent in 1935 when Stephen Kleene and J. B. Rosser developed the Kleene–Rosser paradox. Subsequently, in 1936 Church isolated and published just the portion relevant to computation, what is now called the untyped lambda calculus. In 1940, he also introduced a computationally weaker, but logically consistent system, known as the simply typed lambda calculus. Until the 1960s when its relation to programming languages was clarified, the lambda calculus was only a formalism. Thanks to Richard Montague and other linguists' applications in the semantics of natural language, the lambda calculus has begun to enjoy a respectable place in both linguistics and computer science.
Origin of the λ symbol
… excerpt ends here. Continue reading the full article.

