Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 87 3 b Solution Created 2026-10-03 Updated 2026-10-14
Choose mutually inverse maps and . This is an extensional reflexive object in the Cartesian closed category. Define its application morphismFor endomorphisms , application in the underlying set is .
It is useful to define term interpretation uniformly over any context object . An environment assigns each free variable a morphism . Variables are interpreted by their assigned maps, and application is interpreted by and pairing. For lambda abstraction, lift the old environment along , interpret the new variable by , and let interpret the body. Then setTaking gives interpretations in the requested set of endomorphisms. Other context objects are needed in the recursive definition to handle bound variables correctly.
The beta reduction rule follows from and the evaluation identity for currying. Applying the interpreted abstraction to a map givesInduction on terms identifies this with interpretation of the capture-avoiding substitution of the argument for .
For eta conversion, suppose is not free in and write for the interpretation of . The body on is the uncurried form of . HenceThus beta-eta-equivalent terms have equal interpretations in . The full isomorphism, rather than just a retract of the function object, provides the inverse law used in the eta step.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 20 4 Solution Created 2026-10-03 Updated 2026-10-07
In the simply typed lambda calculus, types are generated from atomic types by the arrow constructor . A typed lambda term is a lambda term equipped with a derivation of a judgement , where the context assigns types to its free variables. The basic typing rules areThe Implicational Curry-Howard correspondence reads atomic types as propositions and as logical implication. A typed variable is an assumption, abstraction is the implication introduction rule discharging that assumption, and application is the implication elimination rule. Consequently a typed lambda term is a proof in implicational Intuitionistic propositional logic, and a natural deduction proof recursively supplies such a term. For example, expresses implication reflexivity. Products, sums, and the empty type extend the correspondence to conjunction, disjunction, and falsity; pure arrow types give precisely the implicational fragment. Beta reduction removes an introduction followed immediately by its elimination, matching proof simplification.
A Church numeral iswhere means repetitions of application. At base type , it has type . The following Church numeral arithmetic terms use left-associated application:Their concise conclusions areFor successor, the initial adds one application. For addition, the inner supplies applications and supplies more. For multiplication, the repeated operation applies times, and repetitions give . For exponentiation, iterates the operation on : each iteration replaces a function by its -fold iterate, yielding . Zero iterations give , so this encoding takes , including . The explicit outer abstractions make the result the standard Church numeral even at exponent zero, without needing eta equivalence.
Successor, addition, and multiplication operate on the same . The displayed exponentiation term has type : its exponent iterates an operation on functions. Thus the numeral syntax admits several type instances; one should not force every occurrence into one fixed monomorphic Church type.
The Y combinator is the fixed-point combinatorFor , beta reduction gives . Since , we obtain . This allows a recursive program body to receive a representation of itself.
Here the computation is in the untyped lambda calculus. The self-application would require a simple type satisfying , impossible for finite simple types. Accordingly is not a typed lambda term of the simply typed system. The Strong normalization theorem for simply typed lambda calculus also rules out a universal divergent fixed-point operator there.
To obtain a lambda representation of partial computable functions, encode machine configurations as finite data using Church numerals, Church pairs, and Church Booleans. Initial configuration, one transition, the halting test, and output extraction are primitive recursive functions, represented by lambda terms through the initial functions, composition, and lambda definition of primitive recursion by pair iteration. If these representations are , , , and , defineUse normal-order beta reduction so the Church Boolean halting test selects one branch without evaluating the unused recursive branch. A halting computation follows finitely many transitions and returns the Church numeral of the output. A nonhalting computation forces successive tests forever and has no head normal form; by normal-order normalization theorem, it cannot be beta equivalent to a Church numeral. Thus every partial computable function is represented, with divergence preserved; every total computable function is the halting special case. This explains the role of in computational universality while keeping the typed proof interpretation precise.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 135 3 Solution Created 2026-10-03 Updated 2026-10-05
The machine characterization is computation by a Turing machine: the machine halts with exactly on inputs in the domain of a partial function and does not halt elsewhere. The syntactic characterization is the least class containing the initial functions of recursion theory and closed under composition of partial functions, primitive recursion and unbounded minimization. Such functions are the partial recursive functions, equivalently the partial computable functions.
For clarity, composition here is strict: is defined only when every inner value is defined and is defined on the resulting tuple. Likewise primitive recursion requires all preceding recursive values. The partial minimization is defined when such a exists and all earlier values are defined and nonzero; an undefined earlier value blocks the search.
A lambda-definable partial function is represented by a closed untyped lambda calculus term satisfyingOn an input outside its domain there must be no Church numeral beta-equivalent to the result. A stronger representation can be arranged: undefined inputs have no head normal form.
Here are the components for proving that every partial recursive function is lambda-definable. Zero and projections are immediate; lambda definition of the successor function uses . Church Booleans encode a conditional by , with and . PutIteration takes to for , proving that encodes the predecessor function and that correctly tests zero.
Use a fixed-point combinator and the strict sequencing operationFor any numeral , reduces to . If the first argument has no head normal form, neither does the whole expression. Thus composition is implemented by nesting on every inner result before applying the outer representing term. This guard is important: an unguarded projection could discard an undefined inner computation.
For lambda definition of primitive recursion, with already represented by , takeThe tuple notation abbreviates successive abstractions and applications. On numeral inputs, induction on proves the required recursion equations, including strict propagation of undefined preceding values. The beta reduction follows the selected conditional branch only.
For lambda definition of unbounded minimization, useThis searches in increasing order. An undefined value blocks the zero test; an infinite sequence of nonzero values continues forever; the first zero returns its numeral. Under normal-order beta reduction, both failure cases have no head normal form. Structural induction on partial-recursive declarations now supplies the stronger representation claimed above.
Conversely, beta reduction is an effective operation on finitely encoded lambda terms. Enumerate all finite reduction sequences from , stopping when a result is a Church numeral in beta-normal form. If , the Church-Rosser theorem gives a reduction to that numeral. It also makes the output unique. The enumeration therefore computes exactly the represented partial function; by the equivalence of the first two characterizations it is partial recursive. Hence
Past exam of the mathematics course of the University of Cambridge 2021 iii Paper 120 3 Solution 2026-09-28
A partial function is lambda-definable when a lambda term sends the corresponding Church numerals to the numeral for whenever the value is defined and produces no numeral otherwise; in other words, it is a lambda-definable partial function. The initial functions are represented byand the appropriate variable in . If represent , thenrepresents their composition.
Church Booleans supply a lazy conditional, andtests whether a Church numeral is zero. A standard predecessor term isLet and represent the base and step functions of a primitive recursion. With a fixed-point combinator , defineNormal-order beta reduction evaluates only the selected branch. Induction on the input numeral gives the two recursion equations, so this is the lambda definition of primitive recursion.
For unbounded minimization, let represent and defineThen tests in order and returns the least zero of . If no zero is reached, or a required earlier computation is undefined, reduction never produces a Church numeral. This is the lambda definition of unbounded minimization. Since the partial recursive functions are generated from the initial functions by composition, primitive recursion, and minimization, every partial computable function is represented by a lambda term on Church numerals.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 120 1 a Solution 2026-09-28
Under the Curry-Howard correspondence, Intuitionistic propositional logic propositions are types and proofs are typed terms. Assumptions correspond to typed variables. The logical implication corresponds to the function type, logical conjunction to the product type, logical disjunction to the sum type, logical truth to the unit type, and logical falsity to the empty type.
The rules of natural deduction become term constructors. Implication introduction sends a derivation of from a variable to the abstraction , while implication elimination becomes application . Pairing and projection implement conjunction, and injections with case analysis implement disjunction. Under this correspondence, normalization of proofs is computation by beta reduction in the simply typed lambda calculus.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 120 3 a Solution Created 2026-09-28 Updated 2026-10-03
The Church numeral corresponding to the natural number isA function is a lambda-definable function if some closed lambda term satisfiesfor all natural numbers .
DefineThen beta reduction givesTherefore the successor function is lambda-definable; this is the lambda definition of the successor function.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 120 3 c Solution 2026-09-28
By assumption the set of combinators is recursively enumerable. Finite beta reduction sequences, and hence finite certificates of beta equivalence, are also recursively enumerable.
For a closed term , choose a fresh variable . The term is a fixed-point combinator exactly whenIndeed, substitution then gives the required equivalence for every , and the forward direction follows by taking . Dovetail the enumeration of closed terms with all finite beta-equivalence certificates. Whenever a certificate of the displayed equivalence is found, output . This enumerates exactly the fixed-point combinators, proving recursively enumerable fixed-point combinators.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 120 2 c Solution 2026-09-28
A term is in beta-normal form when it contains no beta-redex, meaning no subterm of the formEquivalently, no beta reduction can be performed anywhere in the term.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 120 2 d Solution 2026-09-28
The Weak normalization theorem for simply typed lambda calculus states that every well-typed term of the simply typed lambda calculus admits at least one finite sequence of beta reductions ending in a beta-normal form.
Standardization theorem for beta reduction 2026-10-14
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.