Skip to content

Commit 7fbd8bf

Browse files
committed
address comments
1 parent 85a38b4 commit 7fbd8bf

3 files changed

Lines changed: 66 additions & 61 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@
109109
+ lemma `emeasurable_bounded_integrable`
110110
+ lemmas `integrable_normal_probD1`, `normal_probD1`, `normal_probD2`, `normal_probD`
111111

112+
- in `ftc.v`:
113+
+ lemma `ge0_integration_by_substitution_shift_itvy`,
114+
`ge0_integration_by_substitution_shift_itvNy`
115+
112116
### Changed
113117

114118
- moved from `measurable_structure.v` to `classical_sets.v`:

theories/ftc.v

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,53 @@ Qed.
17931793

17941794
End integration_by_substitution.
17951795

1796+
1797+
Section ge0_integration_by_substitution_shift.
1798+
Context {R : realType}.
1799+
Notation mu := (@lebesgue_measure R).
1800+
1801+
Lemma ge0_integration_by_substitution_shift_itvy (f : R -> R) (r e : R) :
1802+
{within `[r + e, +oo[, continuous f} ->
1803+
{in `]r + e, +oo[, forall x : R, 0 <= f x} ->
1804+
(\int[mu]_(x in `[(r + e)%R, +oo[) (f x)%:E =
1805+
\int[mu]_(x in `[r, +oo[) ((f \o shift e) x)%:E)%E.
1806+
Proof.
1807+
move=> cf f0.
1808+
have dshiftE : (shift e)^`() = cst 1.
1809+
by apply/funext => x; rewrite derive1E -(derive_shift 1 e).
1810+
rewrite (@increasing_ge0_integration_by_substitutiony _ (shift e))//=.
1811+
- by move=> x y _ _ xy; rewrite ltr_leD.
1812+
- by rewrite dshiftE => ? _; exact: cst_continuous.
1813+
- by rewrite dshiftE; exact: is_cvg_cst.
1814+
- by rewrite dshiftE; exact: is_cvg_cst.
1815+
- split; first by move=> x _; exact: ex_derive.
1816+
by apply/cvg_at_right_filter; apply: cvgD => //; exact: cvg_cst.
1817+
- exact: cvg_addrr.
1818+
by rewrite dshiftE mulr1.
1819+
Qed.
1820+
1821+
Lemma ge0_integration_by_substitution_shift_itvNy (f : R -> R) (r e : R) :
1822+
{within `]-oo, r + e], continuous f} ->
1823+
{in `]-oo, r + e[, forall x : R, 0 <= f x} ->
1824+
(\int[mu]_(x in `]-oo, (r + e)%R]) (f x)%:E =
1825+
\int[mu]_(x in `]-oo, r]) ((f \o shift e) x)%:E)%E.
1826+
Proof.
1827+
move=> cf f0.
1828+
have dshiftE : (shift e)^`() = cst 1.
1829+
by apply/funext => x; rewrite derive1E -(derive_shift 1 e).
1830+
rewrite (@increasing_ge0_integration_by_substitutionNy _ (shift e))//.
1831+
- by move=> x y _ _ xy; rewrite ltr_leD.
1832+
- by rewrite dshiftE => ? _; exact: cst_continuous.
1833+
- by rewrite dshiftE; exact: is_cvg_cst.
1834+
- by rewrite dshiftE; exact: cvg_cst.
1835+
- split; first by move=> x _; exact: ex_derive.
1836+
by apply/cvg_at_left_filter; apply: cvgD => //; exact: cvg_cst.
1837+
- exact: cvg_addrr_Ny.
1838+
by rewrite dshiftE mulr1.
1839+
Qed.
1840+
1841+
End ge0_integration_by_substitution_shift.
1842+
17961843
Section integration_by_substitution_onem.
17971844
Context {R : realType}.
17981845
Let mu := (@lebesgue_measure R).

theories/probability_theory/normal_distribution.v

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@ Proof. exact: expR_ge0. Qed.
7070
Lemma normal_fun_center0 m s : normal_fun m s = normal_fun 0 s \o center m.
7171
Proof. by apply/funext => x/=; rewrite /normal_fun/= subr0. Qed.
7272

73-
Lemma normal_funN m s : normal_fun (- m) s (- m) = normal_fun m s m.
74-
Proof. by rewrite /normal_fun opprK addrC. Qed.
73+
Lemma normal_funN m s x : normal_fun (- m) s (- x) = normal_fun m s x.
74+
Proof. by rewrite /normal_fun -opprD sqrrN. Qed.
7575

7676
Lemma normal_fun_sym m s x : normal_fun m s x = normal_fun x s m.
7777
Proof. by rewrite /normal_fun -(sqrrN (x - _)) opprB. Qed.
7878

7979
Lemma normal_fun0abs s x : normal_fun 0 s `|x| = normal_fun 0 s x.
8080
Proof. by rewrite /normal_fun 2!subr0 real_normK// num_real. Qed.
8181

82-
#[deprecated(since="mathcomp-analysis 1.17.0", note="to be renamed to `normal_fun_center`")]
83-
Lemma normal_fun_center_new m s x :
84-
normal_fun (center m x) s (center m x) = normal_fun m s m.
85-
Proof. by rewrite [in RHS]/normal_fun subrr -(subrr (x - m)). Qed.
82+
Lemma normal_fun_shift m s x t :
83+
normal_fun (shift m t) s (shift x t) = normal_fun m s x.
84+
Proof. by rewrite [in LHS]/normal_fun/= (addrC t x) addrKA. Qed.
8685

87-
Lemma normal_fun_shift m s x :
88-
normal_fun (shift m x) s (shift m x) = normal_fun m s m.
89-
Proof. by rewrite -[in LHS]normal_funN/= opprD normal_fun_center_new. Qed.
86+
#[deprecated(since="mathcomp-analysis 1.17.0", note="to be renamed to `normal_fun_center`")]
87+
Lemma normal_fun_center_new m s x t :
88+
normal_fun (center m t) s (center x t) = normal_fun m s x.
89+
Proof. by rewrite normal_fun_shift normal_funN. Qed.
9090

9191
End normal_fun.
9292
#[deprecated(since="mathcomp-analysis 1.17.0", note="renamed to `normal_fun_center0`")]
@@ -139,12 +139,12 @@ Proof. by rewrite /normal_pdf0 normal_fun_sym. Qed.
139139
Lemma normal_pdf0N m s : normal_pdf0 (- m) s (- m) = normal_pdf0 m s m.
140140
Proof. by rewrite /normal_pdf0 normal_funN. Qed.
141141

142-
Lemma normal_pdf0_center m s x :
143-
normal_pdf0 (center m x) s (center m x) = normal_pdf0 m s m.
142+
Lemma normal_pdf0_center m s x t :
143+
normal_pdf0 (center m t) s (center x t) = normal_pdf0 m s x.
144144
Proof. by rewrite /normal_pdf0 normal_fun_center_new. Qed.
145145

146-
Lemma normal_pdf0_shift m s x :
147-
normal_pdf0 (shift m x) s (shift m x) = normal_pdf0 m s m.
146+
Lemma normal_pdf0_shift m s x t :
147+
normal_pdf0 (shift m t) s (shift x t) = normal_pdf0 m s x.
148148
Proof. by rewrite /normal_pdf0 normal_fun_shift. Qed.
149149

150150
End normal_pdf0.
@@ -345,52 +345,6 @@ Local Close Scope charge_scope.
345345

346346
End normal_probability.
347347

348-
Section ge0_integration_by_substitution_shift.
349-
Context {R : realType}.
350-
Notation mu := (@lebesgue_measure R).
351-
352-
Lemma ge0_integration_by_substitution_shift_itvy (f : R -> R) (r e : R) :
353-
{within `[r + e, +oo[, continuous f} ->
354-
{in `]r + e, +oo[, forall x : R, 0 <= f x} ->
355-
(\int[mu]_(x in `[(r + e)%R, +oo[) (f x)%:E =
356-
\int[mu]_(x in `[r, +oo[) ((f \o shift e) x)%:E)%E.
357-
Proof.
358-
move=> cf f0.
359-
have dshiftE : (shift e)^`() = cst 1.
360-
by apply/funext => x; rewrite derive1E -(derive_shift 1 e).
361-
rewrite (@increasing_ge0_integration_by_substitutiony _ (shift e))//=.
362-
- by move=> x y _ _ xy; rewrite ltr_leD.
363-
- by rewrite dshiftE => ? _; exact: cst_continuous.
364-
- by rewrite dshiftE; exact: is_cvg_cst.
365-
- by rewrite dshiftE; exact: is_cvg_cst.
366-
- split; first by move=> x _; exact: ex_derive.
367-
by apply/cvg_at_right_filter; apply: cvgD => //; exact: cvg_cst.
368-
- exact: cvg_addrr.
369-
by rewrite dshiftE mulr1.
370-
Qed.
371-
372-
Lemma ge0_integration_by_substitution_shift_itvNy (f : R -> R) (r e : R) :
373-
{within `]-oo, r + e], continuous f} ->
374-
{in `]-oo, r + e[, forall x : R, 0 <= f x} ->
375-
(\int[mu]_(x in `]-oo, (r + e)%R]) (f x)%:E =
376-
\int[mu]_(x in `]-oo, r]) ((f \o shift e) x)%:E)%E.
377-
Proof.
378-
move=> cf f0.
379-
have dshiftE : (shift e)^`() = cst 1.
380-
by apply/funext => x; rewrite derive1E -(derive_shift 1 e).
381-
rewrite (@increasing_ge0_integration_by_substitutionNy _ (shift e))//.
382-
- by move=> x y _ _ xy; rewrite ltr_leD.
383-
- by rewrite dshiftE => ? _; exact: cst_continuous.
384-
- by rewrite dshiftE; exact: is_cvg_cst.
385-
- by rewrite dshiftE; exact: cvg_cst.
386-
- split; first by move=> x _; exact: ex_derive.
387-
by apply/cvg_at_left_filter; apply: cvgD => //; exact: cvg_cst.
388-
- exact: cvg_addrr_Ny.
389-
by rewrite dshiftE mulr1.
390-
Qed.
391-
392-
End ge0_integration_by_substitution_shift.
393-
394348
Section normal_prob_continuous.
395349
(* outline of proof:
396350
1. It is enough to prove that `(fun x => normal_prob x s Ys)` is continuous
@@ -481,7 +435,7 @@ apply: withinU_continuous.
481435
by near: t; apply: cvgr_dist_le eps eps0; exact: continuous_normal_pdf0.
482436
* apply/cvgrPdist_lt => eps eps0; near=> t.
483437
rewrite /g' !(negPf (ballFE_le _))// (addrC a) addrK normrN.
484-
rewrite (ger0_norm e0)// -(normal_pdf0_center _ _ a) pdf0B//.
438+
rewrite (ger0_norm e0)// -(normal_pdf0_center _ _ _ a) pdf0B//.
485439
near: t; apply: cvgr_dist_lt eps eps0.
486440
by apply/cvg_at_left_filter; exact: continuous_normal_pdf0.
487441
move: e0; rewrite le_eqVlt => /predU1P[<-|e0].
@@ -516,7 +470,7 @@ apply: withinU_continuous.
516470
+ apply/cvgrPdist_le => eps eps0; near=> t.
517471
rewrite /g' !(negPf (ballFE_ge _))//.
518472
rewrite (addrC a) addrK (ger0_norm e0)//.
519-
rewrite -(normal_pdf0_shift e s a)/= pdf0D//.
473+
rewrite -(normal_pdf0_shift e s _ a)/= pdf0D//.
520474
near: t; apply/cvgrPdist_le : eps eps0.
521475
by apply: cvg_at_right_filter; exact: continuous_normal_pdf0.
522476
Unshelve. all: end_near. Qed.

0 commit comments

Comments
 (0)