Proof using.
intros. unfold applied_entries in *.
repeat break_match; repeat find_rewrite; intuition;
match goal with
| _ : argmax ?f ?l = _, _ : argmax ?g ?l = _ |- _ =>
assert (argmax f l = argmax g l) by
(apply argmax_fun_ext; intros; update_destruct; subst; rewrite_update; auto)
end; repeat find_rewrite; try congruence.
match goal with | H : Some _ = Some _ |- _ => inversion H end.
subst. clean.
f_equal. update_destruct; subst; rewrite_update; repeat find_rewrite; auto.
Qed.

(* Specifications: *)
Lemma applied_entries_log_lastApplied_same :
forall sigma sigma',
(forall h, log (sigma' h) = log (sigma h)) ->
(forall h, lastApplied (sigma' h) = lastApplied (sigma h)) ->
applied_entries sigma' = applied_entries sigma.