Proof using name_map_bijective.
move => m m'.
elim => //=.
case => n m0 /= l IH n' H_eq H_in.
rewrite /pt_map_name_msg /=.
case H_m: (pt_map_msg m0) => [m1|].
move => H_in'.
case: H_in' => H_in'.
inversion H_in'.
rewrite H1 in H_m.
rewrite H_m in H_eq.
inversion H_eq.
left.
by rewrite tot_map_name_inverse_inv.
right.
apply: IH => //.
move => nm H_inn.
apply: H_in.
by right.
move => H_in'.
case: H_in' => H_in'.
inversion H_in'.
rewrite H1 in H_m.
by rewrite H_m in H_eq.
apply: IH => //.
move => nm H_inn.
apply: H_in.
by right.
Qed.
Context {overlay_map_congr : NameOverlayParamsTotalMapCongruency overlay_fst overlay_snd name_map}.

(* Specifications: *)
Lemma pt_nodup_perm_map_map_pair_perm :
forall m m' h failed ns ns',
NoDup ns ->
Permutation (map tot_map_name ns) ns' ->
pt_map_msg m = Some m' ->
Permutation
(filterMap pt_map_name_msg (map2snd m (filter_rel adjacent_to_dec h (remove_all name_eq_dec failed ns))))
(map2snd m' (filter_rel adjacent_to_dec (tot_map_name h) (remove_all name_eq_dec (map tot_map_name failed) ns'))).