Proof using.
intros.
unfold update_elections_data_appendEntries in *.
repeat break_match; subst; simpl in *; auto.
find_apply_lem_hyp handleAppendEntriesReply_entries. subst.
do_in_map. do_in_app. subst. intuition.
- do_in_map. subst. simpl in *. auto.
- left. apply in_map_iff. eexists; eauto.
Qed.

Lemma update_elections_data_clientRequest_allEntries_new :
forall h st client id c e,
In e (map snd (allEntries (update_elections_data_client_request h st client id c))) ->
In e (map snd (allEntries (fst st))) \/
(eIndex e = S (maxIndex (log (snd st)))
/\ eTerm e = currentTerm (snd st)
/\ type (snd st) = Leader).