Proof using si aersi.
unfold raft_net_invariant_append_entries_reply, match_index_sanity.
simpl. intros.
repeat find_higher_order_rewrite.
update_destruct_simplify.
- erewrite handleAppendEntriesReply_log by eauto.
find_copy_apply_lem_hyp handleAppendEntriesReply_matchIndex; auto.
intuition.
+ repeat find_rewrite. auto.
+ repeat find_rewrite.
destruct (name_eq_dec h (pSrc p)).
* subst. rewrite get_set_same_default.
apply Max.max_case; auto.
{ destruct es; simpl.
* omega.
* pose proof append_entries_reply_sublog_invariant _ ltac:(eauto).
unfold append_entries_reply_sublog in *.
eapply_prop_hyp pBody pBody; simpl; eauto.
apply maxIndex_is_max; auto.
apply logs_sorted_invariant; auto.
}
* rewrite get_set_diff_default by auto.
auto.
- auto.
Qed.

(* Specifications: *)
Lemma match_index_sanity_request_vote :
raft_net_invariant_request_vote match_index_sanity.