Section AtVal.
Variable A : Type.
Implicit Type h : natmap (A * A).
Definition atval v t h := oapp snd v (find t h).
Definition last_val v h := atval v (last_key h) h.

Lemma lastvalUn v h1 h2 :
last_val v (h1 \+ h2) =
if valid (h1 \+ h2) then
if last_key h1 < last_key h2 then last_val v h2 else last_val v h1
else v.