topology.metric_space.gluingMathlib.Topology.MetricSpace.Gluing

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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -376,10 +376,10 @@ def metricSpaceSum : MetricSpace (Sum X Y)
     cases p <;> cases q
     · simp only [sum.dist, dist_eq_zero, imp_self]
     · intro h
-      simp only [dist, sum.dist_eq_glue_dist p q] at h 
+      simp only [dist, sum.dist_eq_glue_dist p q] at h
       exact glue_eq_of_dist_eq_zero _ _ _ zero_lt_one _ _ h
     · intro h
-      simp only [dist, sum.dist_eq_glue_dist q p] at h 
+      simp only [dist, sum.dist_eq_glue_dist q p] at h
       exact glue_eq_of_dist_eq_zero _ _ _ zero_lt_one _ _ h
     · simp only [sum.dist, dist_eq_zero, imp_self]
   toUniformSpace := Sum.instUniformSpace
@@ -529,7 +529,7 @@ protected theorem isOpen_iff (s : Set (Σ i, E i)) :
     refine' ⟨min ε 1, lt_min εpos zero_lt_one, _⟩
     rintro ⟨j, y⟩ hy
     rcases eq_or_ne i j with (rfl | hij)
-    · simp only [sigma.dist_same, lt_min_iff] at hy 
+    · simp only [sigma.dist_same, lt_min_iff] at hy
       exact hε (mem_ball'.2 hy.1)
     · apply (lt_irrefl (1 : ℝ) _).elim
       calc
@@ -615,7 +615,7 @@ variable [Nonempty Z] [MetricSpace Z] [MetricSpace X] [MetricSpace Y] {Φ : Z 
 
 open _Root_.Sum (inl inr)
 
-attribute [local instance] UniformSpace.separationSetoid
+attribute [local instance] inseparableSetoid
 
 #print Metric.gluePremetric /-
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a pseudo metric space
@@ -633,7 +633,7 @@ def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (S
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a
 space  `glue_space hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
 def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ :=
-  @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
+  @SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
 deriving MetricSpace
 #align metric.glue_space Metric.GlueSpace
 -/
@@ -674,7 +674,7 @@ theorem toGlue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
   letI := i.to_uniform_space
   funext
   simp only [comp, to_glue_l, to_glue_r]
-  refine' UniformSpace.SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
+  refine' SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
   exact glue_dist_glued_points Φ Ψ 0 x
 #align metric.to_glue_commute Metric.toGlue_commute
 -/
@@ -772,12 +772,12 @@ def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σ n, X
 #align metric.inductive_premetric Metric.inductivePremetric
 -/
 
-attribute [local instance] inductive_premetric UniformSpace.separationSetoid
+attribute [local instance] inductive_premetric inseparableSetoid
 
 #print Metric.InductiveLimit /-
 /-- The type giving the inductive limit in a metric space context. -/
 def InductiveLimit (I : ∀ n, Isometry (f n)) : Type _ :=
-  @UniformSpace.SeparationQuotient _ (inductivePremetric I).toUniformSpace
+  @SeparationQuotient _ (inductivePremetric I).toUniformSpace
 deriving MetricSpace
 #align metric.inductive_limit Metric.InductiveLimit
 -/
@@ -812,7 +812,7 @@ theorem toInductiveLimit_commute (I : ∀ n, Isometry (f n)) (n : ℕ) :
   letI := inductive_premetric I
   funext
   simp only [comp, to_inductive_limit]
-  refine' UniformSpace.SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
+  refine' SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
   show inductive_limit_dist f ⟨n.succ, f n x⟩ ⟨n, x⟩ = 0
   · rw [inductive_limit_dist_eq_dist I ⟨n.succ, f n x⟩ ⟨n, x⟩ n.succ, le_rec_on_self,
       le_rec_on_succ, le_rec_on_self, dist_self]
Diff
@@ -382,7 +382,7 @@ def metricSpaceSum : MetricSpace (Sum X Y)
       simp only [dist, sum.dist_eq_glue_dist q p] at h 
       exact glue_eq_of_dist_eq_zero _ _ _ zero_lt_one _ _ h
     · simp only [sum.dist, dist_eq_zero, imp_self]
-  toUniformSpace := Sum.uniformSpace
+  toUniformSpace := Sum.instUniformSpace
   uniformity_dist := uniformity_dist_of_mem_uniformity _ _ Sum.mem_uniformity
 #align metric.metric_space_sum Metric.metricSpaceSum
 -/
Diff
@@ -223,7 +223,7 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
       obtain ⟨q, hq⟩ : ∃ q, dist y (Φ q) + dist z (Ψ q) < (⨅ p, dist y (Φ p) + dist z (Ψ p)) + δ / 2
       exact exists_lt_of_ciInf_lt (by linarith)
       have : dist (Ψ p) (Ψ q) ≤ dist (Φ p) (Φ q) + 2 * ε := by
-        have := le_trans (neg_le_abs_self _) (H p q); · linarith
+        have := le_trans (neg_le_abs _) (H p q); · linarith
       calc
         dist x z ≤ dist x (Ψ p) + dist (Ψ p) (Ψ q) + dist (Ψ q) z := dist_triangle4 _ _ _ _
         _ ≤ dist x (Ψ p) + dist (Φ p) (Φ q) + dist z (Ψ q) + 2 * ε := by
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2019 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 -/
-import Mathbin.Topology.MetricSpace.Isometry
+import Topology.MetricSpace.Isometry
 
 #align_import topology.metric_space.gluing from "leanprover-community/mathlib"@"69c6a5a12d8a2b159f20933e60115a4f2de62b58"
 
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2019 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
-
-! This file was ported from Lean 3 source module topology.metric_space.gluing
-! leanprover-community/mathlib commit 69c6a5a12d8a2b159f20933e60115a4f2de62b58
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Topology.MetricSpace.Isometry
 
+#align_import topology.metric_space.gluing from "leanprover-community/mathlib"@"69c6a5a12d8a2b159f20933e60115a4f2de62b58"
+
 /-!
 # Metric space gluing
 
Diff
@@ -256,6 +256,7 @@ private theorem glue_eq_of_dist_eq_zero (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
     linarith
   | inr x, inr y, h => by rw [eq_of_dist_eq_zero h]
 
+#print Metric.glueMetricApprox /-
 /-- Given two maps `Φ` and `Ψ` intro metric spaces `X` and `Y` such that the distances between
 `Φ p` and `Φ q`, and between `Ψ p` and `Ψ q`, coincide up to `2 ε` where `ε > 0`, one can almost
 glue the two spaces `X` and `Y` along the images of `Φ` and `Ψ`, so that `Φ p` and `Ψ p` are
@@ -269,6 +270,7 @@ def glueMetricApprox (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (ε0 : 0 < ε)
   dist_triangle := glueDist_triangle Φ Ψ ε H
   eq_of_dist_eq_zero := glue_eq_of_dist_eq_zero Φ Ψ ε ε0
 #align metric.glue_metric_approx Metric.glueMetricApprox
+-/
 
 end ApproxGluing
 
@@ -303,6 +305,7 @@ def Sum.dist : Sum X Y → Sum X Y → ℝ
 #align metric.sum.dist Metric.Sum.dist
 -/
 
+#print Metric.Sum.dist_eq_glueDist /-
 theorem Sum.dist_eq_glueDist {p q : Sum X Y} (x : X) (y : Y) :
     Sum.dist p q =
       glueDist (fun _ : Unit => Nonempty.some ⟨x⟩) (fun _ : Unit => Nonempty.some ⟨y⟩) 1 p q :=
@@ -312,18 +315,23 @@ theorem Sum.dist_eq_glueDist {p q : Sum X Y} (x : X) (y : Y) :
     | rfl
     | simp [sum.dist, glue_dist, dist_comm, add_comm, add_left_comm]
 #align metric.sum.dist_eq_glue_dist Metric.Sum.dist_eq_glueDist
+-/
 
 private theorem sum.dist_comm (x y : Sum X Y) : Sum.dist x y = Sum.dist y x := by
   cases x <;> cases y <;> simp only [sum.dist, dist_comm, add_comm, add_left_comm]
 
+#print Metric.Sum.one_le_dist_inl_inr /-
 theorem Sum.one_le_dist_inl_inr {x : X} {y : Y} : 1 ≤ Sum.dist (inl x) (inr y) :=
   le_trans (le_add_of_nonneg_right dist_nonneg) <|
     add_le_add_right (le_add_of_nonneg_left dist_nonneg) _
 #align metric.sum.one_dist_le Metric.Sum.one_le_dist_inl_inr
+-/
 
+#print Metric.Sum.one_le_dist_inr_inl /-
 theorem Sum.one_le_dist_inr_inl {x : X} {y : Y} : 1 ≤ Sum.dist (inr y) (inl x) := by
   rw [sum.dist_comm] <;> exact sum.one_dist_le
 #align metric.sum.one_dist_le' Metric.Sum.one_le_dist_inr_inl
+-/
 
 private theorem sum.mem_uniformity (s : Set (Sum X Y × Sum X Y)) :
     s ∈ 𝓤 (Sum X Y) ↔ ∃ ε > 0, ∀ a b, Sum.dist a b < ε → (a, b) ∈ s :=
@@ -452,26 +460,33 @@ theorem dist_same (i : ι) (x : E i) (y : E i) : dist (⟨i, x⟩ : Σ j, E j) 
 #align metric.sigma.dist_same Metric.Sigma.dist_same
 -/
 
+#print Metric.Sigma.dist_ne /-
 @[simp]
 theorem dist_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
     dist (⟨i, x⟩ : Σ k, E k) ⟨j, y⟩ = dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨y⟩) y :=
   by simp [Dist.dist, sigma.dist, h]
 #align metric.sigma.dist_ne Metric.Sigma.dist_ne
+-/
 
+#print Metric.Sigma.one_le_dist_of_ne /-
 theorem one_le_dist_of_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
     1 ≤ dist (⟨i, x⟩ : Σ k, E k) ⟨j, y⟩ :=
   by
   rw [sigma.dist_ne h x y]
   linarith [@dist_nonneg _ _ x (Nonempty.some ⟨x⟩), @dist_nonneg _ _ (Nonempty.some ⟨y⟩) y]
 #align metric.sigma.one_le_dist_of_ne Metric.Sigma.one_le_dist_of_ne
+-/
 
+#print Metric.Sigma.fst_eq_of_dist_lt_one /-
 theorem fst_eq_of_dist_lt_one (x y : Σ i, E i) (h : dist x y < 1) : x.1 = y.1 :=
   by
   cases x; cases y
   contrapose! h
   apply one_le_dist_of_ne h
 #align metric.sigma.fst_eq_of_dist_lt_one Metric.Sigma.fst_eq_of_dist_lt_one
+-/
 
+#print Metric.Sigma.dist_triangle /-
 protected theorem dist_triangle (x y z : Σ i, E i) : dist x z ≤ dist x y + dist y z :=
   by
   rcases x with ⟨i, x⟩; rcases y with ⟨j, y⟩; rcases z with ⟨k, z⟩
@@ -504,7 +519,9 @@ protected theorem dist_triangle (x y z : Σ i, E i) : dist x z ≤ dist x y + di
             by simp only [add_zero, zero_add]
           _ ≤ _ := by apply_rules [add_le_add, zero_le_one, dist_nonneg, le_rfl]
 #align metric.sigma.dist_triangle Metric.Sigma.dist_triangle
+-/
 
+#print Metric.Sigma.isOpen_iff /-
 protected theorem isOpen_iff (s : Set (Σ i, E i)) :
     IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s :=
   by
@@ -531,6 +548,7 @@ protected theorem isOpen_iff (s : Set (Σ i, E i)) :
     rw [sigma.dist_same]
     exact mem_ball'.1 hy
 #align metric.sigma.is_open_iff Metric.Sigma.isOpen_iff
+-/
 
 #print Metric.Sigma.metricSpace /-
 /-- A metric space structure on the disjoint union `Σ i, E i`.
@@ -664,13 +682,17 @@ theorem toGlue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
 #align metric.to_glue_commute Metric.toGlue_commute
 -/
 
+#print Metric.toGlueL_isometry /-
 theorem toGlueL_isometry (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Isometry (toGlueL hΦ hΨ) :=
   Isometry.of_dist_eq fun _ _ => rfl
 #align metric.to_glue_l_isometry Metric.toGlueL_isometry
+-/
 
+#print Metric.toGlueR_isometry /-
 theorem toGlueR_isometry (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Isometry (toGlueR hΦ hΨ) :=
   Isometry.of_dist_eq fun _ _ => rfl
 #align metric.to_glue_r_isometry Metric.toGlueR_isometry
+-/
 
 end Gluing
 
@@ -773,6 +795,7 @@ def toInductiveLimit (I : ∀ n, Isometry (f n)) (n : ℕ) (x : X n) : Metric.In
 instance (I : ∀ n, Isometry (f n)) [Inhabited (X 0)] : Inhabited (InductiveLimit I) :=
   ⟨toInductiveLimit _ 0 default⟩
 
+#print Metric.toInductiveLimit_isometry /-
 /-- The map `to_inductive_limit n` mapping `X n` to the inductive limit is an isometry. -/
 theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
     Isometry (toInductiveLimit I n) :=
@@ -782,6 +805,7 @@ theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
     rw [inductive_limit_dist_eq_dist I ⟨n, x⟩ ⟨n, y⟩ n (le_refl n) (le_refl n), le_rec_on_self,
       le_rec_on_self]
 #align metric.to_inductive_limit_isometry Metric.toInductiveLimit_isometry
+-/
 
 #print Metric.toInductiveLimit_commute /-
 /-- The maps `to_inductive_limit n` are compatible with the maps `f n`. -/
Diff
@@ -137,7 +137,6 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         dist z (Φ p) + dist x (Ψ p) ≤ dist y z + dist y (Φ p) + dist x (Ψ p) :=
           add_le_add (dist_triangle_left _ _ _) le_rfl
         _ = dist y (Φ p) + dist x (Ψ p) + dist y z := by ring
-        
     linarith
   | inr x, inr y, inl z =>
     by
@@ -159,7 +158,6 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         dist z (Φ p) + dist x (Ψ p) ≤ dist z (Φ p) + (dist x y + dist y (Ψ p)) :=
           add_le_add le_rfl (dist_triangle _ _ _)
         _ = dist x y + (dist z (Φ p) + dist y (Ψ p)) := by ring
-        
     linarith
   | inl x, inl y, inr z =>
     by
@@ -181,7 +179,6 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         dist x (Φ p) + dist z (Ψ p) ≤ dist x y + dist y (Φ p) + dist z (Ψ p) :=
           add_le_add (dist_triangle _ _ _) le_rfl
         _ = dist x y + (dist y (Φ p) + dist z (Ψ p)) := by ring
-        
     linarith
   | inl x, inr y, inr z =>
     by
@@ -203,7 +200,6 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         dist x (Φ p) + dist z (Ψ p) ≤ dist x (Φ p) + (dist y z + dist y (Ψ p)) :=
           add_le_add le_rfl (dist_triangle_left _ _ _)
         _ = dist x (Φ p) + dist y (Ψ p) + dist y z := by ring
-        
     linarith
   | inl x, inr y, inl z =>
     le_of_forall_pos_le_add fun δ δpos =>
@@ -222,7 +218,6 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
           (add_le_add (add_le_add (add_le_add le_rfl (dist_triangle_left _ _ _)) le_rfl) le_rfl)
         _ ≤ (⨅ p, dist x (Φ p) + dist y (Ψ p)) + ε + ((⨅ p, dist z (Φ p) + dist y (Ψ p)) + ε) + δ :=
           by linarith
-        
   | inr x, inl y, inr z =>
     le_of_forall_pos_le_add fun δ δpos =>
       by
@@ -240,7 +235,6 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
           (add_le_add (add_le_add (add_le_add le_rfl (dist_triangle_left _ _ _)) le_rfl) le_rfl)
         _ ≤ (⨅ p, dist y (Φ p) + dist x (Ψ p)) + ε + ((⨅ p, dist y (Φ p) + dist z (Ψ p)) + ε) + δ :=
           by linarith
-        
 
 private theorem glue_eq_of_dist_eq_zero (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (ε0 : 0 < ε) :
     ∀ p q : Sum X Y, glueDist Φ Ψ ε p q = 0 → p = q
@@ -489,7 +483,6 @@ protected theorem dist_triangle (x y z : Σ i, E i) : dist x z ≤ dist x y + di
         dist x z ≤ dist x (Nonempty.some ⟨x⟩) + 0 + 0 + (0 + 0 + dist (Nonempty.some ⟨z⟩) z) := by
           simpa only [zero_add, add_zero] using dist_triangle _ _ _
         _ ≤ _ := by apply_rules [add_le_add, le_rfl, dist_nonneg, zero_le_one]
-        
   · rcases eq_or_ne i j with (rfl | hij)
     · simp only [hik, sigma.dist_ne, Ne.def, not_false_iff, sigma.dist_same]
       calc
@@ -497,7 +490,6 @@ protected theorem dist_triangle (x y z : Σ i, E i) : dist x z ≤ dist x y + di
             dist x y + dist y (Nonempty.some ⟨y⟩) + 1 + dist (Nonempty.some ⟨z⟩) z :=
           by apply_rules [add_le_add, le_rfl, dist_triangle]
         _ = _ := by abel
-        
     · rcases eq_or_ne j k with (rfl | hjk)
       · simp only [hij, sigma.dist_ne, Ne.def, not_false_iff, sigma.dist_same]
         calc
@@ -505,14 +497,12 @@ protected theorem dist_triangle (x y z : Σ i, E i) : dist x z ≤ dist x y + di
               dist x (Nonempty.some ⟨x⟩) + 1 + (dist (Nonempty.some ⟨z⟩) y + dist y z) :=
             by apply_rules [add_le_add, le_rfl, dist_triangle]
           _ = _ := by abel
-          
       · simp only [hik, hij, hjk, sigma.dist_ne, Ne.def, not_false_iff]
         calc
           dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨z⟩) z =
               dist x (Nonempty.some ⟨x⟩) + 1 + 0 + (0 + 0 + dist (Nonempty.some ⟨z⟩) z) :=
             by simp only [add_zero, zero_add]
           _ ≤ _ := by apply_rules [add_le_add, zero_le_one, dist_nonneg, le_rfl]
-          
 #align metric.sigma.dist_triangle Metric.Sigma.dist_triangle
 
 protected theorem isOpen_iff (s : Set (Σ i, E i)) :
@@ -531,7 +521,6 @@ protected theorem isOpen_iff (s : Set (Σ i, E i)) :
       calc
         1 ≤ sigma.dist ⟨i, x⟩ ⟨j, y⟩ := sigma.one_le_dist_of_ne hij _ _
         _ < 1 := hy.trans_le (min_le_right _ _)
-        
   · intro H
     apply isOpen_sigma_iff.2 fun i => _
     apply Metric.isOpen_iff.2 fun x hx => _
@@ -565,7 +554,6 @@ protected def metricSpace : MetricSpace (Σ i, E i) :=
       calc
         1 ≤ sigma.dist (⟨i, x⟩ : Σ k, E k) ⟨j, y⟩ := sigma.one_le_dist_of_ne hij _ _
         _ < 1 := by rw [h]; exact zero_lt_one
-        
 #align metric.sigma.metric_space Metric.Sigma.metricSpace
 -/
 
@@ -762,7 +750,6 @@ def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σ n, X
         (dist_triangle _ _ _)
       _ = inductive_limit_dist f x y + inductive_limit_dist f y z := by
         rw [inductive_limit_dist_eq_dist I x y m hx hy, inductive_limit_dist_eq_dist I y z m hy hz]
-      
 #align metric.inductive_premetric Metric.inductivePremetric
 -/
 
Diff
@@ -587,7 +587,7 @@ theorem isometry_mk (i : ι) : Isometry (Sigma.mk i : E i → Σ k, E k) :=
 protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σ i, E i) :=
   by
   set s : ι → Set (Σ i, E i) := fun i => Sigma.fst ⁻¹' {i}
-  set U := { p : (Σ k, E k) × Σ k, E k | dist p.1 p.2 < 1 }
+  set U := {p : (Σ k, E k) × Σ k, E k | dist p.1 p.2 < 1}
   have hc : ∀ i, IsComplete (s i) := by
     intro i
     simp only [s, ← range_sigma_mk]
Diff
@@ -313,7 +313,10 @@ theorem Sum.dist_eq_glueDist {p q : Sum X Y} (x : X) (y : Y) :
     Sum.dist p q =
       glueDist (fun _ : Unit => Nonempty.some ⟨x⟩) (fun _ : Unit => Nonempty.some ⟨y⟩) 1 p q :=
   by
-  cases p <;> cases q <;> first |rfl|simp [sum.dist, glue_dist, dist_comm, add_comm, add_left_comm]
+  cases p <;> cases q <;>
+    first
+    | rfl
+    | simp [sum.dist, glue_dist, dist_comm, add_comm, add_left_comm]
 #align metric.sum.dist_eq_glue_dist Metric.Sum.dist_eq_glueDist
 
 private theorem sum.dist_comm (x y : Sum X Y) : Sum.dist x y = Sum.dist y x := by
@@ -374,10 +377,10 @@ def metricSpaceSum : MetricSpace (Sum X Y)
     cases p <;> cases q
     · simp only [sum.dist, dist_eq_zero, imp_self]
     · intro h
-      simp only [dist, sum.dist_eq_glue_dist p q] at h
+      simp only [dist, sum.dist_eq_glue_dist p q] at h 
       exact glue_eq_of_dist_eq_zero _ _ _ zero_lt_one _ _ h
     · intro h
-      simp only [dist, sum.dist_eq_glue_dist q p] at h
+      simp only [dist, sum.dist_eq_glue_dist q p] at h 
       exact glue_eq_of_dist_eq_zero _ _ _ zero_lt_one _ _ h
     · simp only [sum.dist, dist_eq_zero, imp_self]
   toUniformSpace := Sum.uniformSpace
@@ -426,7 +429,7 @@ We embed isometrically each factor, set the basepoints at distance 1, arbitraril
 and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
 their respective basepoints, plus the distance 1 between the basepoints.
 Since there is an arbitrary choice in this construction, it is not an instance by default. -/
-protected def dist : (Σi, E i) → (Σi, E i) → ℝ
+protected def dist : (Σ i, E i) → (Σ i, E i) → ℝ
   | ⟨i, x⟩, ⟨j, y⟩ =>
     if h : i = j then
       haveI : E j = E i := by rw [h]
@@ -441,7 +444,7 @@ We embed isometrically each factor, set the basepoints at distance 1, arbitraril
 and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
 their respective basepoints, plus the distance 1 between the basepoints.
 Since there is an arbitrary choice in this construction, it is not an instance by default. -/
-def instDist : Dist (Σi, E i) :=
+def instDist : Dist (Σ i, E i) :=
   ⟨Sigma.dist⟩
 #align metric.sigma.has_dist Metric.Sigma.instDist
 -/
@@ -450,32 +453,32 @@ attribute [local instance] sigma.has_dist
 
 #print Metric.Sigma.dist_same /-
 @[simp]
-theorem dist_same (i : ι) (x : E i) (y : E i) : dist (⟨i, x⟩ : Σj, E j) ⟨i, y⟩ = dist x y := by
+theorem dist_same (i : ι) (x : E i) (y : E i) : dist (⟨i, x⟩ : Σ j, E j) ⟨i, y⟩ = dist x y := by
   simp [Dist.dist, sigma.dist]
 #align metric.sigma.dist_same Metric.Sigma.dist_same
 -/
 
 @[simp]
 theorem dist_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
-    dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ = dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨y⟩) y :=
+    dist (⟨i, x⟩ : Σ k, E k) ⟨j, y⟩ = dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨y⟩) y :=
   by simp [Dist.dist, sigma.dist, h]
 #align metric.sigma.dist_ne Metric.Sigma.dist_ne
 
 theorem one_le_dist_of_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
-    1 ≤ dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ :=
+    1 ≤ dist (⟨i, x⟩ : Σ k, E k) ⟨j, y⟩ :=
   by
   rw [sigma.dist_ne h x y]
   linarith [@dist_nonneg _ _ x (Nonempty.some ⟨x⟩), @dist_nonneg _ _ (Nonempty.some ⟨y⟩) y]
 #align metric.sigma.one_le_dist_of_ne Metric.Sigma.one_le_dist_of_ne
 
-theorem fst_eq_of_dist_lt_one (x y : Σi, E i) (h : dist x y < 1) : x.1 = y.1 :=
+theorem fst_eq_of_dist_lt_one (x y : Σ i, E i) (h : dist x y < 1) : x.1 = y.1 :=
   by
   cases x; cases y
   contrapose! h
   apply one_le_dist_of_ne h
 #align metric.sigma.fst_eq_of_dist_lt_one Metric.Sigma.fst_eq_of_dist_lt_one
 
-protected theorem dist_triangle (x y z : Σi, E i) : dist x z ≤ dist x y + dist y z :=
+protected theorem dist_triangle (x y z : Σ i, E i) : dist x z ≤ dist x y + dist y z :=
   by
   rcases x with ⟨i, x⟩; rcases y with ⟨j, y⟩; rcases z with ⟨k, z⟩
   rcases eq_or_ne i k with (rfl | hik)
@@ -512,17 +515,17 @@ protected theorem dist_triangle (x y z : Σi, E i) : dist x z ≤ dist x y + dis
           
 #align metric.sigma.dist_triangle Metric.Sigma.dist_triangle
 
-protected theorem isOpen_iff (s : Set (Σi, E i)) :
+protected theorem isOpen_iff (s : Set (Σ i, E i)) :
     IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s :=
   by
   constructor
   · rintro hs ⟨i, x⟩ hx
-    obtain ⟨ε, εpos, hε⟩ : ∃ (ε : ℝ)(H : ε > 0), ball x ε ⊆ Sigma.mk i ⁻¹' s :=
+    obtain ⟨ε, εpos, hε⟩ : ∃ (ε : ℝ) (H : ε > 0), ball x ε ⊆ Sigma.mk i ⁻¹' s :=
       Metric.isOpen_iff.1 (isOpen_sigma_iff.1 hs i) x hx
     refine' ⟨min ε 1, lt_min εpos zero_lt_one, _⟩
     rintro ⟨j, y⟩ hy
     rcases eq_or_ne i j with (rfl | hij)
-    · simp only [sigma.dist_same, lt_min_iff] at hy
+    · simp only [sigma.dist_same, lt_min_iff] at hy 
       exact hε (mem_ball'.2 hy.1)
     · apply (lt_irrefl (1 : ℝ) _).elim
       calc
@@ -532,7 +535,7 @@ protected theorem isOpen_iff (s : Set (Σi, E i)) :
   · intro H
     apply isOpen_sigma_iff.2 fun i => _
     apply Metric.isOpen_iff.2 fun x hx => _
-    obtain ⟨ε, εpos, hε⟩ : ∃ (ε : ℝ)(H : ε > 0), ∀ y, dist (⟨i, x⟩ : Σj, E j) y < ε → y ∈ s :=
+    obtain ⟨ε, εpos, hε⟩ : ∃ (ε : ℝ) (H : ε > 0), ∀ y, dist (⟨i, x⟩ : Σ j, E j) y < ε → y ∈ s :=
       H ⟨i, x⟩ hx
     refine' ⟨ε, εpos, fun y hy => _⟩
     apply hε ⟨i, y⟩
@@ -546,7 +549,7 @@ We embed isometrically each factor, set the basepoints at distance 1, arbitraril
 and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
 their respective basepoints, plus the distance 1 between the basepoints.
 Since there is an arbitrary choice in this construction, it is not an instance by default. -/
-protected def metricSpace : MetricSpace (Σi, E i) :=
+protected def metricSpace : MetricSpace (Σ i, E i) :=
   by
   refine' MetricSpace.ofDistTopology sigma.dist _ _ sigma.dist_triangle sigma.is_open_iff _
   · rintro ⟨i, x⟩; simp [sigma.dist]
@@ -560,7 +563,7 @@ protected def metricSpace : MetricSpace (Σi, E i) :=
     · intro h
       apply (lt_irrefl (1 : ℝ) _).elim
       calc
-        1 ≤ sigma.dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ := sigma.one_le_dist_of_ne hij _ _
+        1 ≤ sigma.dist (⟨i, x⟩ : Σ k, E k) ⟨j, y⟩ := sigma.one_le_dist_of_ne hij _ _
         _ < 1 := by rw [h]; exact zero_lt_one
         
 #align metric.sigma.metric_space Metric.Sigma.metricSpace
@@ -574,17 +577,17 @@ open Filter
 
 #print Metric.Sigma.isometry_mk /-
 /-- The injection of a space in a disjoint union is an isometry -/
-theorem isometry_mk (i : ι) : Isometry (Sigma.mk i : E i → Σk, E k) :=
+theorem isometry_mk (i : ι) : Isometry (Sigma.mk i : E i → Σ k, E k) :=
   Isometry.of_dist_eq fun x y => by simp
 #align metric.sigma.isometry_mk Metric.Sigma.isometry_mk
 -/
 
 #print Metric.Sigma.completeSpace /-
 /-- A disjoint union of complete metric spaces is complete. -/
-protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σi, E i) :=
+protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σ i, E i) :=
   by
-  set s : ι → Set (Σi, E i) := fun i => Sigma.fst ⁻¹' {i}
-  set U := { p : (Σk, E k) × Σk, E k | dist p.1 p.2 < 1 }
+  set s : ι → Set (Σ i, E i) := fun i => Sigma.fst ⁻¹' {i}
+  set U := { p : (Σ k, E k) × Σ k, E k | dist p.1 p.2 < 1 }
   have hc : ∀ i, IsComplete (s i) := by
     intro i
     simp only [s, ← range_sigma_mk]
@@ -627,7 +630,8 @@ def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (S
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a
 space  `glue_space hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
 def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ :=
-  @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace deriving MetricSpace
+  @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
+deriving MetricSpace
 #align metric.glue_space Metric.GlueSpace
 -/
 
@@ -699,7 +703,7 @@ variable {X : ℕ → Type u} [∀ n, MetricSpace (X n)] {f : ∀ n, X n → X (
 
 #print Metric.inductiveLimitDist /-
 /-- Predistance on the disjoint union `Σ n, X n`. -/
-def inductiveLimitDist (f : ∀ n, X n → X (n + 1)) (x y : Σn, X n) : ℝ :=
+def inductiveLimitDist (f : ∀ n, X n → X (n + 1)) (x y : Σ n, X n) : ℝ :=
   dist (leRecOn (le_max_left x.1 y.1) f x.2 : X (max x.1 y.1))
     (leRecOn (le_max_right x.1 y.1) f y.2 : X (max x.1 y.1))
 #align metric.inductive_limit_dist Metric.inductiveLimitDist
@@ -708,7 +712,7 @@ def inductiveLimitDist (f : ∀ n, X n → X (n + 1)) (x y : Σn, X n) : ℝ :=
 #print Metric.inductiveLimitDist_eq_dist /-
 /-- The predistance on the disjoint union `Σ n, X n` can be computed in any `X k` for large
 enough `k`. -/
-theorem inductiveLimitDist_eq_dist (I : ∀ n, Isometry (f n)) (x y : Σn, X n) (m : ℕ) :
+theorem inductiveLimitDist_eq_dist (I : ∀ n, Isometry (f n)) (x y : Σ n, X n) (m : ℕ) :
     ∀ hx : x.1 ≤ m,
       ∀ hy : y.1 ≤ m,
         inductiveLimitDist f x y = dist (leRecOn hx f x.2 : X m) (leRecOn hy f y.2 : X m) :=
@@ -733,7 +737,7 @@ theorem inductiveLimitDist_eq_dist (I : ∀ n, Isometry (f n)) (x y : Σn, X n)
 
 #print Metric.inductivePremetric /-
 /-- Premetric space structure on `Σ n, X n`.-/
-def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σn, X n)
+def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σ n, X n)
     where
   dist := inductiveLimitDist f
   dist_self x := by simp [dist, inductive_limit_dist]
@@ -767,7 +771,8 @@ attribute [local instance] inductive_premetric UniformSpace.separationSetoid
 #print Metric.InductiveLimit /-
 /-- The type giving the inductive limit in a metric space context. -/
 def InductiveLimit (I : ∀ n, Isometry (f n)) : Type _ :=
-  @UniformSpace.SeparationQuotient _ (inductivePremetric I).toUniformSpace deriving MetricSpace
+  @UniformSpace.SeparationQuotient _ (inductivePremetric I).toUniformSpace
+deriving MetricSpace
 #align metric.inductive_limit Metric.InductiveLimit
 -/
 
Diff
@@ -61,7 +61,7 @@ universe u v w
 
 open Function Set
 
-open uniformity
+open scoped uniformity
 
 namespace Metric
 
@@ -415,7 +415,7 @@ namespace Sigma
 of two spaces. I.e., work with sigma types instead of sum types. -/
 variable {ι : Type _} {E : ι → Type _} [∀ i, MetricSpace (E i)]
 
-open Classical
+open scoped Classical
 
 #print Metric.Sigma.dist /-
 /-- Distance on a disjoint union. There are many (noncanonical) ways to put a distance compatible
@@ -568,7 +568,7 @@ protected def metricSpace : MetricSpace (Σi, E i) :=
 
 attribute [local instance] sigma.metric_space
 
-open Topology
+open scoped Topology
 
 open Filter
 
Diff
@@ -262,12 +262,6 @@ private theorem glue_eq_of_dist_eq_zero (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
     linarith
   | inr x, inr y, h => by rw [eq_of_dist_eq_zero h]
 
-/- warning: metric.glue_metric_approx -> Metric.glueMetricApprox is a dubious translation:
-lean 3 declaration is
-  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] [_inst_3 : Nonempty.{succ u3} Z] (Φ : Z -> X) (Ψ : Z -> Y) (ε : Real), (LT.lt.{0} Real Real.hasLt (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero))) ε) -> (forall (p : Z) (q : Z), LE.le.{0} Real Real.hasLe (Abs.abs.{0} Real (Neg.toHasAbs.{0} Real Real.hasNeg Real.hasSup) (HSub.hSub.{0, 0, 0} Real Real Real (instHSub.{0} Real Real.hasSub) (Dist.dist.{u1} X (PseudoMetricSpace.toHasDist.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_1)) (Φ p) (Φ q)) (Dist.dist.{u2} Y (PseudoMetricSpace.toHasDist.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_2)) (Ψ p) (Ψ q)))) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne)))) ε)) -> (MetricSpace.{max u1 u2} (Sum.{u1, u2} X Y))
-but is expected to have type
-  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] [_inst_3 : Nonempty.{succ u3} Z] (Φ : Z -> X) (Ψ : Z -> Y) (ε : Real), (LT.lt.{0} Real Real.instLTReal (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal)) ε) -> (forall (p : Z) (q : Z), LE.le.{0} Real Real.instLEReal (Abs.abs.{0} Real (Neg.toHasAbs.{0} Real Real.instNegReal Real.instSupReal) (HSub.hSub.{0, 0, 0} Real Real Real (instHSub.{0} Real Real.instSubReal) (Dist.dist.{u1} X (PseudoMetricSpace.toDist.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_1)) (Φ p) (Φ q)) (Dist.dist.{u2} Y (PseudoMetricSpace.toDist.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_2)) (Ψ p) (Ψ q)))) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) ε)) -> (MetricSpace.{max u2 u1} (Sum.{u1, u2} X Y))
-Case conversion may be inaccurate. Consider using '#align metric.glue_metric_approx Metric.glueMetricApproxₓ'. -/
 /-- Given two maps `Φ` and `Ψ` intro metric spaces `X` and `Y` such that the distances between
 `Φ p` and `Φ q`, and between `Ψ p` and `Ψ q`, coincide up to `2 ε` where `ε > 0`, one can almost
 glue the two spaces `X` and `Y` along the images of `Φ` and `Ψ`, so that `Φ p` and `Ψ p` are
@@ -315,12 +309,6 @@ def Sum.dist : Sum X Y → Sum X Y → ℝ
 #align metric.sum.dist Metric.Sum.dist
 -/
 
-/- warning: metric.sum.dist_eq_glue_dist -> Metric.Sum.dist_eq_glueDist is a dubious translation:
-lean 3 declaration is
-  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {p : Sum.{u1, u2} X Y} {q : Sum.{u1, u2} X Y} (x : X) (y : Y), Eq.{1} Real (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 p q) (Metric.glueDist.{u1, u2, 0} X Y Unit _inst_1 _inst_2 (fun (_x : Unit) => Nonempty.some.{succ u1} X (Nonempty.intro.{succ u1} X x)) (fun (_x : Unit) => Nonempty.some.{succ u2} Y (Nonempty.intro.{succ u2} Y y)) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) p q)
-but is expected to have type
-  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {p : Sum.{u1, u2} X Y} {q : Sum.{u1, u2} X Y} (x : X) (y : Y), Eq.{1} Real (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 p q) (Metric.glueDist.{u1, u2, 0} X Y Unit _inst_1 _inst_2 (fun (_x : Unit) => Nonempty.some.{succ u1} X (Nonempty.intro.{succ u1} X x)) (fun (_x : Unit) => Nonempty.some.{succ u2} Y (Nonempty.intro.{succ u2} Y y)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) p q)
-Case conversion may be inaccurate. Consider using '#align metric.sum.dist_eq_glue_dist Metric.Sum.dist_eq_glueDistₓ'. -/
 theorem Sum.dist_eq_glueDist {p q : Sum X Y} (x : X) (y : Y) :
     Sum.dist p q =
       glueDist (fun _ : Unit => Nonempty.some ⟨x⟩) (fun _ : Unit => Nonempty.some ⟨y⟩) 1 p q :=
@@ -331,23 +319,11 @@ theorem Sum.dist_eq_glueDist {p q : Sum X Y} (x : X) (y : Y) :
 private theorem sum.dist_comm (x y : Sum X Y) : Sum.dist x y = Sum.dist y x := by
   cases x <;> cases y <;> simp only [sum.dist, dist_comm, add_comm, add_left_comm]
 
-/- warning: metric.sum.one_dist_le -> Metric.Sum.one_le_dist_inl_inr is a dubious translation:
-lean 3 declaration is
-  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {x : X} {y : Y}, LE.le.{0} Real Real.hasLe (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 (Sum.inl.{u1, u2} X Y x) (Sum.inr.{u1, u2} X Y y))
-but is expected to have type
-  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {x : X} {y : Y}, LE.le.{0} Real Real.instLEReal (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 (Sum.inl.{u1, u2} X Y x) (Sum.inr.{u1, u2} X Y y))
-Case conversion may be inaccurate. Consider using '#align metric.sum.one_dist_le Metric.Sum.one_le_dist_inl_inrₓ'. -/
 theorem Sum.one_le_dist_inl_inr {x : X} {y : Y} : 1 ≤ Sum.dist (inl x) (inr y) :=
   le_trans (le_add_of_nonneg_right dist_nonneg) <|
     add_le_add_right (le_add_of_nonneg_left dist_nonneg) _
 #align metric.sum.one_dist_le Metric.Sum.one_le_dist_inl_inr
 
-/- warning: metric.sum.one_dist_le' -> Metric.Sum.one_le_dist_inr_inl is a dubious translation:
-lean 3 declaration is
-  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {x : X} {y : Y}, LE.le.{0} Real Real.hasLe (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 (Sum.inr.{u1, u2} X Y y) (Sum.inl.{u1, u2} X Y x))
-but is expected to have type
-  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {x : X} {y : Y}, LE.le.{0} Real Real.instLEReal (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 (Sum.inr.{u1, u2} X Y y) (Sum.inl.{u1, u2} X Y x))
-Case conversion may be inaccurate. Consider using '#align metric.sum.one_dist_le' Metric.Sum.one_le_dist_inr_inlₓ'. -/
 theorem Sum.one_le_dist_inr_inl {x : X} {y : Y} : 1 ≤ Sum.dist (inr y) (inl x) := by
   rw [sum.dist_comm] <;> exact sum.one_dist_le
 #align metric.sum.one_dist_le' Metric.Sum.one_le_dist_inr_inl
@@ -479,24 +455,12 @@ theorem dist_same (i : ι) (x : E i) (y : E i) : dist (⟨i, x⟩ : Σj, E j) 
 #align metric.sigma.dist_same Metric.Sigma.dist_same
 -/
 
-/- warning: metric.sigma.dist_ne -> Metric.Sigma.dist_ne is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] {i : ι} {j : ι}, (Ne.{succ u1} ι i j) -> (forall (x : E i) (y : E j), Eq.{1} Real (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (k : ι) => E k)) (Metric.Sigma.instDist.{u1, u2} ι (fun (k : ι) => E k) (fun (i : ι) => _inst_1 i)) (Sigma.mk.{u1, u2} ι (fun (k : ι) => E k) i x) (Sigma.mk.{u1, u2} ι (fun (k : ι) => E k) j y)) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (Dist.dist.{u2} (E i) (PseudoMetricSpace.toHasDist.{u2} (E i) (MetricSpace.toPseudoMetricSpace.{u2} (E i) (_inst_1 i))) x (Nonempty.some.{succ u2} (E i) (Nonempty.intro.{succ u2} (E i) x))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne)))) (Dist.dist.{u2} (E j) (PseudoMetricSpace.toHasDist.{u2} (E j) (MetricSpace.toPseudoMetricSpace.{u2} (E j) (_inst_1 j))) (Nonempty.some.{succ u2} (E j) (Nonempty.intro.{succ u2} (E j) y)) y)))
-but is expected to have type
-  forall {ι : Type.{u2}} {E : ι -> Type.{u1}} [_inst_1 : forall (i : ι), MetricSpace.{u1} (E i)] {i : ι} {j : ι}, (Ne.{succ u2} ι i j) -> (forall (x : E i) (y : E j), Eq.{1} Real (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (k : ι) => E k)) (Metric.Sigma.instDist.{u2, u1} ι (fun (k : ι) => E k) (fun (i : ι) => _inst_1 i)) (Sigma.mk.{u2, u1} ι (fun (k : ι) => E k) i x) (Sigma.mk.{u2, u1} ι (fun (k : ι) => E k) j y)) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (Dist.dist.{u1} (E i) (PseudoMetricSpace.toDist.{u1} (E i) (MetricSpace.toPseudoMetricSpace.{u1} (E i) (_inst_1 i))) x (Nonempty.some.{succ u1} (E i) (Nonempty.intro.{succ u1} (E i) x))) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal))) (Dist.dist.{u1} (E j) (PseudoMetricSpace.toDist.{u1} (E j) (MetricSpace.toPseudoMetricSpace.{u1} (E j) (_inst_1 j))) (Nonempty.some.{succ u1} (E j) (Nonempty.intro.{succ u1} (E j) y)) y)))
-Case conversion may be inaccurate. Consider using '#align metric.sigma.dist_ne Metric.Sigma.dist_neₓ'. -/
 @[simp]
 theorem dist_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
     dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ = dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨y⟩) y :=
   by simp [Dist.dist, sigma.dist, h]
 #align metric.sigma.dist_ne Metric.Sigma.dist_ne
 
-/- warning: metric.sigma.one_le_dist_of_ne -> Metric.Sigma.one_le_dist_of_ne is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] {i : ι} {j : ι}, (Ne.{succ u1} ι i j) -> (forall (x : E i) (y : E j), LE.le.{0} Real Real.hasLe (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (k : ι) => E k)) (Metric.Sigma.instDist.{u1, u2} ι (fun (k : ι) => E k) (fun (i : ι) => _inst_1 i)) (Sigma.mk.{u1, u2} ι (fun (k : ι) => E k) i x) (Sigma.mk.{u1, u2} ι (fun (k : ι) => E k) j y)))
-but is expected to have type
-  forall {ι : Type.{u2}} {E : ι -> Type.{u1}} [_inst_1 : forall (i : ι), MetricSpace.{u1} (E i)] {i : ι} {j : ι}, (Ne.{succ u2} ι i j) -> (forall (x : E i) (y : E j), LE.le.{0} Real Real.instLEReal (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (k : ι) => E k)) (Metric.Sigma.instDist.{u2, u1} ι (fun (k : ι) => E k) (fun (i : ι) => _inst_1 i)) (Sigma.mk.{u2, u1} ι (fun (k : ι) => E k) i x) (Sigma.mk.{u2, u1} ι (fun (k : ι) => E k) j y)))
-Case conversion may be inaccurate. Consider using '#align metric.sigma.one_le_dist_of_ne Metric.Sigma.one_le_dist_of_neₓ'. -/
 theorem one_le_dist_of_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
     1 ≤ dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ :=
   by
@@ -504,12 +468,6 @@ theorem one_le_dist_of_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
   linarith [@dist_nonneg _ _ x (Nonempty.some ⟨x⟩), @dist_nonneg _ _ (Nonempty.some ⟨y⟩) y]
 #align metric.sigma.one_le_dist_of_ne Metric.Sigma.one_le_dist_of_ne
 
-/- warning: metric.sigma.fst_eq_of_dist_lt_one -> Metric.Sigma.fst_eq_of_dist_lt_one is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] (x : Sigma.{u1, u2} ι (fun (i : ι) => E i)) (y : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (LT.lt.{0} Real Real.hasLt (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne)))) -> (Eq.{succ u1} ι (Sigma.fst.{u1, u2} ι (fun (i : ι) => E i) x) (Sigma.fst.{u1, u2} ι (fun (i : ι) => E i) y))
-but is expected to have type
-  forall {ι : Type.{u2}} {E : ι -> Type.{u1}} [_inst_1 : forall (i : ι), MetricSpace.{u1} (E i)] (x : Sigma.{u2, u1} ι (fun (i : ι) => E i)) (y : Sigma.{u2, u1} ι (fun (i : ι) => E i)), (LT.lt.{0} Real Real.instLTReal (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u2, u1} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal))) -> (Eq.{succ u2} ι (Sigma.fst.{u2, u1} ι (fun (i : ι) => E i) x) (Sigma.fst.{u2, u1} ι (fun (i : ι) => E i) y))
-Case conversion may be inaccurate. Consider using '#align metric.sigma.fst_eq_of_dist_lt_one Metric.Sigma.fst_eq_of_dist_lt_oneₓ'. -/
 theorem fst_eq_of_dist_lt_one (x y : Σi, E i) (h : dist x y < 1) : x.1 = y.1 :=
   by
   cases x; cases y
@@ -517,12 +475,6 @@ theorem fst_eq_of_dist_lt_one (x y : Σi, E i) (h : dist x y < 1) : x.1 = y.1 :=
   apply one_le_dist_of_ne h
 #align metric.sigma.fst_eq_of_dist_lt_one Metric.Sigma.fst_eq_of_dist_lt_one
 
-/- warning: metric.sigma.dist_triangle -> Metric.Sigma.dist_triangle is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] (x : Sigma.{u1, u2} ι (fun (i : ι) => E i)) (y : Sigma.{u1, u2} ι (fun (i : ι) => E i)) (z : Sigma.{u1, u2} ι (fun (i : ι) => E i)), LE.le.{0} Real Real.hasLe (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x z) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) y z))
-but is expected to have type
-  forall {ι : Type.{u2}} {E : ι -> Type.{u1}} [_inst_1 : forall (i : ι), MetricSpace.{u1} (E i)] (x : Sigma.{u2, u1} ι (fun (i : ι) => E i)) (y : Sigma.{u2, u1} ι (fun (i : ι) => E i)) (z : Sigma.{u2, u1} ι (fun (i : ι) => E i)), LE.le.{0} Real Real.instLEReal (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u2, u1} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x z) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u2, u1} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u2, u1} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) y z))
-Case conversion may be inaccurate. Consider using '#align metric.sigma.dist_triangle Metric.Sigma.dist_triangleₓ'. -/
 protected theorem dist_triangle (x y z : Σi, E i) : dist x z ≤ dist x y + dist y z :=
   by
   rcases x with ⟨i, x⟩; rcases y with ⟨j, y⟩; rcases z with ⟨k, z⟩
@@ -560,12 +512,6 @@ protected theorem dist_triangle (x y z : Σi, E i) : dist x z ≤ dist x y + dis
           
 #align metric.sigma.dist_triangle Metric.Sigma.dist_triangle
 
-/- warning: metric.sigma.is_open_iff -> Metric.Sigma.isOpen_iff is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] (s : Set.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))), Iff (IsOpen.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Sigma.topologicalSpace.{u1, u2} ι (fun (i : ι) => E i) (fun (a : ι) => UniformSpace.toTopologicalSpace.{u2} (E a) (PseudoMetricSpace.toUniformSpace.{u2} (E a) (MetricSpace.toPseudoMetricSpace.{u2} (E a) (_inst_1 a))))) s) (forall (x : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (Membership.Mem.{max u1 u2, max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Set.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) (Set.hasMem.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) x s) -> (Exists.{1} Real (fun (ε : Real) => Exists.{0} (GT.gt.{0} Real Real.hasLt ε (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) (fun (H : GT.gt.{0} Real Real.hasLt ε (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) => forall (y : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (LT.lt.{0} Real Real.hasLt (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (a : ι) => _inst_1 a)) x y) ε) -> (Membership.Mem.{max u1 u2, max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Set.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) (Set.hasMem.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) y s)))))
-but is expected to have type
-  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] (s : Set.{max u2 u1} (Sigma.{u1, u2} ι (fun (i : ι) => E i))), Iff (IsOpen.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (instTopologicalSpaceSigma.{u1, u2} ι (fun (i : ι) => E i) (fun (a : ι) => UniformSpace.toTopologicalSpace.{u2} (E a) (PseudoMetricSpace.toUniformSpace.{u2} (E a) (MetricSpace.toPseudoMetricSpace.{u2} (E a) (_inst_1 a))))) s) (forall (x : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (Membership.mem.{max u1 u2, max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Set.{max u2 u1} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) (Set.instMembershipSet.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) x s) -> (Exists.{1} Real (fun (ε : Real) => And (GT.gt.{0} Real Real.instLTReal ε (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) (forall (y : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (LT.lt.{0} Real Real.instLTReal (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) ε) -> (Membership.mem.{max u1 u2, max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Set.{max u2 u1} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) (Set.instMembershipSet.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) y s)))))
-Case conversion may be inaccurate. Consider using '#align metric.sigma.is_open_iff Metric.Sigma.isOpen_iffₓ'. -/
 protected theorem isOpen_iff (s : Set (Σi, E i)) :
     IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s :=
   by
@@ -726,22 +672,10 @@ theorem toGlue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
 #align metric.to_glue_commute Metric.toGlue_commute
 -/
 
-/- warning: metric.to_glue_l_isometry -> Metric.toGlueL_isometry is a dubious translation:
-lean 3 declaration is
-  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : Nonempty.{succ u3} Z] [_inst_2 : MetricSpace.{u3} Z] [_inst_3 : MetricSpace.{u1} X] [_inst_4 : MetricSpace.{u2} Y] {Φ : Z -> X} {Ψ : Z -> Y} (hΦ : Isometry.{u3, u1} Z X (PseudoMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toPseudoMetricSpace.{u3} Z _inst_2)) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_3)) Φ) (hΨ : Isometry.{u3, u2} Z Y (PseudoMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toPseudoMetricSpace.{u3} Z _inst_2)) (PseudoMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_4)) Ψ), Isometry.{u1, max u1 u2} X (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_3)) (PseudoMetricSpace.toPseudoEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (MetricSpace.toPseudoMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (Metric.GlueSpace.metricSpace.{u2, u3, u1} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ))) (Metric.toGlueL.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ)
-but is expected to have type
-  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : Nonempty.{succ u3} Z] [_inst_2 : MetricSpace.{u3} Z] [_inst_3 : MetricSpace.{u1} X] [_inst_4 : MetricSpace.{u2} Y] {Φ : Z -> X} {Ψ : Z -> Y} (hΦ : Isometry.{u3, u1} Z X (EMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toEMetricSpace.{u3} Z _inst_2)) (EMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toEMetricSpace.{u1} X _inst_3)) Φ) (hΨ : Isometry.{u3, u2} Z Y (EMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toEMetricSpace.{u3} Z _inst_2)) (EMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toEMetricSpace.{u2} Y _inst_4)) Ψ), Isometry.{u1, max u1 u2} X (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (EMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toEMetricSpace.{u1} X _inst_3)) (EMetricSpace.toPseudoEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (MetricSpace.toEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (Metric.instMetricSpaceGlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ hΦ Ψ hΨ))) (Metric.toGlueL.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ)
-Case conversion may be inaccurate. Consider using '#align metric.to_glue_l_isometry Metric.toGlueL_isometryₓ'. -/
 theorem toGlueL_isometry (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Isometry (toGlueL hΦ hΨ) :=
   Isometry.of_dist_eq fun _ _ => rfl
 #align metric.to_glue_l_isometry Metric.toGlueL_isometry
 
-/- warning: metric.to_glue_r_isometry -> Metric.toGlueR_isometry is a dubious translation:
-lean 3 declaration is
-  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : Nonempty.{succ u3} Z] [_inst_2 : MetricSpace.{u3} Z] [_inst_3 : MetricSpace.{u1} X] [_inst_4 : MetricSpace.{u2} Y] {Φ : Z -> X} {Ψ : Z -> Y} (hΦ : Isometry.{u3, u1} Z X (PseudoMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toPseudoMetricSpace.{u3} Z _inst_2)) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_3)) Φ) (hΨ : Isometry.{u3, u2} Z Y (PseudoMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toPseudoMetricSpace.{u3} Z _inst_2)) (PseudoMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_4)) Ψ), Isometry.{u2, max u1 u2} Y (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (PseudoMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_4)) (PseudoMetricSpace.toPseudoEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (MetricSpace.toPseudoMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (Metric.GlueSpace.metricSpace.{u2, u3, u1} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ))) (Metric.toGlueR.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ)
-but is expected to have type
-  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : Nonempty.{succ u3} Z] [_inst_2 : MetricSpace.{u3} Z] [_inst_3 : MetricSpace.{u1} X] [_inst_4 : MetricSpace.{u2} Y] {Φ : Z -> X} {Ψ : Z -> Y} (hΦ : Isometry.{u3, u1} Z X (EMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toEMetricSpace.{u3} Z _inst_2)) (EMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toEMetricSpace.{u1} X _inst_3)) Φ) (hΨ : Isometry.{u3, u2} Z Y (EMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toEMetricSpace.{u3} Z _inst_2)) (EMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toEMetricSpace.{u2} Y _inst_4)) Ψ), Isometry.{u2, max u1 u2} Y (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (EMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toEMetricSpace.{u2} Y _inst_4)) (EMetricSpace.toPseudoEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (MetricSpace.toEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (Metric.instMetricSpaceGlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ hΦ Ψ hΨ))) (Metric.toGlueR.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ)
-Case conversion may be inaccurate. Consider using '#align metric.to_glue_r_isometry Metric.toGlueR_isometryₓ'. -/
 theorem toGlueR_isometry (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Isometry (toGlueR hΦ hΨ) :=
   Isometry.of_dist_eq fun _ _ => rfl
 #align metric.to_glue_r_isometry Metric.toGlueR_isometry
@@ -847,12 +781,6 @@ def toInductiveLimit (I : ∀ n, Isometry (f n)) (n : ℕ) (x : X n) : Metric.In
 instance (I : ∀ n, Isometry (f n)) [Inhabited (X 0)] : Inhabited (InductiveLimit I) :=
   ⟨toInductiveLimit _ 0 default⟩
 
-/- warning: metric.to_inductive_limit_isometry -> Metric.toInductiveLimit_isometry is a dubious translation:
-lean 3 declaration is
-  forall {X : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), MetricSpace.{u1} (X n)] {f : forall (n : Nat), (X n) -> (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))} (I : forall (n : Nat), Isometry.{u1, u1} (X n) (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} (X n) (MetricSpace.toPseudoMetricSpace.{u1} (X n) (_inst_1 n))) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (MetricSpace.toPseudoMetricSpace.{u1} (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (_inst_1 (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))))) (f n)) (n : Nat), Isometry.{u1, u1} (X n) (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} (X n) (MetricSpace.toPseudoMetricSpace.{u1} (X n) (_inst_1 n))) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (MetricSpace.toPseudoMetricSpace.{u1} (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (Metric.InductiveLimit.metricSpace.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I))) (Metric.toInductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I n)
-but is expected to have type
-  forall {X : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), MetricSpace.{u1} (X n)] {f : forall (n : Nat), (X n) -> (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))} (I : forall (n : Nat), Isometry.{u1, u1} (X n) (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (EMetricSpace.toPseudoEMetricSpace.{u1} (X n) (MetricSpace.toEMetricSpace.{u1} (X n) (_inst_1 n))) (EMetricSpace.toPseudoEMetricSpace.{u1} (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (MetricSpace.toEMetricSpace.{u1} (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (_inst_1 (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (f n)) (n : Nat), Isometry.{u1, u1} (X n) (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (EMetricSpace.toPseudoEMetricSpace.{u1} (X n) (MetricSpace.toEMetricSpace.{u1} (X n) (_inst_1 n))) (EMetricSpace.toPseudoEMetricSpace.{u1} (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (MetricSpace.toEMetricSpace.{u1} (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (Metric.instMetricSpaceInductiveLimitNat.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I))) (Metric.toInductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I n)
-Case conversion may be inaccurate. Consider using '#align metric.to_inductive_limit_isometry Metric.toInductiveLimit_isometryₓ'. -/
 /-- The map `to_inductive_limit n` mapping `X n` to the inductive limit is an isometry. -/
 theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
     Isometry (toInductiveLimit I n) :=
Diff
@@ -130,8 +130,7 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         by
         refine'
           Monotone.map_ciInf_of_continuousAt (continuous_at_id.add continuousAt_const) _ (B _ _)
-        intro x y hx
-        simpa
+        intro x y hx; simpa
       rw [this, comp]
       refine' ciInf_mono (B _ _) fun p => _
       calc
@@ -153,8 +152,7 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         by
         refine'
           Monotone.map_ciInf_of_continuousAt (continuous_at_const.add continuousAt_id) _ (B _ _)
-        intro x y hx
-        simpa
+        intro x y hx; simpa
       rw [this, comp]
       refine' ciInf_mono (B _ _) fun p => _
       calc
@@ -176,8 +174,7 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         by
         refine'
           Monotone.map_ciInf_of_continuousAt (continuous_at_const.add continuousAt_id) _ (B _ _)
-        intro x y hx
-        simpa
+        intro x y hx; simpa
       rw [this, comp]
       refine' ciInf_mono (B _ _) fun p => _
       calc
@@ -199,8 +196,7 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         by
         refine'
           Monotone.map_ciInf_of_continuousAt (continuous_at_id.add continuousAt_const) _ (B _ _)
-        intro x y hx
-        simpa
+        intro x y hx; simpa
       rw [this, comp]
       refine' ciInf_mono (B _ _) fun p => _
       calc
@@ -216,10 +212,8 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
       exact exists_lt_of_ciInf_lt (by linarith)
       obtain ⟨q, hq⟩ : ∃ q, dist z (Φ q) + dist y (Ψ q) < (⨅ p, dist z (Φ p) + dist y (Ψ p)) + δ / 2
       exact exists_lt_of_ciInf_lt (by linarith)
-      have : dist (Φ p) (Φ q) ≤ dist (Ψ p) (Ψ q) + 2 * ε :=
-        by
-        have := le_trans (le_abs_self _) (H p q)
-        · linarith
+      have : dist (Φ p) (Φ q) ≤ dist (Ψ p) (Ψ q) + 2 * ε := by
+        have := le_trans (le_abs_self _) (H p q); · linarith
       calc
         dist x z ≤ dist x (Φ p) + dist (Φ p) (Φ q) + dist (Φ q) z := dist_triangle4 _ _ _ _
         _ ≤ dist x (Φ p) + dist (Ψ p) (Ψ q) + dist z (Φ q) + 2 * ε := by
@@ -236,10 +230,8 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
       exact exists_lt_of_ciInf_lt (by linarith)
       obtain ⟨q, hq⟩ : ∃ q, dist y (Φ q) + dist z (Ψ q) < (⨅ p, dist y (Φ p) + dist z (Ψ p)) + δ / 2
       exact exists_lt_of_ciInf_lt (by linarith)
-      have : dist (Ψ p) (Ψ q) ≤ dist (Φ p) (Φ q) + 2 * ε :=
-        by
-        have := le_trans (neg_le_abs_self _) (H p q)
-        · linarith
+      have : dist (Ψ p) (Ψ q) ≤ dist (Φ p) (Φ q) + 2 * ε := by
+        have := le_trans (neg_le_abs_self _) (H p q); · linarith
       calc
         dist x z ≤ dist x (Ψ p) + dist (Ψ p) (Ψ q) + dist (Ψ q) z := dist_triangle4 _ _ _ _
         _ ≤ dist x (Ψ p) + dist (Φ p) (Φ q) + dist z (Ψ q) + 2 * ε := by
@@ -611,13 +603,11 @@ Since there is an arbitrary choice in this construction, it is not an instance b
 protected def metricSpace : MetricSpace (Σi, E i) :=
   by
   refine' MetricSpace.ofDistTopology sigma.dist _ _ sigma.dist_triangle sigma.is_open_iff _
-  · rintro ⟨i, x⟩
-    simp [sigma.dist]
+  · rintro ⟨i, x⟩; simp [sigma.dist]
   · rintro ⟨i, x⟩ ⟨j, y⟩
     rcases eq_or_ne i j with (rfl | h)
     · simp [sigma.dist, dist_comm]
-    · simp only [sigma.dist, dist_comm, h, h.symm, not_false_iff, dif_neg]
-      abel
+    · simp only [sigma.dist, dist_comm, h, h.symm, not_false_iff, dif_neg]; abel
   · rintro ⟨i, x⟩ ⟨j, y⟩
     rcases eq_or_ne i j with (rfl | hij)
     · simp [sigma.dist]
@@ -625,9 +615,7 @@ protected def metricSpace : MetricSpace (Σi, E i) :=
       apply (lt_irrefl (1 : ℝ) _).elim
       calc
         1 ≤ sigma.dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ := sigma.one_le_dist_of_ne hij _ _
-        _ < 1 := by
-          rw [h]
-          exact zero_lt_one
+        _ < 1 := by rw [h]; exact zero_lt_one
         
 #align metric.sigma.metric_space Metric.Sigma.metricSpace
 -/
@@ -793,10 +781,7 @@ theorem inductiveLimitDist_eq_dist (I : ∀ n, Isometry (f n)) (x y : Σn, X n)
   by
   induction' m with m hm
   · intro hx hy
-    have A : max x.1 y.1 = 0 :=
-      by
-      rw [nonpos_iff_eq_zero.1 hx, nonpos_iff_eq_zero.1 hy]
-      simp
+    have A : max x.1 y.1 = 0 := by rw [nonpos_iff_eq_zero.1 hx, nonpos_iff_eq_zero.1 hy]; simp
     unfold inductive_limit_dist
     congr <;> simp only [A]
   · intro hx hy
Diff
@@ -86,7 +86,6 @@ def glueDist (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : Sum X Y → Sum X Y →
 private theorem glue_dist_self (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : ∀ x, glueDist Φ Ψ ε x x = 0
   | inl x => dist_self _
   | inr x => dist_self _
-#align metric.glue_dist_self metric.glue_dist_self
 
 #print Metric.glueDist_glued_points /-
 theorem glueDist_glued_points [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (p : Z) :
@@ -110,7 +109,6 @@ private theorem glue_dist_comm (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) :
   | inr x, inr y => dist_comm _ _
   | inl x, inr y => rfl
   | inr x, inl y => rfl
-#align metric.glue_dist_comm metric.glue_dist_comm
 
 variable [Nonempty Z]
 
@@ -251,7 +249,6 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         _ ≤ (⨅ p, dist y (Φ p) + dist x (Ψ p)) + ε + ((⨅ p, dist y (Φ p) + dist z (Ψ p)) + ε) + δ :=
           by linarith
         
-#align metric.glue_dist_triangle metric.glue_dist_triangle
 
 private theorem glue_eq_of_dist_eq_zero (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (ε0 : 0 < ε) :
     ∀ p q : Sum X Y, glueDist Φ Ψ ε p q = 0 → p = q
@@ -272,7 +269,6 @@ private theorem glue_eq_of_dist_eq_zero (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
     exfalso
     linarith
   | inr x, inr y, h => by rw [eq_of_dist_eq_zero h]
-#align metric.glue_eq_of_dist_eq_zero metric.glue_eq_of_dist_eq_zero
 
 /- warning: metric.glue_metric_approx -> Metric.glueMetricApprox is a dubious translation:
 lean 3 declaration is
@@ -342,7 +338,6 @@ theorem Sum.dist_eq_glueDist {p q : Sum X Y} (x : X) (y : Y) :
 
 private theorem sum.dist_comm (x y : Sum X Y) : Sum.dist x y = Sum.dist y x := by
   cases x <;> cases y <;> simp only [sum.dist, dist_comm, add_comm, add_left_comm]
-#align metric.sum.dist_comm metric.sum.dist_comm
 
 /- warning: metric.sum.one_dist_le -> Metric.Sum.one_le_dist_inl_inr is a dubious translation:
 lean 3 declaration is
@@ -381,7 +376,6 @@ private theorem sum.mem_uniformity (s : Set (Sum X Y × Sum X Y)) :
   · rintro ⟨ε, ε0, H⟩
     constructor <;> rw [Filter.mem_sets, Filter.mem_map, mem_uniformity_dist] <;>
       exact ⟨ε, ε0, fun x y h => H _ _ h⟩
-#align metric.sum.mem_uniformity metric.sum.mem_uniformity
 
 #print Metric.metricSpaceSum /-
 /-- The distance on the disjoint union indeed defines a metric space. All the distance properties
Diff
@@ -96,10 +96,10 @@ theorem glueDist_glued_points [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : 
     by
     have A : ∀ q, 0 ≤ dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q) := fun q => by
       rw [← add_zero (0 : ℝ)] <;> exact add_le_add dist_nonneg dist_nonneg
-    refine' le_antisymm _ (le_cinfᵢ A)
+    refine' le_antisymm _ (le_ciInf A)
     have : 0 = dist (Φ p) (Φ p) + dist (Ψ p) (Ψ p) := by simp
     rw [this]
-    exact cinfᵢ_le ⟨0, forall_range_iff.2 A⟩ p
+    exact ciInf_le ⟨0, forall_range_iff.2 A⟩ p
   rw [glue_dist, this, zero_add]
 #align metric.glue_dist_glued_points Metric.glueDist_glued_points
 -/
@@ -128,14 +128,14 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
       by
       have :
         (⨅ p, dist y (Φ p) + dist x (Ψ p)) + dist y z =
-          infᵢ ((fun t => t + dist y z) ∘ fun p => dist y (Φ p) + dist x (Ψ p)) :=
+          iInf ((fun t => t + dist y z) ∘ fun p => dist y (Φ p) + dist x (Ψ p)) :=
         by
         refine'
-          Monotone.map_cinfᵢ_of_continuousAt (continuous_at_id.add continuousAt_const) _ (B _ _)
+          Monotone.map_ciInf_of_continuousAt (continuous_at_id.add continuousAt_const) _ (B _ _)
         intro x y hx
         simpa
       rw [this, comp]
-      refine' cinfᵢ_mono (B _ _) fun p => _
+      refine' ciInf_mono (B _ _) fun p => _
       calc
         dist z (Φ p) + dist x (Ψ p) ≤ dist y z + dist y (Φ p) + dist x (Ψ p) :=
           add_le_add (dist_triangle_left _ _ _) le_rfl
@@ -151,14 +151,14 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
       by
       have :
         (dist x y + ⨅ p, dist z (Φ p) + dist y (Ψ p)) =
-          infᵢ ((fun t => dist x y + t) ∘ fun p => dist z (Φ p) + dist y (Ψ p)) :=
+          iInf ((fun t => dist x y + t) ∘ fun p => dist z (Φ p) + dist y (Ψ p)) :=
         by
         refine'
-          Monotone.map_cinfᵢ_of_continuousAt (continuous_at_const.add continuousAt_id) _ (B _ _)
+          Monotone.map_ciInf_of_continuousAt (continuous_at_const.add continuousAt_id) _ (B _ _)
         intro x y hx
         simpa
       rw [this, comp]
-      refine' cinfᵢ_mono (B _ _) fun p => _
+      refine' ciInf_mono (B _ _) fun p => _
       calc
         dist z (Φ p) + dist x (Ψ p) ≤ dist z (Φ p) + (dist x y + dist y (Ψ p)) :=
           add_le_add le_rfl (dist_triangle _ _ _)
@@ -174,14 +174,14 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
       by
       have :
         (dist x y + ⨅ p, dist y (Φ p) + dist z (Ψ p)) =
-          infᵢ ((fun t => dist x y + t) ∘ fun p => dist y (Φ p) + dist z (Ψ p)) :=
+          iInf ((fun t => dist x y + t) ∘ fun p => dist y (Φ p) + dist z (Ψ p)) :=
         by
         refine'
-          Monotone.map_cinfᵢ_of_continuousAt (continuous_at_const.add continuousAt_id) _ (B _ _)
+          Monotone.map_ciInf_of_continuousAt (continuous_at_const.add continuousAt_id) _ (B _ _)
         intro x y hx
         simpa
       rw [this, comp]
-      refine' cinfᵢ_mono (B _ _) fun p => _
+      refine' ciInf_mono (B _ _) fun p => _
       calc
         dist x (Φ p) + dist z (Ψ p) ≤ dist x y + dist y (Φ p) + dist z (Ψ p) :=
           add_le_add (dist_triangle _ _ _) le_rfl
@@ -197,14 +197,14 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
       by
       have :
         (⨅ p, dist x (Φ p) + dist y (Ψ p)) + dist y z =
-          infᵢ ((fun t => t + dist y z) ∘ fun p => dist x (Φ p) + dist y (Ψ p)) :=
+          iInf ((fun t => t + dist y z) ∘ fun p => dist x (Φ p) + dist y (Ψ p)) :=
         by
         refine'
-          Monotone.map_cinfᵢ_of_continuousAt (continuous_at_id.add continuousAt_const) _ (B _ _)
+          Monotone.map_ciInf_of_continuousAt (continuous_at_id.add continuousAt_const) _ (B _ _)
         intro x y hx
         simpa
       rw [this, comp]
-      refine' cinfᵢ_mono (B _ _) fun p => _
+      refine' ciInf_mono (B _ _) fun p => _
       calc
         dist x (Φ p) + dist z (Ψ p) ≤ dist x (Φ p) + (dist y z + dist y (Ψ p)) :=
           add_le_add le_rfl (dist_triangle_left _ _ _)
@@ -215,9 +215,9 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
     le_of_forall_pos_le_add fun δ δpos =>
       by
       obtain ⟨p, hp⟩ : ∃ p, dist x (Φ p) + dist y (Ψ p) < (⨅ p, dist x (Φ p) + dist y (Ψ p)) + δ / 2
-      exact exists_lt_of_cinfᵢ_lt (by linarith)
+      exact exists_lt_of_ciInf_lt (by linarith)
       obtain ⟨q, hq⟩ : ∃ q, dist z (Φ q) + dist y (Ψ q) < (⨅ p, dist z (Φ p) + dist y (Ψ p)) + δ / 2
-      exact exists_lt_of_cinfᵢ_lt (by linarith)
+      exact exists_lt_of_ciInf_lt (by linarith)
       have : dist (Φ p) (Φ q) ≤ dist (Ψ p) (Ψ q) + 2 * ε :=
         by
         have := le_trans (le_abs_self _) (H p q)
@@ -235,9 +235,9 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
     le_of_forall_pos_le_add fun δ δpos =>
       by
       obtain ⟨p, hp⟩ : ∃ p, dist y (Φ p) + dist x (Ψ p) < (⨅ p, dist y (Φ p) + dist x (Ψ p)) + δ / 2
-      exact exists_lt_of_cinfᵢ_lt (by linarith)
+      exact exists_lt_of_ciInf_lt (by linarith)
       obtain ⟨q, hq⟩ : ∃ q, dist y (Φ q) + dist z (Ψ q) < (⨅ p, dist y (Φ p) + dist z (Ψ p)) + δ / 2
-      exact exists_lt_of_cinfᵢ_lt (by linarith)
+      exact exists_lt_of_ciInf_lt (by linarith)
       have : dist (Ψ p) (Ψ q) ≤ dist (Φ p) (Φ q) + 2 * ε :=
         by
         have := le_trans (neg_le_abs_self _) (H p q)
@@ -259,14 +259,14 @@ private theorem glue_eq_of_dist_eq_zero (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
   | inl x, inr y, h =>
     by
     have : 0 ≤ ⨅ p, dist x (Φ p) + dist y (Ψ p) :=
-      le_cinfᵢ fun p => by simpa using add_le_add (@dist_nonneg _ _ x _) (@dist_nonneg _ _ y _)
+      le_ciInf fun p => by simpa using add_le_add (@dist_nonneg _ _ x _) (@dist_nonneg _ _ y _)
     have : 0 + ε ≤ glue_dist Φ Ψ ε (inl x) (inr y) := add_le_add this (le_refl ε)
     exfalso
     linarith
   | inr x, inl y, h =>
     by
     have : 0 ≤ ⨅ p, dist y (Φ p) + dist x (Ψ p) :=
-      le_cinfᵢ fun p => by
+      le_ciInf fun p => by
         simpa [add_comm] using add_le_add (@dist_nonneg _ _ x _) (@dist_nonneg _ _ y _)
     have : 0 + ε ≤ glue_dist Φ Ψ ε (inr x) (inl y) := add_le_add this (le_refl ε)
     exfalso
@@ -664,7 +664,7 @@ protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σ
   have hd : ∀ (i j), ∀ x ∈ s i, ∀ y ∈ s j, (x, y) ∈ U → i = j := fun i j x hx y hy hxy =>
     (Eq.symm hx).trans ((fst_eq_of_dist_lt_one _ _ hxy).trans hy)
   refine' completeSpace_of_isComplete_univ _
-  convert isComplete_unionᵢ_separated hc (dist_mem_uniformity zero_lt_one) hd
+  convert isComplete_iUnion_separated hc (dist_mem_uniformity zero_lt_one) hd
   simp [s, ← preimage_Union]
 #align metric.sigma.complete_space Metric.Sigma.completeSpace
 -/
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module topology.metric_space.gluing
-! leanprover-community/mathlib commit e1a7bdeb4fd826b7e71d130d34988f0a2d26a177
+! leanprover-community/mathlib commit 69c6a5a12d8a2b159f20933e60115a4f2de62b58
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.Topology.MetricSpace.Isometry
 /-!
 # Metric space gluing
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 Gluing two metric spaces along a common subset. Formally, we are given
 
 ```
Diff
@@ -70,6 +70,7 @@ variable [MetricSpace X] [MetricSpace Y] {Φ : Z → X} {Ψ : Z → Y} {ε : ℝ
 
 open _Root_.Sum (inl inr)
 
+#print Metric.glueDist /-
 /-- Define a predistance on `X ⊕ Y`, for which `Φ p` and `Ψ p` are at distance `ε` -/
 def glueDist (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : Sum X Y → Sum X Y → ℝ
   | inl x, inl y => dist x y
@@ -77,12 +78,14 @@ def glueDist (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : Sum X Y → Sum X Y →
   | inl x, inr y => (⨅ p, dist x (Φ p) + dist y (Ψ p)) + ε
   | inr x, inl y => (⨅ p, dist y (Φ p) + dist x (Ψ p)) + ε
 #align metric.glue_dist Metric.glueDist
+-/
 
 private theorem glue_dist_self (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : ∀ x, glueDist Φ Ψ ε x x = 0
   | inl x => dist_self _
   | inr x => dist_self _
 #align metric.glue_dist_self metric.glue_dist_self
 
+#print Metric.glueDist_glued_points /-
 theorem glueDist_glued_points [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (p : Z) :
     glueDist Φ Ψ ε (inl (Φ p)) (inr (Ψ p)) = ε :=
   by
@@ -96,6 +99,7 @@ theorem glueDist_glued_points [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : 
     exact cinfᵢ_le ⟨0, forall_range_iff.2 A⟩ p
   rw [glue_dist, this, zero_add]
 #align metric.glue_dist_glued_points Metric.glueDist_glued_points
+-/
 
 private theorem glue_dist_comm (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) :
     ∀ x y, glueDist Φ Ψ ε x y = glueDist Φ Ψ ε y x
@@ -267,6 +271,12 @@ private theorem glue_eq_of_dist_eq_zero (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
   | inr x, inr y, h => by rw [eq_of_dist_eq_zero h]
 #align metric.glue_eq_of_dist_eq_zero metric.glue_eq_of_dist_eq_zero
 
+/- warning: metric.glue_metric_approx -> Metric.glueMetricApprox is a dubious translation:
+lean 3 declaration is
+  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] [_inst_3 : Nonempty.{succ u3} Z] (Φ : Z -> X) (Ψ : Z -> Y) (ε : Real), (LT.lt.{0} Real Real.hasLt (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero))) ε) -> (forall (p : Z) (q : Z), LE.le.{0} Real Real.hasLe (Abs.abs.{0} Real (Neg.toHasAbs.{0} Real Real.hasNeg Real.hasSup) (HSub.hSub.{0, 0, 0} Real Real Real (instHSub.{0} Real Real.hasSub) (Dist.dist.{u1} X (PseudoMetricSpace.toHasDist.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_1)) (Φ p) (Φ q)) (Dist.dist.{u2} Y (PseudoMetricSpace.toHasDist.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_2)) (Ψ p) (Ψ q)))) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.hasMul) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne)))) ε)) -> (MetricSpace.{max u1 u2} (Sum.{u1, u2} X Y))
+but is expected to have type
+  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] [_inst_3 : Nonempty.{succ u3} Z] (Φ : Z -> X) (Ψ : Z -> Y) (ε : Real), (LT.lt.{0} Real Real.instLTReal (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal)) ε) -> (forall (p : Z) (q : Z), LE.le.{0} Real Real.instLEReal (Abs.abs.{0} Real (Neg.toHasAbs.{0} Real Real.instNegReal Real.instSupReal) (HSub.hSub.{0, 0, 0} Real Real Real (instHSub.{0} Real Real.instSubReal) (Dist.dist.{u1} X (PseudoMetricSpace.toDist.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_1)) (Φ p) (Φ q)) (Dist.dist.{u2} Y (PseudoMetricSpace.toDist.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_2)) (Ψ p) (Ψ q)))) (HMul.hMul.{0, 0, 0} Real Real Real (instHMul.{0} Real Real.instMulReal) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) ε)) -> (MetricSpace.{max u2 u1} (Sum.{u1, u2} X Y))
+Case conversion may be inaccurate. Consider using '#align metric.glue_metric_approx Metric.glueMetricApproxₓ'. -/
 /-- Given two maps `Φ` and `Ψ` intro metric spaces `X` and `Y` such that the distances between
 `Φ p` and `Φ q`, and between `Ψ p` and `Ψ q`, coincide up to `2 ε` where `ε > 0`, one can almost
 glue the two spaces `X` and `Y` along the images of `Φ` and `Ψ`, so that `Φ p` and `Ψ p` are
@@ -295,6 +305,7 @@ variable [MetricSpace X] [MetricSpace Y]
 
 open Sum (inl inr)
 
+#print Metric.Sum.dist /-
 /-- Distance on a disjoint union. There are many (noncanonical) ways to put a distance compatible
 with each factor.
 If the two spaces are bounded, one can say for instance that each point in the first is at distance
@@ -311,7 +322,14 @@ def Sum.dist : Sum X Y → Sum X Y → ℝ
   | inl a, inr b => dist a (Nonempty.some ⟨a⟩) + 1 + dist (Nonempty.some ⟨b⟩) b
   | inr b, inl a => dist b (Nonempty.some ⟨b⟩) + 1 + dist (Nonempty.some ⟨a⟩) a
 #align metric.sum.dist Metric.Sum.dist
+-/
 
+/- warning: metric.sum.dist_eq_glue_dist -> Metric.Sum.dist_eq_glueDist is a dubious translation:
+lean 3 declaration is
+  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {p : Sum.{u1, u2} X Y} {q : Sum.{u1, u2} X Y} (x : X) (y : Y), Eq.{1} Real (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 p q) (Metric.glueDist.{u1, u2, 0} X Y Unit _inst_1 _inst_2 (fun (_x : Unit) => Nonempty.some.{succ u1} X (Nonempty.intro.{succ u1} X x)) (fun (_x : Unit) => Nonempty.some.{succ u2} Y (Nonempty.intro.{succ u2} Y y)) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) p q)
+but is expected to have type
+  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {p : Sum.{u1, u2} X Y} {q : Sum.{u1, u2} X Y} (x : X) (y : Y), Eq.{1} Real (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 p q) (Metric.glueDist.{u1, u2, 0} X Y Unit _inst_1 _inst_2 (fun (_x : Unit) => Nonempty.some.{succ u1} X (Nonempty.intro.{succ u1} X x)) (fun (_x : Unit) => Nonempty.some.{succ u2} Y (Nonempty.intro.{succ u2} Y y)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) p q)
+Case conversion may be inaccurate. Consider using '#align metric.sum.dist_eq_glue_dist Metric.Sum.dist_eq_glueDistₓ'. -/
 theorem Sum.dist_eq_glueDist {p q : Sum X Y} (x : X) (y : Y) :
     Sum.dist p q =
       glueDist (fun _ : Unit => Nonempty.some ⟨x⟩) (fun _ : Unit => Nonempty.some ⟨y⟩) 1 p q :=
@@ -323,14 +341,26 @@ private theorem sum.dist_comm (x y : Sum X Y) : Sum.dist x y = Sum.dist y x := b
   cases x <;> cases y <;> simp only [sum.dist, dist_comm, add_comm, add_left_comm]
 #align metric.sum.dist_comm metric.sum.dist_comm
 
-theorem Sum.one_dist_le {x : X} {y : Y} : 1 ≤ Sum.dist (inl x) (inr y) :=
+/- warning: metric.sum.one_dist_le -> Metric.Sum.one_le_dist_inl_inr is a dubious translation:
+lean 3 declaration is
+  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {x : X} {y : Y}, LE.le.{0} Real Real.hasLe (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 (Sum.inl.{u1, u2} X Y x) (Sum.inr.{u1, u2} X Y y))
+but is expected to have type
+  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {x : X} {y : Y}, LE.le.{0} Real Real.instLEReal (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 (Sum.inl.{u1, u2} X Y x) (Sum.inr.{u1, u2} X Y y))
+Case conversion may be inaccurate. Consider using '#align metric.sum.one_dist_le Metric.Sum.one_le_dist_inl_inrₓ'. -/
+theorem Sum.one_le_dist_inl_inr {x : X} {y : Y} : 1 ≤ Sum.dist (inl x) (inr y) :=
   le_trans (le_add_of_nonneg_right dist_nonneg) <|
     add_le_add_right (le_add_of_nonneg_left dist_nonneg) _
-#align metric.sum.one_dist_le Metric.Sum.one_dist_le
-
-theorem Sum.one_dist_le' {x : X} {y : Y} : 1 ≤ Sum.dist (inr y) (inl x) := by
+#align metric.sum.one_dist_le Metric.Sum.one_le_dist_inl_inr
+
+/- warning: metric.sum.one_dist_le' -> Metric.Sum.one_le_dist_inr_inl is a dubious translation:
+lean 3 declaration is
+  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {x : X} {y : Y}, LE.le.{0} Real Real.hasLe (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 (Sum.inr.{u1, u2} X Y y) (Sum.inl.{u1, u2} X Y x))
+but is expected to have type
+  forall {X : Type.{u1}} {Y : Type.{u2}} [_inst_1 : MetricSpace.{u1} X] [_inst_2 : MetricSpace.{u2} Y] {x : X} {y : Y}, LE.le.{0} Real Real.instLEReal (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (Metric.Sum.dist.{u1, u2} X Y _inst_1 _inst_2 (Sum.inr.{u1, u2} X Y y) (Sum.inl.{u1, u2} X Y x))
+Case conversion may be inaccurate. Consider using '#align metric.sum.one_dist_le' Metric.Sum.one_le_dist_inr_inlₓ'. -/
+theorem Sum.one_le_dist_inr_inl {x : X} {y : Y} : 1 ≤ Sum.dist (inr y) (inl x) := by
   rw [sum.dist_comm] <;> exact sum.one_dist_le
-#align metric.sum.one_dist_le' Metric.Sum.one_dist_le'
+#align metric.sum.one_dist_le' Metric.Sum.one_le_dist_inr_inl
 
 private theorem sum.mem_uniformity (s : Set (Sum X Y × Sum X Y)) :
     s ∈ 𝓤 (Sum X Y) ↔ ∃ ε > 0, ∀ a b, Sum.dist a b < ε → (a, b) ∈ s :=
@@ -350,6 +380,7 @@ private theorem sum.mem_uniformity (s : Set (Sum X Y × Sum X Y)) :
       exact ⟨ε, ε0, fun x y h => H _ _ h⟩
 #align metric.sum.mem_uniformity metric.sum.mem_uniformity
 
+#print Metric.metricSpaceSum /-
 /-- The distance on the disjoint union indeed defines a metric space. All the distance properties
 follow from our choice of the distance. The harder work is to show that the uniform structure
 defined by the distance coincides with the disjoint union uniform structure. -/
@@ -387,22 +418,29 @@ def metricSpaceSum : MetricSpace (Sum X Y)
   toUniformSpace := Sum.uniformSpace
   uniformity_dist := uniformity_dist_of_mem_uniformity _ _ Sum.mem_uniformity
 #align metric.metric_space_sum Metric.metricSpaceSum
+-/
 
 attribute [local instance] metric_space_sum
 
+#print Metric.Sum.dist_eq /-
 theorem Sum.dist_eq {x y : Sum X Y} : dist x y = Sum.dist x y :=
   rfl
 #align metric.sum.dist_eq Metric.Sum.dist_eq
+-/
 
+#print Metric.isometry_inl /-
 /-- The left injection of a space in a disjoint union is an isometry -/
 theorem isometry_inl : Isometry (Sum.inl : X → Sum X Y) :=
   Isometry.of_dist_eq fun x y => rfl
 #align metric.isometry_inl Metric.isometry_inl
+-/
 
+#print Metric.isometry_inr /-
 /-- The right injection of a space in a disjoint union is an isometry -/
 theorem isometry_inr : Isometry (Sum.inr : Y → Sum X Y) :=
   Isometry.of_dist_eq fun x y => rfl
 #align metric.isometry_inr Metric.isometry_inr
+-/
 
 end Sum
 
@@ -414,6 +452,7 @@ variable {ι : Type _} {E : ι → Type _} [∀ i, MetricSpace (E i)]
 
 open Classical
 
+#print Metric.Sigma.dist /-
 /-- Distance on a disjoint union. There are many (noncanonical) ways to put a distance compatible
 with each factor.
 We choose a construction that works for unbounded spaces, but requires basepoints,
@@ -429,29 +468,46 @@ protected def dist : (Σi, E i) → (Σi, E i) → ℝ
       Dist.dist x (cast this y)
     else Dist.dist x (Nonempty.some ⟨x⟩) + 1 + Dist.dist (Nonempty.some ⟨y⟩) y
 #align metric.sigma.dist Metric.Sigma.dist
+-/
 
+#print Metric.Sigma.instDist /-
 /-- A `has_dist` instance on the disjoint union `Σ i, E i`.
 We embed isometrically each factor, set the basepoints at distance 1, arbitrarily,
 and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
 their respective basepoints, plus the distance 1 between the basepoints.
 Since there is an arbitrary choice in this construction, it is not an instance by default. -/
-def hasDist : Dist (Σi, E i) :=
+def instDist : Dist (Σi, E i) :=
   ⟨Sigma.dist⟩
-#align metric.sigma.has_dist Metric.Sigma.hasDist
+#align metric.sigma.has_dist Metric.Sigma.instDist
+-/
 
 attribute [local instance] sigma.has_dist
 
+#print Metric.Sigma.dist_same /-
 @[simp]
 theorem dist_same (i : ι) (x : E i) (y : E i) : dist (⟨i, x⟩ : Σj, E j) ⟨i, y⟩ = dist x y := by
   simp [Dist.dist, sigma.dist]
 #align metric.sigma.dist_same Metric.Sigma.dist_same
+-/
 
+/- warning: metric.sigma.dist_ne -> Metric.Sigma.dist_ne is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] {i : ι} {j : ι}, (Ne.{succ u1} ι i j) -> (forall (x : E i) (y : E j), Eq.{1} Real (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (k : ι) => E k)) (Metric.Sigma.instDist.{u1, u2} ι (fun (k : ι) => E k) (fun (i : ι) => _inst_1 i)) (Sigma.mk.{u1, u2} ι (fun (k : ι) => E k) i x) (Sigma.mk.{u1, u2} ι (fun (k : ι) => E k) j y)) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (Dist.dist.{u2} (E i) (PseudoMetricSpace.toHasDist.{u2} (E i) (MetricSpace.toPseudoMetricSpace.{u2} (E i) (_inst_1 i))) x (Nonempty.some.{succ u2} (E i) (Nonempty.intro.{succ u2} (E i) x))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne)))) (Dist.dist.{u2} (E j) (PseudoMetricSpace.toHasDist.{u2} (E j) (MetricSpace.toPseudoMetricSpace.{u2} (E j) (_inst_1 j))) (Nonempty.some.{succ u2} (E j) (Nonempty.intro.{succ u2} (E j) y)) y)))
+but is expected to have type
+  forall {ι : Type.{u2}} {E : ι -> Type.{u1}} [_inst_1 : forall (i : ι), MetricSpace.{u1} (E i)] {i : ι} {j : ι}, (Ne.{succ u2} ι i j) -> (forall (x : E i) (y : E j), Eq.{1} Real (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (k : ι) => E k)) (Metric.Sigma.instDist.{u2, u1} ι (fun (k : ι) => E k) (fun (i : ι) => _inst_1 i)) (Sigma.mk.{u2, u1} ι (fun (k : ι) => E k) i x) (Sigma.mk.{u2, u1} ι (fun (k : ι) => E k) j y)) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (Dist.dist.{u1} (E i) (PseudoMetricSpace.toDist.{u1} (E i) (MetricSpace.toPseudoMetricSpace.{u1} (E i) (_inst_1 i))) x (Nonempty.some.{succ u1} (E i) (Nonempty.intro.{succ u1} (E i) x))) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal))) (Dist.dist.{u1} (E j) (PseudoMetricSpace.toDist.{u1} (E j) (MetricSpace.toPseudoMetricSpace.{u1} (E j) (_inst_1 j))) (Nonempty.some.{succ u1} (E j) (Nonempty.intro.{succ u1} (E j) y)) y)))
+Case conversion may be inaccurate. Consider using '#align metric.sigma.dist_ne Metric.Sigma.dist_neₓ'. -/
 @[simp]
 theorem dist_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
     dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ = dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨y⟩) y :=
   by simp [Dist.dist, sigma.dist, h]
 #align metric.sigma.dist_ne Metric.Sigma.dist_ne
 
+/- warning: metric.sigma.one_le_dist_of_ne -> Metric.Sigma.one_le_dist_of_ne is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] {i : ι} {j : ι}, (Ne.{succ u1} ι i j) -> (forall (x : E i) (y : E j), LE.le.{0} Real Real.hasLe (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (k : ι) => E k)) (Metric.Sigma.instDist.{u1, u2} ι (fun (k : ι) => E k) (fun (i : ι) => _inst_1 i)) (Sigma.mk.{u1, u2} ι (fun (k : ι) => E k) i x) (Sigma.mk.{u1, u2} ι (fun (k : ι) => E k) j y)))
+but is expected to have type
+  forall {ι : Type.{u2}} {E : ι -> Type.{u1}} [_inst_1 : forall (i : ι), MetricSpace.{u1} (E i)] {i : ι} {j : ι}, (Ne.{succ u2} ι i j) -> (forall (x : E i) (y : E j), LE.le.{0} Real Real.instLEReal (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (k : ι) => E k)) (Metric.Sigma.instDist.{u2, u1} ι (fun (k : ι) => E k) (fun (i : ι) => _inst_1 i)) (Sigma.mk.{u2, u1} ι (fun (k : ι) => E k) i x) (Sigma.mk.{u2, u1} ι (fun (k : ι) => E k) j y)))
+Case conversion may be inaccurate. Consider using '#align metric.sigma.one_le_dist_of_ne Metric.Sigma.one_le_dist_of_neₓ'. -/
 theorem one_le_dist_of_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
     1 ≤ dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ :=
   by
@@ -459,6 +515,12 @@ theorem one_le_dist_of_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
   linarith [@dist_nonneg _ _ x (Nonempty.some ⟨x⟩), @dist_nonneg _ _ (Nonempty.some ⟨y⟩) y]
 #align metric.sigma.one_le_dist_of_ne Metric.Sigma.one_le_dist_of_ne
 
+/- warning: metric.sigma.fst_eq_of_dist_lt_one -> Metric.Sigma.fst_eq_of_dist_lt_one is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] (x : Sigma.{u1, u2} ι (fun (i : ι) => E i)) (y : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (LT.lt.{0} Real Real.hasLt (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne)))) -> (Eq.{succ u1} ι (Sigma.fst.{u1, u2} ι (fun (i : ι) => E i) x) (Sigma.fst.{u1, u2} ι (fun (i : ι) => E i) y))
+but is expected to have type
+  forall {ι : Type.{u2}} {E : ι -> Type.{u1}} [_inst_1 : forall (i : ι), MetricSpace.{u1} (E i)] (x : Sigma.{u2, u1} ι (fun (i : ι) => E i)) (y : Sigma.{u2, u1} ι (fun (i : ι) => E i)), (LT.lt.{0} Real Real.instLTReal (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u2, u1} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal))) -> (Eq.{succ u2} ι (Sigma.fst.{u2, u1} ι (fun (i : ι) => E i) x) (Sigma.fst.{u2, u1} ι (fun (i : ι) => E i) y))
+Case conversion may be inaccurate. Consider using '#align metric.sigma.fst_eq_of_dist_lt_one Metric.Sigma.fst_eq_of_dist_lt_oneₓ'. -/
 theorem fst_eq_of_dist_lt_one (x y : Σi, E i) (h : dist x y < 1) : x.1 = y.1 :=
   by
   cases x; cases y
@@ -466,6 +528,12 @@ theorem fst_eq_of_dist_lt_one (x y : Σi, E i) (h : dist x y < 1) : x.1 = y.1 :=
   apply one_le_dist_of_ne h
 #align metric.sigma.fst_eq_of_dist_lt_one Metric.Sigma.fst_eq_of_dist_lt_one
 
+/- warning: metric.sigma.dist_triangle -> Metric.Sigma.dist_triangle is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] (x : Sigma.{u1, u2} ι (fun (i : ι) => E i)) (y : Sigma.{u1, u2} ι (fun (i : ι) => E i)) (z : Sigma.{u1, u2} ι (fun (i : ι) => E i)), LE.le.{0} Real Real.hasLe (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x z) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) y z))
+but is expected to have type
+  forall {ι : Type.{u2}} {E : ι -> Type.{u1}} [_inst_1 : forall (i : ι), MetricSpace.{u1} (E i)] (x : Sigma.{u2, u1} ι (fun (i : ι) => E i)) (y : Sigma.{u2, u1} ι (fun (i : ι) => E i)) (z : Sigma.{u2, u1} ι (fun (i : ι) => E i)), LE.le.{0} Real Real.instLEReal (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u2, u1} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x z) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u2, u1} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) (Dist.dist.{max u2 u1} (Sigma.{u2, u1} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u2, u1} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) y z))
+Case conversion may be inaccurate. Consider using '#align metric.sigma.dist_triangle Metric.Sigma.dist_triangleₓ'. -/
 protected theorem dist_triangle (x y z : Σi, E i) : dist x z ≤ dist x y + dist y z :=
   by
   rcases x with ⟨i, x⟩; rcases y with ⟨j, y⟩; rcases z with ⟨k, z⟩
@@ -503,6 +571,12 @@ protected theorem dist_triangle (x y z : Σi, E i) : dist x z ≤ dist x y + dis
           
 #align metric.sigma.dist_triangle Metric.Sigma.dist_triangle
 
+/- warning: metric.sigma.is_open_iff -> Metric.Sigma.isOpen_iff is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] (s : Set.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))), Iff (IsOpen.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Sigma.topologicalSpace.{u1, u2} ι (fun (i : ι) => E i) (fun (a : ι) => UniformSpace.toTopologicalSpace.{u2} (E a) (PseudoMetricSpace.toUniformSpace.{u2} (E a) (MetricSpace.toPseudoMetricSpace.{u2} (E a) (_inst_1 a))))) s) (forall (x : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (Membership.Mem.{max u1 u2, max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Set.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) (Set.hasMem.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) x s) -> (Exists.{1} Real (fun (ε : Real) => Exists.{0} (GT.gt.{0} Real Real.hasLt ε (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) (fun (H : GT.gt.{0} Real Real.hasLt ε (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) => forall (y : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (LT.lt.{0} Real Real.hasLt (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (a : ι) => _inst_1 a)) x y) ε) -> (Membership.Mem.{max u1 u2, max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Set.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) (Set.hasMem.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) y s)))))
+but is expected to have type
+  forall {ι : Type.{u1}} {E : ι -> Type.{u2}} [_inst_1 : forall (i : ι), MetricSpace.{u2} (E i)] (s : Set.{max u2 u1} (Sigma.{u1, u2} ι (fun (i : ι) => E i))), Iff (IsOpen.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (instTopologicalSpaceSigma.{u1, u2} ι (fun (i : ι) => E i) (fun (a : ι) => UniformSpace.toTopologicalSpace.{u2} (E a) (PseudoMetricSpace.toUniformSpace.{u2} (E a) (MetricSpace.toPseudoMetricSpace.{u2} (E a) (_inst_1 a))))) s) (forall (x : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (Membership.mem.{max u1 u2, max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Set.{max u2 u1} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) (Set.instMembershipSet.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) x s) -> (Exists.{1} Real (fun (ε : Real) => And (GT.gt.{0} Real Real.instLTReal ε (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) (forall (y : Sigma.{u1, u2} ι (fun (i : ι) => E i)), (LT.lt.{0} Real Real.instLTReal (Dist.dist.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Metric.Sigma.instDist.{u1, u2} ι (fun (i : ι) => E i) (fun (i : ι) => _inst_1 i)) x y) ε) -> (Membership.mem.{max u1 u2, max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i)) (Set.{max u2 u1} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) (Set.instMembershipSet.{max u1 u2} (Sigma.{u1, u2} ι (fun (i : ι) => E i))) y s)))))
+Case conversion may be inaccurate. Consider using '#align metric.sigma.is_open_iff Metric.Sigma.isOpen_iffₓ'. -/
 protected theorem isOpen_iff (s : Set (Σi, E i)) :
     IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s :=
   by
@@ -531,6 +605,7 @@ protected theorem isOpen_iff (s : Set (Σi, E i)) :
     exact mem_ball'.1 hy
 #align metric.sigma.is_open_iff Metric.Sigma.isOpen_iff
 
+#print Metric.Sigma.metricSpace /-
 /-- A metric space structure on the disjoint union `Σ i, E i`.
 We embed isometrically each factor, set the basepoints at distance 1, arbitrarily,
 and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
@@ -558,6 +633,7 @@ protected def metricSpace : MetricSpace (Σi, E i) :=
           exact zero_lt_one
         
 #align metric.sigma.metric_space Metric.Sigma.metricSpace
+-/
 
 attribute [local instance] sigma.metric_space
 
@@ -565,11 +641,14 @@ open Topology
 
 open Filter
 
+#print Metric.Sigma.isometry_mk /-
 /-- The injection of a space in a disjoint union is an isometry -/
 theorem isometry_mk (i : ι) : Isometry (Sigma.mk i : E i → Σk, E k) :=
   Isometry.of_dist_eq fun x y => by simp
 #align metric.sigma.isometry_mk Metric.Sigma.isometry_mk
+-/
 
+#print Metric.Sigma.completeSpace /-
 /-- A disjoint union of complete metric spaces is complete. -/
 protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σi, E i) :=
   by
@@ -585,6 +664,7 @@ protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σ
   convert isComplete_unionᵢ_separated hc (dist_mem_uniformity zero_lt_one) hd
   simp [s, ← preimage_Union]
 #align metric.sigma.complete_space Metric.Sigma.completeSpace
+-/
 
 end Sigma
 
@@ -600,6 +680,7 @@ open _Root_.Sum (inl inr)
 
 attribute [local instance] UniformSpace.separationSetoid
 
+#print Metric.gluePremetric /-
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a pseudo metric space
 structure on `X ⊕ Y` by declaring that `Φ x` and `Ψ x` are at distance `0`. -/
 def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (Sum X Y)
@@ -609,34 +690,46 @@ def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (S
   dist_comm := glueDist_comm Φ Ψ 0
   dist_triangle := glueDist_triangle Φ Ψ 0 fun p q => by rw [hΦ.dist_eq, hΨ.dist_eq] <;> simp
 #align metric.glue_premetric Metric.gluePremetric
+-/
 
+#print Metric.GlueSpace /-
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a
 space  `glue_space hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
 def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ :=
   @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace deriving MetricSpace
 #align metric.glue_space Metric.GlueSpace
+-/
 
+#print Metric.toGlueL /-
 /-- The canonical map from `X` to the space obtained by gluing isometric subsets in `X` and `Y`. -/
 def toGlueL (hΦ : Isometry Φ) (hΨ : Isometry Ψ) (x : X) : GlueSpace hΦ hΨ :=
   Quotient.mk'' (inl x)
 #align metric.to_glue_l Metric.toGlueL
+-/
 
+#print Metric.toGlueR /-
 /-- The canonical map from `Y` to the space obtained by gluing isometric subsets in `X` and `Y`. -/
 def toGlueR (hΦ : Isometry Φ) (hΨ : Isometry Ψ) (y : Y) : GlueSpace hΦ hΨ :=
   Quotient.mk'' (inr y)
 #align metric.to_glue_r Metric.toGlueR
+-/
 
+#print Metric.inhabitedLeft /-
 instance inhabitedLeft (hΦ : Isometry Φ) (hΨ : Isometry Ψ) [Inhabited X] :
     Inhabited (GlueSpace hΦ hΨ) :=
   ⟨toGlueL _ _ default⟩
 #align metric.inhabited_left Metric.inhabitedLeft
+-/
 
+#print Metric.inhabitedRight /-
 instance inhabitedRight (hΦ : Isometry Φ) (hΨ : Isometry Ψ) [Inhabited Y] :
     Inhabited (GlueSpace hΦ hΨ) :=
   ⟨toGlueR _ _ default⟩
 #align metric.inhabited_right Metric.inhabitedRight
+-/
 
-theorem to_glue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
+#print Metric.toGlue_commute /-
+theorem toGlue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
     toGlueL hΦ hΨ ∘ Φ = toGlueR hΦ hΨ ∘ Ψ :=
   by
   letI i : PseudoMetricSpace (Sum X Y) := glue_premetric hΦ hΨ
@@ -645,12 +738,25 @@ theorem to_glue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
   simp only [comp, to_glue_l, to_glue_r]
   refine' UniformSpace.SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
   exact glue_dist_glued_points Φ Ψ 0 x
-#align metric.to_glue_commute Metric.to_glue_commute
+#align metric.to_glue_commute Metric.toGlue_commute
+-/
 
+/- warning: metric.to_glue_l_isometry -> Metric.toGlueL_isometry is a dubious translation:
+lean 3 declaration is
+  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : Nonempty.{succ u3} Z] [_inst_2 : MetricSpace.{u3} Z] [_inst_3 : MetricSpace.{u1} X] [_inst_4 : MetricSpace.{u2} Y] {Φ : Z -> X} {Ψ : Z -> Y} (hΦ : Isometry.{u3, u1} Z X (PseudoMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toPseudoMetricSpace.{u3} Z _inst_2)) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_3)) Φ) (hΨ : Isometry.{u3, u2} Z Y (PseudoMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toPseudoMetricSpace.{u3} Z _inst_2)) (PseudoMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_4)) Ψ), Isometry.{u1, max u1 u2} X (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_3)) (PseudoMetricSpace.toPseudoEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (MetricSpace.toPseudoMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (Metric.GlueSpace.metricSpace.{u2, u3, u1} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ))) (Metric.toGlueL.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ)
+but is expected to have type
+  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : Nonempty.{succ u3} Z] [_inst_2 : MetricSpace.{u3} Z] [_inst_3 : MetricSpace.{u1} X] [_inst_4 : MetricSpace.{u2} Y] {Φ : Z -> X} {Ψ : Z -> Y} (hΦ : Isometry.{u3, u1} Z X (EMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toEMetricSpace.{u3} Z _inst_2)) (EMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toEMetricSpace.{u1} X _inst_3)) Φ) (hΨ : Isometry.{u3, u2} Z Y (EMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toEMetricSpace.{u3} Z _inst_2)) (EMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toEMetricSpace.{u2} Y _inst_4)) Ψ), Isometry.{u1, max u1 u2} X (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (EMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toEMetricSpace.{u1} X _inst_3)) (EMetricSpace.toPseudoEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (MetricSpace.toEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (Metric.instMetricSpaceGlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ hΦ Ψ hΨ))) (Metric.toGlueL.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ)
+Case conversion may be inaccurate. Consider using '#align metric.to_glue_l_isometry Metric.toGlueL_isometryₓ'. -/
 theorem toGlueL_isometry (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Isometry (toGlueL hΦ hΨ) :=
   Isometry.of_dist_eq fun _ _ => rfl
 #align metric.to_glue_l_isometry Metric.toGlueL_isometry
 
+/- warning: metric.to_glue_r_isometry -> Metric.toGlueR_isometry is a dubious translation:
+lean 3 declaration is
+  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : Nonempty.{succ u3} Z] [_inst_2 : MetricSpace.{u3} Z] [_inst_3 : MetricSpace.{u1} X] [_inst_4 : MetricSpace.{u2} Y] {Φ : Z -> X} {Ψ : Z -> Y} (hΦ : Isometry.{u3, u1} Z X (PseudoMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toPseudoMetricSpace.{u3} Z _inst_2)) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toPseudoMetricSpace.{u1} X _inst_3)) Φ) (hΨ : Isometry.{u3, u2} Z Y (PseudoMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toPseudoMetricSpace.{u3} Z _inst_2)) (PseudoMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_4)) Ψ), Isometry.{u2, max u1 u2} Y (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (PseudoMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toPseudoMetricSpace.{u2} Y _inst_4)) (PseudoMetricSpace.toPseudoEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (MetricSpace.toPseudoMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (Metric.GlueSpace.metricSpace.{u2, u3, u1} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ))) (Metric.toGlueR.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ)
+but is expected to have type
+  forall {X : Type.{u1}} {Y : Type.{u2}} {Z : Type.{u3}} [_inst_1 : Nonempty.{succ u3} Z] [_inst_2 : MetricSpace.{u3} Z] [_inst_3 : MetricSpace.{u1} X] [_inst_4 : MetricSpace.{u2} Y] {Φ : Z -> X} {Ψ : Z -> Y} (hΦ : Isometry.{u3, u1} Z X (EMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toEMetricSpace.{u3} Z _inst_2)) (EMetricSpace.toPseudoEMetricSpace.{u1} X (MetricSpace.toEMetricSpace.{u1} X _inst_3)) Φ) (hΨ : Isometry.{u3, u2} Z Y (EMetricSpace.toPseudoEMetricSpace.{u3} Z (MetricSpace.toEMetricSpace.{u3} Z _inst_2)) (EMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toEMetricSpace.{u2} Y _inst_4)) Ψ), Isometry.{u2, max u1 u2} Y (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (EMetricSpace.toPseudoEMetricSpace.{u2} Y (MetricSpace.toEMetricSpace.{u2} Y _inst_4)) (EMetricSpace.toPseudoEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (MetricSpace.toEMetricSpace.{max u1 u2} (Metric.GlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ) (Metric.instMetricSpaceGlueSpace.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ hΦ Ψ hΨ))) (Metric.toGlueR.{u1, u2, u3} X Y Z _inst_1 _inst_2 _inst_3 _inst_4 Φ Ψ hΦ hΨ)
+Case conversion may be inaccurate. Consider using '#align metric.to_glue_r_isometry Metric.toGlueR_isometryₓ'. -/
 theorem toGlueR_isometry (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Isometry (toGlueR hΦ hΨ) :=
   Isometry.of_dist_eq fun _ _ => rfl
 #align metric.to_glue_r_isometry Metric.toGlueR_isometry
@@ -672,12 +778,15 @@ open Nat
 
 variable {X : ℕ → Type u} [∀ n, MetricSpace (X n)] {f : ∀ n, X n → X (n + 1)}
 
+#print Metric.inductiveLimitDist /-
 /-- Predistance on the disjoint union `Σ n, X n`. -/
 def inductiveLimitDist (f : ∀ n, X n → X (n + 1)) (x y : Σn, X n) : ℝ :=
   dist (leRecOn (le_max_left x.1 y.1) f x.2 : X (max x.1 y.1))
     (leRecOn (le_max_right x.1 y.1) f y.2 : X (max x.1 y.1))
 #align metric.inductive_limit_dist Metric.inductiveLimitDist
+-/
 
+#print Metric.inductiveLimitDist_eq_dist /-
 /-- The predistance on the disjoint union `Σ n, X n` can be computed in any `X k` for large
 enough `k`. -/
 theorem inductiveLimitDist_eq_dist (I : ∀ n, Isometry (f n)) (x y : Σn, X n) (m : ℕ) :
@@ -704,7 +813,9 @@ theorem inductiveLimitDist_eq_dist (I : ∀ n, Isometry (f n)) (x y : Σn, X n)
       rw [le_rec_on_succ xm, le_rec_on_succ ym, (I m).dist_eq]
       exact hm xm ym
 #align metric.inductive_limit_dist_eq_dist Metric.inductiveLimitDist_eq_dist
+-/
 
+#print Metric.inductivePremetric /-
 /-- Premetric space structure on `Σ n, X n`.-/
 def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σn, X n)
     where
@@ -733,22 +844,33 @@ def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σn, X n
         rw [inductive_limit_dist_eq_dist I x y m hx hy, inductive_limit_dist_eq_dist I y z m hy hz]
       
 #align metric.inductive_premetric Metric.inductivePremetric
+-/
 
 attribute [local instance] inductive_premetric UniformSpace.separationSetoid
 
+#print Metric.InductiveLimit /-
 /-- The type giving the inductive limit in a metric space context. -/
 def InductiveLimit (I : ∀ n, Isometry (f n)) : Type _ :=
   @UniformSpace.SeparationQuotient _ (inductivePremetric I).toUniformSpace deriving MetricSpace
 #align metric.inductive_limit Metric.InductiveLimit
+-/
 
+#print Metric.toInductiveLimit /-
 /-- Mapping each `X n` to the inductive limit. -/
 def toInductiveLimit (I : ∀ n, Isometry (f n)) (n : ℕ) (x : X n) : Metric.InductiveLimit I :=
   Quotient.mk'' (Sigma.mk n x)
 #align metric.to_inductive_limit Metric.toInductiveLimit
+-/
 
 instance (I : ∀ n, Isometry (f n)) [Inhabited (X 0)] : Inhabited (InductiveLimit I) :=
   ⟨toInductiveLimit _ 0 default⟩
 
+/- warning: metric.to_inductive_limit_isometry -> Metric.toInductiveLimit_isometry is a dubious translation:
+lean 3 declaration is
+  forall {X : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), MetricSpace.{u1} (X n)] {f : forall (n : Nat), (X n) -> (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))} (I : forall (n : Nat), Isometry.{u1, u1} (X n) (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} (X n) (MetricSpace.toPseudoMetricSpace.{u1} (X n) (_inst_1 n))) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (MetricSpace.toPseudoMetricSpace.{u1} (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (_inst_1 (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))))) (f n)) (n : Nat), Isometry.{u1, u1} (X n) (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} (X n) (MetricSpace.toPseudoMetricSpace.{u1} (X n) (_inst_1 n))) (PseudoMetricSpace.toPseudoEMetricSpace.{u1} (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (MetricSpace.toPseudoMetricSpace.{u1} (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (Metric.InductiveLimit.metricSpace.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I))) (Metric.toInductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I n)
+but is expected to have type
+  forall {X : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), MetricSpace.{u1} (X n)] {f : forall (n : Nat), (X n) -> (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))} (I : forall (n : Nat), Isometry.{u1, u1} (X n) (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (EMetricSpace.toPseudoEMetricSpace.{u1} (X n) (MetricSpace.toEMetricSpace.{u1} (X n) (_inst_1 n))) (EMetricSpace.toPseudoEMetricSpace.{u1} (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (MetricSpace.toEMetricSpace.{u1} (X (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (_inst_1 (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (f n)) (n : Nat), Isometry.{u1, u1} (X n) (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (EMetricSpace.toPseudoEMetricSpace.{u1} (X n) (MetricSpace.toEMetricSpace.{u1} (X n) (_inst_1 n))) (EMetricSpace.toPseudoEMetricSpace.{u1} (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (MetricSpace.toEMetricSpace.{u1} (Metric.InductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I) (Metric.instMetricSpaceInductiveLimitNat.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I))) (Metric.toInductiveLimit.{u1} (fun (n : Nat) => X n) (fun (n : Nat) => _inst_1 n) (fun (n : Nat) => f n) I n)
+Case conversion may be inaccurate. Consider using '#align metric.to_inductive_limit_isometry Metric.toInductiveLimit_isometryₓ'. -/
 /-- The map `to_inductive_limit n` mapping `X n` to the inductive limit is an isometry. -/
 theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
     Isometry (toInductiveLimit I n) :=
@@ -759,6 +881,7 @@ theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
       le_rec_on_self]
 #align metric.to_inductive_limit_isometry Metric.toInductiveLimit_isometry
 
+#print Metric.toInductiveLimit_commute /-
 /-- The maps `to_inductive_limit n` are compatible with the maps `f n`. -/
 theorem toInductiveLimit_commute (I : ∀ n, Isometry (f n)) (n : ℕ) :
     toInductiveLimit I n.succ ∘ f n = toInductiveLimit I n :=
@@ -774,6 +897,7 @@ theorem toInductiveLimit_commute (I : ∀ n, Isometry (f n)) (n : ℕ) :
     exact le_rfl
     exact le_succ _
 #align metric.to_inductive_limit_commute Metric.toInductiveLimit_commute
+-/
 
 end InductiveLimit
 
Diff
@@ -426,8 +426,8 @@ protected def dist : (Σi, E i) → (Σi, E i) → ℝ
   | ⟨i, x⟩, ⟨j, y⟩ =>
     if h : i = j then
       haveI : E j = E i := by rw [h]
-      HasDist.dist x (cast this y)
-    else HasDist.dist x (Nonempty.some ⟨x⟩) + 1 + HasDist.dist (Nonempty.some ⟨y⟩) y
+      Dist.dist x (cast this y)
+    else Dist.dist x (Nonempty.some ⟨x⟩) + 1 + Dist.dist (Nonempty.some ⟨y⟩) y
 #align metric.sigma.dist Metric.Sigma.dist
 
 /-- A `has_dist` instance on the disjoint union `Σ i, E i`.
@@ -435,7 +435,7 @@ We embed isometrically each factor, set the basepoints at distance 1, arbitraril
 and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
 their respective basepoints, plus the distance 1 between the basepoints.
 Since there is an arbitrary choice in this construction, it is not an instance by default. -/
-def hasDist : HasDist (Σi, E i) :=
+def hasDist : Dist (Σi, E i) :=
   ⟨Sigma.dist⟩
 #align metric.sigma.has_dist Metric.Sigma.hasDist
 
@@ -443,13 +443,13 @@ attribute [local instance] sigma.has_dist
 
 @[simp]
 theorem dist_same (i : ι) (x : E i) (y : E i) : dist (⟨i, x⟩ : Σj, E j) ⟨i, y⟩ = dist x y := by
-  simp [HasDist.dist, sigma.dist]
+  simp [Dist.dist, sigma.dist]
 #align metric.sigma.dist_same Metric.Sigma.dist_same
 
 @[simp]
 theorem dist_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
     dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ = dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨y⟩) y :=
-  by simp [HasDist.dist, sigma.dist, h]
+  by simp [Dist.dist, sigma.dist, h]
 #align metric.sigma.dist_ne Metric.Sigma.dist_ne
 
 theorem one_le_dist_of_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
Diff
@@ -220,7 +220,7 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         _ ≤ dist x (Φ p) + dist (Ψ p) (Ψ q) + dist z (Φ q) + 2 * ε := by
           rw [dist_comm z] <;> linarith
         _ ≤ dist x (Φ p) + (dist y (Ψ p) + dist y (Ψ q)) + dist z (Φ q) + 2 * ε :=
-          add_le_add (add_le_add (add_le_add le_rfl (dist_triangle_left _ _ _)) le_rfl) le_rfl
+          (add_le_add (add_le_add (add_le_add le_rfl (dist_triangle_left _ _ _)) le_rfl) le_rfl)
         _ ≤ (⨅ p, dist x (Φ p) + dist y (Ψ p)) + ε + ((⨅ p, dist z (Φ p) + dist y (Ψ p)) + ε) + δ :=
           by linarith
         
@@ -240,7 +240,7 @@ private theorem glue_dist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
         _ ≤ dist x (Ψ p) + dist (Φ p) (Φ q) + dist z (Ψ q) + 2 * ε := by
           rw [dist_comm z] <;> linarith
         _ ≤ dist x (Ψ p) + (dist y (Φ p) + dist y (Φ q)) + dist z (Ψ q) + 2 * ε :=
-          add_le_add (add_le_add (add_le_add le_rfl (dist_triangle_left _ _ _)) le_rfl) le_rfl
+          (add_le_add (add_le_add (add_le_add le_rfl (dist_triangle_left _ _ _)) le_rfl) le_rfl)
         _ ≤ (⨅ p, dist y (Φ p) + dist x (Ψ p)) + ε + ((⨅ p, dist y (Φ p) + dist z (Ψ p)) + ε) + δ :=
           by linarith
         
@@ -728,7 +728,7 @@ def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σn, X n
       _ ≤
           dist (le_rec_on hx f x.2 : X m) (le_rec_on hy f y.2 : X m) +
             dist (le_rec_on hy f y.2 : X m) (le_rec_on hz f z.2 : X m) :=
-        dist_triangle _ _ _
+        (dist_triangle _ _ _)
       _ = inductive_limit_dist f x y + inductive_limit_dist f y z := by
         rw [inductive_limit_dist_eq_dist I x y m hx hy, inductive_limit_dist_eq_dist I y z m hy hz]
       
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module topology.metric_space.gluing
-! leanprover-community/mathlib commit 0c1f285a9f6e608ae2bdffa3f993eafb01eba829
+! leanprover-community/mathlib commit e1a7bdeb4fd826b7e71d130d34988f0a2d26a177
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -538,7 +538,7 @@ their respective basepoints, plus the distance 1 between the basepoints.
 Since there is an arbitrary choice in this construction, it is not an instance by default. -/
 protected def metricSpace : MetricSpace (Σi, E i) :=
   by
-  refine' MetricSpace.ofMetrizable sigma.dist _ _ sigma.dist_triangle sigma.is_open_iff _
+  refine' MetricSpace.ofDistTopology sigma.dist _ _ sigma.dist_triangle sigma.is_open_iff _
   · rintro ⟨i, x⟩
     simp [sigma.dist]
   · rintro ⟨i, x⟩ ⟨j, y⟩
Diff
@@ -643,7 +643,7 @@ theorem to_glue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
   letI := i.to_uniform_space
   funext
   simp only [comp, to_glue_l, to_glue_r]
-  refine' UniformSpace.SeparationQuotient.mk'_eq_mk'.2 (Metric.inseparable_iff.2 _)
+  refine' UniformSpace.SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
   exact glue_dist_glued_points Φ Ψ 0 x
 #align metric.to_glue_commute Metric.to_glue_commute
 
@@ -766,7 +766,7 @@ theorem toInductiveLimit_commute (I : ∀ n, Isometry (f n)) (n : ℕ) :
   letI := inductive_premetric I
   funext
   simp only [comp, to_inductive_limit]
-  refine' UniformSpace.SeparationQuotient.mk'_eq_mk'.2 (Metric.inseparable_iff.2 _)
+  refine' UniformSpace.SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
   show inductive_limit_dist f ⟨n.succ, f n x⟩ ⟨n, x⟩ = 0
   · rw [inductive_limit_dist_eq_dist I ⟨n.succ, f n x⟩ ⟨n, x⟩ n.succ, le_rec_on_self,
       le_rec_on_succ, le_rec_on_self, dist_self]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module topology.metric_space.gluing
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit 0c1f285a9f6e608ae2bdffa3f993eafb01eba829
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -598,7 +598,7 @@ variable [Nonempty Z] [MetricSpace Z] [MetricSpace X] [MetricSpace Y] {Φ : Z 
 
 open _Root_.Sum (inl inr)
 
-attribute [local instance] PseudoMetric.distSetoid
+attribute [local instance] UniformSpace.separationSetoid
 
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a pseudo metric space
 structure on `X ⊕ Y` by declaring that `Φ x` and `Ψ x` are at distance `0`. -/
@@ -613,23 +613,17 @@ def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (S
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a
 space  `glue_space hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
 def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ :=
-  @PseudoMetricQuot _ (gluePremetric hΦ hΨ)
+  @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace deriving MetricSpace
 #align metric.glue_space Metric.GlueSpace
 
-instance metricSpaceGlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : MetricSpace (GlueSpace hΦ hΨ) :=
-  @metricSpaceQuot _ (gluePremetric hΦ hΨ)
-#align metric.metric_space_glue_space Metric.metricSpaceGlueSpace
-
 /-- The canonical map from `X` to the space obtained by gluing isometric subsets in `X` and `Y`. -/
 def toGlueL (hΦ : Isometry Φ) (hΨ : Isometry Ψ) (x : X) : GlueSpace hΦ hΨ :=
-  letI : PseudoMetricSpace (Sum X Y) := glue_premetric hΦ hΨ
-  ⟦inl x⟧
+  Quotient.mk'' (inl x)
 #align metric.to_glue_l Metric.toGlueL
 
 /-- The canonical map from `Y` to the space obtained by gluing isometric subsets in `X` and `Y`. -/
 def toGlueR (hΦ : Isometry Φ) (hΨ : Isometry Ψ) (y : Y) : GlueSpace hΦ hΨ :=
-  letI : PseudoMetricSpace (Sum X Y) := glue_premetric hΦ hΨ
-  ⟦inr y⟧
+  Quotient.mk'' (inr y)
 #align metric.to_glue_r Metric.toGlueR
 
 instance inhabitedLeft (hΦ : Isometry Φ) (hΨ : Isometry Ψ) [Inhabited X] :
@@ -645,9 +639,11 @@ instance inhabitedRight (hΦ : Isometry Φ) (hΨ : Isometry Ψ) [Inhabited Y] :
 theorem to_glue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
     toGlueL hΦ hΨ ∘ Φ = toGlueR hΦ hΨ ∘ Ψ :=
   by
-  letI : PseudoMetricSpace (Sum X Y) := glue_premetric hΦ hΨ
+  letI i : PseudoMetricSpace (Sum X Y) := glue_premetric hΦ hΨ
+  letI := i.to_uniform_space
   funext
-  simp only [comp, to_glue_l, to_glue_r, Quotient.eq']
+  simp only [comp, to_glue_l, to_glue_r]
+  refine' UniformSpace.SeparationQuotient.mk'_eq_mk'.2 (Metric.inseparable_iff.2 _)
   exact glue_dist_glued_points Φ Ψ 0 x
 #align metric.to_glue_commute Metric.to_glue_commute
 
@@ -738,22 +734,16 @@ def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σn, X n
       
 #align metric.inductive_premetric Metric.inductivePremetric
 
-attribute [local instance] inductive_premetric PseudoMetric.distSetoid
+attribute [local instance] inductive_premetric UniformSpace.separationSetoid
 
 /-- The type giving the inductive limit in a metric space context. -/
 def InductiveLimit (I : ∀ n, Isometry (f n)) : Type _ :=
-  @PseudoMetricQuot _ (inductivePremetric I)
+  @UniformSpace.SeparationQuotient _ (inductivePremetric I).toUniformSpace deriving MetricSpace
 #align metric.inductive_limit Metric.InductiveLimit
 
-/-- Metric space structure on the inductive limit. -/
-instance metricSpaceInductiveLimit (I : ∀ n, Isometry (f n)) : MetricSpace (InductiveLimit I) :=
-  @metricSpaceQuot _ (inductivePremetric I)
-#align metric.metric_space_inductive_limit Metric.metricSpaceInductiveLimit
-
 /-- Mapping each `X n` to the inductive limit. -/
 def toInductiveLimit (I : ∀ n, Isometry (f n)) (n : ℕ) (x : X n) : Metric.InductiveLimit I :=
-  letI : PseudoMetricSpace (Σn, X n) := inductive_premetric I
-  ⟦Sigma.mk n x⟧
+  Quotient.mk'' (Sigma.mk n x)
 #align metric.to_inductive_limit Metric.toInductiveLimit
 
 instance (I : ∀ n, Isometry (f n)) [Inhabited (X 0)] : Inhabited (InductiveLimit I) :=
@@ -773,8 +763,10 @@ theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
 theorem toInductiveLimit_commute (I : ∀ n, Isometry (f n)) (n : ℕ) :
     toInductiveLimit I n.succ ∘ f n = toInductiveLimit I n :=
   by
+  letI := inductive_premetric I
   funext
-  simp only [comp, to_inductive_limit, Quotient.eq']
+  simp only [comp, to_inductive_limit]
+  refine' UniformSpace.SeparationQuotient.mk'_eq_mk'.2 (Metric.inseparable_iff.2 _)
   show inductive_limit_dist f ⟨n.succ, f n x⟩ ⟨n, x⟩ = 0
   · rw [inductive_limit_dist_eq_dist I ⟨n.succ, f n x⟩ ⟨n, x⟩ n.succ, le_rec_on_self,
       le_rec_on_succ, le_rec_on_self, dist_self]

Changes in mathlib4

mathlib3
mathlib4
style: replace '.-/' by '. -/' (#11938)

Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.

Diff
@@ -588,7 +588,7 @@ theorem inductiveLimitDist_eq_dist (I : ∀ n, Isometry (f n)) (x y : Σn, X n)
       exact inductiveLimitDist_eq_dist I x y m xm ym
 #align metric.inductive_limit_dist_eq_dist Metric.inductiveLimitDist_eq_dist
 
-/-- Premetric space structure on `Σ n, X n`.-/
+/-- Premetric space structure on `Σ n, X n`. -/
 def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σn, X n) where
   dist := inductiveLimitDist f
   dist_self x := by simp [dist, inductiveLimitDist]
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11813)
Diff
@@ -385,7 +385,7 @@ protected theorem dist_triangle (x y z : Σi, E i) : dist x z ≤ dist x y + dis
               dist x (Nonempty.some ⟨x⟩) + 1 + (dist (Nonempty.some ⟨z⟩) y + dist y z) := by
             apply_rules [add_le_add, le_rfl, dist_triangle]
           _ = _ := by abel
-      · simp only [hik, hij, hjk, Sigma.dist_ne, Ne.def, not_false_iff]
+      · simp only [hik, hij, hjk, Sigma.dist_ne, Ne, not_false_iff]
         calc
           dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨z⟩) z =
               dist x (Nonempty.some ⟨x⟩) + 1 + 0 + (0 + 0 + dist (Nonempty.some ⟨z⟩) z) := by
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
@@ -59,7 +59,6 @@ namespace Metric
 section ApproxGluing
 
 variable {X : Type u} {Y : Type v} {Z : Type w}
-
 variable [MetricSpace X] [MetricSpace Y] {Φ : Z → X} {Ψ : Z → Y} {ε : ℝ}
 
 /-- Define a predistance on `X ⊕ Y`, for which `Φ p` and `Ψ p` are at distance `ε` -/
@@ -200,7 +199,6 @@ the distance, without `iInf`, as it is easier to use in applications, and show t
 the gluing distance defined above to take advantage of the lemmas we have already proved.
 -/
 variable {X : Type u} {Y : Type v} {Z : Type w}
-
 variable [MetricSpace X] [MetricSpace Y]
 
 /-- Distance on a disjoint union. There are many (noncanonical) ways to put a distance compatible
@@ -474,7 +472,6 @@ section Gluing
 
 -- Exact gluing of two metric spaces along isometric subsets.
 variable {X : Type u} {Y : Type v} {Z : Type w}
-
 variable [Nonempty Z] [MetricSpace Z] [MetricSpace X] [MetricSpace Y] {Φ : Z → X} {Ψ : Z → Y}
   {ε : ℝ}
 
refactor(UniformSpace): drop separationRel (#10644)

We had duplicated API between topological spaces and uniform spaces. In this PR I mostly deduplicate it with some exceptions:

  • SeparationQuotient.lift' and SeparationQuotient.map are leftovers from the old version that are designed to work with uniform spaces;
  • probably, some theorems/instances still assume UniformSpace when TopologicalSpace would work.

Outside of UniformSpace/Separation, I mostly changed SeparatedSpace to T0Space and separationRel to Inseparable. I also rewrote a few proofs that were broken by the API change.

Fixes #2031

Diff
@@ -478,8 +478,6 @@ variable {X : Type u} {Y : Type v} {Z : Type w}
 variable [Nonempty Z] [MetricSpace Z] [MetricSpace X] [MetricSpace Y] {Φ : Z → X} {Ψ : Z → Y}
   {ε : ℝ}
 
-attribute [local instance] UniformSpace.separationSetoid
-
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a pseudo metric space
 structure on `X ⊕ Y` by declaring that `Φ x` and `Ψ x` are at distance `0`. -/
 def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (X ⊕ Y) where
@@ -493,12 +491,12 @@ def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (X
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a
 space `GlueSpace hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
 def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ :=
-  @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
+  @SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace.toTopologicalSpace
 #align metric.glue_space Metric.GlueSpace
 
 instance (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : MetricSpace (GlueSpace hΦ hΨ) :=
   inferInstanceAs <| MetricSpace <|
-    @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
+    @SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace.toTopologicalSpace
 
 /-- The canonical map from `X` to the space obtained by gluing isometric subsets in `X` and `Y`. -/
 def toGlueL (hΦ : Isometry Φ) (hΨ : Isometry Ψ) (x : X) : GlueSpace hΦ hΨ :=
@@ -523,10 +521,10 @@ instance inhabitedRight (hΦ : Isometry Φ) (hΨ : Isometry Ψ) [Inhabited Y] :
 theorem toGlue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
     toGlueL hΦ hΨ ∘ Φ = toGlueR hΦ hΨ ∘ Ψ := by
   let i : PseudoMetricSpace (X ⊕ Y) := gluePremetric hΦ hΨ
-  let _ := i.toUniformSpace
+  let _ := i.toUniformSpace.toTopologicalSpace
   funext
   simp only [comp, toGlueL, toGlueR]
-  refine' UniformSpace.SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
+  refine' SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
   exact glueDist_glued_points Φ Ψ 0 _
 #align metric.to_glue_commute Metric.toGlue_commute
 
@@ -624,13 +622,13 @@ attribute [local instance] inductivePremetric
 
 /-- The type giving the inductive limit in a metric space context. -/
 def InductiveLimit (I : ∀ n, Isometry (f n)) : Type _ :=
-  @UniformSpace.SeparationQuotient _ (inductivePremetric I).toUniformSpace
+  @SeparationQuotient _ (inductivePremetric I).toUniformSpace.toTopologicalSpace
 #align metric.inductive_limit Metric.InductiveLimit
 
 set_option autoImplicit true in
 instance : MetricSpace (InductiveLimit (f := f) I) :=
   inferInstanceAs <| MetricSpace <|
-    @UniformSpace.SeparationQuotient _ (inductivePremetric I).toUniformSpace
+    @SeparationQuotient _ (inductivePremetric I).toUniformSpace.toTopologicalSpace
 
 /-- Mapping each `X n` to the inductive limit. -/
 def toInductiveLimit (I : ∀ n, Isometry (f n)) (n : ℕ) (x : X n) : Metric.InductiveLimit I :=
@@ -652,10 +650,11 @@ theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
 /-- The maps `toInductiveLimit n` are compatible with the maps `f n`. -/
 theorem toInductiveLimit_commute (I : ∀ n, Isometry (f n)) (n : ℕ) :
     toInductiveLimit I n.succ ∘ f n = toInductiveLimit I n := by
-  let _ := inductivePremetric I
+  let h := inductivePremetric I
+  let _ := h.toUniformSpace.toTopologicalSpace
   funext x
   simp only [comp, toInductiveLimit]
-  refine' UniformSpace.SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
+  refine' SeparationQuotient.mk_eq_mk.2 (Metric.inseparable_iff.2 _)
   show inductiveLimitDist f ⟨n.succ, f n x⟩ ⟨n, x⟩ = 0
   rw [inductiveLimitDist_eq_dist I ⟨n.succ, f n x⟩ ⟨n, x⟩ n.succ, leRecOn_self,
     leRecOn_succ, leRecOn_self, dist_self]
chore: Remove ball and bex from lemma names (#10816)

ball for "bounded forall" and bex for "bounded exists" are from experience very confusing abbreviations. This PR renames them to forall_mem and exists_mem in the few Set lemma names that mention them.

Also deprecate ball_image_of_ball, mem_image_elim, mem_image_elim_on since those lemmas are duplicates of the renamed lemmas (apart from argument order and implicitness, which I am also fixing by making the binder in the RHS of forall_mem_image semi-implicit), have obscure names and are completely unused.

Diff
@@ -82,7 +82,7 @@ theorem glueDist_glued_points [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : 
     refine' le_antisymm _ (le_ciInf A)
     have : 0 = dist (Φ p) (Φ p) + dist (Ψ p) (Ψ p) := by simp
     rw [this]
-    exact ciInf_le ⟨0, forall_range_iff.2 A⟩ p
+    exact ciInf_le ⟨0, forall_mem_range.2 A⟩ p
   simp only [glueDist, this, zero_add]
 #align metric.glue_dist_glued_points Metric.glueDist_glued_points
 
@@ -116,7 +116,7 @@ private theorem glueDist_triangle_inl_inr_inr (Φ : Z → X) (Ψ : Z → Y) (ε
   simp only [glueDist]
   rw [add_right_comm, add_le_add_iff_right]
   refine le_ciInf_add fun p => ciInf_le_of_le ⟨0, ?_⟩ p ?_
-  · exact forall_range_iff.2 fun _ => add_nonneg dist_nonneg dist_nonneg
+  · exact forall_mem_range.2 fun _ => add_nonneg dist_nonneg dist_nonneg
   · linarith [dist_triangle_left z (Ψ p) y]
 
 private theorem glueDist_triangle_inl_inr_inl (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -311,7 +311,7 @@ namespace Sigma
 of two spaces. I.e., work with sigma types instead of sum types. -/
 variable {ι : Type*} {E : ι → Type*} [∀ i, MetricSpace (E i)]
 
-open Classical
+open scoped Classical
 
 /-- Distance on a disjoint union. There are many (noncanonical) ways to put a distance compatible
 with each factor.
chore: move Mathlib to v4.7.0-rc1 (#11162)

This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>

Diff
@@ -265,12 +265,15 @@ def metricSpaceSum : MetricSpace (X ⊕ Y) where
   dist_triangle
     | .inl p, .inl q, .inl r => dist_triangle p q r
     | .inl p, .inr q, _ => by
+      set_option tactic.skipAssignedInstances false in
       simp only [Sum.dist_eq_glueDist p q]
       exact glueDist_triangle _ _ _ (by norm_num) _ _ _
     | _, .inl q, .inr r => by
+      set_option tactic.skipAssignedInstances false in
       simp only [Sum.dist_eq_glueDist q r]
       exact glueDist_triangle _ _ _ (by norm_num) _ _ _
     | .inr p, _, .inl r => by
+      set_option tactic.skipAssignedInstances false in
       simp only [Sum.dist_eq_glueDist r p]
       exact glueDist_triangle _ _ _ (by norm_num) _ _ _
     | .inr p, .inr q, .inr r => dist_triangle p q r
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
@@ -456,13 +456,13 @@ protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σ
   set s : ι → Set (Σi, E i) := fun i => Sigma.fst ⁻¹' {i}
   set U := { p : (Σk, E k) × Σk, E k | dist p.1 p.2 < 1 }
   have hc : ∀ i, IsComplete (s i) := fun i => by
-    simp only [← range_sigmaMk]
+    simp only [s, ← range_sigmaMk]
     exact (isometry_mk i).uniformInducing.isComplete_range
   have hd : ∀ (i j), ∀ x ∈ s i, ∀ y ∈ s j, (x, y) ∈ U → i = j := fun i j x hx y hy hxy =>
     (Eq.symm hx).trans ((fst_eq_of_dist_lt_one _ _ hxy).trans hy)
   refine' completeSpace_of_isComplete_univ _
   convert isComplete_iUnion_separated hc (dist_mem_uniformity zero_lt_one) hd
-  simp only [← preimage_iUnion, iUnion_of_singleton, preimage_univ]
+  simp only [s, ← preimage_iUnion, iUnion_of_singleton, preimage_univ]
 #align metric.sigma.complete_space Metric.Sigma.completeSpace
 
 end Sigma
chore(UniformSpace): golf (#10627)

Golf the instance for UniformSpace (α ⊕ β) using the ofNhdsEqComap constructor.

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

Diff
@@ -183,7 +183,7 @@ def glueMetricApprox (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (ε0 : 0 < ε)
   dist_triangle := glueDist_triangle Φ Ψ ε H
   edist_dist _ _ := by exact ENNReal.coe_nnreal_eq _
   eq_of_dist_eq_zero := eq_of_glueDist_eq_zero Φ Ψ ε ε0 _ _
-  toUniformSpace := Sum.uniformSpace
+  toUniformSpace := Sum.instUniformSpace
   uniformity_dist := uniformity_dist_of_mem_uniformity _ _ <| Sum.mem_uniformity_iff_glueDist ε0
 #align metric.glue_metric_approx Metric.glueMetricApprox
 
@@ -281,7 +281,7 @@ def metricSpaceSum : MetricSpace (X ⊕ Y) where
     · exact eq_of_glueDist_eq_zero _ _ _ one_pos _ _ ((Sum.dist_eq_glueDist q p).symm.trans h)
     · rw [eq_of_dist_eq_zero h]
   edist_dist _ _ := by exact ENNReal.coe_nnreal_eq _
-  toUniformSpace := Sum.uniformSpace
+  toUniformSpace := Sum.instUniformSpace
   uniformity_dist := uniformity_dist_of_mem_uniformity _ _ Sum.mem_uniformity
 #align metric.metric_space_sum Metric.metricSpaceSum
 
chore(MetricSpace.Gluing): address porting note (#10509)

The current porting note says TODO: w/o `@`, tries to generate some `[MetricSpace _]` before finding `X` `Y` but removing the @ seems to generate identical terms with pp.all true.

Co-authored-by: Matthew Robert Ballard <100034030+mattrobball@users.noreply.github.com>

Diff
@@ -493,8 +493,7 @@ def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ :=
   @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
 #align metric.glue_space Metric.GlueSpace
 
--- porting note: TODO: w/o `@`, tries to generate some `[MetricSpace _]` before finding `X` `Y`
-instance (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : MetricSpace (@GlueSpace X Y Z _ _ _ _ _ _ hΦ hΨ) :=
+instance (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : MetricSpace (GlueSpace hΦ hΨ) :=
   inferInstanceAs <| MetricSpace <|
     @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
 
chore(Topology): remove autoImplicit in some files (#9689)

... where this is easy to do.

Co-authored-by: grunweg <grunweg@posteo.de>

Diff
@@ -48,9 +48,6 @@ isometrically and in a way compatible with `f n`.
 
 -/
 
-set_option autoImplicit true
-
-
 noncomputable section
 
 universe u v w
@@ -628,6 +625,7 @@ def InductiveLimit (I : ∀ n, Isometry (f n)) : Type _ :=
   @UniformSpace.SeparationQuotient _ (inductivePremetric I).toUniformSpace
 #align metric.inductive_limit Metric.InductiveLimit
 
+set_option autoImplicit true in
 instance : MetricSpace (InductiveLimit (f := f) I) :=
   inferInstanceAs <| MetricSpace <|
     @UniformSpace.SeparationQuotient _ (inductivePremetric I).toUniformSpace
refactor: Split off basic Nat file (#9551)

Data.Nat.Basic is currently made of two things:

  • Basic lemmas that continue the theory in Std (and could belong there, really)
  • Basic algebraic order instances

I need the first ones earlier in the algebraic order hierarchy, hence the split.

Part of #9411. Similar to #9443

Diff
@@ -659,7 +659,7 @@ theorem toInductiveLimit_commute (I : ∀ n, Isometry (f n)) (n : ℕ) :
   show inductiveLimitDist f ⟨n.succ, f n x⟩ ⟨n, x⟩ = 0
   rw [inductiveLimitDist_eq_dist I ⟨n.succ, f n x⟩ ⟨n, x⟩ n.succ, leRecOn_self,
     leRecOn_succ, leRecOn_self, dist_self]
-  exacts [le_rfl, le_succ _, le_rfl]
+  exact le_succ _
 #align metric.to_inductive_limit_commute Metric.toInductiveLimit_commute
 
 end InductiveLimit
style: cleanup by putting by on the same line as := (#8407)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -377,21 +377,21 @@ protected theorem dist_triangle (x y z : Σi, E i) : dist x z ≤ dist x y + dis
     · simp only [Sigma.dist_ne hik, Sigma.dist_same]
       calc
         dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨z⟩) z ≤
-            dist x y + dist y (Nonempty.some ⟨y⟩) + 1 + dist (Nonempty.some ⟨z⟩) z :=
-          by apply_rules [add_le_add, le_rfl, dist_triangle]
+            dist x y + dist y (Nonempty.some ⟨y⟩) + 1 + dist (Nonempty.some ⟨z⟩) z := by
+          apply_rules [add_le_add, le_rfl, dist_triangle]
         _ = _ := by abel
     · rcases eq_or_ne j k with (rfl | hjk)
       · simp only [Sigma.dist_ne hij, Sigma.dist_same]
         calc
           dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨z⟩) z ≤
-              dist x (Nonempty.some ⟨x⟩) + 1 + (dist (Nonempty.some ⟨z⟩) y + dist y z) :=
-            by apply_rules [add_le_add, le_rfl, dist_triangle]
+              dist x (Nonempty.some ⟨x⟩) + 1 + (dist (Nonempty.some ⟨z⟩) y + dist y z) := by
+            apply_rules [add_le_add, le_rfl, dist_triangle]
           _ = _ := by abel
       · simp only [hik, hij, hjk, Sigma.dist_ne, Ne.def, not_false_iff]
         calc
           dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨z⟩) z =
-              dist x (Nonempty.some ⟨x⟩) + 1 + 0 + (0 + 0 + dist (Nonempty.some ⟨z⟩) z) :=
-            by simp only [add_zero, zero_add]
+              dist x (Nonempty.some ⟨x⟩) + 1 + 0 + (0 + 0 + dist (Nonempty.some ⟨z⟩) z) := by
+            simp only [add_zero, zero_add]
           _ ≤ _ := by apply_rules [add_le_add, zero_le_one, dist_nonneg, le_rfl]
 #align metric.sigma.dist_triangle Metric.Sigma.dist_triangle
 
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -48,6 +48,8 @@ isometrically and in a way compatible with `f n`.
 
 -/
 
+set_option autoImplicit true
+
 
 noncomputable section
 
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
@@ -307,7 +307,7 @@ namespace Sigma
 
 /- Copy of the previous paragraph, but for arbitrary disjoint unions instead of the disjoint union
 of two spaces. I.e., work with sigma types instead of sum types. -/
-variable {ι : Type _} {E : ι → Type _} [∀ i, MetricSpace (E i)]
+variable {ι : Type*} {E : ι → Type*} [∀ i, MetricSpace (E i)]
 
 open Classical
 
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) 2019 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
-
-! This file was ported from Lean 3 source module topology.metric_space.gluing
-! leanprover-community/mathlib commit e1a7bdeb4fd826b7e71d130d34988f0a2d26a177
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Topology.MetricSpace.Isometry
 
+#align_import topology.metric_space.gluing from "leanprover-community/mathlib"@"e1a7bdeb4fd826b7e71d130d34988f0a2d26a177"
+
 /-!
 # Metric space gluing
 
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

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

Diff
@@ -492,7 +492,7 @@ def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (X
 #align metric.glue_premetric Metric.gluePremetric
 
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a
-space  `GlueSpace hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
+space `GlueSpace hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
 def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ :=
   @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
 #align metric.glue_space Metric.GlueSpace
feat: port Topology.MetricSpace.GromovHausdorff (#4635)

Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Antoine Chambert-Loir <antoine.chambert-loir@math.univ-paris-diderot.fr> Co-authored-by: Alex J Best <alex.j.best@gmail.com> Co-authored-by: Antoine Chambert-Loir <antoine.chambert-loir@u-paris.fr>

Diff
@@ -161,6 +161,20 @@ private theorem eq_of_glueDist_eq_zero (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
   | .inr x, .inl y, h => by exfalso; linarith [le_glueDist_inr_inl Φ Ψ ε x y]
   | .inr x, .inr y, h => by rw [eq_of_dist_eq_zero h]
 
+theorem Sum.mem_uniformity_iff_glueDist (hε : 0 < ε) (s : Set ((X ⊕ Y) × (X ⊕ Y))) :
+    s ∈ 𝓤 (X ⊕ Y) ↔ ∃ δ > 0, ∀ a b, glueDist Φ Ψ ε a b < δ → (a, b) ∈ s := by
+  simp only [Sum.uniformity, Filter.mem_sup, Filter.mem_map, mem_uniformity_dist, mem_preimage]
+  constructor
+  · rintro ⟨⟨δX, δX0, hX⟩, δY, δY0, hY⟩
+    refine ⟨min (min δX δY) ε, lt_min (lt_min δX0 δY0) hε, ?_⟩
+    rintro (a | a) (b | b) h <;> simp only [lt_min_iff] at h
+    · exact hX h.1.1
+    · exact absurd h.2 (le_glueDist_inl_inr _ _ _ _ _).not_lt
+    · exact absurd h.2 (le_glueDist_inr_inl _ _ _ _ _).not_lt
+    · exact hY h.1.2
+  · rintro ⟨ε, ε0, H⟩
+    constructor <;> exact ⟨ε, ε0, fun h => H _ _ h⟩
+
 /-- Given two maps `Φ` and `Ψ` intro metric spaces `X` and `Y` such that the distances between
 `Φ p` and `Φ q`, and between `Ψ p` and `Ψ q`, coincide up to `2 ε` where `ε > 0`, one can almost
 glue the two spaces `X` and `Y` along the images of `Φ` and `Ψ`, so that `Φ p` and `Ψ p` are
@@ -173,6 +187,8 @@ def glueMetricApprox (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (ε0 : 0 < ε)
   dist_triangle := glueDist_triangle Φ Ψ ε H
   edist_dist _ _ := by exact ENNReal.coe_nnreal_eq _
   eq_of_dist_eq_zero := eq_of_glueDist_eq_zero Φ Ψ ε ε0 _ _
+  toUniformSpace := Sum.uniformSpace
+  uniformity_dist := uniformity_dist_of_mem_uniformity _ _ <| Sum.mem_uniformity_iff_glueDist ε0
 #align metric.glue_metric_approx Metric.glueMetricApprox
 
 end ApproxGluing
fix: precedences of ⨆⋃⋂⨅ (#5614)
Diff
@@ -80,7 +80,7 @@ private theorem glueDist_self (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : ∀ x,
 
 theorem glueDist_glued_points [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (p : Z) :
     glueDist Φ Ψ ε (.inl (Φ p)) (.inr (Ψ p)) = ε := by
-  have : (⨅ q, dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q)) = 0 := by
+  have : ⨅ q, dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q) = 0 := by
     have A : ∀ q, 0 ≤ dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q) := fun _ =>
       add_nonneg dist_nonneg dist_nonneg
     refine' le_antisymm _ (le_ciInf A)
chore: disable relaxedAutoImplicit (#5277)

We disable the "relaxed" auto-implicit feature, so only single character identifiers become eligible as auto-implicits. See discussion on zulip and 2.

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

Diff
@@ -482,7 +482,7 @@ def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ :=
 #align metric.glue_space Metric.GlueSpace
 
 -- porting note: TODO: w/o `@`, tries to generate some `[MetricSpace _]` before finding `X` `Y`
-instance : MetricSpace (@GlueSpace X Y Z _ _ _ _ _ _ hΦ hΨ) :=
+instance (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : MetricSpace (@GlueSpace X Y Z _ _ _ _ _ _ hΦ hΨ) :=
   inferInstanceAs <| MetricSpace <|
     @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
 
chore: Rename to sSup/iSup (#3938)

As discussed on Zulip

Renames

  • supₛsSup
  • infₛsInf
  • supᵢiSup
  • infᵢiInf
  • bsupₛbsSup
  • binfₛbsInf
  • bsupᵢbiSup
  • binfᵢbiInf
  • csupₛcsSup
  • cinfₛcsInf
  • csupᵢciSup
  • cinfᵢciInf
  • unionₛsUnion
  • interₛsInter
  • unionᵢiUnion
  • interᵢiInter
  • bunionₛbsUnion
  • binterₛbsInter
  • bunionᵢbiUnion
  • binterᵢbiInter

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -83,10 +83,10 @@ theorem glueDist_glued_points [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : 
   have : (⨅ q, dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q)) = 0 := by
     have A : ∀ q, 0 ≤ dist (Φ p) (Φ q) + dist (Ψ p) (Ψ q) := fun _ =>
       add_nonneg dist_nonneg dist_nonneg
-    refine' le_antisymm _ (le_cinfᵢ A)
+    refine' le_antisymm _ (le_ciInf A)
     have : 0 = dist (Φ p) (Φ p) + dist (Ψ p) (Ψ p) := by simp
     rw [this]
-    exact cinfᵢ_le ⟨0, forall_range_iff.2 A⟩ p
+    exact ciInf_le ⟨0, forall_range_iff.2 A⟩ p
   simp only [glueDist, this, zero_add]
 #align metric.glue_dist_glued_points Metric.glueDist_glued_points
 
@@ -106,7 +106,7 @@ theorem glueDist_swap (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) :
 
 theorem le_glueDist_inl_inr (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (x y) :
     ε ≤ glueDist Φ Ψ ε (.inl x) (.inr y) :=
-  le_add_of_nonneg_left <| Real.infᵢ_nonneg fun _ => add_nonneg dist_nonneg dist_nonneg
+  le_add_of_nonneg_left <| Real.iInf_nonneg fun _ => add_nonneg dist_nonneg dist_nonneg
 
 theorem le_glueDist_inr_inl (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (x y) :
     ε ≤ glueDist Φ Ψ ε (.inr x) (.inl y) := by
@@ -119,7 +119,7 @@ private theorem glueDist_triangle_inl_inr_inr (Φ : Z → X) (Ψ : Z → Y) (ε
       glueDist Φ Ψ ε (.inl x) (.inr y) + glueDist Φ Ψ ε (.inr y) (.inr z) := by
   simp only [glueDist]
   rw [add_right_comm, add_le_add_iff_right]
-  refine le_cinfᵢ_add fun p => cinfᵢ_le_of_le ⟨0, ?_⟩ p ?_
+  refine le_ciInf_add fun p => ciInf_le_of_le ⟨0, ?_⟩ p ?_
   · exact forall_range_iff.2 fun _ => add_nonneg dist_nonneg dist_nonneg
   · linarith [dist_triangle_left z (Ψ p) y]
 
@@ -128,9 +128,9 @@ private theorem glueDist_triangle_inl_inr_inl (Φ : Z → X) (Ψ : Z → Y) (ε
     glueDist Φ Ψ ε (.inl x) (.inl z) ≤
       glueDist Φ Ψ ε (.inl x) (.inr y) + glueDist Φ Ψ ε (.inr y) (.inl z) := by
   simp_rw [glueDist, add_add_add_comm _ ε, add_assoc]
-  refine le_cinfᵢ_add fun p => ?_
+  refine le_ciInf_add fun p => ?_
   rw [add_left_comm, add_assoc, ← two_mul]
-  refine le_cinfᵢ_add fun q => ?_
+  refine le_ciInf_add fun q => ?_
   rw [dist_comm z]
   linarith [dist_triangle4 x (Φ p) (Φ q) z, dist_triangle_left (Ψ p) (Ψ q) y, (abs_le.1 (H p q)).2]
 
@@ -184,7 +184,7 @@ section Sum
 
 A particular case of the previous construction is when one uses basepoints in `X` and `Y` and one
 glues only along the basepoints, putting them at distance 1. We give a direct definition of
-the distance, without `infᵢ`, as it is easier to use in applications, and show that it is equal to
+the distance, without `iInf`, as it is easier to use in applications, and show that it is equal to
 the gluing distance defined above to take advantage of the lemmas we have already proved.
 -/
 variable {X : Type u} {Y : Type v} {Z : Type w}
@@ -449,8 +449,8 @@ protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σ
   have hd : ∀ (i j), ∀ x ∈ s i, ∀ y ∈ s j, (x, y) ∈ U → i = j := fun i j x hx y hy hxy =>
     (Eq.symm hx).trans ((fst_eq_of_dist_lt_one _ _ hxy).trans hy)
   refine' completeSpace_of_isComplete_univ _
-  convert isComplete_unionᵢ_separated hc (dist_mem_uniformity zero_lt_one) hd
-  simp only [← preimage_unionᵢ, unionᵢ_of_singleton, preimage_univ]
+  convert isComplete_iUnion_separated hc (dist_mem_uniformity zero_lt_one) hd
+  simp only [← preimage_iUnion, iUnion_of_singleton, preimage_univ]
 #align metric.sigma.complete_space Metric.Sigma.completeSpace
 
 end Sigma
chore: tidy various files (#3408)
Diff
@@ -24,8 +24,8 @@ Gluing two metric spaces along a common subset. Formally, we are given
   Y
 ```
 where `hΦ : Isometry Φ` and `hΨ : Isometry Ψ`.
-We want to complete the square by a space `glue_space hΦ hΨ` and two isometries
-`to_glue_l hΦ hΨ` and `to_glue_r hΦ hΨ` that make the square commute.
+We want to complete the square by a space `GlueSpacescan hΦ hΨ` and two isometries
+`toGlueL hΦ hΨ` and `toGlueR hΦ hΨ` that make the square commute.
 We start by defining a predistance on the disjoint union `X ⊕ Y`, for which
 points `Φ p` and `Ψ p` are at distance 0. The (quotient) metric space associated
 to this predistance is the desired space.
@@ -476,7 +476,7 @@ def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (X
 #align metric.glue_premetric Metric.gluePremetric
 
 /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a
-space  `glue_space hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
+space  `GlueSpace hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
 def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ :=
   @UniformSpace.SeparationQuotient _ (gluePremetric hΦ hΨ).toUniformSpace
 #align metric.glue_space Metric.GlueSpace
@@ -625,7 +625,7 @@ def toInductiveLimit (I : ∀ n, Isometry (f n)) (n : ℕ) (x : X n) : Metric.In
 instance (I : ∀ n, Isometry (f n)) [Inhabited (X 0)] : Inhabited (InductiveLimit I) :=
   ⟨toInductiveLimit _ 0 default⟩
 
-/-- The map `to_inductive_limit n` mapping `X n` to the inductive limit is an isometry. -/
+/-- The map `toInductiveLimit n` mapping `X n` to the inductive limit is an isometry. -/
 theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
     Isometry (toInductiveLimit I n) :=
   Isometry.of_dist_eq fun x y => by
@@ -634,7 +634,7 @@ theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
       leRecOn_self]
 #align metric.to_inductive_limit_isometry Metric.toInductiveLimit_isometry
 
-/-- The maps `to_inductive_limit n` are compatible with the maps `f n`. -/
+/-- The maps `toInductiveLimit n` are compatible with the maps `f n`. -/
 theorem toInductiveLimit_commute (I : ∀ n, Isometry (f n)) (n : ℕ) :
     toInductiveLimit I n.succ ∘ f n = toInductiveLimit I n := by
   let _ := inductivePremetric I
feat: port Topology.MetricSpace.Gluing (#2711)

Dependencies 10 + 492

493 files ported (98.0%)
217125 lines ported (97.6%)
Show graph

The unported dependencies are

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