Proof using.
unfold handleAppendEntries in *.
intros.
repeat break_match; repeat find_inversion; simpl in *; auto; try congruence.
Qed.

Lemma handleAppendEntries_preserves_candidate_entries :
forall net h t n pli plt es ci d m e,
handleAppendEntries h (snd (nwState net h)) t n pli plt es ci = (d, m) ->
refined_raft_intermediate_reachable net ->
candidateEntries e (nwState net) ->
candidateEntries e (update name_eq_dec (nwState net) h
(update_elections_data_appendEntries
h
(nwState net h) t n pli plt es ci, d)).