l3lab/ntp-mathlib huggingface dataset:
theorem _root_.MeasurableEmbedding.integrableAtFilter_iff_comap [MeasurableSpace β] {e : α → β}
    (he : MeasurableEmbedding e) {f : β → E} {μ : Measure β} :
    IntegrableAtFilter f (l.map e) μ ↔ IntegrableAtFilter (f ∘ e) l (μ.comap e) := by
  simp_rw [← he.integrableAtFilter_map_iff, IntegrableAtFilter, he.map_comap]
  constructor <;> rintro ⟨s, hs, int⟩
  · exact ⟨s, hs, int.mono_measure <| μ.restrict_le_self⟩
  · 

Proof state:
case mpr.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f✝ g : α → E
s✝ t : Set α
μ✝ ν : Measure α
l l' : Filter α
inst✝ : MeasurableSpace β
e : α → β
he : MeasurableEmbedding e
f : β → E
μ : Measure β
s : Set β
hs : s ∈ map e l
int : IntegrableOn f s
⊢ ∃ s ∈ map e l, IntegrableOn f s

Next tactic:
exact ⟨_, inter_mem hs range_mem_map, int.inter_of_restrict⟩
protected theorem IntegrableAtFilter.add {f g : α → E}
    (hf : IntegrableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
    IntegrableAtFilter (f + g) l μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
hf : IntegrableAtFilter f l
hg : IntegrableAtFilter g l
⊢ IntegrableAtFilter (f + g) l

Next tactic:
rcases hf with ⟨s, sl, hs⟩
protected theorem IntegrableAtFilter.add {f g : α → E}
    (hf : IntegrableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
    IntegrableAtFilter (f + g) l μ := by
  rcases hf with ⟨s, sl, hs⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
hg : IntegrableAtFilter g l
s : Set α
sl : s ∈ l
hs : IntegrableOn f s
⊢ IntegrableAtFilter (f + g) l

Next tactic:
rcases hg with ⟨t, tl, ht⟩
protected theorem IntegrableAtFilter.add {f g : α → E}
    (hf : IntegrableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
    IntegrableAtFilter (f + g) l μ := by
  rcases hf with ⟨s, sl, hs⟩
  rcases hg with ⟨t, tl, ht⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s✝ t✝ : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
s : Set α
sl : s ∈ l
hs : IntegrableOn f s
t : Set α
tl : t ∈ l
ht : IntegrableOn g t
⊢ IntegrableAtFilter (f + g) l

Next tactic:
refine ⟨s ∩ t, inter_mem sl tl, ?_⟩
protected theorem IntegrableAtFilter.add {f g : α → E}
    (hf : IntegrableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
    IntegrableAtFilter (f + g) l μ := by
  rcases hf with ⟨s, sl, hs⟩
  rcases hg with ⟨t, tl, ht⟩
  refine ⟨s ∩ t, inter_mem sl tl, ?_⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s✝ t✝ : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
s : Set α
sl : s ∈ l
hs : IntegrableOn f s
t : Set α
tl : t ∈ l
ht : IntegrableOn g t
⊢ IntegrableOn (f + g) (s ∩ t)

Next tactic:
exact (hs.mono_set (inter_subset_left _ _)).add (ht.mono_set (inter_subset_right _ _))
protected theorem IntegrableAtFilter.neg {f : α → E} (hf : IntegrableAtFilter f l μ) :
    IntegrableAtFilter (-f) l μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
f : α → E
hf : IntegrableAtFilter f l
⊢ IntegrableAtFilter (-f) l

Next tactic:
rcases hf with ⟨s, sl, hs⟩
protected theorem IntegrableAtFilter.neg {f : α → E} (hf : IntegrableAtFilter f l μ) :
    IntegrableAtFilter (-f) l μ := by
  rcases hf with ⟨s, sl, hs⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
f : α → E
s : Set α
sl : s ∈ l
hs : IntegrableOn f s
⊢ IntegrableAtFilter (-f) l

Next tactic:
exact ⟨s, sl, hs.neg⟩
protected theorem IntegrableAtFilter.sub {f g : α → E}
    (hf : IntegrableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
    IntegrableAtFilter (f - g) l μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
hf : IntegrableAtFilter f l
hg : IntegrableAtFilter g l
⊢ IntegrableAtFilter (f - g) l

Next tactic:
rw [sub_eq_add_neg]
protected theorem IntegrableAtFilter.sub {f g : α → E}
    (hf : IntegrableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
    IntegrableAtFilter (f - g) l μ := by
  rw [sub_eq_add_neg]
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
hf : IntegrableAtFilter f l
hg : IntegrableAtFilter g l
⊢ IntegrableAtFilter (f + -g) l

Next tactic:
exact hf.add hg.neg
protected theorem IntegrableAtFilter.smul {𝕜 : Type*} [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 E]
    [BoundedSMul 𝕜 E] {f : α → E} (hf : IntegrableAtFilter f l μ) (c : 𝕜) :
    IntegrableAtFilter (c • f) l μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁴ : MeasurableSpace α
inst✝³ : NormedAddCommGroup E
f✝ g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
𝕜 : Type u_5
inst✝² : NormedAddCommGroup 𝕜
inst✝¹ : SMulZeroClass 𝕜 E
inst✝ : BoundedSMul 𝕜 E
f : α → E
hf : IntegrableAtFilter f l
c : 𝕜
⊢ IntegrableAtFilter (c • f) l

Next tactic:
rcases hf with ⟨s, sl, hs⟩
protected theorem IntegrableAtFilter.smul {𝕜 : Type*} [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 E]
    [BoundedSMul 𝕜 E] {f : α → E} (hf : IntegrableAtFilter f l μ) (c : 𝕜) :
    IntegrableAtFilter (c • f) l μ := by
  rcases hf with ⟨s, sl, hs⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁴ : MeasurableSpace α
inst✝³ : NormedAddCommGroup E
f✝ g : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
𝕜 : Type u_5
inst✝² : NormedAddCommGroup 𝕜
inst✝¹ : SMulZeroClass 𝕜 E
inst✝ : BoundedSMul 𝕜 E
f : α → E
c : 𝕜
s : Set α
sl : s ∈ l
hs : IntegrableOn f s
⊢ IntegrableAtFilter (c • f) l

Next tactic:
exact ⟨s, sl, hs.smul c⟩
@[simp]
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
    IntegrableAtFilter f (l ⊓ μ.ae) μ ↔ IntegrableAtFilter f l μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l✝ l' l : Filter α
⊢ IntegrableAtFilter f (l ⊓ Measure.ae μ) ↔ IntegrableAtFilter f l

Next tactic:
refine' ⟨_, fun h => h.filter_mono inf_le_left⟩
@[simp]
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
    IntegrableAtFilter f (l ⊓ μ.ae) μ ↔ IntegrableAtFilter f l μ := by
  refine' ⟨_, fun h => h.filter_mono inf_le_left⟩
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l✝ l' l : Filter α
⊢ IntegrableAtFilter f (l ⊓ Measure.ae μ) → IntegrableAtFilter f l

Next tactic:
rintro ⟨s, ⟨t, ht, u, hu, rfl⟩, hf⟩
@[simp]
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
    IntegrableAtFilter f (l ⊓ μ.ae) μ ↔ IntegrableAtFilter f l μ := by
  refine' ⟨_, fun h => h.filter_mono inf_le_left⟩
  rintro ⟨s, ⟨t, ht, u, hu, rfl⟩, hf⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f g : α → E
s t✝ : Set α
μ ν : Measure α
l✝ l' l : Filter α
t : Set α
ht : t ∈ l
u : Set α
hu : u ∈ Measure.ae μ
hf : IntegrableOn f (t ∩ u)
⊢ IntegrableAtFilter f l

Next tactic:
refine' ⟨t, ht, _⟩
@[simp]
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
    IntegrableAtFilter f (l ⊓ μ.ae) μ ↔ IntegrableAtFilter f l μ := by
  refine' ⟨_, fun h => h.filter_mono inf_le_left⟩
  rintro ⟨s, ⟨t, ht, u, hu, rfl⟩, hf⟩
  refine' ⟨t, ht, _⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f g : α → E
s t✝ : Set α
μ ν : Measure α
l✝ l' l : Filter α
t : Set α
ht : t ∈ l
u : Set α
hu : u ∈ Measure.ae μ
hf : IntegrableOn f (t ∩ u)
⊢ IntegrableOn f t

Next tactic:
refine' hf.integrable.mono_measure fun v hv => _
@[simp]
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
    IntegrableAtFilter f (l ⊓ μ.ae) μ ↔ IntegrableAtFilter f l μ := by
  refine' ⟨_, fun h => h.filter_mono inf_le_left⟩
  rintro ⟨s, ⟨t, ht, u, hu, rfl⟩, hf⟩
  refine' ⟨t, ht, _⟩
  refine' hf.integrable.mono_measure fun v hv => _
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f g : α → E
s t✝ : Set α
μ ν : Measure α
l✝ l' l : Filter α
t : Set α
ht : t ∈ l
u : Set α
hu : u ∈ Measure.ae μ
hf : IntegrableOn f (t ∩ u)
v : Set α
hv : MeasurableSet v
⊢ ↑↑(Measure.restrict μ t) v ≤ ↑↑(Measure.restrict μ (t ∩ u)) v

Next tactic:
simp only [Measure.restrict_apply hv]
@[simp]
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
    IntegrableAtFilter f (l ⊓ μ.ae) μ ↔ IntegrableAtFilter f l μ := by
  refine' ⟨_, fun h => h.filter_mono inf_le_left⟩
  rintro ⟨s, ⟨t, ht, u, hu, rfl⟩, hf⟩
  refine' ⟨t, ht, _⟩
  refine' hf.integrable.mono_measure fun v hv => _
  simp only [Measure.restrict_apply hv]
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f g : α → E
s t✝ : Set α
μ ν : Measure α
l✝ l' l : Filter α
t : Set α
ht : t ∈ l
u : Set α
hu : u ∈ Measure.ae μ
hf : IntegrableOn f (t ∩ u)
v : Set α
hv : MeasurableSet v
⊢ ↑↑μ (v ∩ t) ≤ ↑↑μ (v ∩ (t ∩ u))

Next tactic:
refine' measure_mono_ae (mem_of_superset hu fun x hx => _)
@[simp]
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
    IntegrableAtFilter f (l ⊓ μ.ae) μ ↔ IntegrableAtFilter f l μ := by
  refine' ⟨_, fun h => h.filter_mono inf_le_left⟩
  rintro ⟨s, ⟨t, ht, u, hu, rfl⟩, hf⟩
  refine' ⟨t, ht, _⟩
  refine' hf.integrable.mono_measure fun v hv => _
  simp only [Measure.restrict_apply hv]
  refine' measure_mono_ae (mem_of_superset hu fun x hx => _)
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f g : α → E
s t✝ : Set α
μ ν : Measure α
l✝ l' l : Filter α
t : Set α
ht : t ∈ l
u : Set α
hu : u ∈ Measure.ae μ
hf : IntegrableOn f (t ∩ u)
v : Set α
hv : MeasurableSet v
x : α
hx : x ∈ u
⊢ x ∈ {x | (fun x => (v ∩ t) x ≤ (v ∩ (t ∩ u)) x) x}

Next tactic:
exact fun ⟨hv, ht⟩ => ⟨hv, ⟨ht, hx⟩⟩
/-- If `μ` is a measure finite at filter `l` and `f` is a function such that its norm is bounded
above at `l`, then `f` is integrable at `l`. -/
theorem Measure.FiniteAtFilter.integrableAtFilter {l : Filter α} [IsMeasurablyGenerated l]
    (hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l)
    (hf : l.IsBoundedUnder (· ≤ ·) (norm ∘ f)) : IntegrableAtFilter f l μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l✝ l' l : Filter α
inst✝ : IsMeasurablyGenerated l
hfm : StronglyMeasurableAtFilter f l
hμ : FiniteAtFilter μ l
hf : IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ f)
⊢ IntegrableAtFilter f l

Next tactic:
obtain ⟨C, hC⟩ : ∃ C, ∀ᶠ s in l.smallSets, ∀ x ∈ s, ‖f x‖ ≤ C :=
    hf.imp fun C hC => eventually_smallSets.2 ⟨_, hC, fun t => id⟩
/-- If `μ` is a measure finite at filter `l` and `f` is a function such that its norm is bounded
above at `l`, then `f` is integrable at `l`. -/
theorem Measure.FiniteAtFilter.integrableAtFilter {l : Filter α} [IsMeasurablyGenerated l]
    (hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l)
    (hf : l.IsBoundedUnder (· ≤ ·) (norm ∘ f)) : IntegrableAtFilter f l μ := by
  obtain ⟨C, hC⟩ : ∃ C, ∀ᶠ s in l.smallSets, ∀ x ∈ s, ‖f x‖ ≤ C :=
    hf.imp fun C hC => eventually_smallSets.2 ⟨_, hC, fun t => id⟩
  

Proof state:
case intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l✝ l' l : Filter α
inst✝ : IsMeasurablyGenerated l
hfm : StronglyMeasurableAtFilter f l
hμ : FiniteAtFilter μ l
hf : IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ f)
C : ℝ
hC : ∀ᶠ (s : Set α) in smallSets l, ∀ x ∈ s, ‖f x‖ ≤ C
⊢ IntegrableAtFilter f l

Next tactic:
rcases (hfm.eventually.and (hμ.eventually.and hC)).exists_measurable_mem_of_smallSets with
    ⟨s, hsl, hsm, hfm, hμ, hC⟩
/-- If `μ` is a measure finite at filter `l` and `f` is a function such that its norm is bounded
above at `l`, then `f` is integrable at `l`. -/
theorem Measure.FiniteAtFilter.integrableAtFilter {l : Filter α} [IsMeasurablyGenerated l]
    (hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l)
    (hf : l.IsBoundedUnder (· ≤ ·) (norm ∘ f)) : IntegrableAtFilter f l μ := by
  obtain ⟨C, hC⟩ : ∃ C, ∀ᶠ s in l.smallSets, ∀ x ∈ s, ‖f x‖ ≤ C :=
    hf.imp fun C hC => eventually_smallSets.2 ⟨_, hC, fun t => id⟩
  rcases (hfm.eventually.and (hμ.eventually.and hC)).exists_measurable_mem_of_smallSets with
    ⟨s, hsl, hsm, hfm, hμ, hC⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l✝ l' l : Filter α
inst✝ : IsMeasurablyGenerated l
hfm✝ : StronglyMeasurableAtFilter f l
hμ✝ : FiniteAtFilter μ l
hf : IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ f)
C : ℝ
hC✝ : ∀ᶠ (s : Set α) in smallSets l, ∀ x ∈ s, ‖f x‖ ≤ C
s : Set α
hsl : s ∈ l
hsm : MeasurableSet s
hfm : AEStronglyMeasurable f (restrict μ s)
hμ : ↑↑μ s < ⊤
hC : ∀ x ∈ s, ‖f x‖ ≤ C
⊢ IntegrableAtFilter f l

Next tactic:
refine' ⟨s, hsl, ⟨hfm, hasFiniteIntegral_restrict_of_bounded hμ (C := C) _⟩⟩
/-- If `μ` is a measure finite at filter `l` and `f` is a function such that its norm is bounded
above at `l`, then `f` is integrable at `l`. -/
theorem Measure.FiniteAtFilter.integrableAtFilter {l : Filter α} [IsMeasurablyGenerated l]
    (hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l)
    (hf : l.IsBoundedUnder (· ≤ ·) (norm ∘ f)) : IntegrableAtFilter f l μ := by
  obtain ⟨C, hC⟩ : ∃ C, ∀ᶠ s in l.smallSets, ∀ x ∈ s, ‖f x‖ ≤ C :=
    hf.imp fun C hC => eventually_smallSets.2 ⟨_, hC, fun t => id⟩
  rcases (hfm.eventually.and (hμ.eventually.and hC)).exists_measurable_mem_of_smallSets with
    ⟨s, hsl, hsm, hfm, hμ, hC⟩
  refine' ⟨s, hsl, ⟨hfm, hasFiniteIntegral_restrict_of_bounded hμ (C := C) _⟩⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l✝ l' l : Filter α
inst✝ : IsMeasurablyGenerated l
hfm✝ : StronglyMeasurableAtFilter f l
hμ✝ : FiniteAtFilter μ l
hf : IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ f)
C : ℝ
hC✝ : ∀ᶠ (s : Set α) in smallSets l, ∀ x ∈ s, ‖f x‖ ≤ C
s : Set α
hsl : s ∈ l
hsm : MeasurableSet s
hfm : AEStronglyMeasurable f (restrict μ s)
hμ : ↑↑μ s < ⊤
hC : ∀ x ∈ s, ‖f x‖ ≤ C
⊢ ∀ᵐ (x : α) ∂restrict μ s, ‖f x‖ ≤ C

Next tactic:
rw [ae_restrict_eq hsm, eventually_inf_principal]
/-- If `μ` is a measure finite at filter `l` and `f` is a function such that its norm is bounded
above at `l`, then `f` is integrable at `l`. -/
theorem Measure.FiniteAtFilter.integrableAtFilter {l : Filter α} [IsMeasurablyGenerated l]
    (hfm : StronglyMeasurableAtFilter f l μ) (hμ : μ.FiniteAtFilter l)
    (hf : l.IsBoundedUnder (· ≤ ·) (norm ∘ f)) : IntegrableAtFilter f l μ := by
  obtain ⟨C, hC⟩ : ∃ C, ∀ᶠ s in l.smallSets, ∀ x ∈ s, ‖f x‖ ≤ C :=
    hf.imp fun C hC => eventually_smallSets.2 ⟨_, hC, fun t => id⟩
  rcases (hfm.eventually.and (hμ.eventually.and hC)).exists_measurable_mem_of_smallSets with
    ⟨s, hsl, hsm, hfm, hμ, hC⟩
  refine' ⟨s, hsl, ⟨hfm, hasFiniteIntegral_restrict_of_bounded hμ (C := C) _⟩⟩
  rw [ae_restrict_eq hsm, eventually_inf_principal]
  

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l✝ l' l : Filter α
inst✝ : IsMeasurablyGenerated l
hfm✝ : StronglyMeasurableAtFilter f l
hμ✝ : FiniteAtFilter μ l
hf : IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ f)
C : ℝ
hC✝ : ∀ᶠ (s : Set α) in smallSets l, ∀ x ∈ s, ‖f x‖ ≤ C
s : Set α
hsl : s ∈ l
hsm : MeasurableSet s
hfm : AEStronglyMeasurable f (restrict μ s)
hμ : ↑↑μ s < ⊤
hC : ∀ x ∈ s, ‖f x‖ ≤ C
⊢ ∀ᵐ (x : α) ∂μ, x ∈ s → ‖f x‖ ≤ C

Next tactic:
exact eventually_of_forall hC
theorem integrable_add_of_disjoint {f g : α → E} (h : Disjoint (support f) (support g))
    (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
h : Disjoint (support f) (support g)
hf : StronglyMeasurable f
hg : StronglyMeasurable g
⊢ Integrable (f + g) ↔ Integrable f ∧ Integrable g

Next tactic:
refine' ⟨fun hfg => ⟨_, _⟩, fun h => h.1.add h.2⟩
theorem integrable_add_of_disjoint {f g : α → E} (h : Disjoint (support f) (support g))
    (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ := by
  refine' ⟨fun hfg => ⟨_, _⟩, fun h => h.1.add h.2⟩
  · 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
h : Disjoint (support f) (support g)
hf : StronglyMeasurable f
hg : StronglyMeasurable g
hfg : Integrable (f + g)
⊢ Integrable f

Next tactic:
rw [← indicator_add_eq_left h]
theorem integrable_add_of_disjoint {f g : α → E} (h : Disjoint (support f) (support g))
    (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ := by
  refine' ⟨fun hfg => ⟨_, _⟩, fun h => h.1.add h.2⟩
  · rw [← indicator_add_eq_left h]; 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
h : Disjoint (support f) (support g)
hf : StronglyMeasurable f
hg : StronglyMeasurable g
hfg : Integrable (f + g)
⊢ Integrable (indicator (support f) (f + g))

Next tactic:
exact hfg.indicator hf.measurableSet_support
theorem integrable_add_of_disjoint {f g : α → E} (h : Disjoint (support f) (support g))
    (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ := by
  refine' ⟨fun hfg => ⟨_, _⟩, fun h => h.1.add h.2⟩
  · rw [← indicator_add_eq_left h]; exact hfg.indicator hf.measurableSet_support
  · 

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
h : Disjoint (support f) (support g)
hf : StronglyMeasurable f
hg : StronglyMeasurable g
hfg : Integrable (f + g)
⊢ Integrable g

Next tactic:
rw [← indicator_add_eq_right h]
theorem integrable_add_of_disjoint {f g : α → E} (h : Disjoint (support f) (support g))
    (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ := by
  refine' ⟨fun hfg => ⟨_, _⟩, fun h => h.1.add h.2⟩
  · rw [← indicator_add_eq_left h]; exact hfg.indicator hf.measurableSet_support
  · rw [← indicator_add_eq_right h]; 

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f✝ g✝ : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
f g : α → E
h : Disjoint (support f) (support g)
hf : StronglyMeasurable f
hg : StronglyMeasurable g
hfg : Integrable (f + g)
⊢ Integrable (indicator (support g) (f + g))

Next tactic:
exact hfg.indicator hg.measurableSet_support
/-- A function which is continuous on a set `s` is almost everywhere measurable with respect to
`μ.restrict s`. -/
theorem ContinuousOn.aemeasurable [TopologicalSpace α] [OpensMeasurableSpace α] [MeasurableSpace β]
    [TopologicalSpace β] [BorelSpace β] {f : α → β} {s : Set α} {μ : Measure α}
    (hf : ContinuousOn f s) (hs : MeasurableSet s) : AEMeasurable f (μ.restrict s) := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁶ : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : TopologicalSpace α
inst✝³ : OpensMeasurableSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α → β
s : Set α
μ : Measure α
hf : ContinuousOn f s
hs : MeasurableSet s
⊢ AEMeasurable f

Next tactic:
nontriviality α
/-- A function which is continuous on a set `s` is almost everywhere measurable with respect to
`μ.restrict s`. -/
theorem ContinuousOn.aemeasurable [TopologicalSpace α] [OpensMeasurableSpace α] [MeasurableSpace β]
    [TopologicalSpace β] [BorelSpace β] {f : α → β} {s : Set α} {μ : Measure α}
    (hf : ContinuousOn f s) (hs : MeasurableSet s) : AEMeasurable f (μ.restrict s) := by
  nontriviality α; 

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁶ : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : TopologicalSpace α
inst✝³ : OpensMeasurableSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α → β
s : Set α
μ : Measure α
hf : ContinuousOn f s
hs : MeasurableSet s
✝ : Nontrivial α
⊢ AEMeasurable f

Next tactic:
inhabit α
/-- A function which is continuous on a set `s` is almost everywhere measurable with respect to
`μ.restrict s`. -/
theorem ContinuousOn.aemeasurable [TopologicalSpace α] [OpensMeasurableSpace α] [MeasurableSpace β]
    [TopologicalSpace β] [BorelSpace β] {f : α → β} {s : Set α} {μ : Measure α}
    (hf : ContinuousOn f s) (hs : MeasurableSet s) : AEMeasurable f (μ.restrict s) := by
  nontriviality α; inhabit α
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁶ : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : TopologicalSpace α
inst✝³ : OpensMeasurableSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α → β
s : Set α
μ : Measure α
hf : ContinuousOn f s
hs : MeasurableSet s
✝ : Nontrivial α
inhabited_h : Inhabited α
⊢ AEMeasurable f

Next tactic:
have : (Set.piecewise s f fun _ => f default) =ᵐ[μ.restrict s] f := piecewise_ae_eq_restrict hs
/-- A function which is continuous on a set `s` is almost everywhere measurable with respect to
`μ.restrict s`. -/
theorem ContinuousOn.aemeasurable [TopologicalSpace α] [OpensMeasurableSpace α] [MeasurableSpace β]
    [TopologicalSpace β] [BorelSpace β] {f : α → β} {s : Set α} {μ : Measure α}
    (hf : ContinuousOn f s) (hs : MeasurableSet s) : AEMeasurable f (μ.restrict s) := by
  nontriviality α; inhabit α
  have : (Set.piecewise s f fun _ => f default) =ᵐ[μ.restrict s] f := piecewise_ae_eq_restrict hs
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁶ : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : TopologicalSpace α
inst✝³ : OpensMeasurableSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α → β
s : Set α
μ : Measure α
hf : ContinuousOn f s
hs : MeasurableSet s
✝ : Nontrivial α
inhabited_h : Inhabited α
this : (Set.piecewise s f fun x => f default) =ᵐ[Measure.restrict μ s] f
⊢ AEMeasurable f

Next tactic:
refine' ⟨Set.piecewise s f fun _ => f default, _, this.symm⟩