Definition good_op_move (x y : op) : Prop :=
    (forall k k', ~ (x = O k /\ y = I k')) /\
    (forall k, ~ (x = I k /\ y = O k)).

Lemma in_before_before_preserved : forall xs ys zs k ir, NoDup (get_op_input_keys (xs ++ I k :: ys ++ O k :: zs)) -> NoDup (get_op_output_keys (xs ++ I k :: ys ++ O k :: zs)) -> (forall k1 k2, In (I k2) (xs ++ I k :: ys ++ O k :: zs) -> before (O k1) (I k2) (xs ++ I k :: ys ++ O k :: zs) -> before (IRO k1) (IRI k2) (IRI k :: IRO k :: ir)) -> forall k1 k2, In (I k2) (xs ++ ys ++ zs) -> before (O k1) (I k2) (xs ++ ys ++ zs) -> before (IRO k1) (IRI k2) ir.