Proof using.
unfold handleAppendEntries.
intros.
repeat break_match; repeat find_inversion; auto; try discriminate.
Qed.

Lemma handleAppendEntries_leader_was_leader :
forall h st t n pli plt es ci st' m,
handleAppendEntries h st t n pli plt es ci = (st', m) ->
type st' = Leader ->
type st = Leader.