the invariant's termination step
The first two parts of a loop proof (initialization and maintenance) only tell you that the invariant is true on every pass. By themselves they do not tell you the program is correct — they just keep a promise alive. The termination step is where you collect the payout: you take the invariant as it stands when the loop exits, combine it with the reason the loop exited (the exit condition), and read off the conclusion you actually wanted.
Concretely, a loop exits because its continuation test failed; at that moment you know both the invariant (true throughout) and the negation of the loop condition. Conjoining them usually nails the result. For insertion sort with invariant 'A[1..i-1] is sorted', the loop runs while i <= n, so it exits when i = n+1; substituting, 'A[1..n] is sorted', which is the whole array — done. For binary search, the invariant 'if x is in the array it lies within [lo, hi]' plus the exit condition 'lo > hi' (empty window) forces 'x is not in the array', so returning not-found is correct.
Two warnings live here. First, this step is purely about correctness of the result assuming the loop stops; whether the loop stops at all is a separate question answered by a termination measure. So the 'termination step' of an invariant proof establishes partial correctness; total correctness also needs a decreasing well-founded measure. Second, you must be honest about the exact exit value (i = n+1, not n); getting that boundary wrong is the classic off-by-one that an honest termination step catches.
Linear search invariant 'x not in A[1..i-1]'. If the loop runs to the end without finding x, it exits at i = n+1, giving 'x not in A[1..n]' — so reporting 'not found' is justified. The exit value n+1, read carefully, is what makes the conclusion exact.
Invariant at exit + negated loop condition = the result you set out to prove.
This step proves the result is right IF the loop ends; it does not prove the loop ends. That part is partial correctness; total correctness needs a separate termination argument.