Proof using.
intros.
unfold handleAppendEntriesReply, advanceCurrentTerm in *.
repeat break_match; try find_inversion; subst; simpl in *; intuition;
do_bool; intuition.
Qed.

Lemma handleAppendEntriesReply_preserves_candidate_entries :
forall net h h' t es r st' ms e,
handleAppendEntriesReply h (snd (nwState net h)) h' t es r = (st', ms) ->
refined_raft_intermediate_reachable net ->
candidateEntries e (nwState net) ->
candidateEntries e (update name_eq_dec (nwState net) h (fst (nwState net h), st')).