Proof using.
intros.
generalize dependent f.
induction s as [|n s].
- auto.
- intros.
simpl in *.
destruct (A_eq_dec b to), (A_eq_dec n a); subst.
+ specialize (IHs (update2 A_eq_dec f a to (f a to ++ [m])));
break_or_hyp.
* find_rewrite.
rewrite update2_eq; eauto.
right; eexists; intuition.
find_apply_lem_hyp in_inv;
break_or_hyp;
[|exfalso]; eauto using in_nil.
* break_exists_name l; break_and.
repeat find_rewrite.
rewrite update2_same.
right; exists (m :: l).
split.
-- intros;
find_apply_lem_hyp in_inv;
intuition.
-- rewrite <- app_assoc; auto.
+ rewrite collate_ls_neq_update2; auto.
+ rewrite collate_ls_neq_to, update2_diff2; auto.
+ rewrite collate_ls_neq_to, update2_diff2; auto.
Qed.

(* Specifications: *)
Lemma collate_ls_in_neq_in_before :
forall s (f : A -> A -> list B) to m a b x,
In x (collate_ls A_eq_dec s f to m a b) ->
x <> m ->
In x (f a b).