loop invariant for selection sort - Search