intros. exploit Mem.alloc_parallel_inject; eauto.
intros [? [? [? [? [? [? [? ?]]]]]]].
repeat (econstructor; eauto).
intros b HH.
destruct (ident_eq b b1).
- subst. rewrite H7; discriminate.
- rewrite H8; auto. eapply H1.
eapply Mem.valid_block_alloc_inv in H0; eauto.
destruct H0; auto. subst; contradict n; auto.
Qed.

Theorem alloc_left_mapped_inject':
forall f m1 m2 lo hi m1' b1 b2 delta,
Mem.inject f m1 m2 ->
injection_full f m1 ->
Mem.alloc m1 lo hi = (m1', b1) ->
Mem.valid_block m2 b2 ->
0 <= delta <= Ptrofs.max_unsigned ->
(forall ofs k p, Mem.perm m2 b2 ofs k p -> delta = 0 \/ 0 <= ofs < Ptrofs.max_unsigned) ->
(forall ofs k p, lo <= ofs < hi -> Mem.perm m2 b2 (ofs + delta) k p) ->
Mem.inj_offset_aligned delta (hi-lo) ->
(forall b delta' ofs k p,
f b = Some (b2, delta') ->
Mem.perm m1 b ofs k p ->
lo + delta <= ofs + delta' < hi + delta -> False) ->
exists f',
Mem.inject f' m1' m2
/\ inject_incr f f'
/\ f' b1 = Some(b2, delta)
/\ (forall b, b <> b1 -> f' b = f b)
/\ injection_full f' m1'.