I'm reading Nielsen and Chuang. On page 142 the integer factoring decision problem is introduced: The integer factorization problem can be reduced to a decision problem:
Given a composite integer m and l < m, does m have a non-trivial factor less than l?
For a given witness x < l this problem can be checked in polynomial time. Now I'm asking myself why it should not be possible to use the algorithm for checking to construct a polynomial time algorithm to decide the decision problem. I'm thinking of something like this:
for x < l
if check(x,l,m)
return true
else
return false
This is basically just trying out all potential numbers of which there are at maximum m. So the time needed for this should be still linear because m times polynomial time (for the checking algorithm) should still be just polynomial I think.
I know something about this reasoning must be wrong but I'm completely stuck there.