Section prodl.
Fixpoint prodl (l : list nat) : nat :=
match l with
| nil => 1
| n :: l' => n * prodl l'
end.
End prodl.
Definition clos_refl {A : Type} (R : A -> A -> Prop) (x y : A) : Prop :=
R x y \/ x = y.
Inductive Exists2 {A B} (R: A -> B -> Prop) : list A -> list B -> Prop :=
| Exists2_cons_hd : forall x xs y ys, R x y -> Exists2 R (x::xs) (y::ys)
| Exists2_cons_tl : forall x xs y ys, Exists2 R xs ys -> Exists2 R (x::xs) (y::ys).
Hint Constructors Exists2.
Fixpoint revflatten {A: Type} (xss: list (list A)) : list A :=
match xss with
| []       => []
| xs::xss' => revflatten xss' ++ xs
end.

Lemma seq_S start len : seq start (S len) = seq start len ++ [start + len].