If you are designing describing and proving correct an algorithm using loop invariants, the following is the list the things must consider.
Specification: Define the problem (pre and post conditions): likely defined by the problem.
Define Loop Invariant: It needs to be a picture of what is true every time the algorithm is at the top of the loop.
Establishing the Loop Invariant:
<pre-cond> & codepre-loop => <Loop Invariant>
· state what you know about the input instance because of <pre-cond>
· state the effect of the code before the loop
· State how it then follows that <loop invariant> has been established.