End ListMaps.
Section Logs.
(* A log is a map from Z, and a finite log has a latest element. *)
Context {B : Type}.
Definition log_latest s (v1 : Z) (v2 : B) := s v1 = Some v2 /\ forall v', v1 < v' -> s v' = None.

Lemma log_latest_upd : forall log v1 v2 v1' v2', log_latest log v1 v2 -> v1 < v1' ->
map_incl log (map_upd log v1' v2') /\ log_latest (map_upd log v1' v2') v1' v2'.