Proof using.
intros.
unfold handleAppendEntries, advanceCurrentTerm in *.
repeat break_match; try find_inversion; subst; simpl in *; intuition;
do_bool; intuition; try solve [break_exists; congruence];
in_crush; eauto using removeAfterIndex_in.
Qed.

(* Specifications: *)
Lemma handleAppendEntries_term_same_or_type_follower :
forall h t n pli plt es ci d m st,
handleAppendEntries h st t n pli plt es ci = (d, m) ->
(currentTerm d = currentTerm st /\ type d = type st) \/ type d = Follower.
Lemma no_entries_past_current_term_append_entries :
raft_net_invariant_append_entries no_entries_past_current_term.