Section Update2.
Variables A B : Type.
Hypothesis A_eq_dec : forall x y : A, {x = y} + {x <> y}.
Proof using.
unfold update2.
intros.
break_if; intuition congruence.
Qed.
Proof using.
unfold update2.
intros.
break_if; intuition congruence.
Qed.
Proof using.
unfold update2.
intros.
break_if; intuition congruence.
Qed.
Proof using.
unfold update2.
intros. break_if; intuition congruence.
Qed.
Proof using.
intros. subst.
unfold update2.
break_if; intuition congruence.
Qed.
Proof using.
intros. subst.
unfold update2.
break_if; intuition congruence.
Qed.
Proof using.
intros.
rewrite update2_eq; auto.
Qed.
Proof using.
intros.
do 2 (apply functional_extensionality; intros).
apply update2_nop.
Qed.
Proof using.
intros.
subst.
apply update2_nop_ext.
Qed.

Lemma update2_overwrite :
forall (sigma : A -> A -> B) x y st st',
update2 A_eq_dec (update2 A_eq_dec sigma x y st) x y st' = update2 A_eq_dec sigma x y st'.