In the above figure, each entry of the table represents the result of running the program Qk on input Qk for f(n) steps inside D. The problem A is then defined to be the set of all programs Qj that return FALSE on input Qj, as these are the only inputs on which D returns TRUE.
Just Defining DDD Is Enough#
As the input to D can be any string, it could be given any program whatsoever as an input. In particular, all programs in the chosen language that run in f(n) times can be given as inputs to D.
Keep in mind that we are not going to run D to do anything, our job is done by just writing D, as this gives us the definition of A.
To reiterate, by ensuring that D is different on at least one input from any program that runs and produces a valid result in f(n) time, we have established that A can’t be solved in f(n) time. This is precisely what we set out to do!
We can use this version of the time hierarchy theorem to show that there are problems that can’t be solved in even 2n,22n,222n, or 22⋅⋅⋅2n time, for example!
Concluding Thoughts#
A stronger version of the time hierarchy theorem can be proven if we measure the complexity of the program D more precisely. We can do so if we make certain assumptions, like the following:
-
f(n) is at least n. D needs at least this much time to determine n from the input w, as n=∣w∣.
-
Each step of the simulation takes some constant time. This is a reasonable assumption, as a simulation of one step of the program should not depend on input length.
-
Each increment to the counter in U (to check if we have not exceeded f(n) steps) does not take more than O(lgf(n)) time. This is also a fair assumption, as we do not require more than lgf(n) bits to write down f(n).
The time complexity of D then turns out to be O(f(n)lgf(n)) (simulation of f(n) steps each requiring O(lgf(n)) time). This is under the assumption that the compiler does not need more than this much time to verify if the input w is a valid program.
Once we have this, we can make stronger claims like the following:
There’s a problem that can be solved in O(f(n)lgf(n)) time that can’t be solved in f(n) time.
An obvious and immediate consequence is that
P=EXPTIME
where P is the collection of efficiently solvable problems discussed earlier, and EXPTIME is the collection of all problems that can be solved in exponential time.
This won’t earn us a million dollars, but it’s no less valuable since there’s a severe dearth of specific results like this in complexity theory. Understanding the nuances of time complexity and the time hierarchy theorem gives you a foundational basis for grappling with the complexities of the ‘P vs NP’ problem.