proposition: Lemma ends_with_abP l a b: reflect (exists w, l = rcons (rcons w a) b) (ends_with_ab l a b).
proof: Proof. apply: (iffP idP). by move/eqP ->; set x:=(rev _); exists x. by move=> [w ->]; rewrite /ends_with_ab !rev_rcons /= revK. Qed.
imports: mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat) mathcomp(seq choice fintype order bigop ssralg) mathcomp(div ssrnum ssrint rat prime path binomial) mathcomp(tuple finset) gaia(fibm)