Hint Extern 4 (@BaseParams) => apply base_params : typeclass_instances.
Hint Extern 4 (@MultiParams _) => apply multi_params : typeclass_instances.
Hint Extern 4 (@FailureParams _ _) => apply failure_params : typeclass_instances.
Section LeaderSublogProof.
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 {cei : candidate_entries_interface}.
Context {vci : votes_correct_interface}.
Context {cci : cronies_correct_interface}.
Context {olpti : one_leader_per_term_interface}.
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.
Notation is_append_entries m :=
(exists t n prevT prevI entries c,
m = AppendEntries t n prevT prevI entries c).

(* Specifications: *)
Lemma leader_sublog_invariant_same_state :
forall net net',
leader_sublog_host_invariant net ->
(forall h, log (nwState net h) = log (nwState net' h)) ->
(forall h, type (nwState net' h) = Leader ->
type (nwState net h) = Leader /\
currentTerm (nwState net h) = currentTerm (nwState net' h)) ->
leader_sublog_host_invariant net'.