Proof using.
case => //=.
case.
move => n ol tr n' lo H_eq.
case: tr H_eq => //=.
case: ol => //=.
move => out H_eq.
exists n; exists out.
split => //.
by inversion H_eq.
Qed.

(* Specifications: *)
Lemma tot_map_trace_occ_in_inv :
forall tr h inp out,
map tot_map_trace_occ tr = [(h, inl inp); (h, inr out)] ->
exists h', exists inp', exists out', tr = [(h', inl inp'); (h', inr out')] /\
tot_map_name h' = h /\ map tot_map_output out' = out /\ tot_map_input inp' = inp.