proposition: Lemma nth_count_lt x x0 s i : sorted <=%O s -> (i < count (< x) s)%N -> nth x0 s i < x.
proof: Proof. move=> ss iltc; rewrite -(nth_take _ iltc) -sorted_filter_lt //. by apply/(all_nthP _ (filter_all (< x) _)); rewrite size_filter. Qed.
imports: HB(structures) mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat choice seq) mathcomp(path fintype tuple bigop finset div prime finfun) mathcomp(finset)