-- Mathlib/MeasureTheory/Function/LocallyIntegrable.lean
theorem locallyIntegrableOn_iff_locallyIntegrable_restrict [OpensMeasurableSpace X]
    (hs : IsClosed s) : LocallyIntegrableOn f s μ ↔ LocallyIntegrable f (μ.restrict s)

Proof state:
case pos.intro.intro.intro.intro.intro
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
t : Set X
ht_nhds : t ∈ 𝓝[s] x
ht_int : IntegrableOn f t μ
u : Set X
hu_o : IsOpen u
hu_x : x ∈ u
hu_sub : u ∩ s ⊆ t
⊢ IntegrableOn f u (μ.restrict s)

Tactic:
rw [IntegrableOn, restrict_restrict hu_o.measurableSet]

Result:
case pos.intro.intro.intro.intro.intro
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
t : Set X
ht_nhds : t ∈ 𝓝[s] x
ht_int : IntegrableOn f t μ
u : Set X
hu_o : IsOpen u
hu_x : x ∈ u
hu_sub : u ∩ s ⊆ t
⊢ Integrable f (μ.restrict (u ∩ s))

Proof state:
case pos.intro.intro.intro.intro.intro
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
t : Set X
ht_nhds : t ∈ 𝓝[s] x
ht_int : IntegrableOn f t μ
u : Set X
hu_o : IsOpen u
hu_x : x ∈ u
hu_sub : u ∩ s ⊆ t
⊢ Integrable f (μ.restrict (u ∩ s))

Tactic:
exact ht_int.mono_set hu_sub

Result:
no goals

Proof state:
case pos.intro.intro.intro.intro.intro
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
t : Set X
ht_nhds : t ∈ 𝓝[s] x
ht_int : IntegrableOn f t μ
u : Set X
hu_o : IsOpen u
hu_x : x ∈ u
hu_sub : u ∩ s ⊆ t
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Tactic:
refine ⟨u, hu_o.mem_nhds hu_x, ?_⟩

Result:
case pos.intro.intro.intro.intro.intro
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
t : Set X
ht_nhds : t ∈ 𝓝[s] x
ht_int : IntegrableOn f t μ
u : Set X
hu_o : IsOpen u
hu_x : x ∈ u
hu_sub : u ∩ s ⊆ t
⊢ IntegrableOn f u (μ.restrict s)

Proof state:
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
⊢ LocallyIntegrableOn f s μ ↔ LocallyIntegrable f (μ.restrict s)

Tactic:
refine ⟨fun hf x => ?_, locallyIntegrableOn_of_locallyIntegrable_restrict⟩

Result:
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Proof state:
case pos
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Tactic:
obtain ⟨t, ht_nhds, ht_int⟩ := hf x h

Result:
case pos.intro.intro
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
t : Set X
ht_nhds : t ∈ 𝓝[s] x
ht_int : IntegrableOn f t μ
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Proof state:
case pos.intro.intro
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
t : Set X
ht_nhds : t ∈ 𝓝[s] x
ht_int : IntegrableOn f t μ
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Tactic:
obtain ⟨u, hu_o, hu_x, hu_sub⟩ := mem_nhdsWithin.mp ht_nhds

Result:
case pos.intro.intro.intro.intro.intro
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
t : Set X
ht_nhds : t ∈ 𝓝[s] x
ht_int : IntegrableOn f t μ
u : Set X
hu_o : IsOpen u
hu_x : x ∈ u
hu_sub : u ∩ s ⊆ t
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Proof state:
case neg
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsOpen sᶜ
hf : LocallyIntegrableOn f s μ
x : X
h : x ∉ s
⊢ IntegrableOn f ∅ μ

case neg
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsOpen sᶜ
hf : LocallyIntegrableOn f s μ
x : X
h : x ∉ s
⊢ MeasurableSet sᶜ

Tactic:
exacts [integrableOn_empty, hs.measurableSet]

Result:
no goals

Proof state:
case neg
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∉ s
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Tactic:
rw [← isOpen_compl_iff] at hs

Result:
case neg
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsOpen sᶜ
hf : LocallyIntegrableOn f s μ
x : X
h : x ∉ s
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Proof state:
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Tactic:
by_cases h : x ∈ s

Result:
case pos
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∈ s
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

case neg
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsClosed s
hf : LocallyIntegrableOn f s μ
x : X
h : x ∉ s
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Proof state:
case neg
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsOpen sᶜ
hf : LocallyIntegrableOn f s μ
x : X
h : x ∉ s
⊢ IntegrableAtFilter f (𝓝 x) (μ.restrict s)

Tactic:
refine ⟨sᶜ, hs.mem_nhds h, ?_⟩

Result:
case neg
X : Type u_1
E : Type u_3
inst✝³ : MeasurableSpace X
inst✝² : TopologicalSpace X
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : OpensMeasurableSpace X
hs : IsOpen sᶜ
hf : LocallyIntegrableOn f s μ
x : X
h : x ∉ s
⊢ IntegrableOn f sᶜ (μ.restrict s)