Proof using.
unfold refined_raft_net_invariant_append_entries, appendEntries_leader.
simpl.
intros.
find_apply_hyp_hyp.
intuition.
- repeat find_higher_order_rewrite.
update_destruct_simplify.
+ eapply appendEntries_leader_predicate_TTLM_preserved; eauto using handleAppendEntries_TTLM.
eauto.
+ eauto.
- find_apply_lem_hyp handleAppendEntries_not_append_entries.
subst. exfalso. eauto 10.
Qed.

Lemma handleAppendEntriesReply_TTLM :
forall h st h' t es r st' ms,
handleAppendEntriesReply h st h' t es r = (st', ms) ->
type_term_log_monotonic st st'.