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]
    

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) ρ
s : Set α
hs : MeasurableSet s
⊢ ↑↑ρ (Prod.map id f ⁻¹' (Prod.fst ⁻¹' s)) = ↑↑ρ (Prod.fst ⁻¹' s)
case hρ'.h.hf
α : 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) ρ
s : Set α
hs : MeasurableSet s
⊢ Measurable (Prod.map id f)
case hρ'.h.hs
α : 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) ρ
s : Set α
hs : MeasurableSet s
⊢ MeasurableSet (Prod.fst ⁻¹' s)
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) ρ
s : Set α
hs : MeasurableSet s
⊢ MeasurableSet s
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) ρ
s : Set α
hs : MeasurableSet s
⊢ MeasurableSet s

Next tactic:
exacts [rfl, Measurable.prod measurable_fst <| hf.measurable.comp measurable_snd,
      measurable_fst hs, hs, 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]
  

Proof state:
case intro
α : 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 ρ
⊢ ∀ᵐ (x : α) ∂Measure.fst ρ, κ x = (Measure.condKernel ρ) x

Next tactic:
have hρ'' : ∀ᵐ x ∂ρ'.fst, kernel.map κ f hf.measurable x = ρ'.condKernel x
/-- 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
  · 

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 ρ
⊢ ∀ᵐ (x : α) ∂Measure.fst ρ', (kernel.map κ f (_ : Measurable f)) x = (Measure.condKernel ρ') x

Next tactic:
refine' eq_condKernel_of_measure_eq_compProd_real ρ' (kernel.map κ f hf.measurable) _
/-- 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) _
    

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 ρ
⊢ ρ' = Measure.fst ρ' ⊗ₘ kernel.map κ f (_ : Measurable f)

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
    

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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
⊢ ↑↑ρ' s = ↑↑(Measure.fst ρ' ⊗ₘ kernel.map κ f (_ : Measurable f)) s

Next tactic:
simp only [Measure.map_apply (measurable_id.prod_map hf.measurable) 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]
    

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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
⊢ ↑↑ρ (Prod.map id f ⁻¹' s) = ↑↑(Measure.fst (Measure.map (Prod.map id f) ρ) ⊗ₘ kernel.map κ f (_ : Measurable f)) s

Next tactic:
conv_lhs => congr; rw [hκ]
/-- 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 => 

Proof state:
α : 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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
| ↑↑ρ (Prod.map id f ⁻¹' s)

Next tactic:
congr; rw [hκ]
/-- 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 => 

Proof state:
α : 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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
| ↑↑ρ (Prod.map id f ⁻¹' s)

Next tactic:
congr
/-- 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; 

Proof state:
case self
α : 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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
| ↑ρ
case a
α : 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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
| Prod.map id f ⁻¹' s

Next tactic:
rw [hκ]
/-- 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κ]
    

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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
⊢ ↑↑(Measure.fst ρ ⊗ₘ κ) (Prod.map id f ⁻¹' s) =
    ↑↑(Measure.fst (Measure.map (Prod.map id f) ρ) ⊗ₘ kernel.map κ f (_ : Measurable f)) s

Next tactic:
rw [Measure.compProd_apply hs, Measure.compProd_apply
      (measurable_id.prod_map hf.measurable hs), (_ : (ρ.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)]
    · 

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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
⊢ ∫⁻ (a : α), ↑↑(κ a) (Prod.mk a ⁻¹' (Prod.map id f ⁻¹' s)) ∂Measure.fst ρ =
    ∫⁻ (a : α), ↑↑((kernel.map κ f (_ : Measurable f)) a) (Prod.mk a ⁻¹' s) ∂Measure.fst ρ

Next tactic:
congr
/-- 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
      

Proof state:
case hρ''.h.e_f
α : 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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
⊢ (fun a => ↑↑(κ a) (Prod.mk a ⁻¹' (Prod.map id f ⁻¹' s))) = fun a =>
    ↑↑((kernel.map κ f (_ : Measurable f)) a) (Prod.mk a ⁻¹' s)

Next tactic:
ext x
/-- 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
      

Proof state:
case hρ''.h.e_f.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 ρ
s : Set (α × ℝ)
hs : MeasurableSet s
x : α
⊢ ↑↑(κ x) (Prod.mk x ⁻¹' (Prod.map id f ⁻¹' s)) = ↑↑((kernel.map κ f (_ : Measurable f)) x) (Prod.mk x ⁻¹' s)

Next tactic:
simp only [Set.mem_preimage, Prod_map, id_eq, kernel.prodMkLeft_apply, kernel.map_apply]