Proof using.
unfold handleAppendEntries.
intros.
repeat break_match; repeat find_inversion; auto; try discriminate.
Qed.

(* Specifications: *)
Lemma handleAppendEntries_leader_was_leader :
forall h st t n pli plt es ci st' m,
handleAppendEntries h st t n pli plt es ci = (st', m) ->
type st' = Leader ->
type st = Leader.
Lemma lifted_no_AE_to_leader :
forall net p t n pli plt es ci,
refined_raft_intermediate_reachable net ->
In p (nwPackets net) ->
pBody p = AppendEntries t n pli plt es ci ->
type (snd (nwState net (pDst p))) = Leader ->
currentTerm (snd (nwState net (pDst p))) = t ->
False.