Consider a turing machine \(M\) that compute the following algorithm:
The following construction is in fact possible, from Kleene's recursion theorem, Turing machines can compute functions based on their description.
Also it is important to note that the description of \(M\) really describes a family of Turing machines, but what I'm going to state holds for any of them.
We can build another Turing machine \(N\) computing the following algorithm:
The same things stated for \(M\) also are true for \(N\).
In ZFC we can construct a proof for the statement: \(halt(N) \rightarrow halt(M)\)
Proof:
From the fact that \(N\) halts we can deduce the fact that it found a proof for the statement \(halt(N) \rightarrow halt(M)\).
Given a proof for \(halt(N)\) halts we can deduce that \(halt(M)\) and indeed proving \(halt(N) \rightarrow halt(M)\). \(\blacksquare\)
Clearly \(N\) will find such proof and halt and by the same reasoning also \(M\) will halt.
Löb's theorem roughly states that if a statement \(P\) is provable then indeed it is also true, in modal logic we would write:
$$\square (\square P \rightarrow P) \rightarrow \square P$$Where we read \(\square \phi\) as \(\phi\) is provable.
By interpreting \(P\) as \(halt(M)\) we can read the construction of \(N\) as the definition of \(\psi\), in fact that step requires the "diagonal lemma" pretty much the same of Kleene's recursion lemma but for logic formulas.
Our proof of the termination of \(M\) is indeed the proof of Löb's theorem.