-- 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
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

Tactic:
by_cases hμm : SigmaFinite (μ.trim hm)

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 : SigmaFinite (μ.trim hm)
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

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 : ¬SigmaFinite (μ.trim hm)
⊢ μ[f * g|m] =ᶠ[ae μ] 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 : SigmaFinite (μ.trim hm)
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

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 : ¬SigmaFinite (μ.trim hm)
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

Tactic:
swap

Result:
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 : ¬SigmaFinite (μ.trim hm)
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

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 : SigmaFinite (μ.trim hm)
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

Proof state:
case pos.intro.intro.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 α
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 : α) ∂μ.restrict (sets n), ‖(sets n).indicator f x‖ ≤ ↑n

Tactic:
filter_upwards with x

Result:
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

Proof state:
case pos.intro.intro.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 α
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))
⊢ μ.restrict (sets n)[(sets n).indicator f * g|m] =ᶠ[ae (μ.restrict (sets n))]
    (sets n).indicator f * μ.restrict (sets n)[g|m]

Tactic:
refine condExp_stronglyMeasurable_mul_of_bound hm (hf.indicator (h_meas n)) hg.integrableOn n ?_

Result:
case pos.intro.intro.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 α
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 : α) ∂μ.restrict (sets n), ‖(sets n).indicator f x‖ ≤ ↑n

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
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : ¬m ≤ m0
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

Tactic:
swap

Result:
case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
f g : α → ℝ
hf : StronglyMeasurable f
hfg : Integrable (f * g) μ
hg : Integrable g μ
hm : ¬m ≤ m0
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

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

Proof state:
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 : ¬SigmaFinite (μ.trim hm)
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

Tactic:
simp_rw [condExp_of_not_sigmaFinite hm hμm]

Result:
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 : ¬SigmaFinite (μ.trim hm)
⊢ 0 =ᶠ[ae μ] f * 0

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
⊢ μ[f * g|m] =ᶠ[ae μ] f * μ[g|m]

Tactic:
filter_upwards [this] with x hx

Result:
case 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
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
⊢ (μ[f * g|m]) x = (f * μ[g|m]) x

Proof state:
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

Tactic:
simp only [hxs, Set.indicator_of_not_mem, not_false_iff, _root_.norm_zero, Nat.cast_nonneg]

Result:
no goals