(** ** Proofs about [AsmContext.dryFineMach]*)
Section FineMachineInternal.
Context {initU : seq nat}
{semAx: CoreLanguage.SemAxioms}
{dilMem: DiluteMem}.
Notation fmachine_step := ((corestep (AsmContext.fine_semantics initU))).
(*TODO: maybe move to tactics *)
(** Solves absurd cases from fine-grained internal steps *)
Ltac absurd_internal Hstep :=
inversion Hstep; try inversion Htstep; subst; Tactics.pf_cleanup; simpl in *;
try match goal with
| [H: Some _ = Some _ |- _] => inversion H; subst
end; Tactics.pf_cleanup;
repeat match goal with
| [H: getThreadC ?Pf = _, Hint: ?Pf$_ @ I |- _] =>
unfold getStepType in Hint; simpl in *;
rewrite H in Hint; simpl in Hint
| [H1: match ?Expr with _ => _ end = _,
H2: ?Expr = _ |- _] => rewrite H2 in H1
end; try discriminate; try (exfalso; by auto).
Opaque getThreadC updThreadC containsThread updThread updLockSet addThread remLockSet getThreadR lockSet.

Lemma gsoThreadC_fstepI:
forall tp tp' m m' i j U tr tr'
(pfj: containsThread tp j)
(pfj': containsThread tp' j)
(pfi: containsThread tp i)
(Hcomp: mem_compatible tp m),
let mrestr := restrPermMap (((compat_th _ _ Hcomp) pfi).1) in
forall (Hinternal: pfi$mrestr @ I)
(Hstep: fmachine_step (i :: U, tr, tp) m (U, tr', tp') m')
(Hneq: i <> j),
getThreadC pfj = getThreadC pfj'.