Section MINMAX_II.
Variable j12 j12' :meminj.
Variable m1' m2: mem.
Definition MINMAX_Offset (b2:block) : option (Z * Z) :=
if plt b2 (Mem.nextblock m2)
then match (zmap_finite_c _ (PMap.get b2 m2.(Mem.mem_contents)))
with (min2, max2) =>
match minmax m1' j12 b2 with
Some(min1, max1) =>
Some(Z.min min1 min2, Z.max max1 max2)
| None => Some(min2,max2)
end
end
else minmax m1' j12' b2.
Hypothesis inc12: inject_incr j12 j12'.
Hypothesis VBj12'_1: forall b1 b2 delta,
j12' b1 = Some (b2, delta) ->
Mem.valid_block m1' b1.
Hypothesis JJ: forall b1 b2 delta,
j12' b1 = Some (b2, delta) ->
Mem.valid_block m2 b2 ->
j12 b1 = Some (b2, delta).
End MINMAX_II.

(*prooves the claim of interpolate_II, plus properties on j12' and j23' corresponding to mkInjections_3 and mkInjections_4. This is usefule for proving Forward_simulations_trans.initial_inject_split in the sufficiently strong form needed to prove that memninj_preserves splits, as required for transitivity_II.*)
Lemma interpolate_II_HeqMKI: forall m1 m2 j12 (MInj12 : Mem.inject j12 m1 m2) m1'
(Fwd1: mem_forward m1 m1') j23 m3
(MInj23 : Mem.inject j23 m2 m3) m3' (Fwd3: mem_forward m3 m3')
j' (MInj13': Mem.inject j' m1' m3')
(InjIncr: inject_incr (compose_meminj j12 j23) j')
(InjSep: inject_separated (compose_meminj j12 j23) j' m1 m3)
(Unch11': Mem.unchanged_on
(loc_unmapped (compose_meminj j12 j23)) m1 m1')
(Unch33': Mem.unchanged_on
(loc_out_of_reach (compose_meminj j12 j23) m1) m3 m3'),
exists m2', exists j12', exists j23', j'=compose_meminj j12' j23' /\
inject_incr j12 j12' /\ inject_incr j23 j23' /\
Mem.inject j12' m1' m2' /\ mem_forward m2 m2' /\
Mem.inject j23' m2' m3' /\
Mem.unchanged_on (loc_out_of_reach j12 m1) m2 m2' /\
inject_separated j12 j12' m1 m2 /\
inject_separated j23 j23' m2 m3 /\
Mem.unchanged_on (loc_unmapped j23) m2 m2' /\
Mem.unchanged_on (loc_out_of_reach j23 m2) m3 m3' /\
(forall b1 b2 ofs2, j12' b1 = Some(b2,ofs2) ->
(j12 b1 = Some (b2,ofs2)) \/
(b1 = Mem.nextblock m1 /\ b2 = Mem.nextblock m2 /\ ofs2 = 0) \/
(exists m, (b1 = Mem.nextblock m1 + m /\ b2=Mem.nextblock m2 + m)%positive /\ ofs2=0)) /\
(forall b2 b3 ofs3, j23' b2 = Some(b3,ofs3) ->
(j23 b2 = Some (b3,ofs3)) \/
(b2 = Mem.nextblock m2 /\ j' (Mem.nextblock m1) = Some(b3,ofs3)) \/
(exists m, (b2 = Mem.nextblock m2 + m)%positive /\
j' ((Mem.nextblock m1+m)%positive) = Some(b3,ofs3))).