Skip to content

Commit c8adb03

Browse files
Chernoff bound (#1053)
* chernoff proof --------- Co-authored-by: Reynald Affeldt <[email protected]>
1 parent 3ebe91a commit c8adb03

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
+ definition `lebesgue_stieltjes_measure`
3636
- in `mathcomp_extra.v`
3737
+ lemmas `ge0_ler_normr`, `gt0_ler_normr`, `le0_ger_normr` and `lt0_ger_normr`
38+
39+
- in `probability.v`:
40+
+ definition `mmt_gen_fun`, `chernoff`
41+
42+
- in `lebesgue_integral.v`:
43+
+ `mfun` instances for `expR` and `comp`
3844

3945
### Changed
4046

@@ -62,6 +68,9 @@
6268
+ notations `_.-ocitv`, `_.-ocitv.-measurable`
6369
+ definitions `ocitv`, `ocitv_display`
6470
+ lemmas `is_ocitv`, `ocitv0`, `ocitvP`, `ocitvD`, `ocitvI`
71+
72+
- in `probability.v`:
73+
+ `markov` now uses `Num.nneg`
6574

6675
### Renamed
6776

theories/lebesgue_integral.v

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@ Lemma mfun_cst x : @cst_mfun x =1 cst x. Proof. by []. Qed.
155155
HB.instance Definition _ := @isMeasurableFun.Build _ _ rT
156156
(@normr rT rT) (@measurable_normr rT setT).
157157

158+
HB.instance Definition _ :=
159+
isMeasurableFun.Build _ _ _ (@expR rT) (@measurable_expR rT).
160+
161+
Lemma measurableT_comp_subproof (f : {mfun _ >-> rT}) (g : {mfun aT >-> rT}) :
162+
measurable_fun setT (f \o g).
163+
Proof. apply: measurableT_comp. exact. apply: @measurable_funP _ _ _ g. Qed.
164+
165+
HB.instance Definition _ (f : {mfun _ >-> rT}) (g : {mfun aT >-> rT}) :=
166+
isMeasurableFun.Build _ _ _ (f \o g) (measurableT_comp_subproof _ _).
167+
158168
End mfun.
159169

160170
Section ring.

theories/probability.v

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ Require Import exp numfun lebesgue_measure lebesgue_integral.
2121
(* 'E_P[X] == expectation of the real measurable function X *)
2222
(* covariance X Y == covariance between real random variable X and Y *)
2323
(* 'V_P[X] == variance of the real random variable X *)
24+
(* mmt_gen_fun X == moment generating function of the random variable *)
25+
(* X *)
2426
(* {dmfun T >-> R} == type of discrete real-valued measurable functions *)
2527
(* {dRV P >-> R} == real-valued discrete random variable *)
2628
(* dRV_dom X == domain of the discrete random variable X *)
27-
(* dRV_eunm X == bijection between the domain and the range of X *)
29+
(* dRV_enum X == bijection between the domain and the range of X *)
2830
(* pmf X r := fine (P (X @^-1` [set r])) *)
2931
(* enum_prob X k == probability of the kth value in the range of X *)
3032
(* *)
@@ -511,20 +513,36 @@ Context d (T : measurableType d) (R : realType) (P : probability T R).
511513
Lemma markov (X : {RV P >-> R}) (f : R -> R) (eps : R) :
512514
(0 < eps)%R ->
513515
measurable_fun [set: R] f -> (forall r, 0 <= f r)%R ->
514-
{in `[0, +oo[%classic &, {homo f : x y / x <= y}}%R ->
516+
{in Num.nneg &, {homo f : x y / x <= y}}%R ->
515517
(f eps)%:E * P [set x | eps%:E <= `| (X x)%:E | ] <=
516518
'E_P[f \o (fun x => `| x |%R) \o X].
517519
Proof.
518520
move=> e0 mf f0 f_nd; rewrite -(setTI [set _ | _]).
519-
apply: (le_trans (@le_integral_comp_abse d T R P setT measurableT (EFin \o X)
521+
apply: (le_trans (@le_integral_comp_abse _ _ _ P _ measurableT (EFin \o X)
520522
eps (er_map f) _ _ _ _ e0)) => //=.
521523
- exact: measurable_er_map.
522524
- by case => //= r _; exact: f0.
523-
- by move=> [x| |] [y| |] xP yP xy//=; rewrite ?leey ?leNye// lee_fin f_nd.
525+
- move=> [x| |] [y| |]; rewrite !inE/= !in_itv/= ?andbT ?lee_fin ?leey//.
526+
by move=> ? ? ?; rewrite f_nd.
524527
- exact/EFin_measurable_fun.
525528
- by rewrite unlock.
526529
Qed.
527530

531+
Definition mmt_gen_fun (X : {RV P >-> R}) (t : R) := 'E_P[expR \o t \o* X].
532+
533+
Lemma chernoff (X : {RV P >-> R}) (r a : R) : (0 < r)%R ->
534+
P [set x | X x >= a]%R * (expR (r * a))%:E <= mmt_gen_fun X r.
535+
Proof.
536+
move=> t0; rewrite /mmt_gen_fun; have -> : expR \o r \o* X =
537+
(normr \o normr) \o [the {mfun T >-> R} of expR \o r \o* X].
538+
by apply: funext => t /=; rewrite normr_id ger0_norm ?expR_ge0.
539+
rewrite (le_trans _ (markov _ (expR_gt0 (r * a)) _ _ _))//; last first.
540+
exact: (monoW_in (@ger0_le_norm _)).
541+
rewrite ger0_norm ?expR_ge0// muleC lee_pmul2l// ?lte_fin ?expR_gt0//.
542+
rewrite [X in _ <= P X](_ : _ = [set x | a <= X x]%R)//; apply: eq_set => t/=.
543+
by rewrite ger0_norm ?expR_ge0// lee_fin ler_expR mulrC ler_pmul2r.
544+
Qed.
545+
528546
Lemma chebyshev (X : {RV P >-> R}) (eps : R) : (0 < eps)%R ->
529547
P [set x | (eps <= `| X x - fine ('E_P[X])|)%R ] <= (eps ^- 2)%:E * 'V_P[X].
530548
Proof.
@@ -537,7 +555,7 @@ have h (Y : {RV P >-> R}) :
537555
apply: (@le_trans _ _ ('E_P[(@GRing.exp R ^~ 2%N \o normr) \o Y])).
538556
apply: (@markov Y (@GRing.exp R ^~ 2%N)) => //.
539557
- by move=> r; apply: sqr_ge0.
540-
- move=> x y; rewrite !inE !mksetE !in_itv/= !andbT => x0 y0.
558+
- move=> x y; rewrite !nnegrE => x0 y0.
541559
by rewrite ler_sqr.
542560
apply: expectation_le => //.
543561
- by apply: measurableT_comp => //; exact: measurableT_comp.
@@ -624,7 +642,7 @@ have le (u : R) : (0 <= u)%R ->
624642
rewrite -[(_ ^+ 2)%R]/(((Y \+ cst u) ^+ 2) x)%R; over.
625643
rewrite -[X in X%:E * _]gtr0_norm => [|//].
626644
apply: (le_trans (markov _ peps _ _ _)) => //=.
627-
by move=> x y /[!inE]/= /[!in_itv]/= /[!andbT] /ger0_norm-> /ger0_norm->.
645+
by move=> x y /[!nnegrE] /ger0_norm-> /ger0_norm->.
628646
rewrite -/Y le_eqVlt; apply/orP; left; apply/eqP; congr expectation.
629647
by apply/funeqP => x /=; rewrite -expr2 normr_id ger0_norm ?sqr_ge0.
630648
pose u0 := (fine 'V_P[X] / lambda)%R.

0 commit comments

Comments
 (0)