From mathcomp
(*************************************************************)
(************ Some useful facts about sequences **************)
(*************************************************************)
Fixpoint remove_elem (xs : seq (nat * nat * seq nat)) e :=
match xs with
| x :: xs => if x == e then xs else x :: (remove_elem xs e)
| [::] => [::]
end.

Lemma remove_elem_in xs e :
if e \in xs
then perm_eq (e :: (remove_elem xs e)) xs = true
else (remove_elem xs e) = xs.