Skip to content

Commit c2c49eb

Browse files
committed
address comments
1 parent 222f2b6 commit c2c49eb

3 files changed

Lines changed: 65 additions & 61 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@
182182

183183
- in `esum.v`:
184184
+ lemma `fsetsTE`
185+
- in `ftc.v`:
186+
+ lemma `ge0_integration_by_substitution_shift_itvy`,
187+
`ge0_integration_by_substitution_shift_itvNy`
185188

186189
### Changed
187190

theories/ftc.v

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

17771777
End integration_by_substitution.
17781778

1779+
1780+
Section ge0_integration_by_substitution_shift.
1781+
Context {R : realType}.
1782+
Notation mu := (@lebesgue_measure R).
1783+
1784+
Lemma ge0_integration_by_substitution_shift_itvy (f : R -> R) (r e : R) :
1785+
{within `[r + e, +oo[, continuous f} ->
1786+
{in `]r + e, +oo[, forall x : R, 0 <= f x} ->
1787+
(\int[mu]_(x in `[(r + e)%R, +oo[) (f x)%:E =
1788+
\int[mu]_(x in `[r, +oo[) ((f \o shift e) x)%:E)%E.
1789+
Proof.
1790+
move=> cf f0.
1791+
have dshiftE : (shift e)^`() = cst 1.
1792+
by apply/funext => x; rewrite derive1E -(derive_shift 1 e).
1793+
rewrite (@increasing_ge0_integration_by_substitutiony _ (shift e))//=.
1794+
- by move=> x y _ _ xy; rewrite ltr_leD.
1795+
- by rewrite dshiftE => ? _; exact: cst_continuous.
1796+
- by rewrite dshiftE; exact: is_cvg_cst.
1797+
- by rewrite dshiftE; exact: is_cvg_cst.
1798+
- split; first by move=> x _; exact: ex_derive.
1799+
by apply/cvg_at_right_filter; apply: cvgD => //; exact: cvg_cst.
1800+
- exact: cvg_addrr.
1801+
by rewrite dshiftE mulr1.
1802+
Qed.
1803+
1804+
Lemma ge0_integration_by_substitution_shift_itvNy (f : R -> R) (r e : R) :
1805+
{within `]-oo, r + e], continuous f} ->
1806+
{in `]-oo, r + e[, forall x : R, 0 <= f x} ->
1807+
(\int[mu]_(x in `]-oo, (r + e)%R]) (f x)%:E =
1808+
\int[mu]_(x in `]-oo, r]) ((f \o shift e) x)%:E)%E.
1809+
Proof.
1810+
move=> cf f0.
1811+
have dshiftE : (shift e)^`() = cst 1.
1812+
by apply/funext => x; rewrite derive1E -(derive_shift 1 e).
1813+
rewrite (@increasing_ge0_integration_by_substitutionNy _ (shift e))//.
1814+
- by move=> x y _ _ xy; rewrite ltr_leD.
1815+
- by rewrite dshiftE => ? _; exact: cst_continuous.
1816+
- by rewrite dshiftE; exact: is_cvg_cst.
1817+
- by rewrite dshiftE; exact: cvg_cst.
1818+
- split; first by move=> x _; exact: ex_derive.
1819+
by apply/cvg_at_left_filter; apply: cvgD => //; exact: cvg_cst.
1820+
- exact: cvg_addrr_Ny.
1821+
by rewrite dshiftE mulr1.
1822+
Qed.
1823+
1824+
End ge0_integration_by_substitution_shift.
1825+
17791826
Section integration_by_substitution_onem.
17801827
Context {R : realType}.
17811828
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)