l3lab/ntp-mathlib huggingface dataset:
/-- The map that sends an L¹-function `f : α × β → E` to `∫∫f` is continuous. -/
theorem continuous_integral_integral :
    Continuous fun f : α × β →₁[μ.prod ν] E => ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  rw [continuous_iff_continuousAt]; intro g
  refine'
    tendsto_integral_of_L1 _ (L1.integrable_coeFn g).integral_prod_left
      (eventually_of_forall fun h => (L1.integrable_coeFn h).integral_prod_left) _
  simp_rw [←
    lintegral_fn_integral_sub (fun x => (‖x‖₊ : ℝ≥0∞)) (L1.integrable_coeFn _)
      (L1.integrable_coeFn g)]
  refine' tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds _ (fun i => zero_le _) _
  · exact fun i => ∫⁻ x, ∫⁻ y, ‖i (x, y) - g (x, y)‖₊ ∂ν ∂μ
  swap; · exact fun i => lintegral_mono fun x => ennnorm_integral_le_lintegral_ennnorm _
  show
    Tendsto (fun i : α × β →₁[μ.prod ν] E => ∫⁻ x, ∫⁻ y : β, ‖i (x, y) - g (x, y)‖₊ ∂ν ∂μ) (𝓝 g)
      (𝓝 0)
  have : ∀ i : α × β →₁[μ.prod ν] E, Measurable fun z => (‖i z - g z‖₊ : ℝ≥0∞) := fun i =>
    ((Lp.stronglyMeasurable i).sub (Lp.stronglyMeasurable g)).ennnorm
  -- Porting note: was
  -- simp_rw [← lintegral_prod_of_measurable _ (this _), ← L1.ofReal_norm_sub_eq_lintegral, ←
  --   ofReal_zero]
  conv =>
    congr
    ext
    rw [← lintegral_prod_of_measurable _ (this _), ← L1.ofReal_norm_sub_eq_lintegral]
  rw [← ofReal_zero]
  refine' (continuous_ofReal.tendsto 0).comp _
  rw [← tendsto_iff_norm_sub_tendsto_zero]; 

Proof state:
case refine'_2
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
g : ↥(Lp E 1)
this : ∀ (i : ↥(Lp E 1)), Measurable fun z => ↑‖↑↑i z - ↑↑g z‖₊
⊢ Tendsto (fun x => x) (𝓝 g) (𝓝 g)

Next tactic:
exact tendsto_id
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  

Proof state:
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
f : α × β → E
hf : Integrable f
⊢ ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ

Next tactic:
by_cases hE : CompleteSpace E
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; 

Proof state:
case pos
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
f : α × β → E
hf : Integrable f
hE : CompleteSpace E
⊢ ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ
case neg
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
f : α × β → E
hf : Integrable f
hE : ¬CompleteSpace E
⊢ ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ

Next tactic:
swap
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · 

Proof state:
case neg
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
f : α × β → E
hf : Integrable f
hE : ¬CompleteSpace E
⊢ ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ

Next tactic:
simp only [integral, dif_neg hE]
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  

Proof state:
case pos
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
f : α × β → E
hf : Integrable f
hE : CompleteSpace E
⊢ ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ

Next tactic:
revert f
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  

Proof state:
case pos
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
⊢ ∀ (f : α × β → E), Integrable f → ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ

Next tactic:
apply Integrable.induction
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  apply Integrable.induction
  · 

Proof state:
case pos.h_ind
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
⊢ ∀ (c : E) ⦃s : Set (α × β)⦄,
    MeasurableSet s →
      ↑↑(Measure.prod μ ν) s < ⊤ →
        ∫ (z : α × β), indicator s (fun x => c) z ∂Measure.prod μ ν =
          ∫ (x : α), ∫ (y : β), indicator s (fun x => c) (x, y) ∂ν ∂μ

Next tactic:
intro c s hs h2s
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  apply Integrable.induction
  · intro c s hs h2s
    

Proof state:
case pos.h_ind
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
c : E
s : Set (α × β)
hs : MeasurableSet s
h2s : ↑↑(Measure.prod μ ν) s < ⊤
⊢ ∫ (z : α × β), indicator s (fun x => c) z ∂Measure.prod μ ν =
    ∫ (x : α), ∫ (y : β), indicator s (fun x => c) (x, y) ∂ν ∂μ

Next tactic:
simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp,
      integral_indicator (measurable_prod_mk_left hs), set_integral_const, integral_smul_const,
      integral_toReal (measurable_measure_prod_mk_left hs).aemeasurable
        (ae_measure_lt_top hs h2s.ne)]
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  apply Integrable.induction
  · intro c s hs h2s
    simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp,
      integral_indicator (measurable_prod_mk_left hs), set_integral_const, integral_smul_const,
      integral_toReal (measurable_measure_prod_mk_left hs).aemeasurable
        (ae_measure_lt_top hs h2s.ne)]
    -- Porting note: was `simp_rw`
    

Proof state:
case pos.h_ind
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
c : E
s : Set (α × β)
hs : MeasurableSet s
h2s : ↑↑(Measure.prod μ ν) s < ⊤
⊢ ENNReal.toReal (↑↑(Measure.prod μ ν) s) • c = ENNReal.toReal (∫⁻ (a : α), ↑↑ν (Prod.mk a ⁻¹' s) ∂μ) • c

Next tactic:
rw [prod_apply hs]
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  apply Integrable.induction
  · intro c s hs h2s
    simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp,
      integral_indicator (measurable_prod_mk_left hs), set_integral_const, integral_smul_const,
      integral_toReal (measurable_measure_prod_mk_left hs).aemeasurable
        (ae_measure_lt_top hs h2s.ne)]
    -- Porting note: was `simp_rw`
    rw [prod_apply hs]
  · 

Proof state:
case pos.h_add
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
⊢ ∀ ⦃f g : α × β → E⦄,
    Disjoint (support f) (support g) →
      Integrable f →
        Integrable g →
          ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ →
            ∫ (z : α × β), g z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), g (x, y) ∂ν ∂μ →
              ∫ (z : α × β), (f + g) z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), (f + g) (x, y) ∂ν ∂μ

Next tactic:
rintro f g - i_f i_g hf hg
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  apply Integrable.induction
  · intro c s hs h2s
    simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp,
      integral_indicator (measurable_prod_mk_left hs), set_integral_const, integral_smul_const,
      integral_toReal (measurable_measure_prod_mk_left hs).aemeasurable
        (ae_measure_lt_top hs h2s.ne)]
    -- Porting note: was `simp_rw`
    rw [prod_apply hs]
  · rintro f g - i_f i_g hf hg
    

Proof state:
case pos.h_add
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
f g : α × β → E
i_f : Integrable f
i_g : Integrable g
hf : ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ
hg : ∫ (z : α × β), g z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), g (x, y) ∂ν ∂μ
⊢ ∫ (z : α × β), (f + g) z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), (f + g) (x, y) ∂ν ∂μ

Next tactic:
simp_rw [integral_add' i_f i_g, integral_integral_add' i_f i_g, hf, hg]
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  apply Integrable.induction
  · intro c s hs h2s
    simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp,
      integral_indicator (measurable_prod_mk_left hs), set_integral_const, integral_smul_const,
      integral_toReal (measurable_measure_prod_mk_left hs).aemeasurable
        (ae_measure_lt_top hs h2s.ne)]
    -- Porting note: was `simp_rw`
    rw [prod_apply hs]
  · rintro f g - i_f i_g hf hg
    simp_rw [integral_add' i_f i_g, integral_integral_add' i_f i_g, hf, hg]
  · 

Proof state:
case pos.h_closed
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
⊢ IsClosed {f | ∫ (z : α × β), ↑↑f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), ↑↑f (x, y) ∂ν ∂μ}

Next tactic:
exact isClosed_eq continuous_integral continuous_integral_integral
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  apply Integrable.induction
  · intro c s hs h2s
    simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp,
      integral_indicator (measurable_prod_mk_left hs), set_integral_const, integral_smul_const,
      integral_toReal (measurable_measure_prod_mk_left hs).aemeasurable
        (ae_measure_lt_top hs h2s.ne)]
    -- Porting note: was `simp_rw`
    rw [prod_apply hs]
  · rintro f g - i_f i_g hf hg
    simp_rw [integral_add' i_f i_g, integral_integral_add' i_f i_g, hf, hg]
  · exact isClosed_eq continuous_integral continuous_integral_integral
  · 

Proof state:
case pos.h_ae
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
⊢ ∀ ⦃f g : α × β → E⦄,
    f =ᶠ[ae (Measure.prod μ ν)] g →
      Integrable f →
        ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ →
          ∫ (z : α × β), g z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), g (x, y) ∂ν ∂μ

Next tactic:
rintro f g hfg - hf
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  apply Integrable.induction
  · intro c s hs h2s
    simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp,
      integral_indicator (measurable_prod_mk_left hs), set_integral_const, integral_smul_const,
      integral_toReal (measurable_measure_prod_mk_left hs).aemeasurable
        (ae_measure_lt_top hs h2s.ne)]
    -- Porting note: was `simp_rw`
    rw [prod_apply hs]
  · rintro f g - i_f i_g hf hg
    simp_rw [integral_add' i_f i_g, integral_integral_add' i_f i_g, hf, hg]
  · exact isClosed_eq continuous_integral continuous_integral_integral
  · rintro f g hfg - hf; 

Proof state:
case pos.h_ae
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
f g : α × β → E
hfg : f =ᶠ[ae (Measure.prod μ ν)] g
hf : ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ
⊢ ∫ (z : α × β), g z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), g (x, y) ∂ν ∂μ

Next tactic:
convert hf using 1
/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ := by
  by_cases hE : CompleteSpace E; swap; · simp only [integral, dif_neg hE]
  revert f
  apply Integrable.induction
  · intro c s hs h2s
    simp_rw [integral_indicator hs, ← indicator_comp_right, Function.comp,
      integral_indicator (measurable_prod_mk_left hs), set_integral_const, integral_smul_const,
      integral_toReal (measurable_measure_prod_mk_left hs).aemeasurable
        (ae_measure_lt_top hs h2s.ne)]
    -- Porting note: was `simp_rw`
    rw [prod_apply hs]
  · rintro f g - i_f i_g hf hg
    simp_rw [integral_add' i_f i_g, integral_integral_add' i_f i_g, hf, hg]
  · exact isClosed_eq continuous_integral continuous_integral_integral
  · rintro f g hfg - hf; convert hf using 1
    · 

Proof state:
case h.e'_2
α : Type u_1
α' : Type u_2
β : Type u_3
β' : Type u_4
γ : Type u_5
E : Type u_6
inst✝¹⁰ : MeasurableSpace α
inst✝⁹ : MeasurableSpace α'
inst✝⁸ : MeasurableSpace β
inst✝⁷ : MeasurableSpace β'
inst✝⁶ : MeasurableSpace γ
μ μ' : Measure α
ν ν' : Measure β
τ : Measure γ
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : SigmaFinite ν
inst✝³ : NormedSpace ℝ E
inst✝² : SigmaFinite μ
E' : Type u_7
inst✝¹ : NormedAddCommGroup E'
inst✝ : NormedSpace ℝ E'
hE : CompleteSpace E
f g : α × β → E
hfg : f =ᶠ[ae (Measure.prod μ ν)] g
hf : ∫ (z : α × β), f z ∂Measure.prod μ ν = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ
⊢ ∫ (z : α × β), g z ∂Measure.prod μ ν = ∫ (z : α × β), f z ∂Measure.prod μ ν

Next tactic:
exact integral_congr_ae hfg.symm