Advanced Topic 45 of 51 Theory & Discrete Math
Lambda Calculus
Minimal formal system of function abstraction and application.
How it works
Lambda calculus is a minimal formal system for computation built from only three kinds of expressions: variables, abstraction, written lambda x dot body, which defines a function, and application, which calls a function on an argument. Computation proceeds by beta reduction, substituting the argument for the bound variable. Despite its simplicity, it is Turing-complete: numbers, booleans, pairs and recursion can be encoded, for example Church numerals and the Y combinator. Typed variants add static guarantees.
Step-by-step walkthrough
- The only things are variables, function definitions and applications.
- A function is written lambda x dot x plus 1.
- Applying it to 3 substitutes x with 3.
- Beta reduction gives 3 plus 1.
- This tiny system is Turing complete and underlies functional languages.
Where it is used
It is the foundation of functional programming languages such as Lisp, Haskell and ML, and of type theory and proof assistants. Lambda expressions in mainstream languages come from it.
Common pitfall
Variable capture during substitution causes errors, so alpha-renaming of bound variables is needed. Reduction strategies such as normal order and applicative order differ in termination: some terms have no normal form. Untyped lambda calculus allows nonterminating terms, while simply typed versions guarantee termination but lose power. Practice by reducing small expressions by hand.
Where it fits in the course
Lambda Calculus is topic 45 of 51 in Theory & Discrete Math, rated Advanced. It follows Parameterized Complexity. The next topic is Information Theory.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Theory & Discrete Math quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Theory & Discrete Math quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Lambda Calculus?
Where do people use Lambda Calculus?
What is the most common mistake with Lambda Calculus?
What should I learn before this topic?
How can I practice it?
Is Lambda Calculus hard to learn?
How long does it take to learn Lambda Calculus?
Which topics are related to Lambda Calculus?
What should I study after Lambda Calculus?
Related topics
- Parameterized Complexity (Theory & Discrete Math)
- Information Theory (Theory & Discrete Math)
- Approximation and Inapproximability (Theory & Discrete Math)
- Kolmogorov Complexity (Theory & Discrete Math)
- Lambda Expressions (Programming Fundamentals)