Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 24 2 Solution Created 2026-10-03 Updated 2026-10-07
A function in intension is a finite description of a computation, such as a program or a formal construction expression. A function in extension is the resulting input-output map, including its domain if it is partial. Different descriptions may have the same extension: the programs that return directly and that compute describe the same function. Finite descriptions have Gödel numbers; equality of the resulting partial computable functions is a separate semantic question.
The primitive recursive functions are the smallest class of numerical functions containing the zero functions, the successor function and all projection functions, and closed under function composition in recursion theory and primitive recursion. More explicitly, from and the latter operation formsFor function composition in recursion theory, an -ary and -ary give . Zero functions of all allowed arities can be included, with nullary zero included if arity is part of the coding convention. Every resulting function is total: the initial functions are total, function composition in recursion theory preserves totality, and mathematical induction on verifies totality of primitive recursion. Applying structural induction for primitive recursive functions then covers all construction expressions.
Use a fixed effective Gödel numbering of finite tagged construction trees with decidable decoding. A node is tagged as zero, successor, projection, composition, or recursion. The primitive recursive syntax and arity checking algorithm first checks that the input decodes as a finite tree, then works upwards from its leaves. A projection tag is legal exactly when , with output arity . A composition node declares its output arity and is legal when its outer child has arity , there are exactly inner children, and each has arity ; its arity is . The declared arity also handles the case . A recursion node is legal when its base child has arity and its step child has arity ; its arity is . Zero and successor tags have their declared arities. Ill-formed nodes are rejected. The process terminates because there are only finitely many nodes. Thus, for each fixed ,This is a syntactic assertion about functions in intension. It does not assert that arbitrary machine indices computing primitive recursive functions form a decidable set. That extensional property is nontrivial, hence undecidable by Rice theorem. For an explicit reduction, given a program construct a program that, on every input, waits for to halt and then returns . Its extension is a primitive recursive function if , and otherwise is nowhere defined and so is not a primitive recursive function. A decision procedure for this latter semantic set would decide the diagonal halting set.
Enumerate the decidable syntax set in increasing code order as . There are infinitely many such descriptions; iterating successor after a unary zero expression already supplies infinitely many. Let be the extension of a valid construction and defineTo compute , find by the syntax test and interpret its finite construction tree. Evaluate function composition in recursion theory by evaluating the children, and evaluate primitive recursion by the prescribed finite loop of length equal to its final input. Termination follows from the totality argument above, so and are total computable functions.
If were a unary primitive recursive function, some construction would have extension . Then the diagonal argument giveswhich is impossible. The displayed is total and computable but not primitive recursive. Repetitions of extensions in the enumeration cause no problem: every possible extension is represented, which is all the diagonal argument needs. The same argument shows that the two-variable interpreter cannot itself be primitive recursive.