in reply to Searching for the remaining smaller values in an array

Maybe you want to rephrase the problem? From your examples, I think an equivalent rule for selecting elements would be all elements that are smaller than the smaller element of the pair, and all elements that are between the small and the large element of the pair. Implementing these two rules as routines using grep should be easy. It should also be easy to see that the two calls to grep do return disjunct lists.