Proof using.
intros.
apply functional_extensionality.
intros. destruct (A_eq_dec h x).
- repeat rewrite update_eq; auto.
- repeat rewrite update_diff; auto.
Qed.
End update.

(* Specifications: *)
Lemma update_fun_comm :
forall A B C A_eq_dec (f : B -> C) (st : A -> B) y v x,
f (update A_eq_dec st y v x) = update A_eq_dec (fun x => f (st x)) y (f v) x.