Fixpoint splits (l: list T): list (T * list T) :=
    match l with
    | nil => nil
    | h :: t => (h, t) :: map (fun xy => (fst xy, h :: snd xy)) (splits t)
    end.

(* Specifications: *)
Lemma length_splits l: length (splits l) = length l.
Lemma splits_are_perms l p: In p (splits l) -> Permutation (fst p :: snd p) l.
Lemma length_in_splits l p: In p (splits l) -> S (length (snd p)) = length l.