α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) = ∫⁻ (y : α) in s, ofReal ((g - f) y) ∂μ
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) = ∫⁻ (y : α) in s, ofReal ((g - f) y) ∂μ
have h₁ :
  (fun y => ENNReal.ofReal ((g - f) y)) =ᵐ[μ.restrict s] fun y =>
    ENNReal.ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y) :=
  (hg.ae_eq_mk.sub hf.ae_eq_mk).fun_comp ENNReal.ofReal
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) = ∫⁻ (y : α) in s, ofReal ((g - f) y) ∂μ
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) = ∫⁻ (y : α) in s, ofReal ((g - f) y) ∂μ
have h₂ :
  (μ.restrict s).prod volume (regionBetween f g s) =
    (μ.restrict s).prod volume
      (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s) := by
  apply measure_congr
  apply EventuallyEq.rfl.inter
  exact
    ((quasiMeasurePreserving_fst.ae_eq_comp hf.ae_eq_mk).comp₂ _ EventuallyEq.rfl).inter
      (EventuallyEq.rfl.comp₂ _ <| quasiMeasurePreserving_fst.ae_eq_comp hg.ae_eq_mk)
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) =
    ↑↑(Measure.prod μ volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) = ∫⁻ (y : α) in s, ofReal ((g - f) y) ∂μ
rw [lintegral_congr_ae h₁, ←
  volume_regionBetween_eq_lintegral' hf.measurable_mk hg.measurable_mk hs]
case h.e'_2
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) = ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s)

case h.e'_3
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) =
    ↑↑(Measure.prod μ volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
convert h₂ using 1
case H
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
⊢ regionBetween f g s =ᶠ[ae (Measure.prod (Measure.restrict μ s) volume)]
    regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
⊢ ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
apply measure_congr
case H
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
⊢ (fun p => Ioo (f p.fst) (g p.fst) p.snd) =ᶠ[ae (Measure.prod (Measure.restrict μ s) volume)] fun p =>
    Ioo (AEMeasurable.mk f hf p.fst) (AEMeasurable.mk g hg p.fst) p.snd
case H
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
⊢ regionBetween f g s =ᶠ[ae (Measure.prod (Measure.restrict μ s) volume)]
    regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s
apply EventuallyEq.rfl.inter
no goals
case H
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
⊢ (fun p => Ioo (f p.fst) (g p.fst) p.snd) =ᶠ[ae (Measure.prod (Measure.restrict μ s) volume)] fun p =>
    Ioo (AEMeasurable.mk f hf p.fst) (AEMeasurable.mk g hg p.fst) p.snd
exact
  ((quasiMeasurePreserving_fst.ae_eq_comp hf.ae_eq_mk).comp₂ _ EventuallyEq.rfl).inter
    (EventuallyEq.rfl.comp₂ _ <| quasiMeasurePreserving_fst.ae_eq_comp hg.ae_eq_mk)
case h.e'_2
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) =
    ↑↑(Measure.restrict (Measure.prod μ volume) (s ×ˢ univ)) (regionBetween f g s)
case h.e'_2
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) = ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s)
rw [Measure.restrict_prod_eq_prod_univ]
no goals
case h.e'_2
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween f g s) =
    ↑↑(Measure.restrict (Measure.prod μ volume) (s ×ˢ univ)) (regionBetween f g s)
exact (Measure.restrict_eq_self _ (regionBetween_subset f g s)).symm
case h.e'_3
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s) =
    ↑↑(Measure.restrict (Measure.prod μ volume) (s ×ˢ univ))
      (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
case h.e'_3
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
rw [Measure.restrict_prod_eq_prod_univ]
no goals
case h.e'_3
α : Type u_1
inst✝¹ : MeasurableSpace α
μ : MeasureTheory.Measure α
f g : α → ℝ
s : Set α
inst✝ : SigmaFinite μ
hf : AEMeasurable f
hg : AEMeasurable g
hs : MeasurableSet s
h₁ :
  (fun y => ofReal ((g - f) y)) =ᶠ[ae (Measure.restrict μ s)] fun y =>
    ofReal ((AEMeasurable.mk g hg - AEMeasurable.mk f hf) y)
h₂ :
  ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween f g s) =
    ↑↑(Measure.prod (Measure.restrict μ s) volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
⊢ ↑↑(Measure.prod μ volume) (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s) =
    ↑↑(Measure.restrict (Measure.prod μ volume) (s ×ˢ univ))
      (regionBetween (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)
exact
  (Measure.restrict_eq_self _
      (regionBetween_subset (AEMeasurable.mk f hf) (AEMeasurable.mk g hg) s)).symm