Proof using.
unfold votesWithLog_term_sanity. intros.
find_higher_order_rewrite. update_destruct; subst; rewrite_update; [|eauto].
simpl in *. find_apply_hyp_hyp. break_or_hyp.
- find_apply_hyp_hyp. omega.
- break_and. subst. auto.
Qed.
Ltac start_cases :=
red; intros; eapply votesWithLog_term_sanity_cases; eauto.
Ltac solve_votesWithLog lem :=
intros; subst; first [
left; solve [eapply lem; eauto] |  (* votesWithLog doesn't change *)
solve [eapply lem; eauto]  (* has both cases *)
].
Ltac solve_currentTerm lem :=
find_apply_lem_hyp lem; solve [intuition].

Lemma votesWithLog_term_sanity_invariant :
forall net,
refined_raft_intermediate_reachable net ->
votesWithLog_term_sanity net.