Theorem: Filter.Tendsto.integral_sub_linear_isLittleO_ae
File: Mathlib/MeasureTheory/Integral/SetIntegral.lean

tactic: suffices : (fun s => (∫ x in s, f x ∂μ) - (μ s).toReal • b) =o[l.smallSets] fun s => (μ s).toReal
state_before: α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
⊢ (fun i => (∫ (x : α) in s i, f x ∂μ) - m i • b) =o[li] m

tactic: exact (this.comp_tendsto hs).congr'
  (hsμ.mono fun a ha => by dsimp only [Function.comp_apply] at ha ⊢; rw [ha]) hsμ
state_before: α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
this : (fun s => (∫ (x : α) in s, f x ∂μ) - ENNReal.toReal (↑↑μ s) • b) =o[smallSets l] fun s => ENNReal.toReal (↑↑μ s)
⊢ (fun i => (∫ (x : α) in s i, f x ∂μ) - m i • b) =o[li] m

case this
α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
⊢ (fun s => (∫ (x : α) in s, f x ∂μ) - ENNReal.toReal (↑↑μ s) • b) =o[smallSets l] fun s => ENNReal.toReal (↑↑μ s)

tactic: refine' isLittleO_iff.2 fun ε ε₀ => _
state_before: case this
α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
⊢ (fun s => (∫ (x : α) in s, f x ∂μ) - ENNReal.toReal (↑↑μ s) • b) =o[smallSets l] fun s => ENNReal.toReal (↑↑μ s)

tactic: have : ∀ᶠ s in l.smallSets, ∀ᶠ x in μ.ae, x ∈ s → f x ∈ closedBall b ε :=
  eventually_smallSets_eventually.2 (h.eventually <| closedBall_mem_nhds _ ε₀)
state_before: case this
α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
ε : ℝ
ε₀ : 0 < ε
⊢ ∀ᶠ (x : Set α) in smallSets l, ‖(∫ (x : α) in x, f x ∂μ) - ENNReal.toReal (↑↑μ x) • b‖ ≤ ε * ‖ENNReal.toReal (↑↑μ x)‖

tactic: filter_upwards [hμ.eventually, (hμ.integrableAtFilter_of_tendsto_ae hfm h).eventually,
  hfm.eventually, this]
state_before: case this
α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
ε : ℝ
ε₀ : 0 < ε
this : ∀ᶠ (s : Set α) in smallSets l, ∀ᵐ (x : α) ∂μ, x ∈ s → f x ∈ closedBall b ε
⊢ ∀ᶠ (x : Set α) in smallSets l, ‖(∫ (x : α) in x, f x ∂μ) - ENNReal.toReal (↑↑μ x) • b‖ ≤ ε * ‖ENNReal.toReal (↑↑μ x)‖

tactic: simp only [mem_closedBall, dist_eq_norm]
state_before: case h
α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
ε : ℝ
ε₀ : 0 < ε
this : ∀ᶠ (s : Set α) in smallSets l, ∀ᵐ (x : α) ∂μ, x ∈ s → f x ∈ closedBall b ε
⊢ ∀ (a : Set α),
    ↑↑μ a < ⊤ →
      IntegrableOn f a →
        AEStronglyMeasurable f (Measure.restrict μ a) →
          (∀ᵐ (x : α) ∂μ, x ∈ a → f x ∈ closedBall b ε) →
            ‖(∫ (x : α) in a, f x ∂μ) - ENNReal.toReal (↑↑μ a) • b‖ ≤ ε * ‖ENNReal.toReal (↑↑μ a)‖

tactic: intro s hμs h_integrable hfm h_norm
state_before: case h
α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
ε : ℝ
ε₀ : 0 < ε
this : ∀ᶠ (s : Set α) in smallSets l, ∀ᵐ (x : α) ∂μ, x ∈ s → f x ∈ closedBall b ε
⊢ ∀ (a : Set α),
    ↑↑μ a < ⊤ →
      IntegrableOn f a →
        AEStronglyMeasurable f (Measure.restrict μ a) →
          (∀ᵐ (x : α) ∂μ, x ∈ a → ‖f x - b‖ ≤ ε) →
            ‖(∫ (x : α) in a, f x ∂μ) - ENNReal.toReal (↑↑μ a) • b‖ ≤ ε * ‖ENNReal.toReal (↑↑μ a)‖

tactic: rw [← set_integral_const, ← integral_sub h_integrable (integrableOn_const.2 <| Or.inr hμs),
  Real.norm_eq_abs, abs_of_nonneg ENNReal.toReal_nonneg]
state_before: case h
α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm✝ : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s✝ : ι → Set α
li : Filter ι
hs : Tendsto s✝ li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s✝ i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s✝ i))) =ᶠ[li] m) _auto✝
ε : ℝ
ε₀ : 0 < ε
this : ∀ᶠ (s : Set α) in smallSets l, ∀ᵐ (x : α) ∂μ, x ∈ s → f x ∈ closedBall b ε
s : Set α
hμs : ↑↑μ s < ⊤
h_integrable : IntegrableOn f s
hfm : AEStronglyMeasurable f (Measure.restrict μ s)
h_norm : ∀ᵐ (x : α) ∂μ, x ∈ s → ‖f x - b‖ ≤ ε
⊢ ‖(∫ (x : α) in s, f x ∂μ) - ENNReal.toReal (↑↑μ s) • b‖ ≤ ε * ‖ENNReal.toReal (↑↑μ s)‖

tactic: exact norm_set_integral_le_of_norm_le_const_ae' hμs h_norm (hfm.sub aestronglyMeasurable_const)
state_before: case h
α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm✝ : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s✝ : ι → Set α
li : Filter ι
hs : Tendsto s✝ li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s✝ i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s✝ i))) =ᶠ[li] m) _auto✝
ε : ℝ
ε₀ : 0 < ε
this : ∀ᶠ (s : Set α) in smallSets l, ∀ᵐ (x : α) ∂μ, x ∈ s → f x ∈ closedBall b ε
s : Set α
hμs : ↑↑μ s < ⊤
h_integrable : IntegrableOn f s
hfm : AEStronglyMeasurable f (Measure.restrict μ s)
h_norm : ∀ᵐ (x : α) ∂μ, x ∈ s → ‖f x - b‖ ≤ ε
⊢ ‖∫ (a : α) in s, f a - b ∂μ‖ ≤ ε * ENNReal.toReal (↑↑μ s)

tactic: dsimp only [Function.comp_apply] at ha ⊢
state_before: α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
this : (fun s => (∫ (x : α) in s, f x ∂μ) - ENNReal.toReal (↑↑μ s) • b) =o[smallSets l] fun s => ENNReal.toReal (↑↑μ s)
a : ι
ha : (fun i => ENNReal.toReal (↑↑μ (s i))) a = m a
⊢ ((fun s => (∫ (x : α) in s, f x ∂μ) - ENNReal.toReal (↑↑μ s) • b) ∘ s) a =
    (fun i => (∫ (x : α) in s i, f x ∂μ) - m i • b) a

tactic: rw [ha]
state_before: α : Type u_2
β : Type ?u.355571
E : Type u_1
F : Type ?u.355577
inst✝⁴ : MeasurableSpace α
ι : Type u_3
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : MeasureTheory.Measure α
l : Filter α
inst✝ : IsMeasurablyGenerated l
f : α → E
b : E
h : Tendsto f (l ⊓ Measure.ae μ) (𝓝 b)
hfm : StronglyMeasurableAtFilter f l
hμ : Measure.FiniteAtFilter μ l
s : ι → Set α
li : Filter ι
hs : Tendsto s li (smallSets l)
m : optParam (ι → ℝ) fun i => ENNReal.toReal (↑↑μ (s i))
hsμ : autoParam ((fun i => ENNReal.toReal (↑↑μ (s i))) =ᶠ[li] m) _auto✝
this : (fun s => (∫ (x : α) in s, f x ∂μ) - ENNReal.toReal (↑↑μ s) • b) =o[smallSets l] fun s => ENNReal.toReal (↑↑μ s)
a : ι
ha : ENNReal.toReal (↑↑μ (s a)) = m a
⊢ (∫ (x : α) in s a, f x ∂μ) - ENNReal.toReal (↑↑μ (s a)) • b = (∫ (x : α) in s a, f x ∂μ) - m a • b