Proof using.
intros. unfold doLeader in *.
repeat break_match; find_inversion; auto.
Qed.

Lemma handleAppendEntries_stateMachine:
forall h st (d : raft_data)
(m : msg) (t : term) (n : name) (pli : logIndex)
(plt : term) (es : list entry) (ci : logIndex),
handleAppendEntries h st t n pli plt es ci = (d, m) ->
stateMachine d = stateMachine st.