l3lab/ntp-mathlib huggingface dataset:
/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_measure_eq_compProd (κ : kernel α Ω) [IsFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x := by
-- The idea is to transporting the question to `ℝ` from `Ω` using `exists_measurableEmbedding_real`
-- and then constructing a measure on `α × ℝ` using the obtained measurable embedding
  obtain ⟨f, hf⟩ := exists_measurableEmbedding_real Ω
  set ρ' : Measure (α × ℝ) := ρ.map (Prod.map id f) with hρ'def
  have hρ' : ρ'.fst = ρ.fst
  · ext s hs
    rw [hρ'def, Measure.fst_apply, Measure.fst_apply, Measure.map_apply]
    exacts [rfl, Measurable.prod measurable_fst <| hf.measurable.comp measurable_snd,
      measurable_fst hs, hs, hs]
  have hρ'' : ∀ᵐ x ∂ρ'.fst, kernel.map κ f hf.measurable x = ρ'.condKernel x
  · refine' eq_condKernel_of_measure_eq_compProd_real ρ' (kernel.map κ f hf.measurable) _
    ext s hs
    simp only [Measure.map_apply (measurable_id.prod_map hf.measurable) hs]
    conv_lhs => congr; rw [hκ]
    rw [Measure.compProd_apply hs, Measure.compProd_apply
      (measurable_id.prod_map hf.measurable hs), (_ : (ρ.map (Prod.map id f)).fst = ρ.fst)]
    · congr
      ext x
      simp only [Set.mem_preimage, Prod_map, id_eq, kernel.prodMkLeft_apply, kernel.map_apply]
      rw [Measure.map_apply hf.measurable]
      · rfl
      · exact measurable_prod_mk_left hs
    · rw [Measure.fst_map_prod_mk]
      · simp only [Prod_map, id_eq]; rfl
      · exact (hf.measurable.comp measurable_snd)
  rw [hρ'] at hρ''
  suffices : ∀ᵐ x ∂ρ.fst, ∀ s, MeasurableSet s →
    ((ρ.map (Prod.map id f)).condKernel x) s = (ρ.condKernel x) (f ⁻¹' s)
  · filter_upwards [hρ'', this] with x hx h
    rw [kernel.map_apply] at hx
    

Proof state:
case h
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
f : Ω → ℝ
hf : MeasurableEmbedding f
ρ' : Measure (α × ℝ) := Measure.map (Prod.map id f) ρ
hρ'def : ρ' = Measure.map (Prod.map id f) ρ
hρ' : Measure.fst ρ' = Measure.fst ρ
hρ'' : ∀ᵐ (x : α) ∂Measure.fst ρ, (kernel.map κ f (_ : Measurable f)) x = (Measure.condKernel ρ') x
this :
  ∀ᵐ (x : α) ∂Measure.fst ρ,
    ∀ (s : Set ℝ),
      MeasurableSet s →
        ↑↑((Measure.condKernel (Measure.map (Prod.map id f) ρ)) x) s = ↑↑((Measure.condKernel ρ) x) (f ⁻¹' s)
x : α
hx : Measure.map f (κ x) = (Measure.condKernel ρ') x
h :
  ∀ (s : Set ℝ),
    MeasurableSet s →
      ↑↑((Measure.condKernel (Measure.map (Prod.map id f) ρ)) x) s = ↑↑((Measure.condKernel ρ) x) (f ⁻¹' s)
⊢ κ x = (Measure.condKernel ρ) x

Next tactic:
ext s hs
/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_measure_eq_compProd (κ : kernel α Ω) [IsFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x := by
-- The idea is to transporting the question to `ℝ` from `Ω` using `exists_measurableEmbedding_real`
-- and then constructing a measure on `α × ℝ` using the obtained measurable embedding
  obtain ⟨f, hf⟩ := exists_measurableEmbedding_real Ω
  set ρ' : Measure (α × ℝ) := ρ.map (Prod.map id f) with hρ'def
  have hρ' : ρ'.fst = ρ.fst
  · ext s hs
    rw [hρ'def, Measure.fst_apply, Measure.fst_apply, Measure.map_apply]
    exacts [rfl, Measurable.prod measurable_fst <| hf.measurable.comp measurable_snd,
      measurable_fst hs, hs, hs]
  have hρ'' : ∀ᵐ x ∂ρ'.fst, kernel.map κ f hf.measurable x = ρ'.condKernel x
  · refine' eq_condKernel_of_measure_eq_compProd_real ρ' (kernel.map κ f hf.measurable) _
    ext s hs
    simp only [Measure.map_apply (measurable_id.prod_map hf.measurable) hs]
    conv_lhs => congr; rw [hκ]
    rw [Measure.compProd_apply hs, Measure.compProd_apply
      (measurable_id.prod_map hf.measurable hs), (_ : (ρ.map (Prod.map id f)).fst = ρ.fst)]
    · congr
      ext x
      simp only [Set.mem_preimage, Prod_map, id_eq, kernel.prodMkLeft_apply, kernel.map_apply]
      rw [Measure.map_apply hf.measurable]
      · rfl
      · exact measurable_prod_mk_left hs
    · rw [Measure.fst_map_prod_mk]
      · simp only [Prod_map, id_eq]; rfl
      · exact (hf.measurable.comp measurable_snd)
  rw [hρ'] at hρ''
  suffices : ∀ᵐ x ∂ρ.fst, ∀ s, MeasurableSet s →
    ((ρ.map (Prod.map id f)).condKernel x) s = (ρ.condKernel x) (f ⁻¹' s)
  · filter_upwards [hρ'', this] with x hx h
    rw [kernel.map_apply] at hx
    ext s hs
    

Proof state:
case h.h
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
f : Ω → ℝ
hf : MeasurableEmbedding f
ρ' : Measure (α × ℝ) := Measure.map (Prod.map id f) ρ
hρ'def : ρ' = Measure.map (Prod.map id f) ρ
hρ' : Measure.fst ρ' = Measure.fst ρ
hρ'' : ∀ᵐ (x : α) ∂Measure.fst ρ, (kernel.map κ f (_ : Measurable f)) x = (Measure.condKernel ρ') x
this :
  ∀ᵐ (x : α) ∂Measure.fst ρ,
    ∀ (s : Set ℝ),
      MeasurableSet s →
        ↑↑((Measure.condKernel (Measure.map (Prod.map id f) ρ)) x) s = ↑↑((Measure.condKernel ρ) x) (f ⁻¹' s)
x : α
hx : Measure.map f (κ x) = (Measure.condKernel ρ') x
h :
  ∀ (s : Set ℝ),
    MeasurableSet s →
      ↑↑((Measure.condKernel (Measure.map (Prod.map id f) ρ)) x) s = ↑↑((Measure.condKernel ρ) x) (f ⁻¹' s)
s : Set Ω
hs : MeasurableSet s
⊢ ↑↑(κ x) s = ↑↑((Measure.condKernel ρ) x) s

Next tactic:
rw [← Set.preimage_image_eq s hf.injective,
      ← Measure.map_apply hf.measurable <| hf.measurableSet_image.2 hs, hx,
      h _ <| hf.measurableSet_image.2 hs]
/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_measure_eq_compProd (κ : kernel α Ω) [IsFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x := by
-- The idea is to transporting the question to `ℝ` from `Ω` using `exists_measurableEmbedding_real`
-- and then constructing a measure on `α × ℝ` using the obtained measurable embedding
  obtain ⟨f, hf⟩ := exists_measurableEmbedding_real Ω
  set ρ' : Measure (α × ℝ) := ρ.map (Prod.map id f) with hρ'def
  have hρ' : ρ'.fst = ρ.fst
  · ext s hs
    rw [hρ'def, Measure.fst_apply, Measure.fst_apply, Measure.map_apply]
    exacts [rfl, Measurable.prod measurable_fst <| hf.measurable.comp measurable_snd,
      measurable_fst hs, hs, hs]
  have hρ'' : ∀ᵐ x ∂ρ'.fst, kernel.map κ f hf.measurable x = ρ'.condKernel x
  · refine' eq_condKernel_of_measure_eq_compProd_real ρ' (kernel.map κ f hf.measurable) _
    ext s hs
    simp only [Measure.map_apply (measurable_id.prod_map hf.measurable) hs]
    conv_lhs => congr; rw [hκ]
    rw [Measure.compProd_apply hs, Measure.compProd_apply
      (measurable_id.prod_map hf.measurable hs), (_ : (ρ.map (Prod.map id f)).fst = ρ.fst)]
    · congr
      ext x
      simp only [Set.mem_preimage, Prod_map, id_eq, kernel.prodMkLeft_apply, kernel.map_apply]
      rw [Measure.map_apply hf.measurable]
      · rfl
      · exact measurable_prod_mk_left hs
    · rw [Measure.fst_map_prod_mk]
      · simp only [Prod_map, id_eq]; rfl
      · exact (hf.measurable.comp measurable_snd)
  rw [hρ'] at hρ''
  suffices : ∀ᵐ x ∂ρ.fst, ∀ s, MeasurableSet s →
    ((ρ.map (Prod.map id f)).condKernel x) s = (ρ.condKernel x) (f ⁻¹' s)
  · filter_upwards [hρ'', this] with x hx h
    rw [kernel.map_apply] at hx
    ext s hs
    rw [← Set.preimage_image_eq s hf.injective,
      ← Measure.map_apply hf.measurable <| hf.measurableSet_image.2 hs, hx,
      h _ <| hf.measurableSet_image.2 hs]
  

Proof state:
case this
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
f : Ω → ℝ
hf : MeasurableEmbedding f
ρ' : Measure (α × ℝ) := Measure.map (Prod.map id f) ρ
hρ'def : ρ' = Measure.map (Prod.map id f) ρ
hρ' : Measure.fst ρ' = Measure.fst ρ
hρ'' : ∀ᵐ (x : α) ∂Measure.fst ρ, (kernel.map κ f (_ : Measurable f)) x = (Measure.condKernel ρ') x
⊢ ∀ᵐ (x : α) ∂Measure.fst ρ,
    ∀ (s : Set ℝ),
      MeasurableSet s →
        ↑↑((Measure.condKernel (Measure.map (Prod.map id f) ρ)) x) s = ↑↑((Measure.condKernel ρ) x) (f ⁻¹' s)

Next tactic:
have hprod : (ρ.map (Prod.map id f)).fst = ρ.fst
/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_measure_eq_compProd (κ : kernel α Ω) [IsFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x := by
-- The idea is to transporting the question to `ℝ` from `Ω` using `exists_measurableEmbedding_real`
-- and then constructing a measure on `α × ℝ` using the obtained measurable embedding
  obtain ⟨f, hf⟩ := exists_measurableEmbedding_real Ω
  set ρ' : Measure (α × ℝ) := ρ.map (Prod.map id f) with hρ'def
  have hρ' : ρ'.fst = ρ.fst
  · ext s hs
    rw [hρ'def, Measure.fst_apply, Measure.fst_apply, Measure.map_apply]
    exacts [rfl, Measurable.prod measurable_fst <| hf.measurable.comp measurable_snd,
      measurable_fst hs, hs, hs]
  have hρ'' : ∀ᵐ x ∂ρ'.fst, kernel.map κ f hf.measurable x = ρ'.condKernel x
  · refine' eq_condKernel_of_measure_eq_compProd_real ρ' (kernel.map κ f hf.measurable) _
    ext s hs
    simp only [Measure.map_apply (measurable_id.prod_map hf.measurable) hs]
    conv_lhs => congr; rw [hκ]
    rw [Measure.compProd_apply hs, Measure.compProd_apply
      (measurable_id.prod_map hf.measurable hs), (_ : (ρ.map (Prod.map id f)).fst = ρ.fst)]
    · congr
      ext x
      simp only [Set.mem_preimage, Prod_map, id_eq, kernel.prodMkLeft_apply, kernel.map_apply]
      rw [Measure.map_apply hf.measurable]
      · rfl
      · exact measurable_prod_mk_left hs
    · rw [Measure.fst_map_prod_mk]
      · simp only [Prod_map, id_eq]; rfl
      · exact (hf.measurable.comp measurable_snd)
  rw [hρ'] at hρ''
  suffices : ∀ᵐ x ∂ρ.fst, ∀ s, MeasurableSet s →
    ((ρ.map (Prod.map id f)).condKernel x) s = (ρ.condKernel x) (f ⁻¹' s)
  · filter_upwards [hρ'', this] with x hx h
    rw [kernel.map_apply] at hx
    ext s hs
    rw [← Set.preimage_image_eq s hf.injective,
      ← Measure.map_apply hf.measurable <| hf.measurableSet_image.2 hs, hx,
      h _ <| hf.measurableSet_image.2 hs]
  have hprod : (ρ.map (Prod.map id f)).fst = ρ.fst
  · 

Proof state:
case hprod
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
f : Ω → ℝ
hf : MeasurableEmbedding f
ρ' : Measure (α × ℝ) := Measure.map (Prod.map id f) ρ
hρ'def : ρ' = Measure.map (Prod.map id f) ρ
hρ' : Measure.fst ρ' = Measure.fst ρ
hρ'' : ∀ᵐ (x : α) ∂Measure.fst ρ, (kernel.map κ f (_ : Measurable f)) x = (Measure.condKernel ρ') x
⊢ Measure.fst (Measure.map (Prod.map id f) ρ) = Measure.fst ρ

Next tactic:
ext s hs
/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_measure_eq_compProd (κ : kernel α Ω) [IsFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x := by
-- The idea is to transporting the question to `ℝ` from `Ω` using `exists_measurableEmbedding_real`
-- and then constructing a measure on `α × ℝ` using the obtained measurable embedding
  obtain ⟨f, hf⟩ := exists_measurableEmbedding_real Ω
  set ρ' : Measure (α × ℝ) := ρ.map (Prod.map id f) with hρ'def
  have hρ' : ρ'.fst = ρ.fst
  · ext s hs
    rw [hρ'def, Measure.fst_apply, Measure.fst_apply, Measure.map_apply]
    exacts [rfl, Measurable.prod measurable_fst <| hf.measurable.comp measurable_snd,
      measurable_fst hs, hs, hs]
  have hρ'' : ∀ᵐ x ∂ρ'.fst, kernel.map κ f hf.measurable x = ρ'.condKernel x
  · refine' eq_condKernel_of_measure_eq_compProd_real ρ' (kernel.map κ f hf.measurable) _
    ext s hs
    simp only [Measure.map_apply (measurable_id.prod_map hf.measurable) hs]
    conv_lhs => congr; rw [hκ]
    rw [Measure.compProd_apply hs, Measure.compProd_apply
      (measurable_id.prod_map hf.measurable hs), (_ : (ρ.map (Prod.map id f)).fst = ρ.fst)]
    · congr
      ext x
      simp only [Set.mem_preimage, Prod_map, id_eq, kernel.prodMkLeft_apply, kernel.map_apply]
      rw [Measure.map_apply hf.measurable]
      · rfl
      · exact measurable_prod_mk_left hs
    · rw [Measure.fst_map_prod_mk]
      · simp only [Prod_map, id_eq]; rfl
      · exact (hf.measurable.comp measurable_snd)
  rw [hρ'] at hρ''
  suffices : ∀ᵐ x ∂ρ.fst, ∀ s, MeasurableSet s →
    ((ρ.map (Prod.map id f)).condKernel x) s = (ρ.condKernel x) (f ⁻¹' s)
  · filter_upwards [hρ'', this] with x hx h
    rw [kernel.map_apply] at hx
    ext s hs
    rw [← Set.preimage_image_eq s hf.injective,
      ← Measure.map_apply hf.measurable <| hf.measurableSet_image.2 hs, hx,
      h _ <| hf.measurableSet_image.2 hs]
  have hprod : (ρ.map (Prod.map id f)).fst = ρ.fst
  · ext s hs
    

Proof state:
case hprod.h
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
f : Ω → ℝ
hf : MeasurableEmbedding f
ρ' : Measure (α × ℝ) := Measure.map (Prod.map id f) ρ
hρ'def : ρ' = Measure.map (Prod.map id f) ρ
hρ' : Measure.fst ρ' = Measure.fst ρ
hρ'' : ∀ᵐ (x : α) ∂Measure.fst ρ, (kernel.map κ f (_ : Measurable f)) x = (Measure.condKernel ρ') x
s : Set α
hs : MeasurableSet s
⊢ ↑↑(Measure.fst (Measure.map (Prod.map id f) ρ)) s = ↑↑(Measure.fst ρ) s

Next tactic:
rw [Measure.fst_apply hs,
      Measure.map_apply (measurable_id.prod_map hf.measurable) (measurable_fst hs),
      ← Set.preimage_comp, Measure.fst_apply hs]
/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_measure_eq_compProd (κ : kernel α Ω) [IsFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x := by
-- The idea is to transporting the question to `ℝ` from `Ω` using `exists_measurableEmbedding_real`
-- and then constructing a measure on `α × ℝ` using the obtained measurable embedding
  obtain ⟨f, hf⟩ := exists_measurableEmbedding_real Ω
  set ρ' : Measure (α × ℝ) := ρ.map (Prod.map id f) with hρ'def
  have hρ' : ρ'.fst = ρ.fst
  · ext s hs
    rw [hρ'def, Measure.fst_apply, Measure.fst_apply, Measure.map_apply]
    exacts [rfl, Measurable.prod measurable_fst <| hf.measurable.comp measurable_snd,
      measurable_fst hs, hs, hs]
  have hρ'' : ∀ᵐ x ∂ρ'.fst, kernel.map κ f hf.measurable x = ρ'.condKernel x
  · refine' eq_condKernel_of_measure_eq_compProd_real ρ' (kernel.map κ f hf.measurable) _
    ext s hs
    simp only [Measure.map_apply (measurable_id.prod_map hf.measurable) hs]
    conv_lhs => congr; rw [hκ]
    rw [Measure.compProd_apply hs, Measure.compProd_apply
      (measurable_id.prod_map hf.measurable hs), (_ : (ρ.map (Prod.map id f)).fst = ρ.fst)]
    · congr
      ext x
      simp only [Set.mem_preimage, Prod_map, id_eq, kernel.prodMkLeft_apply, kernel.map_apply]
      rw [Measure.map_apply hf.measurable]
      · rfl
      · exact measurable_prod_mk_left hs
    · rw [Measure.fst_map_prod_mk]
      · simp only [Prod_map, id_eq]; rfl
      · exact (hf.measurable.comp measurable_snd)
  rw [hρ'] at hρ''
  suffices : ∀ᵐ x ∂ρ.fst, ∀ s, MeasurableSet s →
    ((ρ.map (Prod.map id f)).condKernel x) s = (ρ.condKernel x) (f ⁻¹' s)
  · filter_upwards [hρ'', this] with x hx h
    rw [kernel.map_apply] at hx
    ext s hs
    rw [← Set.preimage_image_eq s hf.injective,
      ← Measure.map_apply hf.measurable <| hf.measurableSet_image.2 hs, hx,
      h _ <| hf.measurableSet_image.2 hs]
  have hprod : (ρ.map (Prod.map id f)).fst = ρ.fst
  · ext s hs
    rw [Measure.fst_apply hs,
      Measure.map_apply (measurable_id.prod_map hf.measurable) (measurable_fst hs),
      ← Set.preimage_comp, Measure.fst_apply hs]
    

Proof state:
case hprod.h
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
f : Ω → ℝ
hf : MeasurableEmbedding f
ρ' : Measure (α × ℝ) := Measure.map (Prod.map id f) ρ
hρ'def : ρ' = Measure.map (Prod.map id f) ρ
hρ' : Measure.fst ρ' = Measure.fst ρ
hρ'' : ∀ᵐ (x : α) ∂Measure.fst ρ, (kernel.map κ f (_ : Measurable f)) x = (Measure.condKernel ρ') x
s : Set α
hs : MeasurableSet s
⊢ ↑↑ρ (Prod.fst ∘ Prod.map id f ⁻¹' s) = ↑↑ρ (Prod.fst ⁻¹' s)

Next tactic:
rfl
/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_measure_eq_compProd (κ : kernel α Ω) [IsFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x := by
-- The idea is to transporting the question to `ℝ` from `Ω` using `exists_measurableEmbedding_real`
-- and then constructing a measure on `α × ℝ` using the obtained measurable embedding
  obtain ⟨f, hf⟩ := exists_measurableEmbedding_real Ω
  set ρ' : Measure (α × ℝ) := ρ.map (Prod.map id f) with hρ'def
  have hρ' : ρ'.fst = ρ.fst
  · ext s hs
    rw [hρ'def, Measure.fst_apply, Measure.fst_apply, Measure.map_apply]
    exacts [rfl, Measurable.prod measurable_fst <| hf.measurable.comp measurable_snd,
      measurable_fst hs, hs, hs]
  have hρ'' : ∀ᵐ x ∂ρ'.fst, kernel.map κ f hf.measurable x = ρ'.condKernel x
  · refine' eq_condKernel_of_measure_eq_compProd_real ρ' (kernel.map κ f hf.measurable) _
    ext s hs
    simp only [Measure.map_apply (measurable_id.prod_map hf.measurable) hs]
    conv_lhs => congr; rw [hκ]
    rw [Measure.compProd_apply hs, Measure.compProd_apply
      (measurable_id.prod_map hf.measurable hs), (_ : (ρ.map (Prod.map id f)).fst = ρ.fst)]
    · congr
      ext x
      simp only [Set.mem_preimage, Prod_map, id_eq, kernel.prodMkLeft_apply, kernel.map_apply]
      rw [Measure.map_apply hf.measurable]
      · rfl
      · exact measurable_prod_mk_left hs
    · rw [Measure.fst_map_prod_mk]
      · simp only [Prod_map, id_eq]; rfl
      · exact (hf.measurable.comp measurable_snd)
  rw [hρ'] at hρ''
  suffices : ∀ᵐ x ∂ρ.fst, ∀ s, MeasurableSet s →
    ((ρ.map (Prod.map id f)).condKernel x) s = (ρ.condKernel x) (f ⁻¹' s)
  · filter_upwards [hρ'', this] with x hx h
    rw [kernel.map_apply] at hx
    ext s hs
    rw [← Set.preimage_image_eq s hf.injective,
      ← Measure.map_apply hf.measurable <| hf.measurableSet_image.2 hs, hx,
      h _ <| hf.measurableSet_image.2 hs]
  have hprod : (ρ.map (Prod.map id f)).fst = ρ.fst
  · ext s hs
    rw [Measure.fst_apply hs,
      Measure.map_apply (measurable_id.prod_map hf.measurable) (measurable_fst hs),
      ← Set.preimage_comp, Measure.fst_apply hs]
    rfl
  

Proof state:
case this
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
f : Ω → ℝ
hf : MeasurableEmbedding f
ρ' : Measure (α × ℝ) := Measure.map (Prod.map id f) ρ
hρ'def : ρ' = Measure.map (Prod.map id f) ρ
hρ' : Measure.fst ρ' = Measure.fst ρ
hρ'' : ∀ᵐ (x : α) ∂Measure.fst ρ, (kernel.map κ f (_ : Measurable f)) x = (Measure.condKernel ρ') x
hprod : Measure.fst (Measure.map (Prod.map id f) ρ) = Measure.fst ρ
⊢ ∀ᵐ (x : α) ∂Measure.fst ρ,
    ∀ (s : Set ℝ),
      MeasurableSet s →
        ↑↑((Measure.condKernel (Measure.map (Prod.map id f) ρ)) x) s = ↑↑((Measure.condKernel ρ) x) (f ⁻¹' s)

Next tactic:
suffices : ρ.map (Prod.map id f) =
    ((ρ.map (Prod.map id f)).fst ⊗ₘ (kernel.map (Measure.condKernel ρ) f hf.measurable))
theorem AEStronglyMeasurable.ae_integrable_condKernel_iff {f : α × Ω → F}
    (hf : AEStronglyMeasurable f ρ) :
    (∀ᵐ a ∂ρ.fst, Integrable (fun ω => f (a, ω)) (ρ.condKernel a)) ∧
      Integrable (fun a => ∫ ω, ‖f (a, ω)‖ ∂ρ.condKernel a) ρ.fst ↔ Integrable f ρ := by
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf : AEStronglyMeasurable f ρ
⊢ ((∀ᵐ (a : α) ∂Measure.fst ρ, Integrable fun ω => f (a, ω)) ∧
      Integrable fun a => ∫ (ω : Ω), ‖f (a, ω)‖ ∂(Measure.condKernel ρ) a) ↔
    Integrable f

Next tactic:
rw [measure_eq_compProd ρ] at hf
theorem AEStronglyMeasurable.ae_integrable_condKernel_iff {f : α × Ω → F}
    (hf : AEStronglyMeasurable f ρ) :
    (∀ᵐ a ∂ρ.fst, Integrable (fun ω => f (a, ω)) (ρ.condKernel a)) ∧
      Integrable (fun a => ∫ ω, ‖f (a, ω)‖ ∂ρ.condKernel a) ρ.fst ↔ Integrable f ρ := by
  rw [measure_eq_compProd ρ] at hf
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf : AEStronglyMeasurable f (Measure.fst ρ ⊗ₘ Measure.condKernel ρ)
⊢ ((∀ᵐ (a : α) ∂Measure.fst ρ, Integrable fun ω => f (a, ω)) ∧
      Integrable fun a => ∫ (ω : Ω), ‖f (a, ω)‖ ∂(Measure.condKernel ρ) a) ↔
    Integrable f

Next tactic:
conv_rhs => rw [measure_eq_compProd ρ]
theorem AEStronglyMeasurable.ae_integrable_condKernel_iff {f : α × Ω → F}
    (hf : AEStronglyMeasurable f ρ) :
    (∀ᵐ a ∂ρ.fst, Integrable (fun ω => f (a, ω)) (ρ.condKernel a)) ∧
      Integrable (fun a => ∫ ω, ‖f (a, ω)‖ ∂ρ.condKernel a) ρ.fst ↔ Integrable f ρ := by
  rw [measure_eq_compProd ρ] at hf
  conv_rhs => 

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf : AEStronglyMeasurable f (Measure.fst ρ ⊗ₘ Measure.condKernel ρ)
| Integrable f

Next tactic:
rw [measure_eq_compProd ρ]
theorem AEStronglyMeasurable.ae_integrable_condKernel_iff {f : α × Ω → F}
    (hf : AEStronglyMeasurable f ρ) :
    (∀ᵐ a ∂ρ.fst, Integrable (fun ω => f (a, ω)) (ρ.condKernel a)) ∧
      Integrable (fun a => ∫ ω, ‖f (a, ω)‖ ∂ρ.condKernel a) ρ.fst ↔ Integrable f ρ := by
  rw [measure_eq_compProd ρ] at hf
  conv_rhs => rw [measure_eq_compProd ρ]
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf : AEStronglyMeasurable f (Measure.fst ρ ⊗ₘ Measure.condKernel ρ)
⊢ ((∀ᵐ (a : α) ∂Measure.fst ρ, Integrable fun ω => f (a, ω)) ∧
      Integrable fun a => ∫ (ω : Ω), ‖f (a, ω)‖ ∂(Measure.condKernel ρ) a) ↔
    Integrable f

Next tactic:
rw [Measure.integrable_compProd_iff hf]
theorem Integrable.condKernel_ae {f : α × Ω → F} (hf_int : Integrable f ρ) :
    ∀ᵐ a ∂ρ.fst, Integrable (fun ω => f (a, ω)) (ρ.condKernel a) := by
  

Proof state:
α : Type u_1
Ω : Type u_2
E : Type u_3
F : Type u_4
mα : MeasurableSpace α
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : NormedAddCommGroup F
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → F
hf_int : Integrable f
⊢ ∀ᵐ (a : α) ∂Measure.fst ρ, Integrable fun ω => f (a, ω)

Next tactic:
have hf_ae : AEStronglyMeasurable f ρ := hf_int.1