proposition: Lemma last_drop (T : eqType) (x : T) n s : last x (drop n s) = if n < size s then last x s else x.
proof: Proof. case: ltnP => sn; last by rewrite drop_oversize. rewrite -[s in RHS](cat_take_drop n) last_cat. by rewrite (@set_last_default _ x) ?size_drop ?subn_gt0. Qed.
imports: mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat seq choice fintype tuple) mathcomp(bigop finset finfun perm fingraph path div) bigmin