Proof using.
intros. unfold doLeader in *.
repeat break_match; find_inversion; subst; auto.
Qed.

(* Specifications: *)
Lemma doLeader_messages :
forall h st os st' ms m t n pli plt entries c,
doLeader st h = (os, st', ms) ->
sorted (log st) ->
In m ms ->
snd m = AppendEntries t n pli plt entries c ->
subseq entries (log st) /\
(forall e, In e entries -> eIndex e > pli) /\
(forall e, In e entries -> eTerm e >= plt).
Theorem no_entries_past_current_term_do_leader :
raft_net_invariant_do_leader (no_entries_past_current_term).