Notation schedule := (seq nat).(** Internal steps are just thread coresteps or resume steps or start steps,
          they mimic fine-grained internal steps *)
      Definition internal_step {tid} {tp} m (cnt: containsThread tp tid)
                 (Hcomp: mem_compatible tp m) tp' m' :=
      (exists ev, threadStep cnt Hcomp tp' m' ev) \/
      (resume_thread m cnt tp' /\ m = m') \/
      (start_thread m cnt tp' m').

(* Specifications: *)
Lemma internal_execution_trans : forall i U tp tp' tp'' m m' m'' (pf': containsThread tp' i) (Hcomp: mem_compatible tp' m') (Hstep: internal_step pf' Hcomp tp'' m'') (Hexec: internal_execution U tp m tp' m'), internal_execution (U ++ (i :: nil))%list tp m tp'' m''.
Lemma internal_step_det : forall tp tp' tp'' m m' m'' i (Hcnt: containsThread tp i) (Hcomp: mem_compatible tp m) (Hstep: internal_step Hcnt Hcomp tp' m') (Hstep': internal_step Hcnt Hcomp tp'' m''), tp' = tp'' /\ m' = m''.
Lemma containsThread_internal_step : forall tp m tp' m' tid0 tid (Hcnt0: containsThread tp tid0) (Hcomp: mem_compatible tp m) (Hstep: internal_step Hcnt0 Hcomp tp' m') (Hcnt: containsThread tp tid), containsThread tp' tid.
Lemma containsThread_internal_execution : forall U tp m tp' m' i (Hexec: internal_execution U tp m tp' m'), containsThread tp i -> containsThread tp' i.
Lemma containsThread_internal_step' : forall tp m tp' m' i j (Hcnt0: containsThread tp j) (Hcomp: mem_compatible tp m) (Hstep: internal_step Hcnt0 Hcomp tp' m') (Hcnt: containsThread tp' i), containsThread tp i.
Lemma containsThread_internal_execution' : forall U tp m tp' m' i (Hexec: internal_execution U tp m tp' m') (Hcnt: containsThread tp' i), containsThread tp i.
Lemma dry_step_compatible : forall (tp tp' : t) m m' (i : nat) ev (pf : containsThread tp i) (Hcompatible: mem_compatible tp m) (Hdry: dry_step pf Hcompatible tp' m' ev), mem_compatible tp' m'.