Function in extension 2026-10-07
A function in extension is a function specified by its domain and the value at each input in that domain. Distinct functions in intension can have this same extension. Properties of the extension of an arbitrary program are semantic properties, to which Rice theorem applies when the property is nontrivial.
Infinite-domain range-restriction index set Created 2026-09-24 Updated 2026-09-24
For a nonempty set of words, the propertyis a nontrivial extensional property of unary partial computable functions: the nowhere-defined function fails it, while any total constant function with value in satisfies it. The Rice theorem therefore makes its index set undecidable.
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.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 120 3 Solution Created 2026-10-03 Updated 2026-10-06
Rice theorem: every nontrivial extensional property of programs computing partial computable functions has an undecidable index set. More precisely, take an acceptable effective enumeration of the unary partial computable functions. If contains some but not all of these functions, then“Extensional” means that equality of partial functions, including their domains, preserves membership; no syntactic restriction on program codes is being considered.
We use two standard facts, stated explicitly. The diagonal halting set is undecidable. For the associated acceptable enumerations of -ary partial computable functions, with , the S-m-n theorem says that for every there is a total computable function such thatwhere means equality of defined values and equality of undefinedness. Thus fixed parameters in a program can be compiled into its index effectively.
Let be the nowhere-defined partial computable function. Choose a partial computable function whose membership in is opposite to that of ; this is possible by nontriviality. For each , construct the programThis is a uniform partial computation. Take an index for the binary partial computable function . The S-m-n theorem gives the total computable function with . Crucially,Even when itself is undefined, the equality of partial functions remains correct. If , this gives a many-one reduction of to ; if , it gives a many-one reduction of to the complement of . A decision procedure for would therefore decide in either case, a contradiction.
The equivalent language formulation says that every nontrivial property of computably enumerable languages depending only on the recognized language has an undecidable index set. Apply the function formulation to the property of a partial computable function that its domain has the specified language property: every computably enumerable language occurs as such a domain.
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 4 4G a Solution Created 2026-09-24 Updated 2026-10-03
The S-m-n theorem says that program inputs can be compiled into an index: for every there is a total recursive such thatHere means that either both sides are undefined or both are defined and equal.
The recursion theorem says that every total recursive transformation of program indices has a semantic fixed point: some satisfies
The Rice theorem says that every nontrivial extensional property of programs computed by partial recursive functions is undecidable.
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 4 4G d Solution Created 2026-09-24 Updated 2026-10-03
No. The propertyis extensional: it depends only on the partial function computed, not on its program index. It is nontrivial, since some partial recursive functions have a nine-element domain and others do not. The Rice theorem therefore implies that its index setis undecidable. Hence
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 3 12H b Solution Created 2026-09-24 Updated 2026-10-03
Rice theorem says that every nontrivial extensional property of programs computing partial functions is undecidable. Equivalently, a nontrivial index set cannot be a computable set.
Let be such an index set. Replacing by its complement if necessary, assume that the nowhere-defined function has no index in . Since the property is nontrivial, choose an index . If membership in were decidable, we could decide the diagonal halting problem as follows. For each , defineBy the S-m-n theorem, a total computable function produces an index for . If diverges, then is nowhere defined and . If it halts, then and extensionality gives . A decider for would therefore decide whether halts, a contradiction. Hence is undecidable.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 3 12H e Solution Created 2026-09-24 Updated 2026-10-03
No. The propertyis an index set: it depends only on the domain of the partial function computed, not on the syntax of its program. It is nontrivial. For example, an index whose domain is a singleton belongs to , whereas an index whose domain has two elements does not. The Rice theorem therefore shows that is not a computable set, so no algorithm can decide the requested property for arbitrary .
Invoking the Church–Turing thesis, this also rules out any effective procedure in the informal sense, because such a procedure would be represented by a computable function.
Past exam of the mathematics course of the University of Cambridge 2022 ii Paper 1 4I Solution Created 2026-09-23 Updated 2026-09-25
Fix an effective enumeration of register-machine programs. The th register machine is , and its domainis the th recursively enumerable set. A many-one reduction is a total computable function satisfying . Rice theorem says that every nontrivial property depending only on the computed partial function, or equivalently on an r.e. set in its extensional form, has an undecidable index set.
There is no total equality algorithm: it would decide whether is empty by comparing it with a fixed index for the empty set, contradicting Rice's theorem.
There is no partial algorithm that halts exactly when either. Given , effectively construct an index whose machine enumerates nothing unless halts, after which it enumerates . ThenA semialgorithm for equality with a fixed empty index would enumerate the complement of the halting problem . Since is r.e., both it and its complement would then be r.e., making recursive, a contradiction.
Past exam of the mathematics course of the University of Cambridge 2024 ii Paper 2 4J c Solution Created 2026-09-24 Updated 2026-09-25
The Rice theorem states that every nontrivial index set of partial computable functions is not computable.
Past exam of the mathematics course of the University of Cambridge 2024 ii Paper 2 4J d Solution Created 2026-09-24 Updated 2026-09-25
Fix . The property defining depends only on the partial function computed, so it is an index set. It is nontrivial: an index of the nowhere-defined function is outside it, whereas an index of the total constant function has infinite domain and range , and hence lies in it. The Rice theorem now shows that this infinite-domain range-restriction index set is not computable.
Past exam of the mathematics course of the University of Cambridge 2025 ii Paper 1 12F b Solution Created 2026-09-24 Updated 2026-09-25
Let and let be any index for the empty language. The proof of Rice theorem givesIn either case choose a language on the opposite side of the nontrivial property and switch from the empty enumerator to its enumerator if the simulated diagonal computation halts.