Instance CompSpecs : compspecs.Definition Vprog : varspecs.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.Definition dotprod (fx fy : list float) : float :=
  fold_left Float.add (map2 Float.mul fx fy) Float.zero .

Lemma Znth_map2: forall A B C (a: Inhabitant A) (b: Inhabitant B) (c: Inhabitant C) (f: A -> B -> C) (al: list A) (bl: list B) i, Zlength al = Zlength bl -> 0 <= i < Zlength al -> Znth i (map2 f al bl) = f (Znth i al) (Znth i bl).