Section TermsAndIndicesFromOne.
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 {taifoli : terms_and_indices_from_one_log_interface}.
Proof using.
unfold refined_raft_net_invariant_init, terms_and_indices_from_one_vwl.
simpl. contradiction.
Qed.
Proof using taifoli rri.
intros.
pose proof (lift_prop _ terms_and_indices_from_one_log_invariant).
unfold terms_and_indices_from_one_log in *.
rewrite <- deghost_spec with (net := net0). auto.
Qed.
Proof using.
unfold refined_raft_net_invariant_client_request, terms_and_indices_from_one_vwl.
simpl. intuition. repeat find_higher_order_rewrite. update_destruct; subst; rewrite_update;
eauto using votesWithLog_update_elections_data_client_request.
Qed.
Proof using taifoli rri.
unfold refined_raft_net_invariant_timeout, terms_and_indices_from_one_vwl.
simpl. intuition. repeat find_higher_order_rewrite. update_destruct; subst; rewrite_update; eauto.
simpl in *. find_eapply_lem_hyp votesWithLog_update_elections_data_timeout; eauto.
intuition; eauto. subst. find_apply_lem_hyp handleTimeout_log_same. find_rewrite.
apply lifted_terms_and_indices_from_one_log; auto.
Qed.
Proof using.
unfold refined_raft_net_invariant_append_entries, terms_and_indices_from_one_vwl.
simpl. intuition. repeat find_higher_order_rewrite. update_destruct; subst; rewrite_update;
eauto using votesWithLog_update_elections_data_append_entries.
Qed.
Proof using.
unfold refined_raft_net_invariant_append_entries_reply, terms_and_indices_from_one_vwl.
simpl. intuition. repeat find_higher_order_rewrite. update_destruct; subst; rewrite_update; eauto.
Qed.
Proof using taifoli rri.
unfold refined_raft_net_invariant_request_vote, terms_and_indices_from_one_vwl.
simpl. intuition. repeat find_higher_order_rewrite. update_destruct; subst; rewrite_update; eauto.
simpl in *. find_eapply_lem_hyp votesWithLog_update_elections_data_request_vote; eauto.
intuition; eauto. subst. find_apply_lem_hyp handleRequestVote_log. find_rewrite.
apply lifted_terms_and_indices_from_one_log; auto.
Qed.
Proof using.
unfold refined_raft_net_invariant_request_vote_reply, terms_and_indices_from_one_vwl.
simpl. intuition. repeat find_higher_order_rewrite. update_destruct; rewrite_update;
eauto using votesWithLog_update_elections_data_request_vote_reply.
Qed.
Proof using.
unfold refined_raft_net_invariant_do_leader, terms_and_indices_from_one_vwl.
simpl. intuition. repeat find_higher_order_rewrite. update_destruct; subst; rewrite_update; eauto.
eapply H0. find_higher_order_rewrite. eauto.
Qed.

Lemma terms_and_indices_from_one_vwl_do_generic_server :
refined_raft_net_invariant_do_generic_server terms_and_indices_from_one_vwl.