In the diagonalization proof, why does the machine D — defined to do the opposite of what H predicts for D on itself — create a contradiction?
Think about your answer, then reveal below.
Model answer: D is constructed so that if H predicts D halts on input D, then D actually loops; and if H predicts D loops, D halts. In either case H's prediction is wrong. Since D is a legitimate program and D itself is a valid input, this means H fails on the specific pair (D, D), contradicting the assumption that H correctly decides halting for all inputs.
This is the diagonalization trick borrowed from Cantor: construct an object that necessarily disagrees with any proposed complete description. D's self-referential behavior is not a curiosity — it is a precise, constructive proof that H cannot exist. Any proposed halting oracle can be defeated by the D built from it.