Set Implicit Arguments.
Require qs_definitions.
Require qs_parts.
Require U.
Require Vector.
Section contents.
Variables (ee: E) (ol: list ee) (i j: Index ee ol).
Variable n: nat.
Variable v: Vector.t (Index ee ol) (S n).
Variable iltj: (i < j)%nat.
Let flt x0 cr := filter (fun f: Index ee ol => unsum_bool (cmp_cmp (Ecmp (UE ee ol) f (vec.nth v x0)) cr)) (vec.remove v x0).
Variable IH: forall (x0: natBelow (S n)) (cr: comparison) (b: nat),
IndexSeq b (flt x0 cr) ->
monoid_expec (U.ijcount i j) (qs (U.cmp (e:=ee) (ol:=ol)) U.pick (flt x0 cr)) <= 2 / INR (S (j - i)).
Variables (b: nat) (is: IndexSeq b v).

Lemma ndi: NoDup v.
apply IndexSeq_NoDup with b.