Theorem: MeasureTheory.locallyIntegrableOn_iff
File: Mathlib/MeasureTheory/Function/LocallyIntegrable.lean

tactic: refine' ⟨fun hf k hk => hf.integrableOn_compact_subset hk, fun hf x hx => _⟩
state_before: X : Type u_1
Y : Type ?u.120325
E : Type u_2
R : Type ?u.120331
inst✝⁶ : MeasurableSpace X
inst✝⁵ : TopologicalSpace X
inst✝⁴ : MeasurableSpace Y
inst✝³ : TopologicalSpace Y
inst✝² : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝¹ : LocallyCompactSpace X
inst✝ : T2Space X
hs : IsClosed s ∨ IsOpen s
⊢ LocallyIntegrableOn f s ↔ ∀ (k : Set X), k ⊆ s → IsCompact k → IntegrableOn f k

tactic: cases hs with
| inl hs =>
  exact
    let ⟨K, hK, h2K⟩ := exists_compact_mem_nhds x
    ⟨_, inter_mem_nhdsWithin s h2K,
      hf _ (inter_subset_left _ _)
        (isCompact_of_isClosed_subset hK (hs.inter hK.isClosed) (inter_subset_right _ _))⟩
| inr hs =>
  obtain ⟨K, hK, h2K, h3K⟩ := exists_compact_subset hs hx
  refine' ⟨K, _, hf K h3K hK⟩
  simpa only [IsOpen.nhdsWithin_eq hs hx, interior_eq_nhds'] using h2K
state_before: X : Type u_1
Y : Type ?u.120325
E : Type u_2
R : Type ?u.120331
inst✝⁶ : MeasurableSpace X
inst✝⁵ : TopologicalSpace X
inst✝⁴ : MeasurableSpace Y
inst✝³ : TopologicalSpace Y
inst✝² : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝¹ : LocallyCompactSpace X
inst✝ : T2Space X
hs : IsClosed s ∨ IsOpen s
hf : ∀ (k : Set X), k ⊆ s → IsCompact k → IntegrableOn f k
x : X
hx : x ∈ s
⊢ IntegrableAtFilter f (𝓝[s] x)

tactic: exact
  let ⟨K, hK, h2K⟩ := exists_compact_mem_nhds x
  ⟨_, inter_mem_nhdsWithin s h2K,
    hf _ (inter_subset_left _ _)
      (isCompact_of_isClosed_subset hK (hs.inter hK.isClosed) (inter_subset_right _ _))⟩
state_before: case inl
X : Type u_1
Y : Type ?u.120325
E : Type u_2
R : Type ?u.120331
inst✝⁶ : MeasurableSpace X
inst✝⁵ : TopologicalSpace X
inst✝⁴ : MeasurableSpace Y
inst✝³ : TopologicalSpace Y
inst✝² : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝¹ : LocallyCompactSpace X
inst✝ : T2Space X
hf : ∀ (k : Set X), k ⊆ s → IsCompact k → IntegrableOn f k
x : X
hx : x ∈ s
hs : IsClosed s
⊢ IntegrableAtFilter f (𝓝[s] x)

tactic: obtain ⟨K, hK, h2K, h3K⟩ := exists_compact_subset hs hx
state_before: case inr
X : Type u_1
Y : Type ?u.120325
E : Type u_2
R : Type ?u.120331
inst✝⁶ : MeasurableSpace X
inst✝⁵ : TopologicalSpace X
inst✝⁴ : MeasurableSpace Y
inst✝³ : TopologicalSpace Y
inst✝² : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝¹ : LocallyCompactSpace X
inst✝ : T2Space X
hf : ∀ (k : Set X), k ⊆ s → IsCompact k → IntegrableOn f k
x : X
hx : x ∈ s
hs : IsOpen s
⊢ IntegrableAtFilter f (𝓝[s] x)

tactic: refine' ⟨K, _, hf K h3K hK⟩
state_before: case inr.intro.intro.intro
X : Type u_1
Y : Type ?u.120325
E : Type u_2
R : Type ?u.120331
inst✝⁶ : MeasurableSpace X
inst✝⁵ : TopologicalSpace X
inst✝⁴ : MeasurableSpace Y
inst✝³ : TopologicalSpace Y
inst✝² : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝¹ : LocallyCompactSpace X
inst✝ : T2Space X
hf : ∀ (k : Set X), k ⊆ s → IsCompact k → IntegrableOn f k
x : X
hx : x ∈ s
hs : IsOpen s
K : Set X
hK : IsCompact K
h2K : x ∈ interior K
h3K : K ⊆ s
⊢ IntegrableAtFilter f (𝓝[s] x)

tactic: simpa only [IsOpen.nhdsWithin_eq hs hx, interior_eq_nhds'] using h2K
state_before: case inr.intro.intro.intro
X : Type u_1
Y : Type ?u.120325
E : Type u_2
R : Type ?u.120331
inst✝⁶ : MeasurableSpace X
inst✝⁵ : TopologicalSpace X
inst✝⁴ : MeasurableSpace Y
inst✝³ : TopologicalSpace Y
inst✝² : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝¹ : LocallyCompactSpace X
inst✝ : T2Space X
hf : ∀ (k : Set X), k ⊆ s → IsCompact k → IntegrableOn f k
x : X
hx : x ∈ s
hs : IsOpen s
K : Set X
hK : IsCompact K
h2K : x ∈ interior K
h3K : K ⊆ s
⊢ K ∈ 𝓝[s] x