Definition product A B (aa: list A) (bb: list B): list (A * B) :=
  concat (map (fun a => map (pair a) bb) aa).

(* Specifications: *)
Lemma concat_map_singleton_f T A (f: A -> T) l: concat (map (fun x : A => (f x)::nil) l) = map f l.
Lemma concat_concat T (x: list (list (list T))): concat (concat x) = concat (map concat x).
Lemma two_lists_rect_pre (p: list T * list T): P (fst p) (snd p).