A loop invariant is a statement about the variables that is true before the first turn of a loop and that each turn keeps true: if it holds at the start of a turn, it holds at the end.
Computer Science · Glossary
What is Loop invariant?
A loop invariant is a condition on the variables of a loop that holds before the first test of the loop condition and is preserved by each iteration: if it holds and the loop condition is true before an iteration, it holds after it. It therefore holds at every test, and in particular when the loop exits.