Goal forall mu Etgt Esrc m2 m2' (WD: SM_wd mu) m1
(TgtHyp: forall b ofs, Etgt b ofs = true ->
(Mem.valid_block m2 b /\
(locBlocksTgt mu b = false ->
exists b1 delta1, foreign_of mu b1 = Some(b,delta1) /\
Esrc b1 (ofs-delta1) = true /\ Mem.perm m1 b1 (ofs-delta1) Max Nonempty)))
(Unch2: Mem.unchanged_on (fun b z => Etgt b z = false) m2 m2')
(*(SrcHyp: forall b ofs, Esrc b ofs = true -> vis mu b = true)*)
nu (WDnu: SM_wd nu)
(X1: forall b, locBlocksTgt nu b = true -> locBlocksTgt mu b = false)
(X2: forall b1 b2 d, foreign_of mu b1 = Some(b2, d) ->
locBlocksSrc nu b1 || locBlocksTgt nu b2 = true ->
pub_of nu b1 = Some(b2,d)),
Mem.unchanged_on (fun b2 z => locBlocksTgt nu b2 = true /\
forall b1 d, (as_inj nu) b1 = Some (b2,d) ->
loc_out_of_bounds m1 b1 (z-d)) m2 m2'.
Inductive match_freelists (j:meminj): list (block * Z * Z) -> list (block * Z * Z) -> Prop :=
match_freelists_nil: match_freelists j nil nil
| match_freelists_cons: forall b1 lo1 hi1 t1 b2 lo2 hi2 t2 delta,
j b1 = Some (b2,delta) ->
lo2 = lo1+delta -> hi2 = hi1+delta ->
match_freelists j t1 t2 ->
match_freelists j ((b1,lo1,hi1)::t1) ((b2,lo2,hi2)::t2).

Lemma core_initial_wd_as_inj : forall {F1 V1 F2 V2} (ge1: Genv.t F1 V1) (ge2: Genv.t F2 V2)
vals1 m1 j vals2 m2 DomS DomT
(MInj: Mem.inject j m1 m2)
(VInj: Forall2 (val_inject j) vals1 vals2)
(HypJ: forall b1 b2 d, j b1 = Some (b2, d) -> DomS b1 = true /\ DomT b2 = true)
(R: forall b, REACH m2 (fun b' => isGlobalBlock ge2 b' || getBlocks vals2 b') b = true ->
DomT b = true)
(PG: meminj_preserves_globals ge1 j)
(GenvsDomEQ: genvs_domain_eq ge1 ge2)
(HS: forall b, DomS b = true -> Mem.valid_block m1 b)
(HT: forall b, DomT b = true -> Mem.valid_block m2 b)
mu (Hmu: mu = initial_SM DomS DomT
(REACH m1 (fun b => isGlobalBlock ge1 b || getBlocks vals1 b))
(REACH m2 (fun b => isGlobalBlock ge2 b || getBlocks vals2 b)) j),
(forall b, REACH m1 (fun b' => isGlobalBlock ge1 b' || getBlocks vals1 b') b = true ->
DomS b = true) /\
SM_wd mu /\ sm_valid mu m1 m2 /\
meminj_preserves_globals ge1 (as_inj mu) /\
(forall b, isGlobalBlock ge1 b = true -> frgnBlocksSrc mu b = true).