Definition update {A B : Type} (A_eq_dec : forall x y : A, {x = y} + {x <> y}) st h (v : B) := 
  fun nm => if A_eq_dec nm h then v else st nm.

Lemma update_overwrite : forall (sigma : A -> B) h st st', update A_eq_dec (update A_eq_dec sigma h st) h st' = update A_eq_dec sigma h st'.