Skip to content

Commit 029d3ca

Browse files
committed
changelog & doc
1 parent 36e280d commit 029d3ca

File tree

5 files changed

+96
-51
lines changed

5 files changed

+96
-51
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,37 @@
3434
- in `normedtype.v`:
3535
+ lemma `not_near_at_leftP`
3636

37+
- in `lebesgue_measure.v`:
38+
+ lemma `measurable_fun_ler`
39+
40+
- in `measure.v`:
41+
+ lemmas `measurable_fun_TF`, `measurable_and`
42+
43+
- in `signed.v`:
44+
+ lemma `onem_nonneg_proof`, definition `onem_nonneg`
45+
46+
- in `esum.v`:
47+
+ lemma `nneseries_sum_bigcup`
48+
49+
- in `lebesgue_measurable.v`:
50+
+ lemmas `measurable_natmul`, `measurable_fun_pow`
51+
52+
- in `probability.v`:
53+
+ definition `bernoulli_pmf`
54+
+ lemmas `bernoulli_pmf_ge0`, `bernoulli_pmf1`, `measurable_bernoulli_pmf`
55+
+ definition `bernoulli` (equipped with the `probability` structure)
56+
+ lemmas `bernoulli_dirac`, `bernoulliE`, `integral_bernoulli`, `measurable_bernoulli`,
57+
`measurable_bernoulli2`
58+
+ definition `binomial_pmf`
59+
+ lemmas `binomial_pmf_ge0`, `measurable_binomial_pmf`
60+
+ definitions `binomial_prob` (equipped with the `probability` structure), `bin_prob`
61+
+ lemmas `bin_prob0`, `bin_prob1`, `binomial_msum`, `binomial_probE`, `integral_binomial`,
62+
`integral_binomial_prob`, `measurable_binomial_prob`
63+
+ definition `uniform_pdf`
64+
+ lemmas `measurable_uniform_pdf`, `integral_uniform_pdf`, `integral_uniform_pdf1`
65+
+ definition `uniform_prob` (equipped with the `probability` structure)
66+
+ lemmas `dominates_uniform_prob`, `integral_uniform`
67+
3768
### Changed
3869

3970
- in `forms.v`:
@@ -110,6 +141,9 @@
110141
(from `measurableType` to `semiRingOfSetsType`)
111142
+ lemmas ` measurable_prod_measurableType`, `measurable_prod_g_measurableTypeR` (from `measurableType` to `algebraOfSetsType`)
112143

144+
- in `lebesgue_integral.v`:
145+
+ lemma `ge0_emeasurable_fun_sum`
146+
113147
### Deprecated
114148

115149
- in `classical_sets.v`:

theories/esum.v

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,15 @@ End esum_bigcup.
451451
Arguments esum_bigcupT {R T K} J a.
452452
Arguments esum_bigcup {R T K} J a.
453453

454+
Lemma nneseries_sum_bigcup {R : realType} (T : choiceType) (F : (set T)^nat)
455+
(f : T -> \bar R) : trivIset [set: nat] F -> (forall i, 0 <= f i)%E ->
456+
(\esum_(i in \bigcup_n F n) f i = \sum_(0 <= i <oo) (\esum_(j in F i) f j))%E.
457+
Proof.
458+
move=> tF f0; rewrite esum_bigcupT// nneseries_esum//; last first.
459+
by move=> k _; exact: esum_ge0.
460+
by rewrite fun_true; apply: eq_esum => /= i _.
461+
Qed.
462+
454463
Definition summable (T : choiceType) (R : realType) (D : set T)
455464
(f : T -> \bar R) := (\esum_(x in D) `| f x | < +oo)%E.
456465

theories/lebesgue_measure.v

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,20 @@ Proof. by apply: continuous_measurable_fun; exact: continuous_expR. Qed.
16861686
#[global] Hint Extern 0 (measurable_fun _ expR) =>
16871687
solve [apply: measurable_expR] : core.
16881688

1689+
Lemma measurable_natmul {R : realType} D n :
1690+
measurable_fun D ((@GRing.natmul R)^~ n).
1691+
Proof.
1692+
under eq_fun do rewrite -mulr_natr.
1693+
by do 2 apply: measurable_funM => //.
1694+
Qed.
1695+
1696+
Lemma measurable_fun_pow {R : realType} D (f : R -> R) n : measurable_fun D f ->
1697+
measurable_fun D (fun x => f x ^+ n).
1698+
Proof.
1699+
move=> mf.
1700+
exact: (@measurable_comp _ _ _ _ _ _ setT (fun x : R => x ^+ n) _ f).
1701+
Qed.
1702+
16891703
Lemma measurable_powR (R : realType) p :
16901704
measurable_fun [set: R] (@powR R ^~ p).
16911705
Proof.

theories/probability.v

Lines changed: 33 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -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

830845
End 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-
865847
Section bernoulli_pmf.
866848
Context {R : realType} (p : R).
867849
Local Open Scope ring_scope.

theories/signed.v

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,4 +1225,10 @@ Lemma onemX_NngNum r (r1 : r <= 1) (r0 : 0 <= r) n :
12251225
`1-(r ^+ n) = (NngNum (onemX_ge0 n r0 r1))%:num.
12261226
Proof. by []. Qed.
12271227

1228+
Lemma onem_nonneg_proof (p : {nonneg R}) : p%:num <= 1 -> 0 <= `1-(p%:num).
1229+
Proof. by rewrite /onem/= subr_ge0. Qed.
1230+
1231+
Definition onem_nonneg (p : {nonneg R}) (p1 : p%:num <= 1) :=
1232+
NngNum (onem_nonneg_proof p1).
1233+
12281234
End onem_signed.

0 commit comments

Comments
 (0)