Proof using.
unfold refined_raft_net_invariant_do_leader, leaderLogs_sublog.
simpl. intuition.
repeat find_higher_order_rewrite.
find_copy_apply_lem_hyp doLeader_type.
intuition.
repeat match goal with
| [ H : _ |- _ ] =>
rewrite update_fun_comm with (f := fst) in H
| [ H : _ |- _ ] =>
rewrite update_fun_comm with (f := snd) in H
| [ H : _ |- _ ] =>
rewrite update_fun_comm with (f := leaderLogs) in H
end.
rewrite update_fun_comm with (f := snd).
simpl in *.
rewrite update_fun_comm.
rewrite update_nop_ext' by (find_apply_lem_hyp doLeader_same_log; repeat find_rewrite; auto).
find_rewrite_lem update_fun_comm.
match goal with
| H : _ |- _ => rewrite update_nop_ext' in H by (repeat find_rewrite; auto)
end.
match goal with
| H : context [ type ] |- _ =>
rewrite update_fun_comm in H;
rewrite update_nop_ext' in H by (repeat find_rewrite; auto)
end.
match goal with
| H : _ |- _ => rewrite update_nop_ext' in H by (repeat find_rewrite; auto)
end.
eauto.
Qed.

(* Specifications: *)
Theorem leaderLogs_sublog_do_generic_server :
refined_raft_net_invariant_do_generic_server leaderLogs_sublog.