For the given effective enumeration of partial computable functions, the diagonal halting set is
A many-one reduction is a total computable function such that
The S-m-n theorem states that for every there is a total computable function satisfying
whenever 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 function
Therefore
Thus .
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:
Finally, use the stated fact that and define
Then , so . The total computable map satisfies
and therefore . This is a distinct representative of the halting many-one degree.
First, : the partial procedure on input simulates and halts exactly when that computation halts.
For hardness, let . Choose a partial computable function with
For each fixed , define a unary program as follows: on any input , simulate ; if that simulation halts, halt and output , and otherwise run forever. The S-m-n theorem gives a total computable function that maps to a code for . Its accepted language is
In particular,
Thus is a many-one reduction . Since was arbitrary, is -hard; together with membership this proves the many-one completeness of the halting problem.