Section Update2Rel.
Variables A B : Type.
Variable R : relation A.
Hypothesis A_eq_dec : forall x y : A, {x = y} + {x <> y}.
Hypothesis R_dec : forall x y : A, {R x y} + {~ R x y}.
Proof using.
intros.
induction ns; simpl in *; [ intuition | idtac ].
break_if; simpl in *.
- break_or_hyp; auto.
concludes.
break_and.
auto.
- concludes.
break_and.
auto.
Qed.
Proof using.
intros.
induction ns; simpl in *; [ intuition | idtac ].
break_if.
- break_or_hyp.
* left; auto.
* concludes.
right; auto.
- break_or_hyp.
* intuition.
* concludes.
assumption.
Qed.
Proof using.
induction ns; intros; auto.
assert (H_neq: a <> n).
intro.
subst.
auto with datatypes.
assert (H_not_in: ~ In n ns).
intro.
intuition.
simpl.
break_if; auto.
simpl.
intro.
break_or_hyp; auto.
intuition eauto.
Qed.
Proof using.
intros.
induction ns; auto.
invc_NoDup.
concludes.
simpl in *.
break_if; auto.
apply NoDup_cons; auto.
apply not_in_not_in_filter_rel.
assumption.
Qed.
Proof using.
induction ns0; intros; simpl in *.
- break_if; auto.
find_apply_lem_hyp irreflexive_R.
intuition.
- break_if; auto.
find_higher_order_rewrite.
trivial.
Qed.

Lemma collate_f_eq :
forall (f : A -> A -> list B) g h n n' l,
f n n' = g n n' ->
collate A_eq_dec h f l n n' = collate A_eq_dec h g l n n'.