(** Prefixes of traces. *)
Definition trace_prefix (t1 t2: trace) :=
exists t3, t2 = t1 ** t3.
Definition traceinf_prefix (t1: trace) (T2: traceinf) :=
exists T3, T2 = t1 *** T3.

Lemma traceinf_prefix_app:
forall t1 T2 t,
traceinf_prefix t1 T2 ->
traceinf_prefix (t ** t1) (t *** T2).