topology.metric_space.pi_natMathlib.Topology.MetricSpace.PiNat

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)

(last sync)

feat(topology/perfect): Schemes, embedding of the Cantor space (#18248)

Add to topology.perfect the following theorem: In a complete metric space, any nonempty perfect set admits a continuous embedding of the Cantor space.

The proof uses an object which in descriptive set theory is sometimes called a "scheme". Some attempt was made to include in topology.metric_space.cantor_scheme a general theory of these schemes, since they should be useful down the line in other results as well.

We also define pi_nat.res in topology.metric_space.pi_nat.

Diff
@@ -196,6 +196,60 @@ lemma update_mem_cylinder (x : Π n, E n) (n : ℕ) (y : E n) :
   update x n y ∈ cylinder x n :=
 mem_cylinder_iff.2 (λ i hi, by simp [hi.ne])
 
+section res
+
+variable {α : Type*}
+open list
+
+/-- In the case where `E` has constant value `α`,
+the cylinder `cylinder x n` can be identified with the element of `list α`
+consisting of the first `n` entries of `x`. See `cylinder_eq_res`.
+We call this list `res x n`, the restriction of `x` to `n`.-/
+def res (x : ℕ → α) : ℕ → list α
+| 0            := nil
+| (nat.succ n) := x n :: res n
+
+@[simp] lemma res_zero (x : ℕ → α) : res x 0 = @nil α := rfl
+@[simp] lemma res_succ (x : ℕ → α) (n : ℕ) : res x n.succ = x n :: res x n := rfl
+
+@[simp] lemma res_length (x : ℕ → α) (n : ℕ) : (res x n).length = n :=
+by induction n; simp [*]
+
+/-- The restrictions of `x` and `y` to `n` are equal if and only if `x m = y m` for all `m < n`.-/
+lemma res_eq_res {x y : ℕ → α} {n : ℕ} : res x n = res y n ↔ ∀ ⦃m⦄, m < n → x m = y m :=
+begin
+  split; intro h; induction n with n ih, { simp },
+  { intros m hm,
+    rw nat.lt_succ_iff_lt_or_eq at hm,
+    simp only [res_succ] at h,
+    cases hm with hm hm,
+    { exact ih h.2 hm },
+    rw hm,
+    exact h.1, },
+  { simp },
+  simp only [res_succ],
+  refine ⟨h (nat.lt_succ_self _), ih (λ m hm, _)⟩,
+  exact h (hm.trans (nat.lt_succ_self _)),
+end
+
+lemma res_injective : injective (@res α) :=
+begin
+  intros x y h,
+  ext n,
+  apply (res_eq_res).mp _ (nat.lt_succ_self _),
+  rw h,
+end
+
+/-- `cylinder x n` is equal to the set of sequences `y` with the same restriction to `n` as `x`.-/
+theorem cylinder_eq_res (x : ℕ → α) (n : ℕ) : cylinder x n = {y | res y n = res x n} :=
+begin
+  ext y,
+  dsimp [cylinder],
+  rw res_eq_res,
+end
+
+end res
+
 /-!
 ### A distance function on `Π n, E n`
 
@@ -305,13 +359,18 @@ end
 
 variables (E) [∀ n, topological_space (E n)] [∀ n, discrete_topology (E n)]
 
-lemma is_topological_basis_cylinders  :
+lemma is_open_cylinder (x : Π n, E n) (n : ℕ) : is_open (cylinder x n) :=
+begin
+  rw pi_nat.cylinder_eq_pi,
+  exact is_open_set_pi (finset.range n).finite_to_set (λ a ha, is_open_discrete _),
+end
+
+lemma is_topological_basis_cylinders :
   is_topological_basis {s : set (Π n, E n) | ∃ (x : Π n, E n) (n : ℕ), s = cylinder x n} :=
 begin
   apply is_topological_basis_of_open_of_nhds,
   { rintros u ⟨x, n, rfl⟩,
-    rw cylinder_eq_pi,
-    exact is_open_set_pi (finset.range n).finite_to_set (λ a ha, is_open_discrete _) },
+    apply is_open_cylinder, },
   { assume x u hx u_open,
     obtain ⟨v, ⟨U, F, hUF, rfl⟩, xU, Uu⟩ : ∃ (v : set (Π (i : ℕ), E i))
       (H : v ∈ {S : set (Π (i : ℕ), E i) | ∃ (U : Π (i : ℕ), set (E i)) (F : finset ℕ),

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -89,8 +89,8 @@ theorem apply_firstDiff_ne {x y : ∀ n, E n} (h : x ≠ y) : x (firstDiff x y)
 #print PiNat.apply_eq_of_lt_firstDiff /-
 theorem apply_eq_of_lt_firstDiff {x y : ∀ n, E n} {n : ℕ} (hn : n < firstDiff x y) : x n = y n :=
   by
-  rw [first_diff] at hn 
-  split_ifs at hn 
+  rw [first_diff] at hn
+  split_ifs at hn
   · convert Nat.find_min (ne_iff.1 h) hn
     simp
   · exact (not_lt_zero' hn).elim
@@ -285,8 +285,8 @@ theorem res_eq_res {x y : ℕ → α} {n : ℕ} : res x n = res y n ↔ ∀ ⦃m
   by
   constructor <;> intro h <;> induction' n with n ih; · simp
   · intro m hm
-    rw [Nat.lt_succ_iff_lt_or_eq] at hm 
-    simp only [res_succ] at h 
+    rw [Nat.lt_succ_iff_lt_or_eq] at hm
+    simp only [res_succ] at h
     cases' hm with hm hm
     · exact ih h.2 hm
     rw [hm]
@@ -394,7 +394,7 @@ protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + d
 protected theorem eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x = y :=
   by
   rcases eq_or_ne x y with (rfl | h); · rfl
-  simp [dist_eq_of_ne h] at hxy 
+  simp [dist_eq_of_ne h] at hxy
   exact (two_ne_zero (pow_eq_zero hxy)).elim
 #align pi_nat.eq_of_dist_eq_zero PiNat.eq_of_dist_eq_zero
 -/
@@ -482,7 +482,7 @@ theorem isTopologicalBasis_cylinders :
     intro i hi
     have : y i = x i := mem_cylinder_iff.1 hy i ((hn hi).trans_lt (lt_add_one n))
     rw [this]
-    simp only [Set.mem_pi, Finset.mem_coe] at xU 
+    simp only [Set.mem_pi, Finset.mem_coe] at xU
     exact xU i hi
 #align pi_nat.is_topological_basis_cylinders PiNat.isTopologicalBasis_cylinders
 -/
@@ -499,7 +499,7 @@ theorem isOpen_iff_dist (s : Set (∀ n, E n)) :
       ∃ (v : Set (∀ n : ℕ, E n)) (H : v ∈ {s | ∃ (x : ∀ n : ℕ, E n) (n : ℕ), s = cylinder x n}),
         x ∈ v ∧ v ⊆ s :=
       (is_topological_basis_cylinders E).exists_subset_of_mem_open hx hs
-    rw [← mem_cylinder_iff_eq.1 h'x] at h's 
+    rw [← mem_cylinder_iff_eq.1 h'x] at h's
     exact
       ⟨(1 / 2 : ℝ) ^ n, by simp, fun y hy => h's fun i hi => (apply_eq_of_dist_lt hy hi.le).symm⟩
   · intro h
@@ -552,7 +552,7 @@ protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type _} [∀ n, Unifo
         · simp only [mem_principal, set_of_subset_set_of, imp_self, imp_true_iff]
         · rintro ⟨x, y⟩ hxy
           simp only [Finset.mem_coe, Finset.mem_range, Inter_coe_set, mem_Inter, mem_set_of_eq] at
-            hxy 
+            hxy
           apply lt_of_le_of_lt _ hn
           rw [← mem_cylinder_iff_dist_le, mem_cylinder_iff]
           exact hxy
@@ -613,7 +613,7 @@ theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : 
   apply lt_irrefl (inf_dist x s)
   calc
     inf_dist x s ≤ dist x y := inf_dist_le_dist_of_mem ys
-    _ ≤ (1 / 2) ^ n := by rw [mem_cylinder_comm] at hy ; exact mem_cylinder_iff_dist_le.1 hy
+    _ ≤ (1 / 2) ^ n := by rw [mem_cylinder_comm] at hy; exact mem_cylinder_iff_dist_le.1 hy
     _ < inf_dist x s := hn
 #align pi_nat.exists_disjoint_cylinder PiNat.exists_disjoint_cylinder
 -/
@@ -682,8 +682,8 @@ theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClo
   obtain ⟨y, ys, hy⟩ : ∃ y : ∀ n : ℕ, E n, y ∈ s ∧ x ∈ cylinder y (Nat.find A - 1) :=
     by
     have := Nat.find_min A B
-    push_neg at this 
-    simp_rw [not_disjoint_iff, mem_cylinder_comm] at this 
+    push_neg at this
+    simp_rw [not_disjoint_iff, mem_cylinder_comm] at this
     exact this
   refine' ⟨y, ys, _⟩
   rw [mem_cylinder_iff_eq] at hy ⊢
@@ -719,8 +719,8 @@ theorem cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff {x y : ∀ n, E
     · have Ax : (s ∩ cylinder x (longest_prefix x s)).Nonempty :=
         inter_cylinder_longest_prefix_nonempty hs hne x
       have Z := disjoint_cylinder_of_longest_prefix_lt hs ys L
-      rw [first_diff_comm] at H 
-      rw [cylinder_eq_cylinder_of_le_first_diff _ _ H.le] at Z 
+      rw [first_diff_comm] at H
+      rw [cylinder_eq_cylinder_of_le_first_diff _ _ H.le] at Z
       exact (Ax.not_disjoint Z).elim
     · exact L
     · have Ay : (s ∩ cylinder y (longest_prefix y s)).Nonempty :=
@@ -728,7 +728,7 @@ theorem cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff {x y : ∀ n, E
       have A'y : (s ∩ cylinder y (longest_prefix x s).succ).Nonempty :=
         Ay.mono (inter_subset_inter_right s (cylinder_anti _ L))
       have Z := disjoint_cylinder_of_longest_prefix_lt hs xs (Nat.lt_succ_self _)
-      rw [cylinder_eq_cylinder_of_le_first_diff _ _ H] at Z 
+      rw [cylinder_eq_cylinder_of_le_first_diff _ _ H] at Z
       exact (A'y.not_disjoint Z).elim
   rw [l_eq, ← mem_cylinder_iff_eq]
   exact cylinder_anti y H.le (mem_cylinder_first_diff x y)
@@ -795,7 +795,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
         apply cylinder_anti y _ A.some_spec.2
         exact first_diff_le_longest_prefix hs ys xs
       rwa [← fy, ← I2, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy.symm,
-        first_diff_comm _ x] at I 
+        first_diff_comm _ x] at I
     -- case where `x ∉ s`
     · by_cases ys : y ∈ s
       -- case where `y ∈ s` (similar to the above)
@@ -808,7 +808,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
           apply cylinder_anti x _ A.some_spec.2
           apply first_diff_le_longest_prefix hs xs ys
         rw [fs y ys] at hfxfy ⊢
-        rwa [← fx, I2, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy] at I 
+        rwa [← fx, I2, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy] at I
       -- case where `y ∉ s`
       · have Ax : (s ∩ cylinder x (longest_prefix x s)).Nonempty :=
           inter_cylinder_longest_prefix_nonempty hs hne x
@@ -824,14 +824,14 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
             cases H
             · exact cylinder_longest_prefix_eq_of_longest_prefix_lt_first_diff hs hne H xs ys
             · symm
-              rw [first_diff_comm] at H 
+              rw [first_diff_comm] at H
               exact cylinder_longest_prefix_eq_of_longest_prefix_lt_first_diff hs hne H ys xs
-          rw [fx, fy] at hfxfy 
+          rw [fx, fy] at hfxfy
           apply (hfxfy _).elim
           congr
         -- case where the common prefix to `x` and `s` is long, as well as the common prefix to
         -- `y` and `s`. Then all points remain in the same cylinders.
-        · push_neg at H 
+        · push_neg at H
           have I1 : cylinder Ax.some (first_diff x y) = cylinder x (first_diff x y) :=
             by
             rw [← mem_cylinder_iff_eq]
@@ -842,7 +842,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
             exact cylinder_anti y H.2 Ay.some_spec.2
           have : cylinder Ax.some (first_diff x y) = cylinder Ay.some (first_diff x y) := by
             rw [I1, I2, I3]
-          rw [← fx, ← fy, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy] at this 
+          rw [← fx, ← fy, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy] at this
           exact this
 #align pi_nat.exists_lipschitz_retraction_of_is_closed PiNat.exists_lipschitz_retraction_of_isClosed
 -/
@@ -945,7 +945,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
     have L : tendsto (fun n : ℕ => (1 / 2 : ℝ) ^ n + (1 / 2) ^ n) at_top (𝓝 (0 + 0)) :=
       (tendsto_pow_atTop_nhds_zero_of_lt_one I0.le I1).add
         (tendsto_pow_atTop_nhds_zero_of_lt_one I0.le I1)
-    rw [add_zero] at L 
+    rw [add_zero] at L
     exact ge_of_tendsto' L J
   have s_closed : IsClosed s :=
     by
@@ -955,7 +955,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
       by
       have : tendsto (fun n : ℕ => (2 : ℝ) * (1 / 2) ^ n) at_top (𝓝 (2 * 0)) :=
         (tendsto_pow_atTop_nhds_zero_of_lt_one I0.le I1).const_mul _
-      rw [MulZeroClass.mul_zero] at this 
+      rw [MulZeroClass.mul_zero] at this
       exact
         squeeze_zero (fun n => diam_nonneg) (fun n => diam_closed_ball (pow_nonneg I0.le _)) this
     refine'
@@ -1126,7 +1126,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
         refine' mem_infi_of_mem δ (mem_infi_of_mem δpos _)
         simp only [Prod.forall, imp_self, mem_principal]
       · rintro ⟨x, y⟩ hxy
-        simp only [mem_Inter, mem_set_of_eq, SetCoe.forall, Finset.mem_range, Finset.mem_coe] at hxy 
+        simp only [mem_Inter, mem_set_of_eq, SetCoe.forall, Finset.mem_range, Finset.mem_coe] at hxy
         calc
           dist x y = ∑' i : ι, min ((1 / 2) ^ encode i) (dist (x i) (y i)) := rfl
           _ =
Diff
@@ -943,7 +943,8 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
           dist_triangle_right _ _ _
         _ ≤ (1 / 2) ^ n + (1 / 2) ^ n := add_le_add (A ⟨x, I⟩ n) (hx n)
     have L : tendsto (fun n : ℕ => (1 / 2 : ℝ) ^ n + (1 / 2) ^ n) at_top (𝓝 (0 + 0)) :=
-      (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1).add (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1)
+      (tendsto_pow_atTop_nhds_zero_of_lt_one I0.le I1).add
+        (tendsto_pow_atTop_nhds_zero_of_lt_one I0.le I1)
     rw [add_zero] at L 
     exact ge_of_tendsto' L J
   have s_closed : IsClosed s :=
@@ -953,7 +954,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
     have L : tendsto (fun n : ℕ => diam (closed_ball (u (x n)) ((1 / 2) ^ n))) at_top (𝓝 0) :=
       by
       have : tendsto (fun n : ℕ => (2 : ℝ) * (1 / 2) ^ n) at_top (𝓝 (2 * 0)) :=
-        (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1).const_mul _
+        (tendsto_pow_atTop_nhds_zero_of_lt_one I0.le I1).const_mul _
       rw [MulZeroClass.mul_zero] at this 
       exact
         squeeze_zero (fun n => diam_nonneg) (fun n => diam_closed_ball (pow_nonneg I0.le _)) this
Diff
@@ -60,7 +60,7 @@ open scoped Classical Topology Filter
 
 open TopologicalSpace Set Metric Filter Function
 
-attribute [local simp] pow_le_pow_iff one_lt_two inv_le_inv
+attribute [local simp] pow_le_pow_iff_right one_lt_two inv_le_inv
 
 variable {E : ℕ → Type _}
 
@@ -377,7 +377,7 @@ theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y)
   rcases eq_or_ne y z with (rfl | hyz)
   · simp
   simp only [dist_eq_of_ne, hxz, hxy, hyz, inv_le_inv, one_div, inv_pow, zero_lt_bit0, Ne.def,
-    not_false_iff, le_max_iff, zero_lt_one, pow_le_pow_iff, one_lt_two, pow_pos,
+    not_false_iff, le_max_iff, zero_lt_one, pow_le_pow_iff_right, one_lt_two, pow_pos,
     min_le_iff.1 (min_first_diff_le x y z hxz)]
 #align pi_nat.dist_triangle_nonarch PiNat.dist_triangle_nonarch
 -/
Diff
@@ -112,7 +112,7 @@ theorem firstDiff_comm (x y : ∀ n, E n) : firstDiff x y = firstDiff y x :=
 theorem min_firstDiff_le (x y z : ∀ n, E n) (h : x ≠ z) :
     min (firstDiff x y) (firstDiff y z) ≤ firstDiff x z :=
   by
-  by_contra' H
+  by_contra! H
   have : x (first_diff x z) = z (first_diff x z) :=
     calc
       x (first_diff x z) = y (first_diff x z) :=
@@ -195,7 +195,7 @@ theorem mem_cylinder_iff_le_firstDiff {x y : ∀ n, E n} (hne : x ≠ y) (i : 
     x ∈ cylinder y i ↔ i ≤ firstDiff x y := by
   constructor
   · intro h
-    by_contra'
+    by_contra!
     exact apply_first_diff_ne hne (h _ this)
   · intro hi j hj
     exact apply_eq_of_lt_first_diff (hj.trans_le hi)
@@ -407,7 +407,7 @@ theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
   suffices (∀ i : ℕ, i < n → y i = x i) ↔ n ≤ first_diff y x by simpa [dist_eq_of_ne hne]
   constructor
   · intro hy
-    by_contra' H
+    by_contra! H
     exact apply_first_diff_ne hne (hy _ H)
   · intro h i hi
     exact apply_eq_of_lt_first_diff (hi.trans_le h)
@@ -911,7 +911,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
     let n := first_diff x.1 y.1 - 1
     have diff_pos : 0 < first_diff x.1 y.1 :=
       by
-      by_contra' h
+      by_contra! h
       apply apply_first_diff_ne hne'
       rw [le_zero_iff.1 h]
       apply apply_eq_of_dist_lt _ le_rfl
Diff
@@ -1018,7 +1018,7 @@ theorem dist_summable (x y : ∀ i, F i) :
     Summable fun i : ι => min ((1 / 2) ^ encode i) (dist (x i) (y i)) :=
   by
   refine'
-    summable_of_nonneg_of_le (fun i => _) (fun i => min_le_left _ _) summable_geometric_two_encode
+    Summable.of_nonneg_of_le (fun i => _) (fun i => min_le_left _ _) summable_geometric_two_encode
   exact le_min (pow_nonneg (by norm_num) _) dist_nonneg
 #align pi_countable.dist_summable PiCountable.dist_summable
 -/
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2022 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.Tactic.RingExp
-import Mathbin.Topology.MetricSpace.HausdorffDistance
+import Tactic.RingExp
+import Topology.MetricSpace.HausdorffDistance
 
 #align_import topology.metric_space.pi_nat from "leanprover-community/mathlib"@"49b7f94aab3a3bdca1f9f34c5d818afb253b3993"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 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.pi_nat
-! leanprover-community/mathlib commit 49b7f94aab3a3bdca1f9f34c5d818afb253b3993
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Tactic.RingExp
 import Mathbin.Topology.MetricSpace.HausdorffDistance
 
+#align_import topology.metric_space.pi_nat from "leanprover-community/mathlib"@"49b7f94aab3a3bdca1f9f34c5d818afb253b3993"
+
 /-!
 # Topological study of spaces `Π (n : ℕ), E n`
 
Diff
@@ -111,6 +111,7 @@ theorem firstDiff_comm (x y : ∀ n, E n) : firstDiff x y = firstDiff y x :=
 #align pi_nat.first_diff_comm PiNat.firstDiff_comm
 -/
 
+#print PiNat.min_firstDiff_le /-
 theorem min_firstDiff_le (x y z : ∀ n, E n) (h : x ≠ z) :
     min (firstDiff x y) (firstDiff y z) ≤ firstDiff x z :=
   by
@@ -122,6 +123,7 @@ theorem min_firstDiff_le (x y z : ∀ n, E n) (h : x ≠ z) :
       _ = z (first_diff x z) := apply_eq_of_lt_first_diff (H.trans_le (min_le_right _ _))
   exact (apply_first_diff_ne h this).elim
 #align pi_nat.min_first_diff_le PiNat.min_firstDiff_le
+-/
 
 /-! ### Cylinders -/
 
@@ -218,6 +220,7 @@ theorem cylinder_eq_cylinder_of_le_firstDiff (x y : ∀ n, E n) {n : ℕ} (hn :
 #align pi_nat.cylinder_eq_cylinder_of_le_first_diff PiNat.cylinder_eq_cylinder_of_le_firstDiff
 -/
 
+#print PiNat.iUnion_cylinder_update /-
 theorem iUnion_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     (⋃ k, cylinder (update x n k) (n + 1)) = cylinder x n :=
   by
@@ -232,10 +235,13 @@ theorem iUnion_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     · simp [H i h'i, h'i.ne]
     · simp
 #align pi_nat.Union_cylinder_update PiNat.iUnion_cylinder_update
+-/
 
+#print PiNat.update_mem_cylinder /-
 theorem update_mem_cylinder (x : ∀ n, E n) (n : ℕ) (y : E n) : update x n y ∈ cylinder x n :=
   mem_cylinder_iff.2 fun i hi => by simp [hi.ne]
 #align pi_nat.update_mem_cylinder PiNat.update_mem_cylinder
+-/
 
 section Res
 
@@ -338,12 +344,16 @@ protected def dist : Dist (∀ n, E n) :=
 
 attribute [local instance] PiNat.dist
 
+#print PiNat.dist_eq_of_ne /-
 theorem dist_eq_of_ne {x y : ∀ n, E n} (h : x ≠ y) : dist x y = (1 / 2 : ℝ) ^ firstDiff x y := by
   simp [dist, h]
 #align pi_nat.dist_eq_of_ne PiNat.dist_eq_of_ne
+-/
 
+#print PiNat.dist_self /-
 protected theorem dist_self (x : ∀ n, E n) : dist x x = 0 := by simp [dist]
 #align pi_nat.dist_self PiNat.dist_self
+-/
 
 #print PiNat.dist_comm /-
 protected theorem dist_comm (x y : ∀ n, E n) : dist x y = dist y x := by
@@ -351,13 +361,16 @@ protected theorem dist_comm (x y : ∀ n, E n) : dist x y = dist y x := by
 #align pi_nat.dist_comm PiNat.dist_comm
 -/
 
+#print PiNat.dist_nonneg /-
 protected theorem dist_nonneg (x y : ∀ n, E n) : 0 ≤ dist x y :=
   by
   rcases eq_or_ne x y with (rfl | h)
   · simp [dist]
   · simp [dist, h]
 #align pi_nat.dist_nonneg PiNat.dist_nonneg
+-/
 
+#print PiNat.dist_triangle_nonarch /-
 theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y) (dist y z) :=
   by
   rcases eq_or_ne x z with (rfl | hxz)
@@ -370,20 +383,26 @@ theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y)
     not_false_iff, le_max_iff, zero_lt_one, pow_le_pow_iff, one_lt_two, pow_pos,
     min_le_iff.1 (min_first_diff_le x y z hxz)]
 #align pi_nat.dist_triangle_nonarch PiNat.dist_triangle_nonarch
+-/
 
+#print PiNat.dist_triangle /-
 protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + dist y z :=
   calc
     dist x z ≤ max (dist x y) (dist y z) := dist_triangle_nonarch x y z
     _ ≤ dist x y + dist y z := max_le_add_of_nonneg (PiNat.dist_nonneg _ _) (PiNat.dist_nonneg _ _)
 #align pi_nat.dist_triangle PiNat.dist_triangle
+-/
 
+#print PiNat.eq_of_dist_eq_zero /-
 protected theorem eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x = y :=
   by
   rcases eq_or_ne x y with (rfl | h); · rfl
   simp [dist_eq_of_ne h] at hxy 
   exact (two_ne_zero (pow_eq_zero hxy)).elim
 #align pi_nat.eq_of_dist_eq_zero PiNat.eq_of_dist_eq_zero
+-/
 
+#print PiNat.mem_cylinder_iff_dist_le /-
 theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
     y ∈ cylinder x n ↔ dist y x ≤ (1 / 2) ^ n :=
   by
@@ -396,7 +415,9 @@ theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
   · intro h i hi
     exact apply_eq_of_lt_first_diff (hi.trans_le h)
 #align pi_nat.mem_cylinder_iff_dist_le PiNat.mem_cylinder_iff_dist_le
+-/
 
+#print PiNat.apply_eq_of_dist_lt /-
 theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2) ^ n) {i : ℕ}
     (hi : i ≤ n) : x i = y i :=
   by
@@ -405,7 +426,9 @@ theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2)
     simpa [dist_eq_of_ne hne, inv_lt_inv, pow_lt_pow_iff, one_lt_two] using h
   exact apply_eq_of_lt_first_diff (hi.trans_lt this)
 #align pi_nat.apply_eq_of_dist_lt PiNat.apply_eq_of_dist_lt
+-/
 
+#print PiNat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder /-
 /-- A function to a pseudo-metric-space is `1`-Lipschitz if and only if points in the same cylinder
 of length `n` are sent to points within distance `(1/2)^n`.
 Not expressed using `lipschitz_with` as we don't have a metric space structure -/
@@ -426,6 +449,7 @@ theorem lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type _
     rw [first_diff_comm]
     exact mem_cylinder_first_diff _ _
 #align pi_nat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder PiNat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder
+-/
 
 variable (E) [∀ n, TopologicalSpace (E n)] [∀ n, DiscreteTopology (E n)]
 
@@ -468,6 +492,7 @@ theorem isTopologicalBasis_cylinders :
 
 variable {E}
 
+#print PiNat.isOpen_iff_dist /-
 theorem isOpen_iff_dist (s : Set (∀ n, E n)) :
     IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s :=
   by
@@ -488,6 +513,7 @@ theorem isOpen_iff_dist (s : Set (∀ n, E n)) :
     rw [PiNat.dist_comm]
     exact (mem_cylinder_iff_dist_le.1 hy).trans_lt hn
 #align pi_nat.is_open_iff_dist PiNat.isOpen_iff_dist
+-/
 
 #print PiNat.metricSpace /-
 /-- Metric space structure on `Π (n : ℕ), E n` when the spaces `E n` have the discrete topology,
@@ -577,6 +603,7 @@ where `z_w` is an element of `s` starting with `w`.
 -/
 
 
+#print PiNat.exists_disjoint_cylinder /-
 theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : ∀ n, E n}
     (hx : x ∉ s) : ∃ n, Disjoint s (cylinder x n) :=
   by
@@ -592,6 +619,7 @@ theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : 
     _ ≤ (1 / 2) ^ n := by rw [mem_cylinder_comm] at hy ; exact mem_cylinder_iff_dist_le.1 hy
     _ < inf_dist x s := hn
 #align pi_nat.exists_disjoint_cylinder PiNat.exists_disjoint_cylinder
+-/
 
 #print PiNat.shortestPrefixDiff /-
 /-- Given a point `x` in a product space `Π (n : ℕ), E n`, and `s` a subset of this space, then
@@ -645,6 +673,7 @@ theorem firstDiff_le_longestPrefix {s : Set (∀ n, E n)} (hs : IsClosed s) {x y
 #align pi_nat.first_diff_le_longest_prefix PiNat.firstDiff_le_longestPrefix
 -/
 
+#print PiNat.inter_cylinder_longestPrefix_nonempty /-
 theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClosed s)
     (hne : s.Nonempty) (x : ∀ n, E n) : (s ∩ cylinder x (longestPrefix x s)).Nonempty :=
   by
@@ -663,7 +692,9 @@ theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClo
   rw [mem_cylinder_iff_eq] at hy ⊢
   rw [hy]
 #align pi_nat.inter_cylinder_longest_prefix_nonempty PiNat.inter_cylinder_longestPrefix_nonempty
+-/
 
+#print PiNat.disjoint_cylinder_of_longestPrefix_lt /-
 theorem disjoint_cylinder_of_longestPrefix_lt {s : Set (∀ n, E n)} (hs : IsClosed s) {x : ∀ n, E n}
     (hx : x ∉ s) {n : ℕ} (hn : longestPrefix x s < n) : Disjoint s (cylinder x n) :=
   by
@@ -674,6 +705,7 @@ theorem disjoint_cylinder_of_longestPrefix_lt {s : Set (∀ n, E n)} (hs : IsClo
   apply (mem_cylinder_iff_le_first_diff (ne_of_mem_of_not_mem ys hx).symm _).1
   rwa [mem_cylinder_comm]
 #align pi_nat.disjoint_cylinder_of_longest_prefix_lt PiNat.disjoint_cylinder_of_longestPrefix_lt
+-/
 
 #print PiNat.cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff /-
 /-- If two points `x, y` coincide up to length `n`, and the longest common prefix of `x` with `s`
@@ -850,6 +882,7 @@ end PiNat
 
 open PiNat
 
+#print exists_nat_nat_continuous_surjective_of_completeSpace /-
 /-- Any nonempty complete second countable metric space is the continuous image of the
 fundamental space `ℕ → ℕ`. For a version of this theorem in the context of Polish spaces, see
 `exists_nat_nat_continuous_surjective_of_polish_space`. -/
@@ -952,6 +985,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
     simpa only [nonempty_coe_sort] using g_surj.nonempty
   exact ⟨g ∘ f, g_cont.comp f_cont, g_surj.comp f_surj⟩
 #align exists_nat_nat_continuous_surjective_of_complete_space exists_nat_nat_continuous_surjective_of_completeSpace
+-/
 
 namespace PiCountable
 
@@ -975,11 +1009,14 @@ protected def dist : Dist (∀ i, F i) :=
 
 attribute [local instance] PiCountable.dist
 
+#print PiCountable.dist_eq_tsum /-
 theorem dist_eq_tsum (x y : ∀ i, F i) :
     dist x y = ∑' i : ι, min ((1 / 2) ^ encode i) (dist (x i) (y i)) :=
   rfl
 #align pi_countable.dist_eq_tsum PiCountable.dist_eq_tsum
+-/
 
+#print PiCountable.dist_summable /-
 theorem dist_summable (x y : ∀ i, F i) :
     Summable fun i : ι => min ((1 / 2) ^ encode i) (dist (x i) (y i)) :=
   by
@@ -987,16 +1024,21 @@ theorem dist_summable (x y : ∀ i, F i) :
     summable_of_nonneg_of_le (fun i => _) (fun i => min_le_left _ _) summable_geometric_two_encode
   exact le_min (pow_nonneg (by norm_num) _) dist_nonneg
 #align pi_countable.dist_summable PiCountable.dist_summable
+-/
 
+#print PiCountable.min_dist_le_dist_pi /-
 theorem min_dist_le_dist_pi (x y : ∀ i, F i) (i : ι) :
     min ((1 / 2) ^ encode i) (dist (x i) (y i)) ≤ dist x y :=
   le_tsum (dist_summable x y) i fun j hj => le_min (by simp) dist_nonneg
 #align pi_countable.min_dist_le_dist_pi PiCountable.min_dist_le_dist_pi
+-/
 
+#print PiCountable.dist_le_dist_pi_of_dist_lt /-
 theorem dist_le_dist_pi_of_dist_lt {x y : ∀ i, F i} {i : ι} (h : dist x y < (1 / 2) ^ encode i) :
     dist (x i) (y i) ≤ dist x y := by
   simpa only [not_le.2 h, false_or_iff] using min_le_iff.1 (min_dist_le_dist_pi x y i)
 #align pi_countable.dist_le_dist_pi_of_dist_lt PiCountable.dist_le_dist_pi_of_dist_lt
+-/
 
 open scoped BigOperators Topology
 
Diff
@@ -1044,8 +1044,8 @@ protected def metricSpace : MetricSpace (∀ i, F i)
     calc
       dist x z ≤
           ∑' i,
-            min ((1 / 2) ^ encode i) (dist (x i) (y i)) +
-              min ((1 / 2) ^ encode i) (dist (y i) (z i)) :=
+            (min ((1 / 2) ^ encode i) (dist (x i) (y i)) +
+              min ((1 / 2) ^ encode i) (dist (y i) (z i))) :=
         tsum_le_tsum I (dist_summable x z) ((dist_summable x y).add (dist_summable y z))
       _ = dist x y + dist y z := tsum_add (dist_summable x y) (dist_summable y z)
   eq_of_dist_eq_zero := by
@@ -1065,7 +1065,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
     · simp only [le_iInf_iff, le_principal_iff]
       intro ε εpos
       obtain ⟨K, hK⟩ :
-        ∃ K : Finset ι, (∑' i : { j // j ∉ K }, (1 / 2 : ℝ) ^ encode (i : ι)) < ε / 2 :=
+        ∃ K : Finset ι, ∑' i : { j // j ∉ K }, (1 / 2 : ℝ) ^ encode (i : ι) < ε / 2 :=
         ((tendsto_order.1 (tendsto_tsum_compl_atTop_zero fun i : ι => (1 / 2 : ℝ) ^ encode i)).2 _
             (half_pos εpos)).exists
       obtain ⟨δ, δpos, hδ⟩ : ∃ (δ : ℝ) (δpos : 0 < δ), (K.card : ℝ) * δ ≤ ε / 2 :=
@@ -1090,17 +1090,16 @@ protected def metricSpace : MetricSpace (∀ i, F i)
         calc
           dist x y = ∑' i : ι, min ((1 / 2) ^ encode i) (dist (x i) (y i)) := rfl
           _ =
-              (∑ i in K, min ((1 / 2) ^ encode i) (dist (x i) (y i))) +
+              ∑ i in K, min ((1 / 2) ^ encode i) (dist (x i) (y i)) +
                 ∑' i : (↑K : Set ι)ᶜ, min ((1 / 2) ^ encode (i : ι)) (dist (x i) (y i)) :=
             (sum_add_tsum_compl (dist_summable _ _)).symm
-          _ ≤ (∑ i in K, dist (x i) (y i)) + ∑' i : (↑K : Set ι)ᶜ, (1 / 2) ^ encode (i : ι) :=
+          _ ≤ ∑ i in K, dist (x i) (y i) + ∑' i : (↑K : Set ι)ᶜ, (1 / 2) ^ encode (i : ι) :=
             by
             refine' add_le_add (Finset.sum_le_sum fun i hi => min_le_right _ _) _
             refine' tsum_le_tsum (fun i => min_le_left _ _) _ _
             · apply Summable.subtype (dist_summable x y) ((↑K : Set ι)ᶜ)
             · apply Summable.subtype summable_geometric_two_encode ((↑K : Set ι)ᶜ)
-          _ < (∑ i in K, δ) + ε / 2 :=
-            by
+          _ < ∑ i in K, δ + ε / 2 := by
             apply add_lt_add_of_le_of_lt _ hK
             apply Finset.sum_le_sum fun i hi => _
             apply (hxy i _).le
Diff
@@ -120,7 +120,6 @@ theorem min_firstDiff_le (x y z : ∀ n, E n) (h : x ≠ z) :
       x (first_diff x z) = y (first_diff x z) :=
         apply_eq_of_lt_first_diff (H.trans_le (min_le_left _ _))
       _ = z (first_diff x z) := apply_eq_of_lt_first_diff (H.trans_le (min_le_right _ _))
-      
   exact (apply_first_diff_ne h this).elim
 #align pi_nat.min_first_diff_le PiNat.min_firstDiff_le
 
@@ -376,7 +375,6 @@ protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + d
   calc
     dist x z ≤ max (dist x y) (dist y z) := dist_triangle_nonarch x y z
     _ ≤ dist x y + dist y z := max_le_add_of_nonneg (PiNat.dist_nonneg _ _) (PiNat.dist_nonneg _ _)
-    
 #align pi_nat.dist_triangle PiNat.dist_triangle
 
 protected theorem eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x = y :=
@@ -593,7 +591,6 @@ theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : 
     inf_dist x s ≤ dist x y := inf_dist_le_dist_of_mem ys
     _ ≤ (1 / 2) ^ n := by rw [mem_cylinder_comm] at hy ; exact mem_cylinder_iff_dist_le.1 hy
     _ < inf_dist x s := hn
-    
 #align pi_nat.exists_disjoint_cylinder PiNat.exists_disjoint_cylinder
 
 #print PiNat.shortestPrefixDiff /-
@@ -899,7 +896,6 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
       _ = dist (g x) (u (x.1 n)) + dist (g y) (u (y.1 n)) := by rw [← B]
       _ ≤ (1 / 2) ^ n + (1 / 2) ^ n := (add_le_add (A x n) (A y n))
       _ = 4 * (1 / 2) ^ (n + 1) := by ring
-      
   have g_surj : surjective g := by
     intro y
     have : ∀ n : ℕ, ∃ j, y ∈ closed_ball (u j) ((1 / 2) ^ n) :=
@@ -916,7 +912,6 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
         dist (g ⟨x, I⟩) y ≤ dist (g ⟨x, I⟩) (u (x n)) + dist y (u (x n)) :=
           dist_triangle_right _ _ _
         _ ≤ (1 / 2) ^ n + (1 / 2) ^ n := add_le_add (A ⟨x, I⟩ n) (hx n)
-        
     have L : tendsto (fun n : ℕ => (1 / 2 : ℝ) ^ n + (1 / 2) ^ n) at_top (𝓝 (0 + 0)) :=
       (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1).add (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1)
     rw [add_zero] at L 
@@ -1046,7 +1041,6 @@ protected def metricSpace : MetricSpace (∀ i, F i)
             min ((1 / 2) ^ encode i) (dist (x i) (y i)) +
               min ((1 / 2) ^ encode i) (dist (y i) (z i)) :=
           min_le_right _ _
-        
     calc
       dist x z ≤
           ∑' i,
@@ -1054,7 +1048,6 @@ protected def metricSpace : MetricSpace (∀ i, F i)
               min ((1 / 2) ^ encode i) (dist (y i) (z i)) :=
         tsum_le_tsum I (dist_summable x z) ((dist_summable x y).add (dist_summable y z))
       _ = dist x y + dist y z := tsum_add (dist_summable x y) (dist_summable y z)
-      
   eq_of_dist_eq_zero := by
     intro x y hxy
     ext1 n
@@ -1115,7 +1108,6 @@ protected def metricSpace : MetricSpace (∀ i, F i)
           _ ≤ ε / 2 + ε / 2 :=
             (add_le_add_right (by simpa only [Finset.sum_const, nsmul_eq_mul] using hδ) _)
           _ = ε := add_halves _
-          
     · simp only [le_iInf_iff, le_principal_iff]
       intro i ε εpos
       refine' mem_infi_of_mem (min ((1 / 2) ^ encode i) ε) _
@@ -1126,7 +1118,6 @@ protected def metricSpace : MetricSpace (∀ i, F i)
       calc
         dist (x i) (y i) ≤ dist x y := dist_le_dist_pi_of_dist_lt hn
         _ < ε := hε
-        
 #align pi_countable.metric_space PiCountable.metricSpace
 -/
 
Diff
@@ -93,7 +93,7 @@ theorem apply_firstDiff_ne {x y : ∀ n, E n} (h : x ≠ y) : x (firstDiff x y)
 theorem apply_eq_of_lt_firstDiff {x y : ∀ n, E n} {n : ℕ} (hn : n < firstDiff x y) : x n = y n :=
   by
   rw [first_diff] at hn 
-  split_ifs  at hn 
+  split_ifs at hn 
   · convert Nat.find_min (ne_iff.1 h) hn
     simp
   · exact (not_lt_zero' hn).elim
@@ -133,7 +133,7 @@ theorem min_firstDiff_le (x y z : ∀ n, E n) (h : x ≠ z) :
 such that `y i = x i` for all `i < n`.
 -/
 def cylinder (x : ∀ n, E n) (n : ℕ) : Set (∀ n, E n) :=
-  { y | ∀ i, i < n → y i = x i }
+  {y | ∀ i, i < n → y i = x i}
 #align pi_nat.cylinder PiNat.cylinder
 -/
 
@@ -308,7 +308,7 @@ theorem res_injective : Injective (@res α) :=
 
 #print PiNat.cylinder_eq_res /-
 /-- `cylinder x n` is equal to the set of sequences `y` with the same restriction to `n` as `x`.-/
-theorem cylinder_eq_res (x : ℕ → α) (n : ℕ) : cylinder x n = { y | res y n = res x n } :=
+theorem cylinder_eq_res (x : ℕ → α) (n : ℕ) : cylinder x n = {y | res y n = res x n} :=
   by
   ext y
   dsimp [cylinder]
@@ -441,7 +441,7 @@ theorem isOpen_cylinder (x : ∀ n, E n) (n : ℕ) : IsOpen (cylinder x n) :=
 
 #print PiNat.isTopologicalBasis_cylinders /-
 theorem isTopologicalBasis_cylinders :
-    IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n) (n : ℕ), s = cylinder x n } :=
+    IsTopologicalBasis {s : Set (∀ n, E n) | ∃ (x : ∀ n, E n) (n : ℕ), s = cylinder x n} :=
   by
   apply is_topological_basis_of_open_of_nhds
   · rintro u ⟨x, n, rfl⟩
@@ -450,9 +450,9 @@ theorem isTopologicalBasis_cylinders :
     obtain ⟨v, ⟨U, F, hUF, rfl⟩, xU, Uu⟩ :
       ∃ (v : Set (∀ i : ℕ, E i)) (H :
         v ∈
-          { S : Set (∀ i : ℕ, E i) |
+          {S : Set (∀ i : ℕ, E i) |
             ∃ (U : ∀ i : ℕ, Set (E i)) (F : Finset ℕ),
-              (∀ i : ℕ, i ∈ F → U i ∈ { s : Set (E i) | IsOpen s }) ∧ S = (F : Set ℕ).pi U }),
+              (∀ i : ℕ, i ∈ F → U i ∈ {s : Set (E i) | IsOpen s}) ∧ S = (F : Set ℕ).pi U}),
         x ∈ v ∧ v ⊆ u :=
       (isTopologicalBasis_pi fun n : ℕ => is_topological_basis_opens).exists_subset_of_mem_open hx
         u_open
@@ -476,7 +476,7 @@ theorem isOpen_iff_dist (s : Set (∀ n, E n)) :
   constructor
   · intro hs x hx
     obtain ⟨v, ⟨y, n, rfl⟩, h'x, h's⟩ :
-      ∃ (v : Set (∀ n : ℕ, E n)) (H : v ∈ { s | ∃ (x : ∀ n : ℕ, E n) (n : ℕ), s = cylinder x n }),
+      ∃ (v : Set (∀ n : ℕ, E n)) (H : v ∈ {s | ∃ (x : ∀ n : ℕ, E n) (n : ℕ), s = cylinder x n}),
         x ∈ v ∧ v ⊆ s :=
       (is_topological_basis_cylinders E).exists_subset_of_mem_open hx hs
     rw [← mem_cylinder_iff_eq.1 h'x] at h's 
@@ -527,7 +527,7 @@ protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type _} [∀ n, Unifo
         obtain ⟨n, hn⟩ : ∃ n, (1 / 2 : ℝ) ^ n < ε := exists_pow_lt_of_lt_one εpos (by norm_num)
         apply
           @mem_infi_of_Inter _ _ _ _ _ (Finset.range n).finite_toSet fun i =>
-            { p : (∀ n : ℕ, E n) × ∀ n : ℕ, E n | p.fst i = p.snd i }
+            {p : (∀ n : ℕ, E n) × ∀ n : ℕ, E n | p.fst i = p.snd i}
         · simp only [mem_principal, set_of_subset_set_of, imp_self, imp_true_iff]
         · rintro ⟨x, y⟩ hxy
           simp only [Finset.mem_coe, Finset.mem_range, Inter_coe_set, mem_Inter, mem_set_of_eq] at
@@ -563,7 +563,7 @@ protected theorem completeSpace : CompleteSpace (∀ n, E n) :=
   intro u hu
   refine' ⟨fun n => u n n, tendsto_pi_nhds.2 fun i => _⟩
   refine' tendsto_const_nhds.congr' _
-  filter_upwards [Filter.Ici_mem_atTop i]with n hn
+  filter_upwards [Filter.Ici_mem_atTop i] with n hn
   exact apply_eq_of_dist_lt (hu i i n le_rfl hn) le_rfl
 #align pi_nat.complete_space PiNat.completeSpace
 -/
@@ -659,7 +659,7 @@ theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClo
   obtain ⟨y, ys, hy⟩ : ∃ y : ∀ n : ℕ, E n, y ∈ s ∧ x ∈ cylinder y (Nat.find A - 1) :=
     by
     have := Nat.find_min A B
-    push_neg  at this 
+    push_neg at this 
     simp_rw [not_disjoint_iff, mem_cylinder_comm] at this 
     exact this
   refine' ⟨y, ys, _⟩
@@ -805,7 +805,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
           congr
         -- case where the common prefix to `x` and `s` is long, as well as the common prefix to
         -- `y` and `s`. Then all points remain in the same cylinders.
-        · push_neg  at H 
+        · push_neg at H 
           have I1 : cylinder Ax.some (first_diff x y) = cylinder x (first_diff x y) :=
             by
             rw [← mem_cylinder_iff_eq]
@@ -870,7 +870,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
   have I0 : (0 : ℝ) < 1 / 2 := by norm_num
   have I1 : (1 / 2 : ℝ) < 1 := by norm_num
   rcases exists_dense_seq α with ⟨u, hu⟩
-  let s : Set (ℕ → ℕ) := { x | (⋂ n : ℕ, closed_ball (u (x n)) ((1 / 2) ^ n)).Nonempty }
+  let s : Set (ℕ → ℕ) := {x | (⋂ n : ℕ, closed_ball (u (x n)) ((1 / 2) ^ n)).Nonempty}
   let g : s → α := fun x => x.2.some
   have A : ∀ (x : s) (n : ℕ), dist (g x) (u ((x : ℕ → ℕ) n)) ≤ (1 / 2) ^ n := fun x n =>
     (mem_Inter.1 x.2.some_mem n : _)
@@ -1037,7 +1037,8 @@ protected def metricSpace : MetricSpace (∀ i, F i)
               (min ((1 / 2) ^ encode i) (dist (x i) (y i)) +
                 min ((1 / 2) ^ encode i) (dist (y i) (z i))) :=
           by
-          convert congr_arg (coe : ℝ≥0 → ℝ)
+          convert
+              congr_arg (coe : ℝ≥0 → ℝ)
                 (min_add_distrib ((1 / 2 : ℝ≥0) ^ encode i) (nndist (x i) (y i))
                   (nndist (y i) (z i))) <;>
             simp
@@ -1087,7 +1088,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
           ring
       apply
         @mem_infi_of_Inter _ _ _ _ _ K.finite_to_set fun i =>
-          { p : (∀ i : ι, F i) × ∀ i : ι, F i | dist (p.fst i) (p.snd i) < δ }
+          {p : (∀ i : ι, F i) × ∀ i : ι, F i | dist (p.fst i) (p.snd i) < δ}
       · rintro ⟨i, hi⟩
         refine' mem_infi_of_mem δ (mem_infi_of_mem δpos _)
         simp only [Prod.forall, imp_self, mem_principal]
Diff
@@ -92,8 +92,8 @@ theorem apply_firstDiff_ne {x y : ∀ n, E n} (h : x ≠ y) : x (firstDiff x y)
 #print PiNat.apply_eq_of_lt_firstDiff /-
 theorem apply_eq_of_lt_firstDiff {x y : ∀ n, E n} {n : ℕ} (hn : n < firstDiff x y) : x n = y n :=
   by
-  rw [first_diff] at hn
-  split_ifs  at hn
+  rw [first_diff] at hn 
+  split_ifs  at hn 
   · convert Nat.find_min (ne_iff.1 h) hn
     simp
   · exact (not_lt_zero' hn).elim
@@ -283,8 +283,8 @@ theorem res_eq_res {x y : ℕ → α} {n : ℕ} : res x n = res y n ↔ ∀ ⦃m
   by
   constructor <;> intro h <;> induction' n with n ih; · simp
   · intro m hm
-    rw [Nat.lt_succ_iff_lt_or_eq] at hm
-    simp only [res_succ] at h
+    rw [Nat.lt_succ_iff_lt_or_eq] at hm 
+    simp only [res_succ] at h 
     cases' hm with hm hm
     · exact ih h.2 hm
     rw [hm]
@@ -382,7 +382,7 @@ protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + d
 protected theorem eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x = y :=
   by
   rcases eq_or_ne x y with (rfl | h); · rfl
-  simp [dist_eq_of_ne h] at hxy
+  simp [dist_eq_of_ne h] at hxy 
   exact (two_ne_zero (pow_eq_zero hxy)).elim
 #align pi_nat.eq_of_dist_eq_zero PiNat.eq_of_dist_eq_zero
 
@@ -441,17 +441,17 @@ theorem isOpen_cylinder (x : ∀ n, E n) (n : ℕ) : IsOpen (cylinder x n) :=
 
 #print PiNat.isTopologicalBasis_cylinders /-
 theorem isTopologicalBasis_cylinders :
-    IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n)(n : ℕ), s = cylinder x n } :=
+    IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n) (n : ℕ), s = cylinder x n } :=
   by
   apply is_topological_basis_of_open_of_nhds
   · rintro u ⟨x, n, rfl⟩
     apply is_open_cylinder
   · intro x u hx u_open
     obtain ⟨v, ⟨U, F, hUF, rfl⟩, xU, Uu⟩ :
-      ∃ (v : Set (∀ i : ℕ, E i))(H :
+      ∃ (v : Set (∀ i : ℕ, E i)) (H :
         v ∈
           { S : Set (∀ i : ℕ, E i) |
-            ∃ (U : ∀ i : ℕ, Set (E i))(F : Finset ℕ),
+            ∃ (U : ∀ i : ℕ, Set (E i)) (F : Finset ℕ),
               (∀ i : ℕ, i ∈ F → U i ∈ { s : Set (E i) | IsOpen s }) ∧ S = (F : Set ℕ).pi U }),
         x ∈ v ∧ v ⊆ u :=
       (isTopologicalBasis_pi fun n : ℕ => is_topological_basis_opens).exists_subset_of_mem_open hx
@@ -463,7 +463,7 @@ theorem isTopologicalBasis_cylinders :
     intro i hi
     have : y i = x i := mem_cylinder_iff.1 hy i ((hn hi).trans_lt (lt_add_one n))
     rw [this]
-    simp only [Set.mem_pi, Finset.mem_coe] at xU
+    simp only [Set.mem_pi, Finset.mem_coe] at xU 
     exact xU i hi
 #align pi_nat.is_topological_basis_cylinders PiNat.isTopologicalBasis_cylinders
 -/
@@ -476,10 +476,10 @@ theorem isOpen_iff_dist (s : Set (∀ n, E n)) :
   constructor
   · intro hs x hx
     obtain ⟨v, ⟨y, n, rfl⟩, h'x, h's⟩ :
-      ∃ (v : Set (∀ n : ℕ, E n))(H : v ∈ { s | ∃ (x : ∀ n : ℕ, E n)(n : ℕ), s = cylinder x n }),
+      ∃ (v : Set (∀ n : ℕ, E n)) (H : v ∈ { s | ∃ (x : ∀ n : ℕ, E n) (n : ℕ), s = cylinder x n }),
         x ∈ v ∧ v ⊆ s :=
       (is_topological_basis_cylinders E).exists_subset_of_mem_open hx hs
-    rw [← mem_cylinder_iff_eq.1 h'x] at h's
+    rw [← mem_cylinder_iff_eq.1 h'x] at h's 
     exact
       ⟨(1 / 2 : ℝ) ^ n, by simp, fun y hy => h's fun i hi => (apply_eq_of_dist_lt hy hi.le).symm⟩
   · intro h
@@ -531,7 +531,7 @@ protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type _} [∀ n, Unifo
         · simp only [mem_principal, set_of_subset_set_of, imp_self, imp_true_iff]
         · rintro ⟨x, y⟩ hxy
           simp only [Finset.mem_coe, Finset.mem_range, Inter_coe_set, mem_Inter, mem_set_of_eq] at
-            hxy
+            hxy 
           apply lt_of_le_of_lt _ hn
           rw [← mem_cylinder_iff_dist_le, mem_cylinder_iff]
           exact hxy
@@ -591,7 +591,7 @@ theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : 
   apply lt_irrefl (inf_dist x s)
   calc
     inf_dist x s ≤ dist x y := inf_dist_le_dist_of_mem ys
-    _ ≤ (1 / 2) ^ n := by rw [mem_cylinder_comm] at hy; exact mem_cylinder_iff_dist_le.1 hy
+    _ ≤ (1 / 2) ^ n := by rw [mem_cylinder_comm] at hy ; exact mem_cylinder_iff_dist_le.1 hy
     _ < inf_dist x s := hn
     
 #align pi_nat.exists_disjoint_cylinder PiNat.exists_disjoint_cylinder
@@ -655,15 +655,15 @@ theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClo
   have A := exists_disjoint_cylinder hs hx
   have B : longest_prefix x s < shortest_prefix_diff x s :=
     Nat.pred_lt (shortest_prefix_diff_pos hs hne hx).ne'
-  rw [longest_prefix, shortest_prefix_diff, dif_pos A] at B⊢
+  rw [longest_prefix, shortest_prefix_diff, dif_pos A] at B ⊢
   obtain ⟨y, ys, hy⟩ : ∃ y : ∀ n : ℕ, E n, y ∈ s ∧ x ∈ cylinder y (Nat.find A - 1) :=
     by
     have := Nat.find_min A B
-    push_neg  at this
-    simp_rw [not_disjoint_iff, mem_cylinder_comm] at this
+    push_neg  at this 
+    simp_rw [not_disjoint_iff, mem_cylinder_comm] at this 
     exact this
   refine' ⟨y, ys, _⟩
-  rw [mem_cylinder_iff_eq] at hy⊢
+  rw [mem_cylinder_iff_eq] at hy ⊢
   rw [hy]
 #align pi_nat.inter_cylinder_longest_prefix_nonempty PiNat.inter_cylinder_longestPrefix_nonempty
 
@@ -693,8 +693,8 @@ theorem cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff {x y : ∀ n, E
     · have Ax : (s ∩ cylinder x (longest_prefix x s)).Nonempty :=
         inter_cylinder_longest_prefix_nonempty hs hne x
       have Z := disjoint_cylinder_of_longest_prefix_lt hs ys L
-      rw [first_diff_comm] at H
-      rw [cylinder_eq_cylinder_of_le_first_diff _ _ H.le] at Z
+      rw [first_diff_comm] at H 
+      rw [cylinder_eq_cylinder_of_le_first_diff _ _ H.le] at Z 
       exact (Ax.not_disjoint Z).elim
     · exact L
     · have Ay : (s ∩ cylinder y (longest_prefix y s)).Nonempty :=
@@ -702,7 +702,7 @@ theorem cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff {x y : ∀ n, E
       have A'y : (s ∩ cylinder y (longest_prefix x s).succ).Nonempty :=
         Ay.mono (inter_subset_inter_right s (cylinder_anti _ L))
       have Z := disjoint_cylinder_of_longest_prefix_lt hs xs (Nat.lt_succ_self _)
-      rw [cylinder_eq_cylinder_of_le_first_diff _ _ H] at Z
+      rw [cylinder_eq_cylinder_of_le_first_diff _ _ H] at Z 
       exact (A'y.not_disjoint Z).elim
   rw [l_eq, ← mem_cylinder_iff_eq]
   exact cylinder_anti y H.le (mem_cylinder_first_diff x y)
@@ -755,7 +755,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
       simpa [dist_eq_of_ne hxy, dist_eq_of_ne hfxfy]
     -- case where `x ∈ s`
     by_cases xs : x ∈ s
-    · rw [fs x xs] at hfxfy⊢
+    · rw [fs x xs] at hfxfy ⊢
       -- case where `y ∈ s`, trivial
       by_cases ys : y ∈ s;
       · rw [fs y ys]
@@ -769,7 +769,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
         apply cylinder_anti y _ A.some_spec.2
         exact first_diff_le_longest_prefix hs ys xs
       rwa [← fy, ← I2, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy.symm,
-        first_diff_comm _ x] at I
+        first_diff_comm _ x] at I 
     -- case where `x ∉ s`
     · by_cases ys : y ∈ s
       -- case where `y ∈ s` (similar to the above)
@@ -781,8 +781,8 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
           rw [← mem_cylinder_iff_eq]
           apply cylinder_anti x _ A.some_spec.2
           apply first_diff_le_longest_prefix hs xs ys
-        rw [fs y ys] at hfxfy⊢
-        rwa [← fx, I2, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy] at I
+        rw [fs y ys] at hfxfy ⊢
+        rwa [← fx, I2, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy] at I 
       -- case where `y ∉ s`
       · have Ax : (s ∩ cylinder x (longest_prefix x s)).Nonempty :=
           inter_cylinder_longest_prefix_nonempty hs hne x
@@ -798,14 +798,14 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
             cases H
             · exact cylinder_longest_prefix_eq_of_longest_prefix_lt_first_diff hs hne H xs ys
             · symm
-              rw [first_diff_comm] at H
+              rw [first_diff_comm] at H 
               exact cylinder_longest_prefix_eq_of_longest_prefix_lt_first_diff hs hne H ys xs
-          rw [fx, fy] at hfxfy
+          rw [fx, fy] at hfxfy 
           apply (hfxfy _).elim
           congr
         -- case where the common prefix to `x` and `s` is long, as well as the common prefix to
         -- `y` and `s`. Then all points remain in the same cylinders.
-        · push_neg  at H
+        · push_neg  at H 
           have I1 : cylinder Ax.some (first_diff x y) = cylinder x (first_diff x y) :=
             by
             rw [← mem_cylinder_iff_eq]
@@ -816,7 +816,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
             exact cylinder_anti y H.2 Ay.some_spec.2
           have : cylinder Ax.some (first_diff x y) = cylinder Ay.some (first_diff x y) := by
             rw [I1, I2, I3]
-          rw [← fx, ← fy, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy] at this
+          rw [← fx, ← fy, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy] at this 
           exact this
 #align pi_nat.exists_lipschitz_retraction_of_is_closed PiNat.exists_lipschitz_retraction_of_isClosed
 -/
@@ -919,7 +919,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
         
     have L : tendsto (fun n : ℕ => (1 / 2 : ℝ) ^ n + (1 / 2) ^ n) at_top (𝓝 (0 + 0)) :=
       (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1).add (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1)
-    rw [add_zero] at L
+    rw [add_zero] at L 
     exact ge_of_tendsto' L J
   have s_closed : IsClosed s :=
     by
@@ -929,7 +929,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
       by
       have : tendsto (fun n : ℕ => (2 : ℝ) * (1 / 2) ^ n) at_top (𝓝 (2 * 0)) :=
         (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1).const_mul _
-      rw [MulZeroClass.mul_zero] at this
+      rw [MulZeroClass.mul_zero] at this 
       exact
         squeeze_zero (fun n => diam_nonneg) (fun n => diam_closed_ball (pow_nonneg I0.le _)) this
     refine'
@@ -1074,7 +1074,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
         ∃ K : Finset ι, (∑' i : { j // j ∉ K }, (1 / 2 : ℝ) ^ encode (i : ι)) < ε / 2 :=
         ((tendsto_order.1 (tendsto_tsum_compl_atTop_zero fun i : ι => (1 / 2 : ℝ) ^ encode i)).2 _
             (half_pos εpos)).exists
-      obtain ⟨δ, δpos, hδ⟩ : ∃ (δ : ℝ)(δpos : 0 < δ), (K.card : ℝ) * δ ≤ ε / 2 :=
+      obtain ⟨δ, δpos, hδ⟩ : ∃ (δ : ℝ) (δpos : 0 < δ), (K.card : ℝ) * δ ≤ ε / 2 :=
         by
         rcases Nat.eq_zero_or_pos K.card with (hK | hK)
         ·
@@ -1092,7 +1092,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
         refine' mem_infi_of_mem δ (mem_infi_of_mem δpos _)
         simp only [Prod.forall, imp_self, mem_principal]
       · rintro ⟨x, y⟩ hxy
-        simp only [mem_Inter, mem_set_of_eq, SetCoe.forall, Finset.mem_range, Finset.mem_coe] at hxy
+        simp only [mem_Inter, mem_set_of_eq, SetCoe.forall, Finset.mem_range, Finset.mem_coe] at hxy 
         calc
           dist x y = ∑' i : ι, min ((1 / 2) ^ encode i) (dist (x i) (y i)) := rfl
           _ =
Diff
@@ -59,7 +59,7 @@ in general), and `ι` is countable.
 
 noncomputable section
 
-open Classical Topology Filter
+open scoped Classical Topology Filter
 
 open TopologicalSpace Set Metric Filter Function
 
@@ -1003,11 +1003,11 @@ theorem dist_le_dist_pi_of_dist_lt {x y : ∀ i, F i} {i : ι} (h : dist x y < (
   simpa only [not_le.2 h, false_or_iff] using min_le_iff.1 (min_dist_le_dist_pi x y i)
 #align pi_countable.dist_le_dist_pi_of_dist_lt PiCountable.dist_le_dist_pi_of_dist_lt
 
-open BigOperators Topology
+open scoped BigOperators Topology
 
 open Filter
 
-open NNReal
+open scoped NNReal
 
 variable (E)
 
Diff
@@ -111,12 +111,6 @@ theorem firstDiff_comm (x y : ∀ n, E n) : firstDiff x y = firstDiff y x :=
 #align pi_nat.first_diff_comm PiNat.firstDiff_comm
 -/
 
-/- warning: pi_nat.min_first_diff_le -> PiNat.min_firstDiff_le is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), (Ne.{succ u1} (forall (n : Nat), E n) x z) -> (LE.le.{0} Nat Nat.hasLe (LinearOrder.min.{0} Nat Nat.linearOrder (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x y) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) y z)) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x z))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), (Ne.{succ u1} (forall (n : Nat), E n) x z) -> (LE.le.{0} Nat instLENat (Min.min.{0} Nat instMinNat (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x y) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) y z)) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x z))
-Case conversion may be inaccurate. Consider using '#align pi_nat.min_first_diff_le PiNat.min_firstDiff_leₓ'. -/
 theorem min_firstDiff_le (x y z : ∀ n, E n) (h : x ≠ z) :
     min (firstDiff x y) (firstDiff y z) ≤ firstDiff x z :=
   by
@@ -225,12 +219,6 @@ theorem cylinder_eq_cylinder_of_le_firstDiff (x y : ∀ n, E n) {n : ℕ} (hn :
 #align pi_nat.cylinder_eq_cylinder_of_le_first_diff PiNat.cylinder_eq_cylinder_of_le_firstDiff
 -/
 
-/- warning: pi_nat.Union_cylinder_update -> PiNat.iUnion_cylinder_update is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat), Eq.{succ u1} (Set.{u1} (forall (n : Nat), E n)) (Set.iUnion.{u1, succ u1} (forall (n : Nat), E n) (E n) (fun (k : E n) => PiNat.cylinder.{u1} (fun (n : Nat) => E n) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) x n k) (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)))))) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat), Eq.{succ u1} (Set.{u1} (forall (n : Nat), E n)) (Set.iUnion.{u1, succ u1} (forall (n : Nat), E n) (E n) (fun (k : E n) => PiNat.cylinder.{u1} (fun (n : Nat) => E n) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) x n k) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
-Case conversion may be inaccurate. Consider using '#align pi_nat.Union_cylinder_update PiNat.iUnion_cylinder_updateₓ'. -/
 theorem iUnion_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     (⋃ k, cylinder (update x n k) (n + 1)) = cylinder x n :=
   by
@@ -246,12 +234,6 @@ theorem iUnion_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     · simp
 #align pi_nat.Union_cylinder_update PiNat.iUnion_cylinder_update
 
-/- warning: pi_nat.update_mem_cylinder -> PiNat.update_mem_cylinder is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat) (y : E n), Membership.Mem.{u1, u1} (forall (a : Nat), E a) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) x n y) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat) (y : E n), Membership.mem.{u1, u1} (forall (a : Nat), E a) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) x n y) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
-Case conversion may be inaccurate. Consider using '#align pi_nat.update_mem_cylinder PiNat.update_mem_cylinderₓ'. -/
 theorem update_mem_cylinder (x : ∀ n, E n) (n : ℕ) (y : E n) : update x n y ∈ cylinder x n :=
   mem_cylinder_iff.2 fun i hi => by simp [hi.ne]
 #align pi_nat.update_mem_cylinder PiNat.update_mem_cylinder
@@ -357,22 +339,10 @@ protected def dist : Dist (∀ n, E n) :=
 
 attribute [local instance] PiNat.dist
 
-/- warning: pi_nat.dist_eq_of_ne -> PiNat.dist_eq_of_ne is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n}, (Ne.{succ u1} (forall (n : Nat), E n) x y) -> (Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x y)))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n}, (Ne.{succ u1} (forall (n : Nat), E n) x y) -> (Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x y)))
-Case conversion may be inaccurate. Consider using '#align pi_nat.dist_eq_of_ne PiNat.dist_eq_of_neₓ'. -/
 theorem dist_eq_of_ne {x y : ∀ n, E n} (h : x ≠ y) : dist x y = (1 / 2 : ℝ) ^ firstDiff x y := by
   simp [dist, h]
 #align pi_nat.dist_eq_of_ne PiNat.dist_eq_of_ne
 
-/- warning: pi_nat.dist_self -> PiNat.dist_self is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n), Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x x) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n), Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x x) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))
-Case conversion may be inaccurate. Consider using '#align pi_nat.dist_self PiNat.dist_selfₓ'. -/
 protected theorem dist_self (x : ∀ n, E n) : dist x x = 0 := by simp [dist]
 #align pi_nat.dist_self PiNat.dist_self
 
@@ -382,12 +352,6 @@ protected theorem dist_comm (x y : ∀ n, E n) : dist x y = dist y x := by
 #align pi_nat.dist_comm PiNat.dist_comm
 -/
 
-/- warning: pi_nat.dist_nonneg -> PiNat.dist_nonneg is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), LE.le.{0} Real Real.hasLe (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero))) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y)
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), LE.le.{0} Real Real.instLEReal (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal)) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y)
-Case conversion may be inaccurate. Consider using '#align pi_nat.dist_nonneg PiNat.dist_nonnegₓ'. -/
 protected theorem dist_nonneg (x y : ∀ n, E n) : 0 ≤ dist x y :=
   by
   rcases eq_or_ne x y with (rfl | h)
@@ -395,12 +359,6 @@ protected theorem dist_nonneg (x y : ∀ n, E n) : 0 ≤ dist x y :=
   · simp [dist, h]
 #align pi_nat.dist_nonneg PiNat.dist_nonneg
 
-/- warning: pi_nat.dist_triangle_nonarch -> PiNat.dist_triangle_nonarch is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), LE.le.{0} Real Real.hasLe (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x z) (LinearOrder.max.{0} Real Real.linearOrder (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y z))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x z) (Max.max.{0} Real (LinearOrderedRing.toMax.{0} Real Real.instLinearOrderedRingReal) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y z))
-Case conversion may be inaccurate. Consider using '#align pi_nat.dist_triangle_nonarch PiNat.dist_triangle_nonarchₓ'. -/
 theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y) (dist y z) :=
   by
   rcases eq_or_ne x z with (rfl | hxz)
@@ -414,12 +372,6 @@ theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y)
     min_le_iff.1 (min_first_diff_le x y z hxz)]
 #align pi_nat.dist_triangle_nonarch PiNat.dist_triangle_nonarch
 
-/- warning: pi_nat.dist_triangle -> PiNat.dist_triangle is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), LE.le.{0} Real Real.hasLe (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x z) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y z))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x z) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y z))
-Case conversion may be inaccurate. Consider using '#align pi_nat.dist_triangle PiNat.dist_triangleₓ'. -/
 protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + dist y z :=
   calc
     dist x z ≤ max (dist x y) (dist y z) := dist_triangle_nonarch x y z
@@ -427,12 +379,6 @@ protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + d
     
 #align pi_nat.dist_triangle PiNat.dist_triangle
 
-/- warning: pi_nat.eq_of_dist_eq_zero -> PiNat.eq_of_dist_eq_zero is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), (Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Eq.{succ u1} (forall (n : Nat), E n) x y)
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), (Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Eq.{succ u1} (forall (n : Nat), E n) x y)
-Case conversion may be inaccurate. Consider using '#align pi_nat.eq_of_dist_eq_zero PiNat.eq_of_dist_eq_zeroₓ'. -/
 protected theorem eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x = y :=
   by
   rcases eq_or_ne x y with (rfl | h); · rfl
@@ -440,12 +386,6 @@ protected theorem eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x
   exact (two_ne_zero (pow_eq_zero hxy)).elim
 #align pi_nat.eq_of_dist_eq_zero PiNat.eq_of_dist_eq_zero
 
-/- warning: pi_nat.mem_cylinder_iff_dist_le -> PiNat.mem_cylinder_iff_dist_le is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n} {n : Nat}, Iff (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) y (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)) (LE.le.{0} Real Real.hasLe (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y x) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) n))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n} {n : Nat}, Iff (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) y (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)) (LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y x) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) n))
-Case conversion may be inaccurate. Consider using '#align pi_nat.mem_cylinder_iff_dist_le PiNat.mem_cylinder_iff_dist_leₓ'. -/
 theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
     y ∈ cylinder x n ↔ dist y x ≤ (1 / 2) ^ n :=
   by
@@ -459,12 +399,6 @@ theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
     exact apply_eq_of_lt_first_diff (hi.trans_le h)
 #align pi_nat.mem_cylinder_iff_dist_le PiNat.mem_cylinder_iff_dist_le
 
-/- warning: pi_nat.apply_eq_of_dist_lt -> PiNat.apply_eq_of_dist_lt is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n} {n : Nat}, (LT.lt.{0} Real Real.hasLt (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) n)) -> (forall {i : Nat}, (LE.le.{0} Nat Nat.hasLe i n) -> (Eq.{succ u1} (E i) (x i) (y i)))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n} {n : Nat}, (LT.lt.{0} Real Real.instLTReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) n)) -> (forall {i : Nat}, (LE.le.{0} Nat instLENat i n) -> (Eq.{succ u1} (E i) (x i) (y i)))
-Case conversion may be inaccurate. Consider using '#align pi_nat.apply_eq_of_dist_lt PiNat.apply_eq_of_dist_ltₓ'. -/
 theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2) ^ n) {i : ℕ}
     (hi : i ≤ n) : x i = y i :=
   by
@@ -474,12 +408,6 @@ theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2)
   exact apply_eq_of_lt_first_diff (hi.trans_lt this)
 #align pi_nat.apply_eq_of_dist_lt PiNat.apply_eq_of_dist_lt
 
-/- warning: pi_nat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder -> PiNat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} {α : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u2} α] {f : (forall (n : Nat), E n) -> α}, Iff (forall (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), LE.le.{0} Real Real.hasLe (Dist.dist.{u2} α (PseudoMetricSpace.toHasDist.{u2} α _inst_1) (f x) (f y)) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y)) (forall (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (n : Nat), (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) y (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)) -> (LE.le.{0} Real Real.hasLe (Dist.dist.{u2} α (PseudoMetricSpace.toHasDist.{u2} α _inst_1) (f x) (f y)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) n)))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} {α : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u2} α] {f : (forall (n : Nat), E n) -> α}, Iff (forall (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), LE.le.{0} Real Real.instLEReal (Dist.dist.{u2} α (PseudoMetricSpace.toDist.{u2} α _inst_1) (f x) (f y)) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y)) (forall (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (n : Nat), (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) y (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)) -> (LE.le.{0} Real Real.instLEReal (Dist.dist.{u2} α (PseudoMetricSpace.toDist.{u2} α _inst_1) (f x) (f y)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) n)))
-Case conversion may be inaccurate. Consider using '#align pi_nat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder PiNat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinderₓ'. -/
 /-- A function to a pseudo-metric-space is `1`-Lipschitz if and only if points in the same cylinder
 of length `n` are sent to points within distance `(1/2)^n`.
 Not expressed using `lipschitz_with` as we don't have a metric space structure -/
@@ -542,12 +470,6 @@ theorem isTopologicalBasis_cylinders :
 
 variable {E}
 
-/- warning: pi_nat.is_open_iff_dist -> PiNat.isOpen_iff_dist is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] (s : Set.{u1} (forall (n : Nat), E n)), Iff (IsOpen.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) (forall (x : forall (n : Nat), E n), (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) 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 : forall (n : Nat), E n), (LT.lt.{0} Real Real.hasLt (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) ε) -> (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) y s)))))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] (s : Set.{u1} (forall (n : Nat), E n)), Iff (IsOpen.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) (forall (x : forall (n : Nat), E n), (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) 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 : forall (n : Nat), E n), (LT.lt.{0} Real Real.instLTReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) ε) -> (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) y s)))))
-Case conversion may be inaccurate. Consider using '#align pi_nat.is_open_iff_dist PiNat.isOpen_iff_distₓ'. -/
 theorem isOpen_iff_dist (s : Set (∀ n, E n)) :
     IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s :=
   by
@@ -657,12 +579,6 @@ where `z_w` is an element of `s` starting with `w`.
 -/
 
 
-/- warning: pi_nat.exists_disjoint_cylinder -> PiNat.exists_disjoint_cylinder is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (forall {x : forall (n : Nat), E n}, (Not (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) x s)) -> (Exists.{1} Nat (fun (n : Nat) => Disjoint.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.completeBooleanAlgebra.{u1} (forall (n : Nat), E n))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} (forall (n : Nat), E n)) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.booleanAlgebra.{u1} (forall (n : Nat), E n)))) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n))))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (forall {x : forall (n : Nat), E n}, (Not (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) x s)) -> (Exists.{1} Nat (fun (n : Nat) => Disjoint.{u1} (Set.{u1} (forall (n : Nat), E n)) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} (forall (n : Nat), E n)) (Preorder.toLE.{u1} (Set.{u1} (forall (n : Nat), E n)) (PartialOrder.toPreorder.{u1} (Set.{u1} (forall (n : Nat), E n)) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n))))
-Case conversion may be inaccurate. Consider using '#align pi_nat.exists_disjoint_cylinder PiNat.exists_disjoint_cylinderₓ'. -/
 theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : ∀ n, E n}
     (hx : x ∉ s) : ∃ n, Disjoint s (cylinder x n) :=
   by
@@ -732,12 +648,6 @@ theorem firstDiff_le_longestPrefix {s : Set (∀ n, E n)} (hs : IsClosed s) {x y
 #align pi_nat.first_diff_le_longest_prefix PiNat.firstDiff_le_longestPrefix
 -/
 
-/- warning: pi_nat.inter_cylinder_longest_prefix_nonempty -> PiNat.inter_cylinder_longestPrefix_nonempty is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (Set.Nonempty.{u1} (forall (n : Nat), E n) s) -> (forall (x : forall (n : Nat), E n), Set.Nonempty.{u1} (forall (n : Nat), E n) (Inter.inter.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.hasInter.{u1} (forall (n : Nat), E n)) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x (PiNat.longestPrefix.{u1} (fun (n : Nat) => E n) x s))))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (Set.Nonempty.{u1} (forall (n : Nat), E n) s) -> (forall (x : forall (n : Nat), E n), Set.Nonempty.{u1} (forall (n : Nat), E n) (Inter.inter.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instInterSet.{u1} (forall (n : Nat), E n)) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x (PiNat.longestPrefix.{u1} (fun (n : Nat) => E n) x s))))
-Case conversion may be inaccurate. Consider using '#align pi_nat.inter_cylinder_longest_prefix_nonempty PiNat.inter_cylinder_longestPrefix_nonemptyₓ'. -/
 theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClosed s)
     (hne : s.Nonempty) (x : ∀ n, E n) : (s ∩ cylinder x (longestPrefix x s)).Nonempty :=
   by
@@ -757,12 +667,6 @@ theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClo
   rw [hy]
 #align pi_nat.inter_cylinder_longest_prefix_nonempty PiNat.inter_cylinder_longestPrefix_nonempty
 
-/- warning: pi_nat.disjoint_cylinder_of_longest_prefix_lt -> PiNat.disjoint_cylinder_of_longestPrefix_lt is a dubious translation:
-lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (forall {x : forall (n : Nat), E n}, (Not (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) x s)) -> (forall {n : Nat}, (LT.lt.{0} Nat Nat.hasLt (PiNat.longestPrefix.{u1} (fun (n : Nat) => E n) x s) n) -> (Disjoint.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.completeBooleanAlgebra.{u1} (forall (n : Nat), E n))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} (forall (n : Nat), E n)) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.booleanAlgebra.{u1} (forall (n : Nat), E n)))) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n))))
-but is expected to have type
-  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (forall {x : forall (n : Nat), E n}, (Not (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) x s)) -> (forall {n : Nat}, (LT.lt.{0} Nat instLTNat (PiNat.longestPrefix.{u1} (fun (n : Nat) => E n) x s) n) -> (Disjoint.{u1} (Set.{u1} (forall (n : Nat), E n)) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} (forall (n : Nat), E n)) (Preorder.toLE.{u1} (Set.{u1} (forall (n : Nat), E n)) (PartialOrder.toPreorder.{u1} (Set.{u1} (forall (n : Nat), E n)) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n))))
-Case conversion may be inaccurate. Consider using '#align pi_nat.disjoint_cylinder_of_longest_prefix_lt PiNat.disjoint_cylinder_of_longestPrefix_ltₓ'. -/
 theorem disjoint_cylinder_of_longestPrefix_lt {s : Set (∀ n, E n)} (hs : IsClosed s) {x : ∀ n, E n}
     (hx : x ∉ s) {n : ℕ} (hn : longestPrefix x s < n) : Disjoint s (cylinder x n) :=
   by
@@ -949,12 +853,6 @@ end PiNat
 
 open PiNat
 
-/- warning: exists_nat_nat_continuous_surjective_of_complete_space -> exists_nat_nat_continuous_surjective_of_completeSpace is a dubious translation:
-lean 3 declaration is
-  forall (α : Type.{u1}) [_inst_1 : MetricSpace.{u1} α] [_inst_2 : CompleteSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1))] [_inst_3 : TopologicalSpace.SecondCountableTopology.{u1} α (UniformSpace.toTopologicalSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1)))] [_inst_4 : Nonempty.{succ u1} α], Exists.{succ u1} ((Nat -> Nat) -> α) (fun (f : (Nat -> Nat) -> α) => And (Continuous.{0, u1} (Nat -> Nat) α (Pi.topologicalSpace.{0, 0} Nat (fun (ᾰ : Nat) => Nat) (fun (a : Nat) => Nat.topologicalSpace)) (UniformSpace.toTopologicalSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1))) f) (Function.Surjective.{1, succ u1} (Nat -> Nat) α f))
-but is expected to have type
-  forall (α : Type.{u1}) [_inst_1 : MetricSpace.{u1} α] [_inst_2 : CompleteSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1))] [_inst_3 : TopologicalSpace.SecondCountableTopology.{u1} α (UniformSpace.toTopologicalSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1)))] [_inst_4 : Nonempty.{succ u1} α], Exists.{succ u1} ((Nat -> Nat) -> α) (fun (f : (Nat -> Nat) -> α) => And (Continuous.{0, u1} (Nat -> Nat) α (Pi.topologicalSpace.{0, 0} Nat (fun (ᾰ : Nat) => Nat) (fun (a : Nat) => instTopologicalSpaceNat)) (UniformSpace.toTopologicalSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1))) f) (Function.Surjective.{1, succ u1} (Nat -> Nat) α f))
-Case conversion may be inaccurate. Consider using '#align exists_nat_nat_continuous_surjective_of_complete_space exists_nat_nat_continuous_surjective_of_completeSpaceₓ'. -/
 /-- Any nonempty complete second countable metric space is the continuous image of the
 fundamental space `ℕ → ℕ`. For a version of this theorem in the context of Polish spaces, see
 `exists_nat_nat_continuous_surjective_of_polish_space`. -/
@@ -1082,23 +980,11 @@ protected def dist : Dist (∀ i, F i) :=
 
 attribute [local instance] PiCountable.dist
 
-/- warning: pi_countable.dist_eq_tsum -> PiCountable.dist_eq_tsum is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} [_inst_1 : Encodable.{u1} ι] {F : ι -> Type.{u2}} [_inst_2 : forall (i : ι), MetricSpace.{u2} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i), Eq.{1} Real (Dist.dist.{max u1 u2} (forall (i : ι), F i) (PiCountable.dist.{u1, u2} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y) (tsum.{0, u1} Real Real.addCommMonoid (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) ι (fun (i : ι) => LinearOrder.min.{0} Real Real.linearOrder (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (Encodable.encode.{u1} ι _inst_1 i)) (Dist.dist.{u2} (F i) (PseudoMetricSpace.toHasDist.{u2} (F i) (MetricSpace.toPseudoMetricSpace.{u2} (F i) (_inst_2 i))) (x i) (y i))))
-but is expected to have type
-  forall {ι : Type.{u2}} [_inst_1 : Encodable.{u2} ι] {F : ι -> Type.{u1}} [_inst_2 : forall (i : ι), MetricSpace.{u1} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i), Eq.{1} Real (Dist.dist.{max u2 u1} (forall (i : ι), F i) (PiCountable.dist.{u2, u1} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y) (tsum.{0, u2} Real Real.instAddCommMonoidReal (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) ι (fun (i : ι) => Min.min.{0} Real (LinearOrderedRing.toMin.{0} Real Real.instLinearOrderedRingReal) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (Encodable.encode.{u2} ι _inst_1 i)) (Dist.dist.{u1} (F i) (PseudoMetricSpace.toDist.{u1} (F i) (MetricSpace.toPseudoMetricSpace.{u1} (F i) (_inst_2 i))) (x i) (y i))))
-Case conversion may be inaccurate. Consider using '#align pi_countable.dist_eq_tsum PiCountable.dist_eq_tsumₓ'. -/
 theorem dist_eq_tsum (x y : ∀ i, F i) :
     dist x y = ∑' i : ι, min ((1 / 2) ^ encode i) (dist (x i) (y i)) :=
   rfl
 #align pi_countable.dist_eq_tsum PiCountable.dist_eq_tsum
 
-/- warning: pi_countable.dist_summable -> PiCountable.dist_summable is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} [_inst_1 : Encodable.{u1} ι] {F : ι -> Type.{u2}} [_inst_2 : forall (i : ι), MetricSpace.{u2} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i), Summable.{0, u1} Real ι Real.addCommMonoid (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (fun (i : ι) => LinearOrder.min.{0} Real Real.linearOrder (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (Encodable.encode.{u1} ι _inst_1 i)) (Dist.dist.{u2} (F i) (PseudoMetricSpace.toHasDist.{u2} (F i) (MetricSpace.toPseudoMetricSpace.{u2} (F i) (_inst_2 i))) (x i) (y i)))
-but is expected to have type
-  forall {ι : Type.{u2}} [_inst_1 : Encodable.{u2} ι] {F : ι -> Type.{u1}} [_inst_2 : forall (i : ι), MetricSpace.{u1} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i), Summable.{0, u2} Real ι Real.instAddCommMonoidReal (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (fun (i : ι) => Min.min.{0} Real (LinearOrderedRing.toMin.{0} Real Real.instLinearOrderedRingReal) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (Encodable.encode.{u2} ι _inst_1 i)) (Dist.dist.{u1} (F i) (PseudoMetricSpace.toDist.{u1} (F i) (MetricSpace.toPseudoMetricSpace.{u1} (F i) (_inst_2 i))) (x i) (y i)))
-Case conversion may be inaccurate. Consider using '#align pi_countable.dist_summable PiCountable.dist_summableₓ'. -/
 theorem dist_summable (x y : ∀ i, F i) :
     Summable fun i : ι => min ((1 / 2) ^ encode i) (dist (x i) (y i)) :=
   by
@@ -1107,23 +993,11 @@ theorem dist_summable (x y : ∀ i, F i) :
   exact le_min (pow_nonneg (by norm_num) _) dist_nonneg
 #align pi_countable.dist_summable PiCountable.dist_summable
 
-/- warning: pi_countable.min_dist_le_dist_pi -> PiCountable.min_dist_le_dist_pi is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} [_inst_1 : Encodable.{u1} ι] {F : ι -> Type.{u2}} [_inst_2 : forall (i : ι), MetricSpace.{u2} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i) (i : ι), LE.le.{0} Real Real.hasLe (LinearOrder.min.{0} Real Real.linearOrder (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (Encodable.encode.{u1} ι _inst_1 i)) (Dist.dist.{u2} (F i) (PseudoMetricSpace.toHasDist.{u2} (F i) (MetricSpace.toPseudoMetricSpace.{u2} (F i) (_inst_2 i))) (x i) (y i))) (Dist.dist.{max u1 u2} (forall (i : ι), F i) (PiCountable.dist.{u1, u2} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y)
-but is expected to have type
-  forall {ι : Type.{u2}} [_inst_1 : Encodable.{u2} ι] {F : ι -> Type.{u1}} [_inst_2 : forall (i : ι), MetricSpace.{u1} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i) (i : ι), LE.le.{0} Real Real.instLEReal (Min.min.{0} Real (LinearOrderedRing.toMin.{0} Real Real.instLinearOrderedRingReal) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (Encodable.encode.{u2} ι _inst_1 i)) (Dist.dist.{u1} (F i) (PseudoMetricSpace.toDist.{u1} (F i) (MetricSpace.toPseudoMetricSpace.{u1} (F i) (_inst_2 i))) (x i) (y i))) (Dist.dist.{max u2 u1} (forall (i : ι), F i) (PiCountable.dist.{u2, u1} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y)
-Case conversion may be inaccurate. Consider using '#align pi_countable.min_dist_le_dist_pi PiCountable.min_dist_le_dist_piₓ'. -/
 theorem min_dist_le_dist_pi (x y : ∀ i, F i) (i : ι) :
     min ((1 / 2) ^ encode i) (dist (x i) (y i)) ≤ dist x y :=
   le_tsum (dist_summable x y) i fun j hj => le_min (by simp) dist_nonneg
 #align pi_countable.min_dist_le_dist_pi PiCountable.min_dist_le_dist_pi
 
-/- warning: pi_countable.dist_le_dist_pi_of_dist_lt -> PiCountable.dist_le_dist_pi_of_dist_lt is a dubious translation:
-lean 3 declaration is
-  forall {ι : Type.{u1}} [_inst_1 : Encodable.{u1} ι] {F : ι -> Type.{u2}} [_inst_2 : forall (i : ι), MetricSpace.{u2} (F i)] {x : forall (i : ι), F i} {y : forall (i : ι), F i} {i : ι}, (LT.lt.{0} Real Real.hasLt (Dist.dist.{max u1 u2} (forall (i : ι), F i) (PiCountable.dist.{u1, u2} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (Encodable.encode.{u1} ι _inst_1 i))) -> (LE.le.{0} Real Real.hasLe (Dist.dist.{u2} (F i) (PseudoMetricSpace.toHasDist.{u2} (F i) (MetricSpace.toPseudoMetricSpace.{u2} (F i) (_inst_2 i))) (x i) (y i)) (Dist.dist.{max u1 u2} (forall (i : ι), F i) (PiCountable.dist.{u1, u2} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y))
-but is expected to have type
-  forall {ι : Type.{u2}} [_inst_1 : Encodable.{u2} ι] {F : ι -> Type.{u1}} [_inst_2 : forall (i : ι), MetricSpace.{u1} (F i)] {x : forall (i : ι), F i} {y : forall (i : ι), F i} {i : ι}, (LT.lt.{0} Real Real.instLTReal (Dist.dist.{max u2 u1} (forall (i : ι), F i) (PiCountable.dist.{u2, u1} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (Encodable.encode.{u2} ι _inst_1 i))) -> (LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} (F i) (PseudoMetricSpace.toDist.{u1} (F i) (MetricSpace.toPseudoMetricSpace.{u1} (F i) (_inst_2 i))) (x i) (y i)) (Dist.dist.{max u2 u1} (forall (i : ι), F i) (PiCountable.dist.{u2, u1} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y))
-Case conversion may be inaccurate. Consider using '#align pi_countable.dist_le_dist_pi_of_dist_lt PiCountable.dist_le_dist_pi_of_dist_ltₓ'. -/
 theorem dist_le_dist_pi_of_dist_lt {x y : ∀ i, F i} {i : ι} (h : dist x y < (1 / 2) ^ encode i) :
     dist (x i) (y i) ≤ dist x y := by
   simpa only [not_le.2 h, false_or_iff] using min_le_iff.1 (min_dist_le_dist_pi x y i)
Diff
@@ -145,10 +145,7 @@ def cylinder (x : ∀ n, E n) (n : ℕ) : Set (∀ n, E n) :=
 
 #print PiNat.cylinder_eq_pi /-
 theorem cylinder_eq_pi (x : ∀ n, E n) (n : ℕ) :
-    cylinder x n = Set.pi (Finset.range n : Set ℕ) fun i : ℕ => {x i} :=
-  by
-  ext y
-  simp [cylinder]
+    cylinder x n = Set.pi (Finset.range n : Set ℕ) fun i : ℕ => {x i} := by ext y; simp [cylinder]
 #align pi_nat.cylinder_eq_pi PiNat.cylinder_eq_pi
 -/
 
@@ -452,8 +449,7 @@ Case conversion may be inaccurate. Consider using '#align pi_nat.mem_cylinder_if
 theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
     y ∈ cylinder x n ↔ dist y x ≤ (1 / 2) ^ n :=
   by
-  rcases eq_or_ne y x with (rfl | hne)
-  · simp [PiNat.dist_self]
+  rcases eq_or_ne y x with (rfl | hne); · simp [PiNat.dist_self]
   suffices (∀ i : ℕ, i < n → y i = x i) ↔ n ≤ first_diff y x by simpa [dist_eq_of_ne hne]
   constructor
   · intro hy
@@ -472,8 +468,7 @@ Case conversion may be inaccurate. Consider using '#align pi_nat.apply_eq_of_dis
 theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2) ^ n) {i : ℕ}
     (hi : i ≤ n) : x i = y i :=
   by
-  rcases eq_or_ne x y with (rfl | hne)
-  · rfl
+  rcases eq_or_ne x y with (rfl | hne); · rfl
   have : n < first_diff x y := by
     simpa [dist_eq_of_ne hne, inv_lt_inv, pow_lt_pow_iff, one_lt_two] using h
   exact apply_eq_of_lt_first_diff (hi.trans_lt this)
@@ -499,8 +494,7 @@ theorem lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type _
     rw [PiNat.dist_comm]
     exact mem_cylinder_iff_dist_le.1 hxy
   · intro H x y
-    rcases eq_or_ne x y with (rfl | hne)
-    · simp [PiNat.dist_nonneg]
+    rcases eq_or_ne x y with (rfl | hne); · simp [PiNat.dist_nonneg]
     rw [dist_eq_of_ne hne]
     apply H x y (first_diff x y)
     rw [first_diff_comm]
@@ -681,9 +675,7 @@ theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : 
   apply lt_irrefl (inf_dist x s)
   calc
     inf_dist x s ≤ dist x y := inf_dist_le_dist_of_mem ys
-    _ ≤ (1 / 2) ^ n := by
-      rw [mem_cylinder_comm] at hy
-      exact mem_cylinder_iff_dist_le.1 hy
+    _ ≤ (1 / 2) ^ n := by rw [mem_cylinder_comm] at hy; exact mem_cylinder_iff_dist_le.1 hy
     _ < inf_dist x s := hn
     
 #align pi_nat.exists_disjoint_cylinder PiNat.exists_disjoint_cylinder
@@ -749,8 +741,7 @@ Case conversion may be inaccurate. Consider using '#align pi_nat.inter_cylinder_
 theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClosed s)
     (hne : s.Nonempty) (x : ∀ n, E n) : (s ∩ cylinder x (longestPrefix x s)).Nonempty :=
   by
-  by_cases hx : x ∈ s
-  · exact ⟨x, hx, self_mem_cylinder _ _⟩
+  by_cases hx : x ∈ s; · exact ⟨x, hx, self_mem_cylinder _ _⟩
   have A := exists_disjoint_cylinder hs hx
   have B : longest_prefix x s < shortest_prefix_diff x s :=
     Nat.pred_lt (shortest_prefix_diff_pos hs hne hx).ne'
@@ -841,8 +832,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
   -- check that the range of `f` is `s`.
   · apply subset.antisymm
     · rintro x ⟨y, rfl⟩
-      by_cases hy : y ∈ s
-      · rwa [fs y hy]
+      by_cases hy : y ∈ s; · rwa [fs y hy]
       simpa [hf, if_neg hy] using (inter_cylinder_longest_prefix_nonempty hs hne y).choose_spec.1
     · intro x hx
       rw [← fs x hx]
@@ -850,10 +840,9 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
   -- check that `f` is `1`-Lipschitz, by a case analysis.
   · apply LipschitzWith.mk_one fun x y => _
     -- exclude the trivial cases where `x = y`, or `f x = f y`.
-    rcases eq_or_ne x y with (rfl | hxy)
+    rcases eq_or_ne x y with (rfl | hxy);
     · simp
-    rcases eq_or_ne (f x) (f y) with (h' | hfxfy)
-    · simp [h', dist_nonneg]
+    rcases eq_or_ne (f x) (f y) with (h' | hfxfy); · simp [h', dist_nonneg]
     have I2 : cylinder x (first_diff x y) = cylinder y (first_diff x y) :=
       by
       rw [← mem_cylinder_iff_eq]
@@ -864,7 +853,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
     by_cases xs : x ∈ s
     · rw [fs x xs] at hfxfy⊢
       -- case where `y ∈ s`, trivial
-      by_cases ys : y ∈ s
+      by_cases ys : y ∈ s;
       · rw [fs y ys]
       -- case where `y ∉ s`
       have A : (s ∩ cylinder y (longest_prefix y s)).Nonempty :=
@@ -991,8 +980,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
     by
     apply continuous_iff_continuousAt.2 fun y => _
     apply continuousAt_of_locally_lipschitz zero_lt_one 4 fun x hxy => _
-    rcases eq_or_ne x y with (rfl | hne)
-    · simp
+    rcases eq_or_ne x y with (rfl | hne); · simp
     have hne' : x.1 ≠ y.1 := subtype.coe_injective.ne hne
     have dist' : dist x y = dist x.1 y.1 := rfl
     let n := first_diff x.1 y.1 - 1
Diff
@@ -228,13 +228,13 @@ theorem cylinder_eq_cylinder_of_le_firstDiff (x y : ∀ n, E n) {n : ℕ} (hn :
 #align pi_nat.cylinder_eq_cylinder_of_le_first_diff PiNat.cylinder_eq_cylinder_of_le_firstDiff
 -/
 
-/- warning: pi_nat.Union_cylinder_update -> PiNat.unionᵢ_cylinder_update is a dubious translation:
+/- warning: pi_nat.Union_cylinder_update -> PiNat.iUnion_cylinder_update is a dubious translation:
 lean 3 declaration is
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat), Eq.{succ u1} (Set.{u1} (forall (n : Nat), E n)) (Set.unionᵢ.{u1, succ u1} (forall (n : Nat), E n) (E n) (fun (k : E n) => PiNat.cylinder.{u1} (fun (n : Nat) => E n) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) x n k) (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)))))) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat), Eq.{succ u1} (Set.{u1} (forall (n : Nat), E n)) (Set.iUnion.{u1, succ u1} (forall (n : Nat), E n) (E n) (fun (k : E n) => PiNat.cylinder.{u1} (fun (n : Nat) => E n) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) x n k) (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)))))) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
 but is expected to have type
-  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat), Eq.{succ u1} (Set.{u1} (forall (n : Nat), E n)) (Set.unionᵢ.{u1, succ u1} (forall (n : Nat), E n) (E n) (fun (k : E n) => PiNat.cylinder.{u1} (fun (n : Nat) => E n) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) x n k) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
-Case conversion may be inaccurate. Consider using '#align pi_nat.Union_cylinder_update PiNat.unionᵢ_cylinder_updateₓ'. -/
-theorem unionᵢ_cylinder_update (x : ∀ n, E n) (n : ℕ) :
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat), Eq.{succ u1} (Set.{u1} (forall (n : Nat), E n)) (Set.iUnion.{u1, succ u1} (forall (n : Nat), E n) (E n) (fun (k : E n) => PiNat.cylinder.{u1} (fun (n : Nat) => E n) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) x n k) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
+Case conversion may be inaccurate. Consider using '#align pi_nat.Union_cylinder_update PiNat.iUnion_cylinder_updateₓ'. -/
+theorem iUnion_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     (⋃ k, cylinder (update x n k) (n + 1)) = cylinder x n :=
   by
   ext y
@@ -247,7 +247,7 @@ theorem unionᵢ_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     rcases Nat.lt_succ_iff_lt_or_eq.1 hi with (h'i | rfl)
     · simp [H i h'i, h'i.ne]
     · simp
-#align pi_nat.Union_cylinder_update PiNat.unionᵢ_cylinder_update
+#align pi_nat.Union_cylinder_update PiNat.iUnion_cylinder_update
 
 /- warning: pi_nat.update_mem_cylinder -> PiNat.update_mem_cylinder is a dubious translation:
 lean 3 declaration is
@@ -606,7 +606,7 @@ protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type _} [∀ n, Unifo
       simp [Pi.uniformity, comap_infi, gt_iff_lt, preimage_set_of_eq, comap_principal,
         PseudoMetricSpace.uniformity_dist, h, idRel]
       apply le_antisymm
-      · simp only [le_infᵢ_iff, le_principal_iff]
+      · simp only [le_iInf_iff, le_principal_iff]
         intro ε εpos
         obtain ⟨n, hn⟩ : ∃ n, (1 / 2 : ℝ) ^ n < ε := exists_pow_lt_of_lt_one εpos (by norm_num)
         apply
@@ -619,7 +619,7 @@ protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type _} [∀ n, Unifo
           apply lt_of_le_of_lt _ hn
           rw [← mem_cylinder_iff_dist_le, mem_cylinder_iff]
           exact hxy
-      · simp only [le_infᵢ_iff, le_principal_iff]
+      · simp only [le_iInf_iff, le_principal_iff]
         intro n
         refine' mem_infi_of_mem ((1 / 2) ^ n) _
         refine' mem_infi_of_mem (by positivity) _
@@ -1206,7 +1206,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
     simp only [Pi.uniformity, comap_infi, gt_iff_lt, preimage_set_of_eq, comap_principal,
       PseudoMetricSpace.uniformity_dist]
     apply le_antisymm
-    · simp only [le_infᵢ_iff, le_principal_iff]
+    · simp only [le_iInf_iff, le_principal_iff]
       intro ε εpos
       obtain ⟨K, hK⟩ :
         ∃ K : Finset ι, (∑' i : { j // j ∉ K }, (1 / 2 : ℝ) ^ encode (i : ι)) < ε / 2 :=
@@ -1253,7 +1253,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
             (add_le_add_right (by simpa only [Finset.sum_const, nsmul_eq_mul] using hδ) _)
           _ = ε := add_halves _
           
-    · simp only [le_infᵢ_iff, le_principal_iff]
+    · simp only [le_iInf_iff, le_principal_iff]
       intro i ε εpos
       refine' mem_infi_of_mem (min ((1 / 2) ^ encode i) ε) _
       have : 0 < min ((1 / 2) ^ encode i) ε := lt_min (by simp) εpos
Diff
@@ -266,6 +266,7 @@ variable {α : Type _}
 open List
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print PiNat.res /-
 /-- In the case where `E` has constant value `α`,
 the cylinder `cylinder x n` can be identified with the element of `list α`
 consisting of the first `n` entries of `x`. See `cylinder_eq_res`.
@@ -274,22 +275,30 @@ def res (x : ℕ → α) : ℕ → List α
   | 0 => nil
   | Nat.succ n => x n::res n
 #align pi_nat.res PiNat.res
+-/
 
+#print PiNat.res_zero /-
 @[simp]
 theorem res_zero (x : ℕ → α) : res x 0 = @nil α :=
   rfl
 #align pi_nat.res_zero PiNat.res_zero
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print PiNat.res_succ /-
 @[simp]
 theorem res_succ (x : ℕ → α) (n : ℕ) : res x n.succ = x n::res x n :=
   rfl
 #align pi_nat.res_succ PiNat.res_succ
+-/
 
+#print PiNat.res_length /-
 @[simp]
 theorem res_length (x : ℕ → α) (n : ℕ) : (res x n).length = n := by induction n <;> simp [*]
 #align pi_nat.res_length PiNat.res_length
+-/
 
+#print PiNat.res_eq_res /-
 /-- The restrictions of `x` and `y` to `n` are equal if and only if `x m = y m` for all `m < n`.-/
 theorem res_eq_res {x y : ℕ → α} {n : ℕ} : res x n = res y n ↔ ∀ ⦃m⦄, m < n → x m = y m :=
   by
@@ -306,7 +315,9 @@ theorem res_eq_res {x y : ℕ → α} {n : ℕ} : res x n = res y n ↔ ∀ ⦃m
   refine' ⟨h (Nat.lt_succ_self _), ih fun m hm => _⟩
   exact h (hm.trans (Nat.lt_succ_self _))
 #align pi_nat.res_eq_res PiNat.res_eq_res
+-/
 
+#print PiNat.res_injective /-
 theorem res_injective : Injective (@res α) :=
   by
   intro x y h
@@ -314,7 +325,9 @@ theorem res_injective : Injective (@res α) :=
   apply res_eq_res.mp _ (Nat.lt_succ_self _)
   rw [h]
 #align pi_nat.res_injective PiNat.res_injective
+-/
 
+#print PiNat.cylinder_eq_res /-
 /-- `cylinder x n` is equal to the set of sequences `y` with the same restriction to `n` as `x`.-/
 theorem cylinder_eq_res (x : ℕ → α) (n : ℕ) : cylinder x n = { y | res y n = res x n } :=
   by
@@ -322,6 +335,7 @@ theorem cylinder_eq_res (x : ℕ → α) (n : ℕ) : cylinder x n = { y | res y
   dsimp [cylinder]
   rw [res_eq_res]
 #align pi_nat.cylinder_eq_res PiNat.cylinder_eq_res
+-/
 
 end Res
 
@@ -495,11 +509,13 @@ theorem lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type _
 
 variable (E) [∀ n, TopologicalSpace (E n)] [∀ n, DiscreteTopology (E n)]
 
+#print PiNat.isOpen_cylinder /-
 theorem isOpen_cylinder (x : ∀ n, E n) (n : ℕ) : IsOpen (cylinder x n) :=
   by
   rw [PiNat.cylinder_eq_pi]
   exact isOpen_set_pi (Finset.range n).finite_toSet fun a ha => isOpen_discrete _
 #align pi_nat.is_open_cylinder PiNat.isOpen_cylinder
+-/
 
 #print PiNat.isTopologicalBasis_cylinders /-
 theorem isTopologicalBasis_cylinders :
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.pi_nat
-! leanprover-community/mathlib commit 25a9423c6b2c8626e91c688bfd6c1d0a986a3e6e
+! leanprover-community/mathlib commit 49b7f94aab3a3bdca1f9f34c5d818afb253b3993
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -259,6 +259,72 @@ theorem update_mem_cylinder (x : ∀ n, E n) (n : ℕ) (y : E n) : update x n y
   mem_cylinder_iff.2 fun i hi => by simp [hi.ne]
 #align pi_nat.update_mem_cylinder PiNat.update_mem_cylinder
 
+section Res
+
+variable {α : Type _}
+
+open List
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+/-- In the case where `E` has constant value `α`,
+the cylinder `cylinder x n` can be identified with the element of `list α`
+consisting of the first `n` entries of `x`. See `cylinder_eq_res`.
+We call this list `res x n`, the restriction of `x` to `n`.-/
+def res (x : ℕ → α) : ℕ → List α
+  | 0 => nil
+  | Nat.succ n => x n::res n
+#align pi_nat.res PiNat.res
+
+@[simp]
+theorem res_zero (x : ℕ → α) : res x 0 = @nil α :=
+  rfl
+#align pi_nat.res_zero PiNat.res_zero
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+@[simp]
+theorem res_succ (x : ℕ → α) (n : ℕ) : res x n.succ = x n::res x n :=
+  rfl
+#align pi_nat.res_succ PiNat.res_succ
+
+@[simp]
+theorem res_length (x : ℕ → α) (n : ℕ) : (res x n).length = n := by induction n <;> simp [*]
+#align pi_nat.res_length PiNat.res_length
+
+/-- The restrictions of `x` and `y` to `n` are equal if and only if `x m = y m` for all `m < n`.-/
+theorem res_eq_res {x y : ℕ → α} {n : ℕ} : res x n = res y n ↔ ∀ ⦃m⦄, m < n → x m = y m :=
+  by
+  constructor <;> intro h <;> induction' n with n ih; · simp
+  · intro m hm
+    rw [Nat.lt_succ_iff_lt_or_eq] at hm
+    simp only [res_succ] at h
+    cases' hm with hm hm
+    · exact ih h.2 hm
+    rw [hm]
+    exact h.1
+  · simp
+  simp only [res_succ]
+  refine' ⟨h (Nat.lt_succ_self _), ih fun m hm => _⟩
+  exact h (hm.trans (Nat.lt_succ_self _))
+#align pi_nat.res_eq_res PiNat.res_eq_res
+
+theorem res_injective : Injective (@res α) :=
+  by
+  intro x y h
+  ext n
+  apply res_eq_res.mp _ (Nat.lt_succ_self _)
+  rw [h]
+#align pi_nat.res_injective PiNat.res_injective
+
+/-- `cylinder x n` is equal to the set of sequences `y` with the same restriction to `n` as `x`.-/
+theorem cylinder_eq_res (x : ℕ → α) (n : ℕ) : cylinder x n = { y | res y n = res x n } :=
+  by
+  ext y
+  dsimp [cylinder]
+  rw [res_eq_res]
+#align pi_nat.cylinder_eq_res PiNat.cylinder_eq_res
+
+end Res
+
 /-!
 ### A distance function on `Π n, E n`
 
@@ -429,14 +495,19 @@ theorem lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type _
 
 variable (E) [∀ n, TopologicalSpace (E n)] [∀ n, DiscreteTopology (E n)]
 
+theorem isOpen_cylinder (x : ∀ n, E n) (n : ℕ) : IsOpen (cylinder x n) :=
+  by
+  rw [PiNat.cylinder_eq_pi]
+  exact isOpen_set_pi (Finset.range n).finite_toSet fun a ha => isOpen_discrete _
+#align pi_nat.is_open_cylinder PiNat.isOpen_cylinder
+
 #print PiNat.isTopologicalBasis_cylinders /-
 theorem isTopologicalBasis_cylinders :
     IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n)(n : ℕ), s = cylinder x n } :=
   by
   apply is_topological_basis_of_open_of_nhds
   · rintro u ⟨x, n, rfl⟩
-    rw [cylinder_eq_pi]
-    exact isOpen_set_pi (Finset.range n).finite_toSet fun a ha => isOpen_discrete _
+    apply is_open_cylinder
   · intro x u hx u_open
     obtain ⟨v, ⟨U, F, hUF, rfl⟩, xU, Uu⟩ :
       ∃ (v : Set (∀ i : ℕ, E i))(H :
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.pi_nat
-! leanprover-community/mathlib commit e1a7bdeb4fd826b7e71d130d34988f0a2d26a177
+! leanprover-community/mathlib commit 25a9423c6b2c8626e91c688bfd6c1d0a986a3e6e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Topology.MetricSpace.HausdorffDistance
 /-!
 # Topological study of spaces `Π (n : ℕ), E n`
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 When `E n` are topological spaces, the space `Π (n : ℕ), E n` is naturally a topological space
 (with the product topology). When `E n` are uniform spaces, it also inherits a uniform structure.
 However, it does not inherit a canonical metric space structure of the `E n`. Nevertheless, one
Diff
@@ -69,19 +69,24 @@ namespace PiNat
 /-! ### The first_diff function -/
 
 
+#print PiNat.firstDiff /-
 /-- In a product space `Π n, E n`, then `first_diff x y` is the first index at which `x` and `y`
 differ. If `x = y`, then by convention we set `first_diff x x = 0`. -/
 @[pp_nodot]
 irreducible_def firstDiff (x y : ∀ n, E n) : ℕ :=
   if h : x ≠ y then Nat.find (ne_iff.1 h) else 0
 #align pi_nat.first_diff PiNat.firstDiff
+-/
 
+#print PiNat.apply_firstDiff_ne /-
 theorem apply_firstDiff_ne {x y : ∀ n, E n} (h : x ≠ y) : x (firstDiff x y) ≠ y (firstDiff x y) :=
   by
   rw [first_diff, dif_pos h]
   exact Nat.find_spec (ne_iff.1 h)
 #align pi_nat.apply_first_diff_ne PiNat.apply_firstDiff_ne
+-/
 
+#print PiNat.apply_eq_of_lt_firstDiff /-
 theorem apply_eq_of_lt_firstDiff {x y : ∀ n, E n} {n : ℕ} (hn : n < firstDiff x y) : x n = y n :=
   by
   rw [first_diff] at hn
@@ -90,7 +95,9 @@ theorem apply_eq_of_lt_firstDiff {x y : ∀ n, E n} {n : ℕ} (hn : n < firstDif
     simp
   · exact (not_lt_zero' hn).elim
 #align pi_nat.apply_eq_of_lt_first_diff PiNat.apply_eq_of_lt_firstDiff
+-/
 
+#print PiNat.firstDiff_comm /-
 theorem firstDiff_comm (x y : ∀ n, E n) : firstDiff x y = firstDiff y x :=
   by
   rcases eq_or_ne x y with (rfl | hxy); · rfl
@@ -99,7 +106,14 @@ theorem firstDiff_comm (x y : ∀ n, E n) : firstDiff x y = firstDiff y x :=
   · exact h
   · exact (apply_first_diff_ne hxy.symm (apply_eq_of_lt_first_diff h).symm).elim
 #align pi_nat.first_diff_comm PiNat.firstDiff_comm
+-/
 
+/- warning: pi_nat.min_first_diff_le -> PiNat.min_firstDiff_le is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), (Ne.{succ u1} (forall (n : Nat), E n) x z) -> (LE.le.{0} Nat Nat.hasLe (LinearOrder.min.{0} Nat Nat.linearOrder (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x y) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) y z)) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x z))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), (Ne.{succ u1} (forall (n : Nat), E n) x z) -> (LE.le.{0} Nat instLENat (Min.min.{0} Nat instMinNat (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x y) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) y z)) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x z))
+Case conversion may be inaccurate. Consider using '#align pi_nat.min_first_diff_le PiNat.min_firstDiff_leₓ'. -/
 theorem min_firstDiff_le (x y z : ∀ n, E n) (h : x ≠ z) :
     min (firstDiff x y) (firstDiff y z) ≤ firstDiff x z :=
   by
@@ -116,6 +130,7 @@ theorem min_firstDiff_le (x y z : ∀ n, E n) (h : x ≠ z) :
 /-! ### Cylinders -/
 
 
+#print PiNat.cylinder /-
 /-- In a product space `Π n, E n`, the cylinder set of length `n` around `x`, denoted
 `cylinder x n`, is the set of sequences `y` that coincide with `x` on the first `n` symbols, i.e.,
 such that `y i = x i` for all `i < n`.
@@ -123,30 +138,42 @@ such that `y i = x i` for all `i < n`.
 def cylinder (x : ∀ n, E n) (n : ℕ) : Set (∀ n, E n) :=
   { y | ∀ i, i < n → y i = x i }
 #align pi_nat.cylinder PiNat.cylinder
+-/
 
+#print PiNat.cylinder_eq_pi /-
 theorem cylinder_eq_pi (x : ∀ n, E n) (n : ℕ) :
     cylinder x n = Set.pi (Finset.range n : Set ℕ) fun i : ℕ => {x i} :=
   by
   ext y
   simp [cylinder]
 #align pi_nat.cylinder_eq_pi PiNat.cylinder_eq_pi
+-/
 
+#print PiNat.cylinder_zero /-
 @[simp]
 theorem cylinder_zero (x : ∀ n, E n) : cylinder x 0 = univ := by simp [cylinder_eq_pi]
 #align pi_nat.cylinder_zero PiNat.cylinder_zero
+-/
 
+#print PiNat.cylinder_anti /-
 theorem cylinder_anti (x : ∀ n, E n) {m n : ℕ} (h : m ≤ n) : cylinder x n ⊆ cylinder x m :=
   fun y hy i hi => hy i (hi.trans_le h)
 #align pi_nat.cylinder_anti PiNat.cylinder_anti
+-/
 
+#print PiNat.mem_cylinder_iff /-
 @[simp]
 theorem mem_cylinder_iff {x y : ∀ n, E n} {n : ℕ} : y ∈ cylinder x n ↔ ∀ i, i < n → y i = x i :=
   Iff.rfl
 #align pi_nat.mem_cylinder_iff PiNat.mem_cylinder_iff
+-/
 
+#print PiNat.self_mem_cylinder /-
 theorem self_mem_cylinder (x : ∀ n, E n) (n : ℕ) : x ∈ cylinder x n := by simp
 #align pi_nat.self_mem_cylinder PiNat.self_mem_cylinder
+-/
 
+#print PiNat.mem_cylinder_iff_eq /-
 theorem mem_cylinder_iff_eq {x y : ∀ n, E n} {n : ℕ} :
     y ∈ cylinder x n ↔ cylinder y n = cylinder x n :=
   by
@@ -163,11 +190,15 @@ theorem mem_cylinder_iff_eq {x y : ∀ n, E n} {n : ℕ} :
     rw [← h]
     exact self_mem_cylinder _ _
 #align pi_nat.mem_cylinder_iff_eq PiNat.mem_cylinder_iff_eq
+-/
 
+#print PiNat.mem_cylinder_comm /-
 theorem mem_cylinder_comm (x y : ∀ n, E n) (n : ℕ) : y ∈ cylinder x n ↔ x ∈ cylinder y n := by
   simp [mem_cylinder_iff_eq, eq_comm]
 #align pi_nat.mem_cylinder_comm PiNat.mem_cylinder_comm
+-/
 
+#print PiNat.mem_cylinder_iff_le_firstDiff /-
 theorem mem_cylinder_iff_le_firstDiff {x y : ∀ n, E n} (hne : x ≠ y) (i : ℕ) :
     x ∈ cylinder y i ↔ i ≤ firstDiff x y := by
   constructor
@@ -177,18 +208,29 @@ theorem mem_cylinder_iff_le_firstDiff {x y : ∀ n, E n} (hne : x ≠ y) (i : 
   · intro hi j hj
     exact apply_eq_of_lt_first_diff (hj.trans_le hi)
 #align pi_nat.mem_cylinder_iff_le_first_diff PiNat.mem_cylinder_iff_le_firstDiff
+-/
 
+#print PiNat.mem_cylinder_firstDiff /-
 theorem mem_cylinder_firstDiff (x y : ∀ n, E n) : x ∈ cylinder y (firstDiff x y) := fun i hi =>
   apply_eq_of_lt_firstDiff hi
 #align pi_nat.mem_cylinder_first_diff PiNat.mem_cylinder_firstDiff
+-/
 
+#print PiNat.cylinder_eq_cylinder_of_le_firstDiff /-
 theorem cylinder_eq_cylinder_of_le_firstDiff (x y : ∀ n, E n) {n : ℕ} (hn : n ≤ firstDiff x y) :
     cylinder x n = cylinder y n := by
   rw [← mem_cylinder_iff_eq]
   intro i hi
   exact apply_eq_of_lt_first_diff (hi.trans_le hn)
 #align pi_nat.cylinder_eq_cylinder_of_le_first_diff PiNat.cylinder_eq_cylinder_of_le_firstDiff
+-/
 
+/- warning: pi_nat.Union_cylinder_update -> PiNat.unionᵢ_cylinder_update is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat), Eq.{succ u1} (Set.{u1} (forall (n : Nat), E n)) (Set.unionᵢ.{u1, succ u1} (forall (n : Nat), E n) (E n) (fun (k : E n) => PiNat.cylinder.{u1} (fun (n : Nat) => E n) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) x n k) (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)))))) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat), Eq.{succ u1} (Set.{u1} (forall (n : Nat), E n)) (Set.unionᵢ.{u1, succ u1} (forall (n : Nat), E n) (E n) (fun (k : E n) => PiNat.cylinder.{u1} (fun (n : Nat) => E n) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) x n k) (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
+Case conversion may be inaccurate. Consider using '#align pi_nat.Union_cylinder_update PiNat.unionᵢ_cylinder_updateₓ'. -/
 theorem unionᵢ_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     (⋃ k, cylinder (update x n k) (n + 1)) = cylinder x n :=
   by
@@ -204,6 +246,12 @@ theorem unionᵢ_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     · simp
 #align pi_nat.Union_cylinder_update PiNat.unionᵢ_cylinder_update
 
+/- warning: pi_nat.update_mem_cylinder -> PiNat.update_mem_cylinder is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat) (y : E n), Membership.Mem.{u1, u1} (forall (a : Nat), E a) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => Nat.decidableEq a b) x n y) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (n : Nat) (y : E n), Membership.mem.{u1, u1} (forall (a : Nat), E a) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) (Function.update.{1, succ u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) (b : Nat) => instDecidableEqNat a b) x n y) (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)
+Case conversion may be inaccurate. Consider using '#align pi_nat.update_mem_cylinder PiNat.update_mem_cylinderₓ'. -/
 theorem update_mem_cylinder (x : ∀ n, E n) (n : ℕ) (y : E n) : update x n y ∈ cylinder x n :=
   mem_cylinder_iff.2 fun i hi => by simp [hi.ne]
 #align pi_nat.update_mem_cylinder PiNat.update_mem_cylinder
@@ -219,25 +267,47 @@ local instances in this section.
 -/
 
 
+#print PiNat.dist /-
 /-- The distance function on a product space `Π n, E n`, given by `dist x y = (1/2)^n` where `n` is
 the first index at which `x` and `y` differ. -/
-protected def hasDist : Dist (∀ n, E n) :=
+protected def dist : Dist (∀ n, E n) :=
   ⟨fun x y => if h : x ≠ y then (1 / 2 : ℝ) ^ firstDiff x y else 0⟩
-#align pi_nat.has_dist PiNat.hasDist
+#align pi_nat.has_dist PiNat.dist
+-/
 
-attribute [local instance] PiNat.hasDist
+attribute [local instance] PiNat.dist
 
+/- warning: pi_nat.dist_eq_of_ne -> PiNat.dist_eq_of_ne is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n}, (Ne.{succ u1} (forall (n : Nat), E n) x y) -> (Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x y)))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n}, (Ne.{succ u1} (forall (n : Nat), E n) x y) -> (Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (PiNat.firstDiff.{u1} (fun (n : Nat) => E n) x y)))
+Case conversion may be inaccurate. Consider using '#align pi_nat.dist_eq_of_ne PiNat.dist_eq_of_neₓ'. -/
 theorem dist_eq_of_ne {x y : ∀ n, E n} (h : x ≠ y) : dist x y = (1 / 2 : ℝ) ^ firstDiff x y := by
   simp [dist, h]
 #align pi_nat.dist_eq_of_ne PiNat.dist_eq_of_ne
 
+/- warning: pi_nat.dist_self -> PiNat.dist_self is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n), Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x x) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n), Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x x) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))
+Case conversion may be inaccurate. Consider using '#align pi_nat.dist_self PiNat.dist_selfₓ'. -/
 protected theorem dist_self (x : ∀ n, E n) : dist x x = 0 := by simp [dist]
 #align pi_nat.dist_self PiNat.dist_self
 
+#print PiNat.dist_comm /-
 protected theorem dist_comm (x y : ∀ n, E n) : dist x y = dist y x := by
   simp [dist, @eq_comm _ x y, first_diff_comm]
 #align pi_nat.dist_comm PiNat.dist_comm
+-/
 
+/- warning: pi_nat.dist_nonneg -> PiNat.dist_nonneg is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), LE.le.{0} Real Real.hasLe (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero))) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y)
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), LE.le.{0} Real Real.instLEReal (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal)) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y)
+Case conversion may be inaccurate. Consider using '#align pi_nat.dist_nonneg PiNat.dist_nonnegₓ'. -/
 protected theorem dist_nonneg (x y : ∀ n, E n) : 0 ≤ dist x y :=
   by
   rcases eq_or_ne x y with (rfl | h)
@@ -245,6 +315,12 @@ protected theorem dist_nonneg (x y : ∀ n, E n) : 0 ≤ dist x y :=
   · simp [dist, h]
 #align pi_nat.dist_nonneg PiNat.dist_nonneg
 
+/- warning: pi_nat.dist_triangle_nonarch -> PiNat.dist_triangle_nonarch is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), LE.le.{0} Real Real.hasLe (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x z) (LinearOrder.max.{0} Real Real.linearOrder (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y z))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x z) (Max.max.{0} Real (LinearOrderedRing.toMax.{0} Real Real.instLinearOrderedRingReal) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y z))
+Case conversion may be inaccurate. Consider using '#align pi_nat.dist_triangle_nonarch PiNat.dist_triangle_nonarchₓ'. -/
 theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y) (dist y z) :=
   by
   rcases eq_or_ne x z with (rfl | hxz)
@@ -258,6 +334,12 @@ theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y)
     min_le_iff.1 (min_first_diff_le x y z hxz)]
 #align pi_nat.dist_triangle_nonarch PiNat.dist_triangle_nonarch
 
+/- warning: pi_nat.dist_triangle -> PiNat.dist_triangle is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), LE.le.{0} Real Real.hasLe (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x z) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.hasAdd) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y z))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (z : forall (n : Nat), E n), LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x z) (HAdd.hAdd.{0, 0, 0} Real Real Real (instHAdd.{0} Real Real.instAddReal) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y z))
+Case conversion may be inaccurate. Consider using '#align pi_nat.dist_triangle PiNat.dist_triangleₓ'. -/
 protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + dist y z :=
   calc
     dist x z ≤ max (dist x y) (dist y z) := dist_triangle_nonarch x y z
@@ -265,6 +347,12 @@ protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + d
     
 #align pi_nat.dist_triangle PiNat.dist_triangle
 
+/- warning: pi_nat.eq_of_dist_eq_zero -> PiNat.eq_of_dist_eq_zero is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), (Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (OfNat.ofNat.{0} Real 0 (OfNat.mk.{0} Real 0 (Zero.zero.{0} Real Real.hasZero)))) -> (Eq.{succ u1} (forall (n : Nat), E n) x y)
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), (Eq.{1} Real (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (OfNat.ofNat.{0} Real 0 (Zero.toOfNat0.{0} Real Real.instZeroReal))) -> (Eq.{succ u1} (forall (n : Nat), E n) x y)
+Case conversion may be inaccurate. Consider using '#align pi_nat.eq_of_dist_eq_zero PiNat.eq_of_dist_eq_zeroₓ'. -/
 protected theorem eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x = y :=
   by
   rcases eq_or_ne x y with (rfl | h); · rfl
@@ -272,6 +360,12 @@ protected theorem eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x
   exact (two_ne_zero (pow_eq_zero hxy)).elim
 #align pi_nat.eq_of_dist_eq_zero PiNat.eq_of_dist_eq_zero
 
+/- warning: pi_nat.mem_cylinder_iff_dist_le -> PiNat.mem_cylinder_iff_dist_le is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n} {n : Nat}, Iff (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) y (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)) (LE.le.{0} Real Real.hasLe (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y x) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) n))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n} {n : Nat}, Iff (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) y (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)) (LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) y x) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) n))
+Case conversion may be inaccurate. Consider using '#align pi_nat.mem_cylinder_iff_dist_le PiNat.mem_cylinder_iff_dist_leₓ'. -/
 theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
     y ∈ cylinder x n ↔ dist y x ≤ (1 / 2) ^ n :=
   by
@@ -286,6 +380,12 @@ theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
     exact apply_eq_of_lt_first_diff (hi.trans_le h)
 #align pi_nat.mem_cylinder_iff_dist_le PiNat.mem_cylinder_iff_dist_le
 
+/- warning: pi_nat.apply_eq_of_dist_lt -> PiNat.apply_eq_of_dist_lt is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n} {n : Nat}, (LT.lt.{0} Real Real.hasLt (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) n)) -> (forall {i : Nat}, (LE.le.{0} Nat Nat.hasLe i n) -> (Eq.{succ u1} (E i) (x i) (y i)))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} {x : forall (n : Nat), E n} {y : forall (n : Nat), E n} {n : Nat}, (LT.lt.{0} Real Real.instLTReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) n)) -> (forall {i : Nat}, (LE.le.{0} Nat instLENat i n) -> (Eq.{succ u1} (E i) (x i) (y i)))
+Case conversion may be inaccurate. Consider using '#align pi_nat.apply_eq_of_dist_lt PiNat.apply_eq_of_dist_ltₓ'. -/
 theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2) ^ n) {i : ℕ}
     (hi : i ≤ n) : x i = y i :=
   by
@@ -296,6 +396,12 @@ theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2)
   exact apply_eq_of_lt_first_diff (hi.trans_lt this)
 #align pi_nat.apply_eq_of_dist_lt PiNat.apply_eq_of_dist_lt
 
+/- warning: pi_nat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder -> PiNat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} {α : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u2} α] {f : (forall (n : Nat), E n) -> α}, Iff (forall (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), LE.le.{0} Real Real.hasLe (Dist.dist.{u2} α (PseudoMetricSpace.toHasDist.{u2} α _inst_1) (f x) (f y)) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y)) (forall (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (n : Nat), (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) y (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)) -> (LE.le.{0} Real Real.hasLe (Dist.dist.{u2} α (PseudoMetricSpace.toHasDist.{u2} α _inst_1) (f x) (f y)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) n)))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} {α : Type.{u2}} [_inst_1 : PseudoMetricSpace.{u2} α] {f : (forall (n : Nat), E n) -> α}, Iff (forall (x : forall (n : Nat), E n) (y : forall (n : Nat), E n), LE.le.{0} Real Real.instLEReal (Dist.dist.{u2} α (PseudoMetricSpace.toDist.{u2} α _inst_1) (f x) (f y)) (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y)) (forall (x : forall (n : Nat), E n) (y : forall (n : Nat), E n) (n : Nat), (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) y (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n)) -> (LE.le.{0} Real Real.instLEReal (Dist.dist.{u2} α (PseudoMetricSpace.toDist.{u2} α _inst_1) (f x) (f y)) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) n)))
+Case conversion may be inaccurate. Consider using '#align pi_nat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder PiNat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinderₓ'. -/
 /-- A function to a pseudo-metric-space is `1`-Lipschitz if and only if points in the same cylinder
 of length `n` are sent to points within distance `(1/2)^n`.
 Not expressed using `lipschitz_with` as we don't have a metric space structure -/
@@ -320,6 +426,7 @@ theorem lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type _
 
 variable (E) [∀ n, TopologicalSpace (E n)] [∀ n, DiscreteTopology (E n)]
 
+#print PiNat.isTopologicalBasis_cylinders /-
 theorem isTopologicalBasis_cylinders :
     IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n)(n : ℕ), s = cylinder x n } :=
   by
@@ -347,9 +454,16 @@ theorem isTopologicalBasis_cylinders :
     simp only [Set.mem_pi, Finset.mem_coe] at xU
     exact xU i hi
 #align pi_nat.is_topological_basis_cylinders PiNat.isTopologicalBasis_cylinders
+-/
 
 variable {E}
 
+/- warning: pi_nat.is_open_iff_dist -> PiNat.isOpen_iff_dist is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] (s : Set.{u1} (forall (n : Nat), E n)), Iff (IsOpen.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) (forall (x : forall (n : Nat), E n), (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) 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 : forall (n : Nat), E n), (LT.lt.{0} Real Real.hasLt (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) ε) -> (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) y s)))))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] (s : Set.{u1} (forall (n : Nat), E n)), Iff (IsOpen.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) (forall (x : forall (n : Nat), E n), (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) 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 : forall (n : Nat), E n), (LT.lt.{0} Real Real.instLTReal (Dist.dist.{u1} (forall (n : Nat), E n) (PiNat.dist.{u1} (fun (n : Nat) => E n)) x y) ε) -> (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) y s)))))
+Case conversion may be inaccurate. Consider using '#align pi_nat.is_open_iff_dist PiNat.isOpen_iff_distₓ'. -/
 theorem isOpen_iff_dist (s : Set (∀ n, E n)) :
     IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s :=
   by
@@ -371,6 +485,7 @@ theorem isOpen_iff_dist (s : Set (∀ n, E n)) :
     exact (mem_cylinder_iff_dist_le.1 hy).trans_lt hn
 #align pi_nat.is_open_iff_dist PiNat.isOpen_iff_dist
 
+#print PiNat.metricSpace /-
 /-- Metric space structure on `Π (n : ℕ), E n` when the spaces `E n` have the discrete topology,
 where the distance is given by `dist x y = (1/2)^n`, where `n` is the smallest index where `x` and
 `y` differ. Not registered as a global instance by default.
@@ -382,7 +497,9 @@ protected def metricSpace : MetricSpace (∀ n, E n) :=
   MetricSpace.ofDistTopology dist PiNat.dist_self PiNat.dist_comm PiNat.dist_triangle
     isOpen_iff_dist PiNat.eq_of_dist_eq_zero
 #align pi_nat.metric_space PiNat.metricSpace
+-/
 
+#print PiNat.metricSpaceOfDiscreteUniformity /-
 /-- Metric space structure on `Π (n : ℕ), E n` when the spaces `E n` have the discrete uniformity,
 where the distance is given by `dist x y = (1/2)^n`, where `n` is the smallest index where `x` and
 `y` differ. Not registered as a global instance by default. -/
@@ -420,16 +537,20 @@ protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type _} [∀ n, Unifo
         intro x y hxy
         exact apply_eq_of_dist_lt hxy le_rfl }
 #align pi_nat.metric_space_of_discrete_uniformity PiNat.metricSpaceOfDiscreteUniformity
+-/
 
+#print PiNat.metricSpaceNatNat /-
 /-- Metric space structure on `ℕ → ℕ` where the distance is given by `dist x y = (1/2)^n`,
 where `n` is the smallest index where `x` and `y` differ.
 Not registered as a global instance by default. -/
 def metricSpaceNatNat : MetricSpace (ℕ → ℕ) :=
   PiNat.metricSpaceOfDiscreteUniformity fun n => rfl
 #align pi_nat.metric_space_nat_nat PiNat.metricSpaceNatNat
+-/
 
 attribute [local instance] PiNat.metricSpace
 
+#print PiNat.completeSpace /-
 protected theorem completeSpace : CompleteSpace (∀ n, E n) :=
   by
   refine' Metric.complete_of_convergent_controlled_sequences (fun n => (1 / 2) ^ n) (by simp) _
@@ -439,6 +560,7 @@ protected theorem completeSpace : CompleteSpace (∀ n, E n) :=
   filter_upwards [Filter.Ici_mem_atTop i]with n hn
   exact apply_eq_of_dist_lt (hu i i n le_rfl hn) le_rfl
 #align pi_nat.complete_space PiNat.completeSpace
+-/
 
 /-!
 ### Retractions inside product spaces
@@ -451,6 +573,12 @@ where `z_w` is an element of `s` starting with `w`.
 -/
 
 
+/- warning: pi_nat.exists_disjoint_cylinder -> PiNat.exists_disjoint_cylinder is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (forall {x : forall (n : Nat), E n}, (Not (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) x s)) -> (Exists.{1} Nat (fun (n : Nat) => Disjoint.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.completeBooleanAlgebra.{u1} (forall (n : Nat), E n))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} (forall (n : Nat), E n)) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.booleanAlgebra.{u1} (forall (n : Nat), E n)))) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n))))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (forall {x : forall (n : Nat), E n}, (Not (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) x s)) -> (Exists.{1} Nat (fun (n : Nat) => Disjoint.{u1} (Set.{u1} (forall (n : Nat), E n)) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} (forall (n : Nat), E n)) (Preorder.toLE.{u1} (Set.{u1} (forall (n : Nat), E n)) (PartialOrder.toPreorder.{u1} (Set.{u1} (forall (n : Nat), E n)) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n))))
+Case conversion may be inaccurate. Consider using '#align pi_nat.exists_disjoint_cylinder PiNat.exists_disjoint_cylinderₓ'. -/
 theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : ∀ n, E n}
     (hx : x ∉ s) : ∃ n, Disjoint s (cylinder x n) :=
   by
@@ -470,13 +598,16 @@ theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : 
     
 #align pi_nat.exists_disjoint_cylinder PiNat.exists_disjoint_cylinder
 
+#print PiNat.shortestPrefixDiff /-
 /-- Given a point `x` in a product space `Π (n : ℕ), E n`, and `s` a subset of this space, then
 `shortest_prefix_diff x s` if the smallest `n` for which there is no element of `s` having the same
 prefix of length `n` as `x`. If there is no such `n`, then use `0` by convention. -/
 def shortestPrefixDiff {E : ℕ → Type _} (x : ∀ n, E n) (s : Set (∀ n, E n)) : ℕ :=
   if h : ∃ n, Disjoint s (cylinder x n) then Nat.find h else 0
 #align pi_nat.shortest_prefix_diff PiNat.shortestPrefixDiff
+-/
 
+#print PiNat.firstDiff_lt_shortestPrefixDiff /-
 theorem firstDiff_lt_shortestPrefixDiff {s : Set (∀ n, E n)} (hs : IsClosed s) {x y : ∀ n, E n}
     (hx : x ∉ s) (hy : y ∈ s) : firstDiff x y < shortestPrefixDiff x s :=
   by
@@ -489,21 +620,27 @@ theorem firstDiff_lt_shortestPrefixDiff {s : Set (∀ n, E n)} (hs : IsClosed s)
   rw [mem_cylinder_comm]
   exact cylinder_anti y B (mem_cylinder_first_diff x y)
 #align pi_nat.first_diff_lt_shortest_prefix_diff PiNat.firstDiff_lt_shortestPrefixDiff
+-/
 
+#print PiNat.shortestPrefixDiff_pos /-
 theorem shortestPrefixDiff_pos {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty)
     {x : ∀ n, E n} (hx : x ∉ s) : 0 < shortestPrefixDiff x s :=
   by
   rcases hne with ⟨y, hy⟩
   exact (zero_le _).trans_lt (first_diff_lt_shortest_prefix_diff hs hx hy)
 #align pi_nat.shortest_prefix_diff_pos PiNat.shortestPrefixDiff_pos
+-/
 
+#print PiNat.longestPrefix /-
 /-- Given a point `x` in a product space `Π (n : ℕ), E n`, and `s` a subset of this space, then
 `longest_prefix x s` if the largest `n` for which there is an element of `s` having the same
 prefix of length `n` as `x`. If there is no such `n`, use `0` by convention. -/
 def longestPrefix {E : ℕ → Type _} (x : ∀ n, E n) (s : Set (∀ n, E n)) : ℕ :=
   shortestPrefixDiff x s - 1
 #align pi_nat.longest_prefix PiNat.longestPrefix
+-/
 
+#print PiNat.firstDiff_le_longestPrefix /-
 theorem firstDiff_le_longestPrefix {s : Set (∀ n, E n)} (hs : IsClosed s) {x y : ∀ n, E n}
     (hx : x ∉ s) (hy : y ∈ s) : firstDiff x y ≤ longestPrefix x s :=
   by
@@ -511,7 +648,14 @@ theorem firstDiff_le_longestPrefix {s : Set (∀ n, E n)} (hs : IsClosed s) {x y
   · exact first_diff_lt_shortest_prefix_diff hs hx hy
   · exact shortest_prefix_diff_pos hs ⟨y, hy⟩ hx
 #align pi_nat.first_diff_le_longest_prefix PiNat.firstDiff_le_longestPrefix
+-/
 
+/- warning: pi_nat.inter_cylinder_longest_prefix_nonempty -> PiNat.inter_cylinder_longestPrefix_nonempty is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (Set.Nonempty.{u1} (forall (n : Nat), E n) s) -> (forall (x : forall (n : Nat), E n), Set.Nonempty.{u1} (forall (n : Nat), E n) (Inter.inter.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.hasInter.{u1} (forall (n : Nat), E n)) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x (PiNat.longestPrefix.{u1} (fun (n : Nat) => E n) x s))))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (Set.Nonempty.{u1} (forall (n : Nat), E n) s) -> (forall (x : forall (n : Nat), E n), Set.Nonempty.{u1} (forall (n : Nat), E n) (Inter.inter.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instInterSet.{u1} (forall (n : Nat), E n)) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x (PiNat.longestPrefix.{u1} (fun (n : Nat) => E n) x s))))
+Case conversion may be inaccurate. Consider using '#align pi_nat.inter_cylinder_longest_prefix_nonempty PiNat.inter_cylinder_longestPrefix_nonemptyₓ'. -/
 theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClosed s)
     (hne : s.Nonempty) (x : ∀ n, E n) : (s ∩ cylinder x (longestPrefix x s)).Nonempty :=
   by
@@ -532,6 +676,12 @@ theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClo
   rw [hy]
 #align pi_nat.inter_cylinder_longest_prefix_nonempty PiNat.inter_cylinder_longestPrefix_nonempty
 
+/- warning: pi_nat.disjoint_cylinder_of_longest_prefix_lt -> PiNat.disjoint_cylinder_of_longestPrefix_lt is a dubious translation:
+lean 3 declaration is
+  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (forall {x : forall (n : Nat), E n}, (Not (Membership.Mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.hasMem.{u1} (forall (n : Nat), E n)) x s)) -> (forall {n : Nat}, (LT.lt.{0} Nat Nat.hasLt (PiNat.longestPrefix.{u1} (fun (n : Nat) => E n) x s) n) -> (Disjoint.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.completeBooleanAlgebra.{u1} (forall (n : Nat), E n))))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} (forall (n : Nat), E n)) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.booleanAlgebra.{u1} (forall (n : Nat), E n)))) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n))))
+but is expected to have type
+  forall {E : Nat -> Type.{u1}} [_inst_1 : forall (n : Nat), TopologicalSpace.{u1} (E n)] [_inst_2 : forall (n : Nat), DiscreteTopology.{u1} (E n) (_inst_1 n)] {s : Set.{u1} (forall (n : Nat), E n)}, (IsClosed.{u1} (forall (n : Nat), E n) (Pi.topologicalSpace.{0, u1} Nat (fun (n : Nat) => E n) (fun (a : Nat) => _inst_1 a)) s) -> (forall {x : forall (n : Nat), E n}, (Not (Membership.mem.{u1, u1} (forall (n : Nat), E n) (Set.{u1} (forall (n : Nat), E n)) (Set.instMembershipSet.{u1} (forall (n : Nat), E n)) x s)) -> (forall {n : Nat}, (LT.lt.{0} Nat instLTNat (PiNat.longestPrefix.{u1} (fun (n : Nat) => E n) x s) n) -> (Disjoint.{u1} (Set.{u1} (forall (n : Nat), E n)) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} (forall (n : Nat), E n)) (Preorder.toLE.{u1} (Set.{u1} (forall (n : Nat), E n)) (PartialOrder.toPreorder.{u1} (Set.{u1} (forall (n : Nat), E n)) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} (forall (n : Nat), E n)) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} (forall (n : Nat), E n)) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} (forall (n : Nat), E n)) (Set.instCompleteBooleanAlgebraSet.{u1} (forall (n : Nat), E n))))))) s (PiNat.cylinder.{u1} (fun (n : Nat) => E n) x n))))
+Case conversion may be inaccurate. Consider using '#align pi_nat.disjoint_cylinder_of_longest_prefix_lt PiNat.disjoint_cylinder_of_longestPrefix_ltₓ'. -/
 theorem disjoint_cylinder_of_longestPrefix_lt {s : Set (∀ n, E n)} (hs : IsClosed s) {x : ∀ n, E n}
     (hx : x ∉ s) {n : ℕ} (hn : longestPrefix x s < n) : Disjoint s (cylinder x n) :=
   by
@@ -543,6 +693,7 @@ theorem disjoint_cylinder_of_longestPrefix_lt {s : Set (∀ n, E n)} (hs : IsClo
   rwa [mem_cylinder_comm]
 #align pi_nat.disjoint_cylinder_of_longest_prefix_lt PiNat.disjoint_cylinder_of_longestPrefix_lt
 
+#print PiNat.cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff /-
 /-- If two points `x, y` coincide up to length `n`, and the longest common prefix of `x` with `s`
 is strictly shorter than `n`, then the longest common prefix of `y` with `s` is the same, and both
 cylinders of this length based at `x` and `y` coincide. -/
@@ -571,7 +722,9 @@ theorem cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff {x y : ∀ n, E
   rw [l_eq, ← mem_cylinder_iff_eq]
   exact cylinder_anti y H.le (mem_cylinder_first_diff x y)
 #align pi_nat.cylinder_longest_prefix_eq_of_longest_prefix_lt_first_diff PiNat.cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff
+-/
 
+#print PiNat.exists_lipschitz_retraction_of_isClosed /-
 /-- Given a closed nonempty subset `s` of `Π (n : ℕ), E n`, there exists a Lipschitz retraction
 onto this set, i.e., a Lipschitz map with range equal to `s`, equal to the identity on `s`. -/
 theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsClosed s)
@@ -683,7 +836,9 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
           rw [← fx, ← fy, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_first_diff hfxfy] at this
           exact this
 #align pi_nat.exists_lipschitz_retraction_of_is_closed PiNat.exists_lipschitz_retraction_of_isClosed
+-/
 
+#print PiNat.exists_retraction_of_isClosed /-
 /-- Given a closed nonempty subset `s` of `Π (n : ℕ), E n`, there exists a retraction onto this
 set, i.e., a continuous map with range equal to `s`, equal to the identity on `s`. -/
 theorem exists_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty) :
@@ -692,7 +847,9 @@ theorem exists_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsClosed s) (
   rcases exists_lipschitz_retraction_of_is_closed hs hne with ⟨f, fs, frange, hf⟩
   exact ⟨f, fs, frange, hf.continuous⟩
 #align pi_nat.exists_retraction_of_is_closed PiNat.exists_retraction_of_isClosed
+-/
 
+#print PiNat.exists_retraction_subtype_of_isClosed /-
 theorem exists_retraction_subtype_of_isClosed {s : Set (∀ n, E n)} (hs : IsClosed s)
     (hne : s.Nonempty) : ∃ f : (∀ n, E n) → s, (∀ x : s, f x = x) ∧ Surjective f ∧ Continuous f :=
   by
@@ -707,11 +864,18 @@ theorem exists_retraction_subtype_of_isClosed {s : Set (∀ n, E n)} (hs : IsClo
     simpa only using fs x.val x.property
   exact ⟨cod_restrict f s A, B, fun x => ⟨x, B x⟩, f_cont.subtype_mk _⟩
 #align pi_nat.exists_retraction_subtype_of_is_closed PiNat.exists_retraction_subtype_of_isClosed
+-/
 
 end PiNat
 
 open PiNat
 
+/- warning: exists_nat_nat_continuous_surjective_of_complete_space -> exists_nat_nat_continuous_surjective_of_completeSpace is a dubious translation:
+lean 3 declaration is
+  forall (α : Type.{u1}) [_inst_1 : MetricSpace.{u1} α] [_inst_2 : CompleteSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1))] [_inst_3 : TopologicalSpace.SecondCountableTopology.{u1} α (UniformSpace.toTopologicalSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1)))] [_inst_4 : Nonempty.{succ u1} α], Exists.{succ u1} ((Nat -> Nat) -> α) (fun (f : (Nat -> Nat) -> α) => And (Continuous.{0, u1} (Nat -> Nat) α (Pi.topologicalSpace.{0, 0} Nat (fun (ᾰ : Nat) => Nat) (fun (a : Nat) => Nat.topologicalSpace)) (UniformSpace.toTopologicalSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1))) f) (Function.Surjective.{1, succ u1} (Nat -> Nat) α f))
+but is expected to have type
+  forall (α : Type.{u1}) [_inst_1 : MetricSpace.{u1} α] [_inst_2 : CompleteSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1))] [_inst_3 : TopologicalSpace.SecondCountableTopology.{u1} α (UniformSpace.toTopologicalSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1)))] [_inst_4 : Nonempty.{succ u1} α], Exists.{succ u1} ((Nat -> Nat) -> α) (fun (f : (Nat -> Nat) -> α) => And (Continuous.{0, u1} (Nat -> Nat) α (Pi.topologicalSpace.{0, 0} Nat (fun (ᾰ : Nat) => Nat) (fun (a : Nat) => instTopologicalSpaceNat)) (UniformSpace.toTopologicalSpace.{u1} α (PseudoMetricSpace.toUniformSpace.{u1} α (MetricSpace.toPseudoMetricSpace.{u1} α _inst_1))) f) (Function.Surjective.{1, succ u1} (Nat -> Nat) α f))
+Case conversion may be inaccurate. Consider using '#align exists_nat_nat_continuous_surjective_of_complete_space exists_nat_nat_continuous_surjective_of_completeSpaceₓ'. -/
 /-- Any nonempty complete second countable metric space is the continuous image of the
 fundamental space `ℕ → ℕ`. For a version of this theorem in the context of Polish spaces, see
 `exists_nat_nat_continuous_surjective_of_polish_space`. -/
@@ -829,20 +993,34 @@ variable {ι : Type _} [Encodable ι] {F : ι → Type _} [∀ i, MetricSpace (F
 
 open Encodable
 
+#print PiCountable.dist /-
 /-- Given a countable family of metric spaces, one may put a distance on their product `Π i, E i`.
 It is highly non-canonical, though, and therefore not registered as a global instance.
 The distance we use here is `dist x y = ∑' i, min (1/2)^(encode i) (dist (x i) (y i))`. -/
-protected def hasDist : Dist (∀ i, F i) :=
+protected def dist : Dist (∀ i, F i) :=
   ⟨fun x y => ∑' i : ι, min ((1 / 2) ^ encode i) (dist (x i) (y i))⟩
-#align pi_countable.has_dist PiCountable.hasDist
+#align pi_countable.has_dist PiCountable.dist
+-/
 
-attribute [local instance] PiCountable.hasDist
+attribute [local instance] PiCountable.dist
 
+/- warning: pi_countable.dist_eq_tsum -> PiCountable.dist_eq_tsum is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} [_inst_1 : Encodable.{u1} ι] {F : ι -> Type.{u2}} [_inst_2 : forall (i : ι), MetricSpace.{u2} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i), Eq.{1} Real (Dist.dist.{max u1 u2} (forall (i : ι), F i) (PiCountable.dist.{u1, u2} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y) (tsum.{0, u1} Real Real.addCommMonoid (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) ι (fun (i : ι) => LinearOrder.min.{0} Real Real.linearOrder (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (Encodable.encode.{u1} ι _inst_1 i)) (Dist.dist.{u2} (F i) (PseudoMetricSpace.toHasDist.{u2} (F i) (MetricSpace.toPseudoMetricSpace.{u2} (F i) (_inst_2 i))) (x i) (y i))))
+but is expected to have type
+  forall {ι : Type.{u2}} [_inst_1 : Encodable.{u2} ι] {F : ι -> Type.{u1}} [_inst_2 : forall (i : ι), MetricSpace.{u1} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i), Eq.{1} Real (Dist.dist.{max u2 u1} (forall (i : ι), F i) (PiCountable.dist.{u2, u1} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y) (tsum.{0, u2} Real Real.instAddCommMonoidReal (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) ι (fun (i : ι) => Min.min.{0} Real (LinearOrderedRing.toMin.{0} Real Real.instLinearOrderedRingReal) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (Encodable.encode.{u2} ι _inst_1 i)) (Dist.dist.{u1} (F i) (PseudoMetricSpace.toDist.{u1} (F i) (MetricSpace.toPseudoMetricSpace.{u1} (F i) (_inst_2 i))) (x i) (y i))))
+Case conversion may be inaccurate. Consider using '#align pi_countable.dist_eq_tsum PiCountable.dist_eq_tsumₓ'. -/
 theorem dist_eq_tsum (x y : ∀ i, F i) :
     dist x y = ∑' i : ι, min ((1 / 2) ^ encode i) (dist (x i) (y i)) :=
   rfl
 #align pi_countable.dist_eq_tsum PiCountable.dist_eq_tsum
 
+/- warning: pi_countable.dist_summable -> PiCountable.dist_summable is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} [_inst_1 : Encodable.{u1} ι] {F : ι -> Type.{u2}} [_inst_2 : forall (i : ι), MetricSpace.{u2} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i), Summable.{0, u1} Real ι Real.addCommMonoid (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (fun (i : ι) => LinearOrder.min.{0} Real Real.linearOrder (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (Encodable.encode.{u1} ι _inst_1 i)) (Dist.dist.{u2} (F i) (PseudoMetricSpace.toHasDist.{u2} (F i) (MetricSpace.toPseudoMetricSpace.{u2} (F i) (_inst_2 i))) (x i) (y i)))
+but is expected to have type
+  forall {ι : Type.{u2}} [_inst_1 : Encodable.{u2} ι] {F : ι -> Type.{u1}} [_inst_2 : forall (i : ι), MetricSpace.{u1} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i), Summable.{0, u2} Real ι Real.instAddCommMonoidReal (UniformSpace.toTopologicalSpace.{0} Real (PseudoMetricSpace.toUniformSpace.{0} Real Real.pseudoMetricSpace)) (fun (i : ι) => Min.min.{0} Real (LinearOrderedRing.toMin.{0} Real Real.instLinearOrderedRingReal) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (Encodable.encode.{u2} ι _inst_1 i)) (Dist.dist.{u1} (F i) (PseudoMetricSpace.toDist.{u1} (F i) (MetricSpace.toPseudoMetricSpace.{u1} (F i) (_inst_2 i))) (x i) (y i)))
+Case conversion may be inaccurate. Consider using '#align pi_countable.dist_summable PiCountable.dist_summableₓ'. -/
 theorem dist_summable (x y : ∀ i, F i) :
     Summable fun i : ι => min ((1 / 2) ^ encode i) (dist (x i) (y i)) :=
   by
@@ -851,11 +1029,23 @@ theorem dist_summable (x y : ∀ i, F i) :
   exact le_min (pow_nonneg (by norm_num) _) dist_nonneg
 #align pi_countable.dist_summable PiCountable.dist_summable
 
+/- warning: pi_countable.min_dist_le_dist_pi -> PiCountable.min_dist_le_dist_pi is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} [_inst_1 : Encodable.{u1} ι] {F : ι -> Type.{u2}} [_inst_2 : forall (i : ι), MetricSpace.{u2} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i) (i : ι), LE.le.{0} Real Real.hasLe (LinearOrder.min.{0} Real Real.linearOrder (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (Encodable.encode.{u1} ι _inst_1 i)) (Dist.dist.{u2} (F i) (PseudoMetricSpace.toHasDist.{u2} (F i) (MetricSpace.toPseudoMetricSpace.{u2} (F i) (_inst_2 i))) (x i) (y i))) (Dist.dist.{max u1 u2} (forall (i : ι), F i) (PiCountable.dist.{u1, u2} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y)
+but is expected to have type
+  forall {ι : Type.{u2}} [_inst_1 : Encodable.{u2} ι] {F : ι -> Type.{u1}} [_inst_2 : forall (i : ι), MetricSpace.{u1} (F i)] (x : forall (i : ι), F i) (y : forall (i : ι), F i) (i : ι), LE.le.{0} Real Real.instLEReal (Min.min.{0} Real (LinearOrderedRing.toMin.{0} Real Real.instLinearOrderedRingReal) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (Encodable.encode.{u2} ι _inst_1 i)) (Dist.dist.{u1} (F i) (PseudoMetricSpace.toDist.{u1} (F i) (MetricSpace.toPseudoMetricSpace.{u1} (F i) (_inst_2 i))) (x i) (y i))) (Dist.dist.{max u2 u1} (forall (i : ι), F i) (PiCountable.dist.{u2, u1} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y)
+Case conversion may be inaccurate. Consider using '#align pi_countable.min_dist_le_dist_pi PiCountable.min_dist_le_dist_piₓ'. -/
 theorem min_dist_le_dist_pi (x y : ∀ i, F i) (i : ι) :
     min ((1 / 2) ^ encode i) (dist (x i) (y i)) ≤ dist x y :=
   le_tsum (dist_summable x y) i fun j hj => le_min (by simp) dist_nonneg
 #align pi_countable.min_dist_le_dist_pi PiCountable.min_dist_le_dist_pi
 
+/- warning: pi_countable.dist_le_dist_pi_of_dist_lt -> PiCountable.dist_le_dist_pi_of_dist_lt is a dubious translation:
+lean 3 declaration is
+  forall {ι : Type.{u1}} [_inst_1 : Encodable.{u1} ι] {F : ι -> Type.{u2}} [_inst_2 : forall (i : ι), MetricSpace.{u2} (F i)] {x : forall (i : ι), F i} {y : forall (i : ι), F i} {i : ι}, (LT.lt.{0} Real Real.hasLt (Dist.dist.{max u1 u2} (forall (i : ι), F i) (PiCountable.dist.{u1, u2} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.monoid)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (DivInvMonoid.toHasDiv.{0} Real (DivisionRing.toDivInvMonoid.{0} Real Real.divisionRing))) (OfNat.ofNat.{0} Real 1 (OfNat.mk.{0} Real 1 (One.one.{0} Real Real.hasOne))) (OfNat.ofNat.{0} Real 2 (OfNat.mk.{0} Real 2 (bit0.{0} Real Real.hasAdd (One.one.{0} Real Real.hasOne))))) (Encodable.encode.{u1} ι _inst_1 i))) -> (LE.le.{0} Real Real.hasLe (Dist.dist.{u2} (F i) (PseudoMetricSpace.toHasDist.{u2} (F i) (MetricSpace.toPseudoMetricSpace.{u2} (F i) (_inst_2 i))) (x i) (y i)) (Dist.dist.{max u1 u2} (forall (i : ι), F i) (PiCountable.dist.{u1, u2} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y))
+but is expected to have type
+  forall {ι : Type.{u2}} [_inst_1 : Encodable.{u2} ι] {F : ι -> Type.{u1}} [_inst_2 : forall (i : ι), MetricSpace.{u1} (F i)] {x : forall (i : ι), F i} {y : forall (i : ι), F i} {i : ι}, (LT.lt.{0} Real Real.instLTReal (Dist.dist.{max u2 u1} (forall (i : ι), F i) (PiCountable.dist.{u2, u1} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y) (HPow.hPow.{0, 0, 0} Real Nat Real (instHPow.{0, 0} Real Nat (Monoid.Pow.{0} Real Real.instMonoidReal)) (HDiv.hDiv.{0, 0, 0} Real Real Real (instHDiv.{0} Real (LinearOrderedField.toDiv.{0} Real Real.instLinearOrderedFieldReal)) (OfNat.ofNat.{0} Real 1 (One.toOfNat1.{0} Real Real.instOneReal)) (OfNat.ofNat.{0} Real 2 (instOfNat.{0} Real 2 Real.natCast (instAtLeastTwoHAddNatInstHAddInstAddNatOfNat (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) (Encodable.encode.{u2} ι _inst_1 i))) -> (LE.le.{0} Real Real.instLEReal (Dist.dist.{u1} (F i) (PseudoMetricSpace.toDist.{u1} (F i) (MetricSpace.toPseudoMetricSpace.{u1} (F i) (_inst_2 i))) (x i) (y i)) (Dist.dist.{max u2 u1} (forall (i : ι), F i) (PiCountable.dist.{u2, u1} ι _inst_1 (fun (i : ι) => F i) (fun (i : ι) => _inst_2 i)) x y))
+Case conversion may be inaccurate. Consider using '#align pi_countable.dist_le_dist_pi_of_dist_lt PiCountable.dist_le_dist_pi_of_dist_ltₓ'. -/
 theorem dist_le_dist_pi_of_dist_lt {x y : ∀ i, F i} {i : ι} (h : dist x y < (1 / 2) ^ encode i) :
     dist (x i) (y i) ≤ dist x y := by
   simpa only [not_le.2 h, false_or_iff] using min_le_iff.1 (min_dist_le_dist_pi x y i)
@@ -869,6 +1059,7 @@ open NNReal
 
 variable (E)
 
+#print PiCountable.metricSpace /-
 /-- Given a countable family of metric spaces, one may put a distance on their product `Π i, E i`,
 defining the right topology and uniform structure. It is highly non-canonical, though, and therefore
 not registered as a global instance.
@@ -984,6 +1175,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
         _ < ε := hε
         
 #align pi_countable.metric_space PiCountable.metricSpace
+-/
 
 end PiCountable
 
Diff
@@ -894,8 +894,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
               (min ((1 / 2) ^ encode i) (dist (x i) (y i)) +
                 min ((1 / 2) ^ encode i) (dist (y i) (z i))) :=
           by
-          convert
-              congr_arg (coe : ℝ≥0 → ℝ)
+          convert congr_arg (coe : ℝ≥0 → ℝ)
                 (min_add_distrib ((1 / 2 : ℝ≥0) ^ encode i) (nndist (x i) (y i))
                   (nndist (y i) (z i))) <;>
             simp
Diff
@@ -789,7 +789,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
       by
       have : tendsto (fun n : ℕ => (2 : ℝ) * (1 / 2) ^ n) at_top (𝓝 (2 * 0)) :=
         (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1).const_mul _
-      rw [mul_zero] at this
+      rw [MulZeroClass.mul_zero] at this
       exact
         squeeze_zero (fun n => diam_nonneg) (fun n => diam_closed_ball (pow_nonneg I0.le _)) this
     refine'
@@ -937,7 +937,8 @@ protected def metricSpace : MetricSpace (∀ i, F i)
         rcases Nat.eq_zero_or_pos K.card with (hK | hK)
         ·
           exact
-            ⟨1, zero_lt_one, by simpa only [hK, Nat.cast_zero, zero_mul] using (half_pos εpos).le⟩
+            ⟨1, zero_lt_one, by
+              simpa only [hK, Nat.cast_zero, MulZeroClass.zero_mul] using (half_pos εpos).le⟩
         · have Kpos : 0 < (K.card : ℝ) := Nat.cast_pos.2 hK
           refine' ⟨ε / 2 / (K.card : ℝ), div_pos (half_pos εpos) Kpos, le_of_eq _⟩
           field_simp [Kpos.ne']
Diff
@@ -221,7 +221,7 @@ local instances in this section.
 
 /-- The distance function on a product space `Π n, E n`, given by `dist x y = (1/2)^n` where `n` is
 the first index at which `x` and `y` differ. -/
-protected def hasDist : HasDist (∀ n, E n) :=
+protected def hasDist : Dist (∀ n, E n) :=
   ⟨fun x y => if h : x ≠ y then (1 / 2 : ℝ) ^ firstDiff x y else 0⟩
 #align pi_nat.has_dist PiNat.hasDist
 
@@ -832,7 +832,7 @@ open Encodable
 /-- Given a countable family of metric spaces, one may put a distance on their product `Π i, E i`.
 It is highly non-canonical, though, and therefore not registered as a global instance.
 The distance we use here is `dist x y = ∑' i, min (1/2)^(encode i) (dist (x i) (y i))`. -/
-protected def hasDist : HasDist (∀ i, F i) :=
+protected def hasDist : Dist (∀ i, F i) :=
   ⟨fun x y => ∑' i : ι, min ((1 / 2) ^ encode i) (dist (x i) (y i))⟩
 #align pi_countable.has_dist PiCountable.hasDist
 
Diff
@@ -757,7 +757,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
       dist (g x) (g y) ≤ dist (g x) (u (x.1 n)) + dist (g y) (u (x.1 n)) :=
         dist_triangle_right _ _ _
       _ = dist (g x) (u (x.1 n)) + dist (g y) (u (y.1 n)) := by rw [← B]
-      _ ≤ (1 / 2) ^ n + (1 / 2) ^ n := add_le_add (A x n) (A y n)
+      _ ≤ (1 / 2) ^ n + (1 / 2) ^ n := (add_le_add (A x n) (A y n))
       _ = 4 * (1 / 2) ^ (n + 1) := by ring
       
   have g_surj : surjective g := by
@@ -969,7 +969,7 @@ protected def metricSpace : MetricSpace (∀ i, F i)
             apply (hxy i _).le
             simpa using hi
           _ ≤ ε / 2 + ε / 2 :=
-            add_le_add_right (by simpa only [Finset.sum_const, nsmul_eq_mul] using hδ) _
+            (add_le_add_right (by simpa only [Finset.sum_const, nsmul_eq_mul] using hδ) _)
           _ = ε := add_halves _
           
     · simp only [le_infᵢ_iff, le_principal_iff]
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.pi_nat
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit e1a7bdeb4fd826b7e71d130d34988f0a2d26a177
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -379,8 +379,8 @@ but it does not take care of a possible uniformity. If the `E n` have a uniform
 there will be two non-defeq uniform structures on `Π n, E n`, the product one and the one coming
 from the metric structure. In this case, use `metric_space_of_discrete_uniformity` instead. -/
 protected def metricSpace : MetricSpace (∀ n, E n) :=
-  MetricSpace.ofMetrizable dist PiNat.dist_self PiNat.dist_comm PiNat.dist_triangle isOpen_iff_dist
-    PiNat.eq_of_dist_eq_zero
+  MetricSpace.ofDistTopology dist PiNat.dist_self PiNat.dist_comm PiNat.dist_triangle
+    isOpen_iff_dist PiNat.eq_of_dist_eq_zero
 #align pi_nat.metric_space PiNat.metricSpace
 
 /-- Metric space structure on `Π (n : ℕ), E n` when the spaces `E n` have the discrete uniformity,

Changes in mathlib4

mathlib3
mathlib4
chore: replace refine' that already have a ?_ (#12261)

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

Diff
@@ -490,7 +490,7 @@ theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : 
   · exact ⟨0, by simp⟩
   have A : 0 < infDist x s := (hs.not_mem_iff_infDist_pos hne).1 hx
   obtain ⟨n, hn⟩ : ∃ n, (1 / 2 : ℝ) ^ n < infDist x s := exists_pow_lt_of_lt_one A one_half_lt_one
-  refine' ⟨n, disjoint_left.2 fun y ys hy => ?_⟩
+  refine ⟨n, disjoint_left.2 fun y ys hy => ?_⟩
   apply lt_irrefl (infDist x s)
   calc
     infDist x s ≤ dist x y := infDist_le_dist_of_mem ys
chore: superfluous parentheses part 2 (#12131)

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

Diff
@@ -758,7 +758,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [Metr
       dist (g x) (g y) ≤ dist (g x) (u (x.1 n)) + dist (g y) (u (x.1 n)) :=
         dist_triangle_right _ _ _
       _ = dist (g x) (u (x.1 n)) + dist (g y) (u (y.1 n)) := by rw [← B]
-      _ ≤ (1 / 2) ^ n + (1 / 2) ^ n := (add_le_add (A x n) (A y n))
+      _ ≤ (1 / 2) ^ n + (1 / 2) ^ n := add_le_add (A x n) (A y n)
       _ = 4 * (1 / 2) ^ (n + 1) := by ring
   have g_surj : Surjective g := fun y ↦ by
     have : ∀ n : ℕ, ∃ j, y ∈ closedBall (u j) ((1 / 2) ^ n) := fun n ↦ by
style: replace '.-/' by '. -/' (#11938)

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

Diff
@@ -199,7 +199,7 @@ open List
 /-- In the case where `E` has constant value `α`,
 the cylinder `cylinder x n` can be identified with the element of `List α`
 consisting of the first `n` entries of `x`. See `cylinder_eq_res`.
-We call this list `res x n`, the restriction of `x` to `n`.-/
+We call this list `res x n`, the restriction of `x` to `n`. -/
 def res (x : ℕ → α) : ℕ → List α
   | 0 => nil
   | Nat.succ n => x n :: res x n
@@ -219,7 +219,7 @@ theorem res_succ (x : ℕ → α) (n : ℕ) : res x n.succ = x n :: res x n :=
 theorem res_length (x : ℕ → α) (n : ℕ) : (res x n).length = n := by induction n <;> simp [*]
 #align pi_nat.res_length PiNat.res_length
 
-/-- The restrictions of `x` and `y` to `n` are equal if and only if `x m = y m` for all `m < n`.-/
+/-- The restrictions of `x` and `y` to `n` are equal if and only if `x m = y m` for all `m < n`. -/
 theorem res_eq_res {x y : ℕ → α} {n : ℕ} :
     res x n = res y n ↔ ∀ ⦃m⦄, m < n → x m = y m := by
   constructor <;> intro h <;> induction' n with n ih; · simp
@@ -243,7 +243,7 @@ theorem res_injective : Injective (@res α) := by
   rw [h]
 #align pi_nat.res_injective PiNat.res_injective
 
-/-- `cylinder x n` is equal to the set of sequences `y` with the same restriction to `n` as `x`.-/
+/-- `cylinder x n` is equal to the set of sequences `y` with the same restriction to `n` as `x`. -/
 theorem cylinder_eq_res (x : ℕ → α) (n : ℕ) :
     cylinder x n = { y | res y n = res x n } := by
   ext y
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11813)
Diff
@@ -295,7 +295,7 @@ theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y)
   · simp
   rcases eq_or_ne y z with (rfl | hyz)
   · simp
-  simp only [dist_eq_of_ne, hxz, hxy, hyz, inv_le_inv, one_div, inv_pow, zero_lt_two, Ne.def,
+  simp only [dist_eq_of_ne, hxz, hxy, hyz, inv_le_inv, one_div, inv_pow, zero_lt_two, Ne,
     not_false_iff, le_max_iff, pow_le_pow_iff_right, one_lt_two, pow_pos,
     min_le_iff.1 (min_firstDiff_le x y z hxz)]
 #align pi_nat.dist_triangle_nonarch PiNat.dist_triangle_nonarch
chore: Reduce scope of LinearOrderedCommGroupWithZero (#11716)

Reconstitute the file Algebra.Order.Monoid.WithZero from three files:

  • Algebra.Order.Monoid.WithZero.Defs
  • Algebra.Order.Monoid.WithZero.Basic
  • Algebra.Order.WithZero

Avoid importing it in many files. Most uses were just to get le_zero_iff to work on Nat.

Before pre_11716

After post_11716

Diff
@@ -747,7 +747,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [Metr
     have diff_pos : 0 < firstDiff x.1 y.1 := by
       by_contra! h
       apply apply_firstDiff_ne hne'
-      rw [le_zero_iff.1 h]
+      rw [Nat.le_zero.1 h]
       apply apply_eq_of_dist_lt _ le_rfl
       rw [pow_zero]
       exact hxy
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
@@ -52,7 +52,8 @@ in general), and `ι` is countable.
 
 noncomputable section
 
-open Classical Topology Filter
+open scoped Classical
+open Topology Filter
 
 open TopologicalSpace Set Metric Filter Function
 
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
@@ -608,14 +608,14 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
     Otherwise, `f x` remains in the same `n`-cylinder as `x`. Similarly for `y`. Finally, `f x` and
     `f y` are again in the same `n`-cylinder, as desired. -/
   set f := fun x => if x ∈ s then x else (inter_cylinder_longestPrefix_nonempty hs hne x).some
-  have fs : ∀ x ∈ s, f x = x := fun x xs => by simp [xs]
+  have fs : ∀ x ∈ s, f x = x := fun x xs => by simp [f, xs]
   refine' ⟨f, fs, _, _⟩
   -- check that the range of `f` is `s`.
   · apply Subset.antisymm
     · rintro x ⟨y, rfl⟩
       by_cases hy : y ∈ s
       · rwa [fs y hy]
-      simpa [if_neg hy] using (inter_cylinder_longestPrefix_nonempty hs hne y).choose_spec.1
+      simpa [f, if_neg hy] using (inter_cylinder_longestPrefix_nonempty hs hne y).choose_spec.1
     · intro x hx
       rw [← fs x hx]
       exact mem_range_self _
@@ -640,7 +640,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
       -- case where `y ∉ s`
       have A : (s ∩ cylinder y (longestPrefix y s)).Nonempty :=
         inter_cylinder_longestPrefix_nonempty hs hne y
-      have fy : f y = A.some := by simp_rw [if_neg ys]
+      have fy : f y = A.some := by simp_rw [f, if_neg ys]
       have I : cylinder A.some (firstDiff x y) = cylinder y (firstDiff x y) := by
         rw [← mem_cylinder_iff_eq, firstDiff_comm]
         apply cylinder_anti y _ A.some_mem.2
@@ -652,7 +652,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
       -- case where `y ∈ s` (similar to the above)
       · have A : (s ∩ cylinder x (longestPrefix x s)).Nonempty :=
           inter_cylinder_longestPrefix_nonempty hs hne x
-        have fx : f x = A.some := by simp_rw [if_neg xs]
+        have fx : f x = A.some := by simp_rw [f, if_neg xs]
         have I : cylinder A.some (firstDiff x y) = cylinder x (firstDiff x y) := by
           rw [← mem_cylinder_iff_eq]
           apply cylinder_anti x _ A.some_mem.2
@@ -662,10 +662,10 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
       -- case where `y ∉ s`
       · have Ax : (s ∩ cylinder x (longestPrefix x s)).Nonempty :=
           inter_cylinder_longestPrefix_nonempty hs hne x
-        have fx : f x = Ax.some := by simp_rw [if_neg xs]
+        have fx : f x = Ax.some := by simp_rw [f, if_neg xs]
         have Ay : (s ∩ cylinder y (longestPrefix y s)).Nonempty :=
           inter_cylinder_longestPrefix_nonempty hs hne y
-        have fy : f y = Ay.some := by simp_rw [if_neg ys]
+        have fy : f y = Ay.some := by simp_rw [f, if_neg ys]
         -- case where the common prefix to `x` and `s`, or `y` and `s`, is shorter than the
         -- common part to `x` and `y` -- then `f x = f y`.
         by_cases H : longestPrefix x s < firstDiff x y ∨ longestPrefix y s < firstDiff x y
chore(Analysis/SpecificLimits/* and others): rename _0 -> _zero, _1 -> _one (#10077)

See here on Zulip.

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

Diff
@@ -773,14 +773,15 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [Metr
           dist_triangle_right _ _ _
         _ ≤ (1 / 2) ^ n + (1 / 2) ^ n := add_le_add (A ⟨x, I⟩ n) (hx n)
     have L : Tendsto (fun n : ℕ => (1 / 2 : ℝ) ^ n + (1 / 2) ^ n) atTop (𝓝 (0 + 0)) :=
-      (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1).add (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1)
+      (tendsto_pow_atTop_nhds_zero_of_lt_one I0.le I1).add
+        (tendsto_pow_atTop_nhds_zero_of_lt_one I0.le I1)
     rw [add_zero] at L
     exact ge_of_tendsto' L J
   have s_closed : IsClosed s := by
     refine isClosed_iff_clusterPt.mpr fun x hx ↦ ?_
     have L : Tendsto (fun n : ℕ => diam (closedBall (u (x n)) ((1 / 2) ^ n))) atTop (𝓝 0) := by
       have : Tendsto (fun n : ℕ => (2 : ℝ) * (1 / 2) ^ n) atTop (𝓝 (2 * 0)) :=
-        (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1).const_mul _
+        (tendsto_pow_atTop_nhds_zero_of_lt_one I0.le I1).const_mul _
       rw [mul_zero] at this
       exact
         squeeze_zero (fun n => diam_nonneg) (fun n => diam_closedBall (pow_nonneg I0.le _)) this
chore: Rename pow monotonicity lemmas (#9095)

The names for lemmas about monotonicity of (a ^ ·) and (· ^ n) were a mess. This PR tidies up everything related by following the naming convention for (a * ·) and (· * b). Namely, (a ^ ·) is pow_right and (· ^ n) is pow_left in lemma names. All lemma renames follow the corresponding multiplication lemma names closely.

Renames

Algebra.GroupPower.Order

  • pow_monopow_right_mono
  • pow_le_powpow_le_pow_right
  • pow_le_pow_of_le_leftpow_le_pow_left
  • pow_lt_pow_of_lt_leftpow_lt_pow_left
  • strictMonoOn_powpow_left_strictMonoOn
  • pow_strictMono_rightpow_right_strictMono
  • pow_lt_powpow_lt_pow_right
  • pow_lt_pow_iffpow_lt_pow_iff_right
  • pow_le_pow_iffpow_le_pow_iff_right
  • self_lt_powlt_self_pow
  • strictAnti_powpow_right_strictAnti
  • pow_lt_pow_iff_of_lt_onepow_lt_pow_iff_right_of_lt_one
  • pow_lt_pow_of_lt_onepow_lt_pow_right_of_lt_one
  • lt_of_pow_lt_powlt_of_pow_lt_pow_left
  • le_of_pow_le_powle_of_pow_le_pow_left
  • pow_lt_pow₀pow_lt_pow_right₀

Algebra.GroupPower.CovariantClass

  • pow_le_pow_of_le_left'pow_le_pow_left'
  • nsmul_le_nsmul_of_le_rightnsmul_le_nsmul_right
  • pow_lt_pow'pow_lt_pow_right'
  • nsmul_lt_nsmulnsmul_lt_nsmul_left
  • pow_strictMono_leftpow_right_strictMono'
  • nsmul_strictMono_rightnsmul_left_strictMono
  • StrictMono.pow_right'StrictMono.pow_const
  • StrictMono.nsmul_leftStrictMono.const_nsmul
  • pow_strictMono_right'pow_left_strictMono
  • nsmul_strictMono_leftnsmul_right_strictMono
  • Monotone.pow_rightMonotone.pow_const
  • Monotone.nsmul_leftMonotone.const_nsmul
  • lt_of_pow_lt_pow'lt_of_pow_lt_pow_left'
  • lt_of_nsmul_lt_nsmullt_of_nsmul_lt_nsmul_right
  • pow_le_pow'pow_le_pow_right'
  • nsmul_le_nsmulnsmul_le_nsmul_left
  • pow_le_pow_of_le_one'pow_le_pow_right_of_le_one'
  • nsmul_le_nsmul_of_nonposnsmul_le_nsmul_left_of_nonpos
  • le_of_pow_le_pow'le_of_pow_le_pow_left'
  • le_of_nsmul_le_nsmul'le_of_nsmul_le_nsmul_right'
  • pow_le_pow_iff'pow_le_pow_iff_right'
  • nsmul_le_nsmul_iffnsmul_le_nsmul_iff_left
  • pow_lt_pow_iff'pow_lt_pow_iff_right'
  • nsmul_lt_nsmul_iffnsmul_lt_nsmul_iff_left

Data.Nat.Pow

  • Nat.pow_lt_pow_of_lt_leftNat.pow_lt_pow_left
  • Nat.pow_le_iff_le_leftNat.pow_le_pow_iff_left
  • Nat.pow_lt_iff_lt_leftNat.pow_lt_pow_iff_left

Lemmas added

  • pow_le_pow_iff_left
  • pow_lt_pow_iff_left
  • pow_right_injective
  • pow_right_inj
  • Nat.pow_le_pow_left to have the correct name since Nat.pow_le_pow_of_le_left is in Std.
  • Nat.pow_le_pow_right to have the correct name since Nat.pow_le_pow_of_le_right is in Std.

Lemmas removed

  • self_le_pow was a duplicate of le_self_pow.
  • Nat.pow_lt_pow_of_lt_right is defeq to pow_lt_pow_right.
  • Nat.pow_right_strictMono is defeq to pow_right_strictMono.
  • Nat.pow_le_iff_le_right is defeq to pow_le_pow_iff_right.
  • Nat.pow_lt_iff_lt_right is defeq to pow_lt_pow_iff_right.

Other changes

  • A bunch of proofs have been golfed.
  • Some lemma assumptions have been turned from 0 < n or 1 ≤ n to n ≠ 0.
  • A few Nat lemmas have been protected.
  • One docstring has been fixed.
Diff
@@ -56,7 +56,7 @@ open Classical Topology Filter
 
 open TopologicalSpace Set Metric Filter Function
 
-attribute [local simp] pow_le_pow_iff one_lt_two inv_le_inv zero_le_two zero_lt_two
+attribute [local simp] pow_le_pow_iff_right one_lt_two inv_le_inv zero_le_two zero_lt_two
 
 variable {E : ℕ → Type*}
 
@@ -295,7 +295,7 @@ theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y)
   rcases eq_or_ne y z with (rfl | hyz)
   · simp
   simp only [dist_eq_of_ne, hxz, hxy, hyz, inv_le_inv, one_div, inv_pow, zero_lt_two, Ne.def,
-    not_false_iff, le_max_iff, pow_le_pow_iff, one_lt_two, pow_pos,
+    not_false_iff, le_max_iff, pow_le_pow_iff_right, one_lt_two, pow_pos,
     min_le_iff.1 (min_firstDiff_le x y z hxz)]
 #align pi_nat.dist_triangle_nonarch PiNat.dist_triangle_nonarch
 
@@ -328,7 +328,7 @@ theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2)
   rcases eq_or_ne x y with (rfl | hne)
   · rfl
   have : n < firstDiff x y := by
-    simpa [dist_eq_of_ne hne, inv_lt_inv, pow_lt_pow_iff, one_lt_two] using h
+    simpa [dist_eq_of_ne hne, inv_lt_inv, pow_lt_pow_iff_right, one_lt_two] using h
   exact apply_eq_of_lt_firstDiff (hi.trans_lt this)
 #align pi_nat.apply_eq_of_dist_lt PiNat.apply_eq_of_dist_lt
 
chore: rename by_contra' to by_contra! (#8797)

To fit with the "please try harder" convention of ! tactics.

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

Diff
@@ -90,7 +90,7 @@ theorem firstDiff_comm (x y : ∀ n, E n) : firstDiff x y = firstDiff y x := by
 
 theorem min_firstDiff_le (x y z : ∀ n, E n) (h : x ≠ z) :
     min (firstDiff x y) (firstDiff y z) ≤ firstDiff x z := by
-  by_contra' H
+  by_contra! H
   rw [lt_min_iff] at H
   refine apply_firstDiff_ne h ?_
   calc
@@ -154,7 +154,7 @@ theorem mem_cylinder_iff_le_firstDiff {x y : ∀ n, E n} (hne : x ≠ y) (i : 
     x ∈ cylinder y i ↔ i ≤ firstDiff x y := by
   constructor
   · intro h
-    by_contra'
+    by_contra!
     exact apply_firstDiff_ne hne (h _ this)
   · intro hi j hj
     exact apply_eq_of_lt_firstDiff (hj.trans_le hi)
@@ -317,7 +317,7 @@ theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
   suffices (∀ i : ℕ, i < n → y i = x i) ↔ n ≤ firstDiff y x by simpa [dist_eq_of_ne hne]
   constructor
   · intro hy
-    by_contra' H
+    by_contra! H
     exact apply_firstDiff_ne hne (hy _ H)
   · intro h i hi
     exact apply_eq_of_lt_firstDiff (hi.trans_le h)
@@ -744,7 +744,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [Metr
     have dist' : dist x y = dist x.1 y.1 := rfl
     let n := firstDiff x.1 y.1 - 1
     have diff_pos : 0 < firstDiff x.1 y.1 := by
-      by_contra' h
+      by_contra! h
       apply apply_firstDiff_ne hne'
       rw [le_zero_iff.1 h]
       apply apply_eq_of_dist_lt _ le_rfl
chore: rename lemmas containing "of_open" to match the naming convention (#8229)

Mostly, this means replacing "of_open" by "of_isOpen". A few lemmas names were misleading and are corrected differently. Zulip discussion.

Diff
@@ -363,7 +363,7 @@ theorem isOpen_cylinder (x : ∀ n, E n) (n : ℕ) : IsOpen (cylinder x n) := by
 
 theorem isTopologicalBasis_cylinders :
     IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n) (n : ℕ), s = cylinder x n } := by
-  apply isTopologicalBasis_of_open_of_nhds
+  apply isTopologicalBasis_of_isOpen_of_nhds
   · rintro u ⟨x, n, rfl⟩
     apply isOpen_cylinder
   · intro x u hx u_open
feat: add a few simp lemmas (#8750)
  • Remove simp-lemma bitwise_of_ne_zero, since it wasn't used, and could cause loops in an inconsistent context.
Diff
@@ -308,7 +308,6 @@ protected theorem dist_triangle (x y z : ∀ n, E n) : dist x z ≤ dist x y + d
 protected theorem eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x = y := by
   rcases eq_or_ne x y with (rfl | h); · rfl
   simp [dist_eq_of_ne h] at hxy
-  exact (two_ne_zero (pow_eq_zero hxy)).elim
 #align pi_nat.eq_of_dist_eq_zero PiNat.eq_of_dist_eq_zero
 
 theorem mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} :
chore(InfiniteSum): use dot notation (#8358)

Rename

  • summable_of_norm_bounded -> Summable.of_norm_bounded;
  • summable_of_norm_bounded_eventually -> Summable.of_norm_bounded_eventually;
  • summable_of_nnnorm_bounded -> Summable.of_nnnorm_bounded;
  • summable_of_summable_norm -> Summable.of_norm;
  • summable_of_summable_nnnorm -> Summable.of_nnnorm;

New lemmas

  • Summable.of_norm_bounded_eventually_nat
  • Summable.norm

Misc changes

  • Golf a few proofs.
Diff
@@ -832,7 +832,7 @@ theorem dist_eq_tsum (x y : ∀ i, F i) :
 
 theorem dist_summable (x y : ∀ i, F i) :
     Summable fun i : ι => min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) := by
-  refine summable_of_nonneg_of_le (fun i => ?_) (fun i => min_le_left _ _)
+  refine .of_nonneg_of_le (fun i => ?_) (fun i => min_le_left _ _)
     summable_geometric_two_encode
   exact le_min (pow_nonneg (by norm_num) _) dist_nonneg
 #align pi_countable.dist_summable PiCountable.dist_summable
chore: cleanup typo in filter_upwards (#7719)

mathport was forgetting a space in filter_upwards [...]with instead of filter_upwards [...] with.

Diff
@@ -470,7 +470,7 @@ protected theorem completeSpace : CompleteSpace (∀ n, E n) := by
   intro u hu
   refine' ⟨fun n => u n n, tendsto_pi_nhds.2 fun i => _⟩
   refine' tendsto_const_nhds.congr' _
-  filter_upwards [Filter.Ici_mem_atTop i]with n hn
+  filter_upwards [Filter.Ici_mem_atTop i] with n hn
   exact apply_eq_of_dist_lt (hu i i n le_rfl hn) le_rfl
 #align pi_nat.complete_space PiNat.completeSpace
 
refactor(Topology/MetricSpace): remove Metric.Bounded (#7240)

Use Bornology.IsBounded instead.

Diff
@@ -786,7 +786,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [Metr
       exact
         squeeze_zero (fun n => diam_nonneg) (fun n => diam_closedBall (pow_nonneg I0.le _)) this
     refine nonempty_iInter_of_nonempty_biInter (fun n => isClosed_ball)
-      (fun n => bounded_closedBall) (fun N ↦ ?_) L
+      (fun n => isBounded_closedBall) (fun N ↦ ?_) L
     obtain ⟨y, hxy, ys⟩ : ∃ y, y ∈ ball x ((1 / 2) ^ N) ∩ s :=
       clusterPt_principal_iff.1 hx _ (ball_mem_nhds x (pow_pos I0 N))
     have E :
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

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

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

Diff
@@ -782,7 +782,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [Metr
     have L : Tendsto (fun n : ℕ => diam (closedBall (u (x n)) ((1 / 2) ^ n))) atTop (𝓝 0) := by
       have : Tendsto (fun n : ℕ => (2 : ℝ) * (1 / 2) ^ n) atTop (𝓝 (2 * 0)) :=
         (tendsto_pow_atTop_nhds_0_of_lt_1 I0.le I1).const_mul _
-      rw [MulZeroClass.mul_zero] at this
+      rw [mul_zero] at this
       exact
         squeeze_zero (fun n => diam_nonneg) (fun n => diam_closedBall (pow_nonneg I0.le _)) this
     refine nonempty_iInter_of_nonempty_biInter (fun n => isClosed_ball)
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
@@ -58,7 +58,7 @@ open TopologicalSpace Set Metric Filter Function
 
 attribute [local simp] pow_le_pow_iff one_lt_two inv_le_inv zero_le_two zero_lt_two
 
-variable {E : ℕ → Type _}
+variable {E : ℕ → Type*}
 
 namespace PiNat
 
@@ -191,7 +191,7 @@ theorem update_mem_cylinder (x : ∀ n, E n) (n : ℕ) (y : E n) : update x n y
 
 section Res
 
-variable {α : Type _}
+variable {α : Type*}
 
 open List
 
@@ -336,7 +336,7 @@ theorem apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2)
 /-- A function to a pseudo-metric-space is `1`-Lipschitz if and only if points in the same cylinder
 of length `n` are sent to points within distance `(1/2)^n`.
 Not expressed using `LipschitzWith` as we don't have a metric space structure -/
-theorem lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type _}
+theorem lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type*}
     [PseudoMetricSpace α] {f : (∀ n, E n) → α} :
     (∀ x y : ∀ n, E n, dist (f x) (f y) ≤ dist x y) ↔
       ∀ x y n, y ∈ cylinder x n → dist (f x) (f y) ≤ (1 / 2) ^ n := by
@@ -421,7 +421,7 @@ protected def metricSpace : MetricSpace (∀ n, E n) :=
 /-- Metric space structure on `Π (n : ℕ), E n` when the spaces `E n` have the discrete uniformity,
 where the distance is given by `dist x y = (1/2)^n`, where `n` is the smallest index where `x` and
 `y` differ. Not registered as a global instance by default. -/
-protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type _} [∀ n, UniformSpace (E n)]
+protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type*} [∀ n, UniformSpace (E n)]
     (h : ∀ n, uniformity (E n) = 𝓟 idRel) : MetricSpace (∀ n, E n) :=
   haveI : ∀ n, DiscreteTopology (E n) := fun n => discreteTopology_of_discrete_uniformity (h n)
   { dist_triangle := PiNat.dist_triangle
@@ -503,7 +503,7 @@ theorem exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : 
 /-- Given a point `x` in a product space `Π (n : ℕ), E n`, and `s` a subset of this space, then
 `shortestPrefixDiff x s` if the smallest `n` for which there is no element of `s` having the same
 prefix of length `n` as `x`. If there is no such `n`, then use `0` by convention. -/
-def shortestPrefixDiff {E : ℕ → Type _} (x : ∀ n, E n) (s : Set (∀ n, E n)) : ℕ :=
+def shortestPrefixDiff {E : ℕ → Type*} (x : ∀ n, E n) (s : Set (∀ n, E n)) : ℕ :=
   if h : ∃ n, Disjoint s (cylinder x n) then Nat.find h else 0
 #align pi_nat.shortest_prefix_diff PiNat.shortestPrefixDiff
 
@@ -528,7 +528,7 @@ theorem shortestPrefixDiff_pos {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s
 /-- Given a point `x` in a product space `Π (n : ℕ), E n`, and `s` a subset of this space, then
 `longestPrefix x s` if the largest `n` for which there is an element of `s` having the same
 prefix of length `n` as `x`. If there is no such `n`, use `0` by convention. -/
-def longestPrefix {E : ℕ → Type _} (x : ∀ n, E n) (s : Set (∀ n, E n)) : ℕ :=
+def longestPrefix {E : ℕ → Type*} (x : ∀ n, E n) (s : Set (∀ n, E n)) : ℕ :=
   shortestPrefixDiff x s - 1
 #align pi_nat.longest_prefix PiNat.longestPrefix
 
@@ -719,7 +719,7 @@ open PiNat
 /-- Any nonempty complete second countable metric space is the continuous image of the
 fundamental space `ℕ → ℕ`. For a version of this theorem in the context of Polish spaces, see
 `exists_nat_nat_continuous_surjective_of_polishSpace`. -/
-theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [MetricSpace α]
+theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [MetricSpace α]
     [CompleteSpace α] [SecondCountableTopology α] [Nonempty α] :
     ∃ f : (ℕ → ℕ) → α, Continuous f ∧ Surjective f := by
   /- First, we define a surjective map from a closed subset `s` of `ℕ → ℕ`. Then, we compose
@@ -812,7 +812,7 @@ namespace PiCountable
 -/
 
 
-variable {ι : Type _} [Encodable ι] {F : ι → Type _} [∀ i, MetricSpace (F i)]
+variable {ι : Type*} [Encodable ι] {F : ι → Type*} [∀ i, MetricSpace (F i)]
 
 open Encodable
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

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

Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2022 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.pi_nat
-! leanprover-community/mathlib commit 49b7f94aab3a3bdca1f9f34c5d818afb253b3993
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Topology.MetricSpace.HausdorffDistance
 
+#align_import topology.metric_space.pi_nat from "leanprover-community/mathlib"@"49b7f94aab3a3bdca1f9f34c5d818afb253b3993"
+
 /-!
 # Topological study of spaces `Π (n : ℕ), E n`
 
fix: ∑' precedence (#5615)
  • Also remove most superfluous parentheses around big operators (, and variants).
  • roughly the used regex: ([^a-zA-Zα-ωΑ-Ω'𝓝ℳ₀𝕂ₛ)]) \(([∑∏][^()∑∏]*,[^()∑∏:]*)\) ([⊂⊆=<≤]) replaced by $1 $2 $3
Diff
@@ -877,8 +877,8 @@ protected def metricSpace : MetricSpace (∀ i, F i) where
         _ ≤ min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) +
               min ((1 / 2) ^ encode i : ℝ) (dist (y i) (z i)) :=
           min_le_right _ _
-    calc dist x z ≤ ∑' i, min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) +
-          min ((1 / 2) ^ encode i : ℝ) (dist (y i) (z i)) :=
+    calc dist x z ≤ ∑' i, (min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) +
+          min ((1 / 2) ^ encode i : ℝ) (dist (y i) (z i))) :=
         tsum_le_tsum I (dist_summable x z) ((dist_summable x y).add (dist_summable y z))
       _ = dist x y + dist y z := tsum_add (dist_summable x y) (dist_summable y z)
   edist_dist _ _ := by exact ENNReal.coe_nnreal_eq _
fix: precedences of ⨆⋃⋂⨅ (#5614)
Diff
@@ -175,7 +175,7 @@ theorem cylinder_eq_cylinder_of_le_firstDiff (x y : ∀ n, E n) {n : ℕ} (hn :
 #align pi_nat.cylinder_eq_cylinder_of_le_first_diff PiNat.cylinder_eq_cylinder_of_le_firstDiff
 
 theorem iUnion_cylinder_update (x : ∀ n, E n) (n : ℕ) :
-    (⋃ k, cylinder (update x n k) (n + 1)) = cylinder x n := by
+    ⋃ k, cylinder (update x n k) (n + 1) = cylinder x n := by
   ext y
   simp only [mem_cylinder_iff, mem_iUnion]
   constructor
@@ -793,7 +793,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
     obtain ⟨y, hxy, ys⟩ : ∃ y, y ∈ ball x ((1 / 2) ^ N) ∩ s :=
       clusterPt_principal_iff.1 hx _ (ball_mem_nhds x (pow_pos I0 N))
     have E :
-      (⋂ (n : ℕ) (H : n ≤ N), closedBall (u (x n)) ((1 / 2) ^ n)) =
+      ⋂ (n : ℕ) (H : n ≤ N), closedBall (u (x n)) ((1 / 2) ^ n) =
         ⋂ (n : ℕ) (H : n ≤ N), closedBall (u (y n)) ((1 / 2) ^ n) := by
       refine iInter_congr fun n ↦ iInter_congr fun hn ↦ ?_
       have : x n = y n := apply_eq_of_dist_lt (mem_ball'.1 hxy) hn
fix: change compl precedence (#5586)

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

Diff
@@ -911,14 +911,14 @@ protected def metricSpace : MetricSpace (∀ i, F i) where
         calc
           dist x y = ∑' i : ι, min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) := rfl
           _ = (∑ i in K, min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i))) +
-                ∑' i : ↑((K : Set ι)ᶜ), min ((1 / 2) ^ encode (i : ι) : ℝ) (dist (x i) (y i)) :=
+                ∑' i : ↑(K : Set ι)ᶜ, min ((1 / 2) ^ encode (i : ι) : ℝ) (dist (x i) (y i)) :=
             (sum_add_tsum_compl (dist_summable _ _)).symm
           _ ≤ (∑ i in K, dist (x i) (y i)) +
-                ∑' i : ↑((K : Set ι)ᶜ), ((1 / 2) ^ encode (i : ι) : ℝ) := by
+                ∑' i : ↑(K : Set ι)ᶜ, ((1 / 2) ^ encode (i : ι) : ℝ) := by
             refine' add_le_add (Finset.sum_le_sum fun i _ => min_le_right _ _) _
             refine' tsum_le_tsum (fun i => min_le_left _ _) _ _
-            · apply Summable.subtype (dist_summable x y) ((↑K : Set ι)ᶜ)
-            · apply Summable.subtype summable_geometric_two_encode ((↑K : Set ι)ᶜ)
+            · apply Summable.subtype (dist_summable x y) (↑K : Set ι)ᶜ
+            · apply Summable.subtype summable_geometric_two_encode (↑K : Set ι)ᶜ
           _ < (∑ _i in K, δ) + ε / 2 := by
             apply add_lt_add_of_le_of_lt _ hK
             refine Finset.sum_le_sum fun i hi => (hxy i ?_).le
chore: clean up spacing around at and goals (#5387)

Changes are of the form

  • some_tactic at h⊢ -> some_tactic at h ⊢
  • some_tactic at h -> some_tactic at h
Diff
@@ -661,7 +661,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
           rw [← mem_cylinder_iff_eq]
           apply cylinder_anti x _ A.some_mem.2
           apply firstDiff_le_longestPrefix hs xs ys
-        rw [fs y ys] at hfxfy⊢
+        rw [fs y ys] at hfxfy ⊢
         rwa [← fx, I2, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_firstDiff hfxfy] at I
       -- case where `y ∉ s`
       · have Ax : (s ∩ cylinder x (longestPrefix x s)).Nonempty :=
@@ -684,7 +684,7 @@ theorem exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsC
           congr
         -- case where the common prefix to `x` and `s` is long, as well as the common prefix to
         -- `y` and `s`. Then all points remain in the same cylinders.
-        · push_neg  at H
+        · push_neg at H
           have I1 : cylinder Ax.some (firstDiff x y) = cylinder x (firstDiff x y) := by
             rw [← mem_cylinder_iff_eq]
             exact cylinder_anti x H.1 Ax.some_mem.2
fix(Tactic/PushNeg): add cleanupAnnotations to push_neg (#5082)

Exprs now have an mdata field. It seems that this gets in the way of push_neg, as reported on Zulip.

The above seems to fix the reported errors.

Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>

Diff
@@ -515,7 +515,7 @@ theorem firstDiff_lt_shortestPrefixDiff {s : Set (∀ n, E n)} (hs : IsClosed s)
   have A := exists_disjoint_cylinder hs hx
   rw [shortestPrefixDiff, dif_pos A]
   have B := Nat.find_spec A
-  contrapose! B; rw [not_lt] at B -- porting note: why this `rw` is needed?
+  contrapose! B
   rw [not_disjoint_iff_nonempty_inter]
   refine' ⟨y, hy, _⟩
   rw [mem_cylinder_comm]
chore: formatting issues (#4947)

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

Diff
@@ -366,7 +366,7 @@ theorem isOpen_cylinder (x : ∀ n, E n) (n : ℕ) : IsOpen (cylinder x n) := by
 #align pi_nat.is_open_cylinder PiNat.isOpen_cylinder
 
 theorem isTopologicalBasis_cylinders :
-    IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n)(n : ℕ), s = cylinder x n } := by
+    IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n) (n : ℕ), s = cylinder x n } := by
   apply isTopologicalBasis_of_open_of_nhds
   · rintro u ⟨x, n, rfl⟩
     apply isOpen_cylinder
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
@@ -174,10 +174,10 @@ theorem cylinder_eq_cylinder_of_le_firstDiff (x y : ∀ n, E n) {n : ℕ} (hn :
   exact apply_eq_of_lt_firstDiff (hi.trans_le hn)
 #align pi_nat.cylinder_eq_cylinder_of_le_first_diff PiNat.cylinder_eq_cylinder_of_le_firstDiff
 
-theorem unionᵢ_cylinder_update (x : ∀ n, E n) (n : ℕ) :
+theorem iUnion_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     (⋃ k, cylinder (update x n k) (n + 1)) = cylinder x n := by
   ext y
-  simp only [mem_cylinder_iff, mem_unionᵢ]
+  simp only [mem_cylinder_iff, mem_iUnion]
   constructor
   · rintro ⟨k, hk⟩ i hi
     simpa [hi.ne] using hk i (Nat.lt_succ_of_lt hi)
@@ -186,7 +186,7 @@ theorem unionᵢ_cylinder_update (x : ∀ n, E n) (n : ℕ) :
     rcases Nat.lt_succ_iff_lt_or_eq.1 hi with (h'i | rfl)
     · simp [H i h'i, h'i.ne]
     · simp
-#align pi_nat.Union_cylinder_update PiNat.unionᵢ_cylinder_update
+#align pi_nat.Union_cylinder_update PiNat.iUnion_cylinder_update
 
 theorem update_mem_cylinder (x : ∀ n, E n) (n : ℕ) (y : E n) : update x n y ∈ cylinder x n :=
   mem_cylinder_iff.2 fun i hi => by simp [hi.ne]
@@ -434,26 +434,26 @@ protected def metricSpaceOfDiscreteUniformity {E : ℕ → Type _} [∀ n, Unifo
     edist_dist := fun _ _ ↦ by exact ENNReal.coe_nnreal_eq _
     toUniformSpace := Pi.uniformSpace _
     uniformity_dist := by
-      simp [Pi.uniformity, comap_infᵢ, gt_iff_lt, preimage_setOf_eq, comap_principal,
+      simp [Pi.uniformity, comap_iInf, gt_iff_lt, preimage_setOf_eq, comap_principal,
         PseudoMetricSpace.uniformity_dist, h, idRel]
       apply le_antisymm
-      · simp only [le_infᵢ_iff, le_principal_iff]
+      · simp only [le_iInf_iff, le_principal_iff]
         intro ε εpos
         obtain ⟨n, hn⟩ : ∃ n, (1 / 2 : ℝ) ^ n < ε := exists_pow_lt_of_lt_one εpos (by norm_num)
         apply
-          @mem_infᵢ_of_interᵢ _ _ _ _ _ (Finset.range n).finite_toSet fun i =>
+          @mem_iInf_of_iInter _ _ _ _ _ (Finset.range n).finite_toSet fun i =>
             { p : (∀ n : ℕ, E n) × ∀ n : ℕ, E n | p.fst i = p.snd i }
         · simp only [mem_principal, setOf_subset_setOf, imp_self, imp_true_iff]
         · rintro ⟨x, y⟩ hxy
-          simp only [Finset.mem_coe, Finset.mem_range, interᵢ_coe_set, mem_interᵢ, mem_setOf_eq]
+          simp only [Finset.mem_coe, Finset.mem_range, iInter_coe_set, mem_iInter, mem_setOf_eq]
             at hxy
           apply lt_of_le_of_lt _ hn
           rw [← mem_cylinder_iff_dist_le, mem_cylinder_iff]
           exact hxy
-      · simp only [le_infᵢ_iff, le_principal_iff]
+      · simp only [le_iInf_iff, le_principal_iff]
         intro n
-        refine' mem_infᵢ_of_mem ((1 / 2) ^ n : ℝ) _
-        refine' mem_infᵢ_of_mem (by positivity) _
+        refine' mem_iInf_of_mem ((1 / 2) ^ n : ℝ) _
+        refine' mem_iInf_of_mem (by positivity) _
         simp only [mem_principal, setOf_subset_setOf, Prod.forall]
         intro x y hxy
         exact apply_eq_of_dist_lt hxy le_rfl }
@@ -738,7 +738,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
   let s : Set (ℕ → ℕ) := { x | (⋂ n : ℕ, closedBall (u (x n)) ((1 / 2) ^ n)).Nonempty }
   let g : s → α := fun x => x.2.some
   have A : ∀ (x : s) (n : ℕ), dist (g x) (u ((x : ℕ → ℕ) n)) ≤ (1 / 2) ^ n := fun x n =>
-    (mem_interᵢ.1 x.2.some_mem n : _)
+    (mem_iInter.1 x.2.some_mem n : _)
   have g_cont : Continuous g := by
     refine continuous_iff_continuousAt.2 fun y => ?_
     refine continuousAt_of_locally_lipschitz zero_lt_one 4 fun x hxy => ?_
@@ -768,7 +768,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
       rcases hu.exists_dist_lt y (by simp : (0 : ℝ) < (1 / 2) ^ n) with ⟨j, hj⟩
       exact ⟨j, hj.le⟩
     choose x hx using this
-    have I : (⋂ n : ℕ, closedBall (u (x n)) ((1 / 2) ^ n)).Nonempty := ⟨y, mem_interᵢ.2 hx⟩
+    have I : (⋂ n : ℕ, closedBall (u (x n)) ((1 / 2) ^ n)).Nonempty := ⟨y, mem_iInter.2 hx⟩
     refine' ⟨⟨x, I⟩, _⟩
     refine' dist_le_zero.1 _
     have J : ∀ n : ℕ, dist (g ⟨x, I⟩) y ≤ (1 / 2) ^ n + (1 / 2) ^ n := fun n =>
@@ -788,19 +788,19 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type _) [Met
       rw [MulZeroClass.mul_zero] at this
       exact
         squeeze_zero (fun n => diam_nonneg) (fun n => diam_closedBall (pow_nonneg I0.le _)) this
-    refine nonempty_interᵢ_of_nonempty_binterᵢ (fun n => isClosed_ball)
+    refine nonempty_iInter_of_nonempty_biInter (fun n => isClosed_ball)
       (fun n => bounded_closedBall) (fun N ↦ ?_) L
     obtain ⟨y, hxy, ys⟩ : ∃ y, y ∈ ball x ((1 / 2) ^ N) ∩ s :=
       clusterPt_principal_iff.1 hx _ (ball_mem_nhds x (pow_pos I0 N))
     have E :
       (⋂ (n : ℕ) (H : n ≤ N), closedBall (u (x n)) ((1 / 2) ^ n)) =
         ⋂ (n : ℕ) (H : n ≤ N), closedBall (u (y n)) ((1 / 2) ^ n) := by
-      refine interᵢ_congr fun n ↦ interᵢ_congr fun hn ↦ ?_
+      refine iInter_congr fun n ↦ iInter_congr fun hn ↦ ?_
       have : x n = y n := apply_eq_of_dist_lt (mem_ball'.1 hxy) hn
       rw [this]
     rw [E]
     apply Nonempty.mono _ ys
-    apply interᵢ_subset_interᵢ₂
+    apply iInter_subset_iInter₂
   obtain ⟨f, -, f_surj, f_cont⟩ :
     ∃ f : (ℕ → ℕ) → s, (∀ x : s, f x = x) ∧ Surjective f ∧ Continuous f := by
     apply exists_retraction_subtype_of_isClosed s_closed
@@ -890,10 +890,10 @@ protected def metricSpace : MetricSpace (∀ i, F i) where
     simp
   toUniformSpace := Pi.uniformSpace _
   uniformity_dist := by
-    simp only [Pi.uniformity, comap_infᵢ, gt_iff_lt, preimage_setOf_eq, comap_principal,
+    simp only [Pi.uniformity, comap_iInf, gt_iff_lt, preimage_setOf_eq, comap_principal,
       PseudoMetricSpace.uniformity_dist]
     apply le_antisymm
-    · simp only [le_infᵢ_iff, le_principal_iff]
+    · simp only [le_iInf_iff, le_principal_iff]
       intro ε εpos
       obtain ⟨K, hK⟩ :
         ∃ K : Finset ι, (∑' i : { j // j ∉ K }, (1 / 2 : ℝ) ^ encode (i : ι)) < ε / 2 :=
@@ -901,13 +901,13 @@ protected def metricSpace : MetricSpace (∀ i, F i) where
             (half_pos εpos)).exists
       obtain ⟨δ, δpos, hδ⟩ : ∃ δ : ℝ, 0 < δ ∧ (K.card : ℝ) * δ < ε / 2 :=
         exists_pos_mul_lt (half_pos εpos) _
-      apply @mem_infᵢ_of_interᵢ _ _ _ _ _ K.finite_toSet fun i =>
+      apply @mem_iInf_of_iInter _ _ _ _ _ K.finite_toSet fun i =>
           { p : (∀ i : ι, F i) × ∀ i : ι, F i | dist (p.fst i) (p.snd i) < δ }
       · rintro ⟨i, hi⟩
-        refine' mem_infᵢ_of_mem δ (mem_infᵢ_of_mem δpos _)
+        refine' mem_iInf_of_mem δ (mem_iInf_of_mem δpos _)
         simp only [Prod.forall, imp_self, mem_principal, Subset.rfl]
       · rintro ⟨x, y⟩ hxy
-        simp only [mem_interᵢ, mem_setOf_eq, SetCoe.forall, Finset.mem_range, Finset.mem_coe] at hxy
+        simp only [mem_iInter, mem_setOf_eq, SetCoe.forall, Finset.mem_range, Finset.mem_coe] at hxy
         calc
           dist x y = ∑' i : ι, min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) := rfl
           _ = (∑ i in K, min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i))) +
@@ -926,11 +926,11 @@ protected def metricSpace : MetricSpace (∀ i, F i) where
           _ ≤ ε / 2 + ε / 2 :=
             (add_le_add_right (by simpa only [Finset.sum_const, nsmul_eq_mul] using hδ.le) _)
           _ = ε := add_halves _
-    · simp only [le_infᵢ_iff, le_principal_iff]
+    · simp only [le_iInf_iff, le_principal_iff]
       intro i ε εpos
-      refine' mem_infᵢ_of_mem (min ((1 / 2) ^ encode i : ℝ) ε) _
+      refine' mem_iInf_of_mem (min ((1 / 2) ^ encode i : ℝ) ε) _
       have : 0 < min ((1 / 2) ^ encode i : ℝ) ε := lt_min (by simp) εpos
-      refine' mem_infᵢ_of_mem this _
+      refine' mem_iInf_of_mem this _
       simp only [and_imp, Prod.forall, setOf_subset_setOf, lt_min_iff, mem_principal]
       intro x y hn hε
       calc
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.pi_nat
-! leanprover-community/mathlib commit e1a7bdeb4fd826b7e71d130d34988f0a2d26a177
+! leanprover-community/mathlib commit 49b7f94aab3a3bdca1f9f34c5d818afb253b3993
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -192,6 +192,69 @@ theorem update_mem_cylinder (x : ∀ n, E n) (n : ℕ) (y : E n) : update x n y
   mem_cylinder_iff.2 fun i hi => by simp [hi.ne]
 #align pi_nat.update_mem_cylinder PiNat.update_mem_cylinder
 
+section Res
+
+variable {α : Type _}
+
+open List
+
+/-- In the case where `E` has constant value `α`,
+the cylinder `cylinder x n` can be identified with the element of `List α`
+consisting of the first `n` entries of `x`. See `cylinder_eq_res`.
+We call this list `res x n`, the restriction of `x` to `n`.-/
+def res (x : ℕ → α) : ℕ → List α
+  | 0 => nil
+  | Nat.succ n => x n :: res x n
+#align pi_nat.res PiNat.res
+
+@[simp]
+theorem res_zero (x : ℕ → α) : res x 0 = @nil α :=
+  rfl
+#align pi_nat.res_zero PiNat.res_zero
+
+@[simp]
+theorem res_succ (x : ℕ → α) (n : ℕ) : res x n.succ = x n :: res x n :=
+  rfl
+#align pi_nat.res_succ PiNat.res_succ
+
+@[simp]
+theorem res_length (x : ℕ → α) (n : ℕ) : (res x n).length = n := by induction n <;> simp [*]
+#align pi_nat.res_length PiNat.res_length
+
+/-- The restrictions of `x` and `y` to `n` are equal if and only if `x m = y m` for all `m < n`.-/
+theorem res_eq_res {x y : ℕ → α} {n : ℕ} :
+    res x n = res y n ↔ ∀ ⦃m⦄, m < n → x m = y m := by
+  constructor <;> intro h <;> induction' n with n ih; · simp
+  · intro m hm
+    rw [Nat.lt_succ_iff_lt_or_eq] at hm
+    simp only [res_succ, cons.injEq] at h
+    cases' hm with hm hm
+    · exact ih h.2 hm
+    rw [hm]
+    exact h.1
+  · simp
+  simp only [res_succ, cons.injEq]
+  refine' ⟨h (Nat.lt_succ_self _), ih fun m hm => _⟩
+  exact h (hm.trans (Nat.lt_succ_self _))
+#align pi_nat.res_eq_res PiNat.res_eq_res
+
+theorem res_injective : Injective (@res α) := by
+  intro x y h
+  ext n
+  apply res_eq_res.mp _ (Nat.lt_succ_self _)
+  rw [h]
+#align pi_nat.res_injective PiNat.res_injective
+
+/-- `cylinder x n` is equal to the set of sequences `y` with the same restriction to `n` as `x`.-/
+theorem cylinder_eq_res (x : ℕ → α) (n : ℕ) :
+    cylinder x n = { y | res y n = res x n } := by
+  ext y
+  dsimp [cylinder]
+  rw [res_eq_res]
+#align pi_nat.cylinder_eq_res PiNat.cylinder_eq_res
+
+end Res
+
 /-!
 ### A distance function on `Π n, E n`
 
@@ -297,12 +360,16 @@ theorem lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type _
 variable (E)
 variable [∀ n, TopologicalSpace (E n)] [∀ n, DiscreteTopology (E n)]
 
+theorem isOpen_cylinder (x : ∀ n, E n) (n : ℕ) : IsOpen (cylinder x n) := by
+  rw [PiNat.cylinder_eq_pi]
+  exact isOpen_set_pi (Finset.range n).finite_toSet fun a _ => isOpen_discrete _
+#align pi_nat.is_open_cylinder PiNat.isOpen_cylinder
+
 theorem isTopologicalBasis_cylinders :
     IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n)(n : ℕ), s = cylinder x n } := by
   apply isTopologicalBasis_of_open_of_nhds
   · rintro u ⟨x, n, rfl⟩
-    rw [cylinder_eq_pi]
-    exact isOpen_set_pi (Finset.range n).finite_toSet fun a _ => isOpen_discrete _
+    apply isOpen_cylinder
   · intro x u hx u_open
     obtain ⟨v, ⟨U, F, -, rfl⟩, xU, Uu⟩ :
         ∃ v ∈ { S : Set (∀ i : ℕ, E i) | ∃ (U : ∀ i : ℕ, Set (E i)) (F : Finset ℕ),
feat: port Topology.MetricSpace.PiNat (#3344)

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

Dependencies 10 + 601

602 files ported (98.4%)
265011 lines ported (98.0%)
Show graph

The unported dependencies are

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