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

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.