Proof using.
intros.
eapply before_middle_reduce.
- eauto using in_middle_insert.
- intro. find_inversion. intuition eauto using acknowledged_op_defn.
Qed.

(* Specifications: *)
Lemma in_before_preserved :
forall xs ys zs k',
NoDup (get_op_output_keys (xs ++ I k' :: ys ++ O k' :: zs)) ->
(forall k, In (O k) (xs ++ I k' :: ys ++ O k' :: zs) ->
before (I k) (O k) (xs ++ I k' :: ys ++ O k' :: zs)) ->
forall k, In (O k) (xs ++ ys ++ zs) ->
before (I k) (O k) (xs ++ ys ++ zs).