Proof using.
intros m n h ns f ns'.
revert f.
induction ns; intros.
- rewrite remove_all_nil.
trivial.
- pose proof (remove_all_cons A_eq_dec ns' a ns) as H_ra.
break_or_hyp; break_and; find_rewrite.
* rewrite IHns; trivial.
* simpl.
break_if.
+ simpl.
rewrite IHns; simpl; auto.
unfold update2.
break_if; auto.
break_and; subst.
intuition.
+ rewrite IHns; trivial.
Qed.

(* Specifications: *)
Lemma collate_map2snd_related_not_in :
forall a n h ns (f : A -> A -> list B),
R h n ->
~ In n ns ->
collate A_eq_dec h f (map2snd a (filter_rel R_dec h (n :: ns))) h n = f h n ++ [a].