Theorem: MeasureTheory.LocallyIntegrableOn.aestronglyMeasurable
File: Mathlib/MeasureTheory/Function/LocallyIntegrable.lean

tactic: have : ∀ x : s, ∃ u, IsOpen u ∧ x.1 ∈ u ∧ IntegrableOn f (u ∩ s) μ := by
  rintro ⟨x, hx⟩
  rcases hf x hx with ⟨t, ht, h't⟩
  rcases mem_nhdsWithin.1 ht with ⟨u, u_open, x_mem, u_sub⟩
  refine' ⟨u, u_open, x_mem, h't.mono_set u_sub⟩
state_before: X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
⊢ AEStronglyMeasurable f (Measure.restrict μ s)

tactic: choose u u_open xu hu using this
state_before: X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
this : ∀ (x : ↑s), ∃ u, IsOpen u ∧ ↑x ∈ u ∧ IntegrableOn f (u ∩ s)
⊢ AEStronglyMeasurable f (Measure.restrict μ s)

tactic: obtain ⟨T, T_count, hT⟩ : ∃ T : Set s, T.Countable ∧ s = ⋃ i : T, u i ∩ s := by
  have : s ⊆ ⋃ x : s, u x := fun y hy => mem_iUnion_of_mem ⟨y, hy⟩ (xu ⟨y, hy⟩)
  obtain ⟨T, hT_count, hT_un⟩ := isOpen_iUnion_countable u u_open
  refine' ⟨T, hT_count, _⟩
  rw [← hT_un, biUnion_eq_iUnion] at this
  rw [← iUnion_inter, eq_comm, inter_eq_right_iff_subset]
  exact this
state_before: X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
⊢ AEStronglyMeasurable f (Measure.restrict μ s)

tactic: have : Countable T := countable_coe_iff.mpr T_count
state_before: case intro.intro
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
T : Set ↑s
T_count : Set.Countable T
hT : s = ⋃ (i : ↑T), u ↑i ∩ s
⊢ AEStronglyMeasurable f (Measure.restrict μ s)

tactic: rw [hT, aestronglyMeasurable_iUnion_iff]
state_before: case intro.intro
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
T : Set ↑s
T_count : Set.Countable T
hT : s = ⋃ (i : ↑T), u ↑i ∩ s
this : Countable ↑T
⊢ AEStronglyMeasurable f (Measure.restrict μ s)

tactic: exact fun i : T => (hu i).aestronglyMeasurable
state_before: case intro.intro
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
T : Set ↑s
T_count : Set.Countable T
hT : s = ⋃ (i : ↑T), u ↑i ∩ s
this : Countable ↑T
⊢ ∀ (i : ↑T), AEStronglyMeasurable f (Measure.restrict μ (u ↑i ∩ s))

tactic: rintro ⟨x, hx⟩
state_before: X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
⊢ ∀ (x : ↑s), ∃ u, IsOpen u ∧ ↑x ∈ u ∧ IntegrableOn f (u ∩ s)

tactic: rcases hf x hx with ⟨t, ht, h't⟩
state_before: case mk
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
x : X
hx : x ∈ s
⊢ ∃ u, IsOpen u ∧ ↑{ val := x, property := hx } ∈ u ∧ IntegrableOn f (u ∩ s)

tactic: rcases mem_nhdsWithin.1 ht with ⟨u, u_open, x_mem, u_sub⟩
state_before: case mk.intro.intro
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
x : X
hx : x ∈ s
t : Set X
ht : t ∈ 𝓝[s] x
h't : IntegrableOn f t
⊢ ∃ u, IsOpen u ∧ ↑{ val := x, property := hx } ∈ u ∧ IntegrableOn f (u ∩ s)

tactic: refine' ⟨u, u_open, x_mem, h't.mono_set u_sub⟩
state_before: case mk.intro.intro.intro.intro.intro
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
x : X
hx : x ∈ s
t : Set X
ht : t ∈ 𝓝[s] x
h't : IntegrableOn f t
u : Set X
u_open : IsOpen u
x_mem : x ∈ u
u_sub : u ∩ s ⊆ t
⊢ ∃ u, IsOpen u ∧ ↑{ val := x, property := hx } ∈ u ∧ IntegrableOn f (u ∩ s)

tactic: have : s ⊆ ⋃ x : s, u x := fun y hy => mem_iUnion_of_mem ⟨y, hy⟩ (xu ⟨y, hy⟩)
state_before: X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
⊢ ∃ T, Set.Countable T ∧ s = ⋃ (i : ↑T), u ↑i ∩ s

tactic: obtain ⟨T, hT_count, hT_un⟩ := isOpen_iUnion_countable u u_open
state_before: X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
this : s ⊆ ⋃ (x : ↑s), u x
⊢ ∃ T, Set.Countable T ∧ s = ⋃ (i : ↑T), u ↑i ∩ s

tactic: refine' ⟨T, hT_count, _⟩
state_before: case intro.intro
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
this : s ⊆ ⋃ (x : ↑s), u x
T : Set ↑s
hT_count : Set.Countable T
hT_un : (⋃ (i : ↑s) (_ : i ∈ T), u i) = ⋃ (i : ↑s), u i
⊢ ∃ T, Set.Countable T ∧ s = ⋃ (i : ↑T), u ↑i ∩ s

tactic: rw [← hT_un, biUnion_eq_iUnion] at this
state_before: case intro.intro
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
this : s ⊆ ⋃ (x : ↑s), u x
T : Set ↑s
hT_count : Set.Countable T
hT_un : (⋃ (i : ↑s) (_ : i ∈ T), u i) = ⋃ (i : ↑s), u i
⊢ s = ⋃ (i : ↑T), u ↑i ∩ s

tactic: rw [← iUnion_inter, eq_comm, inter_eq_right_iff_subset]
state_before: case intro.intro
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
T : Set ↑s
this : s ⊆ ⋃ (x : ↑T), u ↑x
hT_count : Set.Countable T
hT_un : (⋃ (i : ↑s) (_ : i ∈ T), u i) = ⋃ (i : ↑s), u i
⊢ s = ⋃ (i : ↑T), u ↑i ∩ s

tactic: exact this
state_before: case intro.intro
X : Type u_1
Y : Type ?u.117872
E : Type u_2
R : Type ?u.117878
inst✝⁵ : MeasurableSpace X
inst✝⁴ : TopologicalSpace X
inst✝³ : MeasurableSpace Y
inst✝² : TopologicalSpace Y
inst✝¹ : NormedAddCommGroup E
f : X → E
μ : Measure X
s : Set X
inst✝ : SecondCountableTopology X
hf : LocallyIntegrableOn f s
u : ↑s → Set X
u_open : ∀ (x : ↑s), IsOpen (u x)
xu : ∀ (x : ↑s), ↑x ∈ u x
hu : ∀ (x : ↑s), IntegrableOn f (u x ∩ s)
T : Set ↑s
this : s ⊆ ⋃ (x : ↑T), u ↑x
hT_count : Set.Countable T
hT_un : (⋃ (i : ↑s) (_ : i ∈ T), u i) = ⋃ (i : ↑s), u i
⊢ s ⊆ ⋃ (i : ↑T), u ↑i