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.

(* Specifications: *)
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).
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).