Lambda calculus is a formal system for expressing computation through function abstraction and application. The syntax is minimal: variables, lambda abstractions (λx.M), and applications (M N). Computation proceeds via β-reduction: replacing formal parameters with actual arguments. Despite its simplicity, lambda calculus is Turing-complete and captures all computable functions, making it the theoretical foundation of functional programming languages.
Practice β-reduction step by step on concrete lambda terms before studying Church encodings of booleans, natural numbers, and recursion. Understanding the Y combinator (fixed-point combinator) is a key milestone that illustrates how recursion emerges from pure function application.
Lambda calculus strips computation down to its absolute minimum: variables, function definitions, and function application. A lambda abstraction λx.M defines an anonymous function with parameter x and body M. An application (M N) calls function M with argument N. That is the entire syntax — no numbers, no loops, no built-in operations. Yet from this, everything computable can be expressed.
The one rule that drives all computation is β-reduction: (λx.M) N → M[x := N]. When you apply a function to an argument, you substitute the argument for the parameter throughout the body. For example, (λx. x + 1) 5 reduces to 5 + 1. But because lambda calculus has no built-in "+" or numbers, even this must be encoded. Natural numbers are represented as Church numerals: the number n is the function that applies its argument f exactly n times to a starting value x. So 3 = λf. λx. f (f (f x)) — not a constant, but a function that captures the *act* of applying something three times.
This encoding might seem artificial, but it demonstrates something profound: data and functions are not fundamentally different things. Booleans, pairs, lists, and even recursion can all be encoded as lambda terms. The famous Y combinator — Y = λf. (λx. f (x x)) (λx. f (x x)) — implements general recursion from pure function application, with no special "recursion" primitive needed. When you call Y applied to a function, the result applies that function to itself indefinitely, enabling loops.
Alpha-equivalence (α-equivalence) says that λx.x and λy.y are the same term — variable names are just placeholders, not meaningful identifiers. This means you must be careful when substituting: if the body M contains a free variable y and you substitute N containing y for x, you must rename the bound y first to avoid "capturing" the free variable. This renaming is called α-conversion, and managing it carefully is essential to correct implementation of β-reduction.
Lambda calculus is Turing-complete, meaning every computation a Turing machine can perform can also be expressed as a lambda term that reduces to the correct answer. This is the theoretical foundation of functional programming: languages like Haskell, ML, and Scheme are, at their core, elaborated lambda calculi with syntactic sugar and type systems layered on top. Understanding lambda calculus gives you the deepest possible insight into what a function is and why function application is computationally universal.