(** ** Proofs of internal step safety and simulation*)

Lemma weak_tsim_fstep:
forall tpc tpf tpf' mc mf mf' i j f U tr tr'
(pffi: containsThread tpf i)
(pfcj: containsThread tpc j) (pffj: containsThread tpf j)
(pffj': containsThread tpf' j)
(Hcompc: mem_compatible tpc mc)
(Hcompf: mem_compatible tpf mf)
(Hcompf': mem_compatible tpf' mf')
(HinvF: invariant tpf),
let mrestr := restrPermMap (((compat_th _ _ Hcompf) pffi).1) in
forall (Hinternal: pffi$mrestr @ I)
(Hstep: fmachine_step (i :: U, tr, tpf) mf (U, tr',tpf') mf')
(HweakSim: weak_tsim f pfcj pffj Hcompc Hcompf),
weak_tsim f pfcj pffj' Hcompc Hcompf'.