Lambda Calculus Fundamentals
- 44Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the lambda calculus fundamentally a theory of?
44 questions
- 1
What is the lambda calculus fundamentally a theory of?
Model answer
It is fundamentally a theory of functions and computation.
Explanation
The lambda calculus studies functions as mappings from inputs to outputs and provides a formal way to describe computation.
- 2
In this context, what does a function do?
Model answer
A function maps an input to an output, such as mapping a number to its square.
Explanation
For example, the square function maps the input 2 to the output 4.
- 3
Why describe a function using an arbitrary variable rather than listing every input and output?
Model answer
An arbitrary variable lets us describe the mapping generally instead of listing the output for every possible input.
Explanation
For instance, x can stand for any input in a function that maps it to x2.
- 4
What does it mean for two functions to be alpha equivalent?
Model answer
They are alpha equivalent when they differ only in the name of their bound input variable and represent the same mapping.
Explanation
Renaming x to y in a function such as λx.x2 does not change which inputs map to which outputs.
- 5
What is alpha conversion?
Model answer
Alpha conversion is renaming a function's input variable and all occurrences of that variable in its body.
Explanation
The renamed function remains equivalent as long as the renaming does not change the function's meaning.
- 6
What do the parts of the notation λx.M signify?
Model answer
The lambda marks a function, x names its input, the dot separates the input from the body, and M is the body.
Explanation
The dot is a separator; the Greek letter lambda is a visual marker indicating that a function is being defined.
- 7
What is a lambda abstraction?
Model answer
A lambda abstraction is a function written using lambda notation, such as λx.M.
Explanation
This notation concisely specifies the function's input variable and the expression that forms its output.
- 8
What is function application in the lambda calculus?
Model answer
Function application means supplying an input to a function; the input is written to the right of the function.
Explanation
Applying a function is the operation that allows its body to be evaluated for a particular input.
- 9
What is beta reduction?
Model answer
Beta reduction evaluates a function application by substituting the supplied input for the function's input variable in its body.
Explanation
For a function with body M and input variable x, applying it to N replaces occurrences of x in M with N.
- 10
How is beta reduction marked, and what does the mark indicate?
Model answer
It is marked with an arrow bearing a beta, →β, to indicate that a reduction has occurred.
Explanation
The beta mark distinguishes this computation step from an ordinary function definition.
- 11
What does applying λx.(x+1) to 3 produce, and why?
Model answer
It produces 4, because beta reduction substitutes 3 for x, yielding 3+1.
Explanation
The function body is evaluated after replacing its input variable with the supplied number.
- 12
Which three kinds of syntax are allowed in the lambda calculus described here?
Model answer
Variables, lambda abstractions, and applications.
Explanation
The calculus uses these three forms and beta reduction to compute, without requiring additional built-in syntax.
- 13
What makes a function higher-order?
Model answer
A function is higher-order if it can accept functions as inputs or return functions as outputs.
Explanation
Higher-order functions are central to how the lambda calculus expresses more complex behavior using a small set of constructs.
- 14
What claim about computational power is associated with the lambda calculus in the content?
Model answer
The lambda calculus can express anything a computer can compute, despite using only variables, abstractions, applications, and beta reduction.
Explanation
The content connects this result to the Church–Turing thesis and emphasizes that no extra syntax such as loops or booleans is required.
- 15
How can a calculus whose abstractions each have one input represent a function that takes two inputs?
Model answer
It can take the first input and return another function that takes the second input.
Explanation
The returned function can use the first input when producing the final result after receiving the second.
- 16
What happens when a two-input curried addition function is first applied to 1?
Model answer
It returns a function that takes an input y and produces 1+y.
Explanation
The first beta reduction substitutes 1 for x in the inner function's body.
- 17
How does the curried addition example produce the sum of 1 and 2?
Model answer
After the first application returns a function computing 1+y, applying that function to 2 gives 1+2=3.
Explanation
The two inputs are supplied sequentially, with a beta reduction performed for each one.
- 18
For λx.λy.L, what result is obtained by applying it successively to m and n?
Model answer
The result is L with m substituted for x and n substituted for y.
Explanation
The first application substitutes m in the inner abstraction; the second substitutes n in its body.
- 19
What is currying, and who is it named after?
Model answer
Currying represents a multiple-input function as a sequence of functions, each taking one input; it is named after logician Haskell Curry.
Explanation
Each function returns the next function, so inputs are supplied one at a time.
- 20
How are true and false represented in the Boolean encoding described?
Model answer
True is λx.λy.x, which returns the first input; false is λx.λy.y, which returns the second.
Explanation
These encodings behave like Boolean values by selecting one of two supplied terms.
- 21
How is an if-then-else operation encoded using a Boolean term?
Model answer
It is encoded as λb.λx.λy.b x y, which applies the Boolean b to the two alternatives.
Explanation
The function takes a Boolean and two terms, then uses the Boolean's selection behavior to choose an output.
- 22
Why does the encoded if operation return its first alternative when given true?
Model answer
True returns its first argument, so applying it to the two alternatives selects the first one.
Explanation
Under the encoding, true is λx.λy.x; the alternatives occupy the first and second argument positions.
- 23
Why does the encoded if operation return its second alternative when given false?
Model answer
False returns its second argument, so applying it to the two alternatives selects the second one.
Explanation
Under the encoding, false is λx.λy.y.
- 24
How does beta reduction demonstrate that the encoded if operation returns M when its Boolean input is true?
Model answer
Substituting true, then M and N, reduces the expression to true applied to M and N; true selects and returns M.
Explanation
The Boolean encoding returns its first argument, so the sequence of substitutions yields the first alternative.
- 25
How can the not function be expressed using the encoded Boolean and conditional concepts?
Model answer
It can be written as λb.if b then false else true.
Explanation
This definition swaps the Boolean values: true produces false, and false produces true.
- 26
Why can Boolean and conditional definitions often be used without expanding their full lambda-calculus encodings?
Model answer
Once their encodings are understood, they can be treated as familiar concepts without repeatedly unfolding their low-level definitions.
Explanation
This lets programs use Boolean terms and conditional expressions more conveniently.
- 27
What is a type in the simply typed lambda calculus?
Model answer
A type is a label assigned to terms to indicate that they make sense as values of a particular kind.
Explanation
The example system uses types such as bool and num.
- 28
How is the type of a term written, and what does true:bool mean?
Model answer
A type is written after a colon; true:bool says that true has Boolean type.
Explanation
The colon notation associates a term with its type.
- 29
What does the function type A→B specify?
Model answer
It specifies a function that takes an input of type A and produces an output of type B.
Explanation
The type before the arrow describes the input, and the type after it describes the output.
- 30
How is the input type shown when writing a typed lambda abstraction?
Model answer
The input type is written next to the input variable in the abstraction.
Explanation
Annotating the variable makes the type required for that function's input explicit.
- 31
What type rule governs applying a typed lambda abstraction to an argument?
Model answer
The argument must have the same type as the one specified for the abstraction's input variable.
Explanation
This restriction prevents applications that would produce nonsensical terms.
- 32
Why does typing the not function as bool→bool prevent applying it to 1?
Model answer
The function requires a Boolean input, but 1 has numeric type rather than Boolean type.
Explanation
The type rule rejects the application before reducing it to an expression such as an if statement applied to a number.
- 33
What is the simply typed lambda calculus, and what kind of programming languages does it resemble?
Model answer
It is the lambda calculus with a type system attached, and it resembles statically typed languages such as C and Java.
Explanation
Its type rules limit which terms can be applied to one another, helping rule out ill-formed expressions.
- 34
When was the lambda calculus developed, and what is notable about its timing?
Model answer
Alonzo Church developed it between the 1930s and 1940s, before programming and computer science were formally studied.
Explanation
The calculus predates the formal establishment of those fields.
- 35
How are types interpreted in the Curry–Howard correspondence?
Model answer
Types are interpreted as propositions, and a term of a type is interpreted as a proof that the corresponding proposition is true.
Explanation
For example, a term of type A represents a proof of proposition A.
- 36
Under the interpretation described, what does the absence of a term of type A indicate?
Model answer
It indicates that the proposition corresponding to A is false.
Explanation
In this interpretation, a term of type A serves as evidence that proposition A is true.
- 37
What logical proposition corresponds to the function type A→B?
Model answer
It corresponds to the implication “if A, then B.”
Explanation
A function of type A→B transforms an input that serves as evidence for A into an output that serves as evidence for B.
- 38
In the rain example, what does the proposition A→B express if A means “it is raining” and B means “the ground is wet”?
Model answer
It expresses: “If it is raining, then the ground is wet.”
Explanation
The implication says that proof of the first proposition supports the second.
- 39
How does applying a function of type A→B to a term of type A demonstrate that B follows?
Model answer
The application produces a term of type B, which represents a proof of proposition B.
Explanation
The function supplies the logical implication, and the input term supplies evidence for its premise.
- 40
What is the Curry–Howard correspondence?
Model answer
It is the relationship in which types correspond to propositions and programs or terms correspond to proofs.
Explanation
It connects the structure of typed computation with the structure of logical reasoning.
- 41
What are proof assistants, and what role does the Curry–Howard correspondence enable them to play?
Model answer
Proof assistants are programming environments that use the correspondence to let users write mathematical proofs as computer code.
Explanation
Examples mentioned include Lean and Agda.
- 42
What does it mean for a proof-assistant program to type-check, as in the example proof about prime numbers?
Model answer
It means the program satisfies the system's type rules and is accepted as a proof of its stated result.
Explanation
The content presents a Lean program proving that there are infinitely many prime numbers and says its correctness is confirmed by type-checking.
- 43
Besides Boolean values and conditionals, what other programming concepts does the content say can be encoded in the lambda calculus?
Model answer
Numbers, recursion, and data structures such as pairs can also be encoded.
Explanation
These encodings show how a small formal language can represent concepts commonly built into larger programming languages.
- 44
Why is the lambda calculus valuable even though it is not suited to real-world programming?
Model answer
It provides a minimal mathematical definition of computation and supports rigorous study of programs, theoretical computer science, and mathematical logic.
Explanation
Its small set of rules makes it useful for reasoning about computation even though encoding ordinary features directly can be tedious.

Ask anything
We've read this whole study set, so questions about it get the best answers.