@@ -46,7 +46,7 @@ Structure distr := Distr {
4646 mu :> T -> R;
4747 _ : forall x, 0 <= mu x;
4848 _ : summable mu;
49- _ : psum mu <= 1
49+ _ : PosSum. psum mu <= 1
5050}.
5151
5252Definition distr_of & phant R & phant T := distr.
@@ -63,7 +63,7 @@ Context {R : realType} (T : choiceType) (mu : {distr T / R}).
6363Lemma ge0_mu : forall x, 0 <= mu x.
6464Proof . by case: mu. Qed .
6565
66- Lemma le1_mu : psum mu <= 1.
66+ Lemma le1_mu : PosSum. psum mu <= 1.
6767Proof . by case: mu. Qed .
6868
6969Lemma summable_mu : summable mu.
@@ -119,7 +119,7 @@ Proof. by apply: (iffP idP) => /eqP. Qed.
119119Lemma dinsuppPn mu x : reflect (mu x = 0) (x \notin dinsupp mu).
120120Proof . by rewrite -topredE /dinsupp /= negbK; apply/eqP. Qed .
121121
122- Definition pr mu E := psum (fun x => (E x)%:R * mu x).
122+ Definition pr mu E := PosSum. psum (fun x => (E x)%:R * mu x).
123123Definition prc mu E A := pr mu [predI E & A] / pr mu A.
124124Definition esp mu f := sum (fun x => f x * mu x).
125125Definition espc mu f A := sum (fun x => f x * prc mu (pred1 x) A).
@@ -153,7 +153,7 @@ move=> s /h /(le_trans _); apply; rewrite le_eqVlt; apply/orP.
153153by left; apply/eqP/eq_bigr=> i _; rewrite ger0_norm ?isd1.
154154Qed .
155155
156- Local Lemma isd3 : psum mu <= 1.
156+ Local Lemma isd3 : PosSum. psum mu <= 1.
157157Proof .
158158rewrite psumE; [apply/isd1 | apply/isd2 | apply: ge_sup].
159159 by exists 0, fset0; rewrite big_fset0.
181181Lemma le1_mu1
182182 {R : realType} {T : choiceType} (mu : {distr T / R}) x : mu x <= 1.
183183Proof .
184- apply/(@le_trans _ _ (psum mu)) => //; rewrite -[mu x]ger0_norm//.
184+ apply/(@le_trans _ _ (PosSum. psum mu)) => //; rewrite -[mu x]ger0_norm//.
185185by apply/ger1_psum.
186186Qed .
187187
@@ -356,7 +356,7 @@ Implicit Types (T U : choiceType).
356356Section Bind .
357357Context {T U : choiceType} (f : T -> distr U) (mu : distr T).
358358
359- Definition mlet := fun y : U => psum (fun x => mu x * f x y).
359+ Definition mlet := fun y : U => PosSum. psum (fun x => mu x * f x y).
360360
361361Lemma isd_mlet : isdistr mlet.
362362Proof .
373373
374374Definition dlet := locked (mkdistr isd_mlet).
375375
376- Lemma dletE y : dlet y = psum (fun x => mu x * f x y).
376+ Lemma dletE y : dlet y = PosSum. psum (fun x => mu x * f x y).
377377Proof . by unlock dlet. Qed .
378378End Bind .
379379
@@ -511,7 +511,7 @@ Lemma __deprecated__dlet_dlet (mu : {distr T / R}) :
511511Proof .
512512move=> z; unlock dlet => /=; rewrite /mlet /=.
513513pose S y x := mu x * (f1 x y * f2 y z).
514- rewrite (eq_psum (F2 := fun y => psum (S^~ y))) => [x|].
514+ rewrite (eq_psum (F2 := fun y => PosSum. psum (S^~ y))) => [x|].
515515 by rewrite -psumZ //; apply/eq_psum => y /=.
516516rewrite __admitted__interchange_psum.
517517+ by move=> x; apply/summableZ/summable_mlet.
@@ -713,7 +713,7 @@ Section MarginalsTh.
713713Variable (T U V : choiceType).
714714
715715Lemma dmargin_psumE (mu : {distr T / R}) (f : T -> U) y :
716- (dmargin f mu) y = psum (fun x => (f x == y)%:R * mu x).
716+ (dmargin f mu) y = PosSum. psum (fun x => (f x == y)%:R * mu x).
717717Proof .
718718rewrite dmarginE dletE; apply/eq_psum => x //=.
719719by rewrite mulrC dunit1E.
@@ -812,7 +812,7 @@ Section DFst.
812812Context {R : realType} {T U : choiceType}.
813813
814814Lemma dfstE (mu : {distr (T * U) / R}) x :
815- dfst mu x = psum (fun y => mu (x, y)).
815+ dfst mu x = PosSum. psum (fun y => mu (x, y)).
816816Proof .
817817rewrite dmargin_psumE /=; pose h y : T * U := (x, y).
818818rewrite (reindex_psum (P := [pred z | z.1 == x]) (h := h)) /=.
@@ -837,7 +837,7 @@ Section DSnd.
837837Context {R : realType} {T U : choiceType}.
838838
839839Lemma __deprecated__dsndE (mu : {distr (T * U) / R}) y :
840- dsnd mu y = psum (fun x => mu (x, y)).
840+ dsnd mu y = PosSum. psum (fun x => mu (x, y)).
841841Proof . by rewrite -__deprecated__dfst_dswap dfstE; apply/eq_psum=> x; rewrite dswapE. Qed .
842842
843843Lemma summable_snd (mu : {distr (T * U) / R}) y :
878878Lemma pr_exp mu (E : pred T) : \P_[mu] E = \E_[mu] (fun m => (E m)%:R).
879879Proof . by rewrite /pr psum_sum // => x; rewrite mulr_ge0 // ler0n. Qed .
880880
881- Lemma pr_predT mu : \P_[mu] predT = psum mu.
881+ Lemma pr_predT mu : \P_[mu] predT = PosSum. psum mu.
882882Proof . by apply/eq_psum=> x; rewrite mul1r. Qed .
883883
884884Lemma pr_dunit E x : \P_[dunit x] E = (E x)%:R :> R.
@@ -963,7 +963,7 @@ Proof.
963963rewrite /esp -psum_sum => [x|]; first by rewrite mulr_ge0 ?ge0_pr.
964964rewrite /pr; unlock dlet => /=; rewrite /mlet /=.
965965pose F x y := (E x)%:R * (mu y * f y x).
966- transitivity (psum (fun x => psum (fun y => F x y))); rewrite {}/F.
966+ transitivity (PosSum. psum (fun x => PosSum. psum (fun y => F x y))); rewrite {}/F.
967967 by apply/eq_psum => x; rewrite -psumZ ?ler0n.
968968rewrite __admitted__interchange_psum /=; last first.
969969 apply/eq_psum=> y /=; rewrite mulrC -psumZ //.
@@ -1048,7 +1048,7 @@ by move/ler_pdivrMr=> ->; rewrite mul1r le_in_pr // => x _ /andP[].
10481048Qed .
10491049
10501050Lemma prc_sum A mu : 0 < \P_[mu] A ->
1051- psum (fun x => \P_[mu, A] (pred1 x)) = 1.
1051+ PosSum. psum (fun x => \P_[mu, A] (pred1 x)) = 1.
10521052Proof .
10531053move=> gt0_pE; rewrite psumZr ?(invr_ge0, ge0_pr) //.
10541054rewrite (eq_psum (F2 := (fun x => (A x)%:R * mu x))); last first.
@@ -1264,5 +1264,3 @@ End Jensen.
12641264End Jensen.
12651265
12661266Notation convex f := (convexon \-inf \+inf f).
1267-
1268- (* -------------------------------------------------------------------- *)
0 commit comments