Abstract machine 2026-10-14
An abstract machine specifies a computational state and rules for advancing that state without requiring one particular physical implementation. A Turing machine and a stack machine give different ways to organize the state and its transitions.
Church–Turing thesis Created 2026-10-03 Updated 2026-10-05
The Church–Turing thesis asserts that every effectively calculable function is computable by a formal model equivalent to a Turing machine. It identifies an informal notion of effective procedure with a mathematical class rather than stating a theorem within one formal system.
Languages decidable by deterministic Turing machines using work-tape cells with a read-only input. Input-head addresses take bits, while the input itself is not charged to work space. The definition does not require the bound to be computed by the deciding machine.
A semigroup presentation is finite when both its generator set and its list of defining equalities are finite. A finite transition table for a Turing machine can be encoded this way: state-and-tape words simulate transitions, boundary rules supply blank cells, and halting-state rules erase the configuration to one distinguished symbol.
Halting set Created 2026-10-06 Updated 2026-10-07
The halting set of a Turing machine is the set of inputs on which it eventually halts. For a deterministic machine with a designated terminal state, eventual halting is invariant along every transition edge, even when that edge is traversed backwards. This observation justifies passing from forward computations to symmetric equality derivations in a semigroup presentation.
For a deterministic single-tape Turing machine, an instruction reads a state and scanned tape symbol , writes , changes state to , and moves the head one cell left, one cell right, or not at all according to . The state and tape alphabets are finite; an undefined transition halts. A dedicated terminal state can be introduced by directing undefined transitions to it without changing whether computation halts.
Modular machine 2026-10-06
A modular machine of modulus acts on pairs in . Each instruction or has and , and at most one instruction is assigned to each residue pair . The two transition types are and . These finite arithmetic operations can encode a Turing machine; a designated terminal configuration can have a nonrecursive halting set.
An algorithm is a finite effective procedure on finitely encoded inputs; a Turing machine is one precise model. A decision algorithm must halt on every permitted input and answer correctly. An algorithmic problem specifies the input encoding and the required output; enumerating positive answers alone is not a decision algorithm.
For a fixed finite group presentation , the word problem for a group takes a finite word in and asks whether it represents the identity. Equality of two represented elements is equivalent to testing . Positive answers are recursively enumerable: enumerate finite products of conjugates of relators and their inverses, freely reduce them, and compare with the input. Equivalently enumerate finite labelled disc diagrams. The van Kampen lemma ensures that every null word eventually appears. For a non-null word this search continues forever. Solvability requires a procedure that also terminates with a negative answer.
A partial computable function may return a natural-number output or diverge. One concrete definition uses finite deterministic Turing machines; code the finite transition table by an integer . Every single transition and every bounded simulation is computable, and the universal simulation gives a universal partial computable function
The symbol means equal outputs when defined and simultaneous divergence otherwise. A total computable function is a partial computable function defined on every input. Different program codes may compute the same partial function; this distinction between syntax and computed behavior is crucial.
The equivalent recursive description starts with zero, successor and projections and closes under composition and primitive recursion, giving the primitive recursive functions. Add unbounded minimization: search for the first at which a predicate returns zero, requiring every preceding tested computation to have converged. This gives the partial recursive functions. To see the connection with machines, encode finite configurations and histories. Checking a proposed halting history is a primitive recursive predicate , and a primitive recursive function extracts its output. Thus a machine computation has the normal form . Conversely a machine can implement composition, primitive recursion and this successive search. This proves equivalence of the formal definitions. The Church–Turing thesis identifying them with informal effective calculability is a thesis, not an additional formal theorem used in the proof.
A computably enumerable set is one enumerated by a program, equivalently the domain of a partial computable function. For the forward implication wait until the given input is enumerated; for the reverse implication run all input computations by dovetailing, outputting those that halt. A set is decidable if its characteristic function is total computable. It is decidable exactly when both it and its complement are computably enumerable: dovetail their enumerators and stop when one lists the input.
The S-m-n theorem supplies effective specialization of parameters. Given a code for a program on , compile the constant into a wrapper that writes it and then calls that program. The wrapper's transition table is computably produced from the original table and , yielding a total computable function with . This elementary code-construction proof is all the specialization machinery needed below.
The diagonal halting problem is computably enumerable by universal simulation but not decidable. If a total decider existed, the program that halts on precisely when would have an index . Evaluating it at gives exactly when , a contradiction.
For Rice theorem, let be a nontrivial collection of partial computable functions, and let its index set be . Membership must depend only on the computed function, not on its code. Let be the nowhere-defined function. First suppose , and choose a computable partial function with a fixed program. Uniformly from , produce the following program on input : first simulate ; if it halts, then simulate and return that output. Its index is total computable by specialization, and
Therefore iff , so a decider for would decide . If instead , apply the same argument to the nontrivial complement collection, whose index set would also be decidable if were. We conclude
For computably enumerable languages, use the same waiting program before beginning a fixed enumeration, taking the empty language as the bottom object. Properties such as having finite domain, computing a total function or recognizing a particular nontrivial language are therefore undecidable. Purely syntactic properties such as the parity of the code are excluded: they are not extensional. Rice's conclusion is undecidability, not that every such index set must fail to be computably enumerable.
Use a deterministic single-tape Turing machine with finite tape alphabet containing a blank symbol , and finite control states. Its instruction of a Turing machine has the form
It reads , writes , changes state, and moves the head left, right, or stays. An instantaneous description of a Turing machine records the state, scanned position, and tape contents; cells outside the finite recorded window are blank. The initial description places the head at the first input symbol, or at a blank for an empty input. A tape infinite in both directions is used here; extending the recorded window does not change its infinite blank surroundings.
Introduce a dedicated halting state and replace every undefined transition by a stay instruction to , retaining the scanned symbol. Give no instructions. This effective normalization changes only the final bookkeeping step, not whether the original machine halts. Keep its initial state and tape alphabet unchanged. State letters, tape letters, and the new symbols are mutually disjoint.
Represent a finite description by the word
The head scans the first letter of if there is one; if is empty it scans an implicit blank just beyond the recorded right end. The letters of are in left-to-right order, and the remaining right-hand letters follow the scanned cell. The markers bound a window, not walls of the physical tape. Thus the input is represented exactly by , including empty.
Define the semigroup simulation of a Turing machine by taking generators , all state letters, , and , with the following finite list of defining equalities. For each ordinary instruction, use its row below; in a left-move row add the first relation for every :
These are the cases where a scanned cell is explicitly present. For the instructions reading , add boundary cases when the right-hand word is empty:
A left move at the recorded left end supplies a new scanned blank ; a right move at the right end can keep the next blank implicit. Each equality can be checked by reading the new scanned cell and written symbol. For instance leaves the head scanning , with the just-written to its right. Every transition is one of these local substitutions, including either finite-window boundary case.
Finally add only the terminal cleanup equalities
There are finitely many generators and relations, and every side is a nonempty word. Thus these equations define a finite semigroup presentation , not merely a rewriting program. In particular, its equalities may be used in either direction.
If halts on , the simulated forward computation takes to some . The cleanup relations remove and , then . This proves the forward implication.
For the converse, equality in a semigroup presentation is witnessed by a finite sequence of replacements in contexts, in either direction. Before the first cleanup relation is used, every word reached from is still a valid description: it has exactly two outer markers, exactly one state letter, tape symbols between them, and nothing outside. The transition equalities and their inverses preserve this form. A forward transition sends its interpreted configuration to its unique successor . Since the machine is deterministic, eventually halts if and only if eventually halts. Consequently eventual halting is invariant even when such an equality is traversed backward; no reversibility hypothesis on the machine is needed.
Any first cleanup replacement must already encounter . The inverse erasure rules also require , and the inverse acceptance rule requires , which cannot appear before an acceptance replacement. Therefore a derivation reaching the one-letter word first reaches a description in state using only simulation equalities. Halting invariance along this initial part of the derivation implies that the original input configuration halts. Thus
The converse proof is what prevents arbitrary inverse uses of the defining relations from becoming spurious halting certificates.
The arrow in the original PDF permits partial functions. A partial computable function is computed by a finite program which halts with the specified value on every input in its domain and diverges on inputs outside the domain. A total computable function is the special case with full domain. Coding finite tuples by a primitive recursive pairing function identifies the different finite arities effectively, without identifying total and partial computability.
One precise machine model is a Turing machine. Its finite transition rules and configurations admit effective numerical coding. Bounded simulation is primitive recursive, and unbounded execution gives the partial result. Equivalently, start from zero, successor and projections and close under composition, primitive recursion and unbounded minimization. The Kleene normal form theorem makes the equivalence concrete:
where is a primitive recursive predicate checking a coded halting computation and reads its output. If no computation exists, the minimum and hence the value are undefined. Checking a finite history is effective because every consecutive configuration must obey one of the finitely many transition rules.
The universal partial computable function evaluates the program indexed by on an input. The S-m-n theorem says that fixing finitely many input parameters can be done by a total computable operation on program Gödel numbers: a new program stores those parameters and calls the original universal evaluator. These facts explain both universal simulation and uniform reductions. A set is computably enumerable when it is the domain of a partial computable function, equivalently the range of an effective enumeration. It is recursive when its characteristic function is total computable. A set is recursive precisely when it and its complement are computably enumerable: dovetail the two enumerations to decide each input.
The diagonal halting problem is computably enumerable but not recursive. A total decider would yield a program which, on , diverges if the decider says and halts otherwise. Applying this program to its own index gives a contradiction. There is likewise no total computable universal listing of all total computable functions: the diagonal function would be total and absent from the listing.
Here is a full proof of the Rice theorem. Let be a nonempty proper class of partial computable functions whose property depends only on the function, not its program. First suppose the everywhere-undefined function is not in , and choose a program for a function . Given an index , construct uniformly a program which on first waits for to halt and, only then, simulates . The S-m-n theorem gives a total computable index map . If , then ; if , then . Thus
A decision procedure for the property would decide , impossible. If , apply the same argument to its nontrivial complement. Every nontrivial extensional property of partial computable functions has an undecidable index set. Totality, having finite domain, and taking a particular value somewhere are examples. A syntactic property such as program length is not covered; nor does the theorem say that no individual program's behaviour can be established.
Self-reference can also be made effective. For a total computable index transformation , let be an index for the program which first computes and then runs the program with that resulting index on its own input. The S-m-n theorem makes total computable. Choose an index for the total function , and put . Then
This proves the recursion theorem: every effective transformation of programs has a fixed point at the level of the function computed, though not necessarily at the level of its numerical code.
Finally, consider the Jockusch triple coloring computing the halting set. Fix computable finite approximations with union . For , define
This is a total recursive two-coloring because both stages are finite computations. Suppose is infinite and homogeneous. Its color cannot be one: fix , wait until every enumeration below has stabilized, and choose later from beyond that stage. Their color is zero.
If has color zero, it computes . On input , use to find and in . For arbitrarily large with , homogeneity gives . Taking stages sufficiently large to reach the final finite approximation gives . Consequently membership of in is decided by the finite stage . A recursive would therefore make recursive, a contradiction. There is a recursive partition of triples with no infinite recursive homogeneous set. This is the nontrivial finite-color meaning of the partition of an infinite domain; if “infinite partition” meant infinitely many colors, the coloring by the least member would already give a trivial example. Ramsey's theorem still guarantees infinite homogeneous sets for the displayed two-coloring, but every such set is computationally nontrivial.
The printed arrow is a partial-function arrow. Thus the central objects are partial computable functions , with total computable functions as the special case in which every input has an output. Here includes zero; changing this convention by a computable shift changes none of the results. A program computing must halt with output exactly on its domain, and run forever elsewhere. A finite program is a function in intension, whereas its possibly partial input-output map is a function in extension; many programs have the same extension.
A precise machine model is a register machine with finitely many instructions to increment a register, decrement it conditionally, jump, and halt. Registers hold natural numbers. A Turing machine instead uses a finite transition table, a finite alphabet and an unbounded tape. These models simulate one another: encode the finite nonblank tape, state and head position as numbers for the register simulation; conversely represent each register by a finite tape block and implement its increment and decrement by finite scans. Tuple inputs can be encoded by a primitive recursive pairing function. The equivalence of these formal models is a mathematical result. Their identification with every informal effective procedure is the Church–Turing thesis, rather than an additional mathematical theorem about an already formal notion.
There is also an algebraic description. Begin with zero, successor and projections, close under composition of partial functions and primitive recursion, and then under unbounded minimization. The primitive recursion scheme is
Applied within the primitive recursive class it produces only total functions, by mathematical induction on . Unbounded minimization searches for the first zero of ; its output is defined only if that search reaches such a zero with every preceding necessary computation defined. Composition is likewise strict about the intermediate values it requires. These schemes compile into machine programs using finite subroutines, loops and an unbounded search loop.
For the converse, encode a machine's finite configurations and finite computation histories using Gödel numbering. Testing that a history starts with the specified input, that every adjacent pair follows the transition table, and that its final configuration halts is primitive recursive: all the tests are bounded by the finite code. Extracting the final output is primitive recursive too. For a suitable checking predicate and output decoder this proves the Kleene normal form theorem:
The symbol means equality of values and of definedness. A halting computation has a passing history code and every passing history has its actual output; a nonhalting computation has none. This proves that the partial recursive and machine-computable functions coincide, including their domains of divergence.
Finite programs can be effectively listed. Simulating the program with index gives a universal partial computable function . Fixing some inputs is effective syntactically: prepend instructions writing those constants and then call the original program. This proves the S-m-n theorem in this machine presentation. In particular, reductions that construct a program from numerical parameters really do produce its index effectively.
The primitive recursive functions are a proper subclass of the total computable functions. Enumerate all valid unary primitive recursive descriptions, interpreting invalid descriptions as zero. Evaluating any fixed valid description terminates by structural induction. Thus the diagonal map is total and computable, but cannot be one of the enumerated primitive recursive maps, since . This is a total computable diagonal over primitive recursive syntax. The evaluator can terminate on every particular description without itself being primitive recursive.
In contrast, one cannot effectively enumerate exactly the programs for all total computable functions. If such an infinite enumeration were available, wait for its th program and run it on , then add one. Totality makes this another total computable function, while its diagonal disagrees with every listed function. Equivalently, there is no total computable universal evaluator listing precisely all total computable maps.
The halting problem is undecidable. If decided whether program halts on , construct a program which halts on input exactly when says that it does not halt. Taking to be 's own index gives a contradiction. The halting relation is nevertheless computably enumerable, since finite halting histories can be searched for.
More generally, a set is computably enumerable exactly when it is the domain of a partial computable function. From an enumeration, halt on when appears; in the other direction use dovetailing over all inputs of a partial program to enumerate its halting inputs. A set is a computable set exactly when both it and its complement are computably enumerable: dovetail the two searches and return the answer from the one that succeeds. Neither a semidecision procedure nor an unbounded search supplies a uniform negative answer.
Finally, the Rice theorem explains the scope of this obstruction. Let be a nontrivial property of the extension of a partial computable program. Choose a partial computable whose -status differs from that of the nowhere-defined function. Given a program and input , effectively form the program which, on , first waits for to halt and then computes . If never halts its extension is nowhere defined; otherwise its extension is . A decision procedure for would therefore decide the halting problem. Effective descriptions allow universal simulation and positive verification, but not a decision procedure for every semantic property or for termination.
The Cook-Levin theorem states that the Boolean satisfiability problem is NP-complete under polynomial-time many-one reductions. Membership in NP follows by guessing an assignment and evaluating the formula in time polynomial in its description length.
For hardness, let have a deterministic polynomial-time verifier , with a polynomial witness-length bound. Use a fixed polynomial certificate length: a short certificate is encoded by its length followed by padded data, and the verifier checks this encoding. Pad the computation to exactly steps, with accepting and rejecting states absorbing. Enlarge polynomially if necessary to cover input/witness initialization. A standard polynomial slowdown permits a single-tape Turing machine, so it suffices to handle that model.
Encode a tape cell by a fixed number of bits recording its alphabet symbol and either no head or the head's finite control state. Starting with one head, a cell's next label depends only on its own label and the two neighboring labels: a head can change the symbol where it sits and can enter only a neighbor. Each such finite local function has a constant-size Boolean circuit. The initial row fixes , blanks and the starting head, leaving only the witness bits as Boolean circuit inputs. There are relevant cells with blank margins beyond every possible head position, and updates. Repeating these local Boolean circuits produces a Boolean circuit of size , with an output detecting an accepting head in the final row. The construction is computable in polynomial time. Induction on rows shows that every assignment to produces exactly the verifier's valid computation; invalid local encodings can be assigned arbitrary Boolean circuit behavior because they never arise from the valid initial row.
Convert this Boolean circuit to conjunctive normal form using a Tseitin transformation. Introduce one variable for each wire, and encode each gate output by:
Gate relationClauses imposing equivalence
Unit clauses fix constant sources and assert the final output. Each input assignment has exactly one extension to its gate values, so the resulting formula is satisfiable precisely when some witness makes accept. It has clauses of bounded length and is produced in polynomial time. Thus
This proof also gives hardness for clauses of at most three literals, without needing a separate satisfiability assumption.
With a read-only input tape, deterministic space complexity class consists of languages decidable by deterministic Turing machines using work-tape cells. The nondeterministic space complexity class uses Nondeterministic Turing machines, with the bound holding on every computation path and acceptance meaning that some path accepts. Input storage is not charged. We use the standard finite-state, fixed-alphabet model.
The Savitch theorem is
First suppose a work-space budget is available. A configuration graph for computations restricted to cells has configurations encoded in bits: work contents, control state and head positions, including bits for the input head. Its size is at most for a machine-dependent constant . Add accept and exit sinks if needed; the size bound merely changes . A reachable configuration has a simple path of length smaller than the number of configurations.
For encoded configurations , define to ask whether a path of length at most exists. At , test equality or one transition. For , enumerate every candidate middle configuration and test
Any path of the given length can be split into two halves of length at most ; conversely concatenation gives a path of length at most . This proves the recursion. Taking suffices. Depth is , and each recursive frame stores only its endpoints, the current middle configuration and counters in bits. The two recursive calls are made sequentially and reuse their space. The total is , even though the time can be very large.
The printed hypothesis does not say that is computable. The space-bound discovery by exit reachability removes that issue. Begin with and use the preceding recursion to test both whether an accepting state is reachable within the budget and whether a reachable state has a transition leaving the budget. Accept in the first case. If acceptance is absent and an exit is reachable, double and repeat. If neither is reachable, reject: all computations remain within this finite configuration graph, and none accepts.
Every path of the original machine uses at most cells. Once reaches that bound there can be no reachable exit, so this procedure terminates. The final budget is by doubling, and all stages reuse the same storage. Hence its deterministic space is without requiring a machine that first computes . This proves the stated general form.
For sets , many-one reducibility means there is a total computable function such that
Turing reducibility means that a Turing machine with oracle computes the indicator function , halting on every input. A many-one reduction supplies a Turing reduction by computing and making one membership query, so implies .
The Friedberg–Muchnik theorem states that there are computably enumerable sets with and . We prove this by a finite-injury priority construction. Fix an effective enumeration of the oracle Turing functionals and arrange the requirements in the order
A requirement owns a private witness, a success flag and a priority restraint on its oracle set. All witnesses ever chosen are distinct. An witness is reserved outside , and only may enumerate that number into ; an witness is treated symmetrically. A priority restraint forbids lower-priority requirements from adding numbers less than to the specified oracle set. Initializing a requirement abandons its witness, clears its success flag and sets its priority restraint to zero; enumeration into or is never undone.
At stage consider the first requirements and serve the highest-priority one requiring attention. An unsuccessful requirement requires attention if it has no witness, or its current witness has a stage- oracle computation with output zero, found within steps. If there is no such requirement, do nothing. When a requirement with no witness is served, choose a fresh number larger than , all previously chosen witnesses and all current higher-priority priority restraints. When an with a witness and observed computation is served, enumerate into , mark it successful, and restrain below the use of that computation. The use is one more than the largest queried oracle position, or zero if there were no queries. An acts in exactly the same way with interchanged. After either kind of service, initialize every currently assigned lower-priority requirement; the remaining lower priorities are already in their initial state.
This is an effective stage construction with finite sets , and , are computably enumerable. Every enumeration respects all higher-priority priority restraints: its private witness was selected above them, and any later service to a higher-priority requirement would have initialized it before it could act. We do not need to restrain a computation whose output is nonzero; a persistent nonzero output already disagrees with an unenumerated witness.
We verify the finite injury assertion by induction along the priority order. After the last service to requirements above a fixed requirement , the requirement is never initialized again. It can be served at most twice thereafter, once to choose its final witness and once to diagonalize. Whenever it needs attention it is eventually served, since the higher-priority requirements have ceased acting and each later stage considers a longer initial segment. Thus has a final witness and makes only finitely many actions; this proves the induction and justifies the assumed last service above it.
For a final witness , if the diagonalization occurs then , while preservation of a restrained oracle computation applies: its zero computation is preserved permanently because higher priorities no longer act and lower priorities respect the priority restraint. Thus . If it never occurs, then . Were , that convergent computation would use finitely many oracle answers. Because increases to , those finitely many answers eventually stabilize, and a sufficiently late stage would discover the zero computation and cause diagonalization. This contradicts its never occurring. So in this case is undefined or nonzero and again disagrees with . The identical argument verifies every .
All the requirements hold, proving the theorem. Both sets are noncomputable: a computable set is Turing reducible to every oracle. Moreover, every computably enumerable set is Turing reducible to the diagonal halting set , and neither nor can have its Turing degree, since that would make it compute the other set. Hence
This also gives many-one incomparability and answers the existence of intermediate computably enumerable Turing degrees.
We use untyped lambda calculus and normal-order beta reduction. The Church numeral for is . A lambda term represents a partial function if on numeral inputs it has the correct numeral normal form exactly when the function is defined. We use a lambda simulation of a Turing machine; this also ensures that undefined computations do not accidentally produce an output through an ignored argument.
First all total primitive recursive functions are lambda-definable. The initial functions of recursion theory are represented by
Composition is obtained by substitution of representing terms. For primitive recursion use Church pairs:
If represent the total functions in and , define
After iterations the pair has components . Thus the Church numeral executes exactly the required recursion steps. Since these functions are total on numeral inputs, substitution for composition causes no undefined-argument issue.
Now fix a deterministic Turing machine computing the given partial computable function. Encode a configuration by its finite control state and two natural numbers for the tape portions on the two sides of the head, allowing blank bits beyond the finite nonblank tape. For the two-stack encoding of a Turing tape with a binary alphabet, let have the immediately-left cell as its low bit and have the current cell as its low bit. Reading and removing a bit use remainder and quotient by two. If the machine writes , the updates are
The new state is obtained from a finite transition table. These operations, the initial configuration, the halting test, and output decoding are total primitive recursive functions on configuration codes. For instance parity alternates by primitive recursion, and the quotient by two satisfies , . A fixed finite alphabet can be handled by the same stack construction in a larger base. Choose a standard delimited input and output convention, for example unary words in a finite tape alphabet with a distinct blank symbol. Initialization is primitive recursive. On a halting configuration the output is a finite word; decoding can be implemented by a bounded scan of the encoded tape, with a default output for malformed words. This is total primitive recursive and introduces no additional unbounded search. Use nested Church pairs to carry the three fields, and the preceding primitive recursive representations to obtain lambda terms .
Represent Church Booleans by and . A Church numeral zero test is . Use a numerical test equal to zero on halting configurations and one otherwise; applying this zero test gives the required Boolean halting test. With the fixed-point combinator
put
Normal-order reduction evaluates the halting test on the current configuration. If it is true, it selects the output branch without evaluating the recursive branch. Otherwise it advances the configuration and repeats. Induction on the number of machine steps shows that a computation halting with output makes reduce to .
If the machine never halts, the normal-order beta reduction repeatedly takes the recursive branch. Each individual configuration transition and test terminates, but there is always another required transition; hence the reduction never reaches a normal form. The normal-order normalization theorem says that a lambda term with a beta-normal form is normalized by normal-order beta reduction. Therefore in the nonhalting case there is no numeral normal form at all. We have proved
Confluence of beta reduction ensures uniqueness of the resulting numeral. This handles genuinely partial computations. Simply composing terms for partial subcomputations would need extra care, because lambda reduction can discard an unevaluated argument.
We give a finite semigroup presentation using the convention that is blank, the tape is unbounded in both directions, and a transition writes and moves in direction . The Turing machine is deterministic, and the halting state has no outgoing transition. A finite configuration is encoded by
with the head scanning the first symbol of ; if is empty, it scans an implicit blank. Unrepresented cells beyond the boundary markers are blank. An additional generator records completed halting and erasure.
The generators of the semigroup are . Its relations have the following finite families. For every right-moving transition, include
For every left-moving transition and every tape symbol , include
If stationary moves are part of the chosen machine model, include for each such move. Include the boundary-padding relations, for every state ,
They supply a blank immediately to the left of the head when needed, or at the right boundary when the current scanned cell was implicit. Finally include
Writing for this displayed list, the answer is the explicit finite semigroup presentation
All relations are between nonempty words; no group inverses or empty-word generator are used. The transition families are finite because the transition table and alphabet are finite, and the padding and erasure families are visibly finite. The declared head convention determines which side of a tape symbol carries a state letter.
If the Turing machine halts on , follow its computation from . A transition at an already represented cell is one of the corresponding relations. At a boundary, first insert the required blank using a padding relation. Thus the computation gives a finite equality derivation to . Replace by , erase the symbols of using , and erase both boundary markers. This proves in the semigroup.
For the converse, equality in a presented semigroup means a finite sequence of contextual replacements using defining relations in either direction. In any derivation from to , consider the first occurrence of the special symbol . Before it occurs, the erasure relations cannot be used in either direction. Each word therefore still has exactly two markers , exactly one state letter, and the form . Both directions of a transition relation join configurations linked by one actual machine step; both directions of a boundary-padding relation merely change how much blank tape is represented.
The first occurrence of must come from in the forward direction. Hence the initial configuration is connected, by transitions in either direction and harmless padding, to a configuration in state . For a deterministic Turing machine, the property of eventually reaching is invariant along each transition edge: if is a step, then halts if and only if halts, since that step is the unique next step of and is not already in the halting state. The same property is unchanged by padding. A finite path of these edges to therefore shows that the initial configuration halts.
Consequently
The invariance argument is necessary because equality in a semigroup presentation allows reversed transitions as well as forward computation steps.
For (1)(a), a primitive recursive function is obtained by a finite construction from the zero function, successor function and projection functions, using function composition in recursion theory and primitive recursion. The recursion rule, with parameters , is
Here have already been constructed. All these functions are total on nonnegative integers: the initial functions are total, composition preserves totality, and ordinary mathematical induction proves totality of each recursion.
For (1)(b), use a shifted hyperoperation sequence, beginning with addition. Define
and, for each fixed , define
The first three members are therefore addition, multiplication and exponentiation:
The exponentiation convention includes , hence . The next member iterates exponentiation, with ; there is no need for an exceptional domain restriction at .
For (1)(c), is a primitive recursive function by its displayed recursion. If is a primitive recursive function, then
are primitive recursive functions, using constants, projection functions and function composition in recursion theory. Primitive recursion applied to gives . Mathematical induction on the fixed rank proves every member of the sequence is primitive recursive. This does not assert that the joint three-variable evaluator is a primitive recursive function.
For (2), as written, the answer is no: the empty set is semidecidable, whereas a total computable function from to always has a nonempty range. This is the only obstruction. To prove the stronger useful statement, suppose is a nonempty computably enumerable set and choose . Fix a Turing machine which halts exactly on the inputs in . Its bounded halting predicate
is primitive recursive: encode configurations arithmetically, iterate its total single-step operation times by primitive recursion, and check the halt state. A halted configuration is kept fixed. This is a bounded simulation, not unbounded waiting.
Fix a primitive recursive pairing function with primitive recursive inverse coordinate functions. For example, the Cantor pairing function has inverses obtained by bounded minimization. Define
The two coordinate functions, the bounded predicate, and the finite case distinction are primitive recursive functions, so is a primitive recursive function. Its values always lie in . Conversely, if , its computation halts within some finite , and . Thus
The range need not be a computable set; deciding whether a value occurs anywhere in this total enumeration is an unbounded search.