Proof using.
unfold doLeader.
intros.
destruct st. simpl in *.
repeat break_match; repeat find_inversion; simpl in *; eauto.
right. intuition.
- intros.
do_in_map. subst.
find_apply_lem_hyp filter_In. break_and.
break_if; try discriminate.
eexists. intuition eauto.
- intuition.
Qed.

(* Specifications: *)
Lemma haveQuorum_directly_committed :
forall net h e,
refined_raft_intermediate_reachable net ->
type (snd (nwState net h)) = Leader ->
In e (log (snd (nwState net h))) ->
haveQuorum (snd (nwState net h)) h (eIndex e) = true ->
eTerm e = currentTerm (snd (nwState net h)) ->
directly_committed net e.