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

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')).