Proof using.
intros. unfold output_before_input in *.
induction tr; simpl in *; intuition.
- unfold key_in_output_trace.
unfold is_output_with_key in *. repeat break_match; try congruence.
subst. do 2 eexists. intuition; eauto.
- unfold key_in_output_trace in *.
break_exists_exists. simpl; intuition.
Qed.

Lemma in_applied_entries_entries_ordered :
forall net,
in_applied_entries client id net ->
~ in_applied_entries client' id' net ->
entries_ordered client id client' id' net.