(** Symmetrically, [encode_val], applied to values related by [Val.inject], returns lists of memory values that are pairwise related by [memval_inject]. *)

(* Specifications: *)
Lemma inj_bytes_inject:
forall f bl, list_forall2 (memval_inject f) (inj_bytes bl) (inj_bytes bl).
Lemma repeat_Undef_inject_any:
forall f vl,
list_forall2 (memval_inject f) (list_repeat (length vl) Undef) vl.
Lemma repeat_Undef_inject_encode_val:
forall f chunk v,
list_forall2 (memval_inject f) (list_repeat (size_chunk_nat chunk) Undef) (encode_val chunk v).
Lemma repeat_Undef_inject_self:
forall f n,
list_forall2 (memval_inject f) (list_repeat n Undef) (list_repeat n Undef).
Lemma inj_value_inject:
forall f v1 v2 q, Val.inject f v1 v2 -> list_forall2 (memval_inject f) (inj_value q v1) (inj_value q v2).
Theorem encode_val_inject:
forall f v1 v2 chunk,
Val.inject f v1 v2 ->
list_forall2 (memval_inject f) (encode_val chunk v1) (encode_val chunk v2).
Lemma inj_bytes_inject:
forall f bl, list_forall2 (memval_inject f) (inj_bytes bl) (inj_bytes bl).
Lemma repeat_Undef_inject_any:
forall f vl,
list_forall2 (memval_inject f) (list_repeat (length vl) Undef) vl.
Lemma repeat_Undef_inject_encode_val:
forall f chunk v,
list_forall2 (memval_inject f) (list_repeat (size_chunk_nat chunk) Undef) (encode_val chunk v).
Lemma repeat_Undef_inject_self:
forall f n,
list_forall2 (memval_inject f) (list_repeat n Undef) (list_repeat n Undef).
Lemma inj_value_inject:
forall f v1 v2 q, Val.inject f v1 v2 -> list_forall2 (memval_inject f) (inj_value q v1) (inj_value q v2).
Theorem encode_val_inject:
forall f v1 v2 chunk,
Val.inject f v1 v2 ->
list_forall2 (memval_inject f) (encode_val chunk v1) (encode_val chunk v2).