Proof using.
intros. induction tr; simpl in *; intuition.
- unfold in_input_trace in *. break_exists; simpl in *; intuition.
- unfold in_input_trace in *.
break_exists. simpl in *. intuition.
+ subst. unfold input_before_output. simpl.
left. do_bool; break_if; intuition; do_bool; auto.
+ unfold input_before_output. simpl. right. intuition.
* unfold key_in_output_trace in *.
apply Bool.not_true_iff_false. intuition.
find_false. unfold is_output_with_key in *.
break_match; subst. repeat break_match; try congruence.
exists l, n. intuition.
* conclude_using eauto.
conclude_using
ltac:(intros; find_false; unfold key_in_output_trace in *;
break_exists_exists; intuition).
eauto.
Qed.

(* Specifications: *)
Lemma input_before_output_not_key_in_output_trace_snoc_key :
forall client id tr h inp tr',
~ key_in_output_trace client id tr ->
input_before_output client id
(tr ++ (h, inl (ClientRequest client id inp)) :: tr').