Section contents.
Variables (X: Set) (eq_X_dec: forall (x y: X), { x = y } + { x <> y }).
Definition beq_X (x y: X): bool := unsum_bool (eq_X_dec x y).
Proof with auto.
destruct l; simpl...
intros.
elimtype False.
specialize (H x).
unfold beq_X in H.
destruct (eq_X_dec x x)...
simpl in H.
discriminate.
Qed.
Proof with auto.
intros.
replace 0 with (INR 0)...
apply expec_constant.
intros.
apply counts_0_length_0.
intros.
apply (expec_0_inv (count (beq_X i))) with t...
Qed.

Lemma exp_list_sum_le (fr: X -> R) (q: list X) (t: ne_tree.T (list X)):
(forall i, In i q -> expec (count (beq_X i)) t <= fr i) ->
(forall i, ~ In i q -> expec (count (beq_X i)) t = 0) ->
expec (@length (_:Set)) t <= Rsum (map fr q).