proposition: Lemma consec_lastE ks t1 t2 t3 : uniq ks -> consec ks t1 t2 -> t2 \notin ks <-> t1 = last t3 ks.
proof: Proof. move=>U C; rewrite (consec_last U C). split=>[[ks' ->]|E]; first by rewrite last_rcons. case: (lastP ks) E C=>[-> /andP [] //|s x]. by rewrite last_rcons => ->; exists s. Qed.
imports: Coq(ssreflect ssrbool ssrfun) mathcomp(ssrnat eqtype seq path interval order) pcm(options prelude ordtype seqext slice useqord uslice)