(* concat *)

Definition concat {T}: list (list T) -> list T := fold_right (@app _) nil.

(* Specifications: *)
Lemma concat_app T (x y: list (list T)): concat (x ++ y) = concat x ++ concat y.
Lemma In_concat X (l: list (list X)) (s: list X) (x: X): In x s -> In s l -> In x (concat l).
Lemma In_concat_inv X (x: X) (l: list (list X)): In x (concat l) -> exists s, In x s /\ In s l.