Proof using.
move => m.
elim => //=.
move => n ns IH n' h H_adj H_in.
case (adjacent_to_dec _ _) => H_dec; case: H_in => H_in.
- rewrite /=.
left.
by rewrite H_in.
- rewrite /=.
right.
exact: IH.
- by rewrite H_in in H_dec.
- exact: IH.
Qed.

Lemma not_in_failed_in_exclude :
forall ns n failed,
~ In (tot_map_name_inv n) failed ->
In (tot_map_name_inv n) ns ->
In (tot_map_name_inv n) (remove_all name_eq_dec failed ns).