-- Mathlib/MeasureTheory/Function/ConditionalExpectation/Real.lean
theorem condExp_mul_of_stronglyMeasurable_left {f g : α → ℝ} (hf : StronglyMeasurable[m] f)
    (hfg : Integrable (f * g) μ) (hg : Integrable g μ) : μ[f * g|m] =ᵐ[μ] f * μ[g|m]

Proof state:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this✝ : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
n : ℕ
this : IsFiniteMeasure (μ.restrict (sets n))
x : α
hxs : x ∈ sets n
⊢ ‖(sets n).indicator f x‖ ≤ ↑n

Tactic:
simpa only [hxs, Set.indicator_of_mem] using h_norm n x hxs

Result:
no goals

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this✝ : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
this : ∀ᵐ (a : α) ∂μ, ∀ (i : ℕ), a ∈ sets i → (μ[f * g|m]) a = f a * (μ[g|m]) a
x : α
hx : ∀ (i : ℕ), x ∈ sets i → (μ[f * g|m]) x = f x * (μ[g|m]) x
⊢ x ∈ ⋃ i, sets i

Tactic:
rw [h_univ]

Result:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this✝ : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
this : ∀ᵐ (a : α) ∂μ, ∀ (i : ℕ), a ∈ sets i → (μ[f * g|m]) a = f a * (μ[g|m]) a
x : α
hx : ∀ (i : ℕ), x ∈ sets i → (μ[f * g|m]) x = f x * (μ[g|m]) x
⊢ x ∈ Set.univ

Proof state:
case h.intro
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this✝ : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
this : ∀ᵐ (a : α) ∂μ, ∀ (i : ℕ), a ∈ sets i → (μ[f * g|m]) a = f a * (μ[g|m]) a
x : α
hx : ∀ (i : ℕ), x ∈ sets i → (μ[f * g|m]) x = f x * (μ[g|m]) x
i : ℕ
hi : x ∈ sets i
⊢ (μ[f * g|m]) x = (f * μ[g|m]) x

Tactic:
exact hx i hi

Result:
no goals

Proof state:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this : SigmaFinite (μ.trim hm)
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

Tactic:
obtain ⟨sets, sets_prop, h_univ⟩ := hf.exists_spanning_measurableSet_norm_le hm μ

Result:
case pos.intro.intro
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
sets_prop : ∀ (n : ℕ), MeasurableSet (sets n) ∧ μ (sets n) < ⊤ ∧ ∀ x ∈ sets n, ‖f x‖ ≤ ↑n
h_univ : ⋃ i, sets i = Set.univ
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

Proof state:
case measure_univ_lt_top
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
n : ℕ
⊢ (μ.restrict (sets n)) Set.univ < ⊤

Tactic:
rw [Measure.restrict_apply_univ]

Result:
case measure_univ_lt_top
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
n : ℕ
⊢ μ (sets n) < ⊤

Proof state:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this✝ : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
this : ∀ᵐ (a : α) ∂μ, ∀ (i : ℕ), a ∈ sets i → (μ[f * g|m]) a = f a * (μ[g|m]) a
x : α
hx : ∀ (i : ℕ), x ∈ sets i → (μ[f * g|m]) x = f x * (μ[g|m]) x
⊢ ∃ i, x ∈ sets i

Tactic:
have h_mem : x ∈ ⋃ i, sets i := by rw [h_univ]; exact Set.mem_univ _

Result:
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this✝ : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
this : ∀ᵐ (a : α) ∂μ, ∀ (i : ℕ), a ∈ sets i → (μ[f * g|m]) a = f a * (μ[g|m]) a
x : α
hx : ∀ (i : ℕ), x ∈ sets i → (μ[f * g|m]) x = f x * (μ[g|m]) x
h_mem : x ∈ ⋃ i, sets i
⊢ ∃ i, x ∈ sets i

Proof state:
case pos.intro.intro.intro.intro.h
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this✝ : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
n : ℕ
this : IsFiniteMeasure (μ.restrict (sets n))
x : α
⊢ ‖(sets n).indicator f x‖ ≤ ↑n

Tactic:
by_cases hxs : x ∈ sets n

Result:
case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this✝ : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
n : ℕ
this : IsFiniteMeasure (μ.restrict (sets n))
x : α
hxs : x ∈ sets n
⊢ ‖(sets n).indicator f x‖ ≤ ↑n

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : m ≤ m0
hμm this✝ : SigmaFinite (μ.trim hm)
sets : ℕ → Set α
h_univ : ⋃ i, sets i = Set.univ
h_meas : ∀ (x : ℕ), MeasurableSet (sets x)
h_finite : ∀ (x : ℕ), μ (sets x) < ⊤
h_norm : ∀ (x : ℕ), ∀ x_1 ∈ sets x, ‖f x_1‖ ≤ ↑x
n : ℕ
this : IsFiniteMeasure (μ.restrict (sets n))
x : α
hxs : x ∉ sets n
⊢ ‖(sets n).indicator f x‖ ≤ ↑n