l3lab/ntp-mathlib huggingface dataset:
/-- One direction of the **Borel-Cantelli lemma** (sometimes called the "*first* Borel-Cantelli
lemma"): if (sᵢ) is a sequence of sets such that `∑ μ sᵢ` is finite, then the limit superior of the
`sᵢ` is a null set.

Note: for the *second* Borel-Cantelli lemma (applying to independent sets in a probability space),
see `ProbabilityTheory.measure_limsup_eq_one`. -/
theorem measure_limsup_eq_zero {s : ℕ → Set α} (hs : (∑' i, μ (s i)) ≠ ∞) :
    μ (limsup s atTop) = 0 := by
  -- First we replace the sequence `sₙ` with a sequence of measurable sets `tₙ ⊇ sₙ` of the same
  -- measure.
  set t : ℕ → Set α := fun n => toMeasurable μ (s n)
  have ht : (∑' i, μ (t i)) ≠ ∞ := by simpa only [measure_toMeasurable] using hs
  suffices μ (limsup t atTop) = 0 by
    have A : s ≤ t := fun n => subset_toMeasurable μ (s n)
    -- TODO default args fail
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
hs : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
t : ℕ → Set α := fun n => toMeasurable μ (s n)
ht : ∑' (i : ℕ), ↑↑μ (t i) ≠ ⊤
this : ↑↑μ (limsup t atTop) = 0
A : s ≤ t
⊢ ↑↑μ (limsup s atTop) = 0

Next tactic:
exact measure_mono_null (limsup_le_limsup (eventually_of_forall (Pi.le_def.mp A))) this
/-- One direction of the **Borel-Cantelli lemma** (sometimes called the "*first* Borel-Cantelli
lemma"): if (sᵢ) is a sequence of sets such that `∑ μ sᵢ` is finite, then the limit superior of the
`sᵢ` is a null set.

Note: for the *second* Borel-Cantelli lemma (applying to independent sets in a probability space),
see `ProbabilityTheory.measure_limsup_eq_one`. -/
theorem measure_limsup_eq_zero {s : ℕ → Set α} (hs : (∑' i, μ (s i)) ≠ ∞) :
    μ (limsup s atTop) = 0 := by
  -- First we replace the sequence `sₙ` with a sequence of measurable sets `tₙ ⊇ sₙ` of the same
  -- measure.
  set t : ℕ → Set α := fun n => toMeasurable μ (s n)
  have ht : (∑' i, μ (t i)) ≠ ∞ := by simpa only [measure_toMeasurable] using hs
  suffices μ (limsup t atTop) = 0 by
    have A : s ≤ t := fun n => subset_toMeasurable μ (s n)
    -- TODO default args fail
    exact measure_mono_null (limsup_le_limsup (eventually_of_forall (Pi.le_def.mp A))) this
  -- Next we unfold `limsup` for sets and replace equality with an inequality
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
hs : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
t : ℕ → Set α := fun n => toMeasurable μ (s n)
ht : ∑' (i : ℕ), ↑↑μ (t i) ≠ ⊤
⊢ ↑↑μ (limsup t atTop) = 0

Next tactic:
simp only [limsup_eq_iInf_iSup_of_nat', Set.iInf_eq_iInter, Set.iSup_eq_iUnion, ←
    nonpos_iff_eq_zero]
/-- One direction of the **Borel-Cantelli lemma** (sometimes called the "*first* Borel-Cantelli
lemma"): if (sᵢ) is a sequence of sets such that `∑ μ sᵢ` is finite, then the limit superior of the
`sᵢ` is a null set.

Note: for the *second* Borel-Cantelli lemma (applying to independent sets in a probability space),
see `ProbabilityTheory.measure_limsup_eq_one`. -/
theorem measure_limsup_eq_zero {s : ℕ → Set α} (hs : (∑' i, μ (s i)) ≠ ∞) :
    μ (limsup s atTop) = 0 := by
  -- First we replace the sequence `sₙ` with a sequence of measurable sets `tₙ ⊇ sₙ` of the same
  -- measure.
  set t : ℕ → Set α := fun n => toMeasurable μ (s n)
  have ht : (∑' i, μ (t i)) ≠ ∞ := by simpa only [measure_toMeasurable] using hs
  suffices μ (limsup t atTop) = 0 by
    have A : s ≤ t := fun n => subset_toMeasurable μ (s n)
    -- TODO default args fail
    exact measure_mono_null (limsup_le_limsup (eventually_of_forall (Pi.le_def.mp A))) this
  -- Next we unfold `limsup` for sets and replace equality with an inequality
  simp only [limsup_eq_iInf_iSup_of_nat', Set.iInf_eq_iInter, Set.iSup_eq_iUnion, ←
    nonpos_iff_eq_zero]
  -- Finally, we estimate `μ (⋃ i, t (i + n))` by `∑ i', μ (t (i + n))`
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
hs : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
t : ℕ → Set α := fun n => toMeasurable μ (s n)
ht : ∑' (i : ℕ), ↑↑μ (t i) ≠ ⊤
⊢ ↑↑μ (⋂ n, ⋃ i, toMeasurable μ (s (i + n))) ≤ 0

Next tactic:
refine'
    le_of_tendsto_of_tendsto'
      (tendsto_measure_iInter
        (fun i => MeasurableSet.iUnion fun b => measurableSet_toMeasurable _ _) _
        ⟨0, ne_top_of_le_ne_top ht (measure_iUnion_le t)⟩)
      (ENNReal.tendsto_sum_nat_add (μ ∘ t) ht) fun n => measure_iUnion_le _
/-- One direction of the **Borel-Cantelli lemma** (sometimes called the "*first* Borel-Cantelli
lemma"): if (sᵢ) is a sequence of sets such that `∑ μ sᵢ` is finite, then the limit superior of the
`sᵢ` is a null set.

Note: for the *second* Borel-Cantelli lemma (applying to independent sets in a probability space),
see `ProbabilityTheory.measure_limsup_eq_one`. -/
theorem measure_limsup_eq_zero {s : ℕ → Set α} (hs : (∑' i, μ (s i)) ≠ ∞) :
    μ (limsup s atTop) = 0 := by
  -- First we replace the sequence `sₙ` with a sequence of measurable sets `tₙ ⊇ sₙ` of the same
  -- measure.
  set t : ℕ → Set α := fun n => toMeasurable μ (s n)
  have ht : (∑' i, μ (t i)) ≠ ∞ := by simpa only [measure_toMeasurable] using hs
  suffices μ (limsup t atTop) = 0 by
    have A : s ≤ t := fun n => subset_toMeasurable μ (s n)
    -- TODO default args fail
    exact measure_mono_null (limsup_le_limsup (eventually_of_forall (Pi.le_def.mp A))) this
  -- Next we unfold `limsup` for sets and replace equality with an inequality
  simp only [limsup_eq_iInf_iSup_of_nat', Set.iInf_eq_iInter, Set.iSup_eq_iUnion, ←
    nonpos_iff_eq_zero]
  -- Finally, we estimate `μ (⋃ i, t (i + n))` by `∑ i', μ (t (i + n))`
  refine'
    le_of_tendsto_of_tendsto'
      (tendsto_measure_iInter
        (fun i => MeasurableSet.iUnion fun b => measurableSet_toMeasurable _ _) _
        ⟨0, ne_top_of_le_ne_top ht (measure_iUnion_le t)⟩)
      (ENNReal.tendsto_sum_nat_add (μ ∘ t) ht) fun n => measure_iUnion_le _
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
hs : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
t : ℕ → Set α := fun n => toMeasurable μ (s n)
ht : ∑' (i : ℕ), ↑↑μ (t i) ≠ ⊤
⊢ Antitone fun n => ⋃ i, toMeasurable μ (s (i + n))

Next tactic:
intro n m hnm x
/-- One direction of the **Borel-Cantelli lemma** (sometimes called the "*first* Borel-Cantelli
lemma"): if (sᵢ) is a sequence of sets such that `∑ μ sᵢ` is finite, then the limit superior of the
`sᵢ` is a null set.

Note: for the *second* Borel-Cantelli lemma (applying to independent sets in a probability space),
see `ProbabilityTheory.measure_limsup_eq_one`. -/
theorem measure_limsup_eq_zero {s : ℕ → Set α} (hs : (∑' i, μ (s i)) ≠ ∞) :
    μ (limsup s atTop) = 0 := by
  -- First we replace the sequence `sₙ` with a sequence of measurable sets `tₙ ⊇ sₙ` of the same
  -- measure.
  set t : ℕ → Set α := fun n => toMeasurable μ (s n)
  have ht : (∑' i, μ (t i)) ≠ ∞ := by simpa only [measure_toMeasurable] using hs
  suffices μ (limsup t atTop) = 0 by
    have A : s ≤ t := fun n => subset_toMeasurable μ (s n)
    -- TODO default args fail
    exact measure_mono_null (limsup_le_limsup (eventually_of_forall (Pi.le_def.mp A))) this
  -- Next we unfold `limsup` for sets and replace equality with an inequality
  simp only [limsup_eq_iInf_iSup_of_nat', Set.iInf_eq_iInter, Set.iSup_eq_iUnion, ←
    nonpos_iff_eq_zero]
  -- Finally, we estimate `μ (⋃ i, t (i + n))` by `∑ i', μ (t (i + n))`
  refine'
    le_of_tendsto_of_tendsto'
      (tendsto_measure_iInter
        (fun i => MeasurableSet.iUnion fun b => measurableSet_toMeasurable _ _) _
        ⟨0, ne_top_of_le_ne_top ht (measure_iUnion_le t)⟩)
      (ENNReal.tendsto_sum_nat_add (μ ∘ t) ht) fun n => measure_iUnion_le _
  intro n m hnm x
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
hs : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
t : ℕ → Set α := fun n => toMeasurable μ (s n)
ht : ∑' (i : ℕ), ↑↑μ (t i) ≠ ⊤
n m : ℕ
hnm : n ≤ m
x : α
⊢ x ∈ (fun n => ⋃ i, toMeasurable μ (s (i + n))) m → x ∈ (fun n => ⋃ i, toMeasurable μ (s (i + n))) n

Next tactic:
simp only [Set.mem_iUnion]
/-- One direction of the **Borel-Cantelli lemma** (sometimes called the "*first* Borel-Cantelli
lemma"): if (sᵢ) is a sequence of sets such that `∑ μ sᵢ` is finite, then the limit superior of the
`sᵢ` is a null set.

Note: for the *second* Borel-Cantelli lemma (applying to independent sets in a probability space),
see `ProbabilityTheory.measure_limsup_eq_one`. -/
theorem measure_limsup_eq_zero {s : ℕ → Set α} (hs : (∑' i, μ (s i)) ≠ ∞) :
    μ (limsup s atTop) = 0 := by
  -- First we replace the sequence `sₙ` with a sequence of measurable sets `tₙ ⊇ sₙ` of the same
  -- measure.
  set t : ℕ → Set α := fun n => toMeasurable μ (s n)
  have ht : (∑' i, μ (t i)) ≠ ∞ := by simpa only [measure_toMeasurable] using hs
  suffices μ (limsup t atTop) = 0 by
    have A : s ≤ t := fun n => subset_toMeasurable μ (s n)
    -- TODO default args fail
    exact measure_mono_null (limsup_le_limsup (eventually_of_forall (Pi.le_def.mp A))) this
  -- Next we unfold `limsup` for sets and replace equality with an inequality
  simp only [limsup_eq_iInf_iSup_of_nat', Set.iInf_eq_iInter, Set.iSup_eq_iUnion, ←
    nonpos_iff_eq_zero]
  -- Finally, we estimate `μ (⋃ i, t (i + n))` by `∑ i', μ (t (i + n))`
  refine'
    le_of_tendsto_of_tendsto'
      (tendsto_measure_iInter
        (fun i => MeasurableSet.iUnion fun b => measurableSet_toMeasurable _ _) _
        ⟨0, ne_top_of_le_ne_top ht (measure_iUnion_le t)⟩)
      (ENNReal.tendsto_sum_nat_add (μ ∘ t) ht) fun n => measure_iUnion_le _
  intro n m hnm x
  simp only [Set.mem_iUnion]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
hs : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
t : ℕ → Set α := fun n => toMeasurable μ (s n)
ht : ∑' (i : ℕ), ↑↑μ (t i) ≠ ⊤
n m : ℕ
hnm : n ≤ m
x : α
⊢ (∃ i, x ∈ toMeasurable μ (s (i + m))) → ∃ i, x ∈ toMeasurable μ (s (i + n))

Next tactic:
exact fun ⟨i, hi⟩ => ⟨i + (m - n), by simpa only [add_assoc, tsub_add_cancel_of_le hnm] using hi⟩
/-- One direction of the **Borel-Cantelli lemma** (sometimes called the "*first* Borel-Cantelli
lemma"): if (sᵢ) is a sequence of sets such that `∑ μ sᵢ` is finite, then the limit superior of the
`sᵢ` is a null set.

Note: for the *second* Borel-Cantelli lemma (applying to independent sets in a probability space),
see `ProbabilityTheory.measure_limsup_eq_one`. -/
theorem measure_limsup_eq_zero {s : ℕ → Set α} (hs : (∑' i, μ (s i)) ≠ ∞) :
    μ (limsup s atTop) = 0 := by
  -- First we replace the sequence `sₙ` with a sequence of measurable sets `tₙ ⊇ sₙ` of the same
  -- measure.
  set t : ℕ → Set α := fun n => toMeasurable μ (s n)
  have ht : (∑' i, μ (t i)) ≠ ∞ := by simpa only [measure_toMeasurable] using hs
  suffices μ (limsup t atTop) = 0 by
    have A : s ≤ t := fun n => subset_toMeasurable μ (s n)
    -- TODO default args fail
    exact measure_mono_null (limsup_le_limsup (eventually_of_forall (Pi.le_def.mp A))) this
  -- Next we unfold `limsup` for sets and replace equality with an inequality
  simp only [limsup_eq_iInf_iSup_of_nat', Set.iInf_eq_iInter, Set.iSup_eq_iUnion, ←
    nonpos_iff_eq_zero]
  -- Finally, we estimate `μ (⋃ i, t (i + n))` by `∑ i', μ (t (i + n))`
  refine'
    le_of_tendsto_of_tendsto'
      (tendsto_measure_iInter
        (fun i => MeasurableSet.iUnion fun b => measurableSet_toMeasurable _ _) _
        ⟨0, ne_top_of_le_ne_top ht (measure_iUnion_le t)⟩)
      (ENNReal.tendsto_sum_nat_add (μ ∘ t) ht) fun n => measure_iUnion_le _
  intro n m hnm x
  simp only [Set.mem_iUnion]
  exact fun ⟨i, hi⟩ => ⟨i + (m - n), by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m✝ : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
hs : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
t : ℕ → Set α := fun n => toMeasurable μ (s n)
ht : ∑' (i : ℕ), ↑↑μ (t i) ≠ ⊤
n m : ℕ
hnm : n ≤ m
x : α
x✝ : ∃ i, x ∈ toMeasurable μ (s (i + m))
i : ℕ
hi : x ∈ toMeasurable μ (s (i + m))
⊢ x ∈ toMeasurable μ (s (i + (m - n) + n))

Next tactic:
simpa only [add_assoc, tsub_add_cancel_of_le hnm] using hi
theorem measure_liminf_eq_zero {s : ℕ → Set α} (h : (∑' i, μ (s i)) ≠ ⊤) :
    μ (liminf s atTop) = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : ℕ → Set α
h : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
⊢ ↑↑μ (liminf s atTop) = 0

Next tactic:
rw [← le_zero_iff]
theorem measure_liminf_eq_zero {s : ℕ → Set α} (h : (∑' i, μ (s i)) ≠ ⊤) :
    μ (liminf s atTop) = 0 := by
  rw [← le_zero_iff]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : ℕ → Set α
h : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
⊢ ↑↑μ (liminf s atTop) ≤ 0

Next tactic:
have : liminf s atTop ≤ limsup s atTop := liminf_le_limsup
theorem measure_liminf_eq_zero {s : ℕ → Set α} (h : (∑' i, μ (s i)) ≠ ⊤) :
    μ (liminf s atTop) = 0 := by
  rw [← le_zero_iff]
  have : liminf s atTop ≤ limsup s atTop := liminf_le_limsup
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : ℕ → Set α
h : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
this : liminf s atTop ≤ limsup s atTop
⊢ ↑↑μ (liminf s atTop) ≤ 0

Next tactic:
exact (μ.mono this).trans (by simp [measure_limsup_eq_zero h])
theorem measure_liminf_eq_zero {s : ℕ → Set α} (h : (∑' i, μ (s i)) ≠ ⊤) :
    μ (liminf s atTop) = 0 := by
  rw [← le_zero_iff]
  have : liminf s atTop ≤ limsup s atTop := liminf_le_limsup
  exact (μ.mono this).trans (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t : Set α
s : ℕ → Set α
h : ∑' (i : ℕ), ↑↑μ (s i) ≠ ⊤
this : liminf s atTop ≤ limsup s atTop
⊢ ↑↑μ (limsup s atTop) ≤ 0

Next tactic:
simp [measure_limsup_eq_zero h]
theorem limsup_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @limsup (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), s n =ᵐ[μ] t
⊢ limsup s atTop =ᵐ[μ] t

Next tactic:
simp_rw [ae_eq_set] at h ⊢
theorem limsup_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @limsup (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (limsup s atTop \ t) = 0 ∧ ↑↑μ (t \ limsup s atTop) = 0

Next tactic:
constructor
theorem limsup_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @limsup (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · 

Proof state:
case left
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (limsup s atTop \ t) = 0

Next tactic:
rw [atTop.limsup_sdiff s t]
theorem limsup_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @limsup (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.limsup_sdiff s t]
    

Proof state:
case left
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (limsup (fun b => s b \ t) atTop) = 0

Next tactic:
apply measure_limsup_eq_zero
theorem limsup_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @limsup (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.limsup_sdiff s t]
    apply measure_limsup_eq_zero
    

Proof state:
case left.hs
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ∑' (i : ℕ), ↑↑μ (s i \ t) ≠ ⊤

Next tactic:
simp [h]
theorem limsup_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @limsup (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.limsup_sdiff s t]
    apply measure_limsup_eq_zero
    simp [h]
  · 

Proof state:
case right
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (t \ limsup s atTop) = 0

Next tactic:
rw [atTop.sdiff_limsup s t]
theorem limsup_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @limsup (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.limsup_sdiff s t]
    apply measure_limsup_eq_zero
    simp [h]
  · rw [atTop.sdiff_limsup s t]
    

Proof state:
case right
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (liminf (fun b => t \ s b) atTop) = 0

Next tactic:
apply measure_liminf_eq_zero
theorem limsup_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @limsup (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.limsup_sdiff s t]
    apply measure_limsup_eq_zero
    simp [h]
  · rw [atTop.sdiff_limsup s t]
    apply measure_liminf_eq_zero
    

Proof state:
case right.h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ∑' (i : ℕ), ↑↑μ (t \ s i) ≠ ⊤

Next tactic:
simp [h]
theorem liminf_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @liminf (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), s n =ᵐ[μ] t
⊢ liminf s atTop =ᵐ[μ] t

Next tactic:
simp_rw [ae_eq_set] at h ⊢
theorem liminf_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @liminf (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (liminf s atTop \ t) = 0 ∧ ↑↑μ (t \ liminf s atTop) = 0

Next tactic:
constructor
theorem liminf_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @liminf (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · 

Proof state:
case left
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (liminf s atTop \ t) = 0

Next tactic:
rw [atTop.liminf_sdiff s t]
theorem liminf_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @liminf (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.liminf_sdiff s t]
    

Proof state:
case left
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (liminf (fun b => s b \ t) atTop) = 0

Next tactic:
apply measure_liminf_eq_zero
theorem liminf_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @liminf (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.liminf_sdiff s t]
    apply measure_liminf_eq_zero
    

Proof state:
case left.h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ∑' (i : ℕ), ↑↑μ (s i \ t) ≠ ⊤

Next tactic:
simp [h]
theorem liminf_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @liminf (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.liminf_sdiff s t]
    apply measure_liminf_eq_zero
    simp [h]
  · 

Proof state:
case right
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (t \ liminf s atTop) = 0

Next tactic:
rw [atTop.sdiff_liminf s t]
theorem liminf_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @liminf (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.liminf_sdiff s t]
    apply measure_liminf_eq_zero
    simp [h]
  · rw [atTop.sdiff_liminf s t]
    

Proof state:
case right
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ↑↑μ (limsup (fun b => t \ s b) atTop) = 0

Next tactic:
apply measure_limsup_eq_zero
theorem liminf_ae_eq_of_forall_ae_eq (s : ℕ → Set α) {t : Set α}
    (h : ∀ n, s n =ᵐ[μ] t) : @liminf (Set α) ℕ _ s atTop =ᵐ[μ] t := by
    -- Need `@` below because of diamond; see gh issue #16932
  simp_rw [ae_eq_set] at h ⊢
  constructor
  · rw [atTop.liminf_sdiff s t]
    apply measure_liminf_eq_zero
    simp [h]
  · rw [atTop.sdiff_liminf s t]
    apply measure_limsup_eq_zero
    

Proof state:
case right.hs
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ι : Type u_5
R : Type u_6
R' : Type u_7
m : MeasurableSpace α
μ μ₁ μ₂ : Measure α
s✝ s₁ s₂ t✝ : Set α
s : ℕ → Set α
t : Set α
h : ∀ (n : ℕ), ↑↑μ (s n \ t) = 0 ∧ ↑↑μ (t \ s n) = 0
⊢ ∑' (i : ℕ), ↑↑μ (t \ s i) ≠ ⊤

Next tactic:
simp [h]