-- Mathlib/MeasureTheory/Measure/Prod.lean
theorem lintegral_prod (f : α × β → ℝ≥0∞) (hf : AEMeasurable f (μ.prod ν)) :
    ∫⁻ z, f z ∂μ.prod ν = ∫⁻ x, ∫⁻ y, f (x, y) ∂ν ∂μ

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝ : SFinite ν
f : α × β → ℝ≥0∞
hf : AEMeasurable f (μ.prod ν)
A : ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (z : α × β), AEMeasurable.mk f hf z ∂μ.prod ν
⊢ ∫⁻ (x : α), ∫⁻ (y : β), f (x, y) ∂ν ∂μ = ∫⁻ (x : α), ∫⁻ (y : β), AEMeasurable.mk f hf (x, y) ∂ν ∂μ

Tactic:
apply lintegral_congr_ae

Result:
case h
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝ : SFinite ν
f : α × β → ℝ≥0∞
hf : AEMeasurable f (μ.prod ν)
A : ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (z : α × β), AEMeasurable.mk f hf z ∂μ.prod ν
⊢ (fun a => ∫⁻ (y : β), f (a, y) ∂ν) =ᶠ[ae μ] fun a => ∫⁻ (y : β), AEMeasurable.mk f hf (a, y) ∂ν

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝ : SFinite ν
f : α × β → ℝ≥0∞
hf : AEMeasurable f (μ.prod ν)
⊢ ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (x : α), ∫⁻ (y : β), f (x, y) ∂ν ∂μ

Tactic:
have A : ∫⁻ z, f z ∂μ.prod ν = ∫⁻ z, hf.mk f z ∂μ.prod ν := lintegral_congr_ae hf.ae_eq_mk

Result:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝ : SFinite ν
f : α × β → ℝ≥0∞
hf : AEMeasurable f (μ.prod ν)
A : ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (z : α × β), AEMeasurable.mk f hf z ∂μ.prod ν
⊢ ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (x : α), ∫⁻ (y : β), f (x, y) ∂ν ∂μ

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝ : SFinite ν
f : α × β → ℝ≥0∞
hf : AEMeasurable f (μ.prod ν)
A : ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (z : α × β), AEMeasurable.mk f hf z ∂μ.prod ν
B : ∫⁻ (x : α), ∫⁻ (y : β), f (x, y) ∂ν ∂μ = ∫⁻ (x : α), ∫⁻ (y : β), AEMeasurable.mk f hf (x, y) ∂ν ∂μ
⊢ ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (x : α), ∫⁻ (y : β), f (x, y) ∂ν ∂μ

Tactic:
rw [A, B, lintegral_prod_of_measurable _ hf.measurable_mk]

Result:
no goals

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝ : SFinite ν
f : α × β → ℝ≥0∞
hf : AEMeasurable f (μ.prod ν)
A : ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (z : α × β), AEMeasurable.mk f hf z ∂μ.prod ν
⊢ (fun a => ∫⁻ (y : β), f (a, y) ∂ν) =ᶠ[ae μ] fun a => ∫⁻ (y : β), AEMeasurable.mk f hf (a, y) ∂ν

Tactic:
filter_upwards [ae_ae_of_ae_prod hf.ae_eq_mk] with _ ha using lintegral_congr_ae ha

Result:
no goals

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝ : SFinite ν
f : α × β → ℝ≥0∞
hf : AEMeasurable f (μ.prod ν)
A : ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (z : α × β), AEMeasurable.mk f hf z ∂μ.prod ν
⊢ ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (x : α), ∫⁻ (y : β), f (x, y) ∂ν ∂μ

Tactic:
have B : (∫⁻ x, ∫⁻ y, f (x, y) ∂ν ∂μ) = ∫⁻ x, ∫⁻ y, hf.mk f (x, y) ∂ν ∂μ := by
  apply lintegral_congr_ae
  filter_upwards [ae_ae_of_ae_prod hf.ae_eq_mk] with _ ha using lintegral_congr_ae ha

Result:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝ : SFinite ν
f : α × β → ℝ≥0∞
hf : AEMeasurable f (μ.prod ν)
A : ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (z : α × β), AEMeasurable.mk f hf z ∂μ.prod ν
B : ∫⁻ (x : α), ∫⁻ (y : β), f (x, y) ∂ν ∂μ = ∫⁻ (x : α), ∫⁻ (y : β), AEMeasurable.mk f hf (x, y) ∂ν ∂μ
⊢ ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (x : α), ∫⁻ (y : β), f (x, y) ∂ν ∂μ