Skip to content

Commit 64678d9

Browse files
committed
feat(Probability): translations of gaussians are gaussian (#25532)
If `μ` is gaussian, then `μ.map (fun x ↦ x + c)` is gaussian as well. The same is true for `c + x`, `x - c`, `-x` and `c - x` instead of `x + c`.
1 parent b2a691d commit 64678d9

File tree

3 files changed

+82
-9
lines changed

3 files changed

+82
-9
lines changed

Mathlib/MeasureTheory/Group/Convolution.lean

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,31 @@ theorem lintegral_mconv [MeasurableMul₂ M] {μ ν : Measure M} [SFinite ν]
4444
rw [mconv, lintegral_map hf measurable_mul, lintegral_prod]
4545
fun_prop
4646

47+
@[to_additive]
48+
lemma dirac_mconv [MeasurableMul₂ M] (x : M) (μ : Measure M) [SFinite μ] :
49+
(Measure.dirac x) ∗ₘ μ = μ.map (fun y ↦ x * y) := by
50+
unfold mconv
51+
rw [Measure.dirac_prod, map_map (by fun_prop) (by fun_prop)]
52+
simp [Function.comp_def]
53+
54+
@[to_additive]
55+
lemma mconv_dirac [MeasurableMul₂ M] (μ : Measure M) [SFinite μ] (x : M) :
56+
μ ∗ₘ (Measure.dirac x) = μ.map (fun y ↦ y * x) := by
57+
unfold mconv
58+
rw [Measure.prod_dirac, map_map (by fun_prop) (by fun_prop)]
59+
simp [Function.comp_def]
60+
4761
/-- Convolution of the dirac measure at 1 with a measure μ returns μ. -/
4862
@[to_additive (attr := simp) "Convolution of the dirac measure at 0 with a measure μ returns μ."]
4963
theorem dirac_one_mconv [MeasurableMul₂ M] (μ : Measure M) [SFinite μ] :
5064
(Measure.dirac 1) ∗ₘ μ = μ := by
51-
unfold mconv
52-
rw [MeasureTheory.Measure.dirac_prod, map_map (by fun_prop)]
53-
· simp only [Function.comp_def, one_mul, map_id']
54-
fun_prop
65+
simp [dirac_mconv]
5566

5667
/-- Convolution of a measure μ with the dirac measure at 1 returns μ. -/
5768
@[to_additive (attr := simp) "Convolution of a measure μ with the dirac measure at 0 returns μ."]
5869
theorem mconv_dirac_one [MeasurableMul₂ M]
5970
(μ : Measure M) [SFinite μ] : μ ∗ₘ (Measure.dirac 1) = μ := by
60-
unfold mconv
61-
rw [MeasureTheory.Measure.prod_dirac, map_map (by fun_prop)]
62-
· simp only [Function.comp_def, mul_one, map_id']
63-
fun_prop
71+
simp [mconv_dirac]
6472

6573
/-- Convolution of the zero measure with a measure μ returns the zero measure. -/
6674
@[to_additive (attr := simp) "Convolution of the zero measure with a measure μ returns

Mathlib/MeasureTheory/Measure/CharacteristicFunction.lean

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,30 @@ lemma charFun_map_mul {μ : Measure ℝ} (r t : ℝ) :
196196
charFun (μ.map (r * ·)) t = charFun μ (r * t) := charFun_map_smul r t
197197

198198
variable {E : Type*} [MeasurableSpace E] {μ ν : Measure E} {t : E}
199-
[NormedAddCommGroup E] [InnerProductSpace ℝ E] [BorelSpace E] [SecondCountableTopology E]
199+
[NormedAddCommGroup E] [InnerProductSpace ℝ E]
200+
201+
@[simp]
202+
lemma charFun_dirac [OpensMeasurableSpace E] {x : E} (t : E) :
203+
charFun (Measure.dirac x) t = cexp (⟪x, t⟫ * I) := by
204+
rw [charFun_apply, integral_dirac]
205+
206+
lemma charFun_map_add_const [BorelSpace E] (r t : E) :
207+
charFun (μ.map (· + r)) t = charFun μ t * cexp (⟪r, t⟫ * I) := by
208+
rw [charFun_apply, charFun_apply, integral_map (by fun_prop) (by fun_prop),
209+
← integral_mul_const]
210+
congr with a
211+
rw [← Complex.exp_add]
212+
congr
213+
rw [inner_add_left]
214+
simp only [ofReal_add]
215+
ring
216+
217+
lemma charFun_map_const_add [BorelSpace E] (r t : E) :
218+
charFun (μ.map (r + ·)) t = charFun μ t * cexp (⟪r, t⟫ * I) := by
219+
simp_rw [add_comm r]
220+
exact charFun_map_add_const _ _
221+
222+
variable [BorelSpace E] [SecondCountableTopology E]
200223

201224
/-- If the characteristic functions `charFun` of two finite measures `μ` and `ν` on
202225
a complete second-countable inner product space coincide, then `μ = ν`. -/
@@ -270,6 +293,21 @@ lemma charFunDual_dirac [OpensMeasurableSpace E] {x : E} (L : Dual ℝ E) :
270293
charFunDual (Measure.dirac x) L = cexp (L x * I) := by
271294
rw [charFunDual_apply, integral_dirac]
272295

296+
lemma charFunDual_map_add_const [BorelSpace E] (r : E) (L : Dual ℝ E) :
297+
charFunDual (μ.map (· + r)) L = charFunDual μ L * cexp (L r * I) := by
298+
rw [charFunDual_apply, charFunDual_apply, integral_map (by fun_prop) (by fun_prop),
299+
← integral_mul_const]
300+
congr with a
301+
rw [← Complex.exp_add]
302+
congr
303+
simp only [map_add, ofReal_add]
304+
ring
305+
306+
lemma charFunDual_map_const_add [BorelSpace E] (r : E) (L : Dual ℝ E) :
307+
charFunDual (μ.map (r + ·)) L = charFunDual μ L * cexp (L r * I) := by
308+
simp_rw [add_comm r]
309+
exact charFunDual_map_add_const _ _
310+
273311
/-- The characteristic function of a product of measures is a product of
274312
characteristic functions. -/
275313
lemma charFunDual_prod [SFinite μ] [SFinite ν] (L : Dual ℝ (E × F)) :

Mathlib/Probability/Distributions/Gaussian/Basic.lean

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,31 @@ instance isGaussian_conv [SecondCountableTopology E]
153153
IsGaussian.map_eq_gaussianReal L, gaussianReal_conv_gaussianReal]
154154
congr <;> simp [variance_nonneg]
155155

156+
instance (c : E) : IsGaussian (μ.map (fun x ↦ x + c)) := by
157+
refine isGaussian_of_charFunDual_eq fun L ↦ ?_
158+
rw [charFunDual_map_add_const, IsGaussian.charFunDual_eq, ← exp_add]
159+
have hL_comp : L ∘ (fun x ↦ x + c) = fun x ↦ L x + L c := by ext; simp
160+
rw [variance_map (by fun_prop) (by fun_prop), integral_map (by fun_prop) (by fun_prop),
161+
hL_comp, variance_add_const (by fun_prop), integral_complex_ofReal, integral_complex_ofReal]
162+
simp only [map_add, ofReal_add]
163+
rw [integral_add (by fun_prop) (by fun_prop)]
164+
congr
165+
simp only [integral_const, measureReal_univ_eq_one, smul_eq_mul, one_mul, ofReal_add]
166+
ring
167+
168+
instance (c : E) : IsGaussian (μ.map (fun x ↦ c + x)) := by simp_rw [add_comm c]; infer_instance
169+
170+
instance (c : E) : IsGaussian (μ.map (fun x ↦ x - c)) := by simp_rw [sub_eq_add_neg]; infer_instance
171+
172+
instance : IsGaussian (μ.map (fun x ↦ -x)) := by
173+
change IsGaussian (μ.map (ContinuousLinearEquiv.neg ℝ))
174+
infer_instance
175+
176+
instance (c : E) : IsGaussian (μ.map (fun x ↦ c - x)) := by
177+
simp_rw [sub_eq_add_neg]
178+
suffices IsGaussian ((μ.map (fun x ↦ -x)).map (fun x ↦ c + x)) by
179+
rw [Measure.map_map (by fun_prop) (by fun_prop)] at this
180+
convert this using 1
181+
infer_instance
182+
156183
end ProbabilityTheory

0 commit comments

Comments
 (0)