Fixpoint permute(ls : list A)(sigma : list nat) : list A :=
    match sigma with
      | nil => nil
      | n :: sigma' => 
        match (nth_error ls n) with
          | None => nil
          | Some a => a :: (permute ls sigma')
        end
  end.

(* Specifications: *)
Theorem nth_error_not_None : forall (ls : list A)(n : nat), n < length ls -> nth_error ls n = None -> False.
Theorem permute_length_eq : forall (sigma : list nat)(ls : list A), (forall n, In n sigma -> n < length ls) -> length (permute ls sigma) = length sigma.
Theorem shuffle_Permutation : forall (ls1 ls2 : list A), In ls2 (getSupport (shuffle ls1)) -> Permutation ls1 ls2.
Theorem shuffle_wf : forall ls, well_formed_comp (shuffle ls).