Proof using name_map_bijective.
move => f h l.
elim: l h f => //.
case => n m l IH h f.
rewrite /= IH /=.
rewrite 2!tot_map_name_inv_inverse /=.
set f1 := fun _ _ => _.
set f2 := update2 _ _ _ _ _.
have H_eq_f: f1 = f2.
rewrite /f1 /f2 {f1 f2}.
have H_eq := map_msg_update2 f (f h n ++ [m]) n h.
rewrite map_app in H_eq.
by rewrite H_eq.
by rewrite H_eq_f.
Qed.

Lemma collate_tot_map_update2_eq :
forall f from to ms l,
(fun src dst => map tot_map_msg
(collate name_eq_dec to (update2 name_eq_dec f from to ms) l
(tot_map_name_inv src) (tot_map_name_inv dst))) =
collate name_eq_dec (tot_map_name to)
(update2 name_eq_dec
(fun src dst : name =>
map tot_map_msg
(f (tot_map_name_inv src) (tot_map_name_inv dst))) (tot_map_name from)
(tot_map_name to) (map tot_map_msg ms)) (tot_map_name_msgs l).