l3lab/ntp-mathlib huggingface dataset:
theorem integral_condKernel {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    (hf : Integrable f ρ) : ∫ a, ∫ x, f (a, x) ∂ρ.condKernel a ∂ρ.fst = ∫ ω, f ω ∂ρ := by
  conv_rhs => rw [measure_eq_compProd ρ]
  have hf': Integrable f (ρ.fst ⊗ₘ ρ.condKernel) := by 

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝⁴ : IsFiniteMeasure ρ✝
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
hf : Integrable f
⊢ Integrable f

Next tactic:
rwa [measure_eq_compProd ρ] at hf
theorem integral_condKernel {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    (hf : Integrable f ρ) : ∫ a, ∫ x, f (a, x) ∂ρ.condKernel a ∂ρ.fst = ∫ ω, f ω ∂ρ := by
  conv_rhs => rw [measure_eq_compProd ρ]
  have hf': Integrable f (ρ.fst ⊗ₘ ρ.condKernel) := by rwa [measure_eq_compProd ρ] at hf
  

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

Next tactic:
rw [Measure.integral_compProd hf']
theorem set_integral_condKernel {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    {s : Set α} (hs : MeasurableSet s) {t : Set Ω} (ht : MeasurableSet t)
    (hf : IntegrableOn f (s ×ˢ t) ρ) :
    ∫ a in s, ∫ ω in t, f (a, ω) ∂ρ.condKernel a ∂ρ.fst = ∫ x in s ×ˢ t, f x ∂ρ := by
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝⁴ : IsFiniteMeasure ρ✝
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
s : Set α
hs : MeasurableSet s
t : Set Ω
ht : MeasurableSet t
hf : IntegrableOn f (s ×ˢ t)
⊢ ∫ (a : α) in s, ∫ (ω : Ω) in t, f (a, ω) ∂(Measure.condKernel ρ) a ∂Measure.fst ρ = ∫ (x : α × Ω) in s ×ˢ t, f x ∂ρ

Next tactic:
conv_rhs => rw [measure_eq_compProd ρ]
theorem set_integral_condKernel {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    {s : Set α} (hs : MeasurableSet s) {t : Set Ω} (ht : MeasurableSet t)
    (hf : IntegrableOn f (s ×ˢ t) ρ) :
    ∫ a in s, ∫ ω in t, f (a, ω) ∂ρ.condKernel a ∂ρ.fst = ∫ x in s ×ˢ t, f x ∂ρ := by
  conv_rhs => 

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝⁴ : IsFiniteMeasure ρ✝
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
s : Set α
hs : MeasurableSet s
t : Set Ω
ht : MeasurableSet t
hf : IntegrableOn f (s ×ˢ t)
| ∫ (x : α × Ω) in s ×ˢ t, f x ∂ρ

Next tactic:
rw [measure_eq_compProd ρ]
theorem set_integral_condKernel {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    {s : Set α} (hs : MeasurableSet s) {t : Set Ω} (ht : MeasurableSet t)
    (hf : IntegrableOn f (s ×ˢ t) ρ) :
    ∫ a in s, ∫ ω in t, f (a, ω) ∂ρ.condKernel a ∂ρ.fst = ∫ x in s ×ˢ t, f x ∂ρ := by
  conv_rhs => rw [measure_eq_compProd ρ]
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝⁴ : IsFiniteMeasure ρ✝
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
s : Set α
hs : MeasurableSet s
t : Set Ω
ht : MeasurableSet t
hf : IntegrableOn f (s ×ˢ t)
⊢ ∫ (a : α) in s, ∫ (ω : Ω) in t, f (a, ω) ∂(Measure.condKernel ρ) a ∂Measure.fst ρ =
    ∫ (x : α × Ω) in s ×ˢ t, f x ∂Measure.fst ρ ⊗ₘ Measure.condKernel ρ

Next tactic:
rw [Measure.set_integral_compProd hs ht]
theorem set_integral_condKernel {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    {s : Set α} (hs : MeasurableSet s) {t : Set Ω} (ht : MeasurableSet t)
    (hf : IntegrableOn f (s ×ˢ t) ρ) :
    ∫ a in s, ∫ ω in t, f (a, ω) ∂ρ.condKernel a ∂ρ.fst = ∫ x in s ×ˢ t, f x ∂ρ := by
  conv_rhs => rw [measure_eq_compProd ρ]
  rw [Measure.set_integral_compProd hs ht]
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝⁴ : IsFiniteMeasure ρ✝
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
s : Set α
hs : MeasurableSet s
t : Set Ω
ht : MeasurableSet t
hf : IntegrableOn f (s ×ˢ t)
⊢ IntegrableOn (fun x => f x) (s ×ˢ t)

Next tactic:
rwa [measure_eq_compProd ρ] at hf
theorem set_integral_condKernel_univ_right {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    {s : Set α} (hs : MeasurableSet s) (hf : IntegrableOn f (s ×ˢ univ) ρ) :
    ∫ a in s, ∫ ω, f (a, ω) ∂ρ.condKernel a ∂ρ.fst = ∫ x in s ×ˢ univ, f x ∂ρ := by
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝⁴ : IsFiniteMeasure ρ✝
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
s : Set α
hs : MeasurableSet s
hf : IntegrableOn f (s ×ˢ univ)
⊢ ∫ (a : α) in s, ∫ (ω : Ω), f (a, ω) ∂(Measure.condKernel ρ) a ∂Measure.fst ρ = ∫ (x : α × Ω) in s ×ˢ univ, f x ∂ρ

Next tactic:
rw [← set_integral_condKernel hs MeasurableSet.univ hf]
theorem set_integral_condKernel_univ_right {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    {s : Set α} (hs : MeasurableSet s) (hf : IntegrableOn f (s ×ˢ univ) ρ) :
    ∫ a in s, ∫ ω, f (a, ω) ∂ρ.condKernel a ∂ρ.fst = ∫ x in s ×ˢ univ, f x ∂ρ := by
  rw [← set_integral_condKernel hs MeasurableSet.univ hf]; 

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝⁴ : IsFiniteMeasure ρ✝
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
s : Set α
hs : MeasurableSet s
hf : IntegrableOn f (s ×ˢ univ)
⊢ ∫ (a : α) in s, ∫ (ω : Ω), f (a, ω) ∂(Measure.condKernel ρ) a ∂Measure.fst ρ =
    ∫ (a : α) in s, ∫ (ω : Ω) in univ, f (a, ω) ∂(Measure.condKernel ρ) a ∂Measure.fst ρ

Next tactic:
simp_rw [Measure.restrict_univ]
theorem set_integral_condKernel_univ_left {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    {t : Set Ω} (ht : MeasurableSet t) (hf : IntegrableOn f (univ ×ˢ t) ρ) :
    ∫ a, ∫ ω in t, f (a, ω) ∂ρ.condKernel a ∂ρ.fst = ∫ x in univ ×ˢ t, f x ∂ρ := by
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝⁴ : IsFiniteMeasure ρ✝
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
t : Set Ω
ht : MeasurableSet t
hf : IntegrableOn f (univ ×ˢ t)
⊢ ∫ (a : α), ∫ (ω : Ω) in t, f (a, ω) ∂(Measure.condKernel ρ) a ∂Measure.fst ρ = ∫ (x : α × Ω) in univ ×ˢ t, f x ∂ρ

Next tactic:
rw [← set_integral_condKernel MeasurableSet.univ ht hf]
theorem set_integral_condKernel_univ_left {ρ : Measure (α × Ω)} [IsFiniteMeasure ρ] {f : α × Ω → E}
    {t : Set Ω} (ht : MeasurableSet t) (hf : IntegrableOn f (univ ×ˢ t) ρ) :
    ∫ a, ∫ ω in t, f (a, ω) ∂ρ.condKernel a ∂ρ.fst = ∫ x in univ ×ˢ t, f x ∂ρ := by
  rw [← set_integral_condKernel MeasurableSet.univ ht hf]; 

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁷ : MeasurableSpace Ω
inst✝⁶ : StandardBorelSpace Ω
inst✝⁵ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝⁴ : IsFiniteMeasure ρ✝
E : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
ρ : Measure (α × Ω)
inst✝ : IsFiniteMeasure ρ
f : α × Ω → E
t : Set Ω
ht : MeasurableSet t
hf : IntegrableOn f (univ ×ˢ t)
⊢ ∫ (a : α), ∫ (ω : Ω) in t, f (a, ω) ∂(Measure.condKernel ρ) a ∂Measure.fst ρ =
    ∫ (a : α) in univ, ∫ (ω : Ω) in t, f (a, ω) ∂(Measure.condKernel ρ) a ∂Measure.fst ρ

Next tactic:
simp_rw [Measure.restrict_univ]
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
⊢ ∀ᵐ (x : α) ∂Measure.fst ρ, ↑↑(κ x) s = ↑↑((Measure.condKernel ρ) x) s

Next tactic:
refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
⊢ ∀ (s_1 : Set α),
    MeasurableSet s_1 →
      ↑↑(Measure.fst ρ) s_1 < ⊤ →
        ∫⁻ (x : α) in s_1, ↑↑(κ x) s ∂Measure.fst ρ = ∫⁻ (x : α) in s_1, ↑↑((Measure.condKernel ρ) x) s ∂Measure.fst ρ

Next tactic:
intros t ht _
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  intros t ht _
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
⊢ ∫⁻ (x : α) in t, ↑↑(κ x) s ∂Measure.fst ρ = ∫⁻ (x : α) in t, ↑↑((Measure.condKernel ρ) x) s ∂Measure.fst ρ

Next tactic:
conv_rhs => rw [set_lintegral_condKernel_eq_measure_prod _ ht hs, hκ]
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  intros t ht _
  conv_rhs => 

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
| ∫⁻ (x : α) in t, ↑↑((Measure.condKernel ρ) x) s ∂Measure.fst ρ

Next tactic:
rw [set_lintegral_condKernel_eq_measure_prod _ ht hs, hκ]
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  intros t ht _
  conv_rhs => rw [set_lintegral_condKernel_eq_measure_prod _ ht hs, hκ]
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
⊢ ∫⁻ (x : α) in t, ↑↑(κ x) s ∂Measure.fst ρ = ↑↑(Measure.fst ρ ⊗ₘ κ) (t ×ˢ s)

Next tactic:
simp only [Measure.compProd_apply (ht.prod hs), Set.mem_prod, ← lintegral_indicator _ ht]
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  intros t ht _
  conv_rhs => rw [set_lintegral_condKernel_eq_measure_prod _ ht hs, hκ]
  simp only [Measure.compProd_apply (ht.prod hs), Set.mem_prod, ← lintegral_indicator _ ht]
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
⊢ ∫⁻ (a : α), indicator t (fun x => ↑↑(κ x) s) a ∂Measure.fst ρ =
    ∫⁻ (a : α), ↑↑(κ a) (Prod.mk a ⁻¹' t ×ˢ s) ∂Measure.fst ρ

Next tactic:
congr
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  intros t ht _
  conv_rhs => rw [set_lintegral_condKernel_eq_measure_prod _ ht hs, hκ]
  simp only [Measure.compProd_apply (ht.prod hs), Set.mem_prod, ← lintegral_indicator _ ht]
  congr; 

Proof state:
case e_f
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
⊢ (fun a => indicator t (fun x => ↑↑(κ x) s) a) = fun a => ↑↑(κ a) (Prod.mk a ⁻¹' t ×ˢ s)

Next tactic:
ext x
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  intros t ht _
  conv_rhs => rw [set_lintegral_condKernel_eq_measure_prod _ ht hs, hκ]
  simp only [Measure.compProd_apply (ht.prod hs), Set.mem_prod, ← lintegral_indicator _ ht]
  congr; ext x
  

Proof state:
case e_f.h
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
x : α
⊢ indicator t (fun x => ↑↑(κ x) s) x = ↑↑(κ x) (Prod.mk x ⁻¹' t ×ˢ s)

Next tactic:
by_cases hx : x ∈ t
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  intros t ht _
  conv_rhs => rw [set_lintegral_condKernel_eq_measure_prod _ ht hs, hκ]
  simp only [Measure.compProd_apply (ht.prod hs), Set.mem_prod, ← lintegral_indicator _ ht]
  congr; ext x
  by_cases hx : x ∈ t
  

Proof state:
case pos
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
x : α
hx : x ∈ t
⊢ indicator t (fun x => ↑↑(κ x) s) x = ↑↑(κ x) (Prod.mk x ⁻¹' t ×ˢ s)
case neg
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
x : α
hx : x ∉ t
⊢ indicator t (fun x => ↑↑(κ x) s) x = ↑↑(κ x) (Prod.mk x ⁻¹' t ×ˢ s)

Next tactic:
all_goals simp [hx]
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  intros t ht _
  conv_rhs => rw [set_lintegral_condKernel_eq_measure_prod _ ht hs, hκ]
  simp only [Measure.compProd_apply (ht.prod hs), Set.mem_prod, ← lintegral_indicator _ ht]
  congr; ext x
  by_cases hx : x ∈ t
  all_goals 

Proof state:
case pos
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
x : α
hx : x ∈ t
⊢ indicator t (fun x => ↑↑(κ x) s) x = ↑↑(κ x) (Prod.mk x ⁻¹' t ×ˢ s)

Next tactic:
simp [hx]
/-- A s-finite kernel which satisfy the disintegration property of the given measure `ρ` is almost
everywhere equal to the disintegration kernel of `ρ` when evaluated on a measurable set.

This theorem in the case of finite kernels is weaker than `eq_condKernel_of_measure_eq_compProd`
which asserts that the kernels are equal almost everywhere and not just on a given measurable
set. -/
theorem eq_condKernel_of_measure_eq_compProd' (κ : kernel α Ω) [IsSFiniteKernel κ]
    (hκ : ρ = ρ.fst ⊗ₘ κ) {s : Set Ω} (hs : MeasurableSet s) :
    ∀ᵐ x ∂ρ.fst, κ x s = ρ.condKernel x s := by
  refine' ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite
    (kernel.measurable_coe κ hs) (kernel.measurable_coe ρ.condKernel hs) _
  intros t ht _
  conv_rhs => rw [set_lintegral_condKernel_eq_measure_prod _ ht hs, hκ]
  simp only [Measure.compProd_apply (ht.prod hs), Set.mem_prod, ← lintegral_indicator _ ht]
  congr; ext x
  by_cases hx : x ∈ t
  all_goals 

Proof state:
case neg
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁴ : MeasurableSpace Ω
inst✝³ : StandardBorelSpace Ω
inst✝² : Nonempty Ω
ρ : Measure (α × Ω)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α Ω)
inst✝ : IsSFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
s : Set Ω
hs : MeasurableSet s
t : Set α
ht : MeasurableSet t
a✝ : ↑↑(Measure.fst ρ) t < ⊤
x : α
hx : x ∉ t
⊢ indicator t (fun x => ↑↑(κ x) s) x = ↑↑(κ x) (Prod.mk x ⁻¹' t ×ˢ s)

Next tactic:
simp [hx]
lemma eq_condKernel_of_measure_eq_compProd_real (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
    (κ : kernel α ℝ) [IsFiniteKernel κ] (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x := by
  

Proof state:
α : Type u_1
mα : MeasurableSpace α
Ω : Type u_2
inst✝⁵ : MeasurableSpace Ω
inst✝⁴ : StandardBorelSpace Ω
inst✝³ : Nonempty Ω
ρ✝ : Measure (α × Ω)
inst✝² : IsFiniteMeasure ρ✝
ρ : Measure (α × ℝ)
inst✝¹ : IsFiniteMeasure ρ
κ : ↥(kernel α ℝ)
inst✝ : IsFiniteKernel κ
hκ : ρ = Measure.fst ρ ⊗ₘ κ
⊢ ∀ᵐ (x : α) ∂Measure.fst ρ, κ x = (Measure.condKernel ρ) x

Next tactic:
have huniv : ∀ᵐ x ∂ρ.fst, κ x Set.univ = ρ.condKernel x Set.univ :=
    eq_condKernel_of_measure_eq_compProd' ρ κ hκ MeasurableSet.univ