Many-one completeness of the halting problem Created 2026-09-24 Updated 2026-09-24
Every recursively enumerable set many-one reduces to the diagonal halting set. If a program halts exactly on , the S-m-n theorem produces from an index for a unary program that ignores its input and performs that computation on . ThenConversely, a computable preimage of a recursively enumerable set is recursively enumerable.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 2 4H a Solution Created 2026-09-24 Updated 2026-10-03
A recursive set has an indicator function computed by a register machine that halts on every input. A recursively enumerable set is the exact halting set of some register machine; equivalently, it is the domain of a partial computable function.
If is recursive, its decider immediately gives machines that halt exactly on and on , so both sets are recursively enumerable. Conversely, suppose machines and recognize the two sets. On input , use dovetailing to run one step of and one step of alternately. Exactly one must eventually halt. Return one if halts first and zero if halts first. This is a total decider for , so is recursive.
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 2 4F i Solution Created 2026-09-24 Updated 2026-09-29
A subset is recursive when its indicator function is a total computable function. It is recursively enumerable when it is the domain of a partial computable function, equivalently when an algorithm can enumerate its members.
If is recursive, its indicator decides both and its complement, so both sets are recursively enumerable. Conversely, suppose programs enumerate and . On input , run the two enumerations in parallel by dovetailing. Exactly one must eventually print ; accept in the first case and reject in the second. This algorithm always halts and decides . Hence
Past exam of the mathematics course of the University of Cambridge 2021 ii Paper 1 4F Solution Created 2026-09-24 Updated 2026-09-25
The S-m-n theorem states that for every there is a total computable function satisfyingwhenever either side is defined.
Suppose first that is recursively enumerable. Choose a program that halts exactly on inputs in , and let index a two-variable program that, on , ignores and runs that program on . By the S-m-n theorem,is total computable and indexes the unary functionThereforeThus .
Conversely, suppose through a total computable . On input , compute and simulate machine on its own code. This procedure halts exactly when , equivalently exactly when . Hence is recursively enumerable. We have proved the many-one completeness of the halting problem:
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 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.
The set of fixed-point combinators is recursively enumerable. Enumerate closed lambda terms and finite proofs of beta equivalence, and output whenever a proof of appears for a fresh variable .