Ltac intermediate_networks :=
    match goal with
      | Hdgs : doGenericServer ?h ?st' = _,
               Hdl : doLeader ?st ?h = _ |- context [update _ (nwState ?net) ?h ?st''] =>
        replace st with (update name_eq_dec (nwState net) h st h) in Hdl by eauto using update_eq;
          replace st' with (update name_eq_dec (update name_eq_dec (nwState net) h st) h st' h) in Hdgs by eauto using update_eq;
          let H := fresh "H" in
          assert (update name_eq_dec (nwState net) h st'' =
                  update name_eq_dec (update name_eq_dec (update name_eq_dec (nwState net) h st) h st') h st'') by (repeat rewrite update_overwrite; auto); unfold data in *; simpl in *; rewrite H; clear H
    end.

Lemma in_output_trace_step_output_correct : forall failed failed' (net net' : network (params := @multi_params _ _ raft_params)) os, in_output_trace client id out os -> @raft_intermediate_reachable _ _ raft_params net -> step_failure (failed, net) (failed', net') os -> output_correct client id out (applied_entries (nwState net')).