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 auto with datatypes.
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.

Lemma filter_rel_self_eq {irreflexive_R : Irreflexive R} :
forall ns0 ns1 h,
filter_rel R_dec h (ns0 ++ h :: ns1) = filter_rel R_dec h (ns0 ++ ns1).