Theorem: MeasureTheory.lintegral_comp_eq_lintegral_meas_le_mul_of_measurable
File: Mathlib/MeasureTheory/Integral/Layercake.lean

tactic: have integrand_eq :
  ∀ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) = ∫⁻ t in Ioc 0 (f ω), ENNReal.ofReal (g t) := by
  intro ω
  have g_ae_nn : 0 ≤ᵐ[volume.restrict (Ioc 0 (f ω))] g := by
    filter_upwards [self_mem_ae_restrict (measurableSet_Ioc : MeasurableSet (Ioc 0 (f ω)))] with x
      hx using g_nn x hx.1
  rw [← ofReal_integral_eq_lintegral_ofReal (g_intble' (f ω) (f_nn ω)).1 g_ae_nn]
  congr
  exact intervalIntegral.integral_of_le (f_nn ω)
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
⊢ (∫⁻ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) ∂μ) =
    ∫⁻ (t : ℝ) in Ioi 0, ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)

tactic: simp_rw [integrand_eq, ← lintegral_indicator (fun t => ENNReal.ofReal (g t)) measurableSet_Ioc]
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
⊢ (∫⁻ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) ∂μ) =
    ∫⁻ (t : ℝ) in Ioi 0, ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)

tactic: rw [← lintegral_indicator _ measurableSet_Ioi]
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
⊢ (∫⁻ (ω : α), ∫⁻ (a : ℝ), indicator (Ioc 0 (f ω)) (fun t => ENNReal.ofReal (g t)) a ∂μ) =
    ∫⁻ (t : ℝ) in Ioi 0, ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)

tactic: rw [lintegral_lintegral_swap]
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
⊢ (∫⁻ (ω : α), ∫⁻ (a : ℝ), indicator (Ioc 0 (f ω)) (fun t => ENNReal.ofReal (g t)) a ∂μ) =
    ∫⁻ (a : ℝ), indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) a

tactic: rw [aux₂]
state_before: case hf
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
aux₂ :
  (Function.uncurry fun x y => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) y) =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} fun p => ENNReal.ofReal (g p.snd)
⊢ AEMeasurable (Function.uncurry fun ω a => indicator (Ioc 0 (f ω)) (fun t => ENNReal.ofReal (g t)) a)

tactic: have mble := measurableSet_region_between_oc measurable_zero f_mble MeasurableSet.univ
state_before: case hf
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
aux₂ :
  (Function.uncurry fun x y => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) y) =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} fun p => ENNReal.ofReal (g p.snd)
⊢ AEMeasurable (indicator {p | p.snd ∈ Ioc 0 (f p.fst)} fun p => ENNReal.ofReal (g p.snd))

tactic: simp_rw [mem_univ, Pi.zero_apply, true_and_iff] at mble
state_before: case hf
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
aux₂ :
  (Function.uncurry fun x y => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) y) =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} fun p => ENNReal.ofReal (g p.snd)
mble : MeasurableSet {p | p.fst ∈ univ ∧ p.snd ∈ Ioc (OfNat.ofNat 0 p.fst) (f p.fst)}
⊢ AEMeasurable (indicator {p | p.snd ∈ Ioc 0 (f p.fst)} fun p => ENNReal.ofReal (g p.snd))

tactic: exact (ENNReal.measurable_ofReal.comp (g_mble.comp measurable_snd)).aemeasurable.indicator mble
state_before: case hf
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
aux₂ :
  (Function.uncurry fun x y => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) y) =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} fun p => ENNReal.ofReal (g p.snd)
mble : MeasurableSet {p | p.snd ∈ Ioc 0 (f p.fst)}
⊢ AEMeasurable (indicator {p | p.snd ∈ Ioc 0 (f p.fst)} fun p => ENNReal.ofReal (g p.snd))

tactic: intro t ht
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
⊢ ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t

tactic: cases' eq_or_lt_of_le ht with h h
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
t : ℝ
ht : 0 ≤ t
⊢ IntervalIntegrable g volume 0 t

tactic: simp [← h]
state_before: case inl
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
t : ℝ
ht : 0 ≤ t
h : 0 = t
⊢ IntervalIntegrable g volume 0 t

tactic: exact g_intble t h
state_before: case inr
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
t : ℝ
ht : 0 ≤ t
h : 0 < t
⊢ IntervalIntegrable g volume 0 t

tactic: intro ω
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
⊢ ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)

tactic: have g_ae_nn : 0 ≤ᵐ[volume.restrict (Ioc 0 (f ω))] g := by
  filter_upwards [self_mem_ae_restrict (measurableSet_Ioc : MeasurableSet (Ioc 0 (f ω)))] with x
    hx using g_nn x hx.1
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
ω : α
⊢ ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)

tactic: rw [← ofReal_integral_eq_lintegral_ofReal (g_intble' (f ω) (f_nn ω)).1 g_ae_nn]
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
ω : α
g_ae_nn : 0 ≤ᵐ[Measure.restrict volume (Ioc 0 (f ω))] g
⊢ ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)

tactic: congr
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
ω : α
g_ae_nn : 0 ≤ᵐ[Measure.restrict volume (Ioc 0 (f ω))] g
⊢ ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ENNReal.ofReal (∫ (x : ℝ) in Ioc 0 (f ω), g x)

tactic: exact intervalIntegral.integral_of_le (f_nn ω)
state_before: case e_r
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
ω : α
g_ae_nn : 0 ≤ᵐ[Measure.restrict volume (Ioc 0 (f ω))] g
⊢ (∫ (t : ℝ) in 0 ..f ω, g t) = ∫ (x : ℝ) in Ioc 0 (f ω), g x

tactic: filter_upwards [self_mem_ae_restrict (measurableSet_Ioc : MeasurableSet (Ioc 0 (f ω)))] with x
  hx using g_nn x hx.1
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
ω : α
⊢ 0 ≤ᵐ[Measure.restrict volume (Ioc 0 (f ω))] g

tactic: apply congr_arg
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
⊢ (∫⁻ (y : ℝ), ∫⁻ (x : α), indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) y ∂μ) =
    ∫⁻ (a : ℝ), indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) a

tactic: funext s
state_before: case h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
⊢ (fun y => ∫⁻ (x : α), indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) y ∂μ) = fun a =>
    indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) a

tactic: simp_rw [aux₁]
state_before: case h.h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ (∫⁻ (x : α), indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s ∂μ) =
    indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) s

tactic: rw [lintegral_const_mul']
state_before: case h.h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ (∫⁻ (x : α), ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x) ∂μ) =
    indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) s

tactic: swap
state_before: case h.h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ (ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * ∫⁻ (a : α), indicator (Ici s) (fun x => 1) (f a) ∂μ) =
    indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) s

case h.h.hr
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s ≠ ⊤

tactic: simp_rw [show
    (fun a => (Ici s).indicator (fun _ : ℝ => (1 : ℝ≥0∞)) (f a)) = fun a =>
      {a : α | s ≤ f a}.indicator (fun _ => 1) a
    by funext a; by_cases s ≤ f a <;> simp [h]]
state_before: case h.h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ (ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * ∫⁻ (a : α), indicator (Ici s) (fun x => 1) (f a) ∂μ) =
    indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) s

tactic: rw [lintegral_indicator]
state_before: case h.h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ (ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * ∫⁻ (a : α), indicator {a | s ≤ f a} (fun x => 1) a ∂μ) =
    indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) s

tactic: swap
state_before: case h.h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ (ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * ∫⁻ (a : α) in {a | s ≤ f a}, 1 ∂μ) =
    indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) s

case h.h.hs
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ MeasurableSet {a | s ≤ f a}

tactic: rw [lintegral_one, Measure.restrict_apply MeasurableSet.univ, univ_inter, indicator_mul_left,
  mul_assoc,
  show
    (Ioi 0).indicator (fun _x : ℝ => (1 : ℝ≥0∞)) s * μ {a : α | s ≤ f a} =
      (Ioi 0).indicator (fun _x : ℝ => 1 * μ {a : α | s ≤ f a}) s
    by by_cases 0 < s <;> simp [h]]
state_before: case h.h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ (ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * ∫⁻ (a : α) in {a | s ≤ f a}, 1 ∂μ) =
    indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a} * ENNReal.ofReal (g t)) s

tactic: simp_rw [mul_comm _ (ENNReal.ofReal _), one_mul]
state_before: case h.h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ ENNReal.ofReal (g s) * indicator (Ioi 0) (fun _x => 1 * ↑↑μ {a | s ≤ f a}) s =
    indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a}) s * ENNReal.ofReal (g s)

tactic: rfl
state_before: case h.h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ ENNReal.ofReal (g s) * indicator (Ioi 0) (fun _x => ↑↑μ {a | s ≤ f a}) s =
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun t => ↑↑μ {a | t ≤ f a}) s

tactic: funext a
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
⊢ (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)

tactic: by_cases s ∈ Ioc (0 : ℝ) (f a)
state_before: case h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
a : α
⊢ indicator (Ioc 0 (f a)) (fun t => ENNReal.ofReal (g t)) s =
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f a)

tactic: simp only [h, show s ∈ Ioi (0 : ℝ) from h.1, show f a ∈ Ici s from h.2, indicator_of_mem,
  mul_one]
state_before: case pos
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
a : α
h : s ∈ Ioc 0 (f a)
⊢ indicator (Ioc 0 (f a)) (fun t => ENNReal.ofReal (g t)) s =
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f a)

tactic: have h_copy := h
state_before: case neg
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
a : α
h : ¬s ∈ Ioc 0 (f a)
⊢ indicator (Ioc 0 (f a)) (fun t => ENNReal.ofReal (g t)) s =
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f a)

tactic: simp only [mem_Ioc, not_and, not_le] at h
state_before: case neg
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
a : α
h h_copy : ¬s ∈ Ioc 0 (f a)
⊢ indicator (Ioc 0 (f a)) (fun t => ENNReal.ofReal (g t)) s =
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f a)

tactic: by_cases h' : 0 < s
state_before: case neg
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
a : α
h_copy : ¬s ∈ Ioc 0 (f a)
h : 0 < s → f a < s
⊢ indicator (Ioc 0 (f a)) (fun t => ENNReal.ofReal (g t)) s =
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f a)

tactic: simp only [h_copy, h h', indicator_of_not_mem, not_false_iff, mem_Ici, not_le,
  MulZeroClass.mul_zero]
state_before: case pos
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
a : α
h_copy : ¬s ∈ Ioc 0 (f a)
h : 0 < s → f a < s
h' : 0 < s
⊢ indicator (Ioc 0 (f a)) (fun t => ENNReal.ofReal (g t)) s =
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f a)

tactic: have : s ∉ Ioi (0 : ℝ) := h'
state_before: case neg
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
a : α
h_copy : ¬s ∈ Ioc 0 (f a)
h : 0 < s → f a < s
h' : ¬0 < s
⊢ indicator (Ioc 0 (f a)) (fun t => ENNReal.ofReal (g t)) s =
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f a)

tactic: simp only [this, h', indicator_of_not_mem, not_false_iff, MulZeroClass.mul_zero,
  MulZeroClass.zero_mul, mem_Ioc, false_and_iff]
state_before: case neg
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
a : α
h_copy : ¬s ∈ Ioc 0 (f a)
h : 0 < s → f a < s
h' : ¬0 < s
this : ¬s ∈ Ioi 0
⊢ indicator (Ioc 0 (f a)) (fun t => ENNReal.ofReal (g t)) s =
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f a)

tactic: apply ENNReal.mul_ne_top ENNReal.ofReal_ne_top
state_before: case h.h.hr
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s ≠ ⊤

tactic: simp [indicator_apply, h]
state_before: case neg
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
h : ¬0 < s
⊢ indicator (Ioi 0) (fun x => 1) s ≠ ⊤

tactic: funext a
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ (fun a => indicator (Ici s) (fun x => 1) (f a)) = fun a => indicator {a | s ≤ f a} (fun x => 1) a

tactic: by_cases s ≤ f a <;> simp [h]
state_before: case h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
a : α
⊢ indicator (Ici s) (fun x => 1) (f a) = indicator {a | s ≤ f a} (fun x => 1) a

tactic: exact f_mble measurableSet_Ici
state_before: case h.h.hs
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ MeasurableSet {a | s ≤ f a}

tactic: by_cases 0 < s <;> simp [h]
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s✝ : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
s : ℝ
aux₁ :
  (fun x => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) s) = fun x =>
    ENNReal.ofReal (g s) * indicator (Ioi 0) (fun x => 1) s * indicator (Ici s) (fun x => 1) (f x)
⊢ indicator (Ioi 0) (fun _x => 1) s * ↑↑μ {a | s ≤ f a} = indicator (Ioi 0) (fun _x => 1 * ↑↑μ {a | s ≤ f a}) s

tactic: funext p
state_before: α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
⊢ (Function.uncurry fun x y => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) y) =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} fun p => ENNReal.ofReal (g p.snd)

tactic: cases p with | mk p_fst p_snd => ?_
state_before: case h
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
p : α × ℝ
⊢ Function.uncurry (fun x y => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) y) p =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} (fun p => ENNReal.ofReal (g p.snd)) p

tactic: rw [Function.uncurry_apply_pair]
state_before: case h.mk
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
p_fst : α
p_snd : ℝ
⊢ Function.uncurry (fun x y => indicator (Ioc 0 (f x)) (fun t => ENNReal.ofReal (g t)) y) (p_fst, p_snd) =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} (fun p => ENNReal.ofReal (g p.snd)) (p_fst, p_snd)

tactic: by_cases p_snd ∈ Ioc 0 (f p_fst)
state_before: case h.mk
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
p_fst : α
p_snd : ℝ
⊢ indicator (Ioc 0 (f p_fst)) (fun t => ENNReal.ofReal (g t)) p_snd =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} (fun p => ENNReal.ofReal (g p.snd)) (p_fst, p_snd)

tactic: have h' : (p_fst, p_snd) ∈ {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := h
state_before: case pos
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
p_fst : α
p_snd : ℝ
h : p_snd ∈ Ioc 0 (f p_fst)
⊢ indicator (Ioc 0 (f p_fst)) (fun t => ENNReal.ofReal (g t)) p_snd =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} (fun p => ENNReal.ofReal (g p.snd)) (p_fst, p_snd)

tactic: rw [Set.indicator_of_mem h', Set.indicator_of_mem h]
state_before: case pos
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
p_fst : α
p_snd : ℝ
h : p_snd ∈ Ioc 0 (f p_fst)
h' : (p_fst, p_snd) ∈ {p | p.snd ∈ Ioc 0 (f p.fst)}
⊢ indicator (Ioc 0 (f p_fst)) (fun t => ENNReal.ofReal (g t)) p_snd =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} (fun p => ENNReal.ofReal (g p.snd)) (p_fst, p_snd)

tactic: have h' : (p_fst, p_snd) ∉ {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := h
state_before: case neg
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
p_fst : α
p_snd : ℝ
h : ¬p_snd ∈ Ioc 0 (f p_fst)
⊢ indicator (Ioc 0 (f p_fst)) (fun t => ENNReal.ofReal (g t)) p_snd =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} (fun p => ENNReal.ofReal (g p.snd)) (p_fst, p_snd)

tactic: rw [Set.indicator_of_not_mem h', Set.indicator_of_not_mem h]
state_before: case neg
α : Type u_1
inst✝¹ : MeasurableSpace α
f : α → ℝ
g : ℝ → ℝ
s : Set α
μ : Measure α
inst✝ : SigmaFinite μ
f_nn : 0 ≤ f
f_mble : Measurable f
g_intble : ∀ (t : ℝ), t > 0 → IntervalIntegrable g volume 0 t
g_mble : Measurable g
g_nn : ∀ (t : ℝ), t > 0 → 0 ≤ g t
g_intble' : ∀ (t : ℝ), 0 ≤ t → IntervalIntegrable g volume 0 t
integrand_eq : ∀ (ω : α), ENNReal.ofReal (∫ (t : ℝ) in 0 ..f ω, g t) = ∫⁻ (t : ℝ) in Ioc 0 (f ω), ENNReal.ofReal (g t)
p_fst : α
p_snd : ℝ
h : ¬p_snd ∈ Ioc 0 (f p_fst)
h' : ¬(p_fst, p_snd) ∈ {p | p.snd ∈ Ioc 0 (f p.fst)}
⊢ indicator (Ioc 0 (f p_fst)) (fun t => ENNReal.ofReal (g t)) p_snd =
    indicator {p | p.snd ∈ Ioc 0 (f p.fst)} (fun p => ENNReal.ofReal (g p.snd)) (p_fst, p_snd)