Proof using.
unfold refined_raft_net_invariant_timeout, match_index_all_entries_inv.
simpl. intros. break_and. split.
- unfold match_index_all_entries in *. simpl. intros.
repeat find_higher_order_rewrite.
apply allEntries_update_timeout.
update_destruct_simplify_hyp.
+ find_erewrite_lem handleTimeout_log_same.
find_copy_apply_lem_hyp handleTimeout_type. intuition; try congruence.
find_erewrite_lem handleTimeout_matchIndex.
repeat find_rewrite.
eapply_prop_hyp In In; eauto. congruence.
+ eapply_prop_hyp In In; eauto. congruence.
- unfold match_index_all_entries_nw in *.
simpl. intros.
find_apply_hyp_hyp. break_or_hyp.
+ repeat find_higher_order_rewrite.
apply allEntries_update_timeout.
update_destruct_simplify_hyp.
* find_erewrite_lem handleTimeout_log_same.
find_copy_apply_lem_hyp handleTimeout_type.
intuition; try congruence.
eapply_prop_hyp In In; eauto; try congruence.
* eapply_prop_hyp In In; eauto; congruence.
+ do_in_map. find_eapply_lem_hyp handleTimeout_sends_RV; eauto.
break_exists. subst. simpl in *. discriminate.
Qed.

Lemma handleAppendEntries_post_leader_nop :
forall h st t n pli plt es ci st' m,
currentTerm st <> t ->
handleAppendEntries h st t n pli plt es ci = (st', m) ->
type st' = Leader ->
st' = st.