Proof using.
intros. unfold handleTimeout, tryToBecomeLeader in *.
break_match; find_inversion; subst; simpl in *; eauto;
repeat (do_in_map; subst; simpl in *); intuition; break_exists; congruence.
Qed.

Lemma handleAppendEntries_type :
forall h st t n pli plt es ci st' ps,
handleAppendEntries h st t n pli plt es ci = (st', ps) ->
(type st' = type st /\ currentTerm st' = currentTerm st) \/
type st' = Follower.