Proof using olpti rri.
red. unfold allEntries_leader_sublog. intros. simpl in *.
subst. repeat find_higher_order_rewrite.
find_copy_apply_lem_hyp handleClientRequest_type. intuition.
destruct_update; simpl in *; eauto;
do_in_map; subst;
destruct x; simpl in *.
- find_apply_lem_hyp update_elections_data_client_request_log_allEntries.
intuition; repeat find_rewrite; eauto.
break_exists. intuition. repeat find_rewrite. simpl in *.
intuition; repeat find_rewrite; eauto; solve_by_inversion.
- find_apply_lem_hyp update_elections_data_client_request_log_allEntries.
intuition; repeat find_rewrite; eauto.
break_exists. intuition. repeat find_rewrite. simpl in *.
intuition; repeat find_rewrite; eauto; solve_by_inversion.
- find_apply_lem_hyp update_elections_data_client_request_log_allEntries.
intuition; repeat find_rewrite; eauto.
break_exists. intuition. repeat find_rewrite. simpl in *.
intuition; repeat find_rewrite; eauto.
tuple_inversion.
repeat find_rewrite.
find_false.
eapply lifted_one_leader_per_term; eauto.
Qed.

(* Specifications: *)
Lemma update_elections_data_appendEntries_log_allEntries_leader
: forall (h : name) (st : electionsData * raft_data)
(t : term) (n : name) (pli : logIndex) (plt : term)
(es : list entry) (ci : logIndex) (st' : raft_data)
(ps : msg),
handleAppendEntries h (snd st) t n pli plt es ci = (st', ps) ->
type st' = Leader ->
(currentTerm st' = currentTerm (snd st) /\
type (snd st) = Leader /\
log st' = log (snd st) /\
allEntries
(update_elections_data_appendEntries h st t n pli plt es ci) =
allEntries (fst st)).