Proof using.
unfold doLeader in *.
intros; repeat break_match; find_inversion; simpl in *; intuition.
do_in_map. eauto.
Qed.

(* Specifications: *)
Lemma doLeader_getNextIndex :
forall h h' st os st' ms,
doLeader st h = (os, st', ms) ->
getNextIndex st' h' = getNextIndex st h'.