Proof using.
elim => [|n ns IH] failed n'; first by rewrite remove_all_nil.
have H_cn := remove_all_cons name_eq_dec failed n ns.
break_or_hyp; break_and; find_rewrite.
move => H_in.
apply IH in H_in.
move: H_in => [H_in H_in'].
split => //.
by right.
move => H_in.
case: H_in => H_in.
rewrite -{1}H_in {2}H_in.
split => //.
by left.
apply IH in H_in.
move: H_in => [H_in H_in'].
split => //.
by right.
Qed.

Lemma in_in_adj_map_pair :
forall (m : msg) ns failed n h,
In n ns ->
~ In n (map tot_map_name failed) ->
adjacent_to h n ->
In (n, m)
(map2snd m
(filter_rel adjacent_to_dec h
(remove_all name_eq_dec (map tot_map_name failed) ns))).