The language in question is $L = \{M : M \text{ is a Turing machine that halts in } 100n^2 + 200 \text{ time}\}$.
Attempt 1
Suppose $L$ is decidable. Let $M_1, M_2, \ldots$ be the Turing machines in $L$. Now construct a new Turing machine $M$ that works as follows:
- on input of length $n$ run $M_n$ and output the opposite answer
On the one hand, $M \in L$ since it halts in the appropriate time. On the other hand, $M \notin L$ because it is different from every machine in $L$. Therefore $L$ is undecidable.
Is this correct?
Something that bothers me: I think I am only using the fact that there are countably many Turing machines; I never used the fact that there is some TM that decides $L$.
Attempt 2
As suggested, here's a new Turing machine $M'$:
M'(M,x,1^n):
if M is not a valid Turing machine then halt
otherwise
run M(x) for 100n^2+200 steps
if it halts, then run forever
otherwise halt
Ask oracle: does $M'(M,x, 1^n)$ halt on all inputs within $100n^2+200$ steps?
If yes, then $M$ doesn't halt on input $x$.
If no, then some input causes it to loop forever, which means $M$ halted on $x$ in a certain amount of time.
This would allow us to decide the halting problem, which we know is undecidable.
Is this correct? If so, I still think of the details are a bit fuzzy... For example, it's a bit unclear to me as to what happens with the inputs $M$ and $x$ are very large...