(* Definition Vubyte (c: Byte.int) : val := Vint (Int.repr (Byte.unsigned c)).  Lemma Znth_map_Vubyte: forall (i : Z) (l : list byte), 0 <= i < Zlength l -> Znth i (map Vubyte l)  = Vubyte (Znth i l). Locate Znth_map_Vubyte. Hint Rewrite Znth_map_Vubyte using list_solve : norm entailer_rewrite. *)
Local Open Scope nat.
Fixpoint map2 {A B C: Type} (f: A -> B -> C) (al: list A) (bl: list B) : list C :=
match al, bl with
| a::al', b::bl' => f a b :: map2 f al' bl'
| _, _ => nil
end.

(* Specifications: *)
Lemma length_map2:
forall A B C (f: A -> B -> C) al bl n,
length al = n -> length bl = n ->
length (map2 f al bl) = n.
Lemma list_repeat_injective {A} (a a':A) n: (0<n)%nat ->
list_repeat n a = list_repeat n a' -> a=a'.