Proof using lmi rri.
unfold refined_raft_net_invariant_request_vote_reply, leaderLogs_entries_match.
intuition.
- unfold leaderLogs_entries_match_host in *.
intros. simpl in *. subst.
repeat find_higher_order_rewrite.
rewrite update_fun_comm. simpl.
rewrite update_fun_comm. simpl.
rewrite update_nop_ext' by now rewrite handleRequestVoteReply_same_log.
find_rewrite_lem update_fun_comm. simpl in *.
update_destruct_simplify; rewrite_update; eauto.
find_eapply_lem_hyp leaderLogs_update_elections_data_RVR; eauto.
intuition eauto.
subst.
rewrite handleRequestVoteReply_same_log.
apply lifted_log_matching_host. auto.
- unfold leaderLogs_entries_match_nw in *.
intros. simpl in *. subst.
repeat find_higher_order_rewrite.
find_rewrite_lem update_fun_comm. simpl in *.
find_rewrite_lem update_fun_comm.
update_destruct_simplify; rewrite_update.
+ find_eapply_lem_hyp leaderLogs_update_elections_data_RVR; eauto.
break_or_hyp.
* repeat find_reverse_rewrite. eauto.
* break_and. subst.
rewrite handleRequestVoteReply_same_log.
find_rewrite_lem handleRequestVoteReply_same_log.
pose proof (lifted_log_matching_nw _ ltac:(eauto)).
repeat find_reverse_rewrite.
match goal with
| [ H : _, pkt : packet  |- _ ] =>
solve [eapply H with (p := pkt); eauto]
end.
+ repeat find_reverse_rewrite. eauto.
Qed.

Lemma doLeader_messages :
forall st h os st' ms,
doLeader st h = (os, st', ms) ->
ms = [] \/
ms = map (replicaMessage st' h)
(filter (fun h' : name => if name_eq_dec h h' then false else true)
nodes).