Theorem: MeasureTheory.condexp_stronglyMeasurable_simpleFunc_mul
File: Mathlib/MeasureTheory/Function/ConditionalExpectation/Real.lean

tactic: apply @SimpleFunc.induction _ _ m _ (fun f => _)
  (fun c s hs => ?_) (fun g₁ g₂ _ h_eq₁ h_eq₂ => ?_) f
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
⊢ μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]
state_after: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ μ[↑(SimpleFunc.piecewise s hs (SimpleFunc.const α c) (SimpleFunc.const α 0)) * g|m] =ᶠ[ae μ]
    ↑(SimpleFunc.piecewise s hs (SimpleFunc.const α c) (SimpleFunc.const α 0)) * μ[g|m]

α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
⊢ μ[↑(g₁ + g₂) * g|m] =ᶠ[ae μ] ↑(g₁ + g₂) * μ[g|m]

tactic: intro s c f
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
⊢ ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
state_after: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f✝ : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
s : Set α
c : ℝ
f : α → ℝ
⊢ s.indicator (Function.const α c) * f = s.indicator (c • f)

tactic: ext1 x
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f✝ : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
s : Set α
c : ℝ
f : α → ℝ
⊢ s.indicator (Function.const α c) * f = s.indicator (c • f)
state_after: case h
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f✝ : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
s : Set α
c : ℝ
f : α → ℝ
x : α
⊢ (s.indicator (Function.const α c) * f) x = s.indicator (c • f) x

tactic: by_cases hx : x ∈ s
state_before: case h
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f✝ : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
s : Set α
c : ℝ
f : α → ℝ
x : α
⊢ (s.indicator (Function.const α c) * f) x = s.indicator (c • f) x
state_after: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f✝ : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
s : Set α
c : ℝ
f : α → ℝ
x : α
hx : x ∈ s
⊢ (s.indicator (Function.const α c) * f) x = s.indicator (c • f) x

case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f✝ : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
s : Set α
c : ℝ
f : α → ℝ
x : α
hx : x ∉ s
⊢ (s.indicator (Function.const α c) * f) x = s.indicator (c • f) x

tactic: simp only [hx, Pi.mul_apply, Set.indicator_of_mem, Pi.smul_apply, Algebra.id.smul_eq_mul,
  Function.const_apply]
state_before: case pos
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f✝ : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
s : Set α
c : ℝ
f : α → ℝ
x : α
hx : x ∈ s
⊢ (s.indicator (Function.const α c) * f) x = s.indicator (c • f) x
state_after: no goals

tactic: simp only [hx, Pi.mul_apply, Set.indicator_of_not_mem, not_false_iff, zero_mul]
state_before: case neg
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f✝ : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
s : Set α
c : ℝ
f : α → ℝ
x : α
hx : x ∉ s
⊢ (s.indicator (Function.const α c) * f) x = s.indicator (c • f) x
state_after: no goals

tactic: classical simp only [@SimpleFunc.const_zero _ _ m, @SimpleFunc.coe_piecewise _ _ m,
  @SimpleFunc.coe_const _ _ m, @SimpleFunc.coe_zero _ _ m, Set.piecewise_eq_indicator]
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ μ[↑(SimpleFunc.piecewise s hs (SimpleFunc.const α c) (SimpleFunc.const α 0)) * g|m] =ᶠ[ae μ]
    ↑(SimpleFunc.piecewise s hs (SimpleFunc.const α c) (SimpleFunc.const α 0)) * μ[g|m]
state_after: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ μ[s.indicator (Function.const α c) * g|m] =ᶠ[ae μ] s.indicator (Function.const α c) * μ[g|m]

tactic: rw [this, this]
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ μ[s.indicator (Function.const α c) * g|m] =ᶠ[ae μ] s.indicator (Function.const α c) * μ[g|m]
state_after: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ μ[s.indicator (c • g)|m] =ᶠ[ae μ] s.indicator (c • μ[g|m])

tactic: refine (condexp_indicator (hg.smul c) hs).trans ?_
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ μ[s.indicator (c • g)|m] =ᶠ[ae μ] s.indicator (c • μ[g|m])
state_after: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ s.indicator (μ[c • g|m]) =ᶠ[ae μ] s.indicator (c • μ[g|m])

tactic: filter_upwards [condexp_smul (m := m) (m0 := m0) c g] with x hx
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ s.indicator (μ[c • g|m]) =ᶠ[ae μ] s.indicator (c • μ[g|m])
state_after: case h
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
x : α
hx : (μ[c • g|m]) x = (c • μ[g|m]) x
⊢ s.indicator (μ[c • g|m]) x = s.indicator (c • μ[g|m]) x

tactic: classical simp_rw [Set.indicator_apply, hx]
state_before: case h
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
x : α
hx : (μ[c • g|m]) x = (c • μ[g|m]) x
⊢ s.indicator (μ[c • g|m]) x = s.indicator (c • μ[g|m]) x
state_after: no goals

tactic: simp only [@SimpleFunc.const_zero _ _ m, @SimpleFunc.coe_piecewise _ _ m,
@SimpleFunc.coe_const _ _ m, @SimpleFunc.coe_zero _ _ m, Set.piecewise_eq_indicator]
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ μ[↑(SimpleFunc.piecewise s hs (SimpleFunc.const α c) (SimpleFunc.const α 0)) * g|m] =ᶠ[ae μ]
    ↑(SimpleFunc.piecewise s hs (SimpleFunc.const α c) (SimpleFunc.const α 0)) * μ[g|m]
state_after: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
⊢ μ[s.indicator (Function.const α c) * g|m] =ᶠ[ae μ] s.indicator (Function.const α c) * μ[g|m]

tactic: simp_rw [Set.indicator_apply, hx]
state_before: case h
α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
c : ℝ
s : Set α
hs : MeasurableSet s
x : α
hx : (μ[c • g|m]) x = (c • μ[g|m]) x
⊢ s.indicator (μ[c • g|m]) x = s.indicator (c • μ[g|m]) x
state_after: no goals

tactic: have h_add := @SimpleFunc.coe_add _ _ m _ g₁ g₂
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
⊢ μ[↑(g₁ + g₂) * g|m] =ᶠ[ae μ] ↑(g₁ + g₂) * μ[g|m]
state_after: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
h_add : ↑(g₁ + g₂) = ↑g₁ + ↑g₂
⊢ μ[↑(g₁ + g₂) * g|m] =ᶠ[ae μ] ↑(g₁ + g₂) * μ[g|m]

tactic: calc
  μ[⇑(g₁ + g₂) * g|m] =ᵐ[μ] μ[(⇑g₁ + ⇑g₂) * g|m] := by
    refine condexp_congr_ae (EventuallyEq.mul ?_ EventuallyEq.rfl); rw [h_add]
  _ =ᵐ[μ] μ[⇑g₁ * g|m] + μ[⇑g₂ * g|m] := by
    rw [add_mul]; exact condexp_add (hg.simpleFunc_mul' hm _) (hg.simpleFunc_mul' hm _)
  _ =ᵐ[μ] ⇑g₁ * μ[g|m] + ⇑g₂ * μ[g|m] := EventuallyEq.add h_eq₁ h_eq₂
  _ =ᵐ[μ] ⇑(g₁ + g₂) * μ[g|m] := by rw [h_add, add_mul]
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
h_add : ↑(g₁ + g₂) = ↑g₁ + ↑g₂
⊢ μ[↑(g₁ + g₂) * g|m] =ᶠ[ae μ] ↑(g₁ + g₂) * μ[g|m]
state_after: no goals

tactic: refine condexp_congr_ae (EventuallyEq.mul ?_ EventuallyEq.rfl)
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
h_add : ↑(g₁ + g₂) = ↑g₁ + ↑g₂
⊢ μ[↑(g₁ + g₂) * g|m] =ᶠ[ae μ] μ[(↑g₁ + ↑g₂) * g|m]
state_after: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
h_add : ↑(g₁ + g₂) = ↑g₁ + ↑g₂
⊢ ↑(g₁ + g₂) =ᶠ[ae μ] ↑g₁ + ↑g₂

tactic: rw [h_add]
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
h_add : ↑(g₁ + g₂) = ↑g₁ + ↑g₂
⊢ ↑(g₁ + g₂) =ᶠ[ae μ] ↑g₁ + ↑g₂
state_after: no goals

tactic: rw [add_mul]
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
h_add : ↑(g₁ + g₂) = ↑g₁ + ↑g₂
⊢ μ[(↑g₁ + ↑g₂) * g|m] =ᶠ[ae μ] μ[↑g₁ * g|m] + μ[↑g₂ * g|m]
state_after: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
h_add : ↑(g₁ + g₂) = ↑g₁ + ↑g₂
⊢ μ[↑g₁ * g + ↑g₂ * g|m] =ᶠ[ae μ] μ[↑g₁ * g|m] + μ[↑g₂ * g|m]

tactic: exact condexp_add (hg.simpleFunc_mul' hm _) (hg.simpleFunc_mul' hm _)
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
h_add : ↑(g₁ + g₂) = ↑g₁ + ↑g₂
⊢ μ[↑g₁ * g + ↑g₂ * g|m] =ᶠ[ae μ] μ[↑g₁ * g|m] + μ[↑g₂ * g|m]
state_after: no goals

tactic: rw [h_add, add_mul]
state_before: α : Type u_1
m m0 : MeasurableSpace α
μ : Measure α
hm : m ≤ m0
f : SimpleFunc α ℝ
g : α → ℝ
hg : Integrable g μ
this : ∀ (s : Set α) (c : ℝ) (f : α → ℝ), s.indicator (Function.const α c) * f = s.indicator (c • f)
g₁ g₂ : SimpleFunc α ℝ
x✝ : Disjoint (Function.support ↑g₁) (Function.support ↑g₂)
h_eq₁ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₁
h_eq₂ : (fun f => μ[↑f * g|m] =ᶠ[ae μ] ↑f * μ[g|m]) g₂
h_add : ↑(g₁ + g₂) = ↑g₁ + ↑g₂
⊢ ↑g₁ * μ[g|m] + ↑g₂ * μ[g|m] =ᶠ[ae μ] ↑(g₁ + g₂) * μ[g|m]
state_after: no goals