Section AllPairs.
Variables (S T R : Type) (f : S -> T -> R).
Implicit Types (s : seq S) (t : seq T).
Definition allpairs s t := foldr (fun x => cat (map (f x) t)) [::] s.

Lemma allpairs_uniq R (f : S -> T -> R) s t :
uniq s -> uniq t ->
{in [seq (x, y) | x <- s, y <- t] &, injective (prod_curry f)} ->
uniq (allpairs f s t).