awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
hE : CompleteSpace E
this_1 : MeasurableSpace E := borel E
this_2 : BorelSpace E
this_3 : SeparableSpace.{u_3} (↑(range (uncurry f) ∪ {0}) : Type u_3)
s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn (uncurry f) ⋯ (range (uncurry f) ∪ {0}) 0 ⋯
s' : ℕ → α → SimpleFunc β E := fun (n : ℕ) (x : α) ↦ (s n).comp (Prod.mk x) ⋯
f' : ℕ → α → E := fun (n : ℕ) ↦ indicator {x : α | Integrable (f x) ν} fun (x : α) ↦ SimpleFunc.integral ν (s' n x)
hf' : ∀ (n : ℕ), StronglyMeasurable (f' n)
x : α
hfx : Integrable (f x) ν
this : ∀ (n : ℕ), Integrable.{u_3, u_2} (ε := E) (⇑(s' n x) : (a : β) → E) ν
⊢ Tendsto.{0, u_3} (β := E) (fun (i : ℕ) ↦ ∫ (x_1 : β), (s' i x : (a : β) → E) x_1 ∂ν) atTop (𝓝 (∫ (y : β), f x y ∂ν))
have pos : ∀ (n : ℕ), ∀ᵐ (a : β) ∂ν, Norm.norm.{u_3} (E := E) ((s' n x : (a : β) → E) a : E) ≤ (fun (y : β) ↦ ‖f x y‖ + ‖f x y‖) a
Tactic: refine
        tendsto_integral_of_dominated_convergence (fun y => ‖f x y‖ + ‖f x y‖)
          (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
hE : CompleteSpace E
this_1 : MeasurableSpace E := borel E
this_2 : BorelSpace E
this_3 : SeparableSpace.{u_3} (↑(range (uncurry f) ∪ {0}) : Type u_3)
s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn (uncurry f) ⋯ (range (uncurry f) ∪ {0}) 0 ⋯
s' : ℕ → α → SimpleFunc β E := fun (n : ℕ) (x : α) ↦ (s n).comp (Prod.mk x) ⋯
f' : ℕ → α → E := fun (n : ℕ) ↦ indicator {x : α | Integrable (f x) ν} fun (x : α) ↦ SimpleFunc.integral ν (s' n x)
hf' : ∀ (n : ℕ), StronglyMeasurable (f' n)
x : α
hfx : Integrable (f x) ν
this : ∀ (n : ℕ), Integrable.{u_3, u_2} (ε := E) (⇑(s' n x) : (a : β) → E) ν
pos :
  ∀ (n : ℕ),
    ∀ᵐ (a : β) ∂ν, Norm.norm.{u_3} (E := E) ((s' n x : (a : β) → E) a : E) ≤ (fun (y : β) ↦ ‖f x y‖ + ‖f x y‖) a
⊢ Tendsto.{0, u_3} (β := E) (fun (i : ℕ) ↦ ∫ (x_1 : β), (s' i x : (a : β) → E) x_1 ∂ν) atTop (𝓝 (∫ (y : β), f x y ∂ν))
have pos₁ : ∀ᵐ (a : β) ∂ν, Tendsto (fun (n : ℕ) ↦ (s' n x : (a : β) → E) a) atTop (𝓝 (f x a))
Tactic: refine
        tendsto_integral_of_dominated_convergence (fun y => ‖f x y‖ + ‖f x y‖)
          (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
hE : CompleteSpace E
this_1 : MeasurableSpace E := borel E
this_2 : BorelSpace E
this_3 : SeparableSpace.{u_3} (↑(range (uncurry f) ∪ {0}) : Type u_3)
s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn (uncurry f) ⋯ (range (uncurry f) ∪ {0}) 0 ⋯
s' : ℕ → α → SimpleFunc β E := fun (n : ℕ) (x : α) ↦ (s n).comp (Prod.mk x) ⋯
f' : ℕ → α → E := fun (n : ℕ) ↦ indicator {x : α | Integrable (f x) ν} fun (x : α) ↦ SimpleFunc.integral ν (s' n x)
hf' : ∀ (n : ℕ), StronglyMeasurable (f' n)
x : α
hfx : Integrable (f x) ν
this : ∀ (n : ℕ), Integrable.{u_3, u_2} (ε := E) (⇑(s' n x) : (a : β) → E) ν
⊢ ∀ (n : ℕ),
    ∀ᵐ (a : β) ∂ν, Norm.norm.{u_3} (E := E) ((s' n x : (a : β) → E) a : E) ≤ (fun (y : β) ↦ ‖f x y‖ + ‖f x y‖) a
have pos : ∀ (n : ℕ) (y : β), Measurable (uncurry f)
Tactic: refine fun n => Eventually.of_forall fun y =>
          SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
hE : CompleteSpace E
this_1 : MeasurableSpace E := borel E
this_2 : BorelSpace E
this_3 : SeparableSpace.{u_3} (↑(range (uncurry f) ∪ {0}) : Type u_3)
s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn (uncurry f) ⋯ (range (uncurry f) ∪ {0}) 0 ⋯
s' : ℕ → α → SimpleFunc β E := fun (n : ℕ) (x : α) ↦ (s n).comp (Prod.mk x) ⋯
f' : ℕ → α → E := fun (n : ℕ) ↦ indicator {x : α | Integrable (f x) ν} fun (x : α) ↦ SimpleFunc.integral ν (s' n x)
hf' : ∀ (n : ℕ), StronglyMeasurable (f' n)
x : α
hfx : Integrable (f x) ν
this : ∀ (n : ℕ), Integrable.{u_3, u_2} (ε := E) (⇑(s' n x) : (a : β) → E) ν
pos : ∀ (n : ℕ) (y : β), Measurable (uncurry f)
⊢ ∀ (n : ℕ),
    ∀ᵐ (a : β) ∂ν, Norm.norm.{u_3} (E := E) ((s' n x : (a : β) → E) a : E) ≤ (fun (y : β) ↦ ‖f x y‖ + ‖f x y‖) a
have pos₁ : ∀ (n : ℕ) (y : β), 0 ∈ range (uncurry f) ∪ {0}
Tactic: refine fun n => Eventually.of_forall fun y =>
          SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
hE : CompleteSpace E
this_1 : MeasurableSpace E := borel E
this_2 : BorelSpace E
this_3 : SeparableSpace.{u_3} (↑(range (uncurry f) ∪ {0}) : Type u_3)
s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn (uncurry f) ⋯ (range (uncurry f) ∪ {0}) 0 ⋯
s' : ℕ → α → SimpleFunc β E := fun (n : ℕ) (x : α) ↦ (s n).comp (Prod.mk x) ⋯
f' : ℕ → α → E := fun (n : ℕ) ↦ indicator {x : α | Integrable (f x) ν} fun (x : α) ↦ SimpleFunc.integral ν (s' n x)
hf' : ∀ (n : ℕ), StronglyMeasurable (f' n)
x : α
hfx : Integrable (f x) ν
this : ∀ (n : ℕ), Integrable.{u_3, u_2} (ε := E) (⇑(s' n x) : (a : β) → E) ν
⊢ ∀ᵐ (a : β) ∂ν, Tendsto (fun (n : ℕ) ↦ (s' n x : (a : β) → E) a) atTop (𝓝 (f x a))
have pos : ∀ (y : β), Measurable.{u_2, u_3} (β := E) fun (x_1 : β) ↦ uncurry f (x, x_1)
Tactic: refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
hE : CompleteSpace E
this_1 : MeasurableSpace E := borel E
this_2 : BorelSpace E
this_3 : SeparableSpace.{u_3} (↑(range (uncurry f) ∪ {0}) : Type u_3)
s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn (uncurry f) ⋯ (range (uncurry f) ∪ {0}) 0 ⋯
s' : ℕ → α → SimpleFunc β E := fun (n : ℕ) (x : α) ↦ (s n).comp (Prod.mk x) ⋯
f' : ℕ → α → E := fun (n : ℕ) ↦ indicator {x : α | Integrable (f x) ν} fun (x : α) ↦ SimpleFunc.integral ν (s' n x)
hf' : ∀ (n : ℕ), StronglyMeasurable (f' n)
x : α
hfx : Integrable (f x) ν
this : ∀ (n : ℕ), Integrable.{u_3, u_2} (ε := E) (⇑(s' n x) : (a : β) → E) ν
pos : ∀ (y : β), Measurable.{u_2, u_3} (β := E) fun (x_1 : β) ↦ uncurry f (x, x_1)
⊢ ∀ᵐ (a : β) ∂ν, Tendsto (fun (n : ℕ) ↦ (s' n x : (a : β) → E) a) atTop (𝓝 (f x a))
have pos₁ : ∀ (y : β), 0 ∈ range (uncurry f) ∪ {0}
Tactic: refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
hE : CompleteSpace E
this_1 : MeasurableSpace E := borel E
this_2 : BorelSpace E
this_3 : SeparableSpace.{u_3} (↑(range (uncurry f) ∪ {0}) : Type u_3)
s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn (uncurry f) ⋯ (range (uncurry f) ∪ {0}) 0 ⋯
s' : ℕ → α → SimpleFunc β E := fun (n : ℕ) (x : α) ↦ (s n).comp (Prod.mk x) ⋯
f' : ℕ → α → E := fun (n : ℕ) ↦ indicator {x : α | Integrable (f x) ν} fun (x : α) ↦ SimpleFunc.integral ν (s' n x)
hf' : ∀ (n : ℕ), StronglyMeasurable (f' n)
x : α
hfx : Integrable (f x) ν
this : ∀ (n : ℕ), Integrable.{u_3, u_2} (ε := E) (⇑(s' n x) : (a : β) → E) ν
pos : ∀ (y : β), Measurable.{u_2, u_3} (β := E) fun (x_1 : β) ↦ uncurry f (x, x_1)
pos₁ : ∀ (y : β), 0 ∈ range (uncurry f) ∪ {0}
⊢ ∀ᵐ (a : β) ∂ν, Tendsto (fun (n : ℕ) ↦ (s' n x : (a : β) → E) a) atTop (𝓝 (f x a))
have pos₂ : ∀ (y : β), uncurry f (x, y) ∈ closure[PseudoEMetricSpace.toUniformSpace.toTopologicalSpace] (range (uncurry f) ∪ {0})
Tactic: refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
hE : CompleteSpace E
this_1 : MeasurableSpace E := borel E
this_2 : BorelSpace E
this_3 : SeparableSpace.{u_3} (↑(range (uncurry f) ∪ {0}) : Type u_3)
s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn (uncurry f) ⋯ (range (uncurry f) ∪ {0}) 0 ⋯
s' : ℕ → α → SimpleFunc β E := fun (n : ℕ) (x : α) ↦ (s n).comp (Prod.mk x) ⋯
f' : ℕ → α → E := fun (n : ℕ) ↦ indicator {x : α | Integrable (f x) ν} fun (x : α) ↦ SimpleFunc.integral ν (s' n x)
hf' : ∀ (n : ℕ), StronglyMeasurable (f' n)
x : α
hfx : Integrable (f x) ν
this : ∀ (n : ℕ), Integrable.{u_3, u_2} (ε := E) (⇑(s' n x) : (a : β) → E) ν
y : β
⊢ uncurry f (x, y) ∈ closure[PseudoEMetricSpace.toUniformSpace.toTopologicalSpace] (range (uncurry f) ∪ {0})
have pos : uncurry f (x, y) ∈ range (uncurry f) ∪ {0}
Tactic: apply subset_closure
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (hypothesis)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
hE : CompleteSpace E
this_1 : MeasurableSpace E := borel E
this_2 : BorelSpace E
this : SeparableSpace.{u_3} (↑(range (uncurry f) ∪ {0}) : Type u_3)
s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn (uncurry f) ⋯ (range (uncurry f) ∪ {0}) 0 ⋯
s' : ℕ → α → SimpleFunc β E := fun (n : ℕ) (x : α) ↦ (s n).comp (Prod.mk x) ⋯
f' : ℕ → α → E := fun (n : ℕ) ↦ indicator {x : α | Integrable (f x) ν} fun (x : α) ↦ SimpleFunc.integral ν (s' n x)
hf' : ∀ (n : ℕ), StronglyMeasurable (f' n)
⊢ StronglyMeasurable.{u_1, u_3} (β := E) fun (x : α) ↦ ∫ (y : β), f x y ∂ν
have h2f' : Tendsto f' atTop (𝓝 fun (x : α) ↦ ∫ (y : β), f x y ∂ν)
Tactic: have h2f' : Tendsto f' atTop (𝓝 fun x : α => ∫ y : β, f x y ∂ν) := by
    rw [tendsto_pi_nhds]; intro x
    by_cases hfx : Integrable (f x) ν
    · have (n : _) : Integrable (s' n x) ν := by
        apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable
        filter_upwards with y
        simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n
      simp only [f', hfx, SimpleFunc.integral_eq_integral _ (this _), indicator_of_mem,
        mem_setOf_eq]
      refine
        tendsto_integral_of_dominated_convergence (fun y => ‖f x y‖ + ‖f x y‖)
          (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_
      · refine fun n => Eventually.of_forall fun y =>
          SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n
        · exact hf.measurable
        · simp
      · refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_
        · exact hf.measurable.of_uncurry_left
        · simp
        apply subset_closure
        simp [-uncurry_apply_pair]
    · simp [f', hfx, integral_undef]
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
⊢ StronglyMeasurable.{u_1, u_3} (β := E) fun (x : α) ↦ ∫ (y : β), f x y ∂ν
have pos : ∀ (hE : CompleteSpace E), StronglyMeasurable.{u_1, u_3} (β := E) fun (x : α) ↦ ∫ (y : β), f x y ∂ν
Tactic: classical
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE, stronglyMeasurable_const]
  borelize E
  haveI : SeparableSpace (range (uncurry f) ∪ {0} : Set E) :=
    hf.separableSpace_range_union_singleton
  let s : ℕ → SimpleFunc (α × β) E :=
    SimpleFunc.approxOn _ hf.measurable (range (uncurry f) ∪ {0}) 0 (by simp)
  let s' : ℕ → α → SimpleFunc β E := fun n x => (s n).comp (Prod.mk x) measurable_prodMk_left
  let f' : ℕ → α → E := fun n => {x | Integrable (f x) ν}.indicator fun x => (s' n x).integral ν
  have hf' : ∀ n, StronglyMeasurable (f' n) := by
    intro n; refine StronglyMeasurable.indicator ?_ (measurableSet_integrable hf)
    have : ∀ x, ((s' n x).range.filter fun x => x ≠ 0) ⊆ (s n).range := by
      intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y
      simp_rw [SimpleFunc.mem_range]; rintro ⟨z, rfl⟩; exact ⟨(x, z), rfl⟩
    simp only [SimpleFunc.integral_eq_sum_of_subset (this _)]
    refine Finset.stronglyMeasurable_fun_sum _ fun x _ => ?_
    refine (Measurable.ennreal_toReal ?_).stronglyMeasurable.smul_const _
    simp only [s', SimpleFunc.coe_comp, preimage_comp]
    apply measurable_measure_prodMk_left
    exact (s n).measurableSet_fiber x
  have h2f' : Tendsto f' atTop (𝓝 fun x : α => ∫ y : β, f x y ∂ν) := by
    rw [tendsto_pi_nhds]; intro x
    by_cases hfx : Integrable (f x) ν
    · have (n : _) : Integrable (s' n x) ν := by
        apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable
        filter_upwards with y
        simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n
      simp only [f', hfx, SimpleFunc.integral_eq_integral _ (this _), indicator_of_mem,
        mem_setOf_eq]
      refine
        tendsto_integral_of_dominated_convergence (fun y => ‖f x y‖ + ‖f x y‖)
          (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_
      · refine fun n => Eventually.of_forall fun y =>
          SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n
        · exact hf.measurable
        · simp
      · refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_
        · exact hf.measurable.of_uncurry_left
        · simp
        apply subset_closure
        simp [-uncurry_apply_pair]
    · simp [f', hfx, integral_undef]
  exact stronglyMeasurable_of_tendsto _ hf' h2f'
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α → β → E
hf : StronglyMeasurable (uncurry f)
pos : ∀ (hE : CompleteSpace E), StronglyMeasurable.{u_1, u_3} (β := E) fun (x : α) ↦ ∫ (y : β), f x y ∂ν
⊢ StronglyMeasurable.{u_1, u_3} (β := E) fun (x : α) ↦ ∫ (y : β), f x y ∂ν
have neg : ∀ (hE : ¬CompleteSpace E), StronglyMeasurable.{u_1, u_3} (β := E) fun (x : α) ↦ ∫ (y : β), f x y ∂ν
Tactic: classical
  by_cases hE : CompleteSpace E; swap; · simp [integral, hE, stronglyMeasurable_const]
  borelize E
  haveI : SeparableSpace (range (uncurry f) ∪ {0} : Set E) :=
    hf.separableSpace_range_union_singleton
  let s : ℕ → SimpleFunc (α × β) E :=
    SimpleFunc.approxOn _ hf.measurable (range (uncurry f) ∪ {0}) 0 (by simp)
  let s' : ℕ → α → SimpleFunc β E := fun n x => (s n).comp (Prod.mk x) measurable_prodMk_left
  let f' : ℕ → α → E := fun n => {x | Integrable (f x) ν}.indicator fun x => (s' n x).integral ν
  have hf' : ∀ n, StronglyMeasurable (f' n) := by
    intro n; refine StronglyMeasurable.indicator ?_ (measurableSet_integrable hf)
    have : ∀ x, ((s' n x).range.filter fun x => x ≠ 0) ⊆ (s n).range := by
      intro x; refine Finset.Subset.trans (Finset.filter_subset _ _) ?_; intro y
      simp_rw [SimpleFunc.mem_range]; rintro ⟨z, rfl⟩; exact ⟨(x, z), rfl⟩
    simp only [SimpleFunc.integral_eq_sum_of_subset (this _)]
    refine Finset.stronglyMeasurable_fun_sum _ fun x _ => ?_
    refine (Measurable.ennreal_toReal ?_).stronglyMeasurable.smul_const _
    simp only [s', SimpleFunc.coe_comp, preimage_comp]
    apply measurable_measure_prodMk_left
    exact (s n).measurableSet_fiber x
  have h2f' : Tendsto f' atTop (𝓝 fun x : α => ∫ y : β, f x y ∂ν) := by
    rw [tendsto_pi_nhds]; intro x
    by_cases hfx : Integrable (f x) ν
    · have (n : _) : Integrable (s' n x) ν := by
        apply (hfx.norm.add hfx.norm).mono' (s' n x).aestronglyMeasurable
        filter_upwards with y
        simp_rw [s', SimpleFunc.coe_comp]; exact SimpleFunc.norm_approxOn_zero_le _ _ (x, y) n
      simp only [f', hfx, SimpleFunc.integral_eq_integral _ (this _), indicator_of_mem,
        mem_setOf_eq]
      refine
        tendsto_integral_of_dominated_convergence (fun y => ‖f x y‖ + ‖f x y‖)
          (fun n => (s' n x).aestronglyMeasurable) (hfx.norm.add hfx.norm) ?_ ?_
      · refine fun n => Eventually.of_forall fun y =>
          SimpleFunc.norm_approxOn_zero_le ?_ ?_ (x, y) n
        · exact hf.measurable
        · simp
      · refine Eventually.of_forall fun y => SimpleFunc.tendsto_approxOn ?_ ?_ ?_
        · exact hf.measurable.of_uncurry_left
        · simp
        apply subset_closure
        simp [-uncurry_apply_pair]
    · simp [f', hfx, integral_undef]
  exact stronglyMeasurable_of_tendsto _ hf' h2f'
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (hypothesis)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace ℝ E
inst_4 : SFinite ν
f : α × β → E
hf : StronglyMeasurable f
⊢ StronglyMeasurable.{u_1, u_3} (β := E) fun (x : α) ↦ ∫ (y : β), f (x, y) ∂ν
have hf₁ : StronglyMeasurable (uncurry (Function.curry f))
Tactic: rw [← uncurry_curry f] at hf
Cleared hypotheses: hf
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
μ : Measure α
ν : Measure β
inst_2 : SFinite ν
s : Set (α × β)
hs : MeasurableSet s
h2s : Ne (α := ℝ≥0∞) ((μ.prod ν : (a : Set (α × β)) → ℝ≥0∞) s : ℝ≥0∞) (∞ : ℝ≥0∞)
⊢ Integrable (ε := ℝ) (fun (x : α) ↦ ν.real (Prod.mk x ⁻¹' s)) μ
have refine : HasFiniteIntegral (ε := ℝ) (fun (x : α) ↦ ν.real (Prod.mk x ⁻¹' s)) μ
Tactic: refine ⟨(measurable_measure_prodMk_left hs).ennreal_toReal.aemeasurable.aestronglyMeasurable, ?_⟩
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
μ : Measure α
ν : Measure β
inst_2 : SFinite ν
s : Set (α × β)
hs : MeasurableSet s
h2s : Ne (α := ℝ≥0∞) ((μ.prod ν : (a : Set (α × β)) → ℝ≥0∞) s : ℝ≥0∞) (∞ : ℝ≥0∞)
⊢ HasFiniteIntegral (ε := ℝ) (fun (x : α) ↦ ν.real (Prod.mk x ⁻¹' s)) μ
have simp_rw : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s))) ∂μ < ∞
Tactic: simp_rw [hasFiniteIntegral_iff_enorm, measureReal_def, enorm_eq_ofReal toReal_nonneg]
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
μ : Measure α
ν : Measure β
inst_2 : SFinite ν
s : Set (α × β)
hs : MeasurableSet s
h2s : Ne (α := ℝ≥0∞) ((μ.prod ν : (a : Set (α × β)) → ℝ≥0∞) s : ℝ≥0∞) (∞ : ℝ≥0∞)
⊢ ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s))) ∂μ < ∞
have h : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s))) ∂μ =
  (μ.prod ν : (a : Set (α × β)) → ℝ≥0∞) s
Tactic: convert! h2s.lt_top using 1
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
μ : Measure α
ν : Measure β
inst_2 : SFinite ν
s : Set (α × β)
hs : MeasurableSet s
h2s : Ne (α := ℝ≥0∞) ((μ.prod ν : (a : Set (α × β)) → ℝ≥0∞) s : ℝ≥0∞) (∞ : ℝ≥0∞)
⊢ ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s))) ∂μ =
    (μ.prod ν : (a : Set (α × β)) → ℝ≥0∞) s
have h : ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s))) ∂μ =
  ∫⁻ (x : α), (ν : (a : Set β) → ℝ≥0∞) (Prod.mk x ⁻¹' s) ∂μ
Tactic: rw [prod_apply hs]
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
μ : Measure α
ν : Measure β
inst_2 : SFinite ν
s : Set (α × β)
hs : MeasurableSet s
h2s : Ne (α := ℝ≥0∞) ((μ.prod ν : (a : Set (α × β)) → ℝ≥0∞) s : ℝ≥0∞) (∞ : ℝ≥0∞)
⊢ ∫⁻ (a : α), ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s))) ∂μ =
    ∫⁻ (x : α), (ν : (a : Set β) → ℝ≥0∞) (Prod.mk x ⁻¹' s) ∂μ
have h : (ae μ).EventuallyEq (β := ℝ≥0∞)
  (fun (a : α) ↦ ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s)))) fun (a : α) ↦
  (ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s)
Tactic: apply lintegral_congr_ae
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
μ : Measure α
ν : Measure β
inst_2 : SFinite ν
s : Set (α × β)
hs : MeasurableSet s
h2s : Ne (α := ℝ≥0∞) ((μ.prod ν : (a : Set (α × β)) → ℝ≥0∞) s : ℝ≥0∞) (∞ : ℝ≥0∞)
⊢ (ae μ).EventuallyEq (β := ℝ≥0∞)
    (fun (a : α) ↦ ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s)))) fun (a : α) ↦
    (ν : (a : Set β) → ℝ≥0∞) (Prod.mk a ⁻¹' s)
have h : ∀ (x : α) (hx : LT.lt (α := ℝ≥0∞) ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk x ⁻¹' s) : ℝ≥0∞) (∞ : ℝ≥0∞)),
  ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk x ⁻¹' s))) =
    (ν : (a : Set β) → ℝ≥0∞) (Prod.mk x ⁻¹' s)
Tactic: filter_upwards [ae_measure_lt_top hs h2s] with x hx
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (hypothesis)
Goal:
α : Type u_1
β : Type u_2
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
μ : Measure α
ν : Measure β
inst_2 : SFinite ν
s : Set (α × β)
hs : MeasurableSet s
h2s : Ne (α := ℝ≥0∞) ((μ.prod ν : (a : Set (α × β)) → ℝ≥0∞) s : ℝ≥0∞) (∞ : ℝ≥0∞)
x : α
hx : LT.lt (α := ℝ≥0∞) ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk x ⁻¹' s) : ℝ≥0∞) (∞ : ℝ≥0∞)
⊢ ENNReal.ofReal (ENNReal.toReal ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk x ⁻¹' s))) =
    (ν : (a : Set β) → ℝ≥0∞) (Prod.mk x ⁻¹' s)
have hx₁ : Ne (α := ℝ≥0∞) ((ν : (a : Set β) → ℝ≥0∞) (Prod.mk x ⁻¹' s) : ℝ≥0∞) (∞ : ℝ≥0∞)
Tactic: rw [lt_top_iff_ne_top] at hx
Cleared hypotheses: hx
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (hypothesis)
Goal:
α : Type u_1
β : Type u_2
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
μ : Measure α
ν : Measure β
X : Type u_4
inst_2 : TopologicalSpace X
inst_3 : SFinite μ
inst_4 : SFinite ν
f : β × α → X
hf : AEStronglyMeasurable f (ν.prod μ)
⊢ AEStronglyMeasurable (β := X) (fun (z : α × β) ↦ f z.swap) (μ.prod ν)
have hf₁ : AEStronglyMeasurable (m₀ := Prod.instMeasurableSpace) f (map Prod.swap (μ.prod ν))
Tactic: rw [← prod_swap] at hf
Cleared hypotheses: hf
-- Lean 4 proof step from Mathlib.MeasureTheory.Integral.Prod (goal)
Goal:
α : Type u_1
β : Type u_2
E : Type u_3
inst : MeasurableSpace α
inst_1 : MeasurableSpace β
μ : Measure α
ν : Measure β
inst_2 : NormedAddCommGroup E
inst_3 : SFinite ν
inst_4 : NormedSpace ℝ E
f : α × β → E
hf : AEStronglyMeasurable f (μ.prod ν)
⊢ EventuallyEq.{u_1, u_3} (β := E) (ae μ) (fun (x : α) ↦ ∫ (y : β), f (x, y) ∂ν) fun (x : α) ↦
    ∫ (y : β), AEStronglyMeasurable.mk f hf (x, y) ∂ν
have h : ∀ (a : α),
  Membership.mem (γ := Set α)
    {x : α |
      Membership.mem (γ := Set α)
          {x : α | (fun (x : α) ↦ ∀ᵐ (y : β) ∂ν, f (x, y) = AEStronglyMeasurable.mk f hf (x, y)) x} x →
        Membership.mem (γ := Set α)
          {x : α |
            (fun (x : α) ↦
                Eq.{u_3 + 1} (α := E) ((fun (x : α) ↦ (∫ (y : β), f (x, y) ∂ν : E)) x)
                  ((fun (x : α) ↦ (∫ (y : β), AEStronglyMeasurable.mk f hf (x, y) ∂ν : E)) x))
              x}
          x}
    a
Tactic: filter_upwards [ae_ae_of_ae_prod hf.ae_eq_mk] with _ hx using integral_congr_ae hx