Fixpoint insertion_sort n: Vector.t X n -> Vector.t X n :=
    match n return Vector.t X n -> Vector.t X n with
    | 0 => fun _ => Vector.nil
    | S n' => fun v => insert_ordered (head v) (insertion_sort (tail v))
    end.

Lemma insertion_sort_permutes n (l: Vector.t X n): Permutation (insertion_sort l) l.