Proof using.
unfold raft_net_invariant_do_leader, no_entries_past_current_term.
intuition.
- unfold no_entries_past_current_term_host in *.
intros. simpl in *.
find_apply_lem_hyp doLeader_spec.
find_higher_order_rewrite.
break_if;
subst; intuition;
repeat find_rewrite;
eauto.
- unfold no_entries_past_current_term_nw in *. intros; simpl in *.
find_apply_hyp_hyp. intuition eauto.
unfold doLeader in *.
repeat break_match; repeat find_inversion; try solve_by_inversion.
repeat do_in_map; subst; simpl in *; find_inversion.
find_apply_lem_hyp findGtIndex_in. eauto.
Qed.

Lemma doGenericServer_spec :
forall h d os d' ms,
doGenericServer h d = (os, d', ms) ->
(log d' = log d /\ currentTerm d' = currentTerm d /\
(forall m, In m ms -> ~ is_append_entries (snd m))).