fact stringlengths 6 3.84k | type stringclasses 11
values | library stringclasses 32
values | imports listlengths 1 14 | filename stringlengths 20 95 | symbolic_name stringlengths 1 90 | docstring stringlengths 7 20k ⌀ |
|---|---|---|---|---|---|---|
noAtoms_gaussianReal {μ : ℝ} {v : ℝ≥0} (h : v ≠ 0) : NoAtoms (gaussianReal μ v) := by
rw [gaussianReal_of_var_ne_zero _ h]
infer_instance | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | noAtoms_gaussianReal | null |
gaussianReal_apply (μ : ℝ) {v : ℝ≥0} (hv : v ≠ 0) (s : Set ℝ) :
gaussianReal μ v s = ∫⁻ x in s, gaussianPDF μ v x := by
rw [gaussianReal_of_var_ne_zero _ hv, withDensity_apply' _ s] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_apply | null |
gaussianReal_apply_eq_integral (μ : ℝ) {v : ℝ≥0} (hv : v ≠ 0) (s : Set ℝ) :
gaussianReal μ v s = ENNReal.ofReal (∫ x in s, gaussianPDFReal μ v x) := by
rw [gaussianReal_apply _ hv s, ofReal_integral_eq_lintegral_ofReal]
· rfl
· exact (integrable_gaussianPDFReal _ _).restrict
· exact ae_of_all _ (gaussianPDFReal_nonneg _ _) | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_apply_eq_integral | null |
gaussianReal_absolutelyContinuous (μ : ℝ) {v : ℝ≥0} (hv : v ≠ 0) :
gaussianReal μ v ≪ volume := by
rw [gaussianReal_of_var_ne_zero _ hv]
exact withDensity_absolutelyContinuous _ _ | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_absolutelyContinuous | null |
gaussianReal_absolutelyContinuous' (μ : ℝ) {v : ℝ≥0} (hv : v ≠ 0) :
volume ≪ gaussianReal μ v := by
rw [gaussianReal_of_var_ne_zero _ hv]
refine withDensity_absolutelyContinuous' ?_ ?_
· exact (measurable_gaussianPDF _ _).aemeasurable
· exact ae_of_all _ (fun _ ↦ (gaussianPDF_pos _ hv _).ne') | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_absolutelyContinuous' | null |
rnDeriv_gaussianReal (μ : ℝ) (v : ℝ≥0) :
∂(gaussianReal μ v)/∂volume =ₐₛ gaussianPDF μ v := by
by_cases hv : v = 0
· simp only [hv, gaussianReal_zero_var, gaussianPDF_zero_var]
refine (Measure.eq_rnDeriv measurable_zero (mutuallySingular_dirac μ volume) ?_).symm
rw [withDensity_zero, add_zero]
· rw [gaussianReal_of_var_ne_zero _ hv]
exact Measure.rnDeriv_withDensity _ (measurable_gaussianPDF μ v) | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | rnDeriv_gaussianReal | null |
integral_gaussianReal_eq_integral_smul {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
{μ : ℝ} {v : ℝ≥0} {f : ℝ → E} (hv : v ≠ 0) :
∫ x, f x ∂(gaussianReal μ v) = ∫ x, gaussianPDFReal μ v x • f x := by
simp [gaussianReal, hv,
integral_withDensity_eq_integral_toReal_smul (measurable_gaussianPDF _ _)
(ae_of_all _ fun _ ↦ gaussianPDF_lt_top)] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | integral_gaussianReal_eq_integral_smul | null |
_root_.MeasurableEmbedding.gaussianReal_comap_apply (hv : v ≠ 0)
{f : ℝ → ℝ} (hf : MeasurableEmbedding f)
{f' : ℝ → ℝ} (h_deriv : ∀ x, HasDerivAt f (f' x) x) {s : Set ℝ} (hs : MeasurableSet s) :
(gaussianReal μ v).comap f s
= ENNReal.ofReal (∫ x in s, |f' x| * gaussianPDFReal μ v (f x)) := by
rw [gaussianReal_of_var_ne_zero _ hv, gaussianPDF_def]
exact hf.withDensity_ofReal_comap_apply_eq_integral_abs_deriv_mul' hs h_deriv
(ae_of_all _ (gaussianPDFReal_nonneg _ _)) (integrable_gaussianPDFReal _ _) | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | _root_.MeasurableEmbedding.gaussianReal_comap_apply | null |
_root_.MeasurableEquiv.gaussianReal_map_symm_apply (hv : v ≠ 0) (f : ℝ ≃ᵐ ℝ) {f' : ℝ → ℝ}
(h_deriv : ∀ x, HasDerivAt f (f' x) x) {s : Set ℝ} (hs : MeasurableSet s) :
(gaussianReal μ v).map f.symm s
= ENNReal.ofReal (∫ x in s, |f' x| * gaussianPDFReal μ v (f x)) := by
rw [gaussianReal_of_var_ne_zero _ hv, gaussianPDF_def]
exact f.withDensity_ofReal_map_symm_apply_eq_integral_abs_deriv_mul' hs h_deriv
(ae_of_all _ (gaussianPDFReal_nonneg _ _)) (integrable_gaussianPDFReal _ _) | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | _root_.MeasurableEquiv.gaussianReal_map_symm_apply | null |
gaussianReal_map_add_const (y : ℝ) :
(gaussianReal μ v).map (· + y) = gaussianReal (μ + y) v := by
by_cases hv : v = 0
· simp only [hv, gaussianReal_zero_var]
exact Measure.map_dirac (measurable_id'.add_const _) _
let e : ℝ ≃ᵐ ℝ := (Homeomorph.addRight y).symm.toMeasurableEquiv
have he' : ∀ x, HasDerivAt e ((fun _ ↦ 1) x) x := fun _ ↦ (hasDerivAt_id _).sub_const y
change (gaussianReal μ v).map e.symm = gaussianReal (μ + y) v
ext s' hs'
rw [MeasurableEquiv.gaussianReal_map_symm_apply hv e he' hs']
simp only [abs_one, one_mul]
rw [gaussianReal_apply_eq_integral _ hv s']
simp [e, gaussianPDFReal_sub _ y, Homeomorph.addRight, ← sub_eq_add_neg] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_map_add_const | The map of a Gaussian distribution by addition of a constant is a Gaussian. |
gaussianReal_map_const_add (y : ℝ) :
(gaussianReal μ v).map (y + ·) = gaussianReal (μ + y) v := by
simp_rw [add_comm y]
exact gaussianReal_map_add_const y | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_map_const_add | The map of a Gaussian distribution by addition of a constant is a Gaussian. |
gaussianReal_map_const_mul (c : ℝ) :
(gaussianReal μ v).map (c * ·) = gaussianReal (c * μ) (⟨c^2, sq_nonneg _⟩ * v) := by
by_cases hv : v = 0
· simp only [hv, mul_zero, gaussianReal_zero_var]
exact Measure.map_dirac (measurable_id'.const_mul c) μ
by_cases hc : c = 0
· simp only [hc, zero_mul]
rw [Measure.map_const]
simp only [measure_univ, one_smul]
convert (gaussianReal_zero_var 0).symm
simp only [ne_eq, zero_pow, mul_eq_zero, hv, or_false, not_false_eq_true, reduceCtorEq,
NNReal.mk_zero]
let e : ℝ ≃ᵐ ℝ := (Homeomorph.mulLeft₀ c hc).symm.toMeasurableEquiv
have he' : ∀ x, HasDerivAt e ((fun _ ↦ c⁻¹) x) x := by
suffices ∀ x, HasDerivAt (fun x => c⁻¹ * x) (c⁻¹ * 1) x by rwa [mul_one] at this
exact fun _ ↦ HasDerivAt.const_mul _ (hasDerivAt_id _)
change (gaussianReal μ v).map e.symm = gaussianReal (c * μ) (⟨c^2, sq_nonneg _⟩ * v)
ext s' hs'
rw [MeasurableEquiv.gaussianReal_map_symm_apply hv e he' hs',
gaussianReal_apply_eq_integral _ _ s']
swap
· simp only [ne_eq, mul_eq_zero, hv, or_false]
rw [← NNReal.coe_inj]
simp [hc]
simp only [e, Homeomorph.mulLeft₀,
Equiv.mulLeft₀_symm_apply, Homeomorph.toMeasurableEquiv_coe, Homeomorph.homeomorph_mk_coe_symm,
gaussianPDFReal_inv_mul hc]
congr with x
suffices |c⁻¹| * |c| = 1 by rw [← mul_assoc, this, one_mul]
rw [abs_inv, inv_mul_cancel₀]
rwa [ne_eq, abs_eq_zero] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_map_const_mul | The map of a Gaussian distribution by multiplication by a constant is a Gaussian. |
gaussianReal_map_mul_const (c : ℝ) :
(gaussianReal μ v).map (· * c) = gaussianReal (c * μ) (⟨c^2, sq_nonneg _⟩ * v) := by
simp_rw [mul_comm _ c]
exact gaussianReal_map_const_mul c | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_map_mul_const | The map of a Gaussian distribution by multiplication by a constant is a Gaussian. |
gaussianReal_map_neg : (gaussianReal μ v).map (fun x ↦ -x) = gaussianReal (-μ) v := by
simpa using gaussianReal_map_const_mul (μ := μ) (v := v) (-1) | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_map_neg | null |
gaussianReal_map_sub_const (y : ℝ) :
(gaussianReal μ v).map (· - y) = gaussianReal (μ - y) v := by
simp_rw [sub_eq_add_neg, gaussianReal_map_add_const] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_map_sub_const | null |
gaussianReal_map_const_sub (y : ℝ) :
(gaussianReal μ v).map (y - ·) = gaussianReal (y - μ) v := by
simp_rw [sub_eq_add_neg]
have : (fun x ↦ y + -x) = (fun x ↦ y + x) ∘ fun x ↦ -x := by ext; simp
rw [this, ← Measure.map_map (by fun_prop) (by fun_prop), gaussianReal_map_neg,
gaussianReal_map_const_add, add_comm]
variable {Ω : Type} [MeasureSpace Ω] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_map_const_sub | null |
gaussianReal_add_const {X : Ω → ℝ} (hX : Measure.map X ℙ = gaussianReal μ v) (y : ℝ) :
Measure.map (fun ω ↦ X ω + y) ℙ = gaussianReal (μ + y) v := by
have hXm : AEMeasurable X := aemeasurable_of_map_neZero (by rw [hX]; infer_instance)
change Measure.map ((fun ω ↦ ω + y) ∘ X) ℙ = gaussianReal (μ + y) v
rw [← AEMeasurable.map_map_of_aemeasurable (measurable_id'.add_const _).aemeasurable hXm, hX,
gaussianReal_map_add_const y] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_add_const | If `X` is a real random variable with Gaussian law with mean `μ` and variance `v`, then `X + y`
has Gaussian law with mean `μ + y` and variance `v`. |
gaussianReal_const_add {X : Ω → ℝ} (hX : Measure.map X ℙ = gaussianReal μ v) (y : ℝ) :
Measure.map (fun ω ↦ y + X ω) ℙ = gaussianReal (μ + y) v := by
simp_rw [add_comm y]
exact gaussianReal_add_const hX y | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_const_add | If `X` is a real random variable with Gaussian law with mean `μ` and variance `v`, then `y + X`
has Gaussian law with mean `μ + y` and variance `v`. |
gaussianReal_const_mul {X : Ω → ℝ} (hX : Measure.map X ℙ = gaussianReal μ v) (c : ℝ) :
Measure.map (fun ω ↦ c * X ω) ℙ = gaussianReal (c * μ) (⟨c^2, sq_nonneg _⟩ * v) := by
have hXm : AEMeasurable X := aemeasurable_of_map_neZero (by rw [hX]; infer_instance)
change Measure.map ((fun ω ↦ c * ω) ∘ X) ℙ = gaussianReal (c * μ) (⟨c^2, sq_nonneg _⟩ * v)
rw [← AEMeasurable.map_map_of_aemeasurable (measurable_id'.const_mul c).aemeasurable hXm, hX]
exact gaussianReal_map_const_mul c | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_const_mul | If `X` is a real random variable with Gaussian law with mean `μ` and variance `v`, then `c * X`
has Gaussian law with mean `c * μ` and variance `c^2 * v`. |
gaussianReal_mul_const {X : Ω → ℝ} (hX : Measure.map X ℙ = gaussianReal μ v) (c : ℝ) :
Measure.map (fun ω ↦ X ω * c) ℙ = gaussianReal (c * μ) (⟨c^2, sq_nonneg _⟩ * v) := by
simp_rw [mul_comm _ c]
exact gaussianReal_const_mul hX c | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_mul_const | If `X` is a real random variable with Gaussian law with mean `μ` and variance `v`, then `X * c`
has Gaussian law with mean `c * μ` and variance `c^2 * v`. |
complexMGF_id_gaussianReal (z : ℂ) :
complexMGF id (gaussianReal μ v) z = cexp (z * μ + v * z ^ 2 / 2) := by
by_cases hv : v = 0
· simp [complexMGF, hv]
calc ∫ x, cexp (z * x) ∂gaussianReal μ v
_ = ∫ x, gaussianPDFReal μ v x * cexp (z * x) ∂ℙ := by
simp_rw [integral_gaussianReal_eq_integral_smul hv, Complex.real_smul]
_ = (√(2 * π * v))⁻¹
* ∫ x : ℝ, cexp (-(2 * v)⁻¹ * x ^ 2 + (z + μ / v) * x + -μ ^ 2 / (2 * v)) ∂ℙ := by
unfold gaussianPDFReal
push_cast
simp_rw [mul_assoc, integral_const_mul, ← Complex.exp_add]
congr with x
congr 1
ring
_ = (√(2 * π * v))⁻¹ * (π / - -(2 * v)⁻¹) ^ (1 / 2 : ℂ)
* cexp (-μ ^ 2 / (2 * v) - (z + μ / v) ^ 2 / (4 * -(2 * v)⁻¹)) := by
rw [integral_cexp_quadratic (by simpa using pos_iff_ne_zero.mpr hv), ← mul_assoc]
_ = 1 * cexp (-μ ^ 2 / (2 * v) - (z + μ / v) ^ 2 / (4 * -(2 * v)⁻¹)) := by
congr 1
simp only [field, sqrt_eq_rpow, one_div, ofReal_inv, NNReal.coe_inv, NNReal.coe_mul,
NNReal.coe_ofNat, ofReal_mul, ofReal_ofNat, neg_neg, div_inv_eq_mul,
ne_eq, ofReal_eq_zero, rpow_eq_zero, not_false_eq_true]
rw [Complex.ofReal_cpow (by positivity)]
push_cast
ring_nf
_ = cexp (z * μ + v * z ^ 2 / 2) := by
rw [one_mul]
congr 1
have : (v : ℂ) ≠ 0 := by simpa
simp [field]
ring | theorem | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | complexMGF_id_gaussianReal | The complex moment-generating function of a Gaussian distribution with mean `μ` and variance `v`
is given by `z ↦ exp (z * μ + v * z ^ 2 / 2)`. |
complexMGF_gaussianReal (hX : p.map X = gaussianReal μ v) (z : ℂ) :
complexMGF X p z = cexp (z * μ + v * z ^ 2 / 2) := by
have hX_meas : AEMeasurable X p := aemeasurable_of_map_neZero (by rw [hX]; infer_instance)
rw [← complexMGF_id_map hX_meas, hX, complexMGF_id_gaussianReal] | theorem | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | complexMGF_gaussianReal | The complex moment-generating function of a random variable with Gaussian distribution
with mean `μ` and variance `v` is given by `z ↦ exp (z * μ + v * z ^ 2 / 2)`. |
charFun_gaussianReal (t : ℝ) :
charFun (gaussianReal μ v) t = cexp (t * μ * I - v * t ^ 2 / 2) := by
rw [← complexMGF_id_mul_I, complexMGF_id_gaussianReal]
congr
simp only [mul_pow, I_sq, mul_neg, mul_one, sub_eq_add_neg]
ring_nf | theorem | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | charFun_gaussianReal | The characteristic function of a Gaussian distribution with mean `μ` and variance `v`
is given by `t ↦ exp (t * μ - v * t ^ 2 / 2)`. |
mgf_gaussianReal (hX : p.map X = gaussianReal μ v) (t : ℝ) :
mgf X p t = rexp (μ * t + v * t ^ 2 / 2) := by
suffices (mgf X p t : ℂ) = rexp (μ * t + ↑v * t ^ 2 / 2) from mod_cast this
have hX_meas : AEMeasurable X p := aemeasurable_of_map_neZero (by rw [hX]; infer_instance)
rw [← mgf_id_map hX_meas, ← complexMGF_ofReal, hX, complexMGF_id_gaussianReal, mul_comm μ]
norm_cast | theorem | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | mgf_gaussianReal | The moment-generating function of a random variable with Gaussian distribution
with mean `μ` and variance `v` is given by `t ↦ exp (μ * t + v * t ^ 2 / 2)`. |
mgf_fun_id_gaussianReal :
mgf (fun x ↦ x) (gaussianReal μ v) = fun t ↦ rexp (μ * t + v * t ^ 2 / 2) := by
ext t
rw [mgf_gaussianReal]
simp | theorem | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | mgf_fun_id_gaussianReal | null |
mgf_id_gaussianReal : mgf id (gaussianReal μ v) = fun t ↦ rexp (μ * t + v * t ^ 2 / 2) :=
mgf_fun_id_gaussianReal | theorem | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | mgf_id_gaussianReal | null |
cgf_gaussianReal (hX : p.map X = gaussianReal μ v) (t : ℝ) :
cgf X p t = μ * t + v * t ^ 2 / 2 := by
rw [cgf, mgf_gaussianReal hX t, Real.log_exp] | theorem | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | cgf_gaussianReal | The cumulant-generating function of a random variable with Gaussian distribution
with mean `μ` and variance `v` is given by `t ↦ μ * t + v * t ^ 2 / 2`. |
integrable_exp_mul_gaussianReal (t : ℝ) :
Integrable (fun x ↦ rexp (t * x)) (gaussianReal μ v) := by
rw [← mgf_pos_iff, mgf_gaussianReal (μ := μ) (v := v) (by simp)]
exact Real.exp_pos _
@[simp] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | integrable_exp_mul_gaussianReal | null |
integrableExpSet_id_gaussianReal : integrableExpSet id (gaussianReal μ v) = Set.univ := by
ext
simpa [integrableExpSet] using integrable_exp_mul_gaussianReal _
@[simp] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | integrableExpSet_id_gaussianReal | null |
integrableExpSet_fun_id_gaussianReal :
integrableExpSet (fun x ↦ x) (gaussianReal μ v) = Set.univ :=
integrableExpSet_id_gaussianReal | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | integrableExpSet_fun_id_gaussianReal | null |
@[simp]
integral_id_gaussianReal : ∫ x, x ∂gaussianReal μ v = μ := by
rw [← deriv_mgf_zero (by simp), mgf_fun_id_gaussianReal, _root_.deriv_exp (by fun_prop)]
simp only [mul_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, zero_div,
add_zero, Real.exp_zero, one_mul]
rw [deriv_fun_add (by fun_prop) (by fun_prop), deriv_fun_mul (by fun_prop) (by fun_prop)]
simp | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | integral_id_gaussianReal | The mean of a real Gaussian distribution `gaussianReal μ v` is its mean parameter `μ`. |
@[simp]
variance_fun_id_gaussianReal : Var[fun x ↦ x; gaussianReal μ v] = v := by
rw [variance_eq_integral measurable_id'.aemeasurable]
simp only [integral_id_gaussianReal]
calc ∫ ω, (ω - μ) ^ 2 ∂gaussianReal μ v
_ = ∫ ω, ω ^ 2 ∂(gaussianReal μ v).map (fun x ↦ x - μ) := by
rw [integral_map (by fun_prop) (by fun_prop)]
_ = ∫ ω, ω ^ 2 ∂(gaussianReal 0 v) := by simp [gaussianReal_map_sub_const]
_ = iteratedDeriv 2 (mgf (fun x ↦ x) (gaussianReal 0 v)) 0 := by
rw [iteratedDeriv_mgf_zero] <;> simp
_ = v := by
rw [mgf_fun_id_gaussianReal, iteratedDeriv_succ, iteratedDeriv_one]
simp only [zero_mul, zero_add]
have : deriv (fun t ↦ rexp (v * t ^ 2 / 2)) = fun t ↦ v * t * rexp (v * t ^ 2 / 2) := by
ext t
rw [_root_.deriv_exp (by fun_prop)]
simp only [deriv_div_const, differentiableAt_const, differentiableAt_fun_id, Nat.cast_ofNat,
DifferentiableAt.fun_pow, deriv_fun_mul, deriv_const', zero_mul, deriv_fun_pow,
Nat.add_one_sub_one, pow_one, deriv_id'', mul_one, zero_add]
ring
rw [this, deriv_fun_mul (by fun_prop) (by fun_prop), deriv_fun_mul (by fun_prop) (by fun_prop)]
simp | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | variance_fun_id_gaussianReal | The variance of a real Gaussian distribution `gaussianReal μ v` is
its variance parameter `v`. |
@[simp]
variance_id_gaussianReal : Var[id; gaussianReal μ v] = v :=
variance_fun_id_gaussianReal | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | variance_id_gaussianReal | The variance of a real Gaussian distribution `gaussianReal μ v` is
its variance parameter `v`. |
memLp_id_gaussianReal (p : ℝ≥0) : MemLp id p (gaussianReal μ v) :=
memLp_of_mem_interior_integrableExpSet (by simp) p | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | memLp_id_gaussianReal | All the moments of a real Gaussian distribution are finite. That is, the identity is in Lp for
all finite `p`. |
memLp_id_gaussianReal' (p : ℝ≥0∞) (hp : p ≠ ∞) : MemLp id p (gaussianReal μ v) := by
lift p to ℝ≥0 using hp
exact memLp_id_gaussianReal p | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | memLp_id_gaussianReal' | All the moments of a real Gaussian distribution are finite. That is, the identity is in Lp for
all finite `p`. |
gaussianReal_map_linearMap (L : ℝ →ₗ[ℝ] ℝ) :
(gaussianReal μ v).map L = gaussianReal (L μ) ((L 1 ^ 2).toNNReal * v) := by
have : (L : ℝ → ℝ) = fun x ↦ L 1 * x := by
ext x
have : x = x • 1 := by simp
conv_lhs => rw [this, L.map_smul, smul_eq_mul, mul_comm]
rw [this, gaussianReal_map_const_mul]
congr
simp only [mul_one, left_eq_sup]
positivity | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_map_linearMap | null |
gaussianReal_map_continuousLinearMap (L : ℝ →L[ℝ] ℝ) :
(gaussianReal μ v).map L = gaussianReal (L μ) ((L 1 ^ 2).toNNReal * v) :=
gaussianReal_map_linearMap L
@[simp] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_map_continuousLinearMap | null |
integral_linearMap_gaussianReal (L : ℝ →ₗ[ℝ] ℝ) :
∫ x, L x ∂(gaussianReal μ v) = L μ := by
have : ∫ x, L x ∂(gaussianReal μ v) = ∫ x, x ∂((gaussianReal μ v).map L) := by
rw [integral_map (φ := L) (by fun_prop) (by fun_prop)]
simp [this, gaussianReal_map_linearMap]
@[simp] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | integral_linearMap_gaussianReal | null |
integral_continuousLinearMap_gaussianReal (L : ℝ →L[ℝ] ℝ) :
∫ x, L x ∂(gaussianReal μ v) = L μ := integral_linearMap_gaussianReal L
@[simp] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | integral_continuousLinearMap_gaussianReal | null |
variance_linearMap_gaussianReal (L : ℝ →ₗ[ℝ] ℝ) :
Var[L; gaussianReal μ v] = (L 1 ^ 2).toNNReal * v := by
rw [← variance_id_map, gaussianReal_map_linearMap, variance_id_gaussianReal]
· simp only [NNReal.coe_mul, Real.coe_toNNReal']
· fun_prop
@[simp] | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | variance_linearMap_gaussianReal | null |
variance_continuousLinearMap_gaussianReal (L : ℝ →L[ℝ] ℝ) :
Var[L; gaussianReal μ v] = (L 1 ^ 2).toNNReal * v :=
variance_linearMap_gaussianReal L | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | variance_continuousLinearMap_gaussianReal | null |
gaussianReal_conv_gaussianReal {m₁ m₂ : ℝ} {v₁ v₂ : ℝ≥0} :
(gaussianReal m₁ v₁) ∗ (gaussianReal m₂ v₂) = gaussianReal (m₁ + m₂) (v₁ + v₂) := by
refine Measure.ext_of_charFun ?_
ext t
simp_rw [charFun_conv, charFun_gaussianReal]
rw [← Complex.exp_add]
simp only [Complex.ofReal_add, NNReal.coe_add]
ring_nf
/- The sum of two real Gaussian variables with means `m₁, m₂` and variances `v₁, v₂` is a real
Gaussian distribution with mean `m₁ + m₂` and variance `v_1 + v_2`. -/ | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_conv_gaussianReal | The convolution of two real Gaussian distributions with means `m₁, m₂` and variances `v₁, v₂`
is a real Gaussian distribution with mean `m₁ + m₂` and variance `v₁ + v₂`. |
gaussianReal_add_gaussianReal_of_indepFun {Ω} {mΩ : MeasurableSpace Ω} {P : Measure Ω}
{m₁ m₂ : ℝ} {v₁ v₂ : ℝ≥0} {X Y : Ω → ℝ} (hXY : IndepFun X Y P)
(hX : P.map X = gaussianReal m₁ v₁) (hY : P.map Y = gaussianReal m₂ v₂) :
P.map (X + Y) = gaussianReal (m₁ + m₂) (v₁ + v₂) := by
rw [hXY.map_add_eq_map_conv_map₀', hX, hY, gaussianReal_conv_gaussianReal]
· apply AEMeasurable.of_map_ne_zero; simp [NeZero.ne, hX]
· apply AEMeasurable.of_map_ne_zero; simp [NeZero.ne, hY]
· rw [hX]; apply IsFiniteMeasure.toSigmaFinite
· rw [hY]; apply IsFiniteMeasure.toSigmaFinite | lemma | Probability | [
"Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform",
"Mathlib.MeasureTheory.Group.Convolution",
"Mathlib.Probability.Moments.MGFAnalytic",
"Mathlib.Probability.Independence.Basic"
] | Mathlib/Probability/Distributions/Gaussian/Real.lean | gaussianReal_add_gaussianReal_of_indepFun | null |
MutuallySingular.compProd_of_right (μ ν : Measure α) (hκη : ∀ᵐ a ∂μ, κ a ⟂ₘ η a) :
μ ⊗ₘ κ ⟂ₘ ν ⊗ₘ η := by
by_cases hμ : SFinite μ
swap; · rw [compProd_of_not_sfinite _ _ hμ]; simp
by_cases hν : SFinite ν
swap; · rw [compProd_of_not_sfinite _ _ hν]; simp
let s := κ.mutuallySingularSet η
have hs : MeasurableSet s := Kernel.measurableSet_mutuallySingularSet κ η
symm
refine ⟨s, hs, ?_⟩
rw [compProd_apply hs, compProd_apply hs.compl]
have h_eq a : Prod.mk a ⁻¹' s = Kernel.mutuallySingularSetSlice κ η a := rfl
have h1 a : η a (Prod.mk a ⁻¹' s) = 0 := by rw [h_eq, Kernel.measure_mutuallySingularSetSlice]
have h2 : ∀ᵐ a ∂μ, κ a (Prod.mk a ⁻¹' s)ᶜ = 0 := by
filter_upwards [hκη] with a ha
rwa [h_eq, ← Kernel.withDensity_rnDeriv_eq_zero_iff_measure_eq_zero κ η a,
Kernel.withDensity_rnDeriv_eq_zero_iff_mutuallySingular]
simp [h1, lintegral_congr_ae h2] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.MeasureCompProd",
"Mathlib.Probability.Kernel.RadonNikodym"
] | Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean | MutuallySingular.compProd_of_right | null |
MutuallySingular.compProd_of_right' (μ ν : Measure α) (hκη : ∀ᵐ a ∂ν, κ a ⟂ₘ η a) :
μ ⊗ₘ κ ⟂ₘ ν ⊗ₘ η := by
refine (MutuallySingular.compProd_of_right _ _ ?_).symm
simp_rw [MutuallySingular.comm, hκη] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.MeasureCompProd",
"Mathlib.Probability.Kernel.RadonNikodym"
] | Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean | MutuallySingular.compProd_of_right' | null |
mutuallySingular_compProd_right_iff [SFinite μ] :
μ ⊗ₘ κ ⟂ₘ μ ⊗ₘ η ↔ ∀ᵐ a ∂μ, κ a ⟂ₘ η a :=
⟨fun h ↦ mutuallySingular_of_mutuallySingular_compProd h AbsolutelyContinuous.rfl
AbsolutelyContinuous.rfl, MutuallySingular.compProd_of_right _ _⟩ | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.MeasureCompProd",
"Mathlib.Probability.Kernel.RadonNikodym"
] | Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean | mutuallySingular_compProd_right_iff | null |
AbsolutelyContinuous.kernel_of_compProd [SFinite μ] (h : μ ⊗ₘ κ ≪ ν ⊗ₘ η) :
∀ᵐ a ∂μ, κ a ≪ η a := by
suffices ∀ᵐ a ∂μ, κ.singularPart η a = 0 by
filter_upwards [this] with a ha
rwa [Kernel.singularPart_eq_zero_iff_absolutelyContinuous] at ha
rw [← κ.rnDeriv_add_singularPart η, compProd_add_right, AbsolutelyContinuous.add_left_iff] at h
have : μ ⊗ₘ κ.singularPart η ⟂ₘ ν ⊗ₘ η :=
MutuallySingular.compProd_of_right μ ν (.of_forall <| Kernel.mutuallySingular_singularPart _ _)
refine compProd_eq_zero_iff.mp ?_
exact eq_zero_of_absolutelyContinuous_of_mutuallySingular h.2 this | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.MeasureCompProd",
"Mathlib.Probability.Kernel.RadonNikodym"
] | Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean | AbsolutelyContinuous.kernel_of_compProd | null |
absolutelyContinuous_compProd_iff' [SFinite μ] [SFinite ν] [∀ a, NeZero (κ a)] :
μ ⊗ₘ κ ≪ ν ⊗ₘ η ↔ μ ≪ ν ∧ ∀ᵐ a ∂μ, κ a ≪ η a :=
⟨fun h ↦ ⟨absolutelyContinuous_of_compProd h, h.kernel_of_compProd⟩, fun h ↦ h.1.compProd h.2⟩ | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.MeasureCompProd",
"Mathlib.Probability.Kernel.RadonNikodym"
] | Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean | absolutelyContinuous_compProd_iff' | null |
absolutelyContinuous_compProd_right_iff [SFinite μ] :
μ ⊗ₘ κ ≪ μ ⊗ₘ η ↔ ∀ᵐ a ∂μ, κ a ≪ η a :=
⟨AbsolutelyContinuous.kernel_of_compProd, AbsolutelyContinuous.compProd_right⟩ | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.MeasureCompProd",
"Mathlib.Probability.Kernel.RadonNikodym"
] | Mathlib/Probability/Kernel/Composition/AbsolutelyContinuous.lean | absolutelyContinuous_compProd_right_iff | null |
noncomputable comp (η : Kernel β γ) (κ : Kernel α β) : Kernel α γ where
toFun a := (κ a).bind η
measurable' := (Measure.measurable_bind' η.measurable).comp κ.measurable
@[inherit_doc]
scoped[ProbabilityTheory] infixl:100 " ∘ₖ " => ProbabilityTheory.Kernel.comp | def | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp | Composition of two kernels. |
comp_apply (η : Kernel β γ) (κ : Kernel α β) (a : α) : (η ∘ₖ κ) a = (κ a).bind η :=
rfl | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_apply | null |
comp_apply' (η : Kernel β γ) (κ : Kernel α β) (a : α) {s : Set γ} (hs : MeasurableSet s) :
(η ∘ₖ κ) a s = ∫⁻ b, η b s ∂κ a := by
rw [comp_apply, Measure.bind_apply hs (Kernel.aemeasurable _)] | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_apply' | null |
comp_apply_univ_le (κ : Kernel α β) (η : Kernel β γ) (a : α) :
(η ∘ₖ κ) a Set.univ ≤ κ a Set.univ * η.bound := by
rw [comp_apply' _ _ _ .univ]
let Cη := η.bound
calc
∫⁻ b, η b Set.univ ∂κ a ≤ ∫⁻ _, Cη ∂κ a :=
lintegral_mono fun b => measure_le_bound η b Set.univ
_ = Cη * κ a Set.univ := MeasureTheory.lintegral_const Cη
_ = κ a Set.univ * Cη := mul_comm _ _
@[simp] lemma zero_comp (κ : Kernel α β) : (0 : Kernel β γ) ∘ₖ κ = 0 := by ext; simp [comp_apply]
@[simp] lemma comp_zero (κ : Kernel β γ) : κ ∘ₖ (0 : Kernel α β) = 0 := by ext; simp [comp_apply] | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_apply_univ_le | null |
ae_lt_top_of_comp_ne_top (a : α) (hs : (η ∘ₖ κ) a s ≠ ∞) : ∀ᵐ b ∂κ a, η b s < ∞ := by
have h : ∀ᵐ b ∂κ a, η b (toMeasurable ((η ∘ₖ κ) a) s) < ∞ := by
refine ae_lt_top (Kernel.measurable_coe η (measurableSet_toMeasurable ..)) ?_
rwa [← Kernel.comp_apply' _ _ _ (measurableSet_toMeasurable ..), measure_toMeasurable]
filter_upwards [h] with b hb using (measure_mono (subset_toMeasurable _ _)).trans_lt hb | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | ae_lt_top_of_comp_ne_top | null |
comp_null (a : α) (hs : MeasurableSet s) :
(η ∘ₖ κ) a s = 0 ↔ (fun y ↦ η y s) =ᵐ[κ a] 0 := by
rw [comp_apply' _ _ _ hs, lintegral_eq_zero_iff (η.measurable_coe hs)] | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_null | null |
ae_null_of_comp_null (h : (η ∘ₖ κ) a s = 0) : (η · s) =ᵐ[κ a] 0 := by
obtain ⟨t, hst, mt, ht⟩ := exists_measurable_superset_of_null h
simp_rw [comp_null a mt] at ht
rw [Filter.eventuallyLE_antisymm_iff]
exact ⟨Filter.EventuallyLE.trans_eq (ae_of_all _ fun _ ↦ measure_mono hst) ht,
ae_of_all _ fun _ ↦ zero_le _⟩
variable {p : γ → Prop} | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | ae_null_of_comp_null | null |
ae_ae_of_ae_comp (h : ∀ᵐ z ∂(η ∘ₖ κ) a, p z) :
∀ᵐ y ∂κ a, ∀ᵐ z ∂η y, p z := ae_null_of_comp_null h | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | ae_ae_of_ae_comp | null |
ae_comp_of_ae_ae (hp : MeasurableSet {z | p z})
(h : ∀ᵐ y ∂κ a, ∀ᵐ z ∂η y, p z) : ∀ᵐ z ∂(η ∘ₖ κ) a, p z := by
rwa [ae_iff, comp_null] at *
exact hp.compl | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | ae_comp_of_ae_ae | null |
ae_comp_iff (hp : MeasurableSet {z | p z}) :
(∀ᵐ z ∂(η ∘ₖ κ) a, p z) ↔ ∀ᵐ y ∂κ a, ∀ᵐ z ∂η y, p z :=
⟨ae_ae_of_ae_comp, ae_comp_of_ae_ae hp⟩ | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | ae_comp_iff | null |
comp_restrict {s : Set γ} (hs : MeasurableSet s) :
η.restrict hs ∘ₖ κ = (η ∘ₖ κ).restrict hs := by
ext a t ht
simp_rw [comp_apply' _ _ _ ht, restrict_apply' _ _ _ ht, comp_apply' _ _ _ (ht.inter hs)] | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_restrict | null |
lintegral_comp (η : Kernel β γ) (κ : Kernel α β) (a : α) {g : γ → ℝ≥0∞}
(hg : Measurable g) : ∫⁻ c, g c ∂(η ∘ₖ κ) a = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a := by
rw [comp_apply, Measure.lintegral_bind (Kernel.aemeasurable _) hg.aemeasurable] | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | lintegral_comp | null |
comp_assoc {δ : Type*} {mδ : MeasurableSpace δ} (ξ : Kernel γ δ)
(η : Kernel β γ) (κ : Kernel α β) : ξ ∘ₖ η ∘ₖ κ = ξ ∘ₖ (η ∘ₖ κ) := by
refine ext_fun fun a f hf => ?_
simp_rw [lintegral_comp _ _ _ hf, lintegral_comp _ _ _ hf.lintegral_kernel] | theorem | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_assoc | Composition of kernels is associative. |
comp_discard' (κ : Kernel α β) :
discard β ∘ₖ κ =
{ toFun a := κ a .univ • Measure.dirac ()
measurable' := (κ.measurable_coe .univ).smul_measure _ } := by
ext a s hs
simp [comp_apply' _ _ _ hs, mul_comm]
@[simp] | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_discard' | null |
comp_discard (κ : Kernel α β) [IsMarkovKernel κ] : discard β ∘ₖ κ = discard α := by
ext; simp [comp_discard']
@[simp] | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_discard | null |
swap_copy : (swap α α) ∘ₖ (copy α) = copy α := by
ext a s hs
rw [comp_apply, copy_apply, Measure.dirac_bind (Kernel.measurable _), swap_apply' _ hs,
Measure.dirac_apply' _ hs]
congr | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | swap_copy | null |
const_comp (μ : Measure γ) (κ : Kernel α β) :
const β μ ∘ₖ κ = fun a ↦ (κ a) Set.univ • μ := by
ext _ _ hs
simp_rw [comp_apply' _ _ _ hs, const_apply, MeasureTheory.lintegral_const, Measure.smul_apply,
smul_eq_mul, mul_comm]
@[simp] | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | const_comp | null |
const_comp' (μ : Measure γ) (κ : Kernel α β) [IsMarkovKernel κ] :
const β μ ∘ₖ κ = const α μ := by
ext; simp_rw [const_comp, measure_univ, one_smul, const_apply] | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | const_comp' | null |
comp_add_right (μ κ : Kernel α β) (η : Kernel β γ) :
η ∘ₖ (μ + κ) = η ∘ₖ μ + η ∘ₖ κ := by ext _ _ hs; simp [comp_apply' _ _ _ hs] | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_add_right | null |
comp_add_left (μ : Kernel α β) (κ η : Kernel β γ) :
(κ + η) ∘ₖ μ = κ ∘ₖ μ + η ∘ₖ μ := by
ext a s hs
simp_rw [comp_apply' _ _ _ hs, add_apply, Measure.add_apply, comp_apply' _ _ _ hs,
lintegral_add_left (Kernel.measurable_coe κ hs)] | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_add_left | null |
comp_sum_right {ι : Type*} [Countable ι] (κ : ι → Kernel α β) (η : Kernel β γ) :
η ∘ₖ Kernel.sum κ = Kernel.sum fun i ↦ η ∘ₖ (κ i) := by
ext _ _ hs
simp_rw [sum_apply, comp_apply' _ _ _ hs, Measure.sum_apply _ hs, sum_apply,
lintegral_sum_measure, comp_apply' _ _ _ hs] | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_sum_right | null |
comp_sum_left {ι : Type*} [Countable ι] (κ : Kernel α β) (η : ι → Kernel β γ) :
(Kernel.sum η) ∘ₖ κ = Kernel.sum (fun i ↦ (η i) ∘ₖ κ) := by
ext _ _ hs
simp_rw [sum_apply, comp_apply' _ _ _ hs, sum_apply, Measure.sum_apply _ hs,
comp_apply' _ _ _ hs]
rw [lintegral_tsum]
exact fun _ ↦ (Kernel.measurable_coe _ hs).aemeasurable | lemma | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | comp_sum_left | null |
IsMarkovKernel.comp (η : Kernel β γ) [IsMarkovKernel η] (κ : Kernel α β)
[IsMarkovKernel κ] : IsMarkovKernel (η ∘ₖ κ) where
isProbabilityMeasure a := by
rw [comp_apply]
constructor
rw [Measure.bind_apply .univ η.aemeasurable]
simp | instance | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | IsMarkovKernel.comp | null |
IsZeroOrMarkovKernel.comp (κ : Kernel α β) [IsZeroOrMarkovKernel κ]
(η : Kernel β γ) [IsZeroOrMarkovKernel η] : IsZeroOrMarkovKernel (η ∘ₖ κ) := by
obtain rfl | _ := eq_zero_or_isMarkovKernel κ <;> obtain rfl | _ := eq_zero_or_isMarkovKernel η
all_goals simpa using by infer_instance | instance | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | IsZeroOrMarkovKernel.comp | null |
IsFiniteKernel.comp (η : Kernel β γ) [IsFiniteKernel η] (κ : Kernel α β)
[IsFiniteKernel κ] : IsFiniteKernel (η ∘ₖ κ) := by
refine ⟨⟨κ.bound * η.bound, ENNReal.mul_lt_top κ.bound_lt_top η.bound_lt_top, fun a ↦ ?_⟩⟩
calc (η ∘ₖ κ) a Set.univ
_ ≤ κ a Set.univ * η.bound := comp_apply_univ_le κ η a
_ ≤ κ.bound * η.bound := mul_le_mul (measure_le_bound κ a Set.univ) le_rfl zero_le' zero_le' | instance | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | IsFiniteKernel.comp | null |
IsSFiniteKernel.comp (η : Kernel β γ) [IsSFiniteKernel η] (κ : Kernel α β)
[IsSFiniteKernel κ] : IsSFiniteKernel (η ∘ₖ κ) := by
simp_rw [← kernel_sum_seq κ, ← kernel_sum_seq η, comp_sum_left, comp_sum_right]
infer_instance | instance | Probability | [
"Mathlib.Probability.Kernel.MeasurableLIntegral"
] | Mathlib/Probability/Kernel/Composition/Comp.lean | IsSFiniteKernel.comp | null |
deterministic_comp_eq_map (hf : Measurable f) (κ : Kernel α β) :
deterministic f hf ∘ₖ κ = map κ f := by
ext a s hs
simp_rw [map_apply' _ hf _ hs, comp_apply' _ _ _ hs, deterministic_apply' hf _ hs,
lintegral_indicator_const_comp hf hs, one_mul] | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | deterministic_comp_eq_map | null |
comp_deterministic_eq_comap (κ : Kernel α β) (hg : Measurable g) :
κ ∘ₖ deterministic g hg = comap κ g hg := by
ext a s hs
simp_rw [comap_apply' _ _ _ s, comp_apply' _ _ _ hs, deterministic_apply hg a,
lintegral_dirac' _ (Kernel.measurable_coe κ hs)] | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | comp_deterministic_eq_comap | null |
deterministic_comp_deterministic (hf : Measurable f) (hg : Measurable g) :
(deterministic g hg) ∘ₖ (deterministic f hf) = deterministic (g ∘ f) (hg.comp hf) := by
ext; simp [comp_deterministic_eq_comap, comap_apply, deterministic_apply]
@[simp] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | deterministic_comp_deterministic | null |
comp_id (κ : Kernel α β) : κ ∘ₖ Kernel.id = κ := by
rw [Kernel.id, comp_deterministic_eq_comap, comap_id]
@[simp] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | comp_id | null |
id_comp (κ : Kernel α β) : Kernel.id ∘ₖ κ = κ := by
rw [Kernel.id, deterministic_comp_eq_map, map_id]
@[simp] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | id_comp | null |
swap_swap : (swap α β) ∘ₖ (swap β α) = Kernel.id := by
simp_rw [swap, Kernel.deterministic_comp_deterministic, Prod.swap_swap_eq, Kernel.id] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | swap_swap | null |
swap_comp_eq_map {κ : Kernel α (β × γ)} : (swap β γ) ∘ₖ κ = κ.map Prod.swap := by
rw [swap, deterministic_comp_eq_map] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | swap_comp_eq_map | null |
map_comp (κ : Kernel α β) (η : Kernel β γ) (f : γ → δ) :
(η ∘ₖ κ).map f = (η.map f) ∘ₖ κ := by
by_cases hf : Measurable f
· ext a s hs
rw [map_apply' _ hf _ hs, comp_apply', comp_apply' _ _ _ hs]
· simp_rw [map_apply' _ hf _ hs]
· exact hf hs
· simp [map_of_not_measurable _ hf] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | map_comp | null |
comp_map (κ : Kernel α β) (η : Kernel γ δ) {f : β → γ} (hf : Measurable f) :
η ∘ₖ (κ.map f) = (η.comap f hf) ∘ₖ κ := by
ext x s ms
rw [comp_apply' _ _ _ ms, lintegral_map _ hf _ (η.measurable_coe ms), comp_apply' _ _ _ ms]
simp_rw [comap_apply'] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | comp_map | null |
fst_comp (κ : Kernel α β) (η : Kernel β (γ × δ)) : (η ∘ₖ κ).fst = η.fst ∘ₖ κ := by
simp [fst_eq, map_comp κ η _] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | fst_comp | null |
snd_comp (κ : Kernel α β) (η : Kernel β (γ × δ)) : (η ∘ₖ κ).snd = η.snd ∘ₖ κ := by
simp_rw [snd_eq, map_comp κ η _] | lemma | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.MapComap"
] | Mathlib/Probability/Kernel/Composition/CompMap.lean | snd_comp | null |
@[simp]
comp_apply_univ [IsMarkovKernel κ] : (κ ∘ₘ μ) Set.univ = μ Set.univ := by
simp [bind_apply .univ κ.aemeasurable] | lemma | Probability | [
"Mathlib.Probability.Kernel.Basic"
] | Mathlib/Probability/Kernel/Composition/CompNotation.lean | comp_apply_univ | null |
deterministic_comp_eq_map {f : α → β} (hf : Measurable f) :
Kernel.deterministic f hf ∘ₘ μ = μ.map f :=
Measure.bind_dirac_eq_map μ hf
@[simp] | lemma | Probability | [
"Mathlib.Probability.Kernel.Basic"
] | Mathlib/Probability/Kernel/Composition/CompNotation.lean | deterministic_comp_eq_map | null |
id_comp : Kernel.id ∘ₘ μ = μ := by rw [Kernel.id, deterministic_comp_eq_map, Measure.map_id] | lemma | Probability | [
"Mathlib.Probability.Kernel.Basic"
] | Mathlib/Probability/Kernel/Composition/CompNotation.lean | id_comp | null |
swap_comp {μ : Measure (α × β)} : (Kernel.swap α β) ∘ₘ μ = μ.map Prod.swap :=
deterministic_comp_eq_map measurable_swap
@[simp] | lemma | Probability | [
"Mathlib.Probability.Kernel.Basic"
] | Mathlib/Probability/Kernel/Composition/CompNotation.lean | swap_comp | null |
const_comp {ν : Measure β} : (Kernel.const α ν) ∘ₘ μ = μ Set.univ • ν := μ.bind_const | lemma | Probability | [
"Mathlib.Probability.Kernel.Basic"
] | Mathlib/Probability/Kernel/Composition/CompNotation.lean | const_comp | null |
lintegral_compProd' (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β → γ → ℝ≥0∞} (hf : Measurable (Function.uncurry f)) :
∫⁻ bc, f bc.1 bc.2 ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, f b c ∂η (a, b) ∂κ a := by
let F : ℕ → SimpleFunc (β × γ) ℝ≥0∞ := SimpleFunc.eapprox (Function.uncurry f)
have h : ∀ a, ⨆ n, F n a = Function.uncurry f a := SimpleFunc.iSup_eapprox_apply hf
simp only [Prod.forall, Function.uncurry_apply_pair] at h
simp_rw [← h]
have h_mono : Monotone F := fun i j hij b =>
SimpleFunc.monotone_eapprox (Function.uncurry f) hij _
rw [lintegral_iSup (fun n => (F n).measurable) h_mono]
have : ∀ b, ∫⁻ c, ⨆ n, F n (b, c) ∂η (a, b) = ⨆ n, ∫⁻ c, F n (b, c) ∂η (a, b) := by
intro a
rw [lintegral_iSup]
· exact fun n => (F n).measurable.comp measurable_prodMk_left
· exact fun i j hij b => h_mono hij _
simp_rw [this]
have h_some_meas_integral :
∀ f' : SimpleFunc (β × γ) ℝ≥0∞, Measurable fun b => ∫⁻ c, f' (b, c) ∂η (a, b) := by
intro f'
have :
(fun b => ∫⁻ c, f' (b, c) ∂η (a, b)) =
(fun ab => ∫⁻ c, f' (ab.2, c) ∂η ab) ∘ fun b => (a, b) := by
ext1 ab; rfl
rw [this]
fun_prop
rw [lintegral_iSup]
rotate_left
· exact fun n => h_some_meas_integral (F n)
· exact fun i j hij b => lintegral_mono fun c => h_mono hij _
congr
ext1 n
refine SimpleFunc.induction ?_ ?_ (F n)
· intro c s hs
simp +unfoldPartialApp only [SimpleFunc.const_zero,
SimpleFunc.coe_piecewise, SimpleFunc.coe_const, SimpleFunc.coe_zero,
Set.piecewise_eq_indicator, Function.const, lintegral_indicator_const hs]
rw [compProd_apply hs, ← lintegral_const_mul c _]
swap
· exact (measurable_kernel_prodMk_left ((measurable_fst.snd.prodMk measurable_snd) hs)).comp
measurable_prodMk_left
congr
ext1 b
rw [lintegral_indicator_const_comp measurable_prodMk_left hs]
· intro f f' _ hf_eq hf'_eq
simp_rw [SimpleFunc.coe_add, Pi.add_apply]
change
∫⁻ x, (f : β × γ → ℝ≥0∞) x + f' x ∂(κ ⊗ₖ η) a =
∫⁻ b, ∫⁻ c : γ, f (b, c) + f' (b, c) ∂η (a, b) ∂κ a
rw [lintegral_add_left (SimpleFunc.measurable _), hf_eq, hf'_eq, ← lintegral_add_left]
swap
· exact h_some_meas_integral f
... | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.ParallelComp"
] | Mathlib/Probability/Kernel/Composition/CompProd.lean | lintegral_compProd' | Composition-Product of kernels. For s-finite kernels, it satisfies
`∫⁻ bc, f bc ∂(compProd κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)`
(see `ProbabilityTheory.Kernel.lintegral_compProd`).
If either of the kernels is not s-finite, `compProd` is given the junk value 0. -/
noncomputable irreducible_def compProd (κ : Kernel α β) (η : Kernel (α × β) γ) : Kernel α (β × γ) :=
swap γ β ∘ₖ (η ∥ₖ Kernel.id)
∘ₖ deterministic MeasurableEquiv.prodAssoc.symm (MeasurableEquiv.measurable _)
∘ₖ (Kernel.id ∥ₖ copy β) ∘ₖ (Kernel.id ∥ₖ κ) ∘ₖ copy α
@[inherit_doc]
scoped[ProbabilityTheory] infixl:100 " ⊗ₖ " => ProbabilityTheory.Kernel.compProd
@[simp]
theorem compProd_of_not_isSFiniteKernel_left (κ : Kernel α β) (η : Kernel (α × β) γ)
(h : ¬ IsSFiniteKernel κ) :
κ ⊗ₖ η = 0 := by
simp [compProd, h]
@[simp]
theorem compProd_of_not_isSFiniteKernel_right (κ : Kernel α β) (η : Kernel (α × β) γ)
(h : ¬ IsSFiniteKernel η) :
κ ⊗ₖ η = 0 := by
simp [compProd, h]
theorem compProd_apply (hs : MeasurableSet s) (κ : Kernel α β) [IsSFiniteKernel κ]
(η : Kernel (α × β) γ) [IsSFiniteKernel η] (a : α) :
(κ ⊗ₖ η) a s = ∫⁻ b, η (a, b) (Prod.mk b ⁻¹' s) ∂κ a := by
rw [compProd, comp_apply, copy_apply, Measure.dirac_bind (by fun_prop), comp_apply,
parallelComp_apply, Kernel.id_apply, Measure.bind_apply hs (by fun_prop),
lintegral_prod _ (Kernel.measurable_coe _ hs).aemeasurable, lintegral_dirac']
swap
· suffices Measurable fun p : α × β ↦
(swap γ β ∘ₖ (η ∥ₖ Kernel.id)
∘ₖ deterministic MeasurableEquiv.prodAssoc.symm (MeasurableEquiv.measurable _)
∘ₖ (Kernel.id ∥ₖ copy β)) p s by fun_prop
exact Kernel.measurable_coe _ hs
congr with b
rw [comp_apply, parallelComp_apply, Kernel.id_apply, copy_apply, Measure.dirac_prod_dirac,
Measure.dirac_bind (by fun_prop), comp_apply, deterministic_apply (by fun_prop),
Measure.dirac_bind (by fun_prop), comp_apply]
simp only [MeasurableEquiv.prodAssoc, MeasurableEquiv.symm_mk, MeasurableEquiv.coe_mk,
Equiv.prodAssoc_symm_apply]
rw [parallelComp_apply, Kernel.id_apply, Measure.bind_apply hs (by fun_prop),
lintegral_prod _ (Kernel.measurable_coe _ hs).aemeasurable]
classical
have h_int x : ∫⁻ y, swap γ β (x, y) s ∂Measure.dirac b = (Prod.mk b ⁻¹' s).indicator 1 x := by
rw [lintegral_dirac']
· simp [swap_apply' _ hs, Set.indicator_apply]
· simpa [swap_apply' _ hs, Prod.swap_prod_mk] using
measurable_const.indicator (measurable_prodMk_right hs)
simp_rw [h_int]
rw [lintegral_indicator_one]
exact measurable_prodMk_left hs
theorem le_compProd_apply (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) (s : Set (β × γ)) :
∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a ≤ (κ ⊗ₖ η) a s :=
calc
∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a ≤
∫⁻ b, η (a, b) {c | (b, c) ∈ toMeasurable ((κ ⊗ₖ η) a) s} ∂κ a :=
lintegral_mono fun _ => measure_mono fun _ h_mem => subset_toMeasurable _ _ h_mem
_ = (κ ⊗ₖ η) a (toMeasurable ((κ ⊗ₖ η) a) s) :=
(compProd_apply (measurableSet_toMeasurable _ _) κ η a).symm
_ = (κ ⊗ₖ η) a s := measure_toMeasurable s
@[simp]
lemma compProd_apply_univ {κ : Kernel α β} {η : Kernel (α × β) γ}
[IsSFiniteKernel κ] [IsMarkovKernel η] {a : α} :
(κ ⊗ₖ η) a Set.univ = κ a Set.univ := by
rw [compProd_apply MeasurableSet.univ]
simp
lemma compProd_apply_prod {κ : Kernel α β} {η : Kernel (α × β) γ}
[IsSFiniteKernel κ] [IsSFiniteKernel η] {a : α}
{s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht : MeasurableSet t) :
(κ ⊗ₖ η) a (s ×ˢ t) = ∫⁻ b in s, η (a, b) t ∂(κ a) := by
rw [compProd_apply (hs.prod ht), ← lintegral_indicator hs]
congr with a
by_cases ha : a ∈ s <;> simp [ha]
lemma compProd_congr {κ : Kernel α β} {η η' : Kernel (α × β) γ}
[IsSFiniteKernel η] [IsSFiniteKernel η'] (h : ∀ a, ∀ᵐ b ∂(κ a), η (a, b) = η' (a, b)) :
κ ⊗ₖ η = κ ⊗ₖ η' := by
by_cases hκ : IsSFiniteKernel κ
swap; · simp_rw [compProd_of_not_isSFiniteKernel_left _ _ hκ]
ext a s hs
rw [compProd_apply hs, compProd_apply hs]
refine lintegral_congr_ae ?_
filter_upwards [h a] with b hb using by rw [hb]
@[simp]
lemma compProd_zero_left (κ : Kernel (α × β) γ) :
(0 : Kernel α β) ⊗ₖ κ = 0 := by
by_cases h : IsSFiniteKernel κ
· ext a s hs
rw [Kernel.compProd_apply hs]
simp
· rw [Kernel.compProd_of_not_isSFiniteKernel_right _ _ h]
@[simp]
lemma compProd_zero_right (κ : Kernel α β) (γ : Type*) {mγ : MeasurableSpace γ} :
κ ⊗ₖ (0 : Kernel (α × β) γ) = 0 := by
by_cases h : IsSFiniteKernel κ
· ext a s hs
rw [Kernel.compProd_apply hs]
simp
· rw [Kernel.compProd_of_not_isSFiniteKernel_left _ _ h]
lemma compProd_eq_zero_iff {κ : Kernel α β} {η : Kernel (α × β) γ}
[IsSFiniteKernel κ] [IsSFiniteKernel η] :
κ ⊗ₖ η = 0 ↔ ∀ a, ∀ᵐ b ∂(κ a), η (a, b) = 0 := by
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· simp_rw [← Measure.measure_univ_eq_zero]
refine fun a ↦ (lintegral_eq_zero_iff ?_).mp ?_
· exact (η.measurable_coe .univ).comp measurable_prodMk_left
· rw [← setLIntegral_univ, ← Kernel.compProd_apply_prod .univ .univ, h]
simp
· rw [← Kernel.compProd_zero_right κ]
exact Kernel.compProd_congr h
lemma compProd_preimage_fst {s : Set β} (hs : MeasurableSet s) (κ : Kernel α β)
(η : Kernel (α × β) γ) [IsSFiniteKernel κ] [IsMarkovKernel η] (x : α) :
(κ ⊗ₖ η) x (Prod.fst ⁻¹' s) = κ x s := by
classical
simp_rw [compProd_apply (measurable_fst hs), ← Set.preimage_comp, Prod.fst_comp_mk, Set.preimage,
Function.const_apply]
have : ∀ b : β, η (x, b) {_c | b ∈ s} = s.indicator (fun _ ↦ 1) b := by
intro b
by_cases hb : b ∈ s <;> simp [hb]
simp_rw [this]
rw [lintegral_indicator_const hs, one_mul]
lemma compProd_deterministic_apply [MeasurableSingletonClass γ] {f : α × β → γ} (hf : Measurable f)
{s : Set (β × γ)} (hs : MeasurableSet s) (κ : Kernel α β) [IsSFiniteKernel κ] (x : α) :
(κ ⊗ₖ deterministic f hf) x s = κ x {b | (b, f (x, b)) ∈ s} := by
classical
simp only [deterministic_apply, Measure.dirac_apply,
Set.indicator_apply, Pi.one_apply, compProd_apply hs]
let t := {b | (b, f (x, b)) ∈ s}
have ht : MeasurableSet t := (measurable_id.prodMk (hf.comp measurable_prodMk_left)) hs
rw [← lintegral_add_compl _ ht]
convert add_zero _
· suffices ∀ b ∈ tᶜ, (if f (x, b) ∈ Prod.mk b ⁻¹' s then (1 : ℝ≥0∞) else 0) = 0 by
rw [setLIntegral_congr_fun ht.compl this, lintegral_zero]
intro b hb
simp only [t, Set.mem_compl_iff, Set.mem_setOf_eq] at hb
simp [hb]
· suffices ∀ b ∈ t, (if f (x, b) ∈ Prod.mk b ⁻¹' s then (1 : ℝ≥0∞) else 0) = 1 by
rw [setLIntegral_congr_fun ht this, setLIntegral_one]
intro b hb
simp only [t, Set.mem_setOf_eq] at hb
simp [hb]
section Ae
/-! ### `ae` filter of the composition-product -/
variable {κ : Kernel α β} [IsSFiniteKernel κ] {η : Kernel (α × β) γ} [IsSFiniteKernel η] {a : α}
theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' s) < ∞ := by
let t := toMeasurable ((κ ⊗ₖ η) a) s
have : ∀ b : β, η (a, b) (Prod.mk b ⁻¹' s) ≤ η (a, b) (Prod.mk b ⁻¹' t) := fun b =>
measure_mono (Set.preimage_mono (subset_toMeasurable _ _))
have ht : MeasurableSet t := measurableSet_toMeasurable _ _
have h2t : (κ ⊗ₖ η) a t ≠ ∞ := by rwa [measure_toMeasurable]
have ht_lt_top : ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' t) < ∞ := by
rw [Kernel.compProd_apply ht] at h2t
exact ae_lt_top (Kernel.measurable_kernel_prodMk_left' ht a) h2t
filter_upwards [ht_lt_top] with b hb
exact (this b).trans_lt hb
theorem compProd_null (a : α) (hs : MeasurableSet s) :
(κ ⊗ₖ η) a s = 0 ↔ (fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 := by
rw [Kernel.compProd_apply hs, lintegral_eq_zero_iff]
exact Kernel.measurable_kernel_prodMk_left' hs a
theorem ae_null_of_compProd_null (h : (κ ⊗ₖ η) a s = 0) :
(fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 := by
obtain ⟨t, hst, mt, ht⟩ := exists_measurable_superset_of_null h
simp_rw [compProd_null a mt] at ht
rw [Filter.eventuallyLE_antisymm_iff]
exact
⟨Filter.EventuallyLE.trans_eq
(Filter.Eventually.of_forall fun x => measure_mono (Set.preimage_mono hst)) ht,
Filter.Eventually.of_forall fun x => zero_le _⟩
theorem ae_ae_of_ae_compProd {p : β × γ → Prop} (h : ∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc) :
∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c) :=
ae_null_of_compProd_null h
lemma ae_compProd_of_ae_ae {κ : Kernel α β} {η : Kernel (α × β) γ}
{p : β × γ → Prop} (hp : MeasurableSet {x | p x})
(h : ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c)) :
∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc := by
by_cases hκ : IsSFiniteKernel κ
swap; · simp [compProd_of_not_isSFiniteKernel_left _ _ hκ]
by_cases hη : IsSFiniteKernel η
swap; · simp [compProd_of_not_isSFiniteKernel_right _ _ hη]
simp_rw [ae_iff] at h ⊢
rw [compProd_null]
· exact h
· exact hp.compl
lemma ae_compProd_iff {p : β × γ → Prop} (hp : MeasurableSet {x | p x}) :
(∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc) ↔ ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c) :=
⟨fun h ↦ ae_ae_of_ae_compProd h, fun h ↦ ae_compProd_of_ae_ae hp h⟩
end Ae
section Restrict
variable {κ : Kernel α β} [IsSFiniteKernel κ] {η : Kernel (α × β) γ} [IsSFiniteKernel η]
theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht : MeasurableSet t) :
Kernel.restrict κ hs ⊗ₖ Kernel.restrict η ht = Kernel.restrict (κ ⊗ₖ η) (hs.prod ht) := by
ext a u hu
rw [compProd_apply hu, restrict_apply' _ _ _ hu, compProd_apply (hu.inter (hs.prod ht))]
simp only [restrict_apply, Set.preimage, Measure.restrict_apply' ht, Set.mem_inter_iff,
Set.mem_prod]
have (b : _) : η (a, b) {c : γ | (b, c) ∈ u ∧ b ∈ s ∧ c ∈ t} =
s.indicator (fun b => η (a, b) ({c : γ | (b, c) ∈ u} ∩ t)) b := by
classical
rw [Set.indicator_apply]
split_ifs with h
· simp only [h, true_and, Set.inter_def, Set.mem_setOf]
· simp only [h, false_and, and_false, Set.setOf_false, measure_empty]
simp_rw [this]
rw [lintegral_indicator hs]
theorem compProd_restrict_left {s : Set β} (hs : MeasurableSet s) :
Kernel.restrict κ hs ⊗ₖ η = Kernel.restrict (κ ⊗ₖ η) (hs.prod MeasurableSet.univ) := by
rw [← compProd_restrict hs MeasurableSet.univ]
congr; exact Kernel.restrict_univ.symm
theorem compProd_restrict_right {t : Set γ} (ht : MeasurableSet t) :
κ ⊗ₖ Kernel.restrict η ht = Kernel.restrict (κ ⊗ₖ η) (MeasurableSet.univ.prod ht) := by
rw [← compProd_restrict MeasurableSet.univ ht]
congr; exact Kernel.restrict_univ.symm
end Restrict
section Lintegral
/-! ### Lebesgue integral -/
/-- Lebesgue integral against the composition-product of two kernels. |
lintegral_compProd (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) :
∫⁻ bc, f bc ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, f (b, c) ∂η (a, b) ∂κ a := by
let g := Function.curry f
change ∫⁻ bc, f bc ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, g b c ∂η (a, b) ∂κ a
rw [← lintegral_compProd']
· simp_rw [g, Function.curry_apply]
· simp_rw [g, Function.uncurry_curry]; exact hf | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.ParallelComp"
] | Mathlib/Probability/Kernel/Composition/CompProd.lean | lintegral_compProd | Lebesgue integral against the composition-product of two kernels. |
lintegral_compProd₀ (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : AEMeasurable f ((κ ⊗ₖ η) a)) :
∫⁻ z, f z ∂(κ ⊗ₖ η) a = ∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a := by
have A : ∫⁻ z, f z ∂(κ ⊗ₖ η) a = ∫⁻ z, hf.mk f z ∂(κ ⊗ₖ η) a := lintegral_congr_ae hf.ae_eq_mk
have B : ∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a = ∫⁻ x, ∫⁻ y, hf.mk f (x, y) ∂η (a, x) ∂κ a := by
apply lintegral_congr_ae
filter_upwards [ae_ae_of_ae_compProd hf.ae_eq_mk] with _ ha using lintegral_congr_ae ha
rw [A, B, lintegral_compProd]
exact hf.measurable_mk | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.ParallelComp"
] | Mathlib/Probability/Kernel/Composition/CompProd.lean | lintegral_compProd₀ | Lebesgue integral against the composition-product of two kernels. |
setLIntegral_compProd (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {s : Set β} {t : Set γ}
(hs : MeasurableSet s) (ht : MeasurableSet t) :
∫⁻ z in s ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫⁻ x in s, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a := by
simp_rw [← Kernel.restrict_apply (κ ⊗ₖ η) (hs.prod ht), ← compProd_restrict hs ht,
lintegral_compProd _ _ _ hf, Kernel.restrict_apply] | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.ParallelComp"
] | Mathlib/Probability/Kernel/Composition/CompProd.lean | setLIntegral_compProd | null |
setLIntegral_compProd_univ_right (κ : Kernel α β) [IsSFiniteKernel κ]
(η : Kernel (α × β) γ) [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f)
{s : Set β} (hs : MeasurableSet s) :
∫⁻ z in s ×ˢ Set.univ, f z ∂(κ ⊗ₖ η) a = ∫⁻ x in s, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a := by
simp_rw [setLIntegral_compProd κ η a hf hs MeasurableSet.univ, Measure.restrict_univ] | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.ParallelComp"
] | Mathlib/Probability/Kernel/Composition/CompProd.lean | setLIntegral_compProd_univ_right | null |
setLIntegral_compProd_univ_left (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
[IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {t : Set γ}
(ht : MeasurableSet t) :
∫⁻ z in Set.univ ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫⁻ x, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a := by
simp_rw [setLIntegral_compProd κ η a hf MeasurableSet.univ ht, Measure.restrict_univ] | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.ParallelComp"
] | Mathlib/Probability/Kernel/Composition/CompProd.lean | setLIntegral_compProd_univ_left | null |
compProd_eq_sum_compProd_left (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ) :
κ ⊗ₖ η = Kernel.sum fun n ↦ seq κ n ⊗ₖ η := by
simp_rw [compProd_def]
rw [← comp_sum_left, ← comp_sum_right, ← parallelComp_sum_right, kernel_sum_seq] | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.ParallelComp"
] | Mathlib/Probability/Kernel/Composition/CompProd.lean | compProd_eq_sum_compProd_left | null |
compProd_eq_sum_compProd_right (κ : Kernel α β) (η : Kernel (α × β) γ)
[IsSFiniteKernel η] : κ ⊗ₖ η = Kernel.sum fun n => κ ⊗ₖ seq η n := by
simp_rw [compProd_def]
rw [← comp_sum_left, ← comp_sum_left, ← comp_sum_left, ← comp_sum_left, ← comp_sum_right,
← parallelComp_sum_left, kernel_sum_seq] | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.ParallelComp"
] | Mathlib/Probability/Kernel/Composition/CompProd.lean | compProd_eq_sum_compProd_right | null |
compProd_eq_sum_compProd (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
[IsSFiniteKernel η] : κ ⊗ₖ η = Kernel.sum fun n ↦ Kernel.sum fun m ↦ seq κ n ⊗ₖ seq η m := by
simp_rw [← compProd_eq_sum_compProd_right, ← compProd_eq_sum_compProd_left] | theorem | Probability | [
"Mathlib.Probability.Kernel.Composition.Comp",
"Mathlib.Probability.Kernel.Composition.ParallelComp"
] | Mathlib/Probability/Kernel/Composition/CompProd.lean | compProd_eq_sum_compProd | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.