Notation syncStepF := (@syncStep DryHybridMachine.dryResources _ OrdinalPool.OrdinalThreadPool
                                     DryHybridMachine.DryHybridMachineSig).Notation syncStepE := (@syncStep BareMachine.resources _ OrdinalPool.OrdinalThreadPool
                                     BareMachine.BareMachineSig).Notation start_threadF := (@start_thread DryHybridMachine.dryResources _ OrdinalPool.OrdinalThreadPool
                                             DryHybridMachine.DryHybridMachineSig).Notation start_threadE := (@start_thread BareMachine.resources _ OrdinalPool.OrdinalThreadPool
                                             BareMachine.BareMachineSig).Notation resume_threadF := (@resume_thread DryHybridMachine.dryResources _ OrdinalPool.OrdinalThreadPool
                                               DryHybridMachine.DryHybridMachineSig).Notation resume_threadE := (@resume_thread BareMachine.resources _ OrdinalPool.OrdinalThreadPool
                                               BareMachine.BareMachineSig).Notation suspend_threadF := (@suspend_thread DryHybridMachine.dryResources _ OrdinalPool.OrdinalThreadPool
                                                 DryHybridMachine.DryHybridMachineSig).Notation suspend_threadE := (@suspend_thread BareMachine.resources _ OrdinalPool.OrdinalThreadPool
                                                 BareMachine.BareMachineSig).Notation threadStepF := (@threadStep DryHybridMachine.dryResources _ OrdinalPool.OrdinalThreadPool
                                         DryHybridMachine.DryHybridMachineSig).Notation threadStepE := (@threadStep BareMachine.resources _ OrdinalPool.OrdinalThreadPool
                                         BareMachine.BareMachineSig).Notation fstep := (corestep (@fine_semantics _ initU)).Notation scstep := (corestep (@bare_semantics _ initU)).Notation fsafe := (@HybridFineMachine.fsafe DryHybridMachine.dryResources _ OrdinalPool.OrdinalThreadPool
                                                  DryHybridMachine.DryHybridMachineSig FineDilMem).Notation sc_safe := (@HybridFineMachine.fsafe BareMachine.resources _ OrdinalPool.OrdinalThreadPool
                                                  BareMachine.BareMachineSig BareDilMem).Notation fexecution := (@fine_execution _ FineDilMem DryHybridMachine.dryResources).Notation sc_execution := (@fine_execution _ BareDilMem BareMachine.resources).

(* Specifications: *)
Lemma syncStep_erase: forall tp1 tp1' m1 m1' tp2 m2 i ev (HerasePool: threadPool_erasure tp1 tp1') (cnti: containsThread tp1 i) (cnti': containsThread tp1' i) (Hmem_erasure: mem_erasure m1 m1') (Hcomp1: mem_compatible tp1 m1) (Hcomp1': mem_compatible tp1' m1') (Hstep: syncStepF false cnti Hcomp1 tp2 m2 ev), exists tp2' m2', syncStepE false cnti' Hcomp1' tp2' m2' (eraseSyncEvent ev) /\ threadPool_erasure tp2 tp2' /\ mem_erasure m2 m2'.
Lemma startStep_erasure: forall tp1 tp1' tp2 m1 m1' m2 i (HerasePool: threadPool_erasure tp1 tp1') (Herase_mem: mem_erasure m1 m1') (cnti: containsThread tp1 i) (cnti': ThreadPool.containsThread tp1' i) (Hcomp1': mem_compatible tp1' m1') (Hstep: start_threadF m1 cnti tp2 m2), exists tp2' m2', start_threadE m1' cnti' tp2' m2' /\ threadPool_erasure tp2 tp2' /\ mem_erasure m2 (erasePerm m2').
Lemma resumeStep_erasure: forall tp1 m1 tp1' m1' tp2 i (HerasePool: threadPool_erasure tp1 tp1') (Herase_mem: mem_erasure m1 m1') (cnti: containsThread tp1 i) (cnti': containsThread tp1' i) (Hcomp1': mem_compatible tp1' m1') (Hstep: resume_thread m1 cnti tp2), exists tp2', resume_thread m1' cnti' tp2' /\ threadPool_erasure tp2 tp2'.
Lemma suspendStep_erasure: forall tp1 m1 tp1' m1' tp2 i (HerasePool: threadPool_erasure tp1 tp1') (Herase_mem: mem_erasure m1 m1') (cnti: containsThread tp1 i) (cnti': containsThread tp1' i) (Hcomp1': mem_compatible tp1' m1') (Hstep: suspend_threadF m1 cnti tp2), exists tp2', suspend_threadE m1' cnti' tp2' /\ threadPool_erasure tp2 tp2'.
Lemma threadStep_erase: forall tp1 tp1' m1 m1' tp2 m2 i ev (HerasePool: threadPool_erasure tp1 tp1') (cnti: containsThread tp1 i) (cnti': containsThread tp1' i) (Hmem_erasure: mem_erasure m1 m1') (Hcomp1: mem_compatible tp1 m1) (Hcomp1': mem_compatible tp1' m1') (Hstep: threadStepF cnti Hcomp1 tp2 m2 ev), exists tp2' m2' ev', threadStepE cnti' Hcomp1' tp2' m2' ev' /\ threadPool_erasure tp2 tp2' /\ mem_erasure m2 (erasePerm m2') /\ mem_event_list_erasure ev ev'.
Lemma sc_sim: forall tp1 tp1' i U tr1 tr1' tr2 m1 m1' tp2 m2 (HerasePool: threadPool_erasure tp1 tp1') (Hmem_erasure: mem_erasure m1 m1') (Hfstep: fstep (i :: U, tr1, tp1) m1 (U, tr2, tp2) m2), exists tp2' m2' tr2', scstep (i :: U, tr1', tp1') m1' (U, tr2', tp2') m2' /\ threadPool_erasure tp2 tp2' /\ mem_erasure m2 m2' /\ (trace_erasure tr1 tr1' -> trace_erasure tr2 tr2').
Lemma execution_sim: forall U U' tpf tpf' mf mf' tpsc msc tr tr' trsc (Hexec: fexecution (U, tr, tpf) mf (U', tr', tpf') mf') (HerasedPool: threadPool_erasure tpf tpsc) (Hmem_erasure: mem_erasure mf msc), exists tpsc' msc' trsc', sc_execution (U, trsc, tpsc) msc (U', trsc', tpsc') msc' /\ threadPool_erasure tpf' tpsc' /\ mem_erasure mf' msc' /\ (trace_erasure tr trsc -> trace_erasure tr' trsc').
Lemma fsafe_implies_scsafe: forall n sched tpsc tpf mf msc (Hsafe: fsafe tpf mf sched n) (HerasedPool: threadPool_erasure tpf tpsc) (Hmem_erasure: mem_erasure mf msc), sc_safe tpsc msc sched n.