proposition: Lemma sink_large: forall L i, length L <= i -> sink (L,i) = L.
proof: Proof. intros. rewrite sink_equation. unfold sink1. case_eq (nth_error L i); auto. intros. assert (i < length L) by (apply nth_error_Some; congruence). lia. Qed.
imports: Psatz List Arith.Div2 Even Relations RelationClasses PeanoNat Peano_dec Recdef Sorting Permutation Multiset