(*Expresses that the evolution soundly and completely tracks what happened during related coresteps. sm_locally_allocated is typically be used in conjunction with intern_incr, so extern mu = extern mu', and equalities (pSrc,pTgt,fSrc,fTgt)=(pSrc',pTgt',fSrc',fTgt') hold, too.*)
Definition sm_locally_allocated (mu mu' : SM_Injection) (m1 m2 m1' m2':mem):Prop :=
match mu, mu' with
Build_SM_Injection locBSrc locBTgt pSrc pTgt local extBSrc extBTgt fSrc fTgt extern,
Build_SM_Injection locBSrc' locBTgt' pSrc' pTgt' local' extBSrc' extBTgt' fSrc' fTgt' extern'
=>    locBSrc' = (fun b => orb (locBSrc b) (freshloc m1 m1' b))
/\ locBTgt' = (fun b => orb (locBTgt b) (freshloc m2 m2' b))
/\ extBSrc' = extBSrc
/\ extBTgt' = extBTgt
end.

(* Specifications: *)
Lemma sm_locally_allocatedChar: forall mu mu' m1 m2 m1' m2',
sm_locally_allocated mu mu' m1 m2 m1' m2' <->
(    DomSrc mu' = (fun b => orb (DomSrc mu b) (freshloc m1 m1' b))
/\ DomTgt mu' = (fun b => orb (DomTgt mu b) (freshloc m2 m2' b))
/\ locBlocksSrc mu' = (fun b => orb (locBlocksSrc mu b) (freshloc m1 m1' b))
/\ locBlocksTgt mu' = (fun b => orb (locBlocksTgt mu b) (freshloc m2 m2' b))
/\ extBlocksSrc mu' = extBlocksSrc mu
/\ extBlocksTgt mu' = extBlocksTgt mu).
Lemma sm_inject_separated_intern_MYB: forall mu mu' m1 m2 m1' m2'
(SEP: sm_inject_separated mu mu' m1 m2)
(LAL: sm_locally_allocated mu mu' m1 m2 m1' m2'),
(forall b, locBlocksSrc mu b = false -> locBlocksSrc mu' b = true -> ~ Mem.valid_block m1 b) /\
(forall b, locBlocksTgt mu b = false -> locBlocksTgt mu' b = true -> ~ Mem.valid_block m2 b).
Lemma sm_locally_allocatedChar: forall mu mu' m1 m2 m1' m2',
sm_locally_allocated mu mu' m1 m2 m1' m2' <->
(    DomSrc mu' = (fun b => orb (DomSrc mu b) (freshloc m1 m1' b))
/\ DomTgt mu' = (fun b => orb (DomTgt mu b) (freshloc m2 m2' b))
/\ locBlocksSrc mu' = (fun b => orb (locBlocksSrc mu b) (freshloc m1 m1' b))
/\ locBlocksTgt mu' = (fun b => orb (locBlocksTgt mu b) (freshloc m2 m2' b))
/\ extBlocksSrc mu' = extBlocksSrc mu
/\ extBlocksTgt mu' = extBlocksTgt mu).
Lemma sm_inject_separated_intern_MYB: forall mu mu' m1 m2 m1' m2'
(SEP: sm_inject_separated mu mu' m1 m2)
(LAL: sm_locally_allocated mu mu' m1 m2 m1' m2'),
(forall b, locBlocksSrc mu b = false -> locBlocksSrc mu' b = true -> ~ Mem.valid_block m1 b) /\
(forall b, locBlocksTgt mu b = false -> locBlocksTgt mu' b = true -> ~ Mem.valid_block m2 b).