-- Mathlib/MeasureTheory/Integral/Prod.lean
theorem hasFiniteIntegral_prod_iff' ⦃f : α × β → E⦄ (h1f : AEStronglyMeasurable f (μ.prod ν)) :
    HasFiniteIntegral f (μ.prod ν) ↔
      (∀ᵐ x ∂μ, HasFiniteIntegral (fun y => f (x, y)) ν) ∧
        HasFiniteIntegral (fun x => ∫ y, ‖f (x, y)‖ ∂ν) μ

Proof state:
case h₂
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ HasFiniteIntegral (fun x => ∫ (y : β), ‖AEStronglyMeasurable.mk f h1f (x, y)‖ ∂ν) μ ↔
    HasFiniteIntegral (fun x => ∫ (y : β), ‖f (x, y)‖ ∂ν) μ

Tactic:
apply hasFiniteIntegral_congr

Result:
case h₂.h
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ (fun x => ∫ (y : β), ‖AEStronglyMeasurable.mk f h1f (x, y)‖ ∂ν) =ᶠ[ae μ] fun x => ∫ (y : β), ‖f (x, y)‖ ∂ν

Proof state:
case h₁
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ (∀ᵐ (x : α) ∂μ, HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (x, y)) ν) ↔
    ∀ᵐ (x : α) ∂μ, HasFiniteIntegral (fun y => f (x, y)) ν

Tactic:
apply eventually_congr

Result:
case h₁.h
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ ∀ᵐ (x : α) ∂μ,
    HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (x, y)) ν ↔ HasFiniteIntegral (fun y => f (x, y)) ν

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ HasFiniteIntegral f (μ.prod ν) ↔
    (∀ᵐ (x : α) ∂μ, HasFiniteIntegral (fun y => f (x, y)) ν) ∧ HasFiniteIntegral (fun x => ∫ (y : β), ‖f (x, y)‖ ∂ν) μ

Tactic:
rw [hasFiniteIntegral_congr h1f.ae_eq_mk,
  hasFiniteIntegral_prod_iff h1f.stronglyMeasurable_mk]

Result:
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ (∀ᵐ (x : α) ∂μ, HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (x, y)) ν) ∧
      HasFiniteIntegral (fun x => ∫ (y : β), ‖AEStronglyMeasurable.mk f h1f (x, y)‖ ∂ν) μ ↔
    (∀ᵐ (x : α) ∂μ, HasFiniteIntegral (fun y => f (x, y)) ν) ∧ HasFiniteIntegral (fun x => ∫ (y : β), ‖f (x, y)‖ ∂ν) μ

Proof state:
case h
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
x : α
hx : ∀ᵐ (y : β) ∂ν, AEStronglyMeasurable.mk f h1f (x, y) = f (x, y)
⊢ HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (x, y)) ν ↔ HasFiniteIntegral (fun y => f (x, y)) ν

Tactic:
exact hasFiniteIntegral_congr hx

Result:
no goals

Proof state:
case h
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ ∀ (a : α),
    (∀ᵐ (y : β) ∂ν, AEStronglyMeasurable.mk f h1f (a, y) = f (a, y)) →
      (HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (a, y)) ν ↔ HasFiniteIntegral (fun y => f (a, y)) ν)

Tactic:
intro x hx

Result:
case h
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
x : α
hx : ∀ᵐ (y : β) ∂ν, AEStronglyMeasurable.mk f h1f (x, y) = f (x, y)
⊢ HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (x, y)) ν ↔ HasFiniteIntegral (fun y => f (x, y)) ν

Proof state:
case h₂.h
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ (fun x => ∫ (y : β), ‖AEStronglyMeasurable.mk f h1f (x, y)‖ ∂ν) =ᶠ[ae μ] fun x => ∫ (y : β), ‖f (x, y)‖ ∂ν

Tactic:
filter_upwards [ae_ae_of_ae_prod h1f.ae_eq_mk.symm] with _ hx using
  integral_congr_ae (EventuallyEq.fun_comp hx _)

Result:
no goals

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ (∀ᵐ (x : α) ∂μ, HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (x, y)) ν) ∧
      HasFiniteIntegral (fun x => ∫ (y : β), ‖AEStronglyMeasurable.mk f h1f (x, y)‖ ∂ν) μ ↔
    (∀ᵐ (x : α) ∂μ, HasFiniteIntegral (fun y => f (x, y)) ν) ∧ HasFiniteIntegral (fun x => ∫ (y : β), ‖f (x, y)‖ ∂ν) μ

Tactic:
apply and_congr

Result:
case h₁
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ (∀ᵐ (x : α) ∂μ, HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (x, y)) ν) ↔
    ∀ᵐ (x : α) ∂μ, HasFiniteIntegral (fun y => f (x, y)) ν

case h₂
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ HasFiniteIntegral (fun x => ∫ (y : β), ‖AEStronglyMeasurable.mk f h1f (x, y)‖ ∂ν) μ ↔
    HasFiniteIntegral (fun x => ∫ (y : β), ‖f (x, y)‖ ∂ν) μ

Proof state:
case h₁.h
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ ∀ᵐ (x : α) ∂μ,
    HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (x, y)) ν ↔ HasFiniteIntegral (fun y => f (x, y)) ν

Tactic:
filter_upwards [ae_ae_of_ae_prod h1f.ae_eq_mk.symm]

Result:
case h
α : Type u_1
β : Type u_2
E : Type u_3
inst✝³ : MeasurableSpace α
inst✝² : MeasurableSpace β
μ : Measure α
ν : Measure β
inst✝¹ : NormedAddCommGroup E
inst✝ : SFinite ν
f : α × β → E
h1f : AEStronglyMeasurable f (μ.prod ν)
⊢ ∀ (a : α),
    (∀ᵐ (y : β) ∂ν, AEStronglyMeasurable.mk f h1f (a, y) = f (a, y)) →
      (HasFiniteIntegral (fun y => AEStronglyMeasurable.mk f h1f (a, y)) ν ↔ HasFiniteIntegral (fun y => f (a, y)) ν)