Proof using.
intros h f l.
revert h f.
induction l.
- intros.
find_apply_lem_hyp Permutation_nil.
subst.
trivial.
- intros.
destruct a.
simpl in *.
invc_NoDup.
assert (H_in': In (a, b) ((a, b) :: l)).
left.
trivial.
pose proof (Permutation_in _ H0 H_in') as H_pm'.
apply in_split in H_pm'.
break_exists; subst.
find_apply_lem_hyp Permutation_cons_app_inv.
pose proof (IHl h (update2 A_eq_dec f h a (f h a ++ [b])) _ H4 H0) as IHl'.
rewrite IHl'.
rewrite collate_not_in_mid; auto.
intro.
assert (H_pm': Permutation (map (fun nm : A * B => fst nm) l) (map (fun nm : A * B => fst nm) (x ++ x0))).
apply Permutation_map_fst.
trivial.
contradict H3.
revert H.
apply Permutation_in.
apply Permutation_sym.
trivial.
Qed.

Lemma collate_map2snd_not_related :
forall m n h ns (f : A -> A -> list B),
~ R h n ->
collate A_eq_dec h f (map2snd m (filter_rel R_dec h ns)) h n = f h n.