Proof using.
unfold raft_net_invariant_timeout, prevLog_leader_sublog.
intros. simpl in *.
repeat find_higher_order_rewrite.
find_apply_hyp_hyp. break_or_hyp.
- break_if; eauto.
find_copy_apply_lem_hyp handleTimeout_type.
intuition; repeat find_rewrite; try discriminate.
eapply_prop_hyp In In; eauto.
break_exists_exists. intuition.
erewrite handleTimeout_log_same by eauto.
eauto.
- find_apply_lem_hyp in_map_iff. break_exists. break_and.
exfalso. subst. simpl in *.
eapply handleTimeout_packets; eauto.
find_rewrite. eauto 10.
Qed.

Lemma handleAppendEntries_type_log :
forall h st t n pli plt es ci st' ps,
handleAppendEntries h st t n pli plt es ci = (st', ps) ->
type st' = Follower \/ (type st' = type st /\ log st' = log st /\ currentTerm st' = currentTerm st).