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_appendEntries_allEntries_term :
forall h st t h' pli plt es ci te e,
In (te, e) (allEntries (update_elections_data_appendEntries h st t h' pli plt es ci)) ->
In (te, e) (allEntries (fst st)) \/ (In e es /\ te = t).