Skip to content

Commit 19aae45

Browse files
add poisson distribution (#1668)
* add poisson_prob --------- Co-authored-by: Reynald Affeldt <reynald.affeldt@aist.go.jp>
1 parent d8087fd commit 19aae45

10 files changed

Lines changed: 145 additions & 44 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@
101101

102102
- in `lebesgue_integral_nonneg.v`:
103103
+ lemma `ge0_integral_ereal_sup` (was a `Let`)
104+
- in `esum.v`:
105+
+ lemma `nneseries_esumT`
106+
107+
- in `probability.v`:
108+
+ Definition `poisson_pmf`, `poisson_prob`
109+
+ lemmas `poisson_pmf_ge0`, `measurable_poisson_pmf`,
110+
`measurable_poisson_prob`
111+
+ instance `poisson_prob`
104112

105113
### Changed
106114

@@ -186,6 +194,12 @@
186194
- in `constructive_ereal.v`:
187195
+ lemmas `div1e`, `divee`, `inve_eq1`, `Nyconjugate`
188196

197+
- in `measure.v`:
198+
+ change the implicit arguments of lemma `measurability`
199+
200+
- in `sequences.v`:
201+
+ change the implicit arguments of lemma `is_cvg_series_exp_coeff`
202+
189203
### Changed
190204

191205
- in `measure.v`:

theories/esum.v

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ rewrite fsbig_finite//= -(big_rmcond_in P)/=; first exact: lee_sum_fset_lim.
324324
by move=> k; rewrite in_fset_set// inE => /PF ->.
325325
Qed.
326326

327+
Lemma nneseries_esumT {R : realType} (a : nat -> \bar R) :
328+
(forall n, 0 <= a n) -> \sum_(i <oo) a i = \esum_(i in [set: nat]) a i.
329+
Proof. by move=> a0; rewrite nneseries_esum// set_true. Qed.
330+
327331
Lemma reindex_esum (R : realType) (T T' : choiceType)
328332
(P : set T) (Q : set T') (e : T -> T') (a : T' -> \bar R) :
329333
set_bij P Q e ->

theories/kernel.v

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,12 @@ have kE i : k i x U = \sum_(j <oo) p i j x U.
448448
transitivity (\esum_(l in [set: nat] `*` [set: nat]) p l.1 l.2 x U).
449449
rewrite (_ : _ `*` _ = setT `*`` (fun=> setT)); last by apply/seteqP; split.
450450
rewrite -(@esum_esum _ _ _ _ _ (fun i j => p i j x U))//.
451-
rewrite nneseries_esum// -fun_true; apply: eq_esum => i _.
452-
by rewrite kE// nneseries_esum.
451+
rewrite nneseries_esumT//; apply: eq_esum => i _.
452+
by rewrite kE// nneseries_esumT.
453453
rewrite (reindex_esum [set: nat] _ f)//; last first.
454454
have := @bijTT _ _ f.
455455
by rewrite -setTT_bijective/= -[in X in set_bij _ X _ -> _](@setXTT nat nat).
456-
by rewrite nneseries_esum// fun_true; exact: eq_esum.
456+
by rewrite nneseries_esumT//; exact: eq_esum.
457457
Qed.
458458

459459
HB.instance Definition _ :=
@@ -795,7 +795,7 @@ Let measurable_fun_kprobability U : measurable U ->
795795
measurable_fun [set: X] (kprobability mP ^~ U).
796796
Proof.
797797
move=> mU.
798-
apply: (measurability (ErealGenInftyO.measurableE R)) => _ /= -[_ [r ->] <-].
798+
apply: (measurability _ (ErealGenInftyO.measurableE R)) => _ /= -[_ [r ->] <-].
799799
rewrite setTI preimage_itvNyo -/(P @^-1` mset U r).
800800
have [r0|r0] := leP 0%R r; last by rewrite lt0_mset// preimage_set0.
801801
have [r1|r1] := leP r 1%R; last by rewrite gt1_mset// preimage_setT.
@@ -930,8 +930,7 @@ Lemma measurable_fun_mnormalize d d' (X : measurableType d)
930930
(Y : measurableType d') (R : realType) (k : R.-ker X ~> Y) :
931931
measurable_fun [set: X] (fun x => mnormalize (k x) point : pprobability Y R).
932932
Proof.
933-
apply: (@measurability _ _ _ _ _ _
934-
(@pset _ _ _ : set (set (pprobability Y R)))) => //.
933+
apply: (measurability (@pset _ _ _ : set (set (pprobability Y R)))) => //.
935934
move=> _ -[_ [r r01] [Ys mYs <-]] <-.
936935
rewrite /mnormalize /mset /preimage/=.
937936
apply: emeasurable_fun_infty_o => //.
@@ -1061,7 +1060,7 @@ have [kl hkl] : exists kl : (R.-fker X ~> Z) ^nat, forall x U,
10611060
have /ppcard_eqP[f] : ([set: nat] #= [set: nat * nat])%card.
10621061
by rewrite card_eq_sym; exact: card_nat2.
10631062
exists (fun i => l_ (f i).2 \; k_ (f i).1) => x U.
1064-
by rewrite (reindex_esum [set: nat] _ f)// nneseries_esum// fun_true.
1063+
by rewrite (reindex_esum [set: nat] _ f)// nneseries_esumT.
10651064
exists kl => x U mU.
10661065
transitivity ((kseries l_ \; kseries k_) x U).
10671066
rewrite /= /kcomp [in RHS](eq_measure_integral (l x)); last first.
@@ -1075,8 +1074,8 @@ transitivity (\sum_(i <oo) \sum_(j <oo) (l_ j \; k_ i) x U).
10751074
rewrite /mseries -hkl/=.
10761075
rewrite (_ : setT = setT `*`` (fun=> setT)); last by apply/seteqP; split.
10771076
rewrite -(@esum_esum _ _ _ _ _ (fun i j => (l_ j \; k_ i) x U))//.
1078-
rewrite nneseries_esum; last by move=> n _; exact: nneseries_ge0.
1079-
by rewrite fun_true; apply: eq_esum => /= i _; rewrite nneseries_esum// fun_true.
1077+
rewrite nneseries_esumT; last by move=> *; exact: nneseries_ge0.
1078+
by apply: eq_esum => /= i _; rewrite nneseries_esumT.
10801079
Qed.
10811080

10821081
Lemma measurable_fun_mkcomp_sfinite U : measurable U ->

theories/lebesgue_integral_theory/lebesgue_integral_nonneg.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ Lemma ae_measurable_fun : ae_eq mu D f g ->
11571157
measurable_fun D f -> measurable_fun D g.
11581158
Proof.
11591159
move=> [N [mN N0 subN]] mf B mB mD.
1160-
apply: (measurability (ErealGenOInfty.measurableE R)) => // _ [_ [x ->] <-].
1160+
apply: (measurability _ (ErealGenOInfty.measurableE R)) => // _ [_ [x ->] <-].
11611161
rewrite [X in measurable X](_ : _ = D `&` ~` N `&` (f @^-1` `]x%:E, +oo[)
11621162
`|` (D `&` N `&` g @^-1` `]x%:E, +oo[)); last first.
11631163
apply/seteqP; split=> [y /= [Dy gyxoo]|y /= [[[Dy Ny] fyxoo]|]].

theories/lebesgue_measure.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ have finite_set_F i : finite_set (F i).
11741174
exact/(@bigcup_sup _ _ _ _ (closure \o B))/CsubFi.
11751175
have Fir2 : mu (\bigcup_(j in F i) closure (B j)) <=
11761176
mu (ball (0:R) (r%:num + 2))%R.
1177-
rewrite (le_trans _ EBr2)// -(set_mem_set E) -nneseries_esum //.
1177+
rewrite (le_trans _ EBr2)// -(set_mem_set E) -nneseries_esum//.
11781178
rewrite E_partition -measure_bigcup//=; last 2 first.
11791179
by move=> ? _; exact: measurable_closure.
11801180
apply: trivIset_bigcup => //.
@@ -1207,7 +1207,7 @@ have FE : \sum_(n <oo) \esum_(i in F n) mu (closure (B i)) =
12071207
by apply/(trivIset_mkcond _ _).1; apply: sub_trivIset tDB => x [[]].
12081208
rewrite -bigcup_mkcond; apply: bigcup_measurable => k _.
12091209
exact: measurable_closure.
1210-
rewrite esum_mkcond//= nneseries_esum// -fun_true//=.
1210+
rewrite esum_mkcond//= nneseries_esumT//.
12111211
by under eq_esum do rewrite (fun_if mu) (measure0 mu).
12121212
apply/eqP; rewrite -measure_le0.
12131213
apply/lee_addgt0Pr => _ /posnumP[e]; rewrite add0e.

theories/measurable_realfun.v

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ Qed.
860860
Lemma subspace_continuous_measurable_fun (D : set R) (f : subspace D -> R) :
861861
measurable D -> continuous f -> measurable_fun D f.
862862
Proof.
863-
move=> mD /continuousP cf; apply: (measurability (RGenOpens.measurableE R)).
863+
move=> mD /continuousP cf; apply: (measurability _ (RGenOpens.measurableE R)).
864864
move=> _ [_ [a [b ->] <-]]; apply: open_measurable_subspace => //.
865865
exact/cf/interval_open.
866866
Qed.
@@ -883,7 +883,7 @@ End coutinuous_measurable.
883883
Lemma lower_semicontinuous_measurable {R : realType} (f : R -> \bar R) :
884884
lower_semicontinuous f -> measurable_fun setT f.
885885
Proof.
886-
move=> scif; apply: (measurability (ErealGenOInfty.measurableE R)).
886+
move=> scif; apply: (measurability _ (ErealGenOInfty.measurableE R)).
887887
move=> /= _ [_ [a ->]] <-; apply: measurableI => //; apply: open_measurable.
888888
by rewrite preimage_itvoy; move/lower_semicontinuousP : scif; exact.
889889
Qed.
@@ -900,7 +900,7 @@ Qed.
900900

901901
Lemma normr_measurable D : measurable_fun D (@normr _ R).
902902
Proof.
903-
move=> mD; apply: (measurability (RGenOInfty.measurableE R)) => //.
903+
move=> mD; apply: (measurability _ (RGenOInfty.measurableE R)) => //.
904904
move=> /= _ [_ [x ->] <-]; apply: measurableI => //.
905905
have [x0|x0] := leP 0 x.
906906
rewrite [X in measurable X](_ : _ = `]-oo, (- x)[ `|` `]x, +oo[)%classic.
@@ -962,7 +962,7 @@ Implicit Types (D : set T) (f g : T -> R).
962962
Lemma measurable_funD D f g :
963963
measurable_fun D f -> measurable_fun D g -> measurable_fun D (f \+ g).
964964
Proof.
965-
move=> mf mg mD; apply: (measurability (RGenOInfty.measurableE R)) => //.
965+
move=> mf mg mD; apply: (measurability _ (RGenOInfty.measurableE R)) => //.
966966
move=> /= _ [_ [a ->] <-]; rewrite preimage_itvoy.
967967
rewrite [X in measurable X](_ : _ = \bigcup_(q : rat)
968968
((D `&` [set x | ratr q < f x]) `&` (D `&` [set x | a - ratr q < g x]))).
@@ -1042,7 +1042,7 @@ Lemma measurable_fun_sups D (h : (T -> R)^nat) n :
10421042
(forall m, measurable_fun D (h m)) ->
10431043
measurable_fun D (fun x => sups (h ^~ x) n).
10441044
Proof.
1045-
move=> f_ub mf mD; apply: (measurability (RGenOInfty.measurableE R)) => //.
1045+
move=> f_ub mf mD; apply: (measurability _ (RGenOInfty.measurableE R)) => //.
10461046
move=> _ [_ [x ->] <-]; rewrite sups_preimage // setI_bigcupr.
10471047
by apply: bigcup_measurable => k /= nk; apply: mf => //; exact: measurable_itv.
10481048
Qed.
@@ -1052,7 +1052,7 @@ Lemma measurable_fun_infs D (h : (T -> R)^nat) n :
10521052
(forall n, measurable_fun D (h n)) ->
10531053
measurable_fun D (fun x => infs (h ^~ x) n).
10541054
Proof.
1055-
move=> lb_f mf mD; apply: (measurability (RGenInftyO.measurableE R)) =>//.
1055+
move=> lb_f mf mD; apply: (measurability _ (RGenInftyO.measurableE R)) => //.
10561056
move=> _ [_ [x ->] <-]; rewrite infs_preimage // setI_bigcupr.
10571057
by apply: bigcup_measurable => k /= nk; apply: mf => //; exact: measurable_itv.
10581058
Qed.
@@ -1228,7 +1228,7 @@ Implicit Types (D : set T) (f g : T -> nat).
12281228
Lemma measurable_fun_addn D f g : measurable_fun D f -> measurable_fun D g ->
12291229
measurable_fun D (fun x => f x + g x)%N.
12301230
Proof.
1231-
move=> mf mg mD; apply: (measurability NGenCInfty.measurableE) => //.
1231+
move=> mf mg mD; apply: (measurability _ NGenCInfty.measurableE) => //.
12321232
move=> /= _ [_ [a ->] <-]; rewrite preimage_itvcy.
12331233
rewrite [X in measurable X](_ : _ = \bigcup_q
12341234
((D `&` [set x | q <= f x]%O) `&` (D `&` [set x | (a - q)%N <= g x]%O))).
@@ -1247,7 +1247,7 @@ Qed.
12471247
Lemma measurable_fun_maxn D f g : measurable_fun D f -> measurable_fun D g ->
12481248
measurable_fun D (fun x => maxn (f x) (g x)).
12491249
Proof.
1250-
move=> mf mg mD; apply: (measurability NGenCInfty.measurableE) => //.
1250+
move=> mf mg mD; apply: (measurability _ NGenCInfty.measurableE) => //.
12511251
move=> /= _ [_ [a ->] <-]; rewrite [X in measurable X](_ : _ =
12521252
((D `&` [set x | a <= f x]%O) `|` (D `&` [set x | a <= g x]%O))).
12531253
apply: measurableU.
@@ -1266,7 +1266,7 @@ Let measurable_fun_subn' D f g : (forall t, g t <= f t)%N ->
12661266
measurable_fun D f -> measurable_fun D g ->
12671267
measurable_fun D (fun x => f x - g x)%N.
12681268
Proof.
1269-
move=> gf mf mg mD; apply: (measurability NGenCInfty.measurableE) => //.
1269+
move=> gf mf mg mD; apply: (measurability _ NGenCInfty.measurableE) => //.
12701270
move=> /= _ [_ [a ->] <-]; rewrite preimage_itvcy.
12711271
rewrite [X in measurable X](_ : _ = \bigcup_q
12721272
((D `&` [set x | maxn a q <= f x]%O) `&`
@@ -1366,14 +1366,14 @@ Variable R : realType.
13661366

13671367
Lemma EFin_measurable (D : set R) : measurable_fun D EFin.
13681368
Proof.
1369-
move=> mD; apply: (measurability (ErealGenOInfty.measurableE R)) => //.
1369+
move=> mD; apply: (measurability _ (ErealGenOInfty.measurableE R)) => //.
13701370
move=> /= _ [_ [x ->]] <-; apply: measurableI => //.
13711371
by rewrite preimage_itvoy EFin_itv; exact: measurable_itv.
13721372
Qed.
13731373

13741374
Lemma abse_measurable (D : set (\bar R)) : measurable_fun D abse.
13751375
Proof.
1376-
move=> mD; apply: (measurability (ErealGenOInfty.measurableE R)) => //.
1376+
move=> mD; apply: (measurability _ (ErealGenOInfty.measurableE R)) => //.
13771377
move=> /= _ [_ [x ->] <-].
13781378
rewrite [X in _ @^-1` X](punct_eitv_bndy _ x) preimage_setU setIUr.
13791379
apply: measurableU; last first.
@@ -1390,7 +1390,7 @@ Qed.
13901390
Lemma oppe_measurable (D : set (\bar R)) :
13911391
measurable_fun D (-%E : \bar R -> \bar R).
13921392
Proof.
1393-
move=> mD; apply: (measurability (ErealGenCInfty.measurableE R)) => //.
1393+
move=> mD; apply: (measurability _ (ErealGenCInfty.measurableE R)) => //.
13941394
move=> _ [_ [x ->] <-]; rewrite (_ : _ @^-1` _ = `]-oo, (- x)%:E]%classic).
13951395
by apply: measurableI => //; exact: emeasurable_itv.
13961396
by rewrite predeqE => y; rewrite preimage_itv !in_itv/= andbT in_itv leeNr.
@@ -1452,7 +1452,7 @@ Lemma measurable_fun_einfs D (f : (T -> \bar R)^nat) :
14521452
forall n, measurable_fun D (fun x => einfs (f ^~ x) n).
14531453
Proof.
14541454
move=> mf n mD.
1455-
apply: (measurability (ErealGenCInfty.measurableE R)) => //.
1455+
apply: (measurability _ (ErealGenCInfty.measurableE R)) => //.
14561456
move=> _ [_ [x ->] <-]; rewrite einfs_preimage -bigcapIr; last by exists n =>/=.
14571457
by apply: bigcap_measurableType => ? ?; exact/mf/emeasurable_itv.
14581458
Qed.
@@ -1461,7 +1461,7 @@ Lemma measurable_fun_esups D (f : (T -> \bar R)^nat) :
14611461
(forall n, measurable_fun D (f n)) ->
14621462
forall n, measurable_fun D (fun x => esups (f ^~ x) n).
14631463
Proof.
1464-
move=> mf n mD; apply: (measurability (ErealGenOInfty.measurableE R)) => //.
1464+
move=> mf n mD; apply: (measurability _ (ErealGenOInfty.measurableE R)) => //.
14651465
move=> _ [_ [x ->] <-];rewrite esups_preimage setI_bigcupr.
14661466
by apply: bigcup_measurable => ? ?; exact/mf/emeasurable_itv.
14671467
Qed.
@@ -1470,7 +1470,7 @@ Lemma measurable_maxe D (f g : T -> \bar R) :
14701470
measurable_fun D f -> measurable_fun D g ->
14711471
measurable_fun D (fun x => maxe (f x) (g x)).
14721472
Proof.
1473-
move=> mf mg mD; apply: (measurability (ErealGenCInfty.measurableE R)) => //.
1473+
move=> mf mg mD; apply: (measurability _ (ErealGenCInfty.measurableE R)) => //.
14741474
move=> _ [_ [x ->] <-]; rewrite [X in measurable X](_ : _ =
14751475
(D `&` f @^-1` `[x%:E, +oo[) `|` (D `&` g @^-1` `[x%:E, +oo[)); last first.
14761476
rewrite predeqE => t /=; split.

theories/measure.v

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,7 @@ Notation sigma_algebra_image_class := sigma_algebra_image (only parsing).
18501850

18511851
#[deprecated(since="mathcomp-analysis 1.9.0", note="renamed to `g_sigma_preimageE`")]
18521852
Notation sigma_algebra_preimage_classE := g_sigma_preimageE (only parsing).
1853+
Arguments measurability {d d' aT rT D f} _.
18531854

18541855
Local Open Scope ereal_scope.
18551856

@@ -2463,9 +2464,7 @@ Let mseries0 : mseries set0 = 0.
24632464
Proof. by rewrite /mseries ereal_series eseries0. Qed.
24642465

24652466
Let mseries_ge0 B : 0 <= mseries B.
2466-
Proof.
2467-
by rewrite /mseries ereal_series nneseries_esum//; exact: esum_ge0.
2468-
Qed.
2467+
Proof. by rewrite /mseries ereal_series nneseries_esum//; exact: esum_ge0. Qed.
24692468

24702469
Let mseries_sigma_additive : semi_sigma_additive mseries.
24712470
Proof.
@@ -3198,7 +3197,7 @@ rewrite esum_bigcup//; last first.
31983197
move=> /(decomp_neq0 DUBiN0) [y Yy].
31993198
apply: (@trivIset_seqDU _ B) => //; exists y.
32003199
by split => //; [exact: YBi|exact: YBj].
3201-
rewrite nneseries_esum// set_true le_esum// => i _.
3200+
rewrite nneseries_esumT// le_esum// => i _.
32023201
rewrite [leLHS](_ : _ = \sum_(j \in decomp (seqDU B i)) mu j); last first.
32033202
by rewrite esum_fset//; exact: decomp_finite_set.
32043203
rewrite -SetRing.Rmu_fin_bigcup//=; last 3 first.
@@ -4939,7 +4938,7 @@ pose g i := (f^-1%FUN i).2; exists g; first split.
49394938
exact: decomp_measurable.
49404939
- move=> i /XS [k _]; rewrite -[F k]cover_decomp => -[D /= DFk Di].
49414940
by exists (f (k, D)) => //; rewrite /g invK// inE.
4942-
rewrite !nneseries_esum//= /measure ?set_true.
4941+
rewrite !nneseries_esumT//= /measure.
49434942
transitivity (\esum_(i in setT) \sum_(X0 \in decomp (F i)) mu X0); last first.
49444943
by apply: eq_esum => /= k _; rewrite fsbig_finite//; exact: decomp_finite_set.
49454944
rewrite -(eq_esum (fun _ _ => esum_fset _ _))//; last first.

0 commit comments

Comments
 (0)