Given an instance of the co-halting problem, construct an instance of the same output problem, where and are defined as follows:
procedure Π1: Input: input string I while (true) do {}procedure Π2: Input: input string I call Π(I) return I
Completeness
If does not halt on input , then both and do not terminate on input . Hence is a positive instance of the same output problem.
Soundness
If is a positive instance of the same output problem, then does not terminate on input . By construction, does not terminate only if does not halt on input . Hence is a positive instance of the co-halting problem.
Given an instance of the halting problem, construct an instance of the same output problem, where and are defined as follows:
procedure Π1: Input: input string I return Iprocedure Π2: Input: input string I call Π(I) return I
Completeness
If halts on input , then both and terminate on input and output . Hence is a positive instance of the same output problem.
Soundness
If is a positive instance of the same output problem, then terminates on input . By construction, can only terminate after has halted on input . Hence is a positive instance of the halting problem.