Proof using.
induction tr; simpl; auto.
destruct a, s; simpl; intro H_inp.
- assert (H_inp': input_correct (filterMap trace_non_empty_out tr)).
intros client id i0 i1 h h' H_in H_in'.
eapply H_inp; right; eauto.
concludes.
intros client id i0 i1 h h' H_in H_in'.
simpl in *.
break_or_hyp; break_or_hyp.
* find_injection; find_injection; auto.
* find_injection.
eapply H_inp; [ idtac | left; eauto ].
right.
eapply filterMap_In; eauto.
simpl; eauto.
* find_injection.
eapply H_inp; [ left; eauto | idtac ].
right.
eapply filterMap_In; eauto.
simpl; eauto.
* eapply IHtr; eauto.
- destruct l.
* intros client id i0 i1 h h' H_in H_in'.
simpl in *.
break_or_hyp; [ find_inversion | idtac ].
break_or_hyp; [ find_inversion | idtac ].
eapply IHtr; eauto.
* assert (H_inp': input_correct (filterMap trace_non_empty_out tr)).
intros client id i0 i1 h h' H_in H_in'.
eapply H_inp; right; eauto.
concludes.
intros client id i0 i1 h h' H_in H_in'.
simpl in *.
break_or_hyp; [ find_inversion | idtac ].
break_or_hyp; [ find_inversion | idtac ].
eapply IHtr; eauto.
Qed.

(* Specifications: *)
Lemma input_correct_filterMap_trace_non_empty_out :
forall tr tr',
input_correct tr ->
filterMap trace_non_empty_out tr = filterMap trace_non_empty_out tr' ->
input_correct tr'.