Proof using.
intros.
unfold doLeader, advanceCommitIndex in *.
repeat break_match; find_inversion; intuition.
Qed.

(* Specifications: *)
Lemma do_leader_rvr :
forall st h os st' ms p t ps ps',
doLeader st h = (os, st', ms) ->
(forall p : packet,
In p ps' -> In p ps \/ In p (send_packets h ms)) ->
pBody p = RequestVoteReply t true ->
In p ps' ->
In p ps.
Lemma doLeader_preserves_candidateEntries :
forall net gd d h os d' ms e,
nwState net h = (gd, d) ->
doLeader d h = (os, d', ms) ->
candidateEntries e (nwState net) ->
candidateEntries e (update name_eq_dec (nwState net) h (gd, d')).