Section ThreadPoolErasure.
Context {Sem: Semantics}
{CE: CoreErasure}.
Existing Instance OrdinalPool.OrdinalThreadPool.
Existing Instance DryHybridMachine.dryResources.
Existing Instance BareMachine.resources.
Existing Instance AsmContext.bareMach.
Existing Instance AsmContext.dryFineMach.
Notation containsThreadF := (@containsThread DryHybridMachine.dryResources Sem OrdinalPool.OrdinalThreadPool).
Notation containsThreadE := (@containsThread BareMachine.resources Sem OrdinalPool.OrdinalThreadPool).
Definition ctl_erasure c c' : Prop :=
match c, c' with
| Kinit vf arg, Kinit vf' arg' =>
val_erasure vf vf' /\ val_erasure arg arg'
| Krun c, Krun c' =>
core_erasure c c'
| Kblocked c, Kblocked c' =>
core_erasure c c'
| Kresume c arg, Kresume c' arg' =>
core_erasure c c' /\ arg = arg'
(*we don't use this and our semantics are strange*)
| _, _  => False
end.
Inductive threadPool_erasure tp tp' :=
| ErasedPool :
(forall i, containsThreadF tp i <-> containsThreadE tp' i) ->
(forall i (cnti: containsThreadF tp i)
(cnti': containsThreadE tp' i),
ctl_erasure (getThreadC cnti) (getThreadC cnti')) ->
threadPool_erasure tp tp'.
Proof with eauto with val_erasure erased.
destruct c; simpl...
Qed.

Lemma erased_updThreadC:
forall tp tp' i (cnti: containsThread tp i)
(cnti': containsThread tp' i) c c',
threadPool_erasure tp tp' ->
ctl_erasure c c' ->
threadPool_erasure (updThreadC cnti c)
(updThreadC cnti' c').