Section RaftRefinementProof.
Context {orig_base_params : BaseParams}.
Context {one_node_params : OneNodeParams orig_base_params}.
Context {raft_params : RaftParams orig_base_params}.
Proof using.
intros.
unfold handleMessage, update_elections_data_net in *.
break_match; repeat break_let; repeat find_inversion;
[eapply_prop refined_raft_net_invariant_request_vote|
eapply_prop refined_raft_net_invariant_request_vote_reply|
eapply_prop refined_raft_net_invariant_append_entries|
eapply_prop refined_raft_net_invariant_append_entries_reply]; eauto;
unfold send_packets in *; simpl in *; intros; subst; auto; find_apply_hyp_hyp; intuition.
Qed.
Proof using.
intros.
unfold handleInput, update_elections_data_input in *.
break_match; repeat break_let; repeat find_inversion;
[eapply_prop refined_raft_net_invariant_timeout|
eapply_prop refined_raft_net_invariant_client_request]; eauto; subst; auto.
Qed.

Theorem refined_raft_net_invariant :
forall P net,
refined_raft_net_invariant_init P ->
refined_raft_net_invariant_client_request P ->
refined_raft_net_invariant_timeout P ->
refined_raft_net_invariant_append_entries P ->
refined_raft_net_invariant_append_entries_reply P ->
refined_raft_net_invariant_request_vote P ->
refined_raft_net_invariant_request_vote_reply P ->
refined_raft_net_invariant_do_leader P ->
refined_raft_net_invariant_do_generic_server P ->
refined_raft_net_invariant_state_same_packet_subset P ->
refined_raft_net_invariant_reboot P ->
refined_raft_intermediate_reachable net ->
P net.