@@ -15,24 +15,39 @@ Require Import exp numfun lebesgue_measure lebesgue_integral kernel.
1515(* the type probability T R (a measure that sums to 1). *)
1616(* *)
1717(* ``` *)
18- (* {RV P >-> R} == real random variable: a measurable function from *)
19- (* the measurableType of the probability P to R *)
20- (* distribution P X == measure image of the probability measure P by the *)
21- (* random variable X : {RV P -> R} *)
22- (* P as type probability T R with T of type *)
23- (* measurableType. *)
24- (* Declared as an instance of probability measure. *)
25- (* 'E_P[X] == expectation of the real measurable function X *)
26- (* covariance X Y == covariance between real random variable X and Y *)
27- (* 'V_P[X] == variance of the real random variable X *)
28- (* mmt_gen_fun X == moment generating function of the random variable *)
29- (* X *)
30- (* {dmfun T >-> R} == type of discrete real-valued measurable functions *)
31- (* {dRV P >-> R} == real-valued discrete random variable *)
32- (* dRV_dom X == domain of the discrete random variable X *)
33- (* dRV_enum X == bijection between the domain and the range of X *)
34- (* pmf X r := fine (P (X @^-1` [set r])) *)
35- (* enum_prob X k == probability of the kth value in the range of X *)
18+ (* {RV P >-> R} == real random variable: a measurable function from *)
19+ (* the measurableType of the probability P to R *)
20+ (* distribution P X == measure image of the probability measure P by the *)
21+ (* random variable X : {RV P -> R} *)
22+ (* P as type probability T R with T of type *)
23+ (* measurableType. *)
24+ (* Declared as an instance of probability measure. *)
25+ (* 'E_P[X] == expectation of the real measurable function X *)
26+ (* covariance X Y == covariance between real random variable X and Y *)
27+ (* 'V_P[X] == variance of the real random variable X *)
28+ (* mmt_gen_fun X == moment generating function of the random variable *)
29+ (* X *)
30+ (* {dmfun T >-> R} == type of discrete real-valued measurable functions *)
31+ (* {dRV P >-> R} == real-valued discrete random variable *)
32+ (* dRV_dom X == domain of the discrete random variable X *)
33+ (* dRV_enum X == bijection between the domain and the range of X *)
34+ (* pmf X r := fine (P (X @^-1` [set r])) *)
35+ (* enum_prob X k == probability of the kth value in the range of X *)
36+ (* ``` *)
37+ (* *)
38+ (* ``` *)
39+ (* bernoulli_pmf p == Bernoulli pmf *)
40+ (* bernoulli p == Bernoulli probability measure when 0 <= p <= 1 *)
41+ (* and \d_false otherwise *)
42+ (* binomial_pmf n p == binomial pmf *)
43+ (* binomial_prob n p == binomial probability measure when 0 <= p <= 1 *)
44+ (* and \d_0%N otherwise *)
45+ (* bin_prob n k p == $\binom{n}{k}p^k (1-p)^(n-k)$ *)
46+ (* Computes a binomial distribution term for *)
47+ (* k successes in n trials with success rate p *)
48+ (* uniform_pdf a b == uniform pdf *)
49+ (* uniform_prob a b ab == uniform probability over the interval [a,b] *)
50+ (* with ab0 a proof that 0 < b - a *)
3651(* ``` *)
3752(* *)
3853(***************************************************************************** *)
@@ -829,39 +844,6 @@ Qed.
829844
830845End discrete_distribution.
831846
832- (* TODO: move *)
833- Lemma onem_nonneg_proof (R : numDomainType) (p : {nonneg R}) :
834- (p%:num <= 1 -> 0 <= `1-(p%:num))%R.
835- Proof . by rewrite /onem/= subr_ge0. Qed .
836-
837- Definition onem_nonneg (R : numDomainType) (p : {nonneg R})
838- (p1 : (p%:num <= 1)%R) :=
839- NngNum (onem_nonneg_proof p1).
840-
841- Lemma nneseries_sum_bigcup {R : realType} (T : choiceType) (F : (set T)^nat)
842- (f : T -> \bar R) : trivIset [set: nat] F -> (forall i, 0 <= f i)%E ->
843- (\esum_(i in \bigcup_n F n) f i = \sum_(0 <= i <oo) (\esum_(j in F i) f j))%E.
844- Proof .
845- move=> tF f0; rewrite esum_bigcupT// nneseries_esum//; last first.
846- by move=> k _; exact: esum_ge0.
847- by rewrite fun_true; apply: eq_esum => /= i _.
848- Qed .
849-
850- Lemma measurable_fun_pow {R : realType} D (f : R -> R) n : measurable_fun D f ->
851- measurable_fun D (fun x => f x ^+ n).
852- Proof .
853- move=> mf.
854- apply: (@measurable_comp _ _ _ _ _ _ setT (fun x : R => x ^+ n) _ f) => //.
855- Qed .
856-
857- Lemma measurable_natmul {R : realType} D n :
858- measurable_fun D ((@GRing.natmul R)^~ n).
859- Proof .
860- under eq_fun do rewrite -mulr_natr.
861- by do 2 apply: measurable_funM => //.
862- Qed .
863- (* /TODO: move *)
864-
865847Section bernoulli_pmf.
866848Context {R : realType} (p : R).
867849Local Open Scope ring_scope.
0 commit comments