topology.metric_space.hausdorff_dimensionMathlib.Topology.MetricSpace.HausdorffDimension

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -572,7 +572,7 @@ theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) : dimH (Metric.ball
   · rw [← ENNReal.coe_natCast]
     have : μH[Fintype.card ι] (Metric.ball x r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι) := by
       rw [hausdorff_measure_pi_real, Real.volume_pi_ball _ hr]
-    refine' dimH_of_hausdorffMeasure_ne_zero_ne_top _ _ <;> rw [NNReal.coe_nat_cast, this]
+    refine' dimH_of_hausdorffMeasure_ne_zero_ne_top _ _ <;> rw [NNReal.coe_natCast, this]
     · simp [pow_pos (mul_pos (zero_lt_two' ℝ) hr)]
     · exact ENNReal.ofReal_ne_top
 #align real.dimH_ball_pi Real.dimH_ball_pi
Diff
@@ -569,7 +569,7 @@ theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) : dimH (Metric.ball
   cases isEmpty_or_nonempty ι
   · rwa [dimH_subsingleton, eq_comm, Nat.cast_eq_zero, Fintype.card_eq_zero_iff]
     exact fun x _ y _ => Subsingleton.elim x y
-  · rw [← ENNReal.coe_nat]
+  · rw [← ENNReal.coe_natCast]
     have : μH[Fintype.card ι] (Metric.ball x r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι) := by
       rw [hausdorff_measure_pi_real, Real.volume_pi_ball _ hr]
     refine' dimH_of_hausdorffMeasure_ne_zero_ne_top _ _ <;> rw [NNReal.coe_nat_cast, this]
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Analysis.Calculus.ContDiff
+import Analysis.Calculus.ContDiff.Basic
 import MeasureTheory.Measure.Hausdorff
 
 #align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"44e2ae8cffc713925494e4975ee31ec1d06929b3"
Diff
@@ -120,9 +120,9 @@ theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝ≥0) (hd : μH[d] s = ∞),
 #print hausdorffMeasure_of_lt_dimH /-
 theorem hausdorffMeasure_of_lt_dimH {s : Set X} {d : ℝ≥0} (h : ↑d < dimH s) : μH[d] s = ∞ :=
   by
-  simp only [dimH_def, lt_iSup_iff] at h 
+  simp only [dimH_def, lt_iSup_iff] at h
   rcases h with ⟨d', hsd', hdd'⟩
-  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hdd' 
+  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hdd'
   exact top_unique (hsd' ▸ hausdorff_measure_mono hdd'.le _)
 #align hausdorff_measure_of_lt_dimH hausdorffMeasure_of_lt_dimH
 -/
@@ -148,9 +148,9 @@ theorem le_dimH_of_hausdorffMeasure_eq_top {s : Set X} {d : ℝ≥0} (h : μH[d]
 #print hausdorffMeasure_of_dimH_lt /-
 theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) : μH[d] s = 0 :=
   by
-  rw [dimH_def] at h 
+  rw [dimH_def] at h
   rcases ENNReal.lt_iff_exists_nnreal_btwn.1 h with ⟨d', hsd', hd'd⟩
-  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hd'd 
+  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hd'd
   exact (hausdorff_measure_zero_or_top hd'd s).resolve_right fun h => hsd'.not_le <| le_iSup₂ d' h
 #align hausdorff_measure_of_dimH_lt hausdorffMeasure_of_dimH_lt
 -/
@@ -349,7 +349,7 @@ theorem HolderOnWith.dimH_image_le (h : HolderOnWith C r f s) (hr : 0 < r) :
   borelize X Y
   refine' dimH_le fun d hd => _
   have := h.hausdorff_measure_image_le hr d.coe_nonneg
-  rw [hd, ENNReal.coe_rpow_of_nonneg _ d.coe_nonneg, top_le_iff] at this 
+  rw [hd, ENNReal.coe_rpow_of_nonneg _ d.coe_nonneg, top_le_iff] at this
   have Hrd : μH[(r * d : ℝ≥0)] s = ⊤ := by contrapose this;
     exact ENNReal.mul_ne_top ENNReal.coe_ne_top this
   rw [ENNReal.le_div_iff_mul_le, mul_comm, ← ENNReal.coe_mul]
@@ -390,7 +390,7 @@ theorem dimH_image_le_of_locally_holder_on [SecondCountableTopology X] {r : ℝ
     dimH (f '' s) ≤ dimH s / r := by
   choose! C t htn hC using hf
   rcases countable_cover_nhds_within htn with ⟨u, hus, huc, huU⟩
-  replace huU := inter_eq_self_of_subset_left huU; rw [inter_Union₂] at huU 
+  replace huU := inter_eq_self_of_subset_left huU; rw [inter_Union₂] at huU
   rw [← huU, image_Union₂, dimH_bUnion huc, dimH_bUnion huc]; simp only [ENNReal.iSup_div]
   exact iSup₂_mono fun x hx => ((hC x (hus hx)).mono (inter_subset_right _ _)).dimH_image_le hr
 #align dimH_image_le_of_locally_holder_on dimH_image_le_of_locally_holder_on
@@ -475,7 +475,7 @@ theorem dimH_preimage_le (hf : AntilipschitzWith K f) (s : Set Y) : dimH (f ⁻
   borelize X Y
   refine' dimH_le fun d hd => le_dimH_of_hausdorffMeasure_eq_top _
   have := hf.hausdorff_measure_preimage_le d.coe_nonneg s
-  rw [hd, top_le_iff] at this 
+  rw [hd, top_le_iff] at this
   contrapose! this
   exact ENNReal.mul_ne_top (by simp) this
 #align antilipschitz_with.dimH_preimage_le AntilipschitzWith.dimH_preimage_le
@@ -641,7 +641,7 @@ variable {E F : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimens
 theorem dense_compl_of_dimH_lt_finrank {s : Set E} (hs : dimH s < finrank ℝ E) : Dense (sᶜ) :=
   by
   refine' fun x => mem_closure_iff_nhds.2 fun t ht => nonempty_iff_ne_empty.2 fun he => hs.not_le _
-  rw [← diff_eq, diff_eq_empty] at he 
+  rw [← diff_eq, diff_eq_empty] at he
   rw [← Real.dimH_of_mem_nhds ht]
   exact dimH_mono he
 #align dense_compl_of_dimH_lt_finrank dense_compl_of_dimH_lt_finrank
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Mathbin.Analysis.Calculus.ContDiff
-import Mathbin.MeasureTheory.Measure.Hausdorff
+import Analysis.Calculus.ContDiff
+import MeasureTheory.Measure.Hausdorff
 
 #align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"44e2ae8cffc713925494e4975ee31ec1d06929b3"
 
Diff
@@ -441,30 +441,30 @@ theorem dimH_range_le (h : LipschitzWith K f) : dimH (range f) ≤ dimH (univ :
 
 end LipschitzWith
 
-#print dimH_image_le_of_locally_lipschitz_on /-
+#print dimH_image_le_of_locally_lipschitzOn /-
 /-- If `s` is a set in an extended metric space `X` with second countable topology and `f : X → Y`
 is Lipschitz in a neighborhood within `s` of every point `x ∈ s`, then the Hausdorff dimension of
 the image `f '' s` is at most the Hausdorff dimension of `s`. -/
-theorem dimH_image_le_of_locally_lipschitz_on [SecondCountableTopology X] {f : X → Y} {s : Set X}
+theorem dimH_image_le_of_locally_lipschitzOn [SecondCountableTopology X] {f : X → Y} {s : Set X}
     (hf : ∀ x ∈ s, ∃ C : ℝ≥0, ∃ t ∈ 𝓝[s] x, LipschitzOnWith C f t) : dimH (f '' s) ≤ dimH s :=
   by
   have : ∀ x ∈ s, ∃ C : ℝ≥0, ∃ t ∈ 𝓝[s] x, HolderOnWith C 1 f t := by
     simpa only [holderOnWith_one] using hf
   simpa only [ENNReal.coe_one, div_one] using dimH_image_le_of_locally_holder_on zero_lt_one this
-#align dimH_image_le_of_locally_lipschitz_on dimH_image_le_of_locally_lipschitz_on
+#align dimH_image_le_of_locally_lipschitz_on dimH_image_le_of_locally_lipschitzOn
 -/
 
-#print dimH_range_le_of_locally_lipschitz_on /-
+#print dimH_range_le_of_locally_lipschitzOn /-
 /-- If `f : X → Y` is Lipschitz in a neighborhood of each point `x : X`, then the Hausdorff
 dimension of `range f` is at most the Hausdorff dimension of `X`. -/
-theorem dimH_range_le_of_locally_lipschitz_on [SecondCountableTopology X] {f : X → Y}
+theorem dimH_range_le_of_locally_lipschitzOn [SecondCountableTopology X] {f : X → Y}
     (hf : ∀ x : X, ∃ C : ℝ≥0, ∃ s ∈ 𝓝 x, LipschitzOnWith C f s) :
     dimH (range f) ≤ dimH (univ : Set X) :=
   by
   rw [← image_univ]
-  refine' dimH_image_le_of_locally_lipschitz_on fun x _ => _
+  refine' dimH_image_le_of_locally_lipschitzOn fun x _ => _
   simpa only [exists_prop, nhdsWithin_univ] using hf x
-#align dimH_range_le_of_locally_lipschitz_on dimH_range_le_of_locally_lipschitz_on
+#align dimH_range_le_of_locally_lipschitz_on dimH_range_le_of_locally_lipschitzOn
 -/
 
 namespace AntilipschitzWith
@@ -663,7 +663,7 @@ dimension of `s`.
 TODO: do we actually need `convex ℝ s`? -/
 theorem ContDiffOn.dimH_image_le {f : E → F} {s t : Set E} (hf : ContDiffOn ℝ 1 f s)
     (hc : Convex ℝ s) (ht : t ⊆ s) : dimH (f '' t) ≤ dimH t :=
-  dimH_image_le_of_locally_lipschitz_on fun x hx =>
+  dimH_image_le_of_locally_lipschitzOn fun x hx =>
     let ⟨C, u, hu, hf⟩ := (hf x (ht hx)).exists_lipschitzOnWith hc
     ⟨C, u, nhdsWithin_mono _ ht hu, hf⟩
 #align cont_diff_on.dimH_image_le ContDiffOn.dimH_image_le
Diff
@@ -196,7 +196,7 @@ theorem dimH_subsingleton {s : Set X} (h : s.Subsingleton) : dimH s = 0 :=
 #align dimH_subsingleton dimH_subsingleton
 -/
 
-alias dimH_subsingleton ← Set.Subsingleton.dimH_zero
+alias Set.Subsingleton.dimH_zero := dimH_subsingleton
 #align set.subsingleton.dimH_zero Set.Subsingleton.dimH_zero
 
 #print dimH_empty /-
@@ -257,7 +257,7 @@ theorem dimH_countable {s : Set X} (hs : s.Countable) : dimH s = 0 :=
 #align dimH_countable dimH_countable
 -/
 
-alias dimH_countable ← Set.Countable.dimH_zero
+alias Set.Countable.dimH_zero := dimH_countable
 #align set.countable.dimH_zero Set.Countable.dimH_zero
 
 #print dimH_finite /-
@@ -266,7 +266,7 @@ theorem dimH_finite {s : Set X} (hs : s.Finite) : dimH s = 0 :=
 #align dimH_finite dimH_finite
 -/
 
-alias dimH_finite ← Set.Finite.dimH_zero
+alias Set.Finite.dimH_zero := dimH_finite
 #align set.finite.dimH_zero Set.Finite.dimH_zero
 
 #print dimH_coe_finset /-
@@ -276,7 +276,7 @@ theorem dimH_coe_finset (s : Finset X) : dimH (s : Set X) = 0 :=
 #align dimH_coe_finset dimH_coe_finset
 -/
 
-alias dimH_coe_finset ← Finset.dimH_zero
+alias Finset.dimH_zero := dimH_coe_finset
 #align finset.dimH_zero Finset.dimH_zero
 
 /-!
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module topology.metric_space.hausdorff_dimension
-! leanprover-community/mathlib commit 44e2ae8cffc713925494e4975ee31ec1d06929b3
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Calculus.ContDiff
 import Mathbin.MeasureTheory.Measure.Hausdorff
 
+#align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"44e2ae8cffc713925494e4975ee31ec1d06929b3"
+
 /-!
 # Hausdorff dimension
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 
 ! This file was ported from Lean 3 source module topology.metric_space.hausdorff_dimension
-! leanprover-community/mathlib commit 8f9fea08977f7e450770933ee6abb20733b47c92
+! leanprover-community/mathlib commit 44e2ae8cffc713925494e4975ee31ec1d06929b3
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.MeasureTheory.Measure.Hausdorff
 /-!
 # Hausdorff dimension
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 The Hausdorff dimension of a set `X` in an (extended) metric space is the unique number
 `dimH s : ℝ≥0∞` such that for any `d : ℝ≥0` we have
 
Diff
@@ -117,6 +117,7 @@ theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝ≥0) (hd : μH[d] s = ∞),
 #align dimH_def dimH_def
 -/
 
+#print hausdorffMeasure_of_lt_dimH /-
 theorem hausdorffMeasure_of_lt_dimH {s : Set X} {d : ℝ≥0} (h : ↑d < dimH s) : μH[d] s = ∞ :=
   by
   simp only [dimH_def, lt_iSup_iff] at h 
@@ -124,6 +125,7 @@ theorem hausdorffMeasure_of_lt_dimH {s : Set X} {d : ℝ≥0} (h : ↑d < dimH s
   rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hdd' 
   exact top_unique (hsd' ▸ hausdorff_measure_mono hdd'.le _)
 #align hausdorff_measure_of_lt_dimH hausdorffMeasure_of_lt_dimH
+-/
 
 #print dimH_le /-
 theorem dimH_le {s : Set X} {d : ℝ≥0∞} (H : ∀ d' : ℝ≥0, μH[d'] s = ∞ → ↑d' ≤ d) : dimH s ≤ d :=
@@ -143,6 +145,7 @@ theorem le_dimH_of_hausdorffMeasure_eq_top {s : Set X} {d : ℝ≥0} (h : μH[d]
 #align le_dimH_of_hausdorff_measure_eq_top le_dimH_of_hausdorffMeasure_eq_top
 -/
 
+#print hausdorffMeasure_of_dimH_lt /-
 theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) : μH[d] s = 0 :=
   by
   rw [dimH_def] at h 
@@ -150,6 +153,7 @@ theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) :
   rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hd'd 
   exact (hausdorff_measure_zero_or_top hd'd s).resolve_right fun h => hsd'.not_le <| le_iSup₂ d' h
 #align hausdorff_measure_of_dimH_lt hausdorffMeasure_of_dimH_lt
+-/
 
 #print measure_zero_of_dimH_lt /-
 theorem measure_zero_of_dimH_lt {μ : Measure X} {d : ℝ≥0} (h : μ ≪ μH[d]) {s : Set X}
@@ -173,13 +177,16 @@ theorem dimH_of_hausdorffMeasure_ne_zero_ne_top {d : ℝ≥0} {s : Set X} (h : 
 
 end Measurable
 
+#print dimH_mono /-
 @[mono]
 theorem dimH_mono {s t : Set X} (h : s ⊆ t) : dimH s ≤ dimH t :=
   by
   borelize X
   exact dimH_le fun d hd => le_dimH_of_hausdorffMeasure_eq_top <| top_unique <| hd ▸ measure_mono h
 #align dimH_mono dimH_mono
+-/
 
+#print dimH_subsingleton /-
 theorem dimH_subsingleton {s : Set X} (h : s.Subsingleton) : dimH s = 0 :=
   by
   borelize X
@@ -187,20 +194,26 @@ theorem dimH_subsingleton {s : Set X} (h : s.Subsingleton) : dimH s = 0 :=
   refine' dimH_le_of_hausdorffMeasure_ne_top _
   exact ((hausdorff_measure_le_one_of_subsingleton h le_rfl).trans_lt ENNReal.one_lt_top).Ne
 #align dimH_subsingleton dimH_subsingleton
+-/
 
 alias dimH_subsingleton ← Set.Subsingleton.dimH_zero
 #align set.subsingleton.dimH_zero Set.Subsingleton.dimH_zero
 
+#print dimH_empty /-
 @[simp]
 theorem dimH_empty : dimH (∅ : Set X) = 0 :=
   subsingleton_empty.dimH_zero
 #align dimH_empty dimH_empty
+-/
 
+#print dimH_singleton /-
 @[simp]
 theorem dimH_singleton (x : X) : dimH ({x} : Set X) = 0 :=
   subsingleton_singleton.dimH_zero
 #align dimH_singleton dimH_singleton
+-/
 
+#print dimH_iUnion /-
 @[simp]
 theorem dimH_iUnion [Encodable ι] (s : ι → Set X) : dimH (⋃ i, s i) = ⨆ i, dimH (s i) :=
   by
@@ -212,7 +225,9 @@ theorem dimH_iUnion [Encodable ι] (s : ι → Set X) : dimH (⋃ i, s i) = ⨆
   rw [measure_Union_null this]
   exact ENNReal.zero_ne_top
 #align dimH_Union dimH_iUnion
+-/
 
+#print dimH_bUnion /-
 @[simp]
 theorem dimH_bUnion {s : Set ι} (hs : s.Countable) (t : ι → Set X) :
     dimH (⋃ i ∈ s, t i) = ⨆ i ∈ s, dimH (t i) :=
@@ -220,11 +235,14 @@ theorem dimH_bUnion {s : Set ι} (hs : s.Countable) (t : ι → Set X) :
   haveI := hs.to_encodable
   rw [bUnion_eq_Union, dimH_iUnion, ← iSup_subtype'']
 #align dimH_bUnion dimH_bUnion
+-/
 
+#print dimH_sUnion /-
 @[simp]
 theorem dimH_sUnion {S : Set (Set X)} (hS : S.Countable) : dimH (⋃₀ S) = ⨆ s ∈ S, dimH s := by
   rw [sUnion_eq_bUnion, dimH_bUnion hS]
 #align dimH_sUnion dimH_sUnion
+-/
 
 #print dimH_union /-
 @[simp]
@@ -233,24 +251,30 @@ theorem dimH_union (s t : Set X) : dimH (s ∪ t) = max (dimH s) (dimH t) := by
 #align dimH_union dimH_union
 -/
 
+#print dimH_countable /-
 theorem dimH_countable {s : Set X} (hs : s.Countable) : dimH s = 0 :=
   biUnion_of_singleton s ▸ by simp only [dimH_bUnion hs, dimH_singleton, ENNReal.iSup_zero_eq_zero]
 #align dimH_countable dimH_countable
+-/
 
 alias dimH_countable ← Set.Countable.dimH_zero
 #align set.countable.dimH_zero Set.Countable.dimH_zero
 
+#print dimH_finite /-
 theorem dimH_finite {s : Set X} (hs : s.Finite) : dimH s = 0 :=
   hs.Countable.dimH_zero
 #align dimH_finite dimH_finite
+-/
 
 alias dimH_finite ← Set.Finite.dimH_zero
 #align set.finite.dimH_zero Set.Finite.dimH_zero
 
+#print dimH_coe_finset /-
 @[simp]
 theorem dimH_coe_finset (s : Finset X) : dimH (s : Set X) = 0 :=
   s.finite_toSet.dimH_zero
 #align dimH_coe_finset dimH_coe_finset
+-/
 
 alias dimH_coe_finset ← Finset.dimH_zero
 #align finset.dimH_zero Finset.dimH_zero
@@ -264,6 +288,7 @@ section
 
 variable [SecondCountableTopology X]
 
+#print exists_mem_nhdsWithin_lt_dimH_of_lt_dimH /-
 /-- If `r` is less than the Hausdorff dimension of a set `s` in an (extended) metric space with
 second countable topology, then there exists a point `x ∈ s` such that every neighborhood
 `t` of `x` within `s` has Hausdorff dimension greater than `r`. -/
@@ -276,7 +301,9 @@ theorem exists_mem_nhdsWithin_lt_dimH_of_lt_dimH {s : Set X} {r : ℝ≥0∞} (h
     _ = ⨆ x ∈ S, dimH (t x) := (dimH_bUnion hSc _)
     _ ≤ r := iSup₂_le fun x hx => htr x <| hSs hx
 #align exists_mem_nhds_within_lt_dimH_of_lt_dimH exists_mem_nhdsWithin_lt_dimH_of_lt_dimH
+-/
 
+#print bsupr_limsup_dimH /-
 /-- In an (extended) metric space with second countable topology, the Hausdorff dimension
 of a set `s` is the supremum over `x ∈ s` of the limit superiors of `dimH t` along
 `(𝓝[s] x).small_sets`. -/
@@ -291,7 +318,9 @@ theorem bsupr_limsup_dimH (s : Set X) : (⨆ x ∈ s, limsup dimH (𝓝[s] x).sm
     rcases eventually_small_sets.1 hb with ⟨t, htx, ht⟩
     exact (hxr t htx).le.trans (ht t subset.rfl)
 #align bsupr_limsup_dimH bsupr_limsup_dimH
+-/
 
+#print iSup_limsup_dimH /-
 /-- In an (extended) metric space with second countable topology, the Hausdorff dimension
 of a set `s` is the supremum over all `x` of the limit superiors of `dimH t` along
 `(𝓝[s] x).small_sets`. -/
@@ -302,6 +331,7 @@ theorem iSup_limsup_dimH (s : Set X) : (⨆ x, limsup dimH (𝓝[s] x).smallSets
     exact eventually_small_sets.2 ⟨s, self_mem_nhdsWithin, fun t => dimH_mono⟩
   · rw [← bsupr_limsup_dimH]; exact iSup₂_le_iSup _ _
 #align supr_limsup_dimH iSup_limsup_dimH
+-/
 
 end
 
@@ -312,6 +342,7 @@ end
 
 variable {C K r : ℝ≥0} {f : X → Y} {s t : Set X}
 
+#print HolderOnWith.dimH_image_le /-
 /-- If `f` is a Hölder continuous map with exponent `r > 0`, then `dimH (f '' s) ≤ dimH s / r`. -/
 theorem HolderOnWith.dimH_image_le (h : HolderOnWith C r f s) (hr : 0 < r) :
     dimH (f '' s) ≤ dimH s / r := by
@@ -325,25 +356,31 @@ theorem HolderOnWith.dimH_image_le (h : HolderOnWith C r f s) (hr : 0 < r) :
   exacts [le_dimH_of_hausdorffMeasure_eq_top Hrd, Or.inl (mt ENNReal.coe_eq_zero.1 hr.ne'),
     Or.inl ENNReal.coe_ne_top]
 #align holder_on_with.dimH_image_le HolderOnWith.dimH_image_le
+-/
 
 namespace HolderWith
 
+#print HolderWith.dimH_image_le /-
 /-- If `f : X → Y` is Hölder continuous with a positive exponent `r`, then the Hausdorff dimension
 of the image of a set `s` is at most `dimH s / r`. -/
 theorem dimH_image_le (h : HolderWith C r f) (hr : 0 < r) (s : Set X) :
     dimH (f '' s) ≤ dimH s / r :=
   (h.HolderOnWith s).dimH_image_le hr
 #align holder_with.dimH_image_le HolderWith.dimH_image_le
+-/
 
+#print HolderWith.dimH_range_le /-
 /-- If `f` is a Hölder continuous map with exponent `r > 0`, then the Hausdorff dimension of its
 range is at most the Hausdorff dimension of its domain divided by `r`. -/
 theorem dimH_range_le (h : HolderWith C r f) (hr : 0 < r) :
     dimH (range f) ≤ dimH (univ : Set X) / r :=
   @image_univ _ _ f ▸ h.dimH_image_le hr univ
 #align holder_with.dimH_range_le HolderWith.dimH_range_le
+-/
 
 end HolderWith
 
+#print dimH_image_le_of_locally_holder_on /-
 /-- If `s` is a set in a space `X` with second countable topology and `f : X → Y` is Hölder
 continuous in a neighborhood within `s` of every point `x ∈ s` with the same positive exponent `r`
 but possibly different coefficients, then the Hausdorff dimension of the image `f '' s` is at most
@@ -357,7 +394,9 @@ theorem dimH_image_le_of_locally_holder_on [SecondCountableTopology X] {r : ℝ
   rw [← huU, image_Union₂, dimH_bUnion huc, dimH_bUnion huc]; simp only [ENNReal.iSup_div]
   exact iSup₂_mono fun x hx => ((hC x (hus hx)).mono (inter_subset_right _ _)).dimH_image_le hr
 #align dimH_image_le_of_locally_holder_on dimH_image_le_of_locally_holder_on
+-/
 
+#print dimH_range_le_of_locally_holder_on /-
 /-- If `f : X → Y` is Hölder continuous in a neighborhood of every point `x : X` with the same
 positive exponent `r` but possibly different coefficients, then the Hausdorff dimension of the range
 of `f` is at most the Hausdorff dimension of `X` divided by `r`. -/
@@ -369,32 +408,40 @@ theorem dimH_range_le_of_locally_holder_on [SecondCountableTopology X] {r : ℝ
   refine' dimH_image_le_of_locally_holder_on hr fun x _ => _
   simpa only [exists_prop, nhdsWithin_univ] using hf x
 #align dimH_range_le_of_locally_holder_on dimH_range_le_of_locally_holder_on
+-/
 
 /-!
 ### Hausdorff dimension and Lipschitz continuity
 -/
 
 
+#print LipschitzOnWith.dimH_image_le /-
 /-- If `f : X → Y` is Lipschitz continuous on `s`, then `dimH (f '' s) ≤ dimH s`. -/
 theorem LipschitzOnWith.dimH_image_le (h : LipschitzOnWith K f s) : dimH (f '' s) ≤ dimH s := by
   simpa using h.holder_on_with.dimH_image_le zero_lt_one
 #align lipschitz_on_with.dimH_image_le LipschitzOnWith.dimH_image_le
+-/
 
 namespace LipschitzWith
 
+#print LipschitzWith.dimH_image_le /-
 /-- If `f` is a Lipschitz continuous map, then `dimH (f '' s) ≤ dimH s`. -/
 theorem dimH_image_le (h : LipschitzWith K f) (s : Set X) : dimH (f '' s) ≤ dimH s :=
   (h.LipschitzOnWith s).dimH_image_le
 #align lipschitz_with.dimH_image_le LipschitzWith.dimH_image_le
+-/
 
+#print LipschitzWith.dimH_range_le /-
 /-- If `f` is a Lipschitz continuous map, then the Hausdorff dimension of its range is at most the
 Hausdorff dimension of its domain. -/
 theorem dimH_range_le (h : LipschitzWith K f) : dimH (range f) ≤ dimH (univ : Set X) :=
   @image_univ _ _ f ▸ h.dimH_image_le univ
 #align lipschitz_with.dimH_range_le LipschitzWith.dimH_range_le
+-/
 
 end LipschitzWith
 
+#print dimH_image_le_of_locally_lipschitz_on /-
 /-- If `s` is a set in an extended metric space `X` with second countable topology and `f : X → Y`
 is Lipschitz in a neighborhood within `s` of every point `x ∈ s`, then the Hausdorff dimension of
 the image `f '' s` is at most the Hausdorff dimension of `s`. -/
@@ -405,7 +452,9 @@ theorem dimH_image_le_of_locally_lipschitz_on [SecondCountableTopology X] {f : X
     simpa only [holderOnWith_one] using hf
   simpa only [ENNReal.coe_one, div_one] using dimH_image_le_of_locally_holder_on zero_lt_one this
 #align dimH_image_le_of_locally_lipschitz_on dimH_image_le_of_locally_lipschitz_on
+-/
 
+#print dimH_range_le_of_locally_lipschitz_on /-
 /-- If `f : X → Y` is Lipschitz in a neighborhood of each point `x : X`, then the Hausdorff
 dimension of `range f` is at most the Hausdorff dimension of `X`. -/
 theorem dimH_range_le_of_locally_lipschitz_on [SecondCountableTopology X] {f : X → Y}
@@ -416,9 +465,11 @@ theorem dimH_range_le_of_locally_lipschitz_on [SecondCountableTopology X] {f : X
   refine' dimH_image_le_of_locally_lipschitz_on fun x _ => _
   simpa only [exists_prop, nhdsWithin_univ] using hf x
 #align dimH_range_le_of_locally_lipschitz_on dimH_range_le_of_locally_lipschitz_on
+-/
 
 namespace AntilipschitzWith
 
+#print AntilipschitzWith.dimH_preimage_le /-
 theorem dimH_preimage_le (hf : AntilipschitzWith K f) (s : Set Y) : dimH (f ⁻¹' s) ≤ dimH s :=
   by
   borelize X Y
@@ -428,12 +479,15 @@ theorem dimH_preimage_le (hf : AntilipschitzWith K f) (s : Set Y) : dimH (f ⁻
   contrapose! this
   exact ENNReal.mul_ne_top (by simp) this
 #align antilipschitz_with.dimH_preimage_le AntilipschitzWith.dimH_preimage_le
+-/
 
+#print AntilipschitzWith.le_dimH_image /-
 theorem le_dimH_image (hf : AntilipschitzWith K f) (s : Set X) : dimH s ≤ dimH (f '' s) :=
   calc
     dimH s ≤ dimH (f ⁻¹' (f '' s)) := dimH_mono (subset_preimage_image _ _)
     _ ≤ dimH (f '' s) := hf.dimH_preimage_le _
 #align antilipschitz_with.le_dimH_image AntilipschitzWith.le_dimH_image
+-/
 
 end AntilipschitzWith
 
@@ -442,25 +496,33 @@ end AntilipschitzWith
 -/
 
 
+#print Isometry.dimH_image /-
 theorem Isometry.dimH_image (hf : Isometry f) (s : Set X) : dimH (f '' s) = dimH s :=
   le_antisymm (hf.lipschitz.dimH_image_le _) (hf.antilipschitz.le_dimH_image _)
 #align isometry.dimH_image Isometry.dimH_image
+-/
 
 namespace IsometryEquiv
 
+#print IsometryEquiv.dimH_image /-
 @[simp]
 theorem dimH_image (e : X ≃ᵢ Y) (s : Set X) : dimH (e '' s) = dimH s :=
   e.Isometry.dimH_image s
 #align isometry_equiv.dimH_image IsometryEquiv.dimH_image
+-/
 
+#print IsometryEquiv.dimH_preimage /-
 @[simp]
 theorem dimH_preimage (e : X ≃ᵢ Y) (s : Set Y) : dimH (e ⁻¹' s) = dimH s := by
   rw [← e.image_symm, e.symm.dimH_image]
 #align isometry_equiv.dimH_preimage IsometryEquiv.dimH_preimage
+-/
 
+#print IsometryEquiv.dimH_univ /-
 theorem dimH_univ (e : X ≃ᵢ Y) : dimH (univ : Set X) = dimH (univ : Set Y) := by
   rw [← e.dimH_preimage univ, preimage_univ]
 #align isometry_equiv.dimH_univ IsometryEquiv.dimH_univ
+-/
 
 end IsometryEquiv
 
@@ -469,20 +531,26 @@ namespace ContinuousLinearEquiv
 variable {𝕜 E F : Type _} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E]
   [NormedAddCommGroup F] [NormedSpace 𝕜 F]
 
+#print ContinuousLinearEquiv.dimH_image /-
 @[simp]
 theorem dimH_image (e : E ≃L[𝕜] F) (s : Set E) : dimH (e '' s) = dimH s :=
   le_antisymm (e.lipschitz.dimH_image_le s) <| by
     simpa only [e.symm_image_image] using e.symm.lipschitz.dimH_image_le (e '' s)
 #align continuous_linear_equiv.dimH_image ContinuousLinearEquiv.dimH_image
+-/
 
+#print ContinuousLinearEquiv.dimH_preimage /-
 @[simp]
 theorem dimH_preimage (e : E ≃L[𝕜] F) (s : Set F) : dimH (e ⁻¹' s) = dimH s := by
   rw [← e.image_symm_eq_preimage, e.symm.dimH_image]
 #align continuous_linear_equiv.dimH_preimage ContinuousLinearEquiv.dimH_preimage
+-/
 
+#print ContinuousLinearEquiv.dimH_univ /-
 theorem dimH_univ (e : E ≃L[𝕜] F) : dimH (univ : Set E) = dimH (univ : Set F) := by
   rw [← e.dimH_preimage, preimage_univ]
 #align continuous_linear_equiv.dimH_univ ContinuousLinearEquiv.dimH_univ
+-/
 
 end ContinuousLinearEquiv
 
@@ -495,6 +563,7 @@ namespace Real
 
 variable {E : Type _} [Fintype ι] [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
 
+#print Real.dimH_ball_pi /-
 theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) : dimH (Metric.ball x r) = Fintype.card ι :=
   by
   cases isEmpty_or_nonempty ι
@@ -507,10 +576,13 @@ theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) : dimH (Metric.ball
     · simp [pow_pos (mul_pos (zero_lt_two' ℝ) hr)]
     · exact ENNReal.ofReal_ne_top
 #align real.dimH_ball_pi Real.dimH_ball_pi
+-/
 
+#print Real.dimH_ball_pi_fin /-
 theorem dimH_ball_pi_fin {n : ℕ} (x : Fin n → ℝ) {r : ℝ} (hr : 0 < r) :
     dimH (Metric.ball x r) = n := by rw [dimH_ball_pi x hr, Fintype.card_fin]
 #align real.dimH_ball_pi_fin Real.dimH_ball_pi_fin
+-/
 
 #print Real.dimH_univ_pi /-
 theorem dimH_univ_pi (ι : Type _) [Fintype ι] : dimH (univ : Set (ι → ℝ)) = Fintype.card ι := by
@@ -565,6 +637,7 @@ end Real
 variable {E F : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
   [NormedAddCommGroup F] [NormedSpace ℝ F]
 
+#print dense_compl_of_dimH_lt_finrank /-
 theorem dense_compl_of_dimH_lt_finrank {s : Set E} (hs : dimH s < finrank ℝ E) : Dense (sᶜ) :=
   by
   refine' fun x => mem_closure_iff_nhds.2 fun t ht => nonempty_iff_ne_empty.2 fun he => hs.not_le _
@@ -572,6 +645,7 @@ theorem dense_compl_of_dimH_lt_finrank {s : Set E} (hs : dimH s < finrank ℝ E)
   rw [← Real.dimH_of_mem_nhds ht]
   exact dimH_mono he
 #align dense_compl_of_dimH_lt_finrank dense_compl_of_dimH_lt_finrank
+-/
 
 /-!
 ### Hausdorff dimension and `C¹`-smooth maps
@@ -581,6 +655,7 @@ dimension of sets.
 -/
 
 
+#print ContDiffOn.dimH_image_le /-
 /-- Let `f` be a function defined on a finite dimensional real normed space. If `f` is `C¹`-smooth
 on a convex set `s`, then the Hausdorff dimension of `f '' s` is less than or equal to the Hausdorff
 dimension of `s`.
@@ -592,7 +667,9 @@ theorem ContDiffOn.dimH_image_le {f : E → F} {s t : Set E} (hf : ContDiffOn 
     let ⟨C, u, hu, hf⟩ := (hf x (ht hx)).exists_lipschitzOnWith hc
     ⟨C, u, nhdsWithin_mono _ ht hu, hf⟩
 #align cont_diff_on.dimH_image_le ContDiffOn.dimH_image_le
+-/
 
+#print ContDiff.dimH_range_le /-
 /-- The Hausdorff dimension of the range of a `C¹`-smooth function defined on a finite dimensional
 real normed space is at most the dimension of its domain as a vector space over `ℝ`. -/
 theorem ContDiff.dimH_range_le {f : E → F} (h : ContDiff ℝ 1 f) : dimH (range f) ≤ finrank ℝ E :=
@@ -601,7 +678,9 @@ theorem ContDiff.dimH_range_le {f : E → F} (h : ContDiff ℝ 1 f) : dimH (rang
     _ ≤ dimH (univ : Set E) := (h.ContDiffOn.dimH_image_le convex_univ Subset.rfl)
     _ = finrank ℝ E := Real.dimH_univ_eq_finrank E
 #align cont_diff.dimH_range_le ContDiff.dimH_range_le
+-/
 
+#print ContDiffOn.dense_compl_image_of_dimH_lt_finrank /-
 /-- A particular case of Sard's Theorem. Let `f : E → F` be a map between finite dimensional real
 vector spaces. Suppose that `f` is `C¹` smooth on a convex set `s` of Hausdorff dimension strictly
 less than the dimension of `F`. Then the complement of the image `f '' s` is dense in `F`. -/
@@ -610,7 +689,9 @@ theorem ContDiffOn.dense_compl_image_of_dimH_lt_finrank [FiniteDimensional ℝ F
     (htF : dimH t < finrank ℝ F) : Dense ((f '' t)ᶜ) :=
   dense_compl_of_dimH_lt_finrank <| (h.dimH_image_le hc ht).trans_lt htF
 #align cont_diff_on.dense_compl_image_of_dimH_lt_finrank ContDiffOn.dense_compl_image_of_dimH_lt_finrank
+-/
 
+#print ContDiff.dense_compl_range_of_finrank_lt_finrank /-
 /-- A particular case of Sard's Theorem. If `f` is a `C¹` smooth map from a real vector space to a
 real vector space `F` of strictly larger dimension, then the complement of the range of `f` is dense
 in `F`. -/
@@ -618,4 +699,5 @@ theorem ContDiff.dense_compl_range_of_finrank_lt_finrank [FiniteDimensional ℝ
     (h : ContDiff ℝ 1 f) (hEF : finrank ℝ E < finrank ℝ F) : Dense (range fᶜ) :=
   dense_compl_of_dimH_lt_finrank <| h.dimH_range_le.trans_lt <| Nat.cast_lt.2 hEF
 #align cont_diff.dense_compl_range_of_finrank_lt_finrank ContDiff.dense_compl_range_of_finrank_lt_finrank
+-/
 
Diff
@@ -93,10 +93,12 @@ open MeasureTheory MeasureTheory.Measure Set TopologicalSpace FiniteDimensional
 
 variable {ι X Y : Type _} [EMetricSpace X] [EMetricSpace Y]
 
+#print dimH /-
 /-- Hausdorff dimension of a set in an (e)metric space. -/
 noncomputable irreducible_def dimH (s : Set X) : ℝ≥0∞ := by borelize X;
   exact ⨆ (d : ℝ≥0) (hd : @hausdorff_measure X _ _ ⟨rfl⟩ d s = ∞), d
 #align dimH dimH
+-/
 
 /-!
 ### Basic properties
@@ -107,11 +109,13 @@ section Measurable
 
 variable [MeasurableSpace X] [BorelSpace X]
 
+#print dimH_def /-
 /-- Unfold the definition of `dimH` using `[measurable_space X] [borel_space X]` from the
 environment. -/
 theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝ≥0) (hd : μH[d] s = ∞), d := by borelize X;
   rw [dimH]
 #align dimH_def dimH_def
+-/
 
 theorem hausdorffMeasure_of_lt_dimH {s : Set X} {d : ℝ≥0} (h : ↑d < dimH s) : μH[d] s = ∞ :=
   by
@@ -121,17 +125,23 @@ theorem hausdorffMeasure_of_lt_dimH {s : Set X} {d : ℝ≥0} (h : ↑d < dimH s
   exact top_unique (hsd' ▸ hausdorff_measure_mono hdd'.le _)
 #align hausdorff_measure_of_lt_dimH hausdorffMeasure_of_lt_dimH
 
+#print dimH_le /-
 theorem dimH_le {s : Set X} {d : ℝ≥0∞} (H : ∀ d' : ℝ≥0, μH[d'] s = ∞ → ↑d' ≤ d) : dimH s ≤ d :=
   (dimH_def s).trans_le <| iSup₂_le H
 #align dimH_le dimH_le
+-/
 
+#print dimH_le_of_hausdorffMeasure_ne_top /-
 theorem dimH_le_of_hausdorffMeasure_ne_top {s : Set X} {d : ℝ≥0} (h : μH[d] s ≠ ∞) : dimH s ≤ d :=
   le_of_not_lt <| mt hausdorffMeasure_of_lt_dimH h
 #align dimH_le_of_hausdorff_measure_ne_top dimH_le_of_hausdorffMeasure_ne_top
+-/
 
+#print le_dimH_of_hausdorffMeasure_eq_top /-
 theorem le_dimH_of_hausdorffMeasure_eq_top {s : Set X} {d : ℝ≥0} (h : μH[d] s = ∞) : ↑d ≤ dimH s :=
   by rw [dimH_def]; exact le_iSup₂ d h
 #align le_dimH_of_hausdorff_measure_eq_top le_dimH_of_hausdorffMeasure_eq_top
+-/
 
 theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) : μH[d] s = 0 :=
   by
@@ -141,19 +151,25 @@ theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) :
   exact (hausdorff_measure_zero_or_top hd'd s).resolve_right fun h => hsd'.not_le <| le_iSup₂ d' h
 #align hausdorff_measure_of_dimH_lt hausdorffMeasure_of_dimH_lt
 
+#print measure_zero_of_dimH_lt /-
 theorem measure_zero_of_dimH_lt {μ : Measure X} {d : ℝ≥0} (h : μ ≪ μH[d]) {s : Set X}
     (hd : dimH s < d) : μ s = 0 :=
   h <| hausdorffMeasure_of_dimH_lt hd
 #align measure_zero_of_dimH_lt measure_zero_of_dimH_lt
+-/
 
+#print le_dimH_of_hausdorffMeasure_ne_zero /-
 theorem le_dimH_of_hausdorffMeasure_ne_zero {s : Set X} {d : ℝ≥0} (h : μH[d] s ≠ 0) : ↑d ≤ dimH s :=
   le_of_not_lt <| mt hausdorffMeasure_of_dimH_lt h
 #align le_dimH_of_hausdorff_measure_ne_zero le_dimH_of_hausdorffMeasure_ne_zero
+-/
 
+#print dimH_of_hausdorffMeasure_ne_zero_ne_top /-
 theorem dimH_of_hausdorffMeasure_ne_zero_ne_top {d : ℝ≥0} {s : Set X} (h : μH[d] s ≠ 0)
     (h' : μH[d] s ≠ ∞) : dimH s = d :=
   le_antisymm (dimH_le_of_hausdorffMeasure_ne_top h') (le_dimH_of_hausdorffMeasure_ne_zero h)
 #align dimH_of_hausdorff_measure_ne_zero_ne_top dimH_of_hausdorffMeasure_ne_zero_ne_top
+-/
 
 end Measurable
 
@@ -210,10 +226,12 @@ theorem dimH_sUnion {S : Set (Set X)} (hS : S.Countable) : dimH (⋃₀ S) = ⨆
   rw [sUnion_eq_bUnion, dimH_bUnion hS]
 #align dimH_sUnion dimH_sUnion
 
+#print dimH_union /-
 @[simp]
 theorem dimH_union (s t : Set X) : dimH (s ∪ t) = max (dimH s) (dimH t) := by
   rw [union_eq_Union, dimH_iUnion, iSup_bool_eq, cond, cond, ENNReal.sup_eq_max]
 #align dimH_union dimH_union
+-/
 
 theorem dimH_countable {s : Set X} (hs : s.Countable) : dimH s = 0 :=
   biUnion_of_singleton s ▸ by simp only [dimH_bUnion hs, dimH_singleton, ENNReal.iSup_zero_eq_zero]
@@ -494,15 +512,20 @@ theorem dimH_ball_pi_fin {n : ℕ} (x : Fin n → ℝ) {r : ℝ} (hr : 0 < r) :
     dimH (Metric.ball x r) = n := by rw [dimH_ball_pi x hr, Fintype.card_fin]
 #align real.dimH_ball_pi_fin Real.dimH_ball_pi_fin
 
+#print Real.dimH_univ_pi /-
 theorem dimH_univ_pi (ι : Type _) [Fintype ι] : dimH (univ : Set (ι → ℝ)) = Fintype.card ι := by
   simp only [← Metric.iUnion_ball_nat_succ (0 : ι → ℝ), dimH_iUnion,
     dimH_ball_pi _ (Nat.cast_add_one_pos _), iSup_const]
 #align real.dimH_univ_pi Real.dimH_univ_pi
+-/
 
+#print Real.dimH_univ_pi_fin /-
 theorem dimH_univ_pi_fin (n : ℕ) : dimH (univ : Set (Fin n → ℝ)) = n := by
   rw [dimH_univ_pi, Fintype.card_fin]
 #align real.dimH_univ_pi_fin Real.dimH_univ_pi_fin
+-/
 
+#print Real.dimH_of_mem_nhds /-
 theorem dimH_of_mem_nhds {x : E} {s : Set E} (h : s ∈ 𝓝 x) : dimH s = finrank ℝ E :=
   by
   have e : E ≃L[ℝ] Fin (finrank ℝ E) → ℝ :=
@@ -514,21 +537,28 @@ theorem dimH_of_mem_nhds {x : E} {s : Set E} (h : s ∈ 𝓝 x) : dimH s = finra
     rcases metric.nhds_basis_ball.mem_iff.1 this with ⟨r, hr0, hr⟩
     simpa only [dimH_ball_pi_fin (e x) hr0] using dimH_mono hr
 #align real.dimH_of_mem_nhds Real.dimH_of_mem_nhds
+-/
 
+#print Real.dimH_of_nonempty_interior /-
 theorem dimH_of_nonempty_interior {s : Set E} (h : (interior s).Nonempty) : dimH s = finrank ℝ E :=
   let ⟨x, hx⟩ := h
   dimH_of_mem_nhds (mem_interior_iff_mem_nhds.1 hx)
 #align real.dimH_of_nonempty_interior Real.dimH_of_nonempty_interior
+-/
 
 variable (E)
 
+#print Real.dimH_univ_eq_finrank /-
 theorem dimH_univ_eq_finrank : dimH (univ : Set E) = finrank ℝ E :=
   dimH_of_mem_nhds (@univ_mem _ (𝓝 0))
 #align real.dimH_univ_eq_finrank Real.dimH_univ_eq_finrank
+-/
 
+#print Real.dimH_univ /-
 theorem dimH_univ : dimH (univ : Set ℝ) = 1 := by
   rw [dimH_univ_eq_finrank ℝ, FiniteDimensional.finrank_self, Nat.cast_one]
 #align real.dimH_univ Real.dimH_univ
+-/
 
 end Real
 
Diff
@@ -257,7 +257,6 @@ theorem exists_mem_nhdsWithin_lt_dimH_of_lt_dimH {s : Set X} {r : ℝ≥0∞} (h
     dimH s ≤ dimH (⋃ x ∈ S, t x) := dimH_mono hSU
     _ = ⨆ x ∈ S, dimH (t x) := (dimH_bUnion hSc _)
     _ ≤ r := iSup₂_le fun x hx => htr x <| hSs hx
-    
 #align exists_mem_nhds_within_lt_dimH_of_lt_dimH exists_mem_nhdsWithin_lt_dimH_of_lt_dimH
 
 /-- In an (extended) metric space with second countable topology, the Hausdorff dimension
@@ -416,7 +415,6 @@ theorem le_dimH_image (hf : AntilipschitzWith K f) (s : Set X) : dimH s ≤ dimH
   calc
     dimH s ≤ dimH (f ⁻¹' (f '' s)) := dimH_mono (subset_preimage_image _ _)
     _ ≤ dimH (f '' s) := hf.dimH_preimage_le _
-    
 #align antilipschitz_with.le_dimH_image AntilipschitzWith.le_dimH_image
 
 end AntilipschitzWith
@@ -572,7 +570,6 @@ theorem ContDiff.dimH_range_le {f : E → F} (h : ContDiff ℝ 1 f) : dimH (rang
     dimH (range f) = dimH (f '' univ) := by rw [image_univ]
     _ ≤ dimH (univ : Set E) := (h.ContDiffOn.dimH_image_le convex_univ Subset.rfl)
     _ = finrank ℝ E := Real.dimH_univ_eq_finrank E
-    
 #align cont_diff.dimH_range_le ContDiff.dimH_range_le
 
 /-- A particular case of Sard's Theorem. Let `f : E → F` be a map between finite dimensional real
Diff
@@ -115,9 +115,9 @@ theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝ≥0) (hd : μH[d] s = ∞),
 
 theorem hausdorffMeasure_of_lt_dimH {s : Set X} {d : ℝ≥0} (h : ↑d < dimH s) : μH[d] s = ∞ :=
   by
-  simp only [dimH_def, lt_iSup_iff] at h
+  simp only [dimH_def, lt_iSup_iff] at h 
   rcases h with ⟨d', hsd', hdd'⟩
-  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hdd'
+  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hdd' 
   exact top_unique (hsd' ▸ hausdorff_measure_mono hdd'.le _)
 #align hausdorff_measure_of_lt_dimH hausdorffMeasure_of_lt_dimH
 
@@ -135,9 +135,9 @@ theorem le_dimH_of_hausdorffMeasure_eq_top {s : Set X} {d : ℝ≥0} (h : μH[d]
 
 theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) : μH[d] s = 0 :=
   by
-  rw [dimH_def] at h
+  rw [dimH_def] at h 
   rcases ENNReal.lt_iff_exists_nnreal_btwn.1 h with ⟨d', hsd', hd'd⟩
-  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hd'd
+  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hd'd 
   exact (hausdorff_measure_zero_or_top hd'd s).resolve_right fun h => hsd'.not_le <| le_iSup₂ d' h
 #align hausdorff_measure_of_dimH_lt hausdorffMeasure_of_dimH_lt
 
@@ -301,11 +301,11 @@ theorem HolderOnWith.dimH_image_le (h : HolderOnWith C r f s) (hr : 0 < r) :
   borelize X Y
   refine' dimH_le fun d hd => _
   have := h.hausdorff_measure_image_le hr d.coe_nonneg
-  rw [hd, ENNReal.coe_rpow_of_nonneg _ d.coe_nonneg, top_le_iff] at this
+  rw [hd, ENNReal.coe_rpow_of_nonneg _ d.coe_nonneg, top_le_iff] at this 
   have Hrd : μH[(r * d : ℝ≥0)] s = ⊤ := by contrapose this;
     exact ENNReal.mul_ne_top ENNReal.coe_ne_top this
   rw [ENNReal.le_div_iff_mul_le, mul_comm, ← ENNReal.coe_mul]
-  exacts[le_dimH_of_hausdorffMeasure_eq_top Hrd, Or.inl (mt ENNReal.coe_eq_zero.1 hr.ne'),
+  exacts [le_dimH_of_hausdorffMeasure_eq_top Hrd, Or.inl (mt ENNReal.coe_eq_zero.1 hr.ne'),
     Or.inl ENNReal.coe_ne_top]
 #align holder_on_with.dimH_image_le HolderOnWith.dimH_image_le
 
@@ -336,7 +336,7 @@ theorem dimH_image_le_of_locally_holder_on [SecondCountableTopology X] {r : ℝ
     dimH (f '' s) ≤ dimH s / r := by
   choose! C t htn hC using hf
   rcases countable_cover_nhds_within htn with ⟨u, hus, huc, huU⟩
-  replace huU := inter_eq_self_of_subset_left huU; rw [inter_Union₂] at huU
+  replace huU := inter_eq_self_of_subset_left huU; rw [inter_Union₂] at huU 
   rw [← huU, image_Union₂, dimH_bUnion huc, dimH_bUnion huc]; simp only [ENNReal.iSup_div]
   exact iSup₂_mono fun x hx => ((hC x (hus hx)).mono (inter_subset_right _ _)).dimH_image_le hr
 #align dimH_image_le_of_locally_holder_on dimH_image_le_of_locally_holder_on
@@ -407,7 +407,7 @@ theorem dimH_preimage_le (hf : AntilipschitzWith K f) (s : Set Y) : dimH (f ⁻
   borelize X Y
   refine' dimH_le fun d hd => le_dimH_of_hausdorffMeasure_eq_top _
   have := hf.hausdorff_measure_preimage_le d.coe_nonneg s
-  rw [hd, top_le_iff] at this
+  rw [hd, top_le_iff] at this 
   contrapose! this
   exact ENNReal.mul_ne_top (by simp) this
 #align antilipschitz_with.dimH_preimage_le AntilipschitzWith.dimH_preimage_le
@@ -540,7 +540,7 @@ variable {E F : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimens
 theorem dense_compl_of_dimH_lt_finrank {s : Set E} (hs : dimH s < finrank ℝ E) : Dense (sᶜ) :=
   by
   refine' fun x => mem_closure_iff_nhds.2 fun t ht => nonempty_iff_ne_empty.2 fun he => hs.not_le _
-  rw [← diff_eq, diff_eq_empty] at he
+  rw [← diff_eq, diff_eq_empty] at he 
   rw [← Real.dimH_of_mem_nhds ht]
   exact dimH_mono he
 #align dense_compl_of_dimH_lt_finrank dense_compl_of_dimH_lt_finrank
Diff
@@ -87,7 +87,7 @@ Hausdorff measure, Hausdorff dimension, dimension
 -/
 
 
-open MeasureTheory ENNReal NNReal Topology
+open scoped MeasureTheory ENNReal NNReal Topology
 
 open MeasureTheory MeasureTheory.Measure Set TopologicalSpace FiniteDimensional Filter
 
Diff
@@ -94,9 +94,7 @@ open MeasureTheory MeasureTheory.Measure Set TopologicalSpace FiniteDimensional
 variable {ι X Y : Type _} [EMetricSpace X] [EMetricSpace Y]
 
 /-- Hausdorff dimension of a set in an (e)metric space. -/
-noncomputable irreducible_def dimH (s : Set X) : ℝ≥0∞ :=
-  by
-  borelize X
+noncomputable irreducible_def dimH (s : Set X) : ℝ≥0∞ := by borelize X;
   exact ⨆ (d : ℝ≥0) (hd : @hausdorff_measure X _ _ ⟨rfl⟩ d s = ∞), d
 #align dimH dimH
 
@@ -111,9 +109,7 @@ variable [MeasurableSpace X] [BorelSpace X]
 
 /-- Unfold the definition of `dimH` using `[measurable_space X] [borel_space X]` from the
 environment. -/
-theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝ≥0) (hd : μH[d] s = ∞), d :=
-  by
-  borelize X
+theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝ≥0) (hd : μH[d] s = ∞), d := by borelize X;
   rw [dimH]
 #align dimH_def dimH_def
 
@@ -134,9 +130,7 @@ theorem dimH_le_of_hausdorffMeasure_ne_top {s : Set X} {d : ℝ≥0} (h : μH[d]
 #align dimH_le_of_hausdorff_measure_ne_top dimH_le_of_hausdorffMeasure_ne_top
 
 theorem le_dimH_of_hausdorffMeasure_eq_top {s : Set X} {d : ℝ≥0} (h : μH[d] s = ∞) : ↑d ≤ dimH s :=
-  by
-  rw [dimH_def]
-  exact le_iSup₂ d h
+  by rw [dimH_def]; exact le_iSup₂ d h
 #align le_dimH_of_hausdorff_measure_eq_top le_dimH_of_hausdorffMeasure_eq_top
 
 theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) : μH[d] s = 0 :=
@@ -276,9 +270,7 @@ theorem bsupr_limsup_dimH (s : Set X) : (⨆ x ∈ s, limsup dimH (𝓝[s] x).sm
     exact eventually_small_sets.2 ⟨s, self_mem_nhdsWithin, fun t => dimH_mono⟩
   · refine' le_of_forall_ge_of_dense fun r hr => _
     rcases exists_mem_nhdsWithin_lt_dimH_of_lt_dimH hr with ⟨x, hxs, hxr⟩
-    refine' le_iSup₂_of_le x hxs _
-    rw [limsup_eq]
-    refine' le_sInf fun b hb => _
+    refine' le_iSup₂_of_le x hxs _; rw [limsup_eq]; refine' le_sInf fun b hb => _
     rcases eventually_small_sets.1 hb with ⟨t, htx, ht⟩
     exact (hxr t htx).le.trans (ht t subset.rfl)
 #align bsupr_limsup_dimH bsupr_limsup_dimH
@@ -291,8 +283,7 @@ theorem iSup_limsup_dimH (s : Set X) : (⨆ x, limsup dimH (𝓝[s] x).smallSets
   refine' le_antisymm (iSup_le fun x => _) _
   · refine' Limsup_le_of_le (by infer_param) (eventually_map.2 _)
     exact eventually_small_sets.2 ⟨s, self_mem_nhdsWithin, fun t => dimH_mono⟩
-  · rw [← bsupr_limsup_dimH]
-    exact iSup₂_le_iSup _ _
+  · rw [← bsupr_limsup_dimH]; exact iSup₂_le_iSup _ _
 #align supr_limsup_dimH iSup_limsup_dimH
 
 end
@@ -311,8 +302,7 @@ theorem HolderOnWith.dimH_image_le (h : HolderOnWith C r f s) (hr : 0 < r) :
   refine' dimH_le fun d hd => _
   have := h.hausdorff_measure_image_le hr d.coe_nonneg
   rw [hd, ENNReal.coe_rpow_of_nonneg _ d.coe_nonneg, top_le_iff] at this
-  have Hrd : μH[(r * d : ℝ≥0)] s = ⊤ := by
-    contrapose this
+  have Hrd : μH[(r * d : ℝ≥0)] s = ⊤ := by contrapose this;
     exact ENNReal.mul_ne_top ENNReal.coe_ne_top this
   rw [ENNReal.le_div_iff_mul_le, mul_comm, ← ENNReal.coe_mul]
   exacts[le_dimH_of_hausdorffMeasure_eq_top Hrd, Or.inl (mt ENNReal.coe_eq_zero.1 hr.ne'),
@@ -522,9 +512,7 @@ theorem dimH_of_mem_nhds {x : E} {s : Set E} (h : s ∈ 𝓝 x) : dimH s = finra
   rw [← e.dimH_image]
   refine' le_antisymm _ _
   · exact (dimH_mono (subset_univ _)).trans_eq (dimH_univ_pi_fin _)
-  · have : e '' s ∈ 𝓝 (e x) := by
-      rw [← e.map_nhds_eq]
-      exact image_mem_map h
+  · have : e '' s ∈ 𝓝 (e x) := by rw [← e.map_nhds_eq]; exact image_mem_map h
     rcases metric.nhds_basis_ball.mem_iff.1 this with ⟨r, hr0, hr⟩
     simpa only [dimH_ball_pi_fin (e x) hr0] using dimH_mono hr
 #align real.dimH_of_mem_nhds Real.dimH_of_mem_nhds
Diff
@@ -4,10 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 
 ! This file was ported from Lean 3 source module topology.metric_space.hausdorff_dimension
-! leanprover-community/mathlib commit 57ac39bd365c2f80589a700f9fbb664d3a1a30c2
+! leanprover-community/mathlib commit 8f9fea08977f7e450770933ee6abb20733b47c92
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
+import Mathbin.Analysis.Calculus.ContDiff
 import Mathbin.MeasureTheory.Measure.Hausdorff
 
 /-!
Diff
@@ -118,14 +118,14 @@ theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝ≥0) (hd : μH[d] s = ∞),
 
 theorem hausdorffMeasure_of_lt_dimH {s : Set X} {d : ℝ≥0} (h : ↑d < dimH s) : μH[d] s = ∞ :=
   by
-  simp only [dimH_def, lt_supᵢ_iff] at h
+  simp only [dimH_def, lt_iSup_iff] at h
   rcases h with ⟨d', hsd', hdd'⟩
   rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hdd'
   exact top_unique (hsd' ▸ hausdorff_measure_mono hdd'.le _)
 #align hausdorff_measure_of_lt_dimH hausdorffMeasure_of_lt_dimH
 
 theorem dimH_le {s : Set X} {d : ℝ≥0∞} (H : ∀ d' : ℝ≥0, μH[d'] s = ∞ → ↑d' ≤ d) : dimH s ≤ d :=
-  (dimH_def s).trans_le <| supᵢ₂_le H
+  (dimH_def s).trans_le <| iSup₂_le H
 #align dimH_le dimH_le
 
 theorem dimH_le_of_hausdorffMeasure_ne_top {s : Set X} {d : ℝ≥0} (h : μH[d] s ≠ ∞) : dimH s ≤ d :=
@@ -135,7 +135,7 @@ theorem dimH_le_of_hausdorffMeasure_ne_top {s : Set X} {d : ℝ≥0} (h : μH[d]
 theorem le_dimH_of_hausdorffMeasure_eq_top {s : Set X} {d : ℝ≥0} (h : μH[d] s = ∞) : ↑d ≤ dimH s :=
   by
   rw [dimH_def]
-  exact le_supᵢ₂ d h
+  exact le_iSup₂ d h
 #align le_dimH_of_hausdorff_measure_eq_top le_dimH_of_hausdorffMeasure_eq_top
 
 theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) : μH[d] s = 0 :=
@@ -143,7 +143,7 @@ theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) :
   rw [dimH_def] at h
   rcases ENNReal.lt_iff_exists_nnreal_btwn.1 h with ⟨d', hsd', hd'd⟩
   rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hd'd
-  exact (hausdorff_measure_zero_or_top hd'd s).resolve_right fun h => hsd'.not_le <| le_supᵢ₂ d' h
+  exact (hausdorff_measure_zero_or_top hd'd s).resolve_right fun h => hsd'.not_le <| le_iSup₂ d' h
 #align hausdorff_measure_of_dimH_lt hausdorffMeasure_of_dimH_lt
 
 theorem measure_zero_of_dimH_lt {μ : Measure X} {d : ℝ≥0} (h : μ ≪ μH[d]) {s : Set X}
@@ -191,37 +191,37 @@ theorem dimH_singleton (x : X) : dimH ({x} : Set X) = 0 :=
 #align dimH_singleton dimH_singleton
 
 @[simp]
-theorem dimH_unionᵢ [Encodable ι] (s : ι → Set X) : dimH (⋃ i, s i) = ⨆ i, dimH (s i) :=
+theorem dimH_iUnion [Encodable ι] (s : ι → Set X) : dimH (⋃ i, s i) = ⨆ i, dimH (s i) :=
   by
   borelize X
-  refine' le_antisymm (dimH_le fun d hd => _) (supᵢ_le fun i => dimH_mono <| subset_Union _ _)
+  refine' le_antisymm (dimH_le fun d hd => _) (iSup_le fun i => dimH_mono <| subset_Union _ _)
   contrapose! hd
   have : ∀ i, μH[d] (s i) = 0 := fun i =>
-    hausdorffMeasure_of_dimH_lt ((le_supᵢ (fun i => dimH (s i)) i).trans_lt hd)
+    hausdorffMeasure_of_dimH_lt ((le_iSup (fun i => dimH (s i)) i).trans_lt hd)
   rw [measure_Union_null this]
   exact ENNReal.zero_ne_top
-#align dimH_Union dimH_unionᵢ
+#align dimH_Union dimH_iUnion
 
 @[simp]
 theorem dimH_bUnion {s : Set ι} (hs : s.Countable) (t : ι → Set X) :
     dimH (⋃ i ∈ s, t i) = ⨆ i ∈ s, dimH (t i) :=
   by
   haveI := hs.to_encodable
-  rw [bUnion_eq_Union, dimH_unionᵢ, ← supᵢ_subtype'']
+  rw [bUnion_eq_Union, dimH_iUnion, ← iSup_subtype'']
 #align dimH_bUnion dimH_bUnion
 
 @[simp]
-theorem dimH_unionₛ {S : Set (Set X)} (hS : S.Countable) : dimH (⋃₀ S) = ⨆ s ∈ S, dimH s := by
+theorem dimH_sUnion {S : Set (Set X)} (hS : S.Countable) : dimH (⋃₀ S) = ⨆ s ∈ S, dimH s := by
   rw [sUnion_eq_bUnion, dimH_bUnion hS]
-#align dimH_sUnion dimH_unionₛ
+#align dimH_sUnion dimH_sUnion
 
 @[simp]
 theorem dimH_union (s t : Set X) : dimH (s ∪ t) = max (dimH s) (dimH t) := by
-  rw [union_eq_Union, dimH_unionᵢ, supᵢ_bool_eq, cond, cond, ENNReal.sup_eq_max]
+  rw [union_eq_Union, dimH_iUnion, iSup_bool_eq, cond, cond, ENNReal.sup_eq_max]
 #align dimH_union dimH_union
 
 theorem dimH_countable {s : Set X} (hs : s.Countable) : dimH s = 0 :=
-  bunionᵢ_of_singleton s ▸ by simp only [dimH_bUnion hs, dimH_singleton, ENNReal.supᵢ_zero_eq_zero]
+  biUnion_of_singleton s ▸ by simp only [dimH_bUnion hs, dimH_singleton, ENNReal.iSup_zero_eq_zero]
 #align dimH_countable dimH_countable
 
 alias dimH_countable ← Set.Countable.dimH_zero
@@ -261,7 +261,7 @@ theorem exists_mem_nhdsWithin_lt_dimH_of_lt_dimH {s : Set X} {r : ℝ≥0∞} (h
   calc
     dimH s ≤ dimH (⋃ x ∈ S, t x) := dimH_mono hSU
     _ = ⨆ x ∈ S, dimH (t x) := (dimH_bUnion hSc _)
-    _ ≤ r := supᵢ₂_le fun x hx => htr x <| hSs hx
+    _ ≤ r := iSup₂_le fun x hx => htr x <| hSs hx
     
 #align exists_mem_nhds_within_lt_dimH_of_lt_dimH exists_mem_nhdsWithin_lt_dimH_of_lt_dimH
 
@@ -270,14 +270,14 @@ of a set `s` is the supremum over `x ∈ s` of the limit superiors of `dimH t` a
 `(𝓝[s] x).small_sets`. -/
 theorem bsupr_limsup_dimH (s : Set X) : (⨆ x ∈ s, limsup dimH (𝓝[s] x).smallSets) = dimH s :=
   by
-  refine' le_antisymm (supᵢ₂_le fun x hx => _) _
+  refine' le_antisymm (iSup₂_le fun x hx => _) _
   · refine' Limsup_le_of_le (by infer_param) (eventually_map.2 _)
     exact eventually_small_sets.2 ⟨s, self_mem_nhdsWithin, fun t => dimH_mono⟩
   · refine' le_of_forall_ge_of_dense fun r hr => _
     rcases exists_mem_nhdsWithin_lt_dimH_of_lt_dimH hr with ⟨x, hxs, hxr⟩
-    refine' le_supᵢ₂_of_le x hxs _
+    refine' le_iSup₂_of_le x hxs _
     rw [limsup_eq]
-    refine' le_infₛ fun b hb => _
+    refine' le_sInf fun b hb => _
     rcases eventually_small_sets.1 hb with ⟨t, htx, ht⟩
     exact (hxr t htx).le.trans (ht t subset.rfl)
 #align bsupr_limsup_dimH bsupr_limsup_dimH
@@ -285,14 +285,14 @@ theorem bsupr_limsup_dimH (s : Set X) : (⨆ x ∈ s, limsup dimH (𝓝[s] x).sm
 /-- In an (extended) metric space with second countable topology, the Hausdorff dimension
 of a set `s` is the supremum over all `x` of the limit superiors of `dimH t` along
 `(𝓝[s] x).small_sets`. -/
-theorem supᵢ_limsup_dimH (s : Set X) : (⨆ x, limsup dimH (𝓝[s] x).smallSets) = dimH s :=
+theorem iSup_limsup_dimH (s : Set X) : (⨆ x, limsup dimH (𝓝[s] x).smallSets) = dimH s :=
   by
-  refine' le_antisymm (supᵢ_le fun x => _) _
+  refine' le_antisymm (iSup_le fun x => _) _
   · refine' Limsup_le_of_le (by infer_param) (eventually_map.2 _)
     exact eventually_small_sets.2 ⟨s, self_mem_nhdsWithin, fun t => dimH_mono⟩
   · rw [← bsupr_limsup_dimH]
-    exact supᵢ₂_le_supᵢ _ _
-#align supr_limsup_dimH supᵢ_limsup_dimH
+    exact iSup₂_le_iSup _ _
+#align supr_limsup_dimH iSup_limsup_dimH
 
 end
 
@@ -346,8 +346,8 @@ theorem dimH_image_le_of_locally_holder_on [SecondCountableTopology X] {r : ℝ
   choose! C t htn hC using hf
   rcases countable_cover_nhds_within htn with ⟨u, hus, huc, huU⟩
   replace huU := inter_eq_self_of_subset_left huU; rw [inter_Union₂] at huU
-  rw [← huU, image_Union₂, dimH_bUnion huc, dimH_bUnion huc]; simp only [ENNReal.supᵢ_div]
-  exact supᵢ₂_mono fun x hx => ((hC x (hus hx)).mono (inter_subset_right _ _)).dimH_image_le hr
+  rw [← huU, image_Union₂, dimH_bUnion huc, dimH_bUnion huc]; simp only [ENNReal.iSup_div]
+  exact iSup₂_mono fun x hx => ((hC x (hus hx)).mono (inter_subset_right _ _)).dimH_image_le hr
 #align dimH_image_le_of_locally_holder_on dimH_image_le_of_locally_holder_on
 
 /-- If `f : X → Y` is Hölder continuous in a neighborhood of every point `x : X` with the same
@@ -506,8 +506,8 @@ theorem dimH_ball_pi_fin {n : ℕ} (x : Fin n → ℝ) {r : ℝ} (hr : 0 < r) :
 #align real.dimH_ball_pi_fin Real.dimH_ball_pi_fin
 
 theorem dimH_univ_pi (ι : Type _) [Fintype ι] : dimH (univ : Set (ι → ℝ)) = Fintype.card ι := by
-  simp only [← Metric.unionᵢ_ball_nat_succ (0 : ι → ℝ), dimH_unionᵢ,
-    dimH_ball_pi _ (Nat.cast_add_one_pos _), supᵢ_const]
+  simp only [← Metric.iUnion_ball_nat_succ (0 : ι → ℝ), dimH_iUnion,
+    dimH_ball_pi _ (Nat.cast_add_one_pos _), iSup_const]
 #align real.dimH_univ_pi Real.dimH_univ_pi
 
 theorem dimH_univ_pi_fin (n : ℕ) : dimH (univ : Set (Fin n → ℝ)) = n := by
Diff
@@ -90,7 +90,7 @@ open MeasureTheory ENNReal NNReal Topology
 
 open MeasureTheory MeasureTheory.Measure Set TopologicalSpace FiniteDimensional Filter
 
-variable {ι X Y : Type _} [EmetricSpace X] [EmetricSpace Y]
+variable {ι X Y : Type _} [EMetricSpace X] [EMetricSpace Y]
 
 /-- Hausdorff dimension of a set in an (e)metric space. -/
 noncomputable irreducible_def dimH (s : Set X) : ℝ≥0∞ :=
Diff
@@ -260,7 +260,7 @@ theorem exists_mem_nhdsWithin_lt_dimH_of_lt_dimH {s : Set X} {r : ℝ≥0∞} (h
   rcases countable_cover_nhds_within htx with ⟨S, hSs, hSc, hSU⟩
   calc
     dimH s ≤ dimH (⋃ x ∈ S, t x) := dimH_mono hSU
-    _ = ⨆ x ∈ S, dimH (t x) := dimH_bUnion hSc _
+    _ = ⨆ x ∈ S, dimH (t x) := (dimH_bUnion hSc _)
     _ ≤ r := supᵢ₂_le fun x hx => htr x <| hSs hx
     
 #align exists_mem_nhds_within_lt_dimH_of_lt_dimH exists_mem_nhdsWithin_lt_dimH_of_lt_dimH
@@ -581,7 +581,7 @@ real normed space is at most the dimension of its domain as a vector space over
 theorem ContDiff.dimH_range_le {f : E → F} (h : ContDiff ℝ 1 f) : dimH (range f) ≤ finrank ℝ E :=
   calc
     dimH (range f) = dimH (f '' univ) := by rw [image_univ]
-    _ ≤ dimH (univ : Set E) := h.ContDiffOn.dimH_image_le convex_univ Subset.rfl
+    _ ≤ dimH (univ : Set E) := (h.ContDiffOn.dimH_image_le convex_univ Subset.rfl)
     _ = finrank ℝ E := Real.dimH_univ_eq_finrank E
     
 #align cont_diff.dimH_range_le ContDiff.dimH_range_le
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 
 ! This file was ported from Lean 3 source module topology.metric_space.hausdorff_dimension
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit 57ac39bd365c2f80589a700f9fbb664d3a1a30c2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -600,6 +600,6 @@ real vector space `F` of strictly larger dimension, then the complement of the r
 in `F`. -/
 theorem ContDiff.dense_compl_range_of_finrank_lt_finrank [FiniteDimensional ℝ F] {f : E → F}
     (h : ContDiff ℝ 1 f) (hEF : finrank ℝ E < finrank ℝ F) : Dense (range fᶜ) :=
-  dense_compl_of_dimH_lt_finrank <| h.dimH_range_le.trans_lt <| ENNReal.coe_nat_lt_coe_nat.2 hEF
+  dense_compl_of_dimH_lt_finrank <| h.dimH_range_le.trans_lt <| Nat.cast_lt.2 hEF
 #align cont_diff.dense_compl_range_of_finrank_lt_finrank ContDiff.dense_compl_range_of_finrank_lt_finrank
 
Diff
@@ -86,7 +86,7 @@ Hausdorff measure, Hausdorff dimension, dimension
 -/
 
 
-open MeasureTheory Ennreal NNReal Topology
+open MeasureTheory ENNReal NNReal Topology
 
 open MeasureTheory MeasureTheory.Measure Set TopologicalSpace FiniteDimensional Filter
 
@@ -120,7 +120,7 @@ theorem hausdorffMeasure_of_lt_dimH {s : Set X} {d : ℝ≥0} (h : ↑d < dimH s
   by
   simp only [dimH_def, lt_supᵢ_iff] at h
   rcases h with ⟨d', hsd', hdd'⟩
-  rw [Ennreal.coe_lt_coe, ← NNReal.coe_lt_coe] at hdd'
+  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hdd'
   exact top_unique (hsd' ▸ hausdorff_measure_mono hdd'.le _)
 #align hausdorff_measure_of_lt_dimH hausdorffMeasure_of_lt_dimH
 
@@ -141,8 +141,8 @@ theorem le_dimH_of_hausdorffMeasure_eq_top {s : Set X} {d : ℝ≥0} (h : μH[d]
 theorem hausdorffMeasure_of_dimH_lt {s : Set X} {d : ℝ≥0} (h : dimH s < d) : μH[d] s = 0 :=
   by
   rw [dimH_def] at h
-  rcases Ennreal.lt_iff_exists_nNReal_btwn.1 h with ⟨d', hsd', hd'd⟩
-  rw [Ennreal.coe_lt_coe, ← NNReal.coe_lt_coe] at hd'd
+  rcases ENNReal.lt_iff_exists_nnreal_btwn.1 h with ⟨d', hsd', hd'd⟩
+  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at hd'd
   exact (hausdorff_measure_zero_or_top hd'd s).resolve_right fun h => hsd'.not_le <| le_supᵢ₂ d' h
 #align hausdorff_measure_of_dimH_lt hausdorffMeasure_of_dimH_lt
 
@@ -174,7 +174,7 @@ theorem dimH_subsingleton {s : Set X} (h : s.Subsingleton) : dimH s = 0 :=
   borelize X
   apply le_antisymm _ (zero_le _)
   refine' dimH_le_of_hausdorffMeasure_ne_top _
-  exact ((hausdorff_measure_le_one_of_subsingleton h le_rfl).trans_lt Ennreal.one_lt_top).Ne
+  exact ((hausdorff_measure_le_one_of_subsingleton h le_rfl).trans_lt ENNReal.one_lt_top).Ne
 #align dimH_subsingleton dimH_subsingleton
 
 alias dimH_subsingleton ← Set.Subsingleton.dimH_zero
@@ -199,7 +199,7 @@ theorem dimH_unionᵢ [Encodable ι] (s : ι → Set X) : dimH (⋃ i, s i) = 
   have : ∀ i, μH[d] (s i) = 0 := fun i =>
     hausdorffMeasure_of_dimH_lt ((le_supᵢ (fun i => dimH (s i)) i).trans_lt hd)
   rw [measure_Union_null this]
-  exact Ennreal.zero_ne_top
+  exact ENNReal.zero_ne_top
 #align dimH_Union dimH_unionᵢ
 
 @[simp]
@@ -217,11 +217,11 @@ theorem dimH_unionₛ {S : Set (Set X)} (hS : S.Countable) : dimH (⋃₀ S) = 
 
 @[simp]
 theorem dimH_union (s t : Set X) : dimH (s ∪ t) = max (dimH s) (dimH t) := by
-  rw [union_eq_Union, dimH_unionᵢ, supᵢ_bool_eq, cond, cond, Ennreal.sup_eq_max]
+  rw [union_eq_Union, dimH_unionᵢ, supᵢ_bool_eq, cond, cond, ENNReal.sup_eq_max]
 #align dimH_union dimH_union
 
 theorem dimH_countable {s : Set X} (hs : s.Countable) : dimH s = 0 :=
-  bunionᵢ_of_singleton s ▸ by simp only [dimH_bUnion hs, dimH_singleton, Ennreal.supᵢ_zero_eq_zero]
+  bunionᵢ_of_singleton s ▸ by simp only [dimH_bUnion hs, dimH_singleton, ENNReal.supᵢ_zero_eq_zero]
 #align dimH_countable dimH_countable
 
 alias dimH_countable ← Set.Countable.dimH_zero
@@ -309,13 +309,13 @@ theorem HolderOnWith.dimH_image_le (h : HolderOnWith C r f s) (hr : 0 < r) :
   borelize X Y
   refine' dimH_le fun d hd => _
   have := h.hausdorff_measure_image_le hr d.coe_nonneg
-  rw [hd, Ennreal.coe_rpow_of_nonneg _ d.coe_nonneg, top_le_iff] at this
+  rw [hd, ENNReal.coe_rpow_of_nonneg _ d.coe_nonneg, top_le_iff] at this
   have Hrd : μH[(r * d : ℝ≥0)] s = ⊤ := by
     contrapose this
-    exact Ennreal.mul_ne_top Ennreal.coe_ne_top this
-  rw [Ennreal.le_div_iff_mul_le, mul_comm, ← Ennreal.coe_mul]
-  exacts[le_dimH_of_hausdorffMeasure_eq_top Hrd, Or.inl (mt Ennreal.coe_eq_zero.1 hr.ne'),
-    Or.inl Ennreal.coe_ne_top]
+    exact ENNReal.mul_ne_top ENNReal.coe_ne_top this
+  rw [ENNReal.le_div_iff_mul_le, mul_comm, ← ENNReal.coe_mul]
+  exacts[le_dimH_of_hausdorffMeasure_eq_top Hrd, Or.inl (mt ENNReal.coe_eq_zero.1 hr.ne'),
+    Or.inl ENNReal.coe_ne_top]
 #align holder_on_with.dimH_image_le HolderOnWith.dimH_image_le
 
 namespace HolderWith
@@ -346,7 +346,7 @@ theorem dimH_image_le_of_locally_holder_on [SecondCountableTopology X] {r : ℝ
   choose! C t htn hC using hf
   rcases countable_cover_nhds_within htn with ⟨u, hus, huc, huU⟩
   replace huU := inter_eq_self_of_subset_left huU; rw [inter_Union₂] at huU
-  rw [← huU, image_Union₂, dimH_bUnion huc, dimH_bUnion huc]; simp only [Ennreal.supᵢ_div]
+  rw [← huU, image_Union₂, dimH_bUnion huc, dimH_bUnion huc]; simp only [ENNReal.supᵢ_div]
   exact supᵢ₂_mono fun x hx => ((hC x (hus hx)).mono (inter_subset_right _ _)).dimH_image_le hr
 #align dimH_image_le_of_locally_holder_on dimH_image_le_of_locally_holder_on
 
@@ -395,7 +395,7 @@ theorem dimH_image_le_of_locally_lipschitz_on [SecondCountableTopology X] {f : X
   by
   have : ∀ x ∈ s, ∃ C : ℝ≥0, ∃ t ∈ 𝓝[s] x, HolderOnWith C 1 f t := by
     simpa only [holderOnWith_one] using hf
-  simpa only [Ennreal.coe_one, div_one] using dimH_image_le_of_locally_holder_on zero_lt_one this
+  simpa only [ENNReal.coe_one, div_one] using dimH_image_le_of_locally_holder_on zero_lt_one this
 #align dimH_image_le_of_locally_lipschitz_on dimH_image_le_of_locally_lipschitz_on
 
 /-- If `f : X → Y` is Lipschitz in a neighborhood of each point `x : X`, then the Hausdorff
@@ -418,7 +418,7 @@ theorem dimH_preimage_le (hf : AntilipschitzWith K f) (s : Set Y) : dimH (f ⁻
   have := hf.hausdorff_measure_preimage_le d.coe_nonneg s
   rw [hd, top_le_iff] at this
   contrapose! this
-  exact Ennreal.mul_ne_top (by simp) this
+  exact ENNReal.mul_ne_top (by simp) this
 #align antilipschitz_with.dimH_preimage_le AntilipschitzWith.dimH_preimage_le
 
 theorem le_dimH_image (hf : AntilipschitzWith K f) (s : Set X) : dimH s ≤ dimH (f '' s) :=
@@ -493,12 +493,12 @@ theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) : dimH (Metric.ball
   cases isEmpty_or_nonempty ι
   · rwa [dimH_subsingleton, eq_comm, Nat.cast_eq_zero, Fintype.card_eq_zero_iff]
     exact fun x _ y _ => Subsingleton.elim x y
-  · rw [← Ennreal.coe_nat]
-    have : μH[Fintype.card ι] (Metric.ball x r) = Ennreal.ofReal ((2 * r) ^ Fintype.card ι) := by
+  · rw [← ENNReal.coe_nat]
+    have : μH[Fintype.card ι] (Metric.ball x r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι) := by
       rw [hausdorff_measure_pi_real, Real.volume_pi_ball _ hr]
     refine' dimH_of_hausdorffMeasure_ne_zero_ne_top _ _ <;> rw [NNReal.coe_nat_cast, this]
     · simp [pow_pos (mul_pos (zero_lt_two' ℝ) hr)]
-    · exact Ennreal.ofReal_ne_top
+    · exact ENNReal.ofReal_ne_top
 #align real.dimH_ball_pi Real.dimH_ball_pi
 
 theorem dimH_ball_pi_fin {n : ℕ} (x : Fin n → ℝ) {r : ℝ} (hr : 0 < r) :
@@ -600,6 +600,6 @@ real vector space `F` of strictly larger dimension, then the complement of the r
 in `F`. -/
 theorem ContDiff.dense_compl_range_of_finrank_lt_finrank [FiniteDimensional ℝ F] {f : E → F}
     (h : ContDiff ℝ 1 f) (hEF : finrank ℝ E < finrank ℝ F) : Dense (range fᶜ) :=
-  dense_compl_of_dimH_lt_finrank <| h.dimH_range_le.trans_lt <| Ennreal.coe_nat_lt_coe_nat.2 hEF
+  dense_compl_of_dimH_lt_finrank <| h.dimH_range_le.trans_lt <| ENNReal.coe_nat_lt_coe_nat.2 hEF
 #align cont_diff.dense_compl_range_of_finrank_lt_finrank ContDiff.dense_compl_range_of_finrank_lt_finrank
 

Changes in mathlib4

mathlib3
mathlib4
chore: Rename nat_cast/int_cast/rat_cast to natCast/intCast/ratCast (#11486)

Now that I am defining NNRat.cast, I want a definitive answer to this naming issue. Plenty of lemmas in mathlib already use natCast/intCast/ratCast over nat_cast/int_cast/rat_cast, and this matches with the general expectation that underscore-separated name parts correspond to a single declaration.

Diff
@@ -521,7 +521,7 @@ theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) :
   · rw [← ENNReal.coe_natCast]
     have : μH[Fintype.card ι] (Metric.ball x r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι) := by
       rw [hausdorffMeasure_pi_real, Real.volume_pi_ball _ hr]
-    refine dimH_of_hausdorffMeasure_ne_zero_ne_top ?_ ?_ <;> rw [NNReal.coe_nat_cast, this]
+    refine dimH_of_hausdorffMeasure_ne_zero_ne_top ?_ ?_ <;> rw [NNReal.coe_natCast, this]
     · simp [pow_pos (mul_pos (zero_lt_two' ℝ) hr)]
     · exact ENNReal.ofReal_ne_top
 set_option linter.uppercaseLean3 false in
chore: superfluous parentheses part 2 (#12131)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -274,7 +274,7 @@ theorem exists_mem_nhdsWithin_lt_dimH_of_lt_dimH {s : Set X} {r : ℝ≥0∞} (h
   rcases countable_cover_nhdsWithin htx with ⟨S, hSs, hSc, hSU⟩
   calc
     dimH s ≤ dimH (⋃ x ∈ S, t x) := dimH_mono hSU
-    _ = ⨆ x ∈ S, dimH (t x) := (dimH_bUnion hSc _)
+    _ = ⨆ x ∈ S, dimH (t x) := dimH_bUnion hSc _
     _ ≤ r := iSup₂_le fun x hx => htr x <| hSs hx
 set_option linter.uppercaseLean3 false in
 #align exists_mem_nhds_within_lt_dimH_of_lt_dimH exists_mem_nhdsWithin_lt_dimH_of_lt_dimH
@@ -612,7 +612,7 @@ real normed space is at most the dimension of its domain as a vector space over
 theorem ContDiff.dimH_range_le {f : E → F} (h : ContDiff ℝ 1 f) : dimH (range f) ≤ finrank ℝ E :=
   calc
     dimH (range f) = dimH (f '' univ) := by rw [image_univ]
-    _ ≤ dimH (univ : Set E) := (h.contDiffOn.dimH_image_le convex_univ Subset.rfl)
+    _ ≤ dimH (univ : Set E) := h.contDiffOn.dimH_image_le convex_univ Subset.rfl
     _ = finrank ℝ E := Real.dimH_univ_eq_finrank E
 set_option linter.uppercaseLean3 false in
 #align cont_diff.dimH_range_le ContDiff.dimH_range_le
chore: Rename coe_nat/coe_int/coe_rat to natCast/intCast/ratCast (#11499)

This is less exhaustive than its sibling #11486 because edge cases are harder to classify. No fundamental difficulty, just me being a bit fast and lazy.

Reduce the diff of #11203

Diff
@@ -518,7 +518,7 @@ theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) :
   cases isEmpty_or_nonempty ι
   · rwa [dimH_subsingleton, eq_comm, Nat.cast_eq_zero, Fintype.card_eq_zero_iff]
     exact fun x _ y _ => Subsingleton.elim x y
-  · rw [← ENNReal.coe_nat]
+  · rw [← ENNReal.coe_natCast]
     have : μH[Fintype.card ι] (Metric.ball x r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι) := by
       rw [hausdorffMeasure_pi_real, Real.volume_pi_ball _ hr]
     refine dimH_of_hausdorffMeasure_ne_zero_ne_top ?_ ?_ <;> rw [NNReal.coe_nat_cast, this]
chore: Rename IsROrC to RCLike (#10819)

IsROrC contains data, which goes against the expectation that classes prefixed with Is are prop-valued. People have been complaining about this on and off, so this PR renames IsROrC to RCLike.

Diff
@@ -3,7 +3,7 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Mathlib.Analysis.Calculus.ContDiff.IsROrC
+import Mathlib.Analysis.Calculus.ContDiff.RCLike
 import Mathlib.MeasureTheory.Measure.Hausdorff
 
 #align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92"
chore(HausdorffDimension): fix Encodable/Countable (#10250)
Diff
@@ -196,7 +196,8 @@ set_option linter.uppercaseLean3 false in
 #align dimH_singleton dimH_singleton
 
 @[simp]
-theorem dimH_iUnion [Encodable ι] (s : ι → Set X) : dimH (⋃ i, s i) = ⨆ i, dimH (s i) := by
+theorem dimH_iUnion {ι : Sort*} [Countable ι] (s : ι → Set X) :
+    dimH (⋃ i, s i) = ⨆ i, dimH (s i) := by
   borelize X
   refine le_antisymm (dimH_le fun d hd => ?_) (iSup_le fun i => dimH_mono <| subset_iUnion _ _)
   contrapose! hd
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -3,7 +3,7 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Mathlib.Analysis.Calculus.ContDiff.Basic
+import Mathlib.Analysis.Calculus.ContDiff.IsROrC
 import Mathlib.MeasureTheory.Measure.Hausdorff
 
 #align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92"
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -519,7 +519,7 @@ theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) :
     exact fun x _ y _ => Subsingleton.elim x y
   · rw [← ENNReal.coe_nat]
     have : μH[Fintype.card ι] (Metric.ball x r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι) := by
-      rw [hausdorffMeasure_pi_real, Real.volume_pi_ball _ hr, rpow_nat_cast]
+      rw [hausdorffMeasure_pi_real, Real.volume_pi_ball _ hr]
     refine dimH_of_hausdorffMeasure_ne_zero_ne_top ?_ ?_ <;> rw [NNReal.coe_nat_cast, this]
     · simp [pow_pos (mul_pos (zero_lt_two' ℝ) hr)]
     · exact ENNReal.ofReal_ne_top
chore: move Analysis/ContDiff to Analysis/ContDiff/Basic to make room for splitting (#8337)

No changes to content, or splitting, just a rename so there is room for more files.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -3,7 +3,7 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Mathlib.Analysis.Calculus.ContDiff
+import Mathlib.Analysis.Calculus.ContDiff.Basic
 import Mathlib.MeasureTheory.Measure.Hausdorff
 
 #align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92"
chore(Analysis): rename lipschitz_on_univ to lipschitzOn_univ (#6946)

Also rename dimH_image_le_of_locally_lipschitz_on to dimH_image_le_of_locally_lipschitzOn.

Diff
@@ -407,24 +407,24 @@ end LipschitzWith
 /-- If `s` is a set in an extended metric space `X` with second countable topology and `f : X → Y`
 is Lipschitz in a neighborhood within `s` of every point `x ∈ s`, then the Hausdorff dimension of
 the image `f '' s` is at most the Hausdorff dimension of `s`. -/
-theorem dimH_image_le_of_locally_lipschitz_on [SecondCountableTopology X] {f : X → Y} {s : Set X}
+theorem dimH_image_le_of_locally_lipschitzOn [SecondCountableTopology X] {f : X → Y} {s : Set X}
     (hf : ∀ x ∈ s, ∃ C : ℝ≥0, ∃ t ∈ 𝓝[s] x, LipschitzOnWith C f t) : dimH (f '' s) ≤ dimH s := by
   have : ∀ x ∈ s, ∃ C : ℝ≥0, ∃ t ∈ 𝓝[s] x, HolderOnWith C 1 f t := by
     simpa only [holderOnWith_one] using hf
   simpa only [ENNReal.coe_one, div_one] using dimH_image_le_of_locally_holder_on zero_lt_one this
 set_option linter.uppercaseLean3 false in
-#align dimH_image_le_of_locally_lipschitz_on dimH_image_le_of_locally_lipschitz_on
+#align dimH_image_le_of_locally_lipschitz_on dimH_image_le_of_locally_lipschitzOn
 
 /-- If `f : X → Y` is Lipschitz in a neighborhood of each point `x : X`, then the Hausdorff
 dimension of `range f` is at most the Hausdorff dimension of `X`. -/
-theorem dimH_range_le_of_locally_lipschitz_on [SecondCountableTopology X] {f : X → Y}
+theorem dimH_range_le_of_locally_lipschitzOn [SecondCountableTopology X] {f : X → Y}
     (hf : ∀ x : X, ∃ C : ℝ≥0, ∃ s ∈ 𝓝 x, LipschitzOnWith C f s) :
     dimH (range f) ≤ dimH (univ : Set X) := by
   rw [← image_univ]
-  refine dimH_image_le_of_locally_lipschitz_on fun x _ => ?_
+  refine dimH_image_le_of_locally_lipschitzOn fun x _ => ?_
   simpa only [exists_prop, nhdsWithin_univ] using hf x
 set_option linter.uppercaseLean3 false in
-#align dimH_range_le_of_locally_lipschitz_on dimH_range_le_of_locally_lipschitz_on
+#align dimH_range_le_of_locally_lipschitz_on dimH_range_le_of_locally_lipschitzOn
 
 namespace AntilipschitzWith
 
@@ -600,7 +600,7 @@ dimension of `s`.
 TODO: do we actually need `Convex ℝ s`? -/
 theorem ContDiffOn.dimH_image_le {f : E → F} {s t : Set E} (hf : ContDiffOn ℝ 1 f s)
     (hc : Convex ℝ s) (ht : t ⊆ s) : dimH (f '' t) ≤ dimH t :=
-  dimH_image_le_of_locally_lipschitz_on fun x hx =>
+  dimH_image_le_of_locally_lipschitzOn fun x hx =>
     let ⟨C, u, hu, hf⟩ := (hf x (ht hx)).exists_lipschitzOnWith hc
     ⟨C, u, nhdsWithin_mono _ ht hu, hf⟩
 set_option linter.uppercaseLean3 false in
feat: patch for new alias command (#6172)
Diff
@@ -179,7 +179,7 @@ theorem dimH_subsingleton {s : Set X} (h : s.Subsingleton) : dimH s = 0 := by
 set_option linter.uppercaseLean3 false in
 #align dimH_subsingleton dimH_subsingleton
 
-alias dimH_subsingleton ← Set.Subsingleton.dimH_zero
+alias Set.Subsingleton.dimH_zero := dimH_subsingleton
 set_option linter.uppercaseLean3 false in
 #align set.subsingleton.dimH_zero Set.Subsingleton.dimH_zero
 
@@ -232,7 +232,7 @@ theorem dimH_countable {s : Set X} (hs : s.Countable) : dimH s = 0 :=
 set_option linter.uppercaseLean3 false in
 #align dimH_countable dimH_countable
 
-alias dimH_countable ← Set.Countable.dimH_zero
+alias Set.Countable.dimH_zero := dimH_countable
 set_option linter.uppercaseLean3 false in
 #align set.countable.dimH_zero Set.Countable.dimH_zero
 
@@ -241,7 +241,7 @@ theorem dimH_finite {s : Set X} (hs : s.Finite) : dimH s = 0 :=
 set_option linter.uppercaseLean3 false in
 #align dimH_finite dimH_finite
 
-alias dimH_finite ← Set.Finite.dimH_zero
+alias Set.Finite.dimH_zero := dimH_finite
 set_option linter.uppercaseLean3 false in
 #align set.finite.dimH_zero Set.Finite.dimH_zero
 
@@ -251,7 +251,7 @@ theorem dimH_coe_finset (s : Finset X) : dimH (s : Set X) = 0 :=
 set_option linter.uppercaseLean3 false in
 #align dimH_coe_finset dimH_coe_finset
 
-alias dimH_coe_finset ← Finset.dimH_zero
+alias Finset.dimH_zero := dimH_coe_finset
 set_option linter.uppercaseLean3 false in
 #align finset.dimH_zero Finset.dimH_zero
 
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
@@ -88,7 +88,7 @@ open scoped MeasureTheory ENNReal NNReal Topology
 
 open MeasureTheory MeasureTheory.Measure Set TopologicalSpace FiniteDimensional Filter
 
-variable {ι X Y : Type _} [EMetricSpace X] [EMetricSpace Y]
+variable {ι X Y : Type*} [EMetricSpace X] [EMetricSpace Y]
 
 /-- Hausdorff dimension of a set in an (e)metric space. -/
 @[irreducible] noncomputable def dimH (s : Set X) : ℝ≥0∞ := by
@@ -480,7 +480,7 @@ end IsometryEquiv
 
 namespace ContinuousLinearEquiv
 
-variable {𝕜 E F : Type _} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E]
+variable {𝕜 E F : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E]
   [NormedAddCommGroup F] [NormedSpace 𝕜 F]
 
 @[simp]
@@ -510,7 +510,7 @@ end ContinuousLinearEquiv
 
 namespace Real
 
-variable {E : Type _} [Fintype ι] [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
+variable {E : Type*} [Fintype ι] [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
 
 theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) :
     dimH (Metric.ball x r) = Fintype.card ι := by
@@ -531,7 +531,7 @@ theorem dimH_ball_pi_fin {n : ℕ} (x : Fin n → ℝ) {r : ℝ} (hr : 0 < r) :
 set_option linter.uppercaseLean3 false in
 #align real.dimH_ball_pi_fin Real.dimH_ball_pi_fin
 
-theorem dimH_univ_pi (ι : Type _) [Fintype ι] : dimH (univ : Set (ι → ℝ)) = Fintype.card ι := by
+theorem dimH_univ_pi (ι : Type*) [Fintype ι] : dimH (univ : Set (ι → ℝ)) = Fintype.card ι := by
   simp only [← Metric.iUnion_ball_nat_succ (0 : ι → ℝ), dimH_iUnion,
     dimH_ball_pi _ (Nat.cast_add_one_pos _), iSup_const]
 set_option linter.uppercaseLean3 false in
@@ -574,7 +574,7 @@ set_option linter.uppercaseLean3 false in
 
 end Real
 
-variable {E F : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
+variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
   [NormedAddCommGroup F] [NormedSpace ℝ F]
 
 theorem dense_compl_of_dimH_lt_finrank {s : Set E} (hs : dimH s < finrank ℝ E) : Dense sᶜ := by
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,15 +2,12 @@
 Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module topology.metric_space.hausdorff_dimension
-! leanprover-community/mathlib commit 8f9fea08977f7e450770933ee6abb20733b47c92
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.Calculus.ContDiff
 import Mathlib.MeasureTheory.Measure.Hausdorff
 
+#align_import topology.metric_space.hausdorff_dimension from "leanprover-community/mathlib"@"8f9fea08977f7e450770933ee6abb20733b47c92"
+
 /-!
 # Hausdorff dimension
 
fix: precedences of ⨆⋃⋂⨅ (#5614)
Diff
@@ -284,7 +284,7 @@ set_option linter.uppercaseLean3 false in
 /-- In an (extended) metric space with second countable topology, the Hausdorff dimension
 of a set `s` is the supremum over `x ∈ s` of the limit superiors of `dimH t` along
 `(𝓝[s] x).smallSets`. -/
-theorem bsupr_limsup_dimH (s : Set X) : (⨆ x ∈ s, limsup dimH (𝓝[s] x).smallSets) = dimH s := by
+theorem bsupr_limsup_dimH (s : Set X) : ⨆ x ∈ s, limsup dimH (𝓝[s] x).smallSets = dimH s := by
   refine le_antisymm (iSup₂_le fun x _ => ?_) ?_
   · refine limsup_le_of_le isCobounded_le_of_bot ?_
     exact eventually_smallSets.2 ⟨s, self_mem_nhdsWithin, fun t => dimH_mono⟩
@@ -299,7 +299,7 @@ set_option linter.uppercaseLean3 false in
 /-- In an (extended) metric space with second countable topology, the Hausdorff dimension
 of a set `s` is the supremum over all `x` of the limit superiors of `dimH t` along
 `(𝓝[s] x).smallSets`. -/
-theorem iSup_limsup_dimH (s : Set X) : (⨆ x, limsup dimH (𝓝[s] x).smallSets) = dimH s := by
+theorem iSup_limsup_dimH (s : Set X) : ⨆ x, limsup dimH (𝓝[s] x).smallSets = dimH s := by
   refine le_antisymm (iSup_le fun x => ?_) ?_
   · refine limsup_le_of_le isCobounded_le_of_bot ?_
     exact eventually_smallSets.2 ⟨s, self_mem_nhdsWithin, fun t => dimH_mono⟩
fix: change compl precedence (#5586)

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

Diff
@@ -580,7 +580,7 @@ end Real
 variable {E F : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]
   [NormedAddCommGroup F] [NormedSpace ℝ F]
 
-theorem dense_compl_of_dimH_lt_finrank {s : Set E} (hs : dimH s < finrank ℝ E) : Dense (sᶜ) := by
+theorem dense_compl_of_dimH_lt_finrank {s : Set E} (hs : dimH s < finrank ℝ E) : Dense sᶜ := by
   refine fun x => mem_closure_iff_nhds.2 fun t ht => nonempty_iff_ne_empty.2 fun he => hs.not_le ?_
   rw [← diff_eq, diff_eq_empty] at he
   rw [← Real.dimH_of_mem_nhds ht]
@@ -624,7 +624,7 @@ vector spaces. Suppose that `f` is `C¹` smooth on a convex set `s` of Hausdorff
 less than the dimension of `F`. Then the complement of the image `f '' s` is dense in `F`. -/
 theorem ContDiffOn.dense_compl_image_of_dimH_lt_finrank [FiniteDimensional ℝ F] {f : E → F}
     {s t : Set E} (h : ContDiffOn ℝ 1 f s) (hc : Convex ℝ s) (ht : t ⊆ s)
-    (htF : dimH t < finrank ℝ F) : Dense ((f '' t)ᶜ) :=
+    (htF : dimH t < finrank ℝ F) : Dense (f '' t)ᶜ :=
   dense_compl_of_dimH_lt_finrank <| (h.dimH_image_le hc ht).trans_lt htF
 set_option linter.uppercaseLean3 false in
 #align cont_diff_on.dense_compl_image_of_dimH_lt_finrank ContDiffOn.dense_compl_image_of_dimH_lt_finrank
@@ -633,6 +633,6 @@ set_option linter.uppercaseLean3 false in
 real vector space `F` of strictly larger dimension, then the complement of the range of `f` is dense
 in `F`. -/
 theorem ContDiff.dense_compl_range_of_finrank_lt_finrank [FiniteDimensional ℝ F] {f : E → F}
-    (h : ContDiff ℝ 1 f) (hEF : finrank ℝ E < finrank ℝ F) : Dense (range fᶜ) :=
+    (h : ContDiff ℝ 1 f) (hEF : finrank ℝ E < finrank ℝ F) : Dense (range f)ᶜ :=
   dense_compl_of_dimH_lt_finrank <| h.dimH_range_le.trans_lt <| Nat.cast_lt.2 hEF
 #align cont_diff.dense_compl_range_of_finrank_lt_finrank ContDiff.dense_compl_range_of_finrank_lt_finrank
feat: port Topology.MetricSpace.HausdorffDimension (#4974)

Dependencies 12 + 1007

1008 files ported (98.8%)
454246 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