measure_theory.covering.liminf_limsupMathlib.MeasureTheory.Covering.LiminfLimsup

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -92,7 +92,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
       (IsUnifLocDoublingMeasure.ae_tendsto_measure_inter_div μ W 2)
   replace hd : d ∈ blimsup Y₁ at_top p := ((mem_diff _).mp hd).1
   obtain ⟨f : ℕ → ℕ, hf⟩ := exists_forall_mem_of_has_basis_mem_blimsup' at_top_basis hd
-  simp only [forall_and] at hf 
+  simp only [forall_and] at hf
   obtain ⟨hf₀ : ∀ j, d ∈ cthickening (r₁ (f j)) (s (f j)), hf₁, hf₂ : ∀ j, j ≤ f j⟩ := hf
   have hf₃ : tendsto f at_top at_top :=
     tendsto_at_top_at_top.mpr fun j => ⟨f j, fun i hi => (hf₂ j).trans (hi.trans <| hf₂ i)⟩
@@ -101,10 +101,10 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
   replace hf₀ : ∀ j, ∃ w ∈ s (f j), d ∈ closed_ball w (2 * r₁ (f j))
   · intro j
     specialize hrp (f j)
-    rw [Pi.zero_apply] at hrp 
+    rw [Pi.zero_apply] at hrp
     rcases eq_or_lt_of_le hrp with (hr0 | hrp')
     · specialize hf₀ j
-      rw [← hr0, cthickening_zero, (hs (f j)).closure_eq] at hf₀ 
+      rw [← hr0, cthickening_zero, (hs (f j)).closure_eq] at hf₀
       exact ⟨d, hf₀, by simp [← hr0]⟩
     ·
       exact
@@ -166,7 +166,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
     rw [← measure_union' hj₁ measurableSet_closedBall]
     exact measure_mono (union_subset (h₁ j) (h₂ j))
   replace hj₃ := tsub_le_tsub_right hj₃ (↑C⁻¹ * μ (B j))
-  rwa [ENNReal.add_sub_cancel_left hB] at hj₃ 
+  rwa [ENNReal.add_sub_cancel_left hB] at hj₃
 #align blimsup_cthickening_ae_le_of_eventually_mul_le_aux blimsup_cthickening_ae_le_of_eventually_mul_le_aux
 -/
 
Diff
@@ -240,7 +240,7 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
     by
     refine'
       tendsto_nhds_within_iff.mpr
-        ⟨tendsto.if' hr tendsto_one_div_add_atTop_nhds_0_nat, eventually_of_forall fun i => _⟩
+        ⟨tendsto.if' hr tendsto_one_div_add_atTop_nhds_zero_nat, eventually_of_forall fun i => _⟩
     by_cases hi : 0 < r i
     · simp [hi, r']
     · simp only [hi, r', one_div, mem_Ioi, if_false, inv_pos]; positivity
Diff
@@ -325,7 +325,8 @@ theorem blimsup_thickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
       blimsup (fun i => thickening (M * r i) (s i)) at_top q :=
     by
     refine' blimsup_congr' (eventually_of_forall fun i h => _)
-    replace h : 0 < r i; · rw [← zero_lt_mul_left hM]; contrapose! h; apply thickening_of_nonpos h
+    replace h : 0 < r i;
+    · rw [← mul_pos_iff_of_pos_left hM]; contrapose! h; apply thickening_of_nonpos h
     simp only [h, iff_self_and, imp_true_iff]
   rw [h₁, h₂]
   exact blimsup_thickening_mul_ae_eq_aux μ q s hM r hr (eventually_of_forall fun i hi => hi.2)
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2022 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 -/
-import Mathbin.MeasureTheory.Covering.DensityTheorem
+import MeasureTheory.Covering.DensityTheorem
 
 #align_import measure_theory.covering.liminf_limsup from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
 
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2022 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
-
-! This file was ported from Lean 3 source module measure_theory.covering.liminf_limsup
-! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Covering.DensityTheorem
 
+#align_import measure_theory.covering.liminf_limsup from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
+
 /-!
 # Liminf, limsup, and uniformly locally doubling measures.
 
Diff
@@ -40,6 +40,7 @@ variable {α : Type _} [MetricSpace α] [SecondCountableTopology α] [Measurable
 
 variable (μ : Measure α) [IsLocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure μ]
 
+#print blimsup_cthickening_ae_le_of_eventually_mul_le_aux /-
 /-- This is really an auxiliary result en route to `blimsup_cthickening_ae_le_of_eventually_mul_le`
 (which is itself an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`).
 
@@ -170,7 +171,9 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
   replace hj₃ := tsub_le_tsub_right hj₃ (↑C⁻¹ * μ (B j))
   rwa [ENNReal.add_sub_cancel_left hB] at hj₃ 
 #align blimsup_cthickening_ae_le_of_eventually_mul_le_aux blimsup_cthickening_ae_le_of_eventually_mul_le_aux
+-/
 
+#print blimsup_cthickening_ae_le_of_eventually_mul_le /-
 /-- This is really an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`.
 
 NB: The `set : α` type ascription is present because of issue #16932 on GitHub. -/
@@ -199,7 +202,9 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le (p : ℕ → Prop) {s : 
       blimsup_cthickening_ae_le_of_eventually_mul_le_aux μ p hs (tendsto_nhds_max_right hr) hRp hM
         hM' hMr
 #align blimsup_cthickening_ae_le_of_eventually_mul_le blimsup_cthickening_ae_le_of_eventually_mul_le
+-/
 
+#print blimsup_cthickening_mul_ae_eq /-
 /-- Given a sequence of subsets `sᵢ` of a metric space, together with a sequence of radii `rᵢ`
 such that `rᵢ → 0`, the set of points which belong to infinitely many of the closed
 `rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a uniformly locally doubling measure if
@@ -258,7 +263,9 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
     blimsup_congr (eventually_of_forall h₂)]
   exact ae_eq_set_union (this (fun i => p i ∧ 0 < r i) hr') (ae_eq_refl _)
 #align blimsup_cthickening_mul_ae_eq blimsup_cthickening_mul_ae_eq
+-/
 
+#print blimsup_cthickening_ae_eq_blimsup_thickening /-
 theorem blimsup_cthickening_ae_eq_blimsup_thickening {p : ℕ → Prop} {s : ℕ → Set α} {r : ℕ → ℝ}
     (hr : Tendsto r atTop (𝓝 0)) (hr' : ∀ᶠ i in atTop, p i → 0 < r i) :
     (blimsup (fun i => cthickening (r i) (s i)) atTop p : Set α) =ᵐ[μ]
@@ -273,7 +280,9 @@ theorem blimsup_cthickening_ae_eq_blimsup_thickening {p : ℕ → Prop} {s : ℕ
     nlinarith [hi pi]
   · exact mono_blimsup fun i pi => thickening_subset_cthickening _ _
 #align blimsup_cthickening_ae_eq_blimsup_thickening blimsup_cthickening_ae_eq_blimsup_thickening
+-/
 
+#print blimsup_thickening_mul_ae_eq_aux /-
 /-- An auxiliary result en route to `blimsup_thickening_mul_ae_eq`. -/
 theorem blimsup_thickening_mul_ae_eq_aux (p : ℕ → Prop) (s : ℕ → Set α) {M : ℝ} (hM : 0 < M)
     (r : ℕ → ℝ) (hr : Tendsto r atTop (𝓝 0)) (hr' : ∀ᶠ i in atTop, p i → 0 < r i) :
@@ -287,7 +296,9 @@ theorem blimsup_thickening_mul_ae_eq_aux (p : ℕ → Prop) (s : ℕ → Set α)
   have h₃ := blimsup_cthickening_ae_eq_blimsup_thickening μ hr hr'
   exact h₃.symm.trans (h₂.trans h₁)
 #align blimsup_thickening_mul_ae_eq_aux blimsup_thickening_mul_ae_eq_aux
+-/
 
+#print blimsup_thickening_mul_ae_eq /-
 /-- Given a sequence of subsets `sᵢ` of a metric space, together with a sequence of radii `rᵢ`
 such that `rᵢ → 0`, the set of points which belong to infinitely many of the
 `rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a uniformly locally doubling measure if
@@ -322,4 +333,5 @@ theorem blimsup_thickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
   rw [h₁, h₂]
   exact blimsup_thickening_mul_ae_eq_aux μ q s hM r hr (eventually_of_forall fun i hi => hi.2)
 #align blimsup_thickening_mul_ae_eq blimsup_thickening_mul_ae_eq
+-/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 
 ! This file was ported from Lean 3 source module measure_theory.covering.liminf_limsup
-! leanprover-community/mathlib commit 5f6e827d81dfbeb6151d7016586ceeb0099b9655
+! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.MeasureTheory.Covering.DensityTheorem
 /-!
 # Liminf, limsup, and uniformly locally doubling measures.
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file is a place to collect lemmas about liminf and limsup for subsets of a metric space
 carrying a uniformly locally doubling measure.
 
Diff
@@ -35,7 +35,7 @@ open scoped NNReal ENNReal Topology
 
 variable {α : Type _} [MetricSpace α] [SecondCountableTopology α] [MeasurableSpace α] [BorelSpace α]
 
-variable (μ : Measure α) [LocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure μ]
+variable (μ : Measure α) [IsLocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure μ]
 
 /-- This is really an auxiliary result en route to `blimsup_cthickening_ae_le_of_eventually_mul_le`
 (which is itself an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`).
Diff
@@ -91,7 +91,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
       (IsUnifLocDoublingMeasure.ae_tendsto_measure_inter_div μ W 2)
   replace hd : d ∈ blimsup Y₁ at_top p := ((mem_diff _).mp hd).1
   obtain ⟨f : ℕ → ℕ, hf⟩ := exists_forall_mem_of_has_basis_mem_blimsup' at_top_basis hd
-  simp only [forall_and] at hf
+  simp only [forall_and] at hf 
   obtain ⟨hf₀ : ∀ j, d ∈ cthickening (r₁ (f j)) (s (f j)), hf₁, hf₂ : ∀ j, j ≤ f j⟩ := hf
   have hf₃ : tendsto f at_top at_top :=
     tendsto_at_top_at_top.mpr fun j => ⟨f j, fun i hi => (hf₂ j).trans (hi.trans <| hf₂ i)⟩
@@ -100,10 +100,10 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
   replace hf₀ : ∀ j, ∃ w ∈ s (f j), d ∈ closed_ball w (2 * r₁ (f j))
   · intro j
     specialize hrp (f j)
-    rw [Pi.zero_apply] at hrp
+    rw [Pi.zero_apply] at hrp 
     rcases eq_or_lt_of_le hrp with (hr0 | hrp')
     · specialize hf₀ j
-      rw [← hr0, cthickening_zero, (hs (f j)).closure_eq] at hf₀
+      rw [← hr0, cthickening_zero, (hs (f j)).closure_eq] at hf₀ 
       exact ⟨d, hf₀, by simp [← hr0]⟩
     ·
       exact
@@ -165,7 +165,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
     rw [← measure_union' hj₁ measurableSet_closedBall]
     exact measure_mono (union_subset (h₁ j) (h₂ j))
   replace hj₃ := tsub_le_tsub_right hj₃ (↑C⁻¹ * μ (B j))
-  rwa [ENNReal.add_sub_cancel_left hB] at hj₃
+  rwa [ENNReal.add_sub_cancel_left hB] at hj₃ 
 #align blimsup_cthickening_ae_le_of_eventually_mul_le_aux blimsup_cthickening_ae_le_of_eventually_mul_le_aux
 
 /-- This is really an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`.
@@ -240,7 +240,7 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
     · simp [hi, r']
     · simp only [hi, r', one_div, mem_Ioi, if_false, inv_pos]; positivity
   have h₀ : ∀ i, p i ∧ 0 < r i → cthickening (r i) (s i) = cthickening (r' i) (s i) := by
-    rintro i ⟨-, hi⟩; congr ; change r i = ite (0 < r i) (r i) _; simp [hi]
+    rintro i ⟨-, hi⟩; congr; change r i = ite (0 < r i) (r i) _; simp [hi]
   have h₁ : ∀ i, p i ∧ 0 < r i → cthickening (M * r i) (s i) = cthickening (M * r' i) (s i) := by
     rintro i ⟨-, hi⟩; simp only [hi, mul_ite, if_true]
   have h₂ : ∀ i, p i ∧ r i ≤ 0 → cthickening (M * r i) (s i) = cthickening (r i) (s i) :=
Diff
@@ -31,7 +31,7 @@ carrying a uniformly locally doubling measure.
 
 open Set Filter Metric MeasureTheory TopologicalSpace
 
-open NNReal ENNReal Topology
+open scoped NNReal ENNReal Topology
 
 variable {α : Type _} [MetricSpace α] [SecondCountableTopology α] [MeasurableSpace α] [BorelSpace α]
 
Diff
@@ -149,8 +149,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
       fun j hj => hj (w j)
   refine' (h₃.and h₄).mono fun j hj₀ => _
   change μ (W ∩ B j) / μ (B j) ≤ ↑(1 - C⁻¹)
-  rcases eq_or_ne (μ (B j)) ∞ with (hB | hB)
-  · simp [hB]
+  rcases eq_or_ne (μ (B j)) ∞ with (hB | hB); · simp [hB]
   apply ENNReal.div_le_of_le_mul
   rw [WithTop.coe_sub, ENNReal.coe_one, ENNReal.sub_mul fun _ _ => hB, one_mul]
   replace hB : ↑C⁻¹ * μ (B j) ≠ ∞
@@ -219,8 +218,7 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
       (blimsup (fun i => cthickening (M * r i) (s i)) at_top p : Set α) =ᵐ[μ]
         (blimsup (fun i => cthickening (r i) (s i)) at_top p : Set α) :=
     by
-    clear p hr r
-    intro p r hr
+    clear p hr r; intro p r hr
     have hr' : tendsto (fun i => M * r i) at_top (𝓝[>] 0) := by
       convert tendsto_nhds_within_Ioi.const_mul hM hr <;> simp only [MulZeroClass.mul_zero]
     refine' eventually_le_antisymm_iff.mpr ⟨_, _⟩
@@ -240,26 +238,17 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
         ⟨tendsto.if' hr tendsto_one_div_add_atTop_nhds_0_nat, eventually_of_forall fun i => _⟩
     by_cases hi : 0 < r i
     · simp [hi, r']
-    · simp only [hi, r', one_div, mem_Ioi, if_false, inv_pos]
-      positivity
-  have h₀ : ∀ i, p i ∧ 0 < r i → cthickening (r i) (s i) = cthickening (r' i) (s i) :=
-    by
-    rintro i ⟨-, hi⟩
-    congr
-    change r i = ite (0 < r i) (r i) _
-    simp [hi]
-  have h₁ : ∀ i, p i ∧ 0 < r i → cthickening (M * r i) (s i) = cthickening (M * r' i) (s i) :=
-    by
-    rintro i ⟨-, hi⟩
-    simp only [hi, mul_ite, if_true]
+    · simp only [hi, r', one_div, mem_Ioi, if_false, inv_pos]; positivity
+  have h₀ : ∀ i, p i ∧ 0 < r i → cthickening (r i) (s i) = cthickening (r' i) (s i) := by
+    rintro i ⟨-, hi⟩; congr ; change r i = ite (0 < r i) (r i) _; simp [hi]
+  have h₁ : ∀ i, p i ∧ 0 < r i → cthickening (M * r i) (s i) = cthickening (M * r' i) (s i) := by
+    rintro i ⟨-, hi⟩; simp only [hi, mul_ite, if_true]
   have h₂ : ∀ i, p i ∧ r i ≤ 0 → cthickening (M * r i) (s i) = cthickening (r i) (s i) :=
     by
     rintro i ⟨-, hi⟩
     have hi' : M * r i ≤ 0 := mul_nonpos_of_nonneg_of_nonpos hM.le hi
     rw [cthickening_of_nonpos hi, cthickening_of_nonpos hi']
-  have hp : p = fun i => p i ∧ 0 < r i ∨ p i ∧ r i ≤ 0 :=
-    by
-    ext i
+  have hp : p = fun i => p i ∧ 0 < r i ∨ p i ∧ r i ≤ 0 := by ext i;
     simp [← and_or_left, lt_or_le 0 (r i)]
   rw [hp, blimsup_or_eq_sup, blimsup_or_eq_sup, sup_eq_union,
     blimsup_congr (eventually_of_forall h₀), blimsup_congr (eventually_of_forall h₁),
@@ -290,9 +279,7 @@ theorem blimsup_thickening_mul_ae_eq_aux (p : ℕ → Prop) (s : ℕ → Set α)
   by
   have h₁ := blimsup_cthickening_ae_eq_blimsup_thickening μ hr hr'
   have h₂ := blimsup_cthickening_mul_ae_eq μ p s hM r hr
-  replace hr : tendsto (fun i => M * r i) at_top (𝓝 0);
-  · convert hr.const_mul M
-    simp
+  replace hr : tendsto (fun i => M * r i) at_top (𝓝 0); · convert hr.const_mul M; simp
   replace hr' : ∀ᶠ i in at_top, p i → 0 < M * r i := hr'.mono fun i hi hip => mul_pos hM (hi hip)
   have h₃ := blimsup_cthickening_ae_eq_blimsup_thickening μ hr hr'
   exact h₃.symm.trans (h₂.trans h₁)
@@ -320,19 +307,14 @@ theorem blimsup_thickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
       blimsup (fun i => thickening (r i) (s i)) at_top q :=
     by
     refine' blimsup_congr' (eventually_of_forall fun i h => _)
-    replace hi : 0 < r i
-    · contrapose! h
-      apply thickening_of_nonpos h
+    replace hi : 0 < r i; · contrapose! h; apply thickening_of_nonpos h
     simp only [hi, iff_self_and, imp_true_iff]
   have h₂ :
     blimsup (fun i => thickening (M * r i) (s i)) at_top p =
       blimsup (fun i => thickening (M * r i) (s i)) at_top q :=
     by
     refine' blimsup_congr' (eventually_of_forall fun i h => _)
-    replace h : 0 < r i
-    · rw [← zero_lt_mul_left hM]
-      contrapose! h
-      apply thickening_of_nonpos h
+    replace h : 0 < r i; · rw [← zero_lt_mul_left hM]; contrapose! h; apply thickening_of_nonpos h
     simp only [h, iff_self_and, imp_true_iff]
   rw [h₁, h₂]
   exact blimsup_thickening_mul_ae_eq_aux μ q s hM r hr (eventually_of_forall fun i hi => hi.2)
Diff
@@ -35,7 +35,7 @@ open NNReal ENNReal Topology
 
 variable {α : Type _} [MetricSpace α] [SecondCountableTopology α] [MeasurableSpace α] [BorelSpace α]
 
-variable (μ : Measure α) [IsLocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure μ]
+variable (μ : Measure α) [LocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure μ]
 
 /-- This is really an auxiliary result en route to `blimsup_cthickening_ae_le_of_eventually_mul_le`
 (which is itself an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`).
Diff
@@ -4,24 +4,24 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 
 ! This file was ported from Lean 3 source module measure_theory.covering.liminf_limsup
-! leanprover-community/mathlib commit b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f
+! leanprover-community/mathlib commit 5f6e827d81dfbeb6151d7016586ceeb0099b9655
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Covering.DensityTheorem
 
 /-!
-# Liminf, limsup, and doubling measures.
+# Liminf, limsup, and uniformly locally doubling measures.
 
 This file is a place to collect lemmas about liminf and limsup for subsets of a metric space
-carrying a doubling measure.
+carrying a uniformly locally doubling measure.
 
 ## Main results:
 
  * `blimsup_cthickening_mul_ae_eq`: the limsup of the closed thickening of a sequence of subsets
-   of a metric space is unchanged almost everywhere for a doubling measure if the sequence of
-   distances is multiplied by a positive scale factor. This is a generalisation of a result of
-   Cassels, appearing as Lemma 9 on page 217 of
+   of a metric space is unchanged almost everywhere for a uniformly locally doubling measure if the
+   sequence of distances is multiplied by a positive scale factor. This is a generalisation of a
+   result of Cassels, appearing as Lemma 9 on page 217 of
    [J.W.S. Cassels, *Some metrical theorems in Diophantine approximation. I*](cassels1950).
  * `blimsup_thickening_mul_ae_eq`: a variant of `blimsup_cthickening_mul_ae_eq` for thickenings
    rather than closed thickenings.
@@ -35,7 +35,7 @@ open NNReal ENNReal Topology
 
 variable {α : Type _} [MetricSpace α] [SecondCountableTopology α] [MeasurableSpace α] [BorelSpace α]
 
-variable (μ : Measure α) [IsLocallyFiniteMeasure μ] [IsDoublingMeasure μ]
+variable (μ : Measure α) [IsLocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure μ]
 
 /-- This is really an auxiliary result en route to `blimsup_cthickening_ae_le_of_eventually_mul_le`
 (which is itself an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`).
@@ -62,7 +62,8 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
   
     We obtain our contradiction by showing that there exists `η < 1` such that
     `μ (W ∩ (B j)) / μ (B j) ≤ η` for sufficiently large `j`. In fact we claim that `η = 1 - C⁻¹`
-    is such a value where `C` is the scaling constant of `M⁻¹` for the doubling measure `μ`.
+    is such a value where `C` is the scaling constant of `M⁻¹` for the uniformly locally doubling
+    measure `μ`.
   
     To prove the claim, let `b j = closed_ball (w j) (M * r₁ (f j))` and for given `j` consider the
     sets `b j` and `W ∩ (B j)`. These are both subsets of `B j` and are disjoint for large enough `j`
@@ -87,7 +88,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
               tendsto (fun j => μ (W ∩ closed_ball (w j) (δ j)) / μ (closed_ball (w j) (δ j))) l
                 (𝓝 1) :=
     measure.exists_mem_of_measure_ne_zero_of_ae contra
-      (IsDoublingMeasure.ae_tendsto_measure_inter_div μ W 2)
+      (IsUnifLocDoublingMeasure.ae_tendsto_measure_inter_div μ W 2)
   replace hd : d ∈ blimsup Y₁ at_top p := ((mem_diff _).mp hd).1
   obtain ⟨f : ℕ → ℕ, hf⟩ := exists_forall_mem_of_has_basis_mem_blimsup' at_top_basis hd
   simp only [forall_and] at hf
@@ -110,8 +111,9 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
           (cthickening_subset_Union_closed_ball_of_lt (s (f j)) (by positivity)
             (lt_two_mul_self hrp') (hf₀ j))
   choose w hw hw' using hf₀
-  let C := IsDoublingMeasure.scalingConstantOf μ M⁻¹
-  have hC : 0 < C := lt_of_lt_of_le zero_lt_one (IsDoublingMeasure.one_le_scalingConstantOf μ M⁻¹)
+  let C := IsUnifLocDoublingMeasure.scalingConstantOf μ M⁻¹
+  have hC : 0 < C :=
+    lt_of_lt_of_le zero_lt_one (IsUnifLocDoublingMeasure.one_le_scalingConstantOf μ M⁻¹)
   suffices
     ∃ η < (1 : ℝ≥0),
       ∀ᶠ j in at_top, μ (W ∩ closed_ball (w j) (r₁ (f j))) / μ (closed_ball (w j) (r₁ (f j))) ≤ η
@@ -142,7 +144,8 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
     simp only [mem_Union, exists_prop]
     exact ⟨f j, ⟨hf₁ j, hj.le.trans (hf₂ j)⟩, ha⟩
   have h₄ : ∀ᶠ j in at_top, μ (B j) ≤ C * μ (b j) :=
-    (hr.eventually (IsDoublingMeasure.eventually_measure_le_scaling_constant_mul' μ M hM)).mono
+    (hr.eventually
+          (IsUnifLocDoublingMeasure.eventually_measure_le_scaling_constant_mul' μ M hM)).mono
       fun j hj => hj (w j)
   refine' (h₃.and h₄).mono fun j hj₀ => _
   change μ (W ∩ B j) / μ (B j) ≤ ↑(1 - C⁻¹)
@@ -197,8 +200,8 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le (p : ℕ → Prop) {s : 
 
 /-- Given a sequence of subsets `sᵢ` of a metric space, together with a sequence of radii `rᵢ`
 such that `rᵢ → 0`, the set of points which belong to infinitely many of the closed
-`rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a doubling measure if the `rᵢ` are all
-scaled by a positive constant.
+`rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a uniformly locally doubling measure if
+the `rᵢ` are all scaled by a positive constant.
 
 This lemma is a generalisation of Lemma 9 appearing on page 217 of
 [J.W.S. Cassels, *Some metrical theorems in Diophantine approximation. I*](cassels1950).
@@ -297,8 +300,8 @@ theorem blimsup_thickening_mul_ae_eq_aux (p : ℕ → Prop) (s : ℕ → Set α)
 
 /-- Given a sequence of subsets `sᵢ` of a metric space, together with a sequence of radii `rᵢ`
 such that `rᵢ → 0`, the set of points which belong to infinitely many of the
-`rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a doubling measure if the `rᵢ` are all
-scaled by a positive constant.
+`rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a uniformly locally doubling measure if
+the `rᵢ` are all scaled by a positive constant.
 
 This lemma is a generalisation of Lemma 9 appearing on page 217 of
 [J.W.S. Cassels, *Some metrical theorems in Diophantine approximation. I*](cassels1950).
Diff
@@ -180,7 +180,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le (p : ℕ → Prop) {s : 
   have hRp : 0 ≤ R₁ := fun i => le_max_left 0 (r₁ i)
   replace hMr : ∀ᶠ i in at_top, M * R₁ i ≤ R₂ i
   · refine' hMr.mono fun i hi => _
-    rw [mul_max_of_nonneg _ _ hM.le, mul_zero]
+    rw [mul_max_of_nonneg _ _ hM.le, MulZeroClass.mul_zero]
     exact max_le_max (le_refl 0) hi
   simp_rw [← cthickening_max_zero (r₁ _), ← cthickening_max_zero (r₂ _)]
   cases' le_or_lt 1 M with hM' hM'
@@ -219,7 +219,7 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
     clear p hr r
     intro p r hr
     have hr' : tendsto (fun i => M * r i) at_top (𝓝[>] 0) := by
-      convert tendsto_nhds_within_Ioi.const_mul hM hr <;> simp only [mul_zero]
+      convert tendsto_nhds_within_Ioi.const_mul hM hr <;> simp only [MulZeroClass.mul_zero]
     refine' eventually_le_antisymm_iff.mpr ⟨_, _⟩
     ·
       exact
Diff
@@ -184,7 +184,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le (p : ℕ → Prop) {s : 
     exact max_le_max (le_refl 0) hi
   simp_rw [← cthickening_max_zero (r₁ _), ← cthickening_max_zero (r₂ _)]
   cases' le_or_lt 1 M with hM' hM'
-  · apply HasSubset.Subset.eventuallyLe
+  · apply HasSubset.Subset.eventuallyLE
     change _ ≤ _
     refine' mono_blimsup' (hMr.mono fun i hi hp => cthickening_mono _ (s i))
     exact (le_mul_of_one_le_left (hRp i) hM').trans hi
@@ -269,10 +269,10 @@ theorem blimsup_cthickening_ae_eq_blimsup_thickening {p : ℕ → Prop} {s : ℕ
     (blimsup (fun i => cthickening (r i) (s i)) atTop p : Set α) =ᵐ[μ]
       (blimsup (fun i => thickening (r i) (s i)) atTop p : Set α) :=
   by
-  refine' eventually_le_antisymm_iff.mpr ⟨_, HasSubset.Subset.eventuallyLe (_ : _ ≤ _)⟩
+  refine' eventually_le_antisymm_iff.mpr ⟨_, HasSubset.Subset.eventuallyLE (_ : _ ≤ _)⟩
   · rw [eventually_le_congr (blimsup_cthickening_mul_ae_eq μ p s (@one_half_pos ℝ _) r hr).symm
         eventually_eq.rfl]
-    apply HasSubset.Subset.eventuallyLe
+    apply HasSubset.Subset.eventuallyLE
     change _ ≤ _
     refine' mono_blimsup' (hr'.mono fun i hi pi => cthickening_subset_thickening' (hi pi) _ (s i))
     nlinarith [hi pi]
Diff
@@ -31,7 +31,7 @@ carrying a doubling measure.
 
 open Set Filter Metric MeasureTheory TopologicalSpace
 
-open NNReal Ennreal Topology
+open NNReal ENNReal Topology
 
 variable {α : Type _} [MetricSpace α] [SecondCountableTopology α] [MeasurableSpace α] [BorelSpace α]
 
@@ -118,7 +118,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
     by
     obtain ⟨η, hη, hη'⟩ := this
     replace hη' : 1 ≤ η := by
-      simpa only [Ennreal.one_le_coe_iff] using
+      simpa only [ENNReal.one_le_coe_iff] using
         le_of_tendsto (hd' w (fun j => r₁ (f j)) hr <| eventually_of_forall hw') hη'
     exact (lt_self_iff_false _).mp (lt_of_lt_of_le hη hη')
   refine' ⟨1 - C⁻¹, tsub_lt_self zero_lt_one (inv_pos.mpr hC), _⟩
@@ -148,22 +148,22 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
   change μ (W ∩ B j) / μ (B j) ≤ ↑(1 - C⁻¹)
   rcases eq_or_ne (μ (B j)) ∞ with (hB | hB)
   · simp [hB]
-  apply Ennreal.div_le_of_le_mul
-  rw [WithTop.coe_sub, Ennreal.coe_one, Ennreal.sub_mul fun _ _ => hB, one_mul]
+  apply ENNReal.div_le_of_le_mul
+  rw [WithTop.coe_sub, ENNReal.coe_one, ENNReal.sub_mul fun _ _ => hB, one_mul]
   replace hB : ↑C⁻¹ * μ (B j) ≠ ∞
-  · refine' Ennreal.mul_ne_top _ hB
-    rwa [Ennreal.coe_inv hC, Ne.def, Ennreal.inv_eq_top, Ennreal.coe_eq_zero]
+  · refine' ENNReal.mul_ne_top _ hB
+    rwa [ENNReal.coe_inv hC, Ne.def, ENNReal.inv_eq_top, ENNReal.coe_eq_zero]
   obtain ⟨hj₁ : Disjoint (b j) (W ∩ B j), hj₂ : μ (B j) ≤ C * μ (b j)⟩ := hj₀
   replace hj₂ : ↑C⁻¹ * μ (B j) ≤ μ (b j)
-  · rw [Ennreal.coe_inv hC, ← Ennreal.div_eq_inv_mul]
-    exact Ennreal.div_le_of_le_mul' hj₂
+  · rw [ENNReal.coe_inv hC, ← ENNReal.div_eq_inv_mul]
+    exact ENNReal.div_le_of_le_mul' hj₂
   have hj₃ : ↑C⁻¹ * μ (B j) + μ (W ∩ B j) ≤ μ (B j) :=
     by
     refine' le_trans (add_le_add_right hj₂ _) _
     rw [← measure_union' hj₁ measurableSet_closedBall]
     exact measure_mono (union_subset (h₁ j) (h₂ j))
   replace hj₃ := tsub_le_tsub_right hj₃ (↑C⁻¹ * μ (B j))
-  rwa [Ennreal.add_sub_cancel_left hB] at hj₃
+  rwa [ENNReal.add_sub_cancel_left hB] at hj₃
 #align blimsup_cthickening_ae_le_of_eventually_mul_le_aux blimsup_cthickening_ae_le_of_eventually_mul_le_aux
 
 /-- This is really an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`.
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 
 ! This file was ported from Lean 3 source module measure_theory.covering.liminf_limsup
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit b2ff9a3d7a15fd5b0f060b135421d6a89a999c2f
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -121,7 +121,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
       simpa only [Ennreal.one_le_coe_iff] using
         le_of_tendsto (hd' w (fun j => r₁ (f j)) hr <| eventually_of_forall hw') hη'
     exact (lt_self_iff_false _).mp (lt_of_lt_of_le hη hη')
-  refine' ⟨1 - C⁻¹, tsub_lt_self zero_lt_one (nnreal.inv_pos.mpr hC), _⟩
+  refine' ⟨1 - C⁻¹, tsub_lt_self zero_lt_one (inv_pos.mpr hC), _⟩
   replace hC : C ≠ 0 := ne_of_gt hC
   let b : ℕ → Set α := fun j => closed_ball (w j) (M * r₁ (f j))
   let B : ℕ → Set α := fun j => closed_ball (w j) (r₁ (f j))

Changes in mathlib4

mathlib3
mathlib4
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11813)
Diff
@@ -137,7 +137,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
   rw [ENNReal.coe_sub, ENNReal.coe_one, ENNReal.sub_mul fun _ _ => hB, one_mul]
   replace hB : ↑C⁻¹ * μ (B j) ≠ ∞ := by
     refine ENNReal.mul_ne_top ?_ hB
-    rwa [ENNReal.coe_inv hC, Ne.def, ENNReal.inv_eq_top, ENNReal.coe_eq_zero]
+    rwa [ENNReal.coe_inv hC, Ne, ENNReal.inv_eq_top, ENNReal.coe_eq_zero]
   obtain ⟨hj₁ : Disjoint (b j) (W ∩ B j), hj₂ : μ (B j) ≤ C * μ (b j)⟩ := hj₀
   replace hj₂ : ↑C⁻¹ * μ (B j) ≤ μ (b j) := by
     rw [ENNReal.coe_inv hC, ← ENNReal.div_eq_inv_mul]
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -31,7 +31,6 @@ open Set Filter Metric MeasureTheory TopologicalSpace
 open scoped NNReal ENNReal Topology
 
 variable {α : Type*} [MetricSpace α] [SecondCountableTopology α] [MeasurableSpace α] [BorelSpace α]
-
 variable (μ : Measure α) [IsLocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure μ]
 
 /-- This is really an auxiliary result en route to `blimsup_cthickening_ae_le_of_eventually_mul_le`
chore: more backporting of simp changes from #10995 (#11001)

Co-authored-by: Patrick Massot <patrickmassot@free.fr> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -126,7 +126,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
     rw [disjoint_compl_right_iff_subset]
     refine' (closedBall_subset_cthickening (hw j) (M * r₁ (f j))).trans
       ((cthickening_mono hj' _).trans fun a ha => _)
-    simp only [mem_iUnion, exists_prop]
+    simp only [Z, mem_iUnion, exists_prop]
     exact ⟨f j, ⟨hf₁ j, hj.le.trans (hf₂ j)⟩, ha⟩
   have h₄ : ∀ᶠ j in atTop, μ (B j) ≤ C * μ (b j) :=
     (hr.eventually (IsUnifLocDoublingMeasure.eventually_measure_le_scaling_constant_mul'
@@ -211,12 +211,12 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
     refine' tendsto_nhdsWithin_iff.mpr
       ⟨Tendsto.if' hr tendsto_one_div_add_atTop_nhds_zero_nat, eventually_of_forall fun i => _⟩
     by_cases hi : 0 < r i
-    · simp [hi]
-    · simp only [hi, one_div, mem_Ioi, if_false, inv_pos]; positivity
+    · simp [r', hi]
+    · simp only [r', hi, one_div, mem_Ioi, if_false, inv_pos]; positivity
   have h₀ : ∀ i, p i ∧ 0 < r i → cthickening (r i) (s i) = cthickening (r' i) (s i) := by
     rintro i ⟨-, hi⟩; congr! 1; change r i = ite (0 < r i) (r i) _; simp [hi]
   have h₁ : ∀ i, p i ∧ 0 < r i → cthickening (M * r i) (s i) = cthickening (M * r' i) (s i) := by
-    rintro i ⟨-, hi⟩; simp only [hi, mul_ite, if_true]
+    rintro i ⟨-, hi⟩; simp only [r', hi, mul_ite, if_true]
   have h₂ : ∀ i, p i ∧ r i ≤ 0 → cthickening (M * r i) (s i) = cthickening (r i) (s i) := by
     rintro i ⟨-, hi⟩
     have hi' : M * r i ≤ 0 := mul_nonpos_of_nonneg_of_nonpos hM.le hi
@@ -278,13 +278,13 @@ theorem blimsup_thickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
       blimsup (fun i => thickening (r i) (s i)) atTop q := by
     refine' blimsup_congr' (eventually_of_forall fun i h => _)
     replace hi : 0 < r i := by contrapose! h; apply thickening_of_nonpos h
-    simp only [hi, iff_self_and, imp_true_iff]
+    simp only [q, hi, iff_self_and, imp_true_iff]
   have h₂ : blimsup (fun i => thickening (M * r i) (s i)) atTop p =
       blimsup (fun i => thickening (M * r i) (s i)) atTop q := by
     refine blimsup_congr' (eventually_of_forall fun i h ↦ ?_)
     replace h : 0 < r i := by
       rw [← mul_pos_iff_of_pos_left hM]; contrapose! h; apply thickening_of_nonpos h
-    simp only [h, iff_self_and, imp_true_iff]
+    simp only [q, h, iff_self_and, imp_true_iff]
   rw [h₁, h₂]
   exact blimsup_thickening_mul_ae_eq_aux μ q s hM r hr (eventually_of_forall fun i hi => hi.2)
 #align blimsup_thickening_mul_ae_eq blimsup_thickening_mul_ae_eq
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -89,8 +89,8 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
     tendsto_atTop_atTop.mpr fun j => ⟨f j, fun i hi => (hf₂ j).trans (hi.trans <| hf₂ i)⟩
   replace hr : Tendsto (r₁ ∘ f) atTop (𝓝[>] 0) := hr.comp hf₃
   replace hMr : ∀ᶠ j in atTop, M * r₁ (f j) ≤ r₂ (f j) := hf₃.eventually hMr
-  replace hf₀ : ∀ j, ∃ w ∈ s (f j), d ∈ closedBall w (2 * r₁ (f j))
-  · intro j
+  replace hf₀ : ∀ j, ∃ w ∈ s (f j), d ∈ closedBall w (2 * r₁ (f j)) := by
+    intro j
     specialize hrp (f j)
     rw [Pi.zero_apply] at hrp
     rcases eq_or_lt_of_le hrp with (hr0 | hrp')
@@ -136,12 +136,12 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
   rcases eq_or_ne (μ (B j)) ∞ with (hB | hB); · simp [hB]
   apply ENNReal.div_le_of_le_mul
   rw [ENNReal.coe_sub, ENNReal.coe_one, ENNReal.sub_mul fun _ _ => hB, one_mul]
-  replace hB : ↑C⁻¹ * μ (B j) ≠ ∞
-  · refine' ENNReal.mul_ne_top _ hB
+  replace hB : ↑C⁻¹ * μ (B j) ≠ ∞ := by
+    refine ENNReal.mul_ne_top ?_ hB
     rwa [ENNReal.coe_inv hC, Ne.def, ENNReal.inv_eq_top, ENNReal.coe_eq_zero]
   obtain ⟨hj₁ : Disjoint (b j) (W ∩ B j), hj₂ : μ (B j) ≤ C * μ (b j)⟩ := hj₀
-  replace hj₂ : ↑C⁻¹ * μ (B j) ≤ μ (b j)
-  · rw [ENNReal.coe_inv hC, ← ENNReal.div_eq_inv_mul]
+  replace hj₂ : ↑C⁻¹ * μ (B j) ≤ μ (b j) := by
+    rw [ENNReal.coe_inv hC, ← ENNReal.div_eq_inv_mul]
     exact ENNReal.div_le_of_le_mul' hj₂
   have hj₃ : ↑C⁻¹ * μ (B j) + μ (W ∩ B j) ≤ μ (B j) := by
     refine' le_trans (add_le_add_right hj₂ _) _
@@ -163,8 +163,8 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le (p : ℕ → Prop) {s : 
   let R₁ i := max 0 (r₁ i)
   let R₂ i := max 0 (r₂ i)
   have hRp : 0 ≤ R₁ := fun i => le_max_left 0 (r₁ i)
-  replace hMr : ∀ᶠ i in atTop, M * R₁ i ≤ R₂ i
-  · refine' hMr.mono fun i hi => _
+  replace hMr : ∀ᶠ i in atTop, M * R₁ i ≤ R₂ i := by
+    refine hMr.mono fun i hi ↦ ?_
     rw [mul_max_of_nonneg _ _ hM.le, mul_zero]
     exact max_le_max (le_refl 0) hi
   simp_rw [← cthickening_max_zero (r₁ _), ← cthickening_max_zero (r₂ _)]
@@ -251,8 +251,8 @@ theorem blimsup_thickening_mul_ae_eq_aux (p : ℕ → Prop) (s : ℕ → Set α)
       (blimsup (fun i => thickening (r i) (s i)) atTop p : Set α) := by
   have h₁ := blimsup_cthickening_ae_eq_blimsup_thickening (s := s) μ hr hr'
   have h₂ := blimsup_cthickening_mul_ae_eq μ p s hM r hr
-  replace hr : Tendsto (fun i => M * r i) atTop (𝓝 0); · convert hr.const_mul M; simp
-  replace hr' : ∀ᶠ i in atTop, p i → 0 < M * r i := hr'.mono fun i hi hip => mul_pos hM (hi hip)
+  replace hr : Tendsto (fun i => M * r i) atTop (𝓝 0) := by convert hr.const_mul M; simp
+  replace hr' : ∀ᶠ i in atTop, p i → 0 < M * r i := hr'.mono fun i hi hip ↦ mul_pos hM (hi hip)
   have h₃ := blimsup_cthickening_ae_eq_blimsup_thickening (s := s) μ hr hr'
   exact h₃.symm.trans (h₂.trans h₁)
 #align blimsup_thickening_mul_ae_eq_aux blimsup_thickening_mul_ae_eq_aux
@@ -277,13 +277,13 @@ theorem blimsup_thickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
   have h₁ : blimsup (fun i => thickening (r i) (s i)) atTop p =
       blimsup (fun i => thickening (r i) (s i)) atTop q := by
     refine' blimsup_congr' (eventually_of_forall fun i h => _)
-    replace hi : 0 < r i; · contrapose! h; apply thickening_of_nonpos h
+    replace hi : 0 < r i := by contrapose! h; apply thickening_of_nonpos h
     simp only [hi, iff_self_and, imp_true_iff]
   have h₂ : blimsup (fun i => thickening (M * r i) (s i)) atTop p =
       blimsup (fun i => thickening (M * r i) (s i)) atTop q := by
-    refine' blimsup_congr' (eventually_of_forall fun i h => _)
-    replace h : 0 < r i
-    · rw [← mul_pos_iff_of_pos_left hM]; contrapose! h; apply thickening_of_nonpos h
+    refine blimsup_congr' (eventually_of_forall fun i h ↦ ?_)
+    replace h : 0 < r i := by
+      rw [← mul_pos_iff_of_pos_left hM]; contrapose! h; apply thickening_of_nonpos h
     simp only [h, iff_self_and, imp_true_iff]
   rw [h₁, h₂]
   exact blimsup_thickening_mul_ae_eq_aux μ q s hM r hr (eventually_of_forall fun i hi => hi.2)
chore(Analysis/SpecificLimits/* and others): rename _0 -> _zero, _1 -> _one (#10077)

See here on Zulip.

This PR changes a bunch of names containing nhds_0 or/and lt_1 to nhds_zero or/and lt_one.

Diff
@@ -209,7 +209,7 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
   let r' : ℕ → ℝ := fun i => if 0 < r i then r i else 1 / ((i : ℝ) + 1)
   have hr' : Tendsto r' atTop (𝓝[>] 0) := by
     refine' tendsto_nhdsWithin_iff.mpr
-      ⟨Tendsto.if' hr tendsto_one_div_add_atTop_nhds_0_nat, eventually_of_forall fun i => _⟩
+      ⟨Tendsto.if' hr tendsto_one_div_add_atTop_nhds_zero_nat, eventually_of_forall fun i => _⟩
     by_cases hi : 0 < r i
     · simp [hi]
     · simp only [hi, one_div, mem_Ioi, if_false, inv_pos]; positivity
feat: 0 ≤ a * b ↔ (0 < a → 0 ≤ b) ∧ (0 < b → 0 ≤ a) (#9219)

I had a slightly logic-heavy argument that was nicely simplified by stating this lemma. Also fix a few lemma names.

From LeanAPAP and LeanCamCombi

Diff
@@ -282,7 +282,8 @@ theorem blimsup_thickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
   have h₂ : blimsup (fun i => thickening (M * r i) (s i)) atTop p =
       blimsup (fun i => thickening (M * r i) (s i)) atTop q := by
     refine' blimsup_congr' (eventually_of_forall fun i h => _)
-    replace h : 0 < r i; · rw [← zero_lt_mul_left hM]; contrapose! h; apply thickening_of_nonpos h
+    replace h : 0 < r i
+    · rw [← mul_pos_iff_of_pos_left hM]; contrapose! h; apply thickening_of_nonpos h
     simp only [h, iff_self_and, imp_true_iff]
   rw [h₁, h₂]
   exact blimsup_thickening_mul_ae_eq_aux μ q s hM r hr (eventually_of_forall fun i hi => hi.2)
chore: remove uses of cases' (#9171)

I literally went through and regex'd some uses of cases', replacing them with rcases; this is meant to be a low effort PR as I hope that tools can do this in the future.

rcases is an easier replacement than cases, though with better tools we could in future do a second pass converting simple rcases added here (and existing ones) to cases.

Diff
@@ -168,7 +168,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le (p : ℕ → Prop) {s : 
     rw [mul_max_of_nonneg _ _ hM.le, mul_zero]
     exact max_le_max (le_refl 0) hi
   simp_rw [← cthickening_max_zero (r₁ _), ← cthickening_max_zero (r₂ _)]
-  cases' le_or_lt 1 M with hM' hM'
+  rcases le_or_lt 1 M with hM' | hM'
   · apply HasSubset.Subset.eventuallyLE
     change _ ≤ _
     refine' mono_blimsup' (hMr.mono fun i hi _ => cthickening_mono _ (s i))
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -165,7 +165,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le (p : ℕ → Prop) {s : 
   have hRp : 0 ≤ R₁ := fun i => le_max_left 0 (r₁ i)
   replace hMr : ∀ᶠ i in atTop, M * R₁ i ≤ R₂ i
   · refine' hMr.mono fun i hi => _
-    rw [mul_max_of_nonneg _ _ hM.le, MulZeroClass.mul_zero]
+    rw [mul_max_of_nonneg _ _ hM.le, mul_zero]
     exact max_le_max (le_refl 0) hi
   simp_rw [← cthickening_max_zero (r₁ _), ← cthickening_max_zero (r₂ _)]
   cases' le_or_lt 1 M with hM' hM'
@@ -200,7 +200,7 @@ theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M
         (blimsup (fun i => cthickening (r i) (s i)) atTop p : Set α) := by
     clear p hr r; intro p r hr
     have hr' : Tendsto (fun i => M * r i) atTop (𝓝[>] 0) := by
-      convert TendstoNhdsWithinIoi.const_mul hM hr <;> simp only [MulZeroClass.mul_zero]
+      convert TendstoNhdsWithinIoi.const_mul hM hr <;> simp only [mul_zero]
     refine' eventuallyLE_antisymm_iff.mpr ⟨_, _⟩
     · exact blimsup_cthickening_ae_le_of_eventually_mul_le μ p (inv_pos.mpr hM) hr'
         (eventually_of_forall fun i => by rw [inv_mul_cancel_left₀ hM.ne' (r i)])
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -30,7 +30,7 @@ open Set Filter Metric MeasureTheory TopologicalSpace
 
 open scoped NNReal ENNReal Topology
 
-variable {α : Type _} [MetricSpace α] [SecondCountableTopology α] [MeasurableSpace α] [BorelSpace α]
+variable {α : Type*} [MetricSpace α] [SecondCountableTopology α] [MeasurableSpace α] [BorelSpace α]
 
 variable (μ : Measure α) [IsLocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure μ]
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2022 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
-
-! This file was ported from Lean 3 source module measure_theory.covering.liminf_limsup
-! leanprover-community/mathlib commit 5f6e827d81dfbeb6151d7016586ceeb0099b9655
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.MeasureTheory.Covering.DensityTheorem
 
+#align_import measure_theory.covering.liminf_limsup from "leanprover-community/mathlib"@"5f6e827d81dfbeb6151d7016586ceeb0099b9655"
+
 /-!
 # Liminf, limsup, and uniformly locally doubling measures.
 
fix: change compl precedence (#5586)

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -125,7 +125,7 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
     rw [eventually_atTop]
     refine'
       ⟨i, fun j hj hj' => Disjoint.inf_right (B j) <| Disjoint.inf_right' (blimsup Y₁ atTop p) _⟩
-    change Disjoint (b j) (Z iᶜ)
+    change Disjoint (b j) (Z i)ᶜ
     rw [disjoint_compl_right_iff_subset]
     refine' (closedBall_subset_cthickening (hw j) (M * r₁ (f j))).trans
       ((cthickening_mono hj' _).trans fun a ha => _)
chore: tidy various files (#5469)

Co-authored-by: Scott Morrison <scott@tqft.net>

Diff
@@ -40,7 +40,8 @@ variable (μ : Measure α) [IsLocallyFiniteMeasure μ] [IsUnifLocDoublingMeasure
 /-- This is really an auxiliary result en route to `blimsup_cthickening_ae_le_of_eventually_mul_le`
 (which is itself an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`).
 
-NB: The `set : α` type ascription is present because of issue #16932 on GitHub. -/
+NB: The `: Set α` type ascription is present because of
+https://github.com/leanprover-community/mathlib/issues/16932. -/
 theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s : ℕ → Set α}
     (hs : ∀ i, IsClosed (s i)) {r₁ r₂ : ℕ → ℝ} (hr : Tendsto r₁ atTop (𝓝[>] 0)) (hrp : 0 ≤ r₁)
     {M : ℝ} (hM : 0 < M) (hM' : M < 1) (hMr : ∀ᶠ i in atTop, M * r₁ i ≤ r₂ i) :
@@ -155,7 +156,8 @@ theorem blimsup_cthickening_ae_le_of_eventually_mul_le_aux (p : ℕ → Prop) {s
 
 /-- This is really an auxiliary result en route to `blimsup_cthickening_mul_ae_eq`.
 
-NB: The `Set α` type ascription is present because of issue #16932 on GitHub. -/
+NB: The `: Set α` type ascription is present because of
+https://github.com/leanprover-community/mathlib/issues/16932. -/
 theorem blimsup_cthickening_ae_le_of_eventually_mul_le (p : ℕ → Prop) {s : ℕ → Set α} {M : ℝ}
     (hM : 0 < M) {r₁ r₂ : ℕ → ℝ} (hr : Tendsto r₁ atTop (𝓝[>] 0))
     (hMr : ∀ᶠ i in atTop, M * r₁ i ≤ r₂ i) :
@@ -190,7 +192,8 @@ This lemma is a generalisation of Lemma 9 appearing on page 217 of
 
 See also `blimsup_thickening_mul_ae_eq`.
 
-NB: The `Set α` type ascription is present because of issue #16932 on GitHub. -/
+NB: The `: Set α` type ascription is present because of
+https://github.com/leanprover-community/mathlib/issues/16932. -/
 theorem blimsup_cthickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M : ℝ} (hM : 0 < M)
     (r : ℕ → ℝ) (hr : Tendsto r atTop (𝓝 0)) :
     (blimsup (fun i => cthickening (M * r i) (s i)) atTop p : Set α) =ᵐ[μ]
@@ -267,7 +270,8 @@ This lemma is a generalisation of Lemma 9 appearing on page 217 of
 
 See also `blimsup_cthickening_mul_ae_eq`.
 
-NB: The `Set α` type ascription is present because of issue #16932 on GitHub. -/
+NB: The `: Set α` type ascription is present because of
+https://github.com/leanprover-community/mathlib/issues/16932. -/
 theorem blimsup_thickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M : ℝ} (hM : 0 < M) (r : ℕ → ℝ)
     (hr : Tendsto r atTop (𝓝 0)) :
     (blimsup (fun i => thickening (M * r i) (s i)) atTop p : Set α) =ᵐ[μ]
feat: port MeasureTheory.Covering.LiminfLimsup (#4797)

Dependencies 12 + 989

990 files ported (98.8%)
452457 lines ported (98.8%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file