Proof using.
intros a n h ns f H_adj H_in.
simpl.
break_if; intuition.
clear r.
revert f n h H_in H_adj.
induction ns; intros; simpl.
- unfold update2.
break_if; auto.
intuition.
- assert (H_in': ~ In n ns).
intro.
contradict H_in.
right.
trivial.
assert (H_neq: n <> a0).
intro.
subst.
contradict H_in.
left.
trivial.
simpl in *.
break_if.
* simpl.
unfold update2 at 3.
break_if; intuition eauto.
pose proof (IHns f) as IH'.
rewrite collate_map2snd_not_in; auto.
unfold update2.
break_if; intuition eauto.
break_if; auto.
intuition.
* rewrite IHns; auto.
Qed.

Lemma in_collate_in :
forall ns n h (f : A -> A -> list B) a,
~ In n ns ->
In a (collate A_eq_dec h f (map2snd a (filter_rel R_dec h ns)) h n) ->
In a (f h n).