Definition replace_externs (mu:SM_Injection) fSrc' fTgt': 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, fSrc b -> fSrc' b and forall b, fTgt b -> fTgt' b, i.e. only reclassify unknown entries as foreign*)

Lemma replace_locals_sharedSrc mu pubSrc' pubTgt': forall
(HPUB1: forall b,  pubSrc' b = true -> local_of mu b <> None)
(HPUB2: forall b,  pubBlocksSrc mu b = true -> pubSrc' b = true),
sharedSrc (replace_locals mu pubSrc' pubTgt') =
fun b => pubSrc' b || sharedSrc mu b.