Notation val_inject:=Val.inject.
(*A value that is (if its a pointer) not dangling wrt m - a condition like this will probably be need to imposed on after-external return values (and thus also on the values returned by halted)*)
Definition val_valid (v:val) (m:mem):Prop :=
match v with Vptr b ofs => Mem.valid_block m b | _ => True
end.

(*Preservation of val_valid along an injection only holds if the LHS value is defined*)
Lemma inject_valvalid_1:
forall (j : meminj) (m1 m2 : mem),
Mem.inject j m1 m2 ->
forall v1 : val,
val_valid v1 m1 -> forall v2 : val, val_inject j v1 v2 ->
match v1 with Vundef => True
| _ => val_valid v2 m2
end.