Section POrderTheory.
Context {disp : unit} {T : porderType disp}.
Implicit Types (x y : T) (s : seq T).
Definition lt_gtF x y hxy := le_gtF (@ltW x y hxy).

Lemma filter_le_nth x0 s i : sorted <%O s -> (i < size s)%N ->
[seq x <- s | x <= nth x0 s i] = take i.+1 s.