Section LeaderLogsTermSanity.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Context {rri : raft_refinement_interface}.
Context {ctgli : candidate_term_gt_log_interface}.
Proof using ctgli rri.
intros. eapply lift_prop; eauto using candidate_term_gt_log_invariant.
Qed.
Ltac term_sanity_start :=
red; unfold leaderLogs_term_sanity; simpl; intros.
Ltac term_sanity_start_update :=
term_sanity_start;
repeat find_higher_order_rewrite; update_destruct; rewrite_update; [|eauto].
Proof using.
unfold leaderLogs_term_sanity. intros. find_higher_order_rewrite.
update_destruct; subst; rewrite_update; simpl in *; [find_rewrite|]; eauto.
Qed.
Ltac term_sanity_unchanged' lem :=
red; intros; eapply leaderLogs_term_sanity_unchanged; subst;
pose lem; eauto.
Tactic Notation "term_sanity_unchanged" constr(lem) := term_sanity_unchanged' lem.
Tactic Notation "term_sanity_unchanged" := term_sanity_unchanged' eq_refl (* bogus *).

Lemma leaderLogs_term_sanity_request_vote_reply :
refined_raft_net_invariant_request_vote_reply leaderLogs_term_sanity.