Proof using.
intros.
rewrite get_op_input_keys_app in *.
rewrite get_op_input_keys_defn in *.
do_in_app.
intuition; eapply NoDup_remove_2; eauto using get_op_input_keys_complete, in_or_app.
Qed.

(* Specifications: *)
Lemma in_before_before_preserved_IU :
forall xs ys k ir,
NoDup (get_op_input_keys (xs ++ I k :: ys)) ->
(forall k1 k2,
In (I k2) (xs ++ I k :: ys) ->
before (O k1) (I k2) (xs ++ I k :: ys) ->
before (IRO k1) (IRI k2) (IRI k :: IRU k :: ir)) ->
forall k1 k2,
In (I k2) (xs ++ ys) ->
before (O k1) (I k2) (xs ++ ys) ->
before (IRO k1) (IRI k2) ir.