@@ -3,6 +3,7 @@ From mathcomp Require Import all_ssreflect all_algebra finmap.
33From mathcomp.classical Require Import boolp classical_sets functions.
44From mathcomp.classical Require Import cardinality fsbigop mathcomp_extra.
55Require Import reals ereal signed topology normedtype sequences esum numfun.
6+ Require Import itv.
67From HB Require Import structures.
78
89(***************************************************************************** *)
@@ -137,6 +138,7 @@ From HB Require Import structures.
137138(* probability T R == probability measure over the measurableType T with *)
138139(* value in R : realType *)
139140(* Measure_isProbability == factor for probability measures *)
141+ (* bernoulli p == the p-Bernoulli probability where p : {i01 R} *)
140142(* *)
141143(* mu.-negligible A == A is mu negligible *)
142144(* {ae mu, forall x, P x} == P holds almost everywhere for the measure mu, *)
@@ -2826,6 +2828,26 @@ HB.instance Definition _ x :=
28262828
28272829End pdirac.
28282830
2831+ Section bernoulli.
2832+ Variables (R : realType) (p : {i01 R}).
2833+
2834+ Definition bernoulli : set _ -> \bar R := measure_add
2835+ (mscale (NngNum (itv_ge0 p)) (dirac true))
2836+ (mscale (NngNum (itv_ge0 ((`1-(p%:inum))%:i01))) (dirac false)).
2837+
2838+ HB.instance Definition _ := Measure.on bernoulli.
2839+
2840+ Let bernoulli_setT : bernoulli [set: _] = 1.
2841+ Proof .
2842+ rewrite /bernoulli/= /measure_add/= /msum 2!big_ord_recr/= big_ord0 add0e/=.
2843+ by rewrite /mscale/= !diracT !mule1 -EFinD add_onemK.
2844+ Qed .
2845+
2846+ HB.instance Definition _ :=
2847+ @Measure_isProbability.Build _ _ R bernoulli bernoulli_setT.
2848+
2849+ End bernoulli.
2850+
28292851Lemma sigma_finite_counting (R : realType) :
28302852 sigma_finite [set: nat] (@counting _ R).
28312853Proof .
0 commit comments