Proof using misi.
intros. symmetry.
unfold handleInput in *. break_match; repeat break_let; repeat find_inversion.
- apply applied_entries_log_lastApplied_update_same;
eauto using handleTimeout_log, handleTimeout_lastApplied.
- apply applied_entries_safe_update; eauto using handleClientRequest_lastApplied.
destruct (log st') using (handleClientRequest_log_ind ltac:(eauto)); auto.
simpl in *. break_if; auto.
exfalso.
do_bool.
find_apply_lem_hyp max_index_sanity_invariant.
unfold maxIndex_sanity, maxIndex_lastApplied in *.
intuition.
match goal with
| H : forall _, _ |- _ => specialize (H h)
end. omega.
Qed.

(* Specifications: *)
Lemma doGenericServer_applied_entries :
forall ps h sigma os st' ms,
raft_intermediate_reachable (mkNetwork ps sigma) ->
doGenericServer h (sigma h) = (os, st', ms) ->
exists es, applied_entries (update name_eq_dec sigma h st') = (applied_entries sigma) ++ es.