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

(* Specifications: *)
Lemma handleAppendEntriesReply_matchIndex_leader_preserved:
forall h st (d : raft_data)
(m : list (name * msg)) (t : nat) (es : list entry)
(res : bool) h',
handleAppendEntriesReply h st h' t es res = (d, m) ->
matchIndex_preserved_except_at_host h' st d.