Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bernoulli trials and central limit theorem #1184

Closed
wants to merge 112 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
3a020cc
start of chernoff proof
hoheinzollern Oct 8, 2023
7666bcf
proof completed
hoheinzollern Oct 12, 2023
4ad33ac
moment -> mgf
hoheinzollern Oct 17, 2023
fdbdae9
start
hoheinzollern Oct 26, 2023
b090078
variance
hoheinzollern Oct 26, 2023
b72c99d
note
hoheinzollern Oct 26, 2023
1091b62
sampling_lemma
hoheinzollern Oct 26, 2023
3dc02a2
wip
hoheinzollern Oct 26, 2023
588fbe6
up
hoheinzollern Oct 26, 2023
4efeb1d
start
hoheinzollern Oct 26, 2023
cc1c671
variance
hoheinzollern Oct 26, 2023
5db1fe8
note
hoheinzollern Oct 26, 2023
e9c1606
sampling_lemma
hoheinzollern Oct 26, 2023
23a3183
wip
hoheinzollern Oct 26, 2023
3087897
up
hoheinzollern Oct 26, 2023
da7832b
wip
hoheinzollern Oct 27, 2023
04225a5
up
hoheinzollern Oct 27, 2023
daf8307
Merge branch 'bernoulli' of github.com:hoheinzollern/analysis into be…
hoheinzollern Oct 27, 2023
8006c73
trying to use bernoulli measure
affeldt-aist Oct 31, 2023
eb5413d
Merge pull request #5 from affeldt-aist/bruni-bernoulli
hoheinzollern Oct 31, 2023
a5bd17c
up
hoheinzollern Oct 31, 2023
422e270
small progress
affeldt-aist Oct 31, 2023
84c7969
Merge pull request #6 from affeldt-aist/bruni-bernoulli
hoheinzollern Oct 31, 2023
6f13379
up
hoheinzollern Oct 31, 2023
b7015e2
bernoulli sqr
affeldt-aist Nov 1, 2023
481af5c
up
hoheinzollern Nov 1, 2023
512d5c4
generalize integral_distribution but it's useless
affeldt-aist Nov 1, 2023
e0d6547
cp
affeldt-aist Nov 1, 2023
cfcda28
wip
affeldt-aist Nov 1, 2023
d6692e3
wip
hoheinzollern Nov 1, 2023
77ded9a
wip
hoheinzollern Nov 1, 2023
6cc4ef7
Merge branch 'master' of https://github.com/math-comp/analysis into b…
hoheinzollern Nov 1, 2023
bc829c6
Merge branch 'bernoulli' of github.com:hoheinzollern/analysis into be…
hoheinzollern Nov 1, 2023
581ddc8
wip
hoheinzollern Nov 1, 2023
59f5f93
up
hoheinzollern Nov 1, 2023
f6f65d6
wip
hoheinzollern Nov 2, 2023
50ca26a
wip
hoheinzollern Nov 6, 2023
a8d7a7c
wip
hoheinzollern Nov 6, 2023
358d95d
wip
hoheinzollern Nov 6, 2023
ded26a8
wip
hoheinzollern Nov 7, 2023
42ce469
wip
hoheinzollern Nov 7, 2023
9aab1d0
up
hoheinzollern Nov 7, 2023
f68c778
minor progress
affeldt-aist Nov 7, 2023
5c107f2
Merge pull request #7 from affeldt-aist/bruni-bernoulli
hoheinzollern Nov 7, 2023
7b58a16
wip
hoheinzollern Nov 7, 2023
a2eb230
wip
affeldt-aist Nov 7, 2023
d422637
Merge pull request #8 from affeldt-aist/bruni-bernoulli
hoheinzollern Nov 7, 2023
a53c8b4
wip
hoheinzollern Nov 7, 2023
97d0f0f
thm25
hoheinzollern Nov 7, 2023
65a0ec0
wip
hoheinzollern Nov 7, 2023
5a01334
thm25
hoheinzollern Nov 7, 2023
51a8254
up
hoheinzollern Nov 7, 2023
8dab46f
up
hoheinzollern Nov 7, 2023
de456b7
up
hoheinzollern Nov 7, 2023
7c8e4e1
wip
affeldt-aist Nov 7, 2023
c4fc51a
Merge pull request #9 from affeldt-aist/bruni-bernoulli
hoheinzollern Nov 7, 2023
89de0e4
fix
affeldt-aist Nov 7, 2023
c95cf17
Merge pull request #10 from affeldt-aist/bruni-bernoulli
hoheinzollern Nov 7, 2023
b9f777f
up
hoheinzollern Nov 7, 2023
846ff0d
up
hoheinzollern Nov 7, 2023
7e6c79f
wip
hoheinzollern Nov 7, 2023
fce1f35
cor27
hoheinzollern Nov 7, 2023
e80ac5f
wip
hoheinzollern Nov 7, 2023
0953183
up
hoheinzollern Nov 7, 2023
1839748
up
hoheinzollern Nov 8, 2023
6a0230e
up
hoheinzollern Nov 8, 2023
3d0da3b
up
hoheinzollern Nov 8, 2023
c43c9c8
up
hoheinzollern Nov 8, 2023
4fe1a3e
up
hoheinzollern Nov 8, 2023
47c8425
up
hoheinzollern Nov 8, 2023
14e5c73
thm24
affeldt-aist Nov 8, 2023
3660d35
Merge pull request #11 from affeldt-aist/bruni-bernoulli
hoheinzollern Nov 8, 2023
8ebec47
up
hoheinzollern Nov 8, 2023
ed7176d
up
hoheinzollern Nov 8, 2023
fe479fd
refine thm26
affeldt-aist Nov 8, 2023
f09340d
Merge pull request #12 from affeldt-aist/bruni-bernoulli
hoheinzollern Nov 8, 2023
bbe6096
up
hoheinzollern Nov 8, 2023
937bb0c
up
hoheinzollern Nov 8, 2023
7c3310e
up
hoheinzollern Nov 8, 2023
c30182b
up
hoheinzollern Nov 8, 2023
e426d3b
up
hoheinzollern Nov 8, 2023
70dfa26
up
hoheinzollern Nov 8, 2023
bec5832
expR_prod
affeldt-aist Nov 8, 2023
40ec20b
Merge pull request #13 from affeldt-aist/bruni-bernoulli
hoheinzollern Nov 8, 2023
92420d4
up
hoheinzollern Nov 8, 2023
7e05525
up
hoheinzollern Nov 8, 2023
174bbb8
up
hoheinzollern Nov 8, 2023
4094b20
Merge branch 'math-comp:master' into bernoulli
hoheinzollern Nov 8, 2023
3808a91
memo
affeldt-aist Nov 9, 2023
ccb74e1
Merge pull request #14 from affeldt-aist/bruni-bernoulli
hoheinzollern Nov 9, 2023
72a9c5e
le01_expR_ge1Dx
affeldt-aist Nov 13, 2023
0c9505e
Merge pull request #15 from affeldt-aist/bruni-bernoulli
hoheinzollern Nov 13, 2023
bda7d1a
expR
hoheinzollern Nov 13, 2023
ef84448
up
hoheinzollern Nov 13, 2023
f158eb2
up
hoheinzollern Nov 14, 2023
b66023f
up
hoheinzollern Nov 14, 2023
8782937
wip
hoheinzollern Nov 15, 2023
2686fc5
up
hoheinzollern Nov 17, 2023
c28882d
up
hoheinzollern Nov 20, 2023
53fcf71
product lemma
hoheinzollern Nov 20, 2023
f3ca75e
wip
hoheinzollern Nov 20, 2023
bf05827
up
hoheinzollern Nov 22, 2023
add0e24
bernoulli probability measure
affeldt-aist Apr 12, 2023
f9983d4
up
hoheinzollern Jan 4, 2024
8d4b61a
up
hoheinzollern Jan 4, 2024
6717d5e
wip
affeldt-aist Jan 5, 2024
1933a11
wip
hoheinzollern Jan 5, 2024
04ae4dc
kwise_inde_weak
affeldt-aist Jan 5, 2024
d935983
complete pairwise_independentM
affeldt-aist Jan 5, 2024
9d23b18
mutually_independent_weak\
hoheinzollern Jan 5, 2024
5e87738
wip
hoheinzollern Jan 8, 2024
bfa056d
wip
affeldt-aist Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@

- in `lebesgue_integral.v`:
+ lemma `abse_integralP`
- in `signed.v`:
+ definition `onem_NngNum`
- in `measure.v`:
+ definition `bernoulli`, declared as a probability measure instance
- in `itv.v`:
+ canonical `onem_itv01`

### Changed

Expand Down
2 changes: 1 addition & 1 deletion classical/classical_sets.v
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ apply/predeqP => x; split=> [[a ? [b ? <-]]|[[a b] [? ? <-]]]/=;
by [exists (a, b) | exists a => //; exists b].
Qed.

Lemma set_nil (T : choiceType) : [set` [::]] = @set0 T.
Lemma set_nil (T : eqType) : [set` [::]] = @set0 T.
Proof. by rewrite predeqP. Qed.

Lemma set_seq_eq0 (T : eqType) (S : seq T) : ([set` S] == set0) = (S == [::]).
Expand Down
5 changes: 3 additions & 2 deletions theories/itv.v
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,9 @@ Lemma inum_lt : {mono inum : x y / (x < y)%O}. Proof. by []. Qed.

End Morph.

Canonical onem_itv01 {R : realDomainType} (p : {i01 R}) : {i01 R} :=
@Itv.mk _ _ (onem p%:inum) [itv of 1 - p%:inum].

Section Test1.

Variable R : numDomainType.
Expand Down Expand Up @@ -882,8 +885,6 @@ apply/val_inj => /=.
by rewrite subr0 mulr1 opprB addrCA subrr addr0.
Qed.

Canonical onem_itv01 (p : {i01 R}) : {i01 R} :=
@Itv.mk _ _ (onem p%:inum) [itv of 1 - p%:inum].

Definition s_of_pq' (p q : {i01 R}) : {i01 R} :=
(`1- (`1-(p%:inum) * `1-(q%:inum)))%:i01.
Expand Down
71 changes: 40 additions & 31 deletions theories/lebesgue_integral.v
Original file line number Diff line number Diff line change
Expand Up @@ -4617,7 +4617,7 @@ End measurable_fun_ysection.

Section product_measures.
Context d1 d2 (T1 : measurableType d1) (T2 : measurableType d2) (R : realType).
Context (m1 : {measure set T1 -> \bar R}) (m2 : {measure set T2 -> \bar R}).
Context (m1 : set T1 -> \bar R) (m2 : set T2 -> \bar R).

Definition product_measure1 := (fun A => \int[m1]_x (m2 \o xsection A) x)%E.
Definition product_measure2 := (fun A => \int[m2]_x (m1 \o ysection A) x)%E.
Expand All @@ -4635,19 +4635,16 @@ Variable m2 : {sigma_finite_measure set T2 -> \bar R}.
Implicit Types A : set (T1 * T2).

Let pm10 : (m1 \x m2) set0 = 0.
Proof. by rewrite [LHS]integral0_eq// => x/= _; rewrite xsection0 measure0. Qed.
Proof. by rewrite [LHS]integral0_eq// => x/= _; rewrite xsection0. Qed.

Let pm1_ge0 A : 0 <= (m1 \x m2) A.
Proof.
by apply: integral_ge0 => // *; exact/measure_ge0/measurable_xsection.
Qed.
Proof. by apply: integral_ge0 => // *. Qed.

Let pm1_sigma_additive : semi_sigma_additive (m1 \x m2).
Proof.
move=> F mF tF mUF.
rewrite [X in _ --> X](_ : _ = \sum_(n <oo) (m1 \x m2) (F n)).
apply/cvg_closeP; split; last by rewrite closeE.
by apply: is_cvg_nneseries => *; exact: integral_ge0.
by apply/cvg_closeP; split; [exact: is_cvg_nneseries|rewrite closeE].
rewrite -integral_nneseries//; last by move=> n; exact: measurable_fun_xsection.
apply: eq_integral => x _; apply/esym/cvg_lim => //=; rewrite xsection_bigcup.
apply: (measure_sigma_additive _ (trivIset_xsection tF)) => ?.
Expand Down Expand Up @@ -4686,41 +4683,53 @@ Context d1 d2 (T1 : measurableType d1) (T2 : measurableType d2) (R : realType).
Variable m1 : {sigma_finite_measure set T1 -> \bar R}.
Variable m2 : {sigma_finite_measure set T2 -> \bar R}.

Let product_measure_sigma_finite : sigma_finite setT (m1 \x m2).
Proof.
have /sigma_finiteP[F TF [ndF Foo]] := sigma_finiteT m1.
have /sigma_finiteP[G TG [ndG Goo]] := sigma_finiteT m2.
exists (fun n => F n `*` G n).
rewrite -setMTT TF TG predeqE => -[x y]; split.
move=> [/= [n _ Fnx] [k _ Gky]]; exists (maxn n k) => //; split.
- by move: x Fnx; exact/subsetPset/ndF/leq_maxl.
- by move: y Gky; exact/subsetPset/ndG/leq_maxr.
by move=> [n _ []/= ? ?]; split; exists n.
move=> k; have [? ?] := Foo k; have [? ?] := Goo k.
split; first exact: measurableM.
by rewrite product_measure1E// lte_mul_pinfty// ge0_fin_numE.
Qed.

HB.instance Definition _ := Measure_isSigmaFinite.Build _ _ _ (m1 \x m2)
product_measure_sigma_finite.

Lemma product_measure_unique
(m' : {measure set [the semiRingOfSetsType _ of T1 * T2] -> \bar R}) :
(forall A1 A2, measurable A1 -> measurable A2 ->
m' (A1 `*` A2) = m1 A1 * m2 A2) ->
(forall A B, measurable A -> measurable B -> m' (A `*` B) = m1 A * m2 B) ->
forall X : set (T1 * T2), measurable X -> (m1 \x m2) X = m' X.
Proof.
move=> m'E; pose m := product_measure1 m1 m2.
have /sigma_finiteP [F1 F1_T [F1_nd F1_oo]] := sigma_finiteT m1.
have /sigma_finiteP [F2 F2_T [F2_nd F2_oo]] := sigma_finiteT m2.
have UF12T : \bigcup_k (F1 k `*` F2 k) = setT.
rewrite -setMTT F1_T F2_T predeqE => -[x y]; split.
move=> m'E.
have /sigma_finiteP[F TF [ndF Foo]] := sigma_finiteT m1.
have /sigma_finiteP[G TG [ndG Goo]] := sigma_finiteT m2.
have UFGT : \bigcup_k (F k `*` G k) = setT.
rewrite -setMTT TF TG predeqE => -[x y]; split.
by move=> [n _ []/= ? ?]; split; exists n.
move=> [/= [n _ F1nx] [k _ F2ky]]; exists (maxn n k) => //; split.
- by move: x F1nx; apply/subsetPset/F1_nd; rewrite leq_maxl.
- by move: y F2ky; apply/subsetPset/F2_nd; rewrite leq_maxr.
have mF1F2 n : measurable (F1 n `*` F2 n) /\ m (F1 n `*` F2 n) < +oo.
have [? ?] := F1_oo n; have [? ?] := F2_oo n.
split; first exact: measurableM.
by rewrite /m product_measure1E // lte_mul_pinfty// ge0_fin_numE.
have sm : sigma_finite setT m by exists (fun n => F1 n `*` F2 n).
pose C : set (set (T1 * T2)) := [set C |
exists A1, measurable A1 /\ exists A2, measurable A2 /\ C = A1 `*` A2].
move=> [/= [n _ Fnx] [k _ Gky]]; exists (maxn n k) => //; split.
- by move: x Fnx; exact/subsetPset/ndF/leq_maxl.
- by move: y Gky; exact/subsetPset/ndG/leq_maxr.
pose C : set (set (T1 * T2)) :=
[set C | exists A, measurable A /\ exists B, measurable B /\ C = A `*` B].
have CI : setI_closed C.
move=> /= _ _ [X1 [mX1 [X2 [mX2 ->]]]] [Y1 [mY1 [Y2 [mY2 ->]]]].
rewrite -setMI; exists (X1 `&` Y1); split; first exact: measurableI.
by exists (X2 `&` Y2); split => //; exact: measurableI.
move=> X mX; apply: (measure_unique C (fun n => F1 n `*` F2 n)) => //.
move=> X mX; apply: (measure_unique C (fun n => F n `*` G n)) => //.
- rewrite measurable_prod_measurableType //; congr (<<s _ >>).
rewrite predeqE; split => [[A1 mA1 [A2 mA2 <-]]|[A1 [mA1 [A2 [mA2 ->]]]]].
by exists A1; split => //; exists A2; split.
by exists A1 => //; exists A2.
- move=> n; rewrite /C /=; exists (F1 n); split; first by have [] := F1_oo n.
by exists (F2 n); split => //; have [] := F2_oo n.
rewrite predeqE; split => [[A mA [B mB <-]]|[A [mA [B [mB ->]]]]].
by exists A; split => //; exists B.
by exists A => //; exists B.
- move=> n; rewrite /C /=; exists (F n); split; first by have [] := Foo n.
by exists (G n); split => //; have [] := Goo n.
- by move=> A [A1 [mA1 [A2 [mA2 ->]]]]; rewrite m'E//= product_measure1E.
- move=> k; have [? ?] := F1_oo k; have [? ?] := F2_oo k.
- move=> k; have [? ?] := Foo k; have [? ?] := Goo k.
by rewrite /= product_measure1E// lte_mul_pinfty// ge0_fin_numE.
Qed.

Expand Down
2 changes: 2 additions & 0 deletions theories/lebesgue_measure.v
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ Definition lebesgue_measure {R : realType} :
HB.instance Definition _ (R : realType) := Measure.on (@lebesgue_measure R).
HB.instance Definition _ (R : realType) :=
SigmaFiniteContent.on (@lebesgue_measure R).
HB.instance Definition _ (R : realType) :=
SigmaFiniteMeasure.on (@lebesgue_measure R).

Section ps_infty.
Context {T : Type}.
Expand Down
2 changes: 1 addition & 1 deletion theories/lebesgue_stieltjes_measure.v
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ Lemma sigmaT_finite_lebesgue_stieltjes_measure (f : cumulative R) :
sigma_finite setT (lebesgue_stieltjes_measure f).
Proof. exact/measure_extension_sigma_finite/wlength_sigma_finite. Qed.

HB.instance Definition _ (f : cumulative R) := @isSigmaFinite.Build _ _ _
HB.instance Definition _ (f : cumulative R) := @Measure_isSigmaFinite.Build _ _ _
(lebesgue_stieltjes_measure f) (sigmaT_finite_lebesgue_stieltjes_measure f).

End wlength_extension.
Expand Down
22 changes: 22 additions & 0 deletions theories/measure.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ From mathcomp Require Import all_ssreflect all_algebra finmap.
From mathcomp Require Import mathcomp_extra boolp classical_sets functions.
From mathcomp Require Import cardinality fsbigop .
Require Import reals ereal signed topology normedtype sequences esum numfun.
Require Import itv.
From HB Require Import structures.

(******************************************************************************)
Expand Down Expand Up @@ -178,6 +179,7 @@ From HB Require Import structures.
(* probability T R == probability measure over the measurableType T with *)
(* value in R : realType *)
(* Measure_isProbability == factor for probability measures *)
(* bernoulli p == the p-Bernoulli probability where p : {i01 R} *)
(* *)
(* monotone_class D G == G is a monotone class of subsets of D *)
(* <<m D, G >> == monotone class generated by G on D *)
Expand Down Expand Up @@ -2994,6 +2996,26 @@ HB.instance Definition _ x :=

End pdirac.

Section bernoulli.
Variables (R : realType) (p : {i01 R}).

Definition bernoulli : set _ -> \bar R := measure_add
(mscale (NngNum (itv_ge0 p)) (dirac true))
(mscale (NngNum (itv_ge0 ((`1-(p%:inum))%:i01))) (dirac false)).

HB.instance Definition _ := Measure.on bernoulli.

Let bernoulli_setT : bernoulli [set: _] = 1.
Proof.
rewrite /bernoulli/= /measure_add/= /msum 2!big_ord_recr/= big_ord0 add0e/=.
by rewrite /mscale/= !diracT !mule1 -EFinD add_onemK.
Qed.

HB.instance Definition _ :=
@Measure_isProbability.Build _ _ R bernoulli bernoulli_setT.

End bernoulli.

Lemma sigma_finite_counting (R : realType) :
sigma_finite [set: nat] (@counting _ R).
Proof.
Expand Down
Loading
Loading