Proof with auto.
intros.
inversion_clear H.
apply NoDup_map'...
intros.
unfold U.unordered_nat_pair.
intro.
apply H3.
unfold Index in *.
apply natBelow_unique.
destruct (le_lt_dec x0 x); destruct (le_lt_dec y x); inversion H4; reflexivity.
Qed.

(* Specifications: *)
Lemma case_A: (vec.nth v pi < i)%nat ->
INR (U.ijcount i j (map (fun i0: Index ee ol => U.unordered_nat_pair i0 (vec.nth v pi)) (vec.remove v pi))) +
monoid_expec (U.ijcount i j)
(foo <- @U.qs ee ol (flt pi Lt);
bar <- @U.qs ee ol (flt pi Gt);
ret  (foo ++ (vec.nth v pi :: flt pi Eq) ++ bar))
<= 2 * / INR (S (j - i)).