Definition body n (v: Vector.t X n) :=
    match v with
    | Vector.nil => ret nil
    | l => selectPivotPart l
    end.Definition raw_body_ext (l: list X) (qs qs': {l': list X | length l' < length l} -> M (list X)):
    (forall x y, proj1_sig x = proj1_sig y -> qs x = qs' y) -> raw_body l qs = raw_body l qs'.

(* Specifications: *)
Lemma bodies x0: raw_body x0 (fun y: {y: list X | length y < length x0} => qs (M:=M) cmp pick (proj1_sig y)) = body x0.
Lemma toBody (l: list X): qs cmp pick l = body l.
Lemma toBody_cons (n: nat) (v: Vector.t X (S n)): body v = selectPivotPart v.
Lemma rect (Q: list X -> M (list X) -> Type): (Q nil (ret nil)) -> (forall n (v: Vector.t X (S n)), (forall y, length y < S n -> Q y (qs cmp pick y)) -> Q v (selectPivotPart v)) -> forall x, Q x (qs cmp pick x).
Lemma rect_using_lists (Q: list X -> M (list X) -> Type): (Q nil (ret nil)) -> (forall h t, (forall y, length y <= length t -> Q y (qs cmp pick y)) -> Q (h::t) (selectPivotPart (h::t))) -> forall x, Q x (qs cmp pick x).