probability.kernel.invarianceMathlib.Probability.Kernel.Invariance

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -92,10 +92,10 @@ def Invariant (κ : kernel α α) (μ : Measure α) : Prop :=
 
 variable {κ η : kernel α α} {μ : Measure α}
 
-#print ProbabilityTheory.kernel.Invariant.def' /-
-theorem Invariant.def' (hκ : Invariant κ μ) : μ.bind κ = μ :=
+#print ProbabilityTheory.kernel.Invariant.def /-
+theorem Invariant.def (hκ : Invariant κ μ) : μ.bind κ = μ :=
   hκ
-#align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def'
+#align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def
 -/
 
 #print ProbabilityTheory.kernel.Invariant.comp_const /-
Diff
@@ -92,10 +92,10 @@ def Invariant (κ : kernel α α) (μ : Measure α) : Prop :=
 
 variable {κ η : kernel α α} {μ : Measure α}
 
-#print ProbabilityTheory.kernel.Invariant.def /-
-theorem Invariant.def (hκ : Invariant κ μ) : μ.bind κ = μ :=
+#print ProbabilityTheory.kernel.Invariant.def' /-
+theorem Invariant.def' (hκ : Invariant κ μ) : μ.bind κ = μ :=
   hκ
-#align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def
+#align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def'
 -/
 
 #print ProbabilityTheory.kernel.Invariant.comp_const /-
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2023 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 -/
-import Mathbin.Probability.Kernel.Composition
+import Probability.Kernel.Composition
 
 #align_import probability.kernel.invariance from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
 
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2023 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
-
-! This file was ported from Lean 3 source module probability.kernel.invariance
-! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Probability.Kernel.Composition
 
+#align_import probability.kernel.invariance from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
+
 /-!
 # Invariance of measures along a kernel
 
Diff
@@ -70,7 +70,7 @@ theorem bind_smul (κ : kernel α β) (μ : Measure α) (r : ℝ≥0∞) : (r 
 theorem const_bind_eq_comp_const (κ : kernel α β) (μ : Measure α) :
     const α (μ.bind κ) = κ ∘ₖ const α μ :=
   by
-  ext (a s hs) : 2
+  ext a s hs : 2
   simp_rw [comp_apply' _ _ _ hs, const_apply, measure.bind_apply hs (kernel.measurable _)]
 #align probability_theory.kernel.const_bind_eq_comp_const ProbabilityTheory.kernel.const_bind_eq_comp_const
 -/
Diff
@@ -45,6 +45,7 @@ namespace Kernel
 /-! ### Push-forward of measures along a kernel -/
 
 
+#print ProbabilityTheory.kernel.bind_add /-
 @[simp]
 theorem bind_add (μ ν : Measure α) (κ : kernel α β) : (μ + ν).bind κ = μ.bind κ + ν.bind κ :=
   by
@@ -53,7 +54,9 @@ theorem bind_add (μ ν : Measure α) (κ : kernel α β) : (μ + ν).bind κ =
     Pi.add_apply, measure.bind_apply hs (kernel.measurable _),
     measure.bind_apply hs (kernel.measurable _)]
 #align probability_theory.kernel.bind_add ProbabilityTheory.kernel.bind_add
+-/
 
+#print ProbabilityTheory.kernel.bind_smul /-
 @[simp]
 theorem bind_smul (κ : kernel α β) (μ : Measure α) (r : ℝ≥0∞) : (r • μ).bind κ = r • μ.bind κ :=
   by
@@ -61,38 +64,50 @@ theorem bind_smul (κ : kernel α β) (μ : Measure α) (r : ℝ≥0∞) : (r 
   rw [measure.bind_apply hs (kernel.measurable _), lintegral_smul_measure, measure.coe_smul,
     Pi.smul_apply, measure.bind_apply hs (kernel.measurable _), smul_eq_mul]
 #align probability_theory.kernel.bind_smul ProbabilityTheory.kernel.bind_smul
+-/
 
+#print ProbabilityTheory.kernel.const_bind_eq_comp_const /-
 theorem const_bind_eq_comp_const (κ : kernel α β) (μ : Measure α) :
     const α (μ.bind κ) = κ ∘ₖ const α μ :=
   by
   ext (a s hs) : 2
   simp_rw [comp_apply' _ _ _ hs, const_apply, measure.bind_apply hs (kernel.measurable _)]
 #align probability_theory.kernel.const_bind_eq_comp_const ProbabilityTheory.kernel.const_bind_eq_comp_const
+-/
 
+#print ProbabilityTheory.kernel.comp_const_apply_eq_bind /-
 theorem comp_const_apply_eq_bind (κ : kernel α β) (μ : Measure α) (a : α) :
     (κ ∘ₖ const α μ) a = μ.bind κ := by
   rw [← const_apply (μ.bind κ) a, const_bind_eq_comp_const κ μ]
 #align probability_theory.kernel.comp_const_apply_eq_bind ProbabilityTheory.kernel.comp_const_apply_eq_bind
+-/
 
 /-! ### Invariant measures of kernels -/
 
 
+#print ProbabilityTheory.kernel.Invariant /-
 /-- A measure `μ` is invariant with respect to the kernel `κ` if the push-forward measure of `μ`
 along `κ` equals `μ`. -/
 def Invariant (κ : kernel α α) (μ : Measure α) : Prop :=
   μ.bind κ = μ
 #align probability_theory.kernel.invariant ProbabilityTheory.kernel.Invariant
+-/
 
 variable {κ η : kernel α α} {μ : Measure α}
 
+#print ProbabilityTheory.kernel.Invariant.def /-
 theorem Invariant.def (hκ : Invariant κ μ) : μ.bind κ = μ :=
   hκ
 #align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def
+-/
 
+#print ProbabilityTheory.kernel.Invariant.comp_const /-
 theorem Invariant.comp_const (hκ : Invariant κ μ) : κ ∘ₖ const α μ = const α μ := by
   rw [← const_bind_eq_comp_const κ μ, hκ.def]
 #align probability_theory.kernel.invariant.comp_const ProbabilityTheory.kernel.Invariant.comp_const
+-/
 
+#print ProbabilityTheory.kernel.Invariant.comp /-
 theorem Invariant.comp [IsSFiniteKernel κ] (hκ : Invariant κ μ) (hη : Invariant η μ) :
     Invariant (κ ∘ₖ η) μ := by
   cases' isEmpty_or_nonempty α with _ hα
@@ -101,6 +116,7 @@ theorem Invariant.comp [IsSFiniteKernel κ] (hκ : Invariant κ μ) (hη : Invar
     simp_rw [invariant, ← comp_const_apply_eq_bind (κ ∘ₖ η) μ hα.some, comp_assoc, hη.comp_const,
       hκ.comp_const, const_apply]
 #align probability_theory.kernel.invariant.comp ProbabilityTheory.kernel.Invariant.comp
+-/
 
 end Kernel
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 
 ! This file was ported from Lean 3 source module probability.kernel.invariance
-! leanprover-community/mathlib commit 3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b
+! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.Probability.Kernel.Composition
 /-!
 # Invariance of measures along a kernel
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 We say that a measure `μ` is invariant with respect to a kernel `κ` if its push-forward along the
 kernel `μ.bind κ` is the same measure.
 
Diff
@@ -37,8 +37,6 @@ namespace ProbabilityTheory
 
 variable {α β γ : Type _} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ}
 
-include mα mβ
-
 namespace Kernel
 
 /-! ### Push-forward of measures along a kernel -/
@@ -73,8 +71,6 @@ theorem comp_const_apply_eq_bind (κ : kernel α β) (μ : Measure α) (a : α)
   rw [← const_apply (μ.bind κ) a, const_bind_eq_comp_const κ μ]
 #align probability_theory.kernel.comp_const_apply_eq_bind ProbabilityTheory.kernel.comp_const_apply_eq_bind
 
-omit mβ
-
 /-! ### Invariant measures of kernels -/
 
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 
 ! This file was ported from Lean 3 source module probability.kernel.invariance
-! leanprover-community/mathlib commit a9545e8a564bac7f24637443f52ae955474e4991
+! leanprover-community/mathlib commit 3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,20 +13,17 @@ import Mathbin.Probability.Kernel.Composition
 /-!
 # Invariance of measures along a kernel
 
-We define the push-forward of a measure along a kernel which results in another measure. In the
-case that the push-forward measure is the same as the original measure, we say that the measure is
-invariant with respect to the kernel.
+We say that a measure `μ` is invariant with respect to a kernel `κ` if its push-forward along the
+kernel `μ.bind κ` is the same measure.
 
 ## Main definitions
 
-* `probability_theory.kernel.map_measure`: the push-forward of a measure along a kernel.
 * `probability_theory.kernel.invariant`: invariance of a given measure with respect to a kernel.
 
 ## Useful lemmas
 
-* `probability_theory.kernel.comp_apply_eq_map_measure`,
-  `probability_theory.kernel.const_map_measure_eq_comp_const`, and
-  `probability_theory.kernel.comp_const_apply_eq_map_measure` established the relationship between
+* `probability_theory.kernel.const_bind_eq_comp_const`, and
+  `probability_theory.kernel.comp_const_apply_eq_bind` established the relationship between
   the push-forward measure and the composition of kernels.
 
 -/
@@ -47,81 +44,34 @@ namespace Kernel
 /-! ### Push-forward of measures along a kernel -/
 
 
-/-- The push-forward of a measure along a kernel. -/
-noncomputable def mapMeasure (κ : kernel α β) (μ : Measure α) : Measure β :=
-  Measure.ofMeasurable (fun s hs => ∫⁻ x, κ x s ∂μ)
-    (by simp only [measure_empty, MeasureTheory.lintegral_const, MulZeroClass.zero_mul])
-    (by
-      intro f hf₁ hf₂
-      simp_rw [measure_Union hf₂ hf₁,
-        lintegral_tsum fun i => (kernel.measurable_coe κ (hf₁ i)).AEMeasurable])
-#align probability_theory.kernel.map_measure ProbabilityTheory.kernel.mapMeasure
-
-@[simp]
-theorem mapMeasure_apply (κ : kernel α β) (μ : Measure α) {s : Set β} (hs : MeasurableSet s) :
-    mapMeasure κ μ s = ∫⁻ x, κ x s ∂μ := by rw [map_measure, measure.of_measurable_apply s hs]
-#align probability_theory.kernel.map_measure_apply ProbabilityTheory.kernel.mapMeasure_apply
-
 @[simp]
-theorem mapMeasure_zero (κ : kernel α β) : mapMeasure κ 0 = 0 :=
+theorem bind_add (μ ν : Measure α) (κ : kernel α β) : (μ + ν).bind κ = μ.bind κ + ν.bind κ :=
   by
   ext1 s hs
-  rw [map_measure_apply κ 0 hs, lintegral_zero_measure, measure.coe_zero, Pi.zero_apply]
-#align probability_theory.kernel.map_measure_zero ProbabilityTheory.kernel.mapMeasure_zero
+  rw [measure.bind_apply hs (kernel.measurable _), lintegral_add_measure, measure.coe_add,
+    Pi.add_apply, measure.bind_apply hs (kernel.measurable _),
+    measure.bind_apply hs (kernel.measurable _)]
+#align probability_theory.kernel.bind_add ProbabilityTheory.kernel.bind_add
 
 @[simp]
-theorem mapMeasure_add (κ : kernel α β) (μ ν : Measure α) :
-    mapMeasure κ (μ + ν) = mapMeasure κ μ + mapMeasure κ ν :=
+theorem bind_smul (κ : kernel α β) (μ : Measure α) (r : ℝ≥0∞) : (r • μ).bind κ = r • μ.bind κ :=
   by
   ext1 s hs
-  rw [map_measure_apply κ (μ + ν) hs, lintegral_add_measure, measure.coe_add, Pi.add_apply,
-    map_measure_apply κ μ hs, map_measure_apply κ ν hs]
-#align probability_theory.kernel.map_measure_add ProbabilityTheory.kernel.mapMeasure_add
+  rw [measure.bind_apply hs (kernel.measurable _), lintegral_smul_measure, measure.coe_smul,
+    Pi.smul_apply, measure.bind_apply hs (kernel.measurable _), smul_eq_mul]
+#align probability_theory.kernel.bind_smul ProbabilityTheory.kernel.bind_smul
 
-@[simp]
-theorem mapMeasure_smul (κ : kernel α β) (μ : Measure α) (r : ℝ≥0∞) :
-    mapMeasure κ (r • μ) = r • mapMeasure κ μ :=
+theorem const_bind_eq_comp_const (κ : kernel α β) (μ : Measure α) :
+    const α (μ.bind κ) = κ ∘ₖ const α μ :=
   by
-  ext1 s hs
-  rw [map_measure_apply κ (r • μ) hs, lintegral_smul_measure, measure.coe_smul, Pi.smul_apply,
-    map_measure_apply κ μ hs, smul_eq_mul]
-#align probability_theory.kernel.map_measure_smul ProbabilityTheory.kernel.mapMeasure_smul
+  ext (a s hs) : 2
+  simp_rw [comp_apply' _ _ _ hs, const_apply, measure.bind_apply hs (kernel.measurable _)]
+#align probability_theory.kernel.const_bind_eq_comp_const ProbabilityTheory.kernel.const_bind_eq_comp_const
 
-include mγ
-
-theorem comp_apply_eq_mapMeasure (η : kernel β γ) [IsSFiniteKernel η] (κ : kernel α β)
-    [IsSFiniteKernel κ] (a : α) : (η ∘ₖ κ) a = mapMeasure η (κ a) :=
-  by
-  ext1 s hs
-  rw [comp_apply η κ a hs, map_measure_apply η _ hs]
-#align probability_theory.kernel.comp_apply_eq_map_measure ProbabilityTheory.kernel.comp_apply_eq_mapMeasure
-
-omit mγ
-
-theorem const_mapMeasure_eq_comp_const (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α)
-    [IsFiniteMeasure μ] : const α (mapMeasure κ μ) = κ ∘ₖ const α μ :=
-  by
-  ext1 a; ext1 s hs
-  rw [const_apply, map_measure_apply _ _ hs, comp_apply _ _ _ hs, const_apply]
-#align probability_theory.kernel.const_map_measure_eq_comp_const ProbabilityTheory.kernel.const_mapMeasure_eq_comp_const
-
-theorem comp_const_apply_eq_mapMeasure (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α)
-    [IsFiniteMeasure μ] (a : α) : (κ ∘ₖ const α μ) a = mapMeasure κ μ := by
-  rw [← const_apply (map_measure κ μ) a, const_map_measure_eq_comp_const κ μ]
-#align probability_theory.kernel.comp_const_apply_eq_map_measure ProbabilityTheory.kernel.comp_const_apply_eq_mapMeasure
-
-theorem lintegral_mapMeasure (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α)
-    [IsFiniteMeasure μ] {f : β → ℝ≥0∞} (hf : Measurable f) :
-    (∫⁻ b, f b ∂mapMeasure κ μ) = ∫⁻ a, ∫⁻ b, f b ∂κ a ∂μ :=
-  by
-  by_cases hα : Nonempty α
-  · have := const_apply μ hα.some
-    swap; infer_instance
-    conv_rhs => rw [← this]
-    rw [← lintegral_comp _ _ _ hf, ← comp_const_apply_eq_map_measure κ μ hα.some]
-  · haveI := not_nonempty_iff.1 hα
-    rw [μ.eq_zero_of_is_empty, map_measure_zero, lintegral_zero_measure, lintegral_zero_measure]
-#align probability_theory.kernel.lintegral_map_measure ProbabilityTheory.kernel.lintegral_mapMeasure
+theorem comp_const_apply_eq_bind (κ : kernel α β) (μ : Measure α) (a : α) :
+    (κ ∘ₖ const α μ) a = μ.bind κ := by
+  rw [← const_apply (μ.bind κ) a, const_bind_eq_comp_const κ μ]
+#align probability_theory.kernel.comp_const_apply_eq_bind ProbabilityTheory.kernel.comp_const_apply_eq_bind
 
 omit mβ
 
@@ -131,28 +81,26 @@ omit mβ
 /-- A measure `μ` is invariant with respect to the kernel `κ` if the push-forward measure of `μ`
 along `κ` equals `μ`. -/
 def Invariant (κ : kernel α α) (μ : Measure α) : Prop :=
-  mapMeasure κ μ = μ
+  μ.bind κ = μ
 #align probability_theory.kernel.invariant ProbabilityTheory.kernel.Invariant
 
 variable {κ η : kernel α α} {μ : Measure α}
 
-theorem Invariant.def (hκ : Invariant κ μ) : mapMeasure κ μ = μ :=
+theorem Invariant.def (hκ : Invariant κ μ) : μ.bind κ = μ :=
   hκ
 #align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def
 
-theorem Invariant.comp_const [IsSFiniteKernel κ] [IsFiniteMeasure μ] (hκ : Invariant κ μ) :
-    κ ∘ₖ const α μ = const α μ := by rw [← const_map_measure_eq_comp_const κ μ, hκ.def]
+theorem Invariant.comp_const (hκ : Invariant κ μ) : κ ∘ₖ const α μ = const α μ := by
+  rw [← const_bind_eq_comp_const κ μ, hκ.def]
 #align probability_theory.kernel.invariant.comp_const ProbabilityTheory.kernel.Invariant.comp_const
 
-theorem Invariant.comp [IsSFiniteKernel κ] [IsSFiniteKernel η] [IsFiniteMeasure μ]
-    (hκ : Invariant κ μ) (hη : Invariant η μ) : Invariant (κ ∘ₖ η) μ :=
-  by
-  by_cases hα : Nonempty α
+theorem Invariant.comp [IsSFiniteKernel κ] (hκ : Invariant κ μ) (hη : Invariant η μ) :
+    Invariant (κ ∘ₖ η) μ := by
+  cases' isEmpty_or_nonempty α with _ hα
+  · exact Subsingleton.elim _ _
   ·
-    simp_rw [invariant, ← comp_const_apply_eq_map_measure (κ ∘ₖ η) μ hα.some, comp_assoc,
-      hη.comp_const, hκ.comp_const, const_apply]
-  · haveI := not_nonempty_iff.1 hα
-    exact Subsingleton.elim _ _
+    simp_rw [invariant, ← comp_const_apply_eq_bind (κ ∘ₖ η) μ hα.some, comp_assoc, hη.comp_const,
+      hκ.comp_const, const_apply]
 #align probability_theory.kernel.invariant.comp ProbabilityTheory.kernel.Invariant.comp
 
 end Kernel
Diff
@@ -99,19 +99,20 @@ theorem comp_apply_eq_mapMeasure (η : kernel β γ) [IsSFiniteKernel η] (κ :
 omit mγ
 
 theorem const_mapMeasure_eq_comp_const (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α)
-    [FiniteMeasure μ] : const α (mapMeasure κ μ) = κ ∘ₖ const α μ :=
+    [IsFiniteMeasure μ] : const α (mapMeasure κ μ) = κ ∘ₖ const α μ :=
   by
   ext1 a; ext1 s hs
   rw [const_apply, map_measure_apply _ _ hs, comp_apply _ _ _ hs, const_apply]
 #align probability_theory.kernel.const_map_measure_eq_comp_const ProbabilityTheory.kernel.const_mapMeasure_eq_comp_const
 
 theorem comp_const_apply_eq_mapMeasure (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α)
-    [FiniteMeasure μ] (a : α) : (κ ∘ₖ const α μ) a = mapMeasure κ μ := by
+    [IsFiniteMeasure μ] (a : α) : (κ ∘ₖ const α μ) a = mapMeasure κ μ := by
   rw [← const_apply (map_measure κ μ) a, const_map_measure_eq_comp_const κ μ]
 #align probability_theory.kernel.comp_const_apply_eq_map_measure ProbabilityTheory.kernel.comp_const_apply_eq_mapMeasure
 
-theorem lintegral_mapMeasure (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α) [FiniteMeasure μ]
-    {f : β → ℝ≥0∞} (hf : Measurable f) : (∫⁻ b, f b ∂mapMeasure κ μ) = ∫⁻ a, ∫⁻ b, f b ∂κ a ∂μ :=
+theorem lintegral_mapMeasure (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α)
+    [IsFiniteMeasure μ] {f : β → ℝ≥0∞} (hf : Measurable f) :
+    (∫⁻ b, f b ∂mapMeasure κ μ) = ∫⁻ a, ∫⁻ b, f b ∂κ a ∂μ :=
   by
   by_cases hα : Nonempty α
   · have := const_apply μ hα.some
@@ -139,11 +140,11 @@ theorem Invariant.def (hκ : Invariant κ μ) : mapMeasure κ μ = μ :=
   hκ
 #align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def
 
-theorem Invariant.comp_const [IsSFiniteKernel κ] [FiniteMeasure μ] (hκ : Invariant κ μ) :
+theorem Invariant.comp_const [IsSFiniteKernel κ] [IsFiniteMeasure μ] (hκ : Invariant κ μ) :
     κ ∘ₖ const α μ = const α μ := by rw [← const_map_measure_eq_comp_const κ μ, hκ.def]
 #align probability_theory.kernel.invariant.comp_const ProbabilityTheory.kernel.Invariant.comp_const
 
-theorem Invariant.comp [IsSFiniteKernel κ] [IsSFiniteKernel η] [FiniteMeasure μ]
+theorem Invariant.comp [IsSFiniteKernel κ] [IsSFiniteKernel η] [IsFiniteMeasure μ]
     (hκ : Invariant κ μ) (hη : Invariant η μ) : Invariant (κ ∘ₖ η) μ :=
   by
   by_cases hα : Nonempty α
Diff
@@ -34,7 +34,7 @@ invariant with respect to the kernel.
 
 open MeasureTheory
 
-open MeasureTheory ENNReal ProbabilityTheory
+open scoped MeasureTheory ENNReal ProbabilityTheory
 
 namespace ProbabilityTheory
 
Diff
@@ -115,8 +115,7 @@ theorem lintegral_mapMeasure (κ : kernel α β) [IsSFiniteKernel κ] (μ : Meas
   by
   by_cases hα : Nonempty α
   · have := const_apply μ hα.some
-    swap
-    infer_instance
+    swap; infer_instance
     conv_rhs => rw [← this]
     rw [← lintegral_comp _ _ _ hf, ← comp_const_apply_eq_map_measure κ μ hα.some]
   · haveI := not_nonempty_iff.1 hα
Diff
@@ -99,20 +99,19 @@ theorem comp_apply_eq_mapMeasure (η : kernel β γ) [IsSFiniteKernel η] (κ :
 omit mγ
 
 theorem const_mapMeasure_eq_comp_const (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α)
-    [IsFiniteMeasure μ] : const α (mapMeasure κ μ) = κ ∘ₖ const α μ :=
+    [FiniteMeasure μ] : const α (mapMeasure κ μ) = κ ∘ₖ const α μ :=
   by
   ext1 a; ext1 s hs
   rw [const_apply, map_measure_apply _ _ hs, comp_apply _ _ _ hs, const_apply]
 #align probability_theory.kernel.const_map_measure_eq_comp_const ProbabilityTheory.kernel.const_mapMeasure_eq_comp_const
 
 theorem comp_const_apply_eq_mapMeasure (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α)
-    [IsFiniteMeasure μ] (a : α) : (κ ∘ₖ const α μ) a = mapMeasure κ μ := by
+    [FiniteMeasure μ] (a : α) : (κ ∘ₖ const α μ) a = mapMeasure κ μ := by
   rw [← const_apply (map_measure κ μ) a, const_map_measure_eq_comp_const κ μ]
 #align probability_theory.kernel.comp_const_apply_eq_map_measure ProbabilityTheory.kernel.comp_const_apply_eq_mapMeasure
 
-theorem lintegral_mapMeasure (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α)
-    [IsFiniteMeasure μ] {f : β → ℝ≥0∞} (hf : Measurable f) :
-    (∫⁻ b, f b ∂mapMeasure κ μ) = ∫⁻ a, ∫⁻ b, f b ∂κ a ∂μ :=
+theorem lintegral_mapMeasure (κ : kernel α β) [IsSFiniteKernel κ] (μ : Measure α) [FiniteMeasure μ]
+    {f : β → ℝ≥0∞} (hf : Measurable f) : (∫⁻ b, f b ∂mapMeasure κ μ) = ∫⁻ a, ∫⁻ b, f b ∂κ a ∂μ :=
   by
   by_cases hα : Nonempty α
   · have := const_apply μ hα.some
@@ -141,11 +140,11 @@ theorem Invariant.def (hκ : Invariant κ μ) : mapMeasure κ μ = μ :=
   hκ
 #align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def
 
-theorem Invariant.comp_const [IsSFiniteKernel κ] [IsFiniteMeasure μ] (hκ : Invariant κ μ) :
+theorem Invariant.comp_const [IsSFiniteKernel κ] [FiniteMeasure μ] (hκ : Invariant κ μ) :
     κ ∘ₖ const α μ = const α μ := by rw [← const_map_measure_eq_comp_const κ μ, hκ.def]
 #align probability_theory.kernel.invariant.comp_const ProbabilityTheory.kernel.Invariant.comp_const
 
-theorem Invariant.comp [IsSFiniteKernel κ] [IsSFiniteKernel η] [IsFiniteMeasure μ]
+theorem Invariant.comp [IsSFiniteKernel κ] [IsSFiniteKernel η] [FiniteMeasure μ]
     (hκ : Invariant κ μ) (hη : Invariant η μ) : Invariant (κ ∘ₖ η) μ :=
   by
   by_cases hα : Nonempty α
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 
 ! This file was ported from Lean 3 source module probability.kernel.invariance
-! leanprover-community/mathlib commit 97d1aa955750bd57a7eeef91de310e633881670b
+! leanprover-community/mathlib commit a9545e8a564bac7f24637443f52ae955474e4991
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -50,7 +50,7 @@ namespace Kernel
 /-- The push-forward of a measure along a kernel. -/
 noncomputable def mapMeasure (κ : kernel α β) (μ : Measure α) : Measure β :=
   Measure.ofMeasurable (fun s hs => ∫⁻ x, κ x s ∂μ)
-    (by simp only [measure_empty, lintegral_const, MulZeroClass.zero_mul])
+    (by simp only [measure_empty, MeasureTheory.lintegral_const, MulZeroClass.zero_mul])
     (by
       intro f hf₁ hf₂
       simp_rw [measure_Union hf₂ hf₁,
Diff
@@ -54,7 +54,7 @@ noncomputable def mapMeasure (κ : kernel α β) (μ : Measure α) : Measure β
     (by
       intro f hf₁ hf₂
       simp_rw [measure_Union hf₂ hf₁,
-        lintegral_tsum fun i => (kernel.measurable_coe κ (hf₁ i)).AeMeasurable])
+        lintegral_tsum fun i => (kernel.measurable_coe κ (hf₁ i)).AEMeasurable])
 #align probability_theory.kernel.map_measure ProbabilityTheory.kernel.mapMeasure
 
 @[simp]

Changes in mathlib4

mathlib3
mathlib4
chore: rename IsRoot.definition back to IsRoot.def (#11999)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -76,14 +76,12 @@ def Invariant (κ : kernel α α) (μ : Measure α) : Prop :=
 
 variable {κ η : kernel α α} {μ : Measure α}
 
--- Adaptation note: 2024-03-15
--- Renamed to avoid the reserved name `Invariant.def`.
-theorem Invariant.def' (hκ : Invariant κ μ) : μ.bind κ = μ :=
+theorem Invariant.def (hκ : Invariant κ μ) : μ.bind κ = μ :=
   hκ
-#align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def'
+#align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def
 
 theorem Invariant.comp_const (hκ : Invariant κ μ) : κ ∘ₖ const α μ = const α μ := by
-  rw [← const_bind_eq_comp_const κ μ, hκ.def']
+  rw [← const_bind_eq_comp_const κ μ, hκ.def]
 #align probability_theory.kernel.invariant.comp_const ProbabilityTheory.kernel.Invariant.comp_const
 
 theorem Invariant.comp [IsSFiniteKernel κ] (hκ : Invariant κ μ) (hη : Invariant η μ) :
chore: rename away from 'def' (#11548)

This will become an error in 2024-03-16 nightly, possibly not permanently.

Co-authored-by: Scott Morrison <scott@tqft.net>

Diff
@@ -76,12 +76,14 @@ def Invariant (κ : kernel α α) (μ : Measure α) : Prop :=
 
 variable {κ η : kernel α α} {μ : Measure α}
 
-theorem Invariant.def (hκ : Invariant κ μ) : μ.bind κ = μ :=
+-- Adaptation note: 2024-03-15
+-- Renamed to avoid the reserved name `Invariant.def`.
+theorem Invariant.def' (hκ : Invariant κ μ) : μ.bind κ = μ :=
   hκ
-#align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def
+#align probability_theory.kernel.invariant.def ProbabilityTheory.kernel.Invariant.def'
 
 theorem Invariant.comp_const (hκ : Invariant κ μ) : κ ∘ₖ const α μ = const α μ := by
-  rw [← const_bind_eq_comp_const κ μ, hκ.def]
+  rw [← const_bind_eq_comp_const κ μ, hκ.def']
 #align probability_theory.kernel.invariant.comp_const ProbabilityTheory.kernel.Invariant.comp_const
 
 theorem Invariant.comp [IsSFiniteKernel κ] (hκ : Invariant κ μ) (hη : Invariant η μ) :
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -32,7 +32,7 @@ open scoped MeasureTheory ENNReal ProbabilityTheory
 
 namespace ProbabilityTheory
 
-variable {α β γ : Type _} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ}
+variable {α β γ : Type*} {mα : MeasurableSpace α} {mβ : MeasurableSpace β} {mγ : MeasurableSpace γ}
 
 namespace kernel
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2023 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
-
-! This file was ported from Lean 3 source module probability.kernel.invariance
-! leanprover-community/mathlib commit 3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Probability.Kernel.Composition
 
+#align_import probability.kernel.invariance from "leanprover-community/mathlib"@"3b92d54a05ee592aa2c6181a4e76b1bb7cc45d0b"
+
 /-!
 # Invariance of measures along a kernel
 
chore: bump Std4 (#5219)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -59,7 +59,7 @@ theorem bind_smul (κ : kernel α β) (μ : Measure α) (r : ℝ≥0∞) : (r 
 
 theorem const_bind_eq_comp_const (κ : kernel α β) (μ : Measure α) :
     const α (μ.bind κ) = κ ∘ₖ const α μ := by
-  ext a s; intro hs
+  ext a s hs
   simp_rw [comp_apply' _ _ _ hs, const_apply, Measure.bind_apply hs (kernel.measurable _)]
 #align probability_theory.kernel.const_bind_eq_comp_const ProbabilityTheory.kernel.const_bind_eq_comp_const
 
feat: port Probability.Kernel.Invariance (#5142)

Dependencies 12 + 941

942 files ported (98.7%)
431350 lines ported (98.7%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file