simpl. destruct st as ((?, ?), ?); simpl; intros.
destruct e; [|contradiction].
destruct H; subst; eauto.
Qed.
(** The new semantics below makes internal (thread) and external (machine) steps explicit *)
Inductive internal_step:
schedule -> machine_state -> mem -> machine_state -> mem -> Prop :=
| thread_step':
forall tid U ms ms' m m' ev
(HschedN: schedPeek U = Some tid)
(Htid: containsThread ms tid)
(Hcmpt: mem_compatible ms m)
(Htstep: threadStep Htid Hcmpt ms' m' ev),
internal_step U ms m ms' (diluteMem m').
Inductive external_step:
schedule -> event_trace -> machine_state -> mem -> schedule ->
event_trace -> machine_state -> mem -> Prop :=
| start_state': forall tid U ms ms' m m' tr
(HschedN: schedPeek U = Some tid)
(Htid: containsThread ms tid)
(Htstep: start_thread m Htid ms' m'),
external_step U tr ms m (yield U) tr ms' (diluteMem m')
| resume_step':
forall tid U ms ms' m tr
(HschedN: schedPeek U = Some tid)
(Htid: containsThread  ms tid)
(Htstep: resume_thread m Htid ms'),
external_step U tr ms m (yield U) tr ms' m
| suspend_step':
forall tid U U' ms ms' m tr
(HschedN: schedPeek U = Some tid)
(HschedS: schedSkip U = U')        (*Schedule Forward*)
(Htid: containsThread ms tid)
(Htstep:suspend_thread m Htid ms'),
external_step U tr ms m U' tr ms' m
| sync_step':
forall tid U U' ms ms' m m' ev tr
(HschedN: schedPeek U = Some tid)
(HschedS: schedSkip U = U')        (*Schedule Forward*)
(Htid: containsThread ms tid)
(Hcmpt: mem_compatible ms m)
(Htstep: syncStep isCoarse Htid Hcmpt ms' m' ev),
external_step U tr ms m  U' (tr ++ [:: external tid ev]) ms' m'
| schedfail':
forall tid U U' ms m tr
(HschedN: schedPeek U = Some tid)
(Htid: ~ containsThread ms tid)
(Hinv: invariant ms)
(Hcmpt: mem_compatible ms m)
(HschedS: schedSkip U = U'),        (*Schedule Forward*)
external_step U tr ms m U' tr ms m.

Lemma step_equivalence3: forall U tr st m U' tr' st' m',
@external_step U tr st m U' tr' st' m' ->
exists tr1, tr' = tr ++ tr1 /\ @machine_step U tr st m U' tr' st' m'.