Definition replace_locals (mu:SM_Injection) pSrc' pTgt': SM_Injection :=
match 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
end.
(*typically, we have forall b, pSrc b -> pSrc' b and forall b, pTgt b -> pTgt' b, i.e. only reclassify private entries as public*)

Lemma replace_locals_pub: forall mu pubSrc' pubTgt',
pub_of (replace_locals mu pubSrc' pubTgt') =
(fun b => if pubSrc' b then local_of mu b else None).