-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger CI for leanprover/lean4#2821
- Loading branch information
Showing
4 changed files
with
170 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
/- | ||
Copyright (c) 2023 Kalle Kytölä. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Kalle Kytölä | ||
-/ | ||
import Mathlib.MeasureTheory.Measure.ProbabilityMeasure | ||
import Mathlib.MeasureTheory.Constructions.Prod.Basic | ||
|
||
/-! | ||
# Products of finite measures and probability measures | ||
This file introduces binary products of finite measures and probability measures. The constructions | ||
are obtained from special cases of products of general measures. Taking products nevertheless has | ||
specific properties in the cases of finite measures and probability measures, notably the fact that | ||
the product measures depend continuously on their factors in the topology of weak convergence when | ||
the underlying space is metrizable and separable. | ||
## Main definitions | ||
* `MeasureTheory.FiniteMeasure.prod`: The product of two finite measures. | ||
* `MeasureTheory.ProbabilityMeasure.prod`: The product of two probability measures. | ||
## Todo | ||
* Add continuous dependence of the product measures on the factors. | ||
-/ | ||
|
||
open MeasureTheory Topology Metric Filter Set ENNReal NNReal | ||
|
||
open scoped Topology ENNReal NNReal BoundedContinuousFunction BigOperators | ||
|
||
namespace MeasureTheory | ||
|
||
section FiniteMeasure_product | ||
|
||
namespace FiniteMeasure | ||
|
||
variable {α : Type*} [MeasurableSpace α] {β : Type*} [MeasurableSpace β] | ||
|
||
/-- The binary product of finite measures. -/ | ||
noncomputable def prod (μ : FiniteMeasure α) (ν : FiniteMeasure β) : FiniteMeasure (α × β) := | ||
⟨μ.toMeasure.prod ν.toMeasure, inferInstance⟩ | ||
|
||
variable (μ : FiniteMeasure α) (ν : FiniteMeasure β) | ||
|
||
@[simp] lemma toMeasure_prod : (μ.prod ν).toMeasure = μ.toMeasure.prod ν.toMeasure := rfl | ||
|
||
lemma prod_apply (s : Set (α × β)) (s_mble : MeasurableSet s) : | ||
μ.prod ν s = ENNReal.toNNReal (∫⁻ x, ν.toMeasure (Prod.mk x ⁻¹' s) ∂μ) := by | ||
simp [Measure.prod_apply s_mble] | ||
|
||
lemma prod_apply_symm (s : Set (α × β)) (s_mble : MeasurableSet s) : | ||
μ.prod ν s = ENNReal.toNNReal (∫⁻ y, μ.toMeasure ((fun x ↦ ⟨x, y⟩) ⁻¹' s) ∂ν) := by | ||
simp [Measure.prod_apply_symm s_mble] | ||
|
||
lemma prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by simp | ||
|
||
@[simp] lemma mass_prod : (μ.prod ν).mass = μ.mass * ν.mass := by | ||
simp only [mass, univ_prod_univ.symm, toMeasure_prod] | ||
rw [← ENNReal.toNNReal_mul] | ||
exact congr_arg ENNReal.toNNReal (Measure.prod_prod univ univ) | ||
|
||
@[simp] lemma zero_prod : (0 : FiniteMeasure α).prod ν = 0 := by | ||
rw [← mass_zero_iff, mass_prod, zero_mass, zero_mul] | ||
|
||
@[simp] lemma prod_zero : μ.prod (0 : FiniteMeasure β) = 0 := by | ||
rw [← mass_zero_iff, mass_prod, zero_mass, mul_zero] | ||
|
||
@[simp] lemma map_fst_prod : (μ.prod ν).map Prod.fst = ν univ • μ := by | ||
apply Subtype.ext | ||
simp only [val_eq_toMeasure, toMeasure_map, toMeasure_prod, Measure.map_fst_prod] | ||
ext s _ | ||
simp only [Measure.smul_toOuterMeasure, OuterMeasure.coe_smul, Pi.smul_apply, smul_eq_mul] | ||
have aux := coeFn_smul_apply (ν univ) μ s | ||
simpa using congr_arg ENNReal.ofNNReal aux.symm | ||
|
||
@[simp] lemma map_snd_prod : (μ.prod ν).map Prod.snd = μ univ • ν := by | ||
apply Subtype.ext | ||
simp only [val_eq_toMeasure, toMeasure_map, toMeasure_prod, Measure.map_fst_prod] | ||
ext s _ | ||
simp only [Measure.map_snd_prod, Measure.smul_toOuterMeasure, OuterMeasure.coe_smul, | ||
Pi.smul_apply, smul_eq_mul] | ||
have aux := coeFn_smul_apply (μ univ) ν s | ||
simpa using congr_arg ENNReal.ofNNReal aux.symm | ||
|
||
lemma map_prod_map {α' : Type*} [MeasurableSpace α'] {β' : Type*} [MeasurableSpace β'] | ||
{f : α → α'} {g : β → β'} (f_mble : Measurable f) (g_mble : Measurable g): | ||
(μ.map f).prod (ν.map g) = (μ.prod ν).map (Prod.map f g) := by | ||
apply Subtype.ext | ||
simp only [val_eq_toMeasure, toMeasure_prod, toMeasure_map] | ||
rw [Measure.map_prod_map _ _ f_mble g_mble] | ||
|
||
lemma prod_swap : (μ.prod ν).map Prod.swap = ν.prod μ := by | ||
apply Subtype.ext | ||
simp [Measure.prod_swap] | ||
|
||
end FiniteMeasure -- namespace | ||
|
||
end FiniteMeasure_product -- section | ||
|
||
section ProbabilityMeasure_product | ||
|
||
namespace ProbabilityMeasure | ||
|
||
variable {α : Type*} [MeasurableSpace α] {β : Type*} [MeasurableSpace β] | ||
|
||
/-- The binary product of probability measures. -/ | ||
noncomputable def prod (μ : ProbabilityMeasure α) (ν : ProbabilityMeasure β) : | ||
ProbabilityMeasure (α × β) := | ||
⟨μ.toMeasure.prod ν.toMeasure, by infer_instance⟩ | ||
|
||
variable (μ : ProbabilityMeasure α) (ν : ProbabilityMeasure β) | ||
|
||
@[simp] lemma toMeasure_prod : (μ.prod ν).toMeasure = μ.toMeasure.prod ν.toMeasure := rfl | ||
|
||
lemma prod_apply (s : Set (α × β)) (s_mble : MeasurableSet s) : | ||
μ.prod ν s = ENNReal.toNNReal (∫⁻ x, ν.toMeasure (Prod.mk x ⁻¹' s) ∂μ) := by | ||
simp [Measure.prod_apply s_mble] | ||
|
||
lemma prod_apply_symm (s : Set (α × β)) (s_mble : MeasurableSet s) : | ||
μ.prod ν s = ENNReal.toNNReal (∫⁻ y, μ.toMeasure ((fun x ↦ ⟨x, y⟩) ⁻¹' s) ∂ν) := by | ||
simp [Measure.prod_apply_symm s_mble] | ||
|
||
lemma prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t := by simp | ||
|
||
/-- The first marginal of a product probability measure is the first probability measure. -/ | ||
@[simp] lemma map_fst_prod : (μ.prod ν).map measurable_fst.aemeasurable = μ := by | ||
apply Subtype.ext | ||
simp only [val_eq_to_measure, toMeasure_map, toMeasure_prod, Measure.map_fst_prod, | ||
measure_univ, one_smul] | ||
|
||
/-- The second marginal of a product probability measure is the second probability measure. -/ | ||
@[simp] lemma map_snd_prod : (μ.prod ν).map measurable_snd.aemeasurable = ν := by | ||
apply Subtype.ext | ||
simp only [val_eq_to_measure, toMeasure_map, toMeasure_prod, Measure.map_snd_prod, | ||
measure_univ, one_smul] | ||
|
||
lemma map_prod_map {α' : Type*} [MeasurableSpace α'] {β' : Type*} [MeasurableSpace β'] | ||
{f : α → α'} {g : β → β'} (f_mble : Measurable f) (g_mble : Measurable g) : | ||
(μ.map f_mble.aemeasurable).prod (ν.map g_mble.aemeasurable) | ||
= (μ.prod ν).map (f_mble.prod_map g_mble).aemeasurable := by | ||
apply Subtype.ext | ||
simp only [val_eq_to_measure, toMeasure_prod, toMeasure_map] | ||
rw [Measure.map_prod_map _ _ f_mble g_mble] | ||
|
||
lemma prod_swap : (μ.prod ν).map measurable_swap.aemeasurable = ν.prod μ := by | ||
apply Subtype.ext | ||
simp [Measure.prod_swap] | ||
|
||
end ProbabilityMeasure -- namespace | ||
|
||
end ProbabilityMeasure_product -- section | ||
|
||
end MeasureTheory -- namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters