Proof using rlmli lsi aelsi rri.
start_update.
- subst.
find_copy_apply_lem_hyp update_elections_data_client_request_log_allEntries.
intuition; simpl in *; repeat find_rewrite; eauto.
break_exists; intuition; repeat find_rewrite; simpl in *; intuition; subst; simpl in *; eauto.
+ contradict_maxIndex.
+ enough (In e' (log (snd (nwState net h0)))) by
contradict_maxIndex.
eapply allEntries_leader_sublog_invariant; repeat find_rewrite; eauto.
- find_apply_lem_hyp update_elections_data_client_request_log_allEntries.
intuition; simpl in *; repeat find_rewrite; eauto.
break_exists. intuition; repeat find_rewrite; simpl in *; intuition; eauto.
subst.
enough (In e (log (snd (nwState net h')))) by
contradict_maxIndex.
eapply lifted_leader_sublog_invariant; repeat find_rewrite; eauto.
- find_apply_lem_hyp update_elections_data_client_request_log_allEntries.
intuition; simpl in *; repeat find_rewrite; eauto.
break_exists. intuition; repeat find_rewrite; simpl in *; intuition; eauto.
subst.
enough (In e' (log (snd (nwState net h0)))) by
contradict_maxIndex.
eapply allEntries_leader_sublog_invariant; repeat find_rewrite; eauto.
- find_apply_hyp_hyp.
intuition;
[|exfalso; do_in_map; subst; simpl in *;
find_eapply_lem_hyp handleClientRequest_no_append_entries; eauto;
intuition; repeat find_rewrite; find_false; repeat eexists; eauto].
find_apply_lem_hyp update_elections_data_client_request_log_allEntries.
intuition; simpl in *; repeat find_rewrite; eauto.
break_exists. intuition; repeat find_rewrite; simpl in *; intuition; eauto.
subst.
enough (In e (log (snd (nwState net h0)))) by
contradict_maxIndex.
eapply lifted_leader_sublog_nw_invariant; repeat find_rewrite; eauto.
- find_apply_hyp_hyp.
intuition;
[|exfalso; do_in_map; subst; simpl in *;
find_eapply_lem_hyp handleClientRequest_no_append_entries; eauto;
intuition; repeat find_rewrite; find_false; repeat eexists; eauto].
eauto.
Qed.

(* Specifications: *)
Lemma allEntries_log_matching_unchanged :
forall net st' h gd d ps',
allEntries_log_matching net ->
(forall h' : Net.name, st' h' = update name_eq_dec (nwState net) h (gd, d) h') ->
log d = log (snd (nwState net h)) ->
allEntries gd = allEntries (fst (nwState net h)) ->
allEntries_log_matching {| nwPackets := ps'; nwState := st' |}.