(** [mem_compatible] is preserved by [resume_thread]*)
    Corollary resume_compatible :
      forall (tp tp' : t) m (i : nat) (pf : containsThread tp i)
        (Hcompatible: mem_compatible tp m)
        (Hresume: resume_thread m pf tp'),
        mem_compatible tp' m.(** [mem_compatible] is preserved by [start_thread]*)
    Corollary start_compatible :
      forall (tp tp' : t) m m' (i : nat) (pf : containsThread tp i)
        (Hcompatible: mem_compatible tp m)
        (Hstart: start_thread m pf tp' m'),
        mem_compatible tp' m'.(** [mem_compatible] is preserved by [internal_step]*)
    Corollary internal_step_compatible :
      forall (tp tp' : t) m m' (i : nat) (pf : containsThread tp i)
        (Hcompatible: mem_compatible tp m)
        (Hstep: internal_step pf Hcompatible tp' m'),
        mem_compatible tp' m'.

(* Specifications: *)
Lemma internal_step_invariant: forall (tp tp' : t) m m' (i : nat) (pf : containsThread tp i) (Hcompatible: mem_compatible tp m) (Hstep: internal_step pf Hcompatible tp' m'), invariant tp'.
Lemma internal_execution_compatible : forall (tp tp' : t) m m' xs (Hcompatible: mem_compatible tp m) (Hstep: internal_execution xs tp m tp' m'), mem_compatible tp' m'.
Lemma internal_execution_invariant : forall (tp tp' : t) m m' xs (Hcompatible: mem_compatible tp m) (Hinv: invariant tp) (Hstep: internal_execution xs tp m tp' m'), invariant tp'.
Lemma gsoThreadC_step: forall tp tp' m m' i j (pfi: containsThread tp i) (pfj: containsThread tp j) (pfj': containsThread tp' j) (Hcomp: mem_compatible tp m) (Hstep: internal_step pfi Hcomp tp' m') (Hneq: i <> j), getThreadC pfj = getThreadC pfj'.
Lemma gsoThreadR_step: forall tp tp' m m' i j (pfi: containsThread tp i) (pfj: containsThread tp j) (pfj': containsThread tp' j) (Hcomp: mem_compatible tp m) (Hstep: internal_step pfi Hcomp tp' m') (Hneq: i <> j), getThreadR pfj = getThreadR pfj'.
Lemma gsoLockPool_step: forall tp tp' m m' i (pfi: containsThread tp i) (Hcomp: mem_compatible tp m) (Hstep: internal_step pfi Hcomp tp' m') addr, lockRes tp addr = lockRes tp' addr.
Lemma internal_step_valid: forall tp m tp' m' i (cnt: containsThread tp i) (Hcomp: mem_compatible tp m) (Hstep: internal_step cnt Hcomp tp' m') b (Hvalid: Mem.valid_block m b), Mem.valid_block m' b.
Lemma internal_execution_valid : forall tp m tp' m' xs (Hexec: internal_execution xs tp m tp' m') b (Hvalid: Mem.valid_block m b), Mem.valid_block m' b.
Lemma updThread_internal_step: forall tp tp' m m' i j c pmap (Hneq: i <> j) (cnti: containsThread tp i) (cnti': containsThread tp' i) (cntj: containsThread tp j) (cntj': containsThread (updThread cnti c pmap) j) (Hcomp: mem_compatible tp m) (Hcomp': mem_compatible (updThread cnti c pmap) m) (Hinv': invariant (updThread cnti c pmap)) (Hstep: internal_step cntj Hcomp tp' m'), internal_step cntj' Hcomp' (updThread cnti' c pmap) m'.
Lemma addThread_internal_step: forall tp tp' m m' i vf arg pmap (cnti: containsThread tp i) (cnti': containsThread (addThread tp vf arg pmap) i) (Hcomp: mem_compatible tp m) (Hcomp': mem_compatible (addThread tp vf arg pmap) m) (Hinv': invariant (addThread tp vf arg pmap)) (Hstep: internal_step cnti Hcomp tp' m'), internal_step cnti' Hcomp' (addThread tp' vf arg pmap) m'.
Lemma remLock_internal_step: forall tp tp' m m' j (cntj: containsThread tp j) b ofs (Hcomp: mem_compatible tp m) (Hcomp': mem_compatible (remLockSet tp (b,ofs)) m) (cntj': containsThread (remLockSet tp (b,ofs)) j) (Hstep: internal_step cntj Hcomp tp' m'), internal_step cntj' Hcomp' (remLockSet tp' (b,ofs)) m'.
Lemma internal_step_nextblock: forall tp m tp' m' i (cnti: containsThread tp i) (Hcomp: mem_compatible tp m) (Hstep: internal_step cnti Hcomp tp' m'), (Mem.nextblock m <= Mem.nextblock m')%positive.
Lemma internal_execution_nextblock: forall tp m tp' m' xs (Hexec: internal_execution xs tp m tp' m'), (Mem.nextblock m <= Mem.nextblock m')%positive.