The question is not about how bitcoin mining works, but rather how bitcoin system adapts to progress in ability to tackle proof-of-work problems.
Suppose that proof-of-work problems used for bitcoin mining become very easy to solve. (eg. P=NP with very fast practical polynomial-time solver, though of course unlikely, but let me play a hypothetical game.) Then it seems that bitcoin system would collapse - 32-bit nonce may be insufficient to counter how fast proof-of-work can be done, in case that this becomes reality.
Is there any part in the current bitcoin implementation that would protect the bitcoin ecosystem from this type of collapse? Is the "difficulty target" system enough to resolve the hypothetical issue?