l3lab/ntp-mathlib huggingface dataset:
/-- If an integrable function has zero integral on all closed sets, then it is zero
almost everwhere.-/
lemma ae_eq_zero_of_forall_set_integral_isClosed_eq_zero {μ : Measure β} {f : β → E}
    (hf : Integrable f μ) (h'f : ∀ (s : Set β), IsClosed s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  suffices : ∀ s, MeasurableSet s → ∫ x in s, f x ∂μ = 0
  · exact hf.ae_eq_zero_of_forall_set_integral_eq_zero (fun s hs _ ↦ this s hs)
  have A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0
      → ∫ (x : β) in tᶜ, f x ∂μ = 0 := by
    intro t t_meas ht
    have I : ∫ x, f x ∂μ = 0 := by rw [← integral_univ]; exact h'f _ isClosed_univ
    simpa [ht, I] using integral_add_compl t_meas hf
  

Proof state:
case this
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s t : Set α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝² : TopologicalSpace β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsClosed s → ∫ (x : β) in s, f x ∂μ = 0
A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0 → ∫ (x : β) in tᶜ, f x ∂μ = 0
⊢ ∀ (s : Set β), MeasurableSet s → ∫ (x : β) in s, f x ∂μ = 0

Next tactic:
intro s hs
/-- If an integrable function has zero integral on all closed sets, then it is zero
almost everwhere.-/
lemma ae_eq_zero_of_forall_set_integral_isClosed_eq_zero {μ : Measure β} {f : β → E}
    (hf : Integrable f μ) (h'f : ∀ (s : Set β), IsClosed s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  suffices : ∀ s, MeasurableSet s → ∫ x in s, f x ∂μ = 0
  · exact hf.ae_eq_zero_of_forall_set_integral_eq_zero (fun s hs _ ↦ this s hs)
  have A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0
      → ∫ (x : β) in tᶜ, f x ∂μ = 0 := by
    intro t t_meas ht
    have I : ∫ x, f x ∂μ = 0 := by rw [← integral_univ]; exact h'f _ isClosed_univ
    simpa [ht, I] using integral_add_compl t_meas hf
  intro s hs
  

Proof state:
case this
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t : Set α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝² : TopologicalSpace β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsClosed s → ∫ (x : β) in s, f x ∂μ = 0
A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0 → ∫ (x : β) in tᶜ, f x ∂μ = 0
s : Set β
hs : MeasurableSet s
⊢ ∫ (x : β) in s, f x ∂μ = 0

Next tactic:
refine MeasurableSet.induction_on_open (fun U hU ↦ ?_) A (fun g g_disj g_meas hg ↦ ?_) hs
/-- If an integrable function has zero integral on all closed sets, then it is zero
almost everwhere.-/
lemma ae_eq_zero_of_forall_set_integral_isClosed_eq_zero {μ : Measure β} {f : β → E}
    (hf : Integrable f μ) (h'f : ∀ (s : Set β), IsClosed s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  suffices : ∀ s, MeasurableSet s → ∫ x in s, f x ∂μ = 0
  · exact hf.ae_eq_zero_of_forall_set_integral_eq_zero (fun s hs _ ↦ this s hs)
  have A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0
      → ∫ (x : β) in tᶜ, f x ∂μ = 0 := by
    intro t t_meas ht
    have I : ∫ x, f x ∂μ = 0 := by rw [← integral_univ]; exact h'f _ isClosed_univ
    simpa [ht, I] using integral_add_compl t_meas hf
  intro s hs
  refine MeasurableSet.induction_on_open (fun U hU ↦ ?_) A (fun g g_disj g_meas hg ↦ ?_) hs
  · 

Proof state:
case this.refine_1
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t : Set α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝² : TopologicalSpace β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsClosed s → ∫ (x : β) in s, f x ∂μ = 0
A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0 → ∫ (x : β) in tᶜ, f x ∂μ = 0
s : Set β
hs : MeasurableSet s
U : Set β
hU : IsOpen U
⊢ ∫ (x : β) in U, f x ∂μ = 0

Next tactic:
rw [← compl_compl U]
/-- If an integrable function has zero integral on all closed sets, then it is zero
almost everwhere.-/
lemma ae_eq_zero_of_forall_set_integral_isClosed_eq_zero {μ : Measure β} {f : β → E}
    (hf : Integrable f μ) (h'f : ∀ (s : Set β), IsClosed s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  suffices : ∀ s, MeasurableSet s → ∫ x in s, f x ∂μ = 0
  · exact hf.ae_eq_zero_of_forall_set_integral_eq_zero (fun s hs _ ↦ this s hs)
  have A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0
      → ∫ (x : β) in tᶜ, f x ∂μ = 0 := by
    intro t t_meas ht
    have I : ∫ x, f x ∂μ = 0 := by rw [← integral_univ]; exact h'f _ isClosed_univ
    simpa [ht, I] using integral_add_compl t_meas hf
  intro s hs
  refine MeasurableSet.induction_on_open (fun U hU ↦ ?_) A (fun g g_disj g_meas hg ↦ ?_) hs
  · rw [← compl_compl U]
    

Proof state:
case this.refine_1
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t : Set α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝² : TopologicalSpace β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsClosed s → ∫ (x : β) in s, f x ∂μ = 0
A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0 → ∫ (x : β) in tᶜ, f x ∂μ = 0
s : Set β
hs : MeasurableSet s
U : Set β
hU : IsOpen U
⊢ ∫ (x : β) in Uᶜᶜ, f x ∂μ = 0

Next tactic:
exact A _ hU.measurableSet.compl (h'f _ hU.isClosed_compl)
/-- If an integrable function has zero integral on all closed sets, then it is zero
almost everwhere.-/
lemma ae_eq_zero_of_forall_set_integral_isClosed_eq_zero {μ : Measure β} {f : β → E}
    (hf : Integrable f μ) (h'f : ∀ (s : Set β), IsClosed s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  suffices : ∀ s, MeasurableSet s → ∫ x in s, f x ∂μ = 0
  · exact hf.ae_eq_zero_of_forall_set_integral_eq_zero (fun s hs _ ↦ this s hs)
  have A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0
      → ∫ (x : β) in tᶜ, f x ∂μ = 0 := by
    intro t t_meas ht
    have I : ∫ x, f x ∂μ = 0 := by rw [← integral_univ]; exact h'f _ isClosed_univ
    simpa [ht, I] using integral_add_compl t_meas hf
  intro s hs
  refine MeasurableSet.induction_on_open (fun U hU ↦ ?_) A (fun g g_disj g_meas hg ↦ ?_) hs
  · rw [← compl_compl U]
    exact A _ hU.measurableSet.compl (h'f _ hU.isClosed_compl)
  · 

Proof state:
case this.refine_2
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t : Set α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝² : TopologicalSpace β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsClosed s → ∫ (x : β) in s, f x ∂μ = 0
A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0 → ∫ (x : β) in tᶜ, f x ∂μ = 0
s : Set β
hs : MeasurableSet s
g : ℕ → Set β
g_disj : Pairwise (Disjoint on g)
g_meas : ∀ (i : ℕ), MeasurableSet (g i)
hg : ∀ (i : ℕ), ∫ (x : β) in g i, f x ∂μ = 0
⊢ ∫ (x : β) in ⋃ i, g i, f x ∂μ = 0

Next tactic:
rw [integral_iUnion g_meas g_disj hf.integrableOn]
/-- If an integrable function has zero integral on all closed sets, then it is zero
almost everwhere.-/
lemma ae_eq_zero_of_forall_set_integral_isClosed_eq_zero {μ : Measure β} {f : β → E}
    (hf : Integrable f μ) (h'f : ∀ (s : Set β), IsClosed s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  suffices : ∀ s, MeasurableSet s → ∫ x in s, f x ∂μ = 0
  · exact hf.ae_eq_zero_of_forall_set_integral_eq_zero (fun s hs _ ↦ this s hs)
  have A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0
      → ∫ (x : β) in tᶜ, f x ∂μ = 0 := by
    intro t t_meas ht
    have I : ∫ x, f x ∂μ = 0 := by rw [← integral_univ]; exact h'f _ isClosed_univ
    simpa [ht, I] using integral_add_compl t_meas hf
  intro s hs
  refine MeasurableSet.induction_on_open (fun U hU ↦ ?_) A (fun g g_disj g_meas hg ↦ ?_) hs
  · rw [← compl_compl U]
    exact A _ hU.measurableSet.compl (h'f _ hU.isClosed_compl)
  · rw [integral_iUnion g_meas g_disj hf.integrableOn]
    

Proof state:
case this.refine_2
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t : Set α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝² : TopologicalSpace β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsClosed s → ∫ (x : β) in s, f x ∂μ = 0
A : ∀ (t : Set β), MeasurableSet t → ∫ (x : β) in t, f x ∂μ = 0 → ∫ (x : β) in tᶜ, f x ∂μ = 0
s : Set β
hs : MeasurableSet s
g : ℕ → Set β
g_disj : Pairwise (Disjoint on g)
g_meas : ∀ (i : ℕ), MeasurableSet (g i)
hg : ∀ (i : ℕ), ∫ (x : β) in g i, f x ∂μ = 0
⊢ ∑' (n : ℕ), ∫ (a : β) in g n, f a ∂μ = 0

Next tactic:
simp [hg]
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s t : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
⊢ f =ᵐ[μ] 0

Next tactic:
apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
⊢ ∫ (x : β) in s, f x ∂μ = 0

Next tactic:
let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
  

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t✝ : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
t : ℕ → Set β := fun n => compactCovering β n ∩ s
⊢ ∫ (x : β) in s, f x ∂μ = 0

Next tactic:
suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ))
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
  suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ))
  · 

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t✝ : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
t : ℕ → Set β := fun n => compactCovering β n ∩ s
H : Tendsto (fun n => ∫ (x : β) in t n, f x ∂μ) atTop (𝓝 (∫ (x : β) in s, f x ∂μ))
⊢ ∫ (x : β) in s, f x ∂μ = 0

Next tactic:
have A : ∀ n, ∫ x in t n, f x ∂μ = 0 :=
      fun n ↦ h'f _ (IsCompact.inter_right (isCompact_compactCovering β n) hs)
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
  suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ))
  · have A : ∀ n, ∫ x in t n, f x ∂μ = 0 :=
      fun n ↦ h'f _ (IsCompact.inter_right (isCompact_compactCovering β n) hs)
    

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t✝ : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
t : ℕ → Set β := fun n => compactCovering β n ∩ s
H : Tendsto (fun n => ∫ (x : β) in t n, f x ∂μ) atTop (𝓝 (∫ (x : β) in s, f x ∂μ))
A : ∀ (n : ℕ), ∫ (x : β) in t n, f x ∂μ = 0
⊢ ∫ (x : β) in s, f x ∂μ = 0

Next tactic:
simp_rw [A, tendsto_const_nhds_iff] at H
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
  suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ))
  · have A : ∀ n, ∫ x in t n, f x ∂μ = 0 :=
      fun n ↦ h'f _ (IsCompact.inter_right (isCompact_compactCovering β n) hs)
    simp_rw [A, tendsto_const_nhds_iff] at H
    

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t✝ : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
t : ℕ → Set β := fun n => compactCovering β n ∩ s
A : ∀ (n : ℕ), ∫ (x : β) in t n, f x ∂μ = 0
H : 0 = ∫ (x : β) in s, f x ∂μ
⊢ ∫ (x : β) in s, f x ∂μ = 0

Next tactic:
exact H.symm
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
  suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ))
  · have A : ∀ n, ∫ x in t n, f x ∂μ = 0 :=
      fun n ↦ h'f _ (IsCompact.inter_right (isCompact_compactCovering β n) hs)
    simp_rw [A, tendsto_const_nhds_iff] at H
    exact H.symm
  

Proof state:
case H
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t✝ : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
t : ℕ → Set β := fun n => compactCovering β n ∩ s
⊢ Tendsto (fun n => ∫ (x : β) in t n, f x ∂μ) atTop (𝓝 (∫ (x : β) in s, f x ∂μ))

Next tactic:
have B : s = ⋃ n, t n := by rw [← Set.iUnion_inter, iUnion_compactCovering, Set.univ_inter]
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
  suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ))
  · have A : ∀ n, ∫ x in t n, f x ∂μ = 0 :=
      fun n ↦ h'f _ (IsCompact.inter_right (isCompact_compactCovering β n) hs)
    simp_rw [A, tendsto_const_nhds_iff] at H
    exact H.symm
  have B : s = ⋃ n, t n := by 

Proof state:
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t✝ : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
t : ℕ → Set β := fun n => compactCovering β n ∩ s
⊢ s = ⋃ n, t n

Next tactic:
rw [← Set.iUnion_inter, iUnion_compactCovering, Set.univ_inter]
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
  suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ))
  · have A : ∀ n, ∫ x in t n, f x ∂μ = 0 :=
      fun n ↦ h'f _ (IsCompact.inter_right (isCompact_compactCovering β n) hs)
    simp_rw [A, tendsto_const_nhds_iff] at H
    exact H.symm
  have B : s = ⋃ n, t n := by rw [← Set.iUnion_inter, iUnion_compactCovering, Set.univ_inter]
  

Proof state:
case H
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t✝ : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
t : ℕ → Set β := fun n => compactCovering β n ∩ s
B : s = ⋃ n, t n
⊢ Tendsto (fun n => ∫ (x : β) in t n, f x ∂μ) atTop (𝓝 (∫ (x : β) in s, f x ∂μ))

Next tactic:
rw [B]
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
  suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ))
  · have A : ∀ n, ∫ x in t n, f x ∂μ = 0 :=
      fun n ↦ h'f _ (IsCompact.inter_right (isCompact_compactCovering β n) hs)
    simp_rw [A, tendsto_const_nhds_iff] at H
    exact H.symm
  have B : s = ⋃ n, t n := by rw [← Set.iUnion_inter, iUnion_compactCovering, Set.univ_inter]
  rw [B]
  

Proof state:
case H
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t✝ : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
t : ℕ → Set β := fun n => compactCovering β n ∩ s
B : s = ⋃ n, t n
⊢ Tendsto (fun n => ∫ (x : β) in t n, f x ∂μ) atTop (𝓝 (∫ (x : β) in ⋃ n, t n, f x ∂μ))

Next tactic:
apply tendsto_set_integral_of_monotone
/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_set_integral_isCompact_eq_zero
    [SigmaCompactSpace β] [T2Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0 := by
  apply ae_eq_zero_of_forall_set_integral_isClosed_eq_zero hf (fun s hs ↦ ?_)
  let t : ℕ → Set β := fun n ↦ compactCovering β n ∩ s
  suffices H : Tendsto (fun n ↦ ∫ x in t n, f x ∂μ) atTop (𝓝 (∫ x in s, f x ∂μ))
  · have A : ∀ n, ∫ x in t n, f x ∂μ = 0 :=
      fun n ↦ h'f _ (IsCompact.inter_right (isCompact_compactCovering β n) hs)
    simp_rw [A, tendsto_const_nhds_iff] at H
    exact H.symm
  have B : s = ⋃ n, t n := by rw [← Set.iUnion_inter, iUnion_compactCovering, Set.univ_inter]
  rw [B]
  apply tendsto_set_integral_of_monotone
  · 

Proof state:
case H.hsm
α : Type u_1
E : Type u_2
m m0 : MeasurableSpace α
μ✝ : Measure α
s✝ t✝ : Set α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
p : ℝ≥0∞
β : Type u_3
inst✝⁴ : TopologicalSpace β
inst✝³ : MeasurableSpace β
inst✝² : BorelSpace β
inst✝¹ : SigmaCompactSpace β
inst✝ : T2Space β
μ : Measure β
f : β → E
hf : Integrable f
h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0
s : Set β
hs : IsClosed s
t : ℕ → Set β := fun n => compactCovering β n ∩ s
B : s = ⋃ n, t n
⊢ ∀ (i : ℕ), MeasurableSet (t i)

Next tactic:
intros n