# Documentation

Mathlib.MeasureTheory.Constructions.Prod.Integral

# Integration with respect to the product measure #

In this file we prove Fubini's theorem.

## Main results #

• MeasureTheory.integrable_prod_iff states that a binary function is integrable iff both
• y ↦ f (x, y) is integrable for almost every x, and
• the function x ↦ ∫ ‖f (x, y)‖ dy is integrable.
• MeasureTheory.integral_prod: Fubini's theorem. It states that for an integrable function α × β → E (where E is a second countable Banach space) we have ∫ z, f z ∂(μ.prod ν) = ∫ x, ∫ y, f (x, y) ∂ν ∂μ. This theorem has the same variants as Tonelli's theorem (see MeasureTheory.lintegral_prod). The lemma MeasureTheory.Integrable.integral_prod_right states that the inner integral of the right-hand side is integrable.

## Tags #

product measure, Fubini's theorem, Fubini-Tonelli theorem

### Measurability #

Before we define the product measure, we can talk about the measurability of operations on binary functions. We show that if f is a binary measurable function, then the function that integrates along one of the variables (using either the Lebesgue or Bochner integral) is measurable.

theorem measurableSet_integrable {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {ν : } ⦃f : αβE :
theorem MeasureTheory.StronglyMeasurable.integral_prod_right {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {ν : } [] [] ⦃f : αβE :
MeasureTheory.StronglyMeasurable fun x => ∫ (y : β), f x yν

The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is measurable. This version has f in curried form.

theorem MeasureTheory.StronglyMeasurable.integral_prod_right' {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {ν : } [] [] ⦃f : α × βE (hf : ) :
MeasureTheory.StronglyMeasurable fun x => ∫ (y : β), f (x, y)ν

The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is measurable.

theorem MeasureTheory.StronglyMeasurable.integral_prod_left {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } [] [] ⦃f : αβE :
MeasureTheory.StronglyMeasurable fun y => ∫ (x : α), f x yμ

The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) the symmetric version of Fubini's theorem is measurable. This version has f in curried form.

theorem MeasureTheory.StronglyMeasurable.integral_prod_left' {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } [] [] ⦃f : α × βE (hf : ) :
MeasureTheory.StronglyMeasurable fun y => ∫ (x : α), f (x, y)μ

The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of) the symmetric version of Fubini's theorem is measurable.

### The product measure #

theorem MeasureTheory.Measure.integrable_measure_prod_mk_left {α : Type u_1} {β : Type u_3} [] [] {μ : } {ν : } {s : Set (α × β)} (hs : ) (h2s : ↑() s ) :
theorem MeasureTheory.AEStronglyMeasurable.prod_swap {α : Type u_1} {β : Type u_3} [] [] {μ : } {ν : } {γ : Type u_7} [] {f : β × αγ} (hf : ) :
theorem MeasureTheory.AEStronglyMeasurable.fst {α : Type u_1} {β : Type u_3} [] [] {μ : } {ν : } {γ : Type u_7} [] {f : αγ} (hf : ) :
theorem MeasureTheory.AEStronglyMeasurable.snd {α : Type u_1} {β : Type u_3} [] [] {μ : } {ν : } {γ : Type u_7} [] {f : βγ} (hf : ) :
theorem MeasureTheory.AEStronglyMeasurable.integral_prod_right' {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] ⦃f : α × βE (hf : ) :
MeasureTheory.AEStronglyMeasurable (fun x => ∫ (y : β), f (x, y)ν) μ

The Bochner integral is a.e.-measurable. This shows that the integrand of (the right-hand-side of) Fubini's theorem is a.e.-measurable.

theorem MeasureTheory.AEStronglyMeasurable.prod_mk_left {α : Type u_1} {β : Type u_3} [] [] {μ : } {ν : } {γ : Type u_7} [] {f : α × βγ} (hf : ) :
∀ᵐ (x : α) ∂μ, MeasureTheory.AEStronglyMeasurable (fun y => f (x, y)) ν

### Integrability on a product #

theorem MeasureTheory.Integrable.swap {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE (hf : ) :
theorem MeasureTheory.integrable_swap_iff {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE :
theorem MeasureTheory.hasFiniteIntegral_prod_iff {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE (h1f : ) :
(∀ᵐ (x : α) ∂μ, MeasureTheory.HasFiniteIntegral fun y => f (x, y)) MeasureTheory.HasFiniteIntegral fun x => ∫ (y : β), f (x, y)ν
theorem MeasureTheory.hasFiniteIntegral_prod_iff' {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE (h1f : ) :
(∀ᵐ (x : α) ∂μ, MeasureTheory.HasFiniteIntegral fun y => f (x, y)) MeasureTheory.HasFiniteIntegral fun x => ∫ (y : β), f (x, y)ν
theorem MeasureTheory.integrable_prod_iff {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE (h1f : ) :
(∀ᵐ (x : α) ∂μ, MeasureTheory.Integrable fun y => f (x, y)) MeasureTheory.Integrable fun x => ∫ (y : β), f (x, y)ν

A binary function is integrable if the function y ↦ f (x, y) is integrable for almost every x and the function x ↦ ∫ ‖f (x, y)‖ dy is integrable.

theorem MeasureTheory.integrable_prod_iff' {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE (h1f : ) :
(∀ᵐ (y : β) ∂ν, MeasureTheory.Integrable fun x => f (x, y)) MeasureTheory.Integrable fun y => ∫ (x : α), f (x, y)μ

A binary function is integrable if the function x ↦ f (x, y) is integrable for almost every y and the function y ↦ ∫ ‖f (x, y)‖ dx is integrable.

theorem MeasureTheory.Integrable.prod_left_ae {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE (hf : ) :
∀ᵐ (y : β) ∂ν, MeasureTheory.Integrable fun x => f (x, y)
theorem MeasureTheory.Integrable.prod_right_ae {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE (hf : ) :
∀ᵐ (x : α) ∂μ, MeasureTheory.Integrable fun y => f (x, y)
theorem MeasureTheory.Integrable.integral_norm_prod_left {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE (hf : ) :
MeasureTheory.Integrable fun x => ∫ (y : β), f (x, y)ν
theorem MeasureTheory.Integrable.integral_norm_prod_right {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } ⦃f : α × βE (hf : ) :
MeasureTheory.Integrable fun y => ∫ (x : α), f (x, y)μ
theorem MeasureTheory.integrable_prod_mul {α : Type u_1} {β : Type u_3} [] [] {μ : } {ν : } {L : Type u_7} [] {f : αL} {g : βL} (hf : ) (hg : ) :
MeasureTheory.Integrable fun z => f z.fst * g z.snd
theorem MeasureTheory.Integrable.integral_prod_left {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] ⦃f : α × βE (hf : ) :
MeasureTheory.Integrable fun x => ∫ (y : β), f (x, y)ν
theorem MeasureTheory.Integrable.integral_prod_right {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] ⦃f : α × βE (hf : ) :
MeasureTheory.Integrable fun y => ∫ (x : α), f (x, y)μ

### The Bochner integral on a product #

theorem MeasureTheory.integral_prod_swap {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] (f : α × βE) (hf : ) :
∫ (z : β × α), f () = ∫ (z : α × β), f z

Some rules about the sum/difference of double integrals. They follow from integral_add, but we separate them out as separate lemmas, because they involve quite some steps.

theorem MeasureTheory.integral_fn_integral_add {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] {E' : Type u_7} [] [] ⦃f : α × βE ⦃g : α × βE (F : EE') (hf : ) (hg : ) :
∫ (x : α), F (∫ (y : β), f (x, y) + g (x, y)ν)μ = ∫ (x : α), F (∫ (y : β), f (x, y)ν + ∫ (y : β), g (x, y)ν)μ

Integrals commute with addition inside another integral. F can be any function.

theorem MeasureTheory.integral_fn_integral_sub {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] {E' : Type u_7} [] [] ⦃f : α × βE ⦃g : α × βE (F : EE') (hf : ) (hg : ) :
∫ (x : α), F (∫ (y : β), f (x, y) - g (x, y)ν)μ = ∫ (x : α), F (∫ (y : β), f (x, y)ν - ∫ (y : β), g (x, y)ν)μ

Integrals commute with subtraction inside another integral. F can be any measurable function.

theorem MeasureTheory.lintegral_fn_integral_sub {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] ⦃f : α × βE ⦃g : α × βE (F : EENNReal) (hf : ) (hg : ) :
∫⁻ (x : α), F (∫ (y : β), f (x, y) - g (x, y)ν)μ = ∫⁻ (x : α), F (∫ (y : β), f (x, y)ν - ∫ (y : β), g (x, y)ν)μ

Integrals commute with subtraction inside a lower Lebesgue integral. F can be any function.

theorem MeasureTheory.integral_integral_add {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] ⦃f : α × βE ⦃g : α × βE (hf : ) (hg : ) :
∫ (x : α), ∫ (y : β), f (x, y) + g (x, y)νμ = ∫ (x : α), ∫ (y : β), f (x, y)νμ + ∫ (x : α), ∫ (y : β), g (x, y)νμ

theorem MeasureTheory.integral_integral_add' {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] ⦃f : α × βE ⦃g : α × βE (hf : ) (hg : ) :
∫ (x : α), ∫ (y : β), ((α × βE) + (α × βE)) (α × βE) instHAdd f g (x, y)νμ = ∫ (x : α), ∫ (y : β), f (x, y)νμ + ∫ (x : α), ∫ (y : β), g (x, y)νμ

Double integrals commute with addition. This is the version with (f + g) (x, y) (instead of f (x, y) + g (x, y)) in the LHS.

theorem MeasureTheory.integral_integral_sub {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] ⦃f : α × βE ⦃g : α × βE (hf : ) (hg : ) :
∫ (x : α), ∫ (y : β), f (x, y) - g (x, y)νμ = ∫ (x : α), ∫ (y : β), f (x, y)νμ - ∫ (x : α), ∫ (y : β), g (x, y)νμ

Double integrals commute with subtraction.

theorem MeasureTheory.integral_integral_sub' {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] ⦃f : α × βE ⦃g : α × βE (hf : ) (hg : ) :
∫ (x : α), ∫ (y : β), ((α × βE) - (α × βE)) (α × βE) instHSub f g (x, y)νμ = ∫ (x : α), ∫ (y : β), f (x, y)νμ - ∫ (x : α), ∫ (y : β), g (x, y)νμ

Double integrals commute with subtraction. This is the version with (f - g) (x, y) (instead of f (x, y) - g (x, y)) in the LHS.

theorem MeasureTheory.continuous_integral_integral {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] :
Continuous fun f => ∫ (x : α), ∫ (y : β), f (x, y)νμ

The map that sends an L¹-function f : α × β → E to ∫∫f is continuous.

theorem MeasureTheory.integral_prod {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] (f : α × βE) :
∫ (z : α × β), f z = ∫ (x : α), ∫ (y : β), f (x, y)νμ

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 MeasureTheory.integral_prod_symm {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] (f : α × βE) (hf : ) :
∫ (z : α × β), f z = ∫ (y : β), ∫ (x : α), f (x, y)μν

Symmetric version of Fubini's Theorem: For integrable functions on α × β, the Bochner integral of f is equal to the iterated Bochner integral. This version has the integrals on the right-hand side in the other order.

theorem MeasureTheory.integral_integral {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] {f : αβE} (hf : ) :
∫ (x : α), ∫ (y : β), f x yνμ = ∫ (z : α × β), f z.fst z.snd

Reversed version of Fubini's Theorem.

theorem MeasureTheory.integral_integral_symm {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] {f : αβE} (hf : ) :
∫ (x : α), ∫ (y : β), f x yνμ = ∫ (z : β × α), f z.snd z.fst

Reversed version of Fubini's Theorem (symmetric version).

theorem MeasureTheory.integral_integral_swap {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] ⦃f : αβE (hf : ) :
∫ (x : α), ∫ (y : β), f x yνμ = ∫ (y : β), ∫ (x : α), f x yμν

Change the order of Bochner integration.

theorem MeasureTheory.set_integral_prod {α : Type u_1} {β : Type u_3} {E : Type u_6} [] [] {μ : } {ν : } [] [] (f : α × βE) {s : Set α} {t : Set β} (hf : MeasureTheory.IntegrableOn f (s ×ˢ t)) :
∫ (z : α × β) in s ×ˢ t, f z = ∫ (x : α) in s, ∫ (y : β) in t, f (x, y)νμ

Fubini's Theorem for set integrals.

theorem MeasureTheory.integral_prod_mul {α : Type u_1} {β : Type u_3} [] [] {μ : } {ν : } {L : Type u_8} [] (f : αL) (g : βL) :
∫ (z : α × β), f z.fst * g z.snd = (∫ (x : α), f xμ) * ∫ (y : β), g yν
theorem MeasureTheory.set_integral_prod_mul {α : Type u_1} {β : Type u_3} [] [] {μ : } {ν : } {L : Type u_8} [] (f : αL) (g : βL) (s : Set α) (t : Set β) :
∫ (z : α × β) in s ×ˢ t, f z.fst * g z.snd = (∫ (x : α) in s, f xμ) * ∫ (y : β) in t, g yν