Ltac start :=
    red; unfold append_entries_came_from_leaders; intros;
    subst; simpl in *; find_higher_order_rewrite;
    update_destruct_hyp; subst; rewrite_update; eauto; simpl in *.Ltac prove_in :=
    match goal with
      | [ _ : nwPackets ?net = _,
              _ : In (?p : packet) _ |- _] =>
        assert (In p (nwPackets net)) by (repeat find_rewrite; do_in_app; intuition)
      | [ _ : nwPackets ?net = _,
              _ : pBody ?p = _ |- _] =>
        assert (In p (nwPackets net)) by (repeat find_rewrite; intuition)
    end.Ltac contra :=  (exfalso; intuition; find_false;
                   repeat eexists; eauto).

(* Specifications: *)
Lemma append_entries_came_from_leaders_appendEntries : refined_raft_net_invariant_append_entries append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_appendEntriesReply : refined_raft_net_invariant_append_entries_reply append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_requestVote : refined_raft_net_invariant_request_vote append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_requestVoteReply : refined_raft_net_invariant_request_vote_reply append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_clientRequest : refined_raft_net_invariant_client_request append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_timeout : refined_raft_net_invariant_timeout append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_doLeader : refined_raft_net_invariant_do_leader append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_doGenericServer : refined_raft_net_invariant_do_generic_server append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_reboot : refined_raft_net_invariant_reboot append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_state_same_packet_subset : refined_raft_net_invariant_state_same_packet_subset append_entries_came_from_leaders.
Lemma append_entries_came_from_leaders_init : refined_raft_net_invariant_init append_entries_came_from_leaders.
Theorem append_entries_came_from_leaders_invariant : forall net, refined_raft_intermediate_reachable net -> append_entries_came_from_leaders net.