Proof using.
intros m n h ns f ns' H_in H_adj.
revert f.
induction ns; intros; [ contradict H | idtac ].
invc_NoDup.
simpl in *.
break_or_hyp.
- pose proof (remove_all_cons A_eq_dec ns' n ns) as H_ra.
break_or_hyp; break_and; intuition.
find_rewrite.
simpl.
break_if; intuition.
simpl.
rewrite collate_map2snd_not_in_remove_all; auto.
unfold update2.
break_if; auto.
intuition.
- assert (H_neq: a <> n).
intro.
subst.
intuition.
pose proof (remove_all_cons A_eq_dec ns' a ns) as H_ra.
break_or_hyp; break_and.
* find_rewrite.
rewrite IHns; auto.
* find_rewrite.
simpl.
break_if; auto.
simpl.
rewrite IHns; auto.
unfold update2.
break_if; auto.
break_and.
subst.
intuition.
Qed.

(* Specifications: *)
Lemma collate_map2snd_in :
forall m n h ns (f : A -> A -> list B) ns',
In n ns' ->
collate A_eq_dec h f (map2snd m (filter_rel R_dec h (remove_all A_eq_dec ns' ns))) h n = f h n.