measure_theory.measure.giry_monadMathlib.MeasureTheory.Measure.GiryMonad

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)

(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)

(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)

(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)

(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)

(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)

(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)

(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)

(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
@@ -3,7 +3,7 @@ Copyright (c) 2019 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 -/
-import Mathbin.MeasureTheory.Integral.Lebesgue
+import MeasureTheory.Integral.Lebesgue
 
 #align_import measure_theory.measure.giry_monad from "leanprover-community/mathlib"@"38df578a6450a8c5142b3727e3ae894c2300cae0"
 
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2019 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module measure_theory.measure.giry_monad
-! leanprover-community/mathlib commit 38df578a6450a8c5142b3727e3ae894c2300cae0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Integral.Lebesgue
 
+#align_import measure_theory.measure.giry_monad from "leanprover-community/mathlib"@"38df578a6450a8c5142b3727e3ae894c2300cae0"
+
 /-!
 # The Giry monad
 
Diff
@@ -60,12 +60,14 @@ theorem measurable_coe {s : Set α} (hs : MeasurableSet s) : Measurable fun μ :
 #align measure_theory.measure.measurable_coe MeasureTheory.Measure.measurable_coe
 -/
 
+#print MeasureTheory.Measure.measurable_of_measurable_coe /-
 theorem measurable_of_measurable_coe (f : β → Measure α)
     (h : ∀ (s : Set α) (hs : MeasurableSet s), Measurable fun b => f b s) : Measurable f :=
   Measurable.of_le_map <|
     iSup₂_le fun s hs =>
       MeasurableSpace.comap_le_iff_le_map.2 <| by rw [MeasurableSpace.map_comp] <;> exact h s hs
 #align measure_theory.measure.measurable_of_measurable_coe MeasureTheory.Measure.measurable_of_measurable_coe
+-/
 
 instance {α : Type _} {m : MeasurableSpace α} : MeasurableAdd₂ (Measure α) :=
   by
@@ -82,12 +84,14 @@ theorem measurable_measure {μ : α → Measure β} :
 #align measure_theory.measure.measurable_measure MeasureTheory.Measure.measurable_measure
 -/
 
+#print MeasureTheory.Measure.measurable_map /-
 theorem measurable_map (f : α → β) (hf : Measurable f) : Measurable fun μ : Measure α => map f μ :=
   by
   refine' measurable_of_measurable_coe _ fun s hs => _
   simp_rw [map_apply hf hs]
   exact measurable_coe (hf hs)
 #align measure_theory.measure.measurable_map MeasureTheory.Measure.measurable_map
+-/
 
 #print MeasureTheory.Measure.measurable_dirac /-
 theorem measurable_dirac : Measurable (Measure.dirac : α → Measure α) :=
@@ -186,6 +190,7 @@ theorem bind_zero_left (f : α → Measure β) : bind 0 f = 0 := by simp [bind]
 #align measure_theory.measure.bind_zero_left MeasureTheory.Measure.bind_zero_left
 -/
 
+#print MeasureTheory.Measure.bind_zero_right /-
 @[simp]
 theorem bind_zero_right (m : Measure α) : bind m (0 : α → Measure β) = 0 :=
   by
@@ -194,17 +199,22 @@ theorem bind_zero_right (m : Measure α) : bind m (0 : α → Measure β) = 0 :=
   rw [lintegral_map (measurable_coe hs) measurable_zero]
   simp only [Pi.zero_apply, coe_zero, lintegral_const, MulZeroClass.zero_mul]
 #align measure_theory.measure.bind_zero_right MeasureTheory.Measure.bind_zero_right
+-/
 
+#print MeasureTheory.Measure.bind_zero_right' /-
 @[simp]
 theorem bind_zero_right' (m : Measure α) : bind m (fun _ => 0 : α → Measure β) = 0 :=
   bind_zero_right m
 #align measure_theory.measure.bind_zero_right' MeasureTheory.Measure.bind_zero_right'
+-/
 
+#print MeasureTheory.Measure.bind_apply /-
 @[simp]
 theorem bind_apply {m : Measure α} {f : α → Measure β} {s : Set β} (hs : MeasurableSet s)
     (hf : Measurable f) : bind m f s = ∫⁻ a, f a s ∂m := by
   rw [bind, join_apply hs, lintegral_map (measurable_coe hs) hf]
 #align measure_theory.measure.bind_apply MeasureTheory.Measure.bind_apply
+-/
 
 #print MeasureTheory.Measure.measurable_bind' /-
 theorem measurable_bind' {g : α → Measure β} (hg : Measurable g) : Measurable fun m => bind m g :=
@@ -212,11 +222,14 @@ theorem measurable_bind' {g : α → Measure β} (hg : Measurable g) : Measurabl
 #align measure_theory.measure.measurable_bind' MeasureTheory.Measure.measurable_bind'
 -/
 
+#print MeasureTheory.Measure.lintegral_bind /-
 theorem lintegral_bind {m : Measure α} {μ : α → Measure β} {f : β → ℝ≥0∞} (hμ : Measurable μ)
     (hf : Measurable f) : ∫⁻ x, f x ∂bind m μ = ∫⁻ a, ∫⁻ x, f x ∂μ a ∂m :=
   (lintegral_join hf).trans (lintegral_map (measurable_lintegral hf) hμ)
 #align measure_theory.measure.lintegral_bind MeasureTheory.Measure.lintegral_bind
+-/
 
+#print MeasureTheory.Measure.bind_bind /-
 theorem bind_bind {γ} [MeasurableSpace γ] {m : Measure α} {f : α → Measure β} {g : β → Measure γ}
     (hf : Measurable f) (hg : Measurable g) : bind (bind m f) g = bind m fun a => bind (f a) g :=
   by
@@ -224,6 +237,7 @@ theorem bind_bind {γ} [MeasurableSpace γ] {m : Measure α} {f : α → Measure
   simp_rw [bind_apply hs hg, bind_apply hs ((measurable_bind' hg).comp hf),
     lintegral_bind hf ((measurable_coe hs).comp hg), bind_apply hs hg]
 #align measure_theory.measure.bind_bind MeasureTheory.Measure.bind_bind
+-/
 
 #print MeasureTheory.Measure.bind_dirac /-
 theorem bind_dirac {f : α → Measure β} (hf : Measurable f) (a : α) : bind (dirac a) f = f a := by
@@ -245,6 +259,7 @@ theorem join_eq_bind (μ : Measure (Measure α)) : join μ = bind μ id := by rw
 #align measure_theory.measure.join_eq_bind MeasureTheory.Measure.join_eq_bind
 -/
 
+#print MeasureTheory.Measure.join_map_map /-
 theorem join_map_map {f : α → β} (hf : Measurable f) (μ : Measure (Measure α)) :
     join (map (map f) μ) = map f (join μ) := by
   ext1 s hs
@@ -252,6 +267,7 @@ theorem join_map_map {f : α → β} (hf : Measurable f) (μ : Measure (Measure
     lintegral_map (measurable_coe hs) (measurable_map f hf)]
   simp_rw [map_apply hf hs]
 #align measure_theory.measure.join_map_map MeasureTheory.Measure.join_map_map
+-/
 
 #print MeasureTheory.Measure.join_map_join /-
 theorem join_map_join (μ : Measure (Measure (Measure α))) : join (map join μ) = join (join μ) :=
Diff
@@ -147,7 +147,7 @@ theorem measurable_join : Measurable (join : Measure (Measure α) → Measure α
 
 #print MeasureTheory.Measure.lintegral_join /-
 theorem lintegral_join {m : Measure (Measure α)} {f : α → ℝ≥0∞} (hf : Measurable f) :
-    (∫⁻ x, f x ∂join m) = ∫⁻ μ, ∫⁻ x, f x ∂μ ∂m :=
+    ∫⁻ x, f x ∂join m = ∫⁻ μ, ∫⁻ x, f x ∂μ ∂m :=
   by
   simp_rw [lintegral_eq_supr_eapprox_lintegral hf, simple_func.lintegral,
     join_apply (simple_func.measurable_set_preimage _ _)]
@@ -213,7 +213,7 @@ theorem measurable_bind' {g : α → Measure β} (hg : Measurable g) : Measurabl
 -/
 
 theorem lintegral_bind {m : Measure α} {μ : α → Measure β} {f : β → ℝ≥0∞} (hμ : Measurable μ)
-    (hf : Measurable f) : (∫⁻ x, f x ∂bind m μ) = ∫⁻ a, ∫⁻ x, f x ∂μ a ∂m :=
+    (hf : Measurable f) : ∫⁻ x, f x ∂bind m μ = ∫⁻ a, ∫⁻ x, f x ∂μ a ∂m :=
   (lintegral_join hf).trans (lintegral_map (measurable_lintegral hf) hμ)
 #align measure_theory.measure.lintegral_bind MeasureTheory.Measure.lintegral_bind
 
Diff
@@ -38,7 +38,7 @@ giry monad
 
 noncomputable section
 
-open Classical BigOperators ENNReal
+open scoped Classical BigOperators ENNReal
 
 open Classical Set Filter
 
Diff
@@ -60,12 +60,6 @@ theorem measurable_coe {s : Set α} (hs : MeasurableSet s) : Measurable fun μ :
 #align measure_theory.measure.measurable_coe MeasureTheory.Measure.measurable_coe
 -/
 
-/- warning: measure_theory.measure.measurable_of_measurable_coe -> MeasureTheory.Measure.measurable_of_measurable_coe is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] (f : β -> (MeasureTheory.Measure.{u1} α _inst_1)), (forall (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Measurable.{u2, 0} β ENNReal _inst_2 ENNReal.measurableSpace (fun (b : β) => coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (f b) s))) -> (Measurable.{u2, u1} β (MeasureTheory.Measure.{u1} α _inst_1) _inst_2 (MeasureTheory.Measure.instMeasurableSpace.{u1} α _inst_1) f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] (f : β -> (MeasureTheory.Measure.{u2} α _inst_1)), (forall (s : Set.{u2} α), (MeasurableSet.{u2} α _inst_1 s) -> (Measurable.{u1, 0} β ENNReal _inst_2 ENNReal.measurableSpace (fun (b : β) => MeasureTheory.OuterMeasure.measureOf.{u2} α (MeasureTheory.Measure.toOuterMeasure.{u2} α _inst_1 (f b)) s))) -> (Measurable.{u1, u2} β (MeasureTheory.Measure.{u2} α _inst_1) _inst_2 (MeasureTheory.Measure.instMeasurableSpace.{u2} α _inst_1) f)
-Case conversion may be inaccurate. Consider using '#align measure_theory.measure.measurable_of_measurable_coe MeasureTheory.Measure.measurable_of_measurable_coeₓ'. -/
 theorem measurable_of_measurable_coe (f : β → Measure α)
     (h : ∀ (s : Set α) (hs : MeasurableSet s), Measurable fun b => f b s) : Measurable f :=
   Measurable.of_le_map <|
@@ -88,12 +82,6 @@ theorem measurable_measure {μ : α → Measure β} :
 #align measure_theory.measure.measurable_measure MeasureTheory.Measure.measurable_measure
 -/
 
-/- warning: measure_theory.measure.measurable_map -> MeasureTheory.Measure.measurable_map is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] (f : α -> β), (Measurable.{u1, u2} α β _inst_1 _inst_2 f) -> (Measurable.{u1, u2} (MeasureTheory.Measure.{u1} α _inst_1) (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u1} α _inst_1) (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) (fun (μ : MeasureTheory.Measure.{u1} α _inst_1) => MeasureTheory.Measure.map.{u1, u2} α β _inst_2 _inst_1 f μ))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] (f : α -> β), (Measurable.{u2, u1} α β _inst_1 _inst_2 f) -> (Measurable.{u2, u1} (MeasureTheory.Measure.{u2} α _inst_1) (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u2} α _inst_1) (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) (fun (μ : MeasureTheory.Measure.{u2} α _inst_1) => MeasureTheory.Measure.map.{u2, u1} α β _inst_2 _inst_1 f μ))
-Case conversion may be inaccurate. Consider using '#align measure_theory.measure.measurable_map MeasureTheory.Measure.measurable_mapₓ'. -/
 theorem measurable_map (f : α → β) (hf : Measurable f) : Measurable fun μ : Measure α => map f μ :=
   by
   refine' measurable_of_measurable_coe _ fun s hs => _
@@ -198,12 +186,6 @@ theorem bind_zero_left (f : α → Measure β) : bind 0 f = 0 := by simp [bind]
 #align measure_theory.measure.bind_zero_left MeasureTheory.Measure.bind_zero_left
 -/
 
-/- warning: measure_theory.measure.bind_zero_right -> MeasureTheory.Measure.bind_zero_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] (m : MeasureTheory.Measure.{u1} α _inst_1), Eq.{succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m (OfNat.ofNat.{max u1 u2} (α -> (MeasureTheory.Measure.{u2} β _inst_2)) 0 (OfNat.mk.{max u1 u2} (α -> (MeasureTheory.Measure.{u2} β _inst_2)) 0 (Zero.zero.{max u1 u2} (α -> (MeasureTheory.Measure.{u2} β _inst_2)) (Pi.instZero.{u1, u2} α (fun (ᾰ : α) => MeasureTheory.Measure.{u2} β _inst_2) (fun (i : α) => MeasureTheory.Measure.instZero.{u2} β _inst_2)))))) (OfNat.ofNat.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (OfNat.mk.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (Zero.zero.{u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instZero.{u2} β _inst_2))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] (m : MeasureTheory.Measure.{u2} α _inst_1), Eq.{succ u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m (OfNat.ofNat.{max u2 u1} (α -> (MeasureTheory.Measure.{u1} β _inst_2)) 0 (Zero.toOfNat0.{max u2 u1} (α -> (MeasureTheory.Measure.{u1} β _inst_2)) (Pi.instZero.{u2, u1} α (fun (a._@.Mathlib.MeasureTheory.Measure.GiryMonad._hyg.1222 : α) => MeasureTheory.Measure.{u1} β _inst_2) (fun (i : α) => MeasureTheory.Measure.instZero.{u1} β _inst_2))))) (OfNat.ofNat.{u1} (MeasureTheory.Measure.{u1} β _inst_2) 0 (Zero.toOfNat0.{u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instZero.{u1} β _inst_2)))
-Case conversion may be inaccurate. Consider using '#align measure_theory.measure.bind_zero_right MeasureTheory.Measure.bind_zero_rightₓ'. -/
 @[simp]
 theorem bind_zero_right (m : Measure α) : bind m (0 : α → Measure β) = 0 :=
   by
@@ -213,23 +195,11 @@ theorem bind_zero_right (m : Measure α) : bind m (0 : α → Measure β) = 0 :=
   simp only [Pi.zero_apply, coe_zero, lintegral_const, MulZeroClass.zero_mul]
 #align measure_theory.measure.bind_zero_right MeasureTheory.Measure.bind_zero_right
 
-/- warning: measure_theory.measure.bind_zero_right' -> MeasureTheory.Measure.bind_zero_right' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] (m : MeasureTheory.Measure.{u1} α _inst_1), Eq.{succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m (fun (_x : α) => OfNat.ofNat.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (OfNat.mk.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (Zero.zero.{u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instZero.{u2} β _inst_2))))) (OfNat.ofNat.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (OfNat.mk.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (Zero.zero.{u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instZero.{u2} β _inst_2))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] (m : MeasureTheory.Measure.{u2} α _inst_1), Eq.{succ u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m (fun (_x : α) => OfNat.ofNat.{u1} (MeasureTheory.Measure.{u1} β _inst_2) 0 (Zero.toOfNat0.{u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instZero.{u1} β _inst_2)))) (OfNat.ofNat.{u1} (MeasureTheory.Measure.{u1} β _inst_2) 0 (Zero.toOfNat0.{u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instZero.{u1} β _inst_2)))
-Case conversion may be inaccurate. Consider using '#align measure_theory.measure.bind_zero_right' MeasureTheory.Measure.bind_zero_right'ₓ'. -/
 @[simp]
 theorem bind_zero_right' (m : Measure α) : bind m (fun _ => 0 : α → Measure β) = 0 :=
   bind_zero_right m
 #align measure_theory.measure.bind_zero_right' MeasureTheory.Measure.bind_zero_right'
 
-/- warning: measure_theory.measure.bind_apply -> MeasureTheory.Measure.bind_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] {m : MeasureTheory.Measure.{u1} α _inst_1} {f : α -> (MeasureTheory.Measure.{u2} β _inst_2)} {s : Set.{u2} β}, (MeasurableSet.{u2} β _inst_2 s) -> (Measurable.{u1, u2} α (MeasureTheory.Measure.{u2} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) f) -> (Eq.{1} ENNReal (coeFn.{succ u2, succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (fun (_x : MeasureTheory.Measure.{u2} β _inst_2) => (Set.{u2} β) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u2} β _inst_2) (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m f) s) (MeasureTheory.lintegral.{u1} α _inst_1 m (fun (a : α) => coeFn.{succ u2, succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (fun (_x : MeasureTheory.Measure.{u2} β _inst_2) => (Set.{u2} β) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u2} β _inst_2) (f a) s)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] {m : MeasureTheory.Measure.{u2} α _inst_1} {f : α -> (MeasureTheory.Measure.{u1} β _inst_2)} {s : Set.{u1} β}, (MeasurableSet.{u1} β _inst_2 s) -> (Measurable.{u2, u1} α (MeasureTheory.Measure.{u1} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) f) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} β (MeasureTheory.Measure.toOuterMeasure.{u1} β _inst_2 (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m f)) s) (MeasureTheory.lintegral.{u2} α _inst_1 m (fun (a : α) => MeasureTheory.OuterMeasure.measureOf.{u1} β (MeasureTheory.Measure.toOuterMeasure.{u1} β _inst_2 (f a)) s)))
-Case conversion may be inaccurate. Consider using '#align measure_theory.measure.bind_apply MeasureTheory.Measure.bind_applyₓ'. -/
 @[simp]
 theorem bind_apply {m : Measure α} {f : α → Measure β} {s : Set β} (hs : MeasurableSet s)
     (hf : Measurable f) : bind m f s = ∫⁻ a, f a s ∂m := by
@@ -242,23 +212,11 @@ theorem measurable_bind' {g : α → Measure β} (hg : Measurable g) : Measurabl
 #align measure_theory.measure.measurable_bind' MeasureTheory.Measure.measurable_bind'
 -/
 
-/- warning: measure_theory.measure.lintegral_bind -> MeasureTheory.Measure.lintegral_bind is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] {m : MeasureTheory.Measure.{u1} α _inst_1} {μ : α -> (MeasureTheory.Measure.{u2} β _inst_2)} {f : β -> ENNReal}, (Measurable.{u1, u2} α (MeasureTheory.Measure.{u2} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) μ) -> (Measurable.{u2, 0} β ENNReal _inst_2 ENNReal.measurableSpace f) -> (Eq.{1} ENNReal (MeasureTheory.lintegral.{u2} β _inst_2 (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m μ) (fun (x : β) => f x)) (MeasureTheory.lintegral.{u1} α _inst_1 m (fun (a : α) => MeasureTheory.lintegral.{u2} β _inst_2 (μ a) (fun (x : β) => f x))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] {m : MeasureTheory.Measure.{u2} α _inst_1} {μ : α -> (MeasureTheory.Measure.{u1} β _inst_2)} {f : β -> ENNReal}, (Measurable.{u2, u1} α (MeasureTheory.Measure.{u1} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) μ) -> (Measurable.{u1, 0} β ENNReal _inst_2 ENNReal.measurableSpace f) -> (Eq.{1} ENNReal (MeasureTheory.lintegral.{u1} β _inst_2 (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m μ) (fun (x : β) => f x)) (MeasureTheory.lintegral.{u2} α _inst_1 m (fun (a : α) => MeasureTheory.lintegral.{u1} β _inst_2 (μ a) (fun (x : β) => f x))))
-Case conversion may be inaccurate. Consider using '#align measure_theory.measure.lintegral_bind MeasureTheory.Measure.lintegral_bindₓ'. -/
 theorem lintegral_bind {m : Measure α} {μ : α → Measure β} {f : β → ℝ≥0∞} (hμ : Measurable μ)
     (hf : Measurable f) : (∫⁻ x, f x ∂bind m μ) = ∫⁻ a, ∫⁻ x, f x ∂μ a ∂m :=
   (lintegral_join hf).trans (lintegral_map (measurable_lintegral hf) hμ)
 #align measure_theory.measure.lintegral_bind MeasureTheory.Measure.lintegral_bind
 
-/- warning: measure_theory.measure.bind_bind -> MeasureTheory.Measure.bind_bind is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] {γ : Type.{u3}} [_inst_3 : MeasurableSpace.{u3} γ] {m : MeasureTheory.Measure.{u1} α _inst_1} {f : α -> (MeasureTheory.Measure.{u2} β _inst_2)} {g : β -> (MeasureTheory.Measure.{u3} γ _inst_3)}, (Measurable.{u1, u2} α (MeasureTheory.Measure.{u2} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) f) -> (Measurable.{u2, u3} β (MeasureTheory.Measure.{u3} γ _inst_3) _inst_2 (MeasureTheory.Measure.instMeasurableSpace.{u3} γ _inst_3) g) -> (Eq.{succ u3} (MeasureTheory.Measure.{u3} γ _inst_3) (MeasureTheory.Measure.bind.{u2, u3} β γ _inst_2 _inst_3 (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m f) g) (MeasureTheory.Measure.bind.{u1, u3} α γ _inst_1 _inst_3 m (fun (a : α) => MeasureTheory.Measure.bind.{u2, u3} β γ _inst_2 _inst_3 (f a) g)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] {γ : Type.{u3}} [_inst_3 : MeasurableSpace.{u3} γ] {m : MeasureTheory.Measure.{u2} α _inst_1} {f : α -> (MeasureTheory.Measure.{u1} β _inst_2)} {g : β -> (MeasureTheory.Measure.{u3} γ _inst_3)}, (Measurable.{u2, u1} α (MeasureTheory.Measure.{u1} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) f) -> (Measurable.{u1, u3} β (MeasureTheory.Measure.{u3} γ _inst_3) _inst_2 (MeasureTheory.Measure.instMeasurableSpace.{u3} γ _inst_3) g) -> (Eq.{succ u3} (MeasureTheory.Measure.{u3} γ _inst_3) (MeasureTheory.Measure.bind.{u1, u3} β γ _inst_2 _inst_3 (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m f) g) (MeasureTheory.Measure.bind.{u2, u3} α γ _inst_1 _inst_3 m (fun (a : α) => MeasureTheory.Measure.bind.{u1, u3} β γ _inst_2 _inst_3 (f a) g)))
-Case conversion may be inaccurate. Consider using '#align measure_theory.measure.bind_bind MeasureTheory.Measure.bind_bindₓ'. -/
 theorem bind_bind {γ} [MeasurableSpace γ] {m : Measure α} {f : α → Measure β} {g : β → Measure γ}
     (hf : Measurable f) (hg : Measurable g) : bind (bind m f) g = bind m fun a => bind (f a) g :=
   by
@@ -287,12 +245,6 @@ theorem join_eq_bind (μ : Measure (Measure α)) : join μ = bind μ id := by rw
 #align measure_theory.measure.join_eq_bind MeasureTheory.Measure.join_eq_bind
 -/
 
-/- warning: measure_theory.measure.join_map_map -> MeasureTheory.Measure.join_map_map is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] {f : α -> β}, (Measurable.{u1, u2} α β _inst_1 _inst_2 f) -> (forall (μ : MeasureTheory.Measure.{u1} (MeasureTheory.Measure.{u1} α _inst_1) (MeasureTheory.Measure.instMeasurableSpace.{u1} α _inst_1)), Eq.{succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.join.{u2} β _inst_2 (MeasureTheory.Measure.map.{u1, u2} (MeasureTheory.Measure.{u1} α _inst_1) (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u1} α _inst_1) (MeasureTheory.Measure.map.{u1, u2} α β _inst_2 _inst_1 f) μ)) (MeasureTheory.Measure.map.{u1, u2} α β _inst_2 _inst_1 f (MeasureTheory.Measure.join.{u1} α _inst_1 μ)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] {f : α -> β}, (Measurable.{u2, u1} α β _inst_1 _inst_2 f) -> (forall (μ : MeasureTheory.Measure.{u2} (MeasureTheory.Measure.{u2} α _inst_1) (MeasureTheory.Measure.instMeasurableSpace.{u2} α _inst_1)), Eq.{succ u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.join.{u1} β _inst_2 (MeasureTheory.Measure.map.{u2, u1} (MeasureTheory.Measure.{u2} α _inst_1) (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u2} α _inst_1) (MeasureTheory.Measure.map.{u2, u1} α β _inst_2 _inst_1 f) μ)) (MeasureTheory.Measure.map.{u2, u1} α β _inst_2 _inst_1 f (MeasureTheory.Measure.join.{u2} α _inst_1 μ)))
-Case conversion may be inaccurate. Consider using '#align measure_theory.measure.join_map_map MeasureTheory.Measure.join_map_mapₓ'. -/
 theorem join_map_map {f : α → β} (hf : Measurable f) (μ : Measure (Measure α)) :
     join (map (map f) μ) = map f (join μ) := by
   ext1 s hs
Diff
@@ -145,9 +145,7 @@ theorem join_apply {m : Measure (Measure α)} {s : Set α} (hs : MeasurableSet s
 
 #print MeasureTheory.Measure.join_zero /-
 @[simp]
-theorem join_zero : (0 : Measure (Measure α)).join = 0 :=
-  by
-  ext1 s hs
+theorem join_zero : (0 : Measure (Measure α)).join = 0 := by ext1 s hs;
   simp only [hs, join_apply, lintegral_zero_measure, coe_zero, Pi.zero_apply]
 #align measure_theory.measure.join_zero MeasureTheory.Measure.join_zero
 -/
@@ -177,8 +175,7 @@ theorem lintegral_join {m : Measure (Measure α)} {f : α → ℝ≥0∞} (hf :
     · exact fun n m h μ => simple_func.lintegral_mono (simple_func.monotone_eapprox _ h) le_rfl
   intro s f hf hm
   rw [lintegral_supr _ hm]
-  swap
-  · exact fun n => Finset.measurable_sum _ fun r _ => (hf _ _).const_mul _
+  swap; · exact fun n => Finset.measurable_sum _ fun r _ => (hf _ _).const_mul _
   congr
   funext n
   rw [lintegral_finset_sum (s n)]
@@ -271,10 +268,8 @@ theorem bind_bind {γ} [MeasurableSpace γ] {m : Measure α} {f : α → Measure
 #align measure_theory.measure.bind_bind MeasureTheory.Measure.bind_bind
 
 #print MeasureTheory.Measure.bind_dirac /-
-theorem bind_dirac {f : α → Measure β} (hf : Measurable f) (a : α) : bind (dirac a) f = f a :=
-  by
-  ext1 s hs
-  rw [bind_apply hs hf, lintegral_dirac' a ((measurable_coe hs).comp hf)]
+theorem bind_dirac {f : α → Measure β} (hf : Measurable f) (a : α) : bind (dirac a) f = f a := by
+  ext1 s hs; rw [bind_apply hs hf, lintegral_dirac' a ((measurable_coe hs).comp hf)]
 #align measure_theory.measure.bind_dirac MeasureTheory.Measure.bind_dirac
 -/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 
 ! This file was ported from Lean 3 source module measure_theory.measure.giry_monad
-! leanprover-community/mathlib commit 56f4cd1ef396e9fd389b5d8371ee9ad91d163625
+! leanprover-community/mathlib commit 38df578a6450a8c5142b3727e3ae894c2300cae0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.MeasureTheory.Integral.Lebesgue
 /-!
 # The Giry monad
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 Let X be a measurable space. The collection of all measures on X again
 forms a measurable space. This construction forms a monad on
 measurable spaces and measurable functions, called the Giry monad.
Diff
@@ -51,10 +51,18 @@ variable [MeasurableSpace α] [MeasurableSpace β]
 instance : MeasurableSpace (Measure α) :=
   ⨆ (s : Set α) (hs : MeasurableSet s), (borel ℝ≥0∞).comap fun μ => μ s
 
+#print MeasureTheory.Measure.measurable_coe /-
 theorem measurable_coe {s : Set α} (hs : MeasurableSet s) : Measurable fun μ : Measure α => μ s :=
   Measurable.of_comap_le <| le_iSup_of_le s <| le_iSup_of_le hs <| le_rfl
 #align measure_theory.measure.measurable_coe MeasureTheory.Measure.measurable_coe
+-/
 
+/- warning: measure_theory.measure.measurable_of_measurable_coe -> MeasureTheory.Measure.measurable_of_measurable_coe is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] (f : β -> (MeasureTheory.Measure.{u1} α _inst_1)), (forall (s : Set.{u1} α), (MeasurableSet.{u1} α _inst_1 s) -> (Measurable.{u2, 0} β ENNReal _inst_2 ENNReal.measurableSpace (fun (b : β) => coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} α _inst_1) (fun (_x : MeasureTheory.Measure.{u1} α _inst_1) => (Set.{u1} α) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} α _inst_1) (f b) s))) -> (Measurable.{u2, u1} β (MeasureTheory.Measure.{u1} α _inst_1) _inst_2 (MeasureTheory.Measure.instMeasurableSpace.{u1} α _inst_1) f)
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] (f : β -> (MeasureTheory.Measure.{u2} α _inst_1)), (forall (s : Set.{u2} α), (MeasurableSet.{u2} α _inst_1 s) -> (Measurable.{u1, 0} β ENNReal _inst_2 ENNReal.measurableSpace (fun (b : β) => MeasureTheory.OuterMeasure.measureOf.{u2} α (MeasureTheory.Measure.toOuterMeasure.{u2} α _inst_1 (f b)) s))) -> (Measurable.{u1, u2} β (MeasureTheory.Measure.{u2} α _inst_1) _inst_2 (MeasureTheory.Measure.instMeasurableSpace.{u2} α _inst_1) f)
+Case conversion may be inaccurate. Consider using '#align measure_theory.measure.measurable_of_measurable_coe MeasureTheory.Measure.measurable_of_measurable_coeₓ'. -/
 theorem measurable_of_measurable_coe (f : β → Measure α)
     (h : ∀ (s : Set α) (hs : MeasurableSet s), Measurable fun b => f b s) : Measurable f :=
   Measurable.of_le_map <|
@@ -70,11 +78,19 @@ instance {α : Type _} {m : MeasurableSpace α} : MeasurableAdd₂ (Measure α)
   · exact (measure.measurable_coe hs).comp measurable_fst
   · exact (measure.measurable_coe hs).comp measurable_snd
 
+#print MeasureTheory.Measure.measurable_measure /-
 theorem measurable_measure {μ : α → Measure β} :
     Measurable μ ↔ ∀ (s : Set β) (hs : MeasurableSet s), Measurable fun b => μ b s :=
   ⟨fun hμ s hs => (measurable_coe hs).comp hμ, measurable_of_measurable_coe μ⟩
 #align measure_theory.measure.measurable_measure MeasureTheory.Measure.measurable_measure
+-/
 
+/- warning: measure_theory.measure.measurable_map -> MeasureTheory.Measure.measurable_map is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] (f : α -> β), (Measurable.{u1, u2} α β _inst_1 _inst_2 f) -> (Measurable.{u1, u2} (MeasureTheory.Measure.{u1} α _inst_1) (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u1} α _inst_1) (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) (fun (μ : MeasureTheory.Measure.{u1} α _inst_1) => MeasureTheory.Measure.map.{u1, u2} α β _inst_2 _inst_1 f μ))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] (f : α -> β), (Measurable.{u2, u1} α β _inst_1 _inst_2 f) -> (Measurable.{u2, u1} (MeasureTheory.Measure.{u2} α _inst_1) (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u2} α _inst_1) (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) (fun (μ : MeasureTheory.Measure.{u2} α _inst_1) => MeasureTheory.Measure.map.{u2, u1} α β _inst_2 _inst_1 f μ))
+Case conversion may be inaccurate. Consider using '#align measure_theory.measure.measurable_map MeasureTheory.Measure.measurable_mapₓ'. -/
 theorem measurable_map (f : α → β) (hf : Measurable f) : Measurable fun μ : Measure α => map f μ :=
   by
   refine' measurable_of_measurable_coe _ fun s hs => _
@@ -82,13 +98,16 @@ theorem measurable_map (f : α → β) (hf : Measurable f) : Measurable fun μ :
   exact measurable_coe (hf hs)
 #align measure_theory.measure.measurable_map MeasureTheory.Measure.measurable_map
 
+#print MeasureTheory.Measure.measurable_dirac /-
 theorem measurable_dirac : Measurable (Measure.dirac : α → Measure α) :=
   by
   refine' measurable_of_measurable_coe _ fun s hs => _
   simp_rw [dirac_apply' _ hs]
   exact measurable_one.indicator hs
 #align measure_theory.measure.measurable_dirac MeasureTheory.Measure.measurable_dirac
+-/
 
+#print MeasureTheory.Measure.measurable_lintegral /-
 theorem measurable_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) :
     Measurable fun μ : Measure α => ∫⁻ x, f x ∂μ :=
   by
@@ -97,7 +116,9 @@ theorem measurable_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) :
   refine' Measurable.const_mul _ _
   exact measurable_coe ((simple_func.eapprox f n).measurableSet_preimage _)
 #align measure_theory.measure.measurable_lintegral MeasureTheory.Measure.measurable_lintegral
+-/
 
+#print MeasureTheory.Measure.join /-
 /-- Monadic join on `measure` in the category of measurable spaces and measurable
 functions. -/
 def join (m : Measure (Measure α)) : Measure α :=
@@ -109,25 +130,33 @@ def join (m : Measure (Measure α)) : Measure α :=
       apply lintegral_tsum
       intro i; exact (measurable_coe (hf i)).AEMeasurable)
 #align measure_theory.measure.join MeasureTheory.Measure.join
+-/
 
+#print MeasureTheory.Measure.join_apply /-
 @[simp]
 theorem join_apply {m : Measure (Measure α)} {s : Set α} (hs : MeasurableSet s) :
     join m s = ∫⁻ μ, μ s ∂m :=
   Measure.ofMeasurable_apply s hs
 #align measure_theory.measure.join_apply MeasureTheory.Measure.join_apply
+-/
 
+#print MeasureTheory.Measure.join_zero /-
 @[simp]
 theorem join_zero : (0 : Measure (Measure α)).join = 0 :=
   by
   ext1 s hs
   simp only [hs, join_apply, lintegral_zero_measure, coe_zero, Pi.zero_apply]
 #align measure_theory.measure.join_zero MeasureTheory.Measure.join_zero
+-/
 
+#print MeasureTheory.Measure.measurable_join /-
 theorem measurable_join : Measurable (join : Measure (Measure α) → Measure α) :=
   measurable_of_measurable_coe _ fun s hs => by
     simp only [join_apply hs] <;> exact measurable_lintegral (measurable_coe hs)
 #align measure_theory.measure.measurable_join MeasureTheory.Measure.measurable_join
+-/
 
+#print MeasureTheory.Measure.lintegral_join /-
 theorem lintegral_join {m : Measure (Measure α)} {f : α → ℝ≥0∞} (hf : Measurable f) :
     (∫⁻ x, f x ∂join m) = ∫⁻ μ, ∫⁻ x, f x ∂μ ∂m :=
   by
@@ -153,17 +182,28 @@ theorem lintegral_join {m : Measure (Measure α)} {f : α → ℝ≥0∞} (hf :
   · simp_rw [lintegral_const_mul _ (hf _ _)]
   · exact fun r _ => (hf _ _).const_mul _
 #align measure_theory.measure.lintegral_join MeasureTheory.Measure.lintegral_join
+-/
 
+#print MeasureTheory.Measure.bind /-
 /-- Monadic bind on `measure`, only works in the category of measurable spaces and measurable
 functions. When the function `f` is not measurable the result is not well defined. -/
 def bind (m : Measure α) (f : α → Measure β) : Measure β :=
   join (map f m)
 #align measure_theory.measure.bind MeasureTheory.Measure.bind
+-/
 
+#print MeasureTheory.Measure.bind_zero_left /-
 @[simp]
 theorem bind_zero_left (f : α → Measure β) : bind 0 f = 0 := by simp [bind]
 #align measure_theory.measure.bind_zero_left MeasureTheory.Measure.bind_zero_left
+-/
 
+/- warning: measure_theory.measure.bind_zero_right -> MeasureTheory.Measure.bind_zero_right is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] (m : MeasureTheory.Measure.{u1} α _inst_1), Eq.{succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m (OfNat.ofNat.{max u1 u2} (α -> (MeasureTheory.Measure.{u2} β _inst_2)) 0 (OfNat.mk.{max u1 u2} (α -> (MeasureTheory.Measure.{u2} β _inst_2)) 0 (Zero.zero.{max u1 u2} (α -> (MeasureTheory.Measure.{u2} β _inst_2)) (Pi.instZero.{u1, u2} α (fun (ᾰ : α) => MeasureTheory.Measure.{u2} β _inst_2) (fun (i : α) => MeasureTheory.Measure.instZero.{u2} β _inst_2)))))) (OfNat.ofNat.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (OfNat.mk.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (Zero.zero.{u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instZero.{u2} β _inst_2))))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] (m : MeasureTheory.Measure.{u2} α _inst_1), Eq.{succ u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m (OfNat.ofNat.{max u2 u1} (α -> (MeasureTheory.Measure.{u1} β _inst_2)) 0 (Zero.toOfNat0.{max u2 u1} (α -> (MeasureTheory.Measure.{u1} β _inst_2)) (Pi.instZero.{u2, u1} α (fun (a._@.Mathlib.MeasureTheory.Measure.GiryMonad._hyg.1222 : α) => MeasureTheory.Measure.{u1} β _inst_2) (fun (i : α) => MeasureTheory.Measure.instZero.{u1} β _inst_2))))) (OfNat.ofNat.{u1} (MeasureTheory.Measure.{u1} β _inst_2) 0 (Zero.toOfNat0.{u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instZero.{u1} β _inst_2)))
+Case conversion may be inaccurate. Consider using '#align measure_theory.measure.bind_zero_right MeasureTheory.Measure.bind_zero_rightₓ'. -/
 @[simp]
 theorem bind_zero_right (m : Measure α) : bind m (0 : α → Measure β) = 0 :=
   by
@@ -173,26 +213,52 @@ theorem bind_zero_right (m : Measure α) : bind m (0 : α → Measure β) = 0 :=
   simp only [Pi.zero_apply, coe_zero, lintegral_const, MulZeroClass.zero_mul]
 #align measure_theory.measure.bind_zero_right MeasureTheory.Measure.bind_zero_right
 
+/- warning: measure_theory.measure.bind_zero_right' -> MeasureTheory.Measure.bind_zero_right' is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] (m : MeasureTheory.Measure.{u1} α _inst_1), Eq.{succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m (fun (_x : α) => OfNat.ofNat.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (OfNat.mk.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (Zero.zero.{u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instZero.{u2} β _inst_2))))) (OfNat.ofNat.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (OfNat.mk.{u2} (MeasureTheory.Measure.{u2} β _inst_2) 0 (Zero.zero.{u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instZero.{u2} β _inst_2))))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] (m : MeasureTheory.Measure.{u2} α _inst_1), Eq.{succ u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m (fun (_x : α) => OfNat.ofNat.{u1} (MeasureTheory.Measure.{u1} β _inst_2) 0 (Zero.toOfNat0.{u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instZero.{u1} β _inst_2)))) (OfNat.ofNat.{u1} (MeasureTheory.Measure.{u1} β _inst_2) 0 (Zero.toOfNat0.{u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instZero.{u1} β _inst_2)))
+Case conversion may be inaccurate. Consider using '#align measure_theory.measure.bind_zero_right' MeasureTheory.Measure.bind_zero_right'ₓ'. -/
 @[simp]
 theorem bind_zero_right' (m : Measure α) : bind m (fun _ => 0 : α → Measure β) = 0 :=
   bind_zero_right m
 #align measure_theory.measure.bind_zero_right' MeasureTheory.Measure.bind_zero_right'
 
+/- warning: measure_theory.measure.bind_apply -> MeasureTheory.Measure.bind_apply is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] {m : MeasureTheory.Measure.{u1} α _inst_1} {f : α -> (MeasureTheory.Measure.{u2} β _inst_2)} {s : Set.{u2} β}, (MeasurableSet.{u2} β _inst_2 s) -> (Measurable.{u1, u2} α (MeasureTheory.Measure.{u2} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) f) -> (Eq.{1} ENNReal (coeFn.{succ u2, succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (fun (_x : MeasureTheory.Measure.{u2} β _inst_2) => (Set.{u2} β) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u2} β _inst_2) (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m f) s) (MeasureTheory.lintegral.{u1} α _inst_1 m (fun (a : α) => coeFn.{succ u2, succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (fun (_x : MeasureTheory.Measure.{u2} β _inst_2) => (Set.{u2} β) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u2} β _inst_2) (f a) s)))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] {m : MeasureTheory.Measure.{u2} α _inst_1} {f : α -> (MeasureTheory.Measure.{u1} β _inst_2)} {s : Set.{u1} β}, (MeasurableSet.{u1} β _inst_2 s) -> (Measurable.{u2, u1} α (MeasureTheory.Measure.{u1} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) f) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} β (MeasureTheory.Measure.toOuterMeasure.{u1} β _inst_2 (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m f)) s) (MeasureTheory.lintegral.{u2} α _inst_1 m (fun (a : α) => MeasureTheory.OuterMeasure.measureOf.{u1} β (MeasureTheory.Measure.toOuterMeasure.{u1} β _inst_2 (f a)) s)))
+Case conversion may be inaccurate. Consider using '#align measure_theory.measure.bind_apply MeasureTheory.Measure.bind_applyₓ'. -/
 @[simp]
 theorem bind_apply {m : Measure α} {f : α → Measure β} {s : Set β} (hs : MeasurableSet s)
     (hf : Measurable f) : bind m f s = ∫⁻ a, f a s ∂m := by
   rw [bind, join_apply hs, lintegral_map (measurable_coe hs) hf]
 #align measure_theory.measure.bind_apply MeasureTheory.Measure.bind_apply
 
+#print MeasureTheory.Measure.measurable_bind' /-
 theorem measurable_bind' {g : α → Measure β} (hg : Measurable g) : Measurable fun m => bind m g :=
   measurable_join.comp (measurable_map _ hg)
 #align measure_theory.measure.measurable_bind' MeasureTheory.Measure.measurable_bind'
+-/
 
+/- warning: measure_theory.measure.lintegral_bind -> MeasureTheory.Measure.lintegral_bind is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] {m : MeasureTheory.Measure.{u1} α _inst_1} {μ : α -> (MeasureTheory.Measure.{u2} β _inst_2)} {f : β -> ENNReal}, (Measurable.{u1, u2} α (MeasureTheory.Measure.{u2} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) μ) -> (Measurable.{u2, 0} β ENNReal _inst_2 ENNReal.measurableSpace f) -> (Eq.{1} ENNReal (MeasureTheory.lintegral.{u2} β _inst_2 (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m μ) (fun (x : β) => f x)) (MeasureTheory.lintegral.{u1} α _inst_1 m (fun (a : α) => MeasureTheory.lintegral.{u2} β _inst_2 (μ a) (fun (x : β) => f x))))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] {m : MeasureTheory.Measure.{u2} α _inst_1} {μ : α -> (MeasureTheory.Measure.{u1} β _inst_2)} {f : β -> ENNReal}, (Measurable.{u2, u1} α (MeasureTheory.Measure.{u1} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) μ) -> (Measurable.{u1, 0} β ENNReal _inst_2 ENNReal.measurableSpace f) -> (Eq.{1} ENNReal (MeasureTheory.lintegral.{u1} β _inst_2 (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m μ) (fun (x : β) => f x)) (MeasureTheory.lintegral.{u2} α _inst_1 m (fun (a : α) => MeasureTheory.lintegral.{u1} β _inst_2 (μ a) (fun (x : β) => f x))))
+Case conversion may be inaccurate. Consider using '#align measure_theory.measure.lintegral_bind MeasureTheory.Measure.lintegral_bindₓ'. -/
 theorem lintegral_bind {m : Measure α} {μ : α → Measure β} {f : β → ℝ≥0∞} (hμ : Measurable μ)
     (hf : Measurable f) : (∫⁻ x, f x ∂bind m μ) = ∫⁻ a, ∫⁻ x, f x ∂μ a ∂m :=
   (lintegral_join hf).trans (lintegral_map (measurable_lintegral hf) hμ)
 #align measure_theory.measure.lintegral_bind MeasureTheory.Measure.lintegral_bind
 
+/- warning: measure_theory.measure.bind_bind -> MeasureTheory.Measure.bind_bind is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] {γ : Type.{u3}} [_inst_3 : MeasurableSpace.{u3} γ] {m : MeasureTheory.Measure.{u1} α _inst_1} {f : α -> (MeasureTheory.Measure.{u2} β _inst_2)} {g : β -> (MeasureTheory.Measure.{u3} γ _inst_3)}, (Measurable.{u1, u2} α (MeasureTheory.Measure.{u2} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) f) -> (Measurable.{u2, u3} β (MeasureTheory.Measure.{u3} γ _inst_3) _inst_2 (MeasureTheory.Measure.instMeasurableSpace.{u3} γ _inst_3) g) -> (Eq.{succ u3} (MeasureTheory.Measure.{u3} γ _inst_3) (MeasureTheory.Measure.bind.{u2, u3} β γ _inst_2 _inst_3 (MeasureTheory.Measure.bind.{u1, u2} α β _inst_1 _inst_2 m f) g) (MeasureTheory.Measure.bind.{u1, u3} α γ _inst_1 _inst_3 m (fun (a : α) => MeasureTheory.Measure.bind.{u2, u3} β γ _inst_2 _inst_3 (f a) g)))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] {γ : Type.{u3}} [_inst_3 : MeasurableSpace.{u3} γ] {m : MeasureTheory.Measure.{u2} α _inst_1} {f : α -> (MeasureTheory.Measure.{u1} β _inst_2)} {g : β -> (MeasureTheory.Measure.{u3} γ _inst_3)}, (Measurable.{u2, u1} α (MeasureTheory.Measure.{u1} β _inst_2) _inst_1 (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) f) -> (Measurable.{u1, u3} β (MeasureTheory.Measure.{u3} γ _inst_3) _inst_2 (MeasureTheory.Measure.instMeasurableSpace.{u3} γ _inst_3) g) -> (Eq.{succ u3} (MeasureTheory.Measure.{u3} γ _inst_3) (MeasureTheory.Measure.bind.{u1, u3} β γ _inst_2 _inst_3 (MeasureTheory.Measure.bind.{u2, u1} α β _inst_1 _inst_2 m f) g) (MeasureTheory.Measure.bind.{u2, u3} α γ _inst_1 _inst_3 m (fun (a : α) => MeasureTheory.Measure.bind.{u1, u3} β γ _inst_2 _inst_3 (f a) g)))
+Case conversion may be inaccurate. Consider using '#align measure_theory.measure.bind_bind MeasureTheory.Measure.bind_bindₓ'. -/
 theorem bind_bind {γ} [MeasurableSpace γ] {m : Measure α} {f : α → Measure β} {g : β → Measure γ}
     (hf : Measurable f) (hg : Measurable g) : bind (bind m f) g = bind m fun a => bind (f a) g :=
   by
@@ -201,22 +267,34 @@ theorem bind_bind {γ} [MeasurableSpace γ] {m : Measure α} {f : α → Measure
     lintegral_bind hf ((measurable_coe hs).comp hg), bind_apply hs hg]
 #align measure_theory.measure.bind_bind MeasureTheory.Measure.bind_bind
 
+#print MeasureTheory.Measure.bind_dirac /-
 theorem bind_dirac {f : α → Measure β} (hf : Measurable f) (a : α) : bind (dirac a) f = f a :=
   by
   ext1 s hs
   rw [bind_apply hs hf, lintegral_dirac' a ((measurable_coe hs).comp hf)]
 #align measure_theory.measure.bind_dirac MeasureTheory.Measure.bind_dirac
+-/
 
+#print MeasureTheory.Measure.dirac_bind /-
 theorem dirac_bind {m : Measure α} : bind m dirac = m :=
   by
   ext1 s hs
   simp only [bind_apply hs measurable_dirac, dirac_apply' _ hs, lintegral_indicator 1 hs,
     Pi.one_apply, lintegral_one, restrict_apply, MeasurableSet.univ, univ_inter]
 #align measure_theory.measure.dirac_bind MeasureTheory.Measure.dirac_bind
+-/
 
+#print MeasureTheory.Measure.join_eq_bind /-
 theorem join_eq_bind (μ : Measure (Measure α)) : join μ = bind μ id := by rw [bind, map_id]
 #align measure_theory.measure.join_eq_bind MeasureTheory.Measure.join_eq_bind
+-/
 
+/- warning: measure_theory.measure.join_map_map -> MeasureTheory.Measure.join_map_map is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : MeasurableSpace.{u1} α] [_inst_2 : MeasurableSpace.{u2} β] {f : α -> β}, (Measurable.{u1, u2} α β _inst_1 _inst_2 f) -> (forall (μ : MeasureTheory.Measure.{u1} (MeasureTheory.Measure.{u1} α _inst_1) (MeasureTheory.Measure.instMeasurableSpace.{u1} α _inst_1)), Eq.{succ u2} (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.join.{u2} β _inst_2 (MeasureTheory.Measure.map.{u1, u2} (MeasureTheory.Measure.{u1} α _inst_1) (MeasureTheory.Measure.{u2} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u2} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u1} α _inst_1) (MeasureTheory.Measure.map.{u1, u2} α β _inst_2 _inst_1 f) μ)) (MeasureTheory.Measure.map.{u1, u2} α β _inst_2 _inst_1 f (MeasureTheory.Measure.join.{u1} α _inst_1 μ)))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : MeasurableSpace.{u2} α] [_inst_2 : MeasurableSpace.{u1} β] {f : α -> β}, (Measurable.{u2, u1} α β _inst_1 _inst_2 f) -> (forall (μ : MeasureTheory.Measure.{u2} (MeasureTheory.Measure.{u2} α _inst_1) (MeasureTheory.Measure.instMeasurableSpace.{u2} α _inst_1)), Eq.{succ u1} (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.join.{u1} β _inst_2 (MeasureTheory.Measure.map.{u2, u1} (MeasureTheory.Measure.{u2} α _inst_1) (MeasureTheory.Measure.{u1} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u1} β _inst_2) (MeasureTheory.Measure.instMeasurableSpace.{u2} α _inst_1) (MeasureTheory.Measure.map.{u2, u1} α β _inst_2 _inst_1 f) μ)) (MeasureTheory.Measure.map.{u2, u1} α β _inst_2 _inst_1 f (MeasureTheory.Measure.join.{u2} α _inst_1 μ)))
+Case conversion may be inaccurate. Consider using '#align measure_theory.measure.join_map_map MeasureTheory.Measure.join_map_mapₓ'. -/
 theorem join_map_map {f : α → β} (hf : Measurable f) (μ : Measure (Measure α)) :
     join (map (map f) μ) = map f (join μ) := by
   ext1 s hs
@@ -225,6 +303,7 @@ theorem join_map_map {f : α → β} (hf : Measurable f) (μ : Measure (Measure
   simp_rw [map_apply hf hs]
 #align measure_theory.measure.join_map_map MeasureTheory.Measure.join_map_map
 
+#print MeasureTheory.Measure.join_map_join /-
 theorem join_map_join (μ : Measure (Measure (Measure α))) : join (map join μ) = join (join μ) :=
   by
   show bind μ join = join (join μ)
@@ -233,14 +312,19 @@ theorem join_map_join (μ : Measure (Measure (Measure α))) : join (map join μ)
   funext ν
   exact join_eq_bind ν
 #align measure_theory.measure.join_map_join MeasureTheory.Measure.join_map_join
+-/
 
+#print MeasureTheory.Measure.join_map_dirac /-
 theorem join_map_dirac (μ : Measure α) : join (map dirac μ) = μ :=
   dirac_bind
 #align measure_theory.measure.join_map_dirac MeasureTheory.Measure.join_map_dirac
+-/
 
+#print MeasureTheory.Measure.join_dirac /-
 theorem join_dirac (μ : Measure α) : join (dirac μ) = μ :=
   (join_eq_bind (dirac μ)).trans (bind_dirac measurable_id _)
 #align measure_theory.measure.join_dirac MeasureTheory.Measure.join_dirac
+-/
 
 end Measure
 
Diff
@@ -52,13 +52,13 @@ instance : MeasurableSpace (Measure α) :=
   ⨆ (s : Set α) (hs : MeasurableSet s), (borel ℝ≥0∞).comap fun μ => μ s
 
 theorem measurable_coe {s : Set α} (hs : MeasurableSet s) : Measurable fun μ : Measure α => μ s :=
-  Measurable.of_comap_le <| le_supᵢ_of_le s <| le_supᵢ_of_le hs <| le_rfl
+  Measurable.of_comap_le <| le_iSup_of_le s <| le_iSup_of_le hs <| le_rfl
 #align measure_theory.measure.measurable_coe MeasureTheory.Measure.measurable_coe
 
 theorem measurable_of_measurable_coe (f : β → Measure α)
     (h : ∀ (s : Set α) (hs : MeasurableSet s), Measurable fun b => f b s) : Measurable f :=
   Measurable.of_le_map <|
-    supᵢ₂_le fun s hs =>
+    iSup₂_le fun s hs =>
       MeasurableSpace.comap_le_iff_le_map.2 <| by rw [MeasurableSpace.map_comp] <;> exact h s hs
 #align measure_theory.measure.measurable_of_measurable_coe MeasureTheory.Measure.measurable_of_measurable_coe
 
@@ -93,7 +93,7 @@ theorem measurable_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) :
     Measurable fun μ : Measure α => ∫⁻ x, f x ∂μ :=
   by
   simp only [lintegral_eq_supr_eapprox_lintegral, hf, simple_func.lintegral]
-  refine' measurable_supᵢ fun n => Finset.measurable_sum _ fun i _ => _
+  refine' measurable_iSup fun n => Finset.measurable_sum _ fun i _ => _
   refine' Measurable.const_mul _ _
   exact measurable_coe ((simple_func.eapprox f n).measurableSet_preimage _)
 #align measure_theory.measure.measurable_lintegral MeasureTheory.Measure.measurable_lintegral
Diff
@@ -62,7 +62,7 @@ theorem measurable_of_measurable_coe (f : β → Measure α)
       MeasurableSpace.comap_le_iff_le_map.2 <| by rw [MeasurableSpace.map_comp] <;> exact h s hs
 #align measure_theory.measure.measurable_of_measurable_coe MeasureTheory.Measure.measurable_of_measurable_coe
 
-instance {α : Type _} {m : MeasurableSpace α} : HasMeasurableAdd₂ (Measure α) :=
+instance {α : Type _} {m : MeasurableSpace α} : MeasurableAdd₂ (Measure α) :=
   by
   refine' ⟨measure.measurable_of_measurable_coe _ fun s hs => _⟩
   simp_rw [measure.coe_add, Pi.add_apply]
Diff
@@ -107,7 +107,7 @@ def join (m : Measure (Measure α)) : Measure α :=
       intro f hf h
       simp_rw [measure_Union h hf]
       apply lintegral_tsum
-      intro i; exact (measurable_coe (hf i)).AeMeasurable)
+      intro i; exact (measurable_coe (hf i)).AEMeasurable)
 #align measure_theory.measure.join MeasureTheory.Measure.join
 
 @[simp]
Diff
@@ -102,7 +102,7 @@ theorem measurable_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) :
 functions. -/
 def join (m : Measure (Measure α)) : Measure α :=
   Measure.ofMeasurable (fun s hs => ∫⁻ μ, μ s ∂m)
-    (by simp only [measure_empty, lintegral_const, zero_mul])
+    (by simp only [measure_empty, lintegral_const, MulZeroClass.zero_mul])
     (by
       intro f hf h
       simp_rw [measure_Union h hf]
@@ -170,7 +170,7 @@ theorem bind_zero_right (m : Measure α) : bind m (0 : α → Measure β) = 0 :=
   ext1 s hs
   simp only [bind, hs, join_apply, coe_zero, Pi.zero_apply]
   rw [lintegral_map (measurable_coe hs) measurable_zero]
-  simp only [Pi.zero_apply, coe_zero, lintegral_const, zero_mul]
+  simp only [Pi.zero_apply, coe_zero, lintegral_const, MulZeroClass.zero_mul]
 #align measure_theory.measure.bind_zero_right MeasureTheory.Measure.bind_zero_right
 
 @[simp]
Diff
@@ -35,7 +35,7 @@ giry monad
 
 noncomputable section
 
-open Classical BigOperators Ennreal
+open Classical BigOperators ENNReal
 
 open Classical Set Filter
 

Changes in mathlib4

mathlib3
mathlib4
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -32,9 +32,11 @@ giry monad
 
 noncomputable section
 
-open Classical BigOperators ENNReal
+open scoped Classical
+open BigOperators ENNReal
 
-open Classical Set Filter
+open scoped Classical
+open Set Filter
 
 variable {α β : Type*}
 
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -98,7 +98,7 @@ theorem measurable_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) :
 functions. -/
 def join (m : Measure (Measure α)) : Measure α :=
   Measure.ofMeasurable (fun s _ => ∫⁻ μ, μ s ∂m)
-    (by simp only [measure_empty, lintegral_const, MulZeroClass.zero_mul])
+    (by simp only [measure_empty, lintegral_const, zero_mul])
     (by
       intro f hf h
       simp_rw [measure_iUnion h hf]
@@ -162,7 +162,7 @@ theorem bind_zero_right (m : Measure α) : bind m (0 : α → Measure β) = 0 :=
   ext1 s hs
   simp only [bind, hs, join_apply, coe_zero, Pi.zero_apply]
   rw [lintegral_map (measurable_coe hs) measurable_zero]
-  simp only [Pi.zero_apply, coe_zero, lintegral_const, MulZeroClass.zero_mul]
+  simp only [Pi.zero_apply, coe_zero, lintegral_const, zero_mul]
 #align measure_theory.measure.bind_zero_right MeasureTheory.Measure.bind_zero_right
 
 @[simp]
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
@@ -36,7 +36,7 @@ open Classical BigOperators ENNReal
 
 open Classical Set Filter
 
-variable {α β : Type _}
+variable {α β : Type*}
 
 namespace MeasureTheory
 
@@ -60,7 +60,7 @@ theorem measurable_of_measurable_coe (f : β → Measure α)
       MeasurableSpace.comap_le_iff_le_map.2 <| by rw [MeasurableSpace.map_comp]; exact h s hs
 #align measure_theory.measure.measurable_of_measurable_coe MeasureTheory.Measure.measurable_of_measurable_coe
 
-instance instMeasurableAdd₂ {α : Type _} {m : MeasurableSpace α} : MeasurableAdd₂ (Measure α) := by
+instance instMeasurableAdd₂ {α : Type*} {m : MeasurableSpace α} : MeasurableAdd₂ (Measure α) := by
   refine' ⟨Measure.measurable_of_measurable_coe _ fun s hs => _⟩
   simp_rw [Measure.coe_add, Pi.add_apply]
   refine' Measurable.add _ _
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) 2019 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module measure_theory.measure.giry_monad
-! leanprover-community/mathlib commit 56f4cd1ef396e9fd389b5d8371ee9ad91d163625
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.MeasureTheory.Integral.Lebesgue
 
+#align_import measure_theory.measure.giry_monad from "leanprover-community/mathlib"@"56f4cd1ef396e9fd389b5d8371ee9ad91d163625"
+
 /-!
 # The Giry monad
 
fix: precedences of ⨆⋃⋂⨅ (#5614)
Diff
@@ -133,7 +133,7 @@ theorem lintegral_join {m : Measure (Measure α)} {f : α → ℝ≥0∞} (hf :
   suffices
     ∀ (s : ℕ → Finset ℝ≥0∞) (f : ℕ → ℝ≥0∞ → Measure α → ℝ≥0∞), (∀ n r, Measurable (f n r)) →
       Monotone (fun n μ => ∑ r in s n, r * f n r μ) →
-      (⨆ n, ∑ r in s n, r * ∫⁻ μ, f n r μ ∂m) = ∫⁻ μ, ⨆ n, ∑ r in s n, r * f n r μ ∂m by
+      ⨆ n, ∑ r in s n, r * ∫⁻ μ, f n r μ ∂m = ∫⁻ μ, ⨆ n, ∑ r in s n, r * f n r μ ∂m by
     refine'
       this (fun n => SimpleFunc.range (SimpleFunc.eapprox f n))
         (fun n r μ => μ (SimpleFunc.eapprox f n ⁻¹' {r})) _ _
chore: remove superfluous parentheses around integrals (#5591)
Diff
@@ -127,7 +127,7 @@ theorem measurable_join : Measurable (join : Measure (Measure α) → Measure α
 #align measure_theory.measure.measurable_join MeasureTheory.Measure.measurable_join
 
 theorem lintegral_join {m : Measure (Measure α)} {f : α → ℝ≥0∞} (hf : Measurable f) :
-    (∫⁻ x, f x ∂join m) = ∫⁻ μ, ∫⁻ x, f x ∂μ ∂m := by
+    ∫⁻ x, f x ∂join m = ∫⁻ μ, ∫⁻ x, f x ∂μ ∂m := by
   simp_rw [lintegral_eq_iSup_eapprox_lintegral hf, SimpleFunc.lintegral,
     join_apply (SimpleFunc.measurableSet_preimage _ _)]
   suffices
@@ -184,7 +184,7 @@ theorem measurable_bind' {g : α → Measure β} (hg : Measurable g) : Measurabl
 #align measure_theory.measure.measurable_bind' MeasureTheory.Measure.measurable_bind'
 
 theorem lintegral_bind {m : Measure α} {μ : α → Measure β} {f : β → ℝ≥0∞} (hμ : Measurable μ)
-    (hf : Measurable f) : (∫⁻ x, f x ∂bind m μ) = ∫⁻ a, ∫⁻ x, f x ∂μ a ∂m :=
+    (hf : Measurable f) : ∫⁻ x, f x ∂bind m μ = ∫⁻ a, ∫⁻ x, f x ∂μ a ∂m :=
   (lintegral_join hf).trans (lintegral_map (measurable_lintegral hf) hμ)
 #align measure_theory.measure.lintegral_bind MeasureTheory.Measure.lintegral_bind
 
style: allow _ for an argument in notation3 & replace _foo with _ in notation3 (#4652)
Diff
@@ -49,7 +49,7 @@ variable [MeasurableSpace α] [MeasurableSpace β]
 
 /-- Measurability structure on `Measure`: Measures are measurable w.r.t. all projections -/
 instance instMeasurableSpace : MeasurableSpace (Measure α) :=
-  ⨆ (s : Set α) (_hs : MeasurableSet s), (borel ℝ≥0∞).comap fun μ => μ s
+  ⨆ (s : Set α) (_ : MeasurableSet s), (borel ℝ≥0∞).comap fun μ => μ s
 #align measure_theory.measure.measurable_space MeasureTheory.Measure.instMeasurableSpace
 
 theorem measurable_coe {s : Set α} (hs : MeasurableSet s) : Measurable fun μ : Measure α => μ s :=
feat: port MeasureTheory.Measure.GiryMonad (#4103)

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Dependencies 10 + 637

638 files ported (98.5%)
288040 lines ported (98.2%)
Show graph

The unported dependencies are

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