l3lab/ntp-mathlib huggingface dataset:
instance (F : X.Sheaf CommRingCat.{w}) : Mono F.presheaf.toTotalQuotientPresheaf := by
  -- Porting note : was an `apply (config := { instances := false })`
  -- See https://github.com/leanprover/lean4/issues/2273
  suffices : ∀ (U : (Opens ↑X)ᵒᵖ), Mono (F.presheaf.toTotalQuotientPresheaf.app U)
  · apply NatTrans.mono_of_mono_app
  intro U
  apply ConcreteCategory.mono_of_injective
  dsimp [toTotalQuotientPresheaf, CommRingCat.ofHom]
  -- Porting note : this is a hack to make the `refine` below works
  set m := _
  change Function.Injective (algebraMap _ (Localization m))
  change Function.Injective (algebraMap (F.presheaf.obj U) _)
  haveI : IsLocalization _ (Localization m) := Localization.isLocalization
  -- Porting note : `M` and `S` need to be specified manually, so used a hack to save some typing
  refine IsLocalization.injective (M := m) (S := Localization m) ?_
  intro s hs t e
  apply section_ext F (unop U)
  intro x
  rw [map_zero]
  apply Submonoid.mem_iInf.mp hs x
  -- Porting note : added `dsimp` to make `rw [← map_mul]` work
  dsimp
  

Proof state:
case this.i.h.a
X : TopCat
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : ConcreteCategory C
F✝ : Presheaf CommRingCat X
G : SubmonoidPresheaf F✝
F : Sheaf CommRingCat X
U : (Opens ↑X)ᵒᵖ
m : Submonoid ((forget CommRingCat).obj ((Sheaf.presheaf F).obj U)) :=
  ⨅ x, Submonoid.comap (germ (Sheaf.presheaf F) x) (↑(stalk (Sheaf.presheaf F) ↑x))⁰
this : IsLocalization m (Localization m)
s : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
hs : s ∈ m
t : (forget CommRingCat).obj ((Sheaf.presheaf F).obj U)
e : t * s = 0
x : ↥U.unop
⊢ (germ (Sheaf.presheaf F) x) t * (germ (Sheaf.presheaf F) x) s = 0

Next tactic:
rw [← map_mul, e, map_zero]
@[simp]
theorem stronglyMeasurableAt_bot {f : α → β} : StronglyMeasurableAtFilter f ⊥ μ :=
  ⟨∅, mem_bot, by 

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace β
l l' : Filter α
f✝ g : α → β
μ ν : Measure α
f : α → β
⊢ AEStronglyMeasurable f (Measure.restrict μ ∅)

Next tactic:
simp
protected theorem MeasureTheory.AEStronglyMeasurable.stronglyMeasurableAtFilter
    (h : AEStronglyMeasurable f μ) : StronglyMeasurableAtFilter f l μ :=
  ⟨univ, univ_mem, by 

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace β
l l' : Filter α
f g : α → β
μ ν : Measure α
h : AEStronglyMeasurable f μ
⊢ AEStronglyMeasurable f (Measure.restrict μ univ)

Next tactic:
rwa [Measure.restrict_univ]
theorem hasFiniteIntegral_restrict_of_bounded [NormedAddCommGroup E] {f : α → E} {s : Set α}
    {μ : Measure α} {C} (hs : μ s < ∞) (hf : ∀ᵐ x ∂μ.restrict s, ‖f x‖ ≤ C) :
    HasFiniteIntegral f (μ.restrict s) :=
  haveI : IsFiniteMeasure (μ.restrict s) := ⟨by 

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝¹ : MeasurableSpace α
inst✝ : NormedAddCommGroup E
f : α → E
s : Set α
μ : Measure α
C : ℝ
hs : ↑↑μ s < ⊤
hf : ∀ᵐ (x : α) ∂Measure.restrict μ s, ‖f x‖ ≤ C
⊢ ↑↑(Measure.restrict μ s) univ < ⊤

Next tactic:
rwa [Measure.restrict_apply_univ]
@[simp]
theorem integrableOn_empty : IntegrableOn f ∅ μ := 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 α
⊢ IntegrableOn f ∅

Next tactic:
simp [IntegrableOn, integrable_zero_measure]
@[simp]
theorem integrableOn_univ : IntegrableOn f univ μ ↔ Integrable f μ := 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 α
⊢ IntegrableOn f univ ↔ Integrable f

Next tactic:
rw [IntegrableOn, Measure.restrict_univ]
@[simp]
theorem integrableOn_const {C : E} : IntegrableOn (fun _ => C) s μ ↔ C = 0 ∨ μ s < ∞ :=
  integrable_const_iff.trans <| 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 α
C : E
⊢ C = 0 ∨ ↑↑(Measure.restrict μ s) univ < ⊤ ↔ C = 0 ∨ ↑↑μ s < ⊤

Next tactic:
rw [Measure.restrict_apply_univ]
theorem IntegrableOn.restrict (h : IntegrableOn f s μ) (hs : MeasurableSet s) :
    IntegrableOn f s (μ.restrict t) := 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 α
h : IntegrableOn f s
hs : MeasurableSet s
⊢ IntegrableOn f s

Next tactic:
rw [IntegrableOn, Measure.restrict_restrict hs]
theorem IntegrableOn.restrict (h : IntegrableOn f s μ) (hs : MeasurableSet s) :
    IntegrableOn f s (μ.restrict t) := by
  rw [IntegrableOn, Measure.restrict_restrict hs]; 

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 α
h : IntegrableOn f s
hs : MeasurableSet s
⊢ Integrable f

Next tactic:
exact h.mono_set (inter_subset_left _ _)
theorem IntegrableOn.inter_of_restrict (h : IntegrableOn f s (μ.restrict t)) :
    IntegrableOn f (s ∩ t) μ := 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 α
h : IntegrableOn f s
⊢ IntegrableOn f (s ∩ t)

Next tactic:
have := h.mono_set (inter_subset_left s t)
theorem IntegrableOn.inter_of_restrict (h : IntegrableOn f s (μ.restrict t)) :
    IntegrableOn f (s ∩ t) μ := by
  have := h.mono_set (inter_subset_left s t)
  

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 α
h : IntegrableOn f s
this : IntegrableOn f (s ∩ t)
⊢ IntegrableOn f (s ∩ t)

Next tactic:
rwa [IntegrableOn, μ.restrict_restrict_of_subset (inter_subset_right s t)] at this
lemma Integrable.piecewise [DecidablePred (· ∈ s)]
    (hs : MeasurableSet s) (hf : IntegrableOn f s μ) (hg : IntegrableOn g sᶜ μ) :
    Integrable (s.piecewise f 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 α
inst✝ : DecidablePred fun x => x ∈ s
hs : MeasurableSet s
hf : IntegrableOn f s
hg : IntegrableOn g sᶜ
⊢ Integrable (Set.piecewise s f g)

Next tactic:
rw [IntegrableOn] at hf hg
lemma Integrable.piecewise [DecidablePred (· ∈ s)]
    (hs : MeasurableSet s) (hf : IntegrableOn f s μ) (hg : IntegrableOn g sᶜ μ) :
    Integrable (s.piecewise f g) μ := by
  rw [IntegrableOn] at hf hg
  

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 α
inst✝ : DecidablePred fun x => x ∈ s
hs : MeasurableSet s
hf : Integrable f
hg : Integrable g
⊢ Integrable (Set.piecewise s f g)

Next tactic:
rw [← memℒp_one_iff_integrable] at hf hg ⊢
lemma Integrable.piecewise [DecidablePred (· ∈ s)]
    (hs : MeasurableSet s) (hf : IntegrableOn f s μ) (hg : IntegrableOn g sᶜ μ) :
    Integrable (s.piecewise f g) μ := by
  rw [IntegrableOn] at hf hg
  rw [← memℒp_one_iff_integrable] at hf hg ⊢
  

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 α
inst✝ : DecidablePred fun x => x ∈ s
hs : MeasurableSet s
hf : Memℒp f 1
hg : Memℒp g 1
⊢ Memℒp (Set.piecewise s f g) 1

Next tactic:
exact Memℒp.piecewise hs hf hg
@[simp]
theorem integrableOn_singleton_iff {x : α} [MeasurableSingletonClass α] :
    IntegrableOn f {x} μ ↔ f x = 0 ∨ μ {x} < ∞ := 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 α
x : α
inst✝ : MeasurableSingletonClass α
⊢ IntegrableOn f {x} ↔ f x = 0 ∨ ↑↑μ {x} < ⊤

Next tactic:
have : f =ᵐ[μ.restrict {x}] fun _ => f x := by
    filter_upwards [ae_restrict_mem (measurableSet_singleton x)] with _ ha
    simp only [mem_singleton_iff.1 ha]
@[simp]
theorem integrableOn_singleton_iff {x : α} [MeasurableSingletonClass α] :
    IntegrableOn f {x} μ ↔ f x = 0 ∨ μ {x} < ∞ := by
  have : f =ᵐ[μ.restrict {x}] fun _ => f x := 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 α
x : α
inst✝ : MeasurableSingletonClass α
⊢ f =ᵐ[Measure.restrict μ {x}] fun x_1 => f x

Next tactic:
filter_upwards [ae_restrict_mem (measurableSet_singleton x)] with _ ha
@[simp]
theorem integrableOn_singleton_iff {x : α} [MeasurableSingletonClass α] :
    IntegrableOn f {x} μ ↔ f x = 0 ∨ μ {x} < ∞ := by
  have : f =ᵐ[μ.restrict {x}] fun _ => f x := by
    filter_upwards [ae_restrict_mem (measurableSet_singleton x)] with _ ha
    

Proof state:
case h
α : 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 α
x : α
inst✝ : MeasurableSingletonClass α
a✝ : α
ha : a✝ ∈ {x}
⊢ f a✝ = f x

Next tactic:
simp only [mem_singleton_iff.1 ha]
@[simp]
theorem integrableOn_singleton_iff {x : α} [MeasurableSingletonClass α] :
    IntegrableOn f {x} μ ↔ f x = 0 ∨ μ {x} < ∞ := by
  have : f =ᵐ[μ.restrict {x}] fun _ => f x := by
    filter_upwards [ae_restrict_mem (measurableSet_singleton x)] with _ ha
    simp only [mem_singleton_iff.1 ha]
  

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 α
x : α
inst✝ : MeasurableSingletonClass α
this : f =ᵐ[Measure.restrict μ {x}] fun x_1 => f x
⊢ IntegrableOn f {x} ↔ f x = 0 ∨ ↑↑μ {x} < ⊤

Next tactic:
rw [IntegrableOn, integrable_congr this, integrable_const_iff]
@[simp]
theorem integrableOn_singleton_iff {x : α} [MeasurableSingletonClass α] :
    IntegrableOn f {x} μ ↔ f x = 0 ∨ μ {x} < ∞ := by
  have : f =ᵐ[μ.restrict {x}] fun _ => f x := by
    filter_upwards [ae_restrict_mem (measurableSet_singleton x)] with _ ha
    simp only [mem_singleton_iff.1 ha]
  rw [IntegrableOn, integrable_congr this, integrable_const_iff]
  

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 α
x : α
inst✝ : MeasurableSingletonClass α
this : f =ᵐ[Measure.restrict μ {x}] fun x_1 => f x
⊢ f x = 0 ∨ ↑↑(Measure.restrict μ {x}) univ < ⊤ ↔ f x = 0 ∨ ↑↑μ {x} < ⊤

Next tactic:
simp
@[simp]
theorem integrableOn_finite_biUnion {s : Set β} (hs : s.Finite) {t : β → Set α} :
    IntegrableOn f (⋃ i ∈ s, t i) μ ↔ ∀ i ∈ s, IntegrableOn f (t i) μ := 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 α
s : Set β
hs : Set.Finite s
t : β → Set α
⊢ IntegrableOn f (⋃ i ∈ s, t i) ↔ ∀ i ∈ s, IntegrableOn f (t i)

Next tactic:
refine hs.induction_on ?_ ?_
@[simp]
theorem integrableOn_finite_biUnion {s : Set β} (hs : s.Finite) {t : β → Set α} :
    IntegrableOn f (⋃ i ∈ s, t i) μ ↔ ∀ i ∈ s, IntegrableOn f (t i) μ := by
  refine hs.induction_on ?_ ?_
  · 

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 α
s : Set β
hs : Set.Finite s
t : β → Set α
⊢ IntegrableOn f (⋃ i ∈ ∅, t i) ↔ ∀ i ∈ ∅, IntegrableOn f (t i)

Next tactic:
simp
@[simp]
theorem integrableOn_finite_biUnion {s : Set β} (hs : s.Finite) {t : β → Set α} :
    IntegrableOn f (⋃ i ∈ s, t i) μ ↔ ∀ i ∈ s, IntegrableOn f (t i) μ := by
  refine hs.induction_on ?_ ?_
  · simp
  · 

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 α
s : Set β
hs : Set.Finite s
t : β → Set α
⊢ ∀ {a : β} {s : Set β},
    a ∉ s →
      Set.Finite s →
        (IntegrableOn f (⋃ i ∈ s, t i) ↔ ∀ i ∈ s, IntegrableOn f (t i)) →
          (IntegrableOn f (⋃ i ∈ insert a s, t i) ↔ ∀ i ∈ insert a s, IntegrableOn f (t i))

Next tactic:
intro a s _ _ hf
@[simp]
theorem integrableOn_finite_biUnion {s : Set β} (hs : s.Finite) {t : β → Set α} :
    IntegrableOn f (⋃ i ∈ s, t i) μ ↔ ∀ i ∈ s, IntegrableOn f (t i) μ := by
  refine hs.induction_on ?_ ?_
  · simp
  · intro a s _ _ hf; 

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 α
s✝ : Set β
hs : Set.Finite s✝
t : β → Set α
a : β
s : Set β
a✝¹ : a ∉ s
a✝ : Set.Finite s
hf : IntegrableOn f (⋃ i ∈ s, t i) ↔ ∀ i ∈ s, IntegrableOn f (t i)
⊢ IntegrableOn f (⋃ i ∈ insert a s, t i) ↔ ∀ i ∈ insert a s, IntegrableOn f (t i)

Next tactic:
simp [hf, or_imp, forall_and]
@[simp]
theorem integrableOn_finite_iUnion [Finite β] {t : β → Set α} :
    IntegrableOn f (⋃ i, t i) μ ↔ ∀ i, IntegrableOn f (t i) μ := 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 α
inst✝ : Finite β
t : β → Set α
⊢ IntegrableOn f (⋃ i, t i) ↔ ∀ (i : β), IntegrableOn f (t i)

Next tactic:
cases nonempty_fintype β
@[simp]
theorem integrableOn_finite_iUnion [Finite β] {t : β → Set α} :
    IntegrableOn f (⋃ i, t i) μ ↔ ∀ i, IntegrableOn f (t i) μ := by
  cases nonempty_fintype β
  

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 α
inst✝ : Finite β
t : β → Set α
val✝ : Fintype β
⊢ IntegrableOn f (⋃ i, t i) ↔ ∀ (i : β), IntegrableOn f (t i)

Next tactic:
simpa using @integrableOn_finset_iUnion _ _ _ _ _ f μ Finset.univ t
theorem IntegrableOn.add_measure (hμ : IntegrableOn f s μ) (hν : IntegrableOn f s ν) :
    IntegrableOn f s (μ + ν) := 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 α
hμ : IntegrableOn f s
hν : IntegrableOn f s
⊢ IntegrableOn f s

Next tactic:
delta IntegrableOn
theorem IntegrableOn.add_measure (hμ : IntegrableOn f s μ) (hν : IntegrableOn f s ν) :
    IntegrableOn f s (μ + ν) := by
  delta IntegrableOn; 

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 α
hμ : IntegrableOn f s
hν : IntegrableOn f s
⊢ Integrable f

Next tactic:
rw [Measure.restrict_add]
theorem IntegrableOn.add_measure (hμ : IntegrableOn f s μ) (hν : IntegrableOn f s ν) :
    IntegrableOn f s (μ + ν) := by
  delta IntegrableOn; rw [Measure.restrict_add]; 

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 α
hμ : IntegrableOn f s
hν : IntegrableOn f s
⊢ Integrable f

Next tactic:
exact hμ.integrable.add_measure hν
theorem _root_.MeasurableEmbedding.integrableOn_map_iff [MeasurableSpace β] {e : α → β}
    (he : MeasurableEmbedding e) {f : β → E} {μ : Measure α} {s : Set β} :
    IntegrableOn f s (μ.map e) ↔ IntegrableOn (f ∘ e) (e ⁻¹' s) μ := 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 α
inst✝ : MeasurableSpace β
e : α → β
he : MeasurableEmbedding e
f : β → E
μ : Measure α
s : Set β
⊢ IntegrableOn f s ↔ IntegrableOn (f ∘ e) (e ⁻¹' s)

Next tactic:
simp_rw [IntegrableOn, he.restrict_map, he.integrable_map_iff]
theorem _root_.MeasurableEmbedding.integrableOn_iff_comap [MeasurableSpace β] {e : α → β}
    (he : MeasurableEmbedding e) {f : β → E} {μ : Measure β} {s : Set β} (hs : s ⊆ range e) :
    IntegrableOn f s μ ↔ IntegrableOn (f ∘ e) (e ⁻¹' s) (μ.comap e) := 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 α
inst✝ : MeasurableSpace β
e : α → β
he : MeasurableEmbedding e
f : β → E
μ : Measure β
s : Set β
hs : s ⊆ range e
⊢ IntegrableOn f s ↔ IntegrableOn (f ∘ e) (e ⁻¹' s)

Next tactic:
simp_rw [← he.integrableOn_map_iff, he.map_comap, IntegrableOn,
    Measure.restrict_restrict_of_subset hs]
theorem integrableOn_map_equiv [MeasurableSpace β] (e : α ≃ᵐ β) {f : β → E} {μ : Measure α}
    {s : Set β} : IntegrableOn f s (μ.map e) ↔ IntegrableOn (f ∘ e) (e ⁻¹' s) μ := 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 α
inst✝ : MeasurableSpace β
e : α ≃ᵐ β
f : β → E
μ : Measure α
s : Set β
⊢ IntegrableOn f s ↔ IntegrableOn (f ∘ ⇑e) (⇑e ⁻¹' s)

Next tactic:
simp only [IntegrableOn, e.restrict_map, integrable_map_equiv e]
theorem integrable_indicator_iff (hs : MeasurableSet s) :
    Integrable (indicator s f) μ ↔ IntegrableOn f s μ := 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 α
hs : MeasurableSet s
⊢ Integrable (indicator s f) ↔ IntegrableOn f s

Next tactic:
simp [IntegrableOn, Integrable, HasFiniteIntegral, nnnorm_indicator_eq_indicator_nnnorm,
    ENNReal.coe_indicator, lintegral_indicator _ hs, aestronglyMeasurable_indicator_iff hs]
theorem integrable_indicatorConstLp {E} [NormedAddCommGroup E] {p : ℝ≥0∞} {s : Set α}
    (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
    Integrable (indicatorConstLp p hs hμs c) μ := 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 α
E : Type u_5
inst✝ : NormedAddCommGroup E
p : ℝ≥0∞
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : E
⊢ Integrable ↑↑(indicatorConstLp p hs hμs c)

Next tactic:
rw [integrable_congr indicatorConstLp_coeFn, integrable_indicator_iff hs, IntegrableOn,
    integrable_const_iff, lt_top_iff_ne_top]
theorem integrable_indicatorConstLp {E} [NormedAddCommGroup E] {p : ℝ≥0∞} {s : Set α}
    (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
    Integrable (indicatorConstLp p hs hμs c) μ := by
  rw [integrable_congr indicatorConstLp_coeFn, integrable_indicator_iff hs, IntegrableOn,
    integrable_const_iff, lt_top_iff_ne_top]
  

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 α
E : Type u_5
inst✝ : NormedAddCommGroup E
p : ℝ≥0∞
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : E
⊢ c = 0 ∨ ↑↑(Measure.restrict μ s) univ ≠ ⊤

Next tactic:
right
theorem integrable_indicatorConstLp {E} [NormedAddCommGroup E] {p : ℝ≥0∞} {s : Set α}
    (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
    Integrable (indicatorConstLp p hs hμs c) μ := by
  rw [integrable_congr indicatorConstLp_coeFn, integrable_indicator_iff hs, IntegrableOn,
    integrable_const_iff, lt_top_iff_ne_top]
  right
  

Proof state:
case h
α : 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 α
E : Type u_5
inst✝ : NormedAddCommGroup E
p : ℝ≥0∞
s : Set α
hs : MeasurableSet s
hμs : ↑↑μ s ≠ ⊤
c : E
⊢ ↑↑(Measure.restrict μ s) univ ≠ ⊤

Next tactic:
simpa only [Set.univ_inter, MeasurableSet.univ, Measure.restrict_apply] using hμs
/-- If a function is integrable on a set `s` and nonzero there, then the measurable hull of `s` is
well behaved: the restriction of the measure to `toMeasurable μ s` coincides with its restriction
to `s`. -/
theorem IntegrableOn.restrict_toMeasurable (hf : IntegrableOn f s μ) (h's : ∀ x ∈ s, f x ≠ 0) :
    μ.restrict (toMeasurable μ s) = μ.restrict s := 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 α
hf : IntegrableOn f s
h's : ∀ x ∈ s, f x ≠ 0
⊢ Measure.restrict μ (toMeasurable μ s) = Measure.restrict μ s

Next tactic:
rcases exists_seq_strictAnti_tendsto (0 : ℝ) with ⟨u, _, u_pos, u_lim⟩
/-- If a function is integrable on a set `s` and nonzero there, then the measurable hull of `s` is
well behaved: the restriction of the measure to `toMeasurable μ s` coincides with its restriction
to `s`. -/
theorem IntegrableOn.restrict_toMeasurable (hf : IntegrableOn f s μ) (h's : ∀ x ∈ s, f x ≠ 0) :
    μ.restrict (toMeasurable μ s) = μ.restrict s := by
  rcases exists_seq_strictAnti_tendsto (0 : ℝ) with ⟨u, _, u_pos, u_lim⟩
  

Proof state:
case 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 α
hf : IntegrableOn f s
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
⊢ Measure.restrict μ (toMeasurable μ s) = Measure.restrict μ s

Next tactic:
let v n := toMeasurable (μ.restrict s) { x | u n ≤ ‖f x‖ }
/-- If a function is integrable on a set `s` and nonzero there, then the measurable hull of `s` is
well behaved: the restriction of the measure to `toMeasurable μ s` coincides with its restriction
to `s`. -/
theorem IntegrableOn.restrict_toMeasurable (hf : IntegrableOn f s μ) (h's : ∀ x ∈ s, f x ≠ 0) :
    μ.restrict (toMeasurable μ s) = μ.restrict s := by
  rcases exists_seq_strictAnti_tendsto (0 : ℝ) with ⟨u, _, u_pos, u_lim⟩
  let v n := toMeasurable (μ.restrict s) { x | u n ≤ ‖f x‖ }
  

Proof state:
case 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 α
hf : IntegrableOn f s
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (Measure.restrict μ s) {x | u n ≤ ‖f x‖}
⊢ Measure.restrict μ (toMeasurable μ s) = Measure.restrict μ s

Next tactic:
have A : ∀ n, μ (s ∩ v n) ≠ ∞ := by
    intro n
    rw [inter_comm, ← Measure.restrict_apply (measurableSet_toMeasurable _ _),
      measure_toMeasurable]
    exact (hf.measure_norm_ge_lt_top (u_pos n)).ne
/-- If a function is integrable on a set `s` and nonzero there, then the measurable hull of `s` is
well behaved: the restriction of the measure to `toMeasurable μ s` coincides with its restriction
to `s`. -/
theorem IntegrableOn.restrict_toMeasurable (hf : IntegrableOn f s μ) (h's : ∀ x ∈ s, f x ≠ 0) :
    μ.restrict (toMeasurable μ s) = μ.restrict s := by
  rcases exists_seq_strictAnti_tendsto (0 : ℝ) with ⟨u, _, u_pos, u_lim⟩
  let v n := toMeasurable (μ.restrict s) { x | u n ≤ ‖f x‖ }
  have A : ∀ n, μ (s ∩ v n) ≠ ∞ := 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 α
hf : IntegrableOn f s
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (Measure.restrict μ s) {x | u n ≤ ‖f x‖}
⊢ ∀ (n : ℕ), ↑↑μ (s ∩ v n) ≠ ⊤

Next tactic:
intro n
/-- If a function is integrable on a set `s` and nonzero there, then the measurable hull of `s` is
well behaved: the restriction of the measure to `toMeasurable μ s` coincides with its restriction
to `s`. -/
theorem IntegrableOn.restrict_toMeasurable (hf : IntegrableOn f s μ) (h's : ∀ x ∈ s, f x ≠ 0) :
    μ.restrict (toMeasurable μ s) = μ.restrict s := by
  rcases exists_seq_strictAnti_tendsto (0 : ℝ) with ⟨u, _, u_pos, u_lim⟩
  let v n := toMeasurable (μ.restrict s) { x | u n ≤ ‖f x‖ }
  have A : ∀ n, μ (s ∩ v n) ≠ ∞ := by
    intro n
    

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 α
hf : IntegrableOn f s
h's : ∀ x ∈ s, f x ≠ 0
u : ℕ → ℝ
left✝ : StrictAnti u
u_pos : ∀ (n : ℕ), 0 < u n
u_lim : Tendsto u atTop (𝓝 0)
v : ℕ → Set α := fun n => toMeasurable (Measure.restrict μ s) {x | u n ≤ ‖f x‖}
n : ℕ
⊢ ↑↑μ (s ∩ v n) ≠ ⊤

Next tactic:
rw [inter_comm, ← Measure.restrict_apply (measurableSet_toMeasurable _ _),
      measure_toMeasurable]