Proof using.
unfold output_correct.
intros.
break_exists.
intuition.
pose proof (deduplicate_log_app xs ys). break_exists.
repeat find_rewrite.
rewrite app_ass in *. simpl in *.
eexists. eexists. eexists. eexists. eexists.
intuition eauto.
Qed.

(* Specifications: *)
Lemma applyEntry_output_correct :
forall st e l st' o es,
applyEntry st e = (l, st') ->
In o l ->
stateMachine st = snd (execute_log (deduplicate_log es)) ->
(forall e', In e' es -> eClient e' = eClient e -> eId e' < eId e) ->
output_correct (eClient e) (eId e) o (es ++ [e]).
Lemma execute_log'_trace:
forall l d d' tr tr' tr'',
execute_log' l d tr = (tr', d') ->
execute_log' l d (tr'' ++ tr) = (tr'' ++ tr', d').