Proof using.
induction tr; intros.
- constructor.
- simpl. repeat break_match; subst.
+ auto.
+ rewrite get_op_output_keys_defn.
eapply subseq_NoDup; eauto.
apply subseq_get_op_output_keys.
apply subseq_remove.
+ rewrite get_op_output_keys_app.
apply NoDup_disjoint_append.
* apply get_op_output_keys_preserves_NoDup.
apply NoDup_dedup.
* eapply subseq_NoDup; eauto.
eapply subseq_get_op_output_keys.
apply subseq_remove_all.
apply subseq_refl.
* intros. intro.
repeat find_apply_lem_hyp get_op_output_keys_sound.
eapply in_remove_all_not_in; eauto.
Qed.

(* Specifications: *)
Lemma before_import_output_before_input :
forall k k' tr,
before (O k) (I k') (import tr) ->
output_before_input (fst k) (snd k) (fst k') (snd k') tr.