Proof using.
intros.
unfold update_elections_data_appendEntries in *.
repeat break_match; subst; simpl in *; auto.
find_apply_lem_hyp handleAppendEntriesReply_entries. intuition.
find_inversion.
do_in_app. intuition.
do_in_map. find_inversion. find_copy_apply_hyp_hyp. intuition.
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).