File: Mathlib/Topology/EMetricSpace/Basic.lean

full_name: uniformity_dist_of_mem_uniformity
code: /-- Characterizing uniformities associated to a (generalized) distance function `D`
in terms of the elements of the uniformity. -/
theorem uniformity_dist_of_mem_uniformity [LinearOrder β] {U : Filter (α × α)} (z : β)
    (D : α → α → β) (H : ∀ s, s ∈ U ↔ ∃ ε > z, ∀ {a b : α}, D a b < ε → (a, b) ∈ s) :
    U = ⨅ ε > z, 𝓟 { p : α × α | D p.1 p.2 < ε } 
goal: U = ⨅ ε, ⨅ (_ : ε > z), 𝓟 {p | D p.1 p.2 < ε}

full_name: EDist
code: /-- `EDist α` means that `α` is equipped with an extended distance. -/
@[ext]
class EDist (α : Type*) where
  edist : α → α → ℝ≥0∞
goal: Type u_2

full_name: EDist.edist
code: /-- `EDist α` means that `α` is equipped with an extended distance. -/
@[ext]
class EDist (α : Type*) where
  edist : α → α → ℝ≥0∞
goal: α → α → ℝ≥0∞

full_name: uniformSpaceOfEDist
code: /-- Creating a uniform space from an extended distance. -/
def uniformSpaceOfEDist (edist : α → α → ℝ≥0∞) (edist_self : ∀ x : α, edist x x = 0)
    (edist_comm : ∀ x y : α, edist x y = edist y x)
    (edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z) : UniformSpace α 
goal: UniformSpace α

full_name: PseudoEMetricSpace.edist_self
code: /-- Extended (pseudo) metric spaces, with an extended distance `edist` possibly taking the
value ∞

Each pseudo_emetric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace`.
This is enforced in the type class definition, by extending the `UniformSpace` structure. When
instantiating a `PseudoEMetricSpace` structure, the uniformity fields are not necessary, they
will be filled in by default. There is a default value for the uniformity, that can be substituted
in cases of interest, for instance when instantiating a `PseudoEMetricSpace` structure
on a product.

Continuity of `edist` is proved in `Topology.Instances.ENNReal`
-/
class PseudoEMetricSpace (α : Type u) extends EDist α : Type u where
  edist_self : ∀ x : α, edist x x = 0
  edist_comm : ∀ x y : α, edist x y = edist y x
  edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z
  toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle
  uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl
goal: edist x x = 0

full_name: PseudoEMetricSpace.edist_triangle
code: /-- Extended (pseudo) metric spaces, with an extended distance `edist` possibly taking the
value ∞

Each pseudo_emetric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace`.
This is enforced in the type class definition, by extending the `UniformSpace` structure. When
instantiating a `PseudoEMetricSpace` structure, the uniformity fields are not necessary, they
will be filled in by default. There is a default value for the uniformity, that can be substituted
in cases of interest, for instance when instantiating a `PseudoEMetricSpace` structure
on a product.

Continuity of `edist` is proved in `Topology.Instances.ENNReal`
-/
class PseudoEMetricSpace (α : Type u) extends EDist α : Type u where
  edist_self : ∀ x : α, edist x x = 0
  edist_comm : ∀ x y : α, edist x y = edist y x
  edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z
  toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle
  uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl
goal: edist x z ≤ edist x y + edist y z

full_name: PseudoEMetricSpace.edist_comm
code: /-- Extended (pseudo) metric spaces, with an extended distance `edist` possibly taking the
value ∞

Each pseudo_emetric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace`.
This is enforced in the type class definition, by extending the `UniformSpace` structure. When
instantiating a `PseudoEMetricSpace` structure, the uniformity fields are not necessary, they
will be filled in by default. There is a default value for the uniformity, that can be substituted
in cases of interest, for instance when instantiating a `PseudoEMetricSpace` structure
on a product.

Continuity of `edist` is proved in `Topology.Instances.ENNReal`
-/
class PseudoEMetricSpace (α : Type u) extends EDist α : Type u where
  edist_self : ∀ x : α, edist x x = 0
  edist_comm : ∀ x y : α, edist x y = edist y x
  edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z
  toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle
  uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl
goal: edist x y = edist y x

full_name: PseudoEMetricSpace.uniformity_edist
code: /-- Extended (pseudo) metric spaces, with an extended distance `edist` possibly taking the
value ∞

Each pseudo_emetric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace`.
This is enforced in the type class definition, by extending the `UniformSpace` structure. When
instantiating a `PseudoEMetricSpace` structure, the uniformity fields are not necessary, they
will be filled in by default. There is a default value for the uniformity, that can be substituted
in cases of interest, for instance when instantiating a `PseudoEMetricSpace` structure
on a product.

Continuity of `edist` is proved in `Topology.Instances.ENNReal`
-/
class PseudoEMetricSpace (α : Type u) extends EDist α : Type u where
  edist_self : ∀ x : α, edist x x = 0
  edist_comm : ∀ x y : α, edist x y = edist y x
  edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z
  toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle
  uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl
goal: 𝓤 α = ⨅ ε, ⨅ (_ : ε > 0), 𝓟 {p | edist p.1 p.2 < ε}

full_name: PseudoEMetricSpace
code: /-- Extended (pseudo) metric spaces, with an extended distance `edist` possibly taking the
value ∞

Each pseudo_emetric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace`.
This is enforced in the type class definition, by extending the `UniformSpace` structure. When
instantiating a `PseudoEMetricSpace` structure, the uniformity fields are not necessary, they
will be filled in by default. There is a default value for the uniformity, that can be substituted
in cases of interest, for instance when instantiating a `PseudoEMetricSpace` structure
on a product.

Continuity of `edist` is proved in `Topology.Instances.ENNReal`
-/
class PseudoEMetricSpace (α : Type u) extends EDist α : Type u where
  edist_self : ∀ x : α, edist x x = 0
  edist_comm : ∀ x y : α, edist x y = edist y x
  edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z
  toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle
  uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl
goal: Type u

full_name: PseudoEMetricSpace.toUniformSpace
code: /-- Extended (pseudo) metric spaces, with an extended distance `edist` possibly taking the
value ∞

Each pseudo_emetric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace`.
This is enforced in the type class definition, by extending the `UniformSpace` structure. When
instantiating a `PseudoEMetricSpace` structure, the uniformity fields are not necessary, they
will be filled in by default. There is a default value for the uniformity, that can be substituted
in cases of interest, for instance when instantiating a `PseudoEMetricSpace` structure
on a product.

Continuity of `edist` is proved in `Topology.Instances.ENNReal`
-/
class PseudoEMetricSpace (α : Type u) extends EDist α : Type u where
  edist_self : ∀ x : α, edist x x = 0
  edist_comm : ∀ x y : α, edist x y = edist y x
  edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z
  toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle
  uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl
goal: UniformSpace α

full_name: PseudoEMetricSpace.ext
code: /-- Two pseudo emetric space structures with the same edistance function coincide. -/
@[ext]
protected theorem PseudoEMetricSpace.ext {α : Type*} {m m' : PseudoEMetricSpace α}
    (h : m.toEDist = m'.toEDist) : m = m' 
goal: m = m'

full_name: edist_triangle_left
code: /-- Triangle inequality for the extended distance -/
theorem edist_triangle_left (x y z : α) : edist x y ≤ edist z x + edist z y 
goal: edist x y ≤ edist z x + edist z y

full_name: edist_triangle_right
code: theorem edist_triangle_right (x y z : α) : edist x y ≤ edist x z + edist y z 
goal: edist x y ≤ edist x z + edist y z

full_name: edist_congr_right
code: theorem edist_congr_right {x y z : α} (h : edist x y = 0) : edist x z = edist y z 
goal: edist x z = edist y z

full_name: edist_congr_left
code: theorem edist_congr_left {x y z : α} (h : edist x y = 0) : edist z x = edist z y 
goal: edist z x = edist z y

full_name: edist_congr
code: theorem edist_congr {w x y z : α} (hl : edist w x = 0) (hr : edist y z = 0) :
    edist w y = edist x z 
goal: edist w y = edist x z

full_name: edist_triangle4
code: theorem edist_triangle4 (x y z t : α) : edist x t ≤ edist x y + edist y z + edist z t 
goal: edist x t ≤ edist x y + edist y z + edist z t

full_name: edist_le_Ico_sum_edist
code: /-- The triangle (polygon) inequality for sequences of points; `Finset.Ico` version. -/
theorem edist_le_Ico_sum_edist (f : ℕ → α) {m n} (h : m ≤ n) :
    edist (f m) (f n) ≤ ∑ i ∈ Finset.Ico m n, edist (f i) (f (i + 1)) 
goal: edist (f m) (f n) ≤ ∑ i ∈ Finset.Ico m n, edist (f i) (f (i + 1))

full_name: edist_le_range_sum_edist
code: /-- The triangle (polygon) inequality for sequences of points; `Finset.range` version. -/
theorem edist_le_range_sum_edist (f : ℕ → α) (n : ℕ) :
    edist (f 0) (f n) ≤ ∑ i ∈ Finset.range n, edist (f i) (f (i + 1)) 
goal: edist (f 0) (f n) ≤ ∑ i ∈ Finset.range n, edist (f i) (f (i + 1))

full_name: edist_le_Ico_sum_of_edist_le
code: /-- A version of `edist_le_Ico_sum_edist` with each intermediate distance replaced
with an upper estimate. -/
theorem edist_le_Ico_sum_of_edist_le {f : ℕ → α} {m n} (hmn : m ≤ n) {d : ℕ → ℝ≥0∞}
    (hd : ∀ {k}, m ≤ k → k < n → edist (f k) (f (k + 1)) ≤ d k) :
    edist (f m) (f n) ≤ ∑ i ∈ Finset.Ico m n, d i 
goal: edist (f m) (f n) ≤ ∑ i ∈ Finset.Ico m n, d i

full_name: edist_le_range_sum_of_edist_le
code: /-- A version of `edist_le_range_sum_edist` with each intermediate distance replaced
with an upper estimate. -/
theorem edist_le_range_sum_of_edist_le {f : ℕ → α} (n : ℕ) {d : ℕ → ℝ≥0∞}
    (hd : ∀ {k}, k < n → edist (f k) (f (k + 1)) ≤ d k) :
    edist (f 0) (f n) ≤ ∑ i ∈ Finset.range n, d i 
goal: edist (f 0) (f n) ≤ ∑ i ∈ Finset.range n, d i

full_name: uniformity_pseudoedist
code: /-- Reformulation of the uniform structure in terms of the extended distance -/
theorem uniformity_pseudoedist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } 
goal: 𝓤 α = ⨅ ε, ⨅ (_ : ε > 0), 𝓟 {p | edist p.1 p.2 < ε}

full_name: uniformSpace_edist
code: theorem uniformSpace_edist :
    ‹PseudoEMetricSpace α›.toUniformSpace =
      uniformSpaceOfEDist edist edist_self edist_comm edist_triangle 
goal: PseudoEMetricSpace.toUniformSpace = uniformSpaceOfEDist edist ⋯ ⋯ ⋯

full_name: uniformity_basis_edist
code: theorem uniformity_basis_edist :
    (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 < ε } 
goal: (𝓤 α).HasBasis (fun ε => 0 < ε) fun ε => {p | edist p.1 p.2 < ε}

full_name: mem_uniformity_edist
code: /-- Characterization of the elements of the uniformity in terms of the extended distance -/
theorem mem_uniformity_edist {s : Set (α × α)} :
    s ∈ 𝓤 α ↔ ∃ ε > 0, ∀ {a b : α}, edist a b < ε → (a, b) ∈ s 
goal: s ∈ 𝓤 α ↔ ∃ ε > 0, ∀ {a b : α}, edist a b < ε → (a, b) ∈ s

full_name: EMetric.mk_uniformity_basis
code: /-- Given `f : β → ℝ≥0∞`, if `f` sends `{i | p i}` to a set of positive numbers
accumulating to zero, then `f i`-neighborhoods of the diagonal form a basis of `𝓤 α`.

For specific bases see `uniformity_basis_edist`, `uniformity_basis_edist'`,
`uniformity_basis_edist_nnreal`, and `uniformity_basis_edist_inv_nat`. -/
protected theorem EMetric.mk_uniformity_basis {β : Type*} {p : β → Prop} {f : β → ℝ≥0∞}
    (hf₀ : ∀ x, p x → 0 < f x) (hf : ∀ ε, 0 < ε → ∃ x, p x ∧ f x ≤ ε) :
    (𝓤 α).HasBasis p fun x => { p : α × α | edist p.1 p.2 < f x } 
goal: (𝓤 α).HasBasis p fun x => {p | edist p.1 p.2 < f x}

full_name: EMetric.mk_uniformity_basis_le
code: /-- Given `f : β → ℝ≥0∞`, if `f` sends `{i | p i}` to a set of positive numbers
accumulating to zero, then closed `f i`-neighborhoods of the diagonal form a basis of `𝓤 α`.

For specific bases see `uniformity_basis_edist_le` and `uniformity_basis_edist_le'`. -/
protected theorem EMetric.mk_uniformity_basis_le {β : Type*} {p : β → Prop} {f : β → ℝ≥0∞}
    (hf₀ : ∀ x, p x → 0 < f x) (hf : ∀ ε, 0 < ε → ∃ x, p x ∧ f x ≤ ε) :
    (𝓤 α).HasBasis p fun x => { p : α × α | edist p.1 p.2 ≤ f x } 
goal: (𝓤 α).HasBasis p fun x => {p | edist p.1 p.2 ≤ f x}

full_name: uniformity_basis_edist_le
code: theorem uniformity_basis_edist_le :
    (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 ≤ ε } 
goal: (𝓤 α).HasBasis (fun ε => 0 < ε) fun ε => {p | edist p.1 p.2 ≤ ε}

full_name: uniformity_basis_edist'
code: theorem uniformity_basis_edist' (ε' : ℝ≥0∞) (hε' : 0 < ε') :
    (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => ε ∈ Ioo 0 ε') fun ε => { p : α × α | edist p.1 p.2 < ε } 
goal: (𝓤 α).HasBasis (fun ε => ε ∈ Set.Ioo 0 ε') fun ε => {p | edist p.1 p.2 < ε}

full_name: uniformity_basis_edist_le'
code: theorem uniformity_basis_edist_le' (ε' : ℝ≥0∞) (hε' : 0 < ε') :
    (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => ε ∈ Ioo 0 ε') fun ε => { p : α × α | edist p.1 p.2 ≤ ε } 
goal: (𝓤 α).HasBasis (fun ε => ε ∈ Set.Ioo 0 ε') fun ε => {p | edist p.1 p.2 ≤ ε}

full_name: uniformity_basis_edist_nnreal
code: theorem uniformity_basis_edist_nnreal :
    (𝓤 α).HasBasis (fun ε : ℝ≥0 => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 < ε } 
goal: (𝓤 α).HasBasis (fun ε => 0 < ε) fun ε => {p | edist p.1 p.2 < ↑ε}

full_name: uniformity_basis_edist_nnreal_le
code: theorem uniformity_basis_edist_nnreal_le :
    (𝓤 α).HasBasis (fun ε : ℝ≥0 => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 ≤ ε } 
goal: (𝓤 α).HasBasis (fun ε => 0 < ε) fun ε => {p | edist p.1 p.2 ≤ ↑ε}

full_name: uniformity_basis_edist_inv_nat
code: theorem uniformity_basis_edist_inv_nat :
    (𝓤 α).HasBasis (fun _ => True) fun n : ℕ => { p : α × α | edist p.1 p.2 < (↑n)⁻¹ } 
goal: (𝓤 α).HasBasis (fun x => True) fun n => {p | edist p.1 p.2 < (↑n)⁻¹}

full_name: uniformity_basis_edist_inv_two_pow
code: theorem uniformity_basis_edist_inv_two_pow :
    (𝓤 α).HasBasis (fun _ => True) fun n : ℕ => { p : α × α | edist p.1 p.2 < 2⁻¹ ^ n } 
goal: (𝓤 α).HasBasis (fun x => True) fun n => {p | edist p.1 p.2 < 2⁻¹ ^ n}

full_name: edist_mem_uniformity
code: /-- Fixed size neighborhoods of the diagonal belong to the uniform structure -/
theorem edist_mem_uniformity {ε : ℝ≥0∞} (ε0 : 0 < ε) : { p : α × α | edist p.1 p.2 < ε } ∈ 𝓤 α 
goal: {p | edist p.1 p.2 < ε} ∈ 𝓤 α

full_name: EMetric.instIsCountablyGeneratedUniformity
code: instance (priority := 900) instIsCountablyGeneratedUniformity : IsCountablyGenerated (𝓤 α) 
goal: (𝓤 α).IsCountablyGenerated

full_name: EMetric.uniformContinuousOn_iff
code: /-- ε-δ characterization of uniform continuity on a set for pseudoemetric spaces -/
theorem uniformContinuousOn_iff [PseudoEMetricSpace β] {f : α → β} {s : Set α} :
    UniformContinuousOn f s ↔
      ∀ ε > 0, ∃ δ > 0, ∀ {a}, a ∈ s → ∀ {b}, b ∈ s → edist a b < δ → edist (f a) (f b) < ε 
goal: UniformContinuousOn f s ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a : α}, a ∈ s → ∀ {b : α}, b ∈ s → edist a b < δ → edist (f a) (f b) < ε

full_name: EMetric.uniformContinuous_iff
code: /-- ε-δ characterization of uniform continuity on pseudoemetric spaces -/
theorem uniformContinuous_iff [PseudoEMetricSpace β] {f : α → β} :
    UniformContinuous f ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a b : α}, edist a b < δ → edist (f a) (f b) < ε 
goal: UniformContinuous f ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a b : α}, edist a b < δ → edist (f a) (f b) < ε

full_name: EMetric.uniformInducing_iff
code: theorem uniformInducing_iff [PseudoEMetricSpace β] {f : α → β} :
    UniformInducing f ↔ UniformContinuous f ∧
      ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, edist (f a) (f b) < ε → edist a b < δ 
goal: UniformInducing f ↔ UniformContinuous f ∧ ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, edist (f a) (f b) < ε → edist a b < δ

full_name: EMetric.uniformEmbedding_iff
code: /-- ε-δ characterization of uniform embeddings on pseudoemetric spaces -/
nonrec theorem uniformEmbedding_iff [PseudoEMetricSpace β] {f : α → β} :
    UniformEmbedding f ↔ Function.Injective f ∧ UniformContinuous f ∧
      ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, edist (f a) (f b) < ε → edist a b < δ 
goal: UniformEmbedding f ↔
  Function.Injective f ∧ UniformContinuous f ∧ ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, edist (f a) (f b) < ε → edist a b < δ

full_name: EMetric.controlled_of_uniformEmbedding
code: /-- If a map between pseudoemetric spaces is a uniform embedding then the edistance between `f x`
and `f y` is controlled in terms of the distance between `x` and `y`.

In fact, this lemma holds for a `UniformInducing` map.
TODO: generalize? -/
theorem controlled_of_uniformEmbedding [PseudoEMetricSpace β] {f : α → β} (h : UniformEmbedding f) :
    (∀ ε > 0, ∃ δ > 0, ∀ {a b : α}, edist a b < δ → edist (f a) (f b) < ε) ∧
      ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, edist (f a) (f b) < ε → edist a b < δ 
goal: (∀ ε > 0, ∃ δ > 0, ∀ {a b : α}, edist a b < δ → edist (f a) (f b) < ε) ∧
  ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, edist (f a) (f b) < ε → edist a b < δ

full_name: EMetric.cauchy_iff
code: /-- ε-δ characterization of Cauchy sequences on pseudoemetric spaces -/
protected theorem cauchy_iff {f : Filter α} :
    Cauchy f ↔ f ≠ ⊥ ∧ ∀ ε > 0, ∃ t ∈ f, ∀ x, x ∈ t → ∀ y, y ∈ t → edist x y < ε 
goal: Cauchy f ↔ f ≠ ⊥ ∧ ∀ ε > 0, ∃ t ∈ f, ∀ x ∈ t, ∀ y ∈ t, edist x y < ε

full_name: EMetric.complete_of_convergent_controlled_sequences
code: /-- A very useful criterion to show that a space is complete is to show that all sequences
which satisfy a bound of the form `edist (u n) (u m) < B N` for all `n m ≥ N` are
converging. This is often applied for `B N = 2^{-N}`, i.e., with a very fast convergence to
`0`, which makes it possible to use arguments of converging series, while this is impossible
to do in general for arbitrary Cauchy sequences. -/
theorem complete_of_convergent_controlled_sequences (B : ℕ → ℝ≥0∞) (hB : ∀ n, 0 < B n)
    (H : ∀ u : ℕ → α, (∀ N n m : ℕ, N ≤ n → N ≤ m → edist (u n) (u m) < B N) →
      ∃ x, Tendsto u atTop (𝓝 x)) :
    CompleteSpace α 
goal: CompleteSpace α

full_name: EMetric.complete_of_cauchySeq_tendsto
code: /-- A sequentially complete pseudoemetric space is complete. -/
theorem complete_of_cauchySeq_tendsto :
    (∀ u : ℕ → α, CauchySeq u → ∃ a, Tendsto u atTop (𝓝 a)) → CompleteSpace α 
goal: (∀ (u : ℕ → α), CauchySeq u → ∃ a, Filter.Tendsto u Filter.atTop (𝓝 a)) → CompleteSpace α

full_name: EMetric.tendstoLocallyUniformlyOn_iff
code: /-- Expressing locally uniform convergence on a set using `edist`. -/
theorem tendstoLocallyUniformlyOn_iff {ι : Type*} [TopologicalSpace β] {F : ι → β → α} {f : β → α}
    {p : Filter ι} {s : Set β} :
    TendstoLocallyUniformlyOn F f p s ↔
      ∀ ε > 0, ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, ∀ᶠ n in p, ∀ y ∈ t, edist (f y) (F n y) < ε 
goal: TendstoLocallyUniformlyOn F f p s ↔ ∀ ε > 0, ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, ∀ᶠ (n : ι) in p, ∀ y ∈ t, edist (f y) (F n y) < ε

full_name: EMetric.tendstoUniformlyOn_iff
code: /-- Expressing uniform convergence on a set using `edist`. -/
theorem tendstoUniformlyOn_iff {ι : Type*} {F : ι → β → α} {f : β → α} {p : Filter ι} {s : Set β} :
    TendstoUniformlyOn F f p s ↔ ∀ ε > 0, ∀ᶠ n in p, ∀ x ∈ s, edist (f x) (F n x) < ε 
goal: TendstoUniformlyOn F f p s ↔ ∀ ε > 0, ∀ᶠ (n : ι) in p, ∀ x ∈ s, edist (f x) (F n x) < ε

full_name: EMetric.tendstoLocallyUniformly_iff
code: /-- Expressing locally uniform convergence using `edist`. -/
theorem tendstoLocallyUniformly_iff {ι : Type*} [TopologicalSpace β] {F : ι → β → α} {f : β → α}
    {p : Filter ι} :
    TendstoLocallyUniformly F f p ↔
      ∀ ε > 0, ∀ x : β, ∃ t ∈ 𝓝 x, ∀ᶠ n in p, ∀ y ∈ t, edist (f y) (F n y) < ε 
goal: TendstoLocallyUniformly F f p ↔ ∀ ε > 0, ∀ (x : β), ∃ t ∈ 𝓝 x, ∀ᶠ (n : ι) in p, ∀ y ∈ t, edist (f y) (F n y) < ε

full_name: EMetric.tendstoUniformly_iff
code: /-- Expressing uniform convergence using `edist`. -/
theorem tendstoUniformly_iff {ι : Type*} {F : ι → β → α} {f : β → α} {p : Filter ι} :
    TendstoUniformly F f p ↔ ∀ ε > 0, ∀ᶠ n in p, ∀ x, edist (f x) (F n x) < ε 
goal: TendstoUniformly F f p ↔ ∀ ε > 0, ∀ᶠ (n : ι) in p, ∀ (x : β), edist (f x) (F n x) < ε

full_name: PseudoEMetricSpace.replaceUniformity
code: /-- Auxiliary function to replace the uniformity on a pseudoemetric space with
a uniformity which is equal to the original one, but maybe not defeq.
This is useful if one wants to construct a pseudoemetric space with a
specified uniformity. See Note [forgetful inheritance] explaining why having definitionally
the right uniformity is often important.
-/
def PseudoEMetricSpace.replaceUniformity {α} [U : UniformSpace α] (m : PseudoEMetricSpace α)
    (H : 𝓤[U] = 𝓤[PseudoEMetricSpace.toUniformSpace]) : PseudoEMetricSpace α 
goal: PseudoEMetricSpace α

full_name: PseudoEMetricSpace.induced
code: /-- The extended pseudometric induced by a function taking values in a pseudoemetric space. -/
def PseudoEMetricSpace.induced {α β} (f : α → β) (m : PseudoEMetricSpace β) :
    PseudoEMetricSpace α 
goal: PseudoEMetricSpace α

full_name: instPseudoEMetricSpaceSubtype
code: /-- Pseudoemetric space instance on subsets of pseudoemetric spaces -/
instance {α : Type*} {p : α → Prop} [PseudoEMetricSpace α] : PseudoEMetricSpace (Subtype p) 
goal: PseudoEMetricSpace (Subtype p)

full_name: Subtype.edist_eq
code: /-- The extended pseudodistance on a subset of a pseudoemetric space is the restriction of
the original pseudodistance, by definition -/
theorem Subtype.edist_eq {p : α → Prop} (x y : Subtype p) : edist x y = edist (x : α) y 
goal: edist x y = edist ↑x ↑y

full_name: AddOpposite.instPseudoEMetricSpace
code: /-- Pseudoemetric space instance on the multiplicative opposite of a pseudoemetric space. -/
@[to_additive "Pseudoemetric space instance on the additive opposite of a pseudoemetric space."]
instance {α : Type*} [PseudoEMetricSpace α] : PseudoEMetricSpace αᵐᵒᵖ 
goal: PseudoEMetricSpace αᵃᵒᵖ

full_name: MulOpposite.instPseudoEMetricSpace
code: /-- Pseudoemetric space instance on the multiplicative opposite of a pseudoemetric space. -/
@[to_additive "Pseudoemetric space instance on the additive opposite of a pseudoemetric space."]
instance {α : Type*} [PseudoEMetricSpace α] : PseudoEMetricSpace αᵐᵒᵖ 
goal: PseudoEMetricSpace αᵐᵒᵖ

full_name: AddOpposite.edist_unop
code: @[to_additive]
theorem edist_unop (x y : αᵐᵒᵖ) : edist (unop x) (unop y) = edist x y 
goal: edist (AddOpposite.unop x) (AddOpposite.unop y) = edist x y

full_name: MulOpposite.edist_unop
code: @[to_additive]
theorem edist_unop (x y : αᵐᵒᵖ) : edist (unop x) (unop y) = edist x y 
goal: edist (MulOpposite.unop x) (MulOpposite.unop y) = edist x y

full_name: MulOpposite.edist_op
code: @[to_additive]
theorem edist_op (x y : α) : edist (op x) (op y) = edist x y 
goal: edist (MulOpposite.op x) (MulOpposite.op y) = edist x y

full_name: AddOpposite.edist_op
code: @[to_additive]
theorem edist_op (x y : α) : edist (op x) (op y) = edist x y 
goal: edist (AddOpposite.op x) (AddOpposite.op y) = edist x y

full_name: instPseudoEMetricSpaceULift
code: instance : PseudoEMetricSpace (ULift α) 
goal: PseudoEMetricSpace (ULift.{u_2, u} α)

full_name: ULift.edist_eq
code: theorem ULift.edist_eq (x y : ULift α) : edist x y = edist x.down y.down 
goal: edist x y = edist x.down y.down

full_name: ULift.edist_up_up
code: @[simp]
theorem ULift.edist_up_up (x y : α) : edist (ULift.up x) (ULift.up y) = edist x y 
goal: edist { down := x } { down := y } = edist x y

full_name: Prod.pseudoEMetricSpaceMax
code: /-- The product of two pseudoemetric spaces, with the max distance, is an extended
pseudometric spaces. We make sure that the uniform structure thus constructed is the one
corresponding to the product of uniform spaces, to avoid diamond problems. -/
instance Prod.pseudoEMetricSpaceMax [PseudoEMetricSpace β] : PseudoEMetricSpace (α × β) 
goal: PseudoEMetricSpace (α × β)

full_name: Prod.edist_eq
code: theorem Prod.edist_eq [PseudoEMetricSpace β] (x y : α × β) :
    edist x y = max (edist x.1 y.1) (edist x.2 y.2) 
goal: edist x y = max (edist x.1 y.1) (edist x.2 y.2)

full_name: instEDistForall
code: instance [∀ b, EDist (π b)] : EDist (∀ b, π b) 
goal: EDist ((b : β) → π b)

full_name: edist_pi_def
code: theorem edist_pi_def [∀ b, EDist (π b)] (f g : ∀ b, π b) :
    edist f g = Finset.sup univ fun b => edist (f b) (g b) 
goal: edist f g = Finset.univ.sup fun b => edist (f b) (g b)

full_name: edist_le_pi_edist
code: theorem edist_le_pi_edist [∀ b, EDist (π b)] (f g : ∀ b, π b) (b : β) :
    edist (f b) (g b) ≤ edist f g 
goal: edist (f b) (g b) ≤ edist f g

full_name: edist_pi_le_iff
code: theorem edist_pi_le_iff [∀ b, EDist (π b)] {f g : ∀ b, π b} {d : ℝ≥0∞} :
    edist f g ≤ d ↔ ∀ b, edist (f b) (g b) ≤ d 
goal: edist f g ≤ d ↔ ∀ (b : β), edist (f b) (g b) ≤ d

full_name: edist_pi_const_le
code: theorem edist_pi_const_le (a b : α) : (edist (fun _ : β => a) fun _ => b) ≤ edist a b 
goal: (edist (fun x => a) fun x => b) ≤ edist a b

full_name: edist_pi_const
code: @[simp]
theorem edist_pi_const [Nonempty β] (a b : α) : (edist (fun _ : β => a) fun _ => b) = edist a b 
goal: (edist (fun x => a) fun x => b) = edist a b

full_name: pseudoEMetricSpacePi
code: /-- The product of a finite number of pseudoemetric spaces, with the max distance, is still
a pseudoemetric space.
This construction would also work for infinite products, but it would not give rise
to the product topology. Hence, we only formalize it in the good situation of finitely many
spaces. -/
instance pseudoEMetricSpacePi [∀ b, PseudoEMetricSpace (π b)] : PseudoEMetricSpace (∀ b, π b) 
goal: PseudoEMetricSpace ((b : β) → π b)

full_name: EMetric.ball
code: /-- `EMetric.ball x ε` is the set of all points `y` with `edist y x < ε` -/
def ball (x : α) (ε : ℝ≥0∞) : Set α 
goal: Set α

full_name: EMetric.mem_ball
code: @[simp] theorem mem_ball : y ∈ ball x ε ↔ edist y x < ε 
goal: y ∈ EMetric.ball x ε ↔ edist y x < ε

full_name: EMetric.mem_ball'
code: theorem mem_ball' : y ∈ ball x ε ↔ edist x y < ε 
goal: y ∈ EMetric.ball x ε ↔ edist x y < ε

full_name: EMetric.closedBall
code: /-- `EMetric.closedBall x ε` is the set of all points `y` with `edist y x ≤ ε` -/
def closedBall (x : α) (ε : ℝ≥0∞) 
goal: Set α

full_name: EMetric.mem_closedBall
code: @[simp] theorem mem_closedBall : y ∈ closedBall x ε ↔ edist y x ≤ ε 
goal: y ∈ EMetric.closedBall x ε ↔ edist y x ≤ ε

full_name: EMetric.mem_closedBall'
code: theorem mem_closedBall' : y ∈ closedBall x ε ↔ edist x y ≤ ε 
goal: y ∈ EMetric.closedBall x ε ↔ edist x y ≤ ε

full_name: EMetric.closedBall_top
code: @[simp]
theorem closedBall_top (x : α) : closedBall x ∞ = univ 
goal: EMetric.closedBall x ⊤ = Set.univ

full_name: EMetric.ball_subset_closedBall
code: theorem ball_subset_closedBall : ball x ε ⊆ closedBall x ε 
goal: EMetric.ball x ε ⊆ EMetric.closedBall x ε

full_name: EMetric.pos_of_mem_ball
code: theorem pos_of_mem_ball (hy : y ∈ ball x ε) : 0 < ε 
goal: 0 < ε

full_name: EMetric.mem_ball_self
code: theorem mem_ball_self (h : 0 < ε) : x ∈ ball x ε 
goal: x ∈ EMetric.ball x ε

full_name: EMetric.mem_closedBall_self
code: theorem mem_closedBall_self : x ∈ closedBall x ε 
goal: x ∈ EMetric.closedBall x ε

full_name: EMetric.mem_ball_comm
code: theorem mem_ball_comm : x ∈ ball y ε ↔ y ∈ ball x ε 
goal: x ∈ EMetric.ball y ε ↔ y ∈ EMetric.ball x ε

full_name: EMetric.mem_closedBall_comm
code: theorem mem_closedBall_comm : x ∈ closedBall y ε ↔ y ∈ closedBall x ε 
goal: x ∈ EMetric.closedBall y ε ↔ y ∈ EMetric.closedBall x ε

full_name: EMetric.ball_subset_ball
code: @[gcongr]
theorem ball_subset_ball (h : ε₁ ≤ ε₂) : ball x ε₁ ⊆ ball x ε₂ 
goal: EMetric.ball x ε₁ ⊆ EMetric.ball x ε₂

full_name: EMetric.closedBall_subset_closedBall
code: @[gcongr]
theorem closedBall_subset_closedBall (h : ε₁ ≤ ε₂) : closedBall x ε₁ ⊆ closedBall x ε₂ 
goal: EMetric.closedBall x ε₁ ⊆ EMetric.closedBall x ε₂

full_name: EMetric.ball_disjoint
code: theorem ball_disjoint (h : ε₁ + ε₂ ≤ edist x y) : Disjoint (ball x ε₁) (ball y ε₂) 
goal: Disjoint (EMetric.ball x ε₁) (EMetric.ball y ε₂)

full_name: EMetric.ball_subset
code: theorem ball_subset (h : edist x y + ε₁ ≤ ε₂) (h' : edist x y ≠ ∞) : ball x ε₁ ⊆ ball y ε₂ 
goal: EMetric.ball x ε₁ ⊆ EMetric.ball y ε₂

full_name: EMetric.exists_ball_subset_ball
code: theorem exists_ball_subset_ball (h : y ∈ ball x ε) : ∃ ε' > 0, ball y ε' ⊆ ball x ε 
goal: ∃ ε' > 0, EMetric.ball y ε' ⊆ EMetric.ball x ε

full_name: EMetric.ball_eq_empty_iff
code: theorem ball_eq_empty_iff : ball x ε = ∅ ↔ ε = 0 
goal: EMetric.ball x ε = ∅ ↔ ε = 0

full_name: EMetric.ordConnected_setOf_closedBall_subset
code: theorem ordConnected_setOf_closedBall_subset (x : α) (s : Set α) :
    OrdConnected { r | closedBall x r ⊆ s } 
goal: {r | EMetric.closedBall x r ⊆ s}.OrdConnected

full_name: EMetric.ordConnected_setOf_ball_subset
code: theorem ordConnected_setOf_ball_subset (x : α) (s : Set α) : OrdConnected { r | ball x r ⊆ s } 
goal: {r | EMetric.ball x r ⊆ s}.OrdConnected

full_name: EMetric.edistLtTopSetoid
code: /-- Relation “two points are at a finite edistance” is an equivalence relation. -/
def edistLtTopSetoid : Setoid α 
goal: Setoid α

full_name: EMetric.ball_zero
code: @[simp]
theorem ball_zero : ball x 0 = ∅ 
goal: EMetric.ball x 0 = ∅

full_name: EMetric.nhds_basis_eball
code: theorem nhds_basis_eball : (𝓝 x).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) (ball x) 
goal: (𝓝 x).HasBasis (fun ε => 0 < ε) (EMetric.ball x)

full_name: EMetric.nhdsWithin_basis_eball
code: theorem nhdsWithin_basis_eball : (𝓝[s] x).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) fun ε => ball x ε ∩ s 
goal: (𝓝[s] x).HasBasis (fun ε => 0 < ε) fun ε => EMetric.ball x ε ∩ s

full_name: EMetric.nhds_basis_closed_eball
code: theorem nhds_basis_closed_eball : (𝓝 x).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) (closedBall x) 
goal: (𝓝 x).HasBasis (fun ε => 0 < ε) (EMetric.closedBall x)

full_name: EMetric.nhdsWithin_basis_closed_eball
code: theorem nhdsWithin_basis_closed_eball :
    (𝓝[s] x).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) fun ε => closedBall x ε ∩ s 
goal: (𝓝[s] x).HasBasis (fun ε => 0 < ε) fun ε => EMetric.closedBall x ε ∩ s

full_name: EMetric.nhds_eq
code: theorem nhds_eq : 𝓝 x = ⨅ ε > 0, 𝓟 (ball x ε) 
goal: 𝓝 x = ⨅ ε, ⨅ (_ : ε > 0), 𝓟 (EMetric.ball x ε)

full_name: EMetric.mem_nhds_iff
code: theorem mem_nhds_iff : s ∈ 𝓝 x ↔ ∃ ε > 0, ball x ε ⊆ s 
goal: s ∈ 𝓝 x ↔ ∃ ε > 0, EMetric.ball x ε ⊆ s

full_name: EMetric.mem_nhdsWithin_iff
code: theorem mem_nhdsWithin_iff : s ∈ 𝓝[t] x ↔ ∃ ε > 0, ball x ε ∩ t ⊆ s 
goal: s ∈ 𝓝[t] x ↔ ∃ ε > 0, EMetric.ball x ε ∩ t ⊆ s

full_name: EMetric.tendsto_nhdsWithin_nhdsWithin
code: theorem tendsto_nhdsWithin_nhdsWithin {t : Set β} {a b} :
    Tendsto f (𝓝[s] a) (𝓝[t] b) ↔
      ∀ ε > 0, ∃ δ > 0, ∀ ⦃x⦄, x ∈ s → edist x a < δ → f x ∈ t ∧ edist (f x) b < ε 
goal: Filter.Tendsto f (𝓝[s] a) (𝓝[t] b) ↔ ∀ ε > 0, ∃ δ > 0, ∀ ⦃x : α⦄, x ∈ s → edist x a < δ → f x ∈ t ∧ edist (f x) b < ε

full_name: EMetric.tendsto_nhdsWithin_nhds
code: theorem tendsto_nhdsWithin_nhds {a b} :
    Tendsto f (𝓝[s] a) (𝓝 b) ↔
      ∀ ε > 0, ∃ δ > 0, ∀ {x : α}, x ∈ s → edist x a < δ → edist (f x) b < ε 
goal: Filter.Tendsto f (𝓝[s] a) (𝓝 b) ↔ ∀ ε > 0, ∃ δ > 0, ∀ {x : α}, x ∈ s → edist x a < δ → edist (f x) b < ε

full_name: EMetric.tendsto_nhds_nhds
code: theorem tendsto_nhds_nhds {a b} :
    Tendsto f (𝓝 a) (𝓝 b) ↔ ∀ ε > 0, ∃ δ > 0, ∀ ⦃x⦄, edist x a < δ → edist (f x) b < ε 
goal: Filter.Tendsto f (𝓝 a) (𝓝 b) ↔ ∀ ε > 0, ∃ δ > 0, ∀ ⦃x : α⦄, edist x a < δ → edist (f x) b < ε

full_name: EMetric.isOpen_iff
code: theorem isOpen_iff : IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ball x ε ⊆ s 
goal: IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, EMetric.ball x ε ⊆ s

full_name: EMetric.isOpen_ball
code: theorem isOpen_ball : IsOpen (ball x ε) 
goal: IsOpen (EMetric.ball x ε)

full_name: EMetric.isClosed_ball_top
code: theorem isClosed_ball_top : IsClosed (ball x ⊤) 
goal: IsClosed (EMetric.ball x ⊤)

full_name: EMetric.ball_mem_nhds
code: theorem ball_mem_nhds (x : α) {ε : ℝ≥0∞} (ε0 : 0 < ε) : ball x ε ∈ 𝓝 x 
goal: EMetric.ball x ε ∈ 𝓝 x

full_name: EMetric.closedBall_mem_nhds
code: theorem closedBall_mem_nhds (x : α) {ε : ℝ≥0∞} (ε0 : 0 < ε) : closedBall x ε ∈ 𝓝 x 
goal: EMetric.closedBall x ε ∈ 𝓝 x

full_name: EMetric.ball_prod_same
code: theorem ball_prod_same [PseudoEMetricSpace β] (x : α) (y : β) (r : ℝ≥0∞) :
    ball x r ×ˢ ball y r = ball (x, y) r 
goal: EMetric.ball x r ×ˢ EMetric.ball y r = EMetric.ball (x, y) r

full_name: EMetric.closedBall_prod_same
code: theorem closedBall_prod_same [PseudoEMetricSpace β] (x : α) (y : β) (r : ℝ≥0∞) :
    closedBall x r ×ˢ closedBall y r = closedBall (x, y) r 
goal: EMetric.closedBall x r ×ˢ EMetric.closedBall y r = EMetric.closedBall (x, y) r

full_name: EMetric.mem_closure_iff
code: /-- ε-characterization of the closure in pseudoemetric spaces -/
theorem mem_closure_iff : x ∈ closure s ↔ ∀ ε > 0, ∃ y ∈ s, edist x y < ε 
goal: x ∈ closure s ↔ ∀ ε > 0, ∃ y ∈ s, edist x y < ε

full_name: EMetric.tendsto_nhds
code: theorem tendsto_nhds {f : Filter β} {u : β → α} {a : α} :
    Tendsto u f (𝓝 a) ↔ ∀ ε > 0, ∀ᶠ x in f, edist (u x) a < ε 
goal: Filter.Tendsto u f (𝓝 a) ↔ ∀ ε > 0, ∀ᶠ (x : β) in f, edist (u x) a < ε

full_name: EMetric.tendsto_atTop
code: theorem tendsto_atTop [Nonempty β] [SemilatticeSup β] {u : β → α} {a : α} :
    Tendsto u atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, edist (u n) a < ε 
goal: Filter.Tendsto u Filter.atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, edist (u n) a < ε

full_name: EMetric.inseparable_iff
code: theorem inseparable_iff : Inseparable x y ↔ edist x y = 0 
goal: Inseparable x y ↔ edist x y = 0

full_name: EMetric.cauchySeq_iff
code: /-- In a pseudoemetric space, Cauchy sequences are characterized by the fact that, eventually,
the pseudoedistance between its elements is arbitrarily small -/
theorem cauchySeq_iff [Nonempty β] [SemilatticeSup β] {u : β → α} :
    CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ m, N ≤ m → ∀ n, N ≤ n → edist (u m) (u n) < ε 
goal: CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ (m : β), N ≤ m → ∀ (n : β), N ≤ n → edist (u m) (u n) < ε

full_name: EMetric.cauchySeq_iff'
code: /-- A variation around the emetric characterization of Cauchy sequences -/
theorem cauchySeq_iff' [Nonempty β] [SemilatticeSup β] {u : β → α} :
    CauchySeq u ↔ ∀ ε > (0 : ℝ≥0∞), ∃ N, ∀ n ≥ N, edist (u n) (u N) < ε 
goal: CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, edist (u n) (u N) < ε

full_name: EMetric.cauchySeq_iff_NNReal
code: /-- A variation of the emetric characterization of Cauchy sequences that deals with
`ℝ≥0` upper bounds. -/
theorem cauchySeq_iff_NNReal [Nonempty β] [SemilatticeSup β] {u : β → α} :
    CauchySeq u ↔ ∀ ε : ℝ≥0, 0 < ε → ∃ N, ∀ n, N ≤ n → edist (u n) (u N) < ε 
goal: CauchySeq u ↔ ∀ (ε : ℝ≥0), 0 < ε → ∃ N, ∀ (n : β), N ≤ n → edist (u n) (u N) < ↑ε

full_name: EMetric.totallyBounded_iff
code: theorem totallyBounded_iff {s : Set α} :
    TotallyBounded s ↔ ∀ ε > 0, ∃ t : Set α, t.Finite ∧ s ⊆ ⋃ y ∈ t, ball y ε 
goal: TotallyBounded s ↔ ∀ ε > 0, ∃ t, t.Finite ∧ s ⊆ ⋃ y ∈ t, EMetric.ball y ε

full_name: EMetric.totallyBounded_iff'
code: theorem totallyBounded_iff' {s : Set α} :
    TotallyBounded s ↔ ∀ ε > 0, ∃ t, t ⊆ s ∧ Set.Finite t ∧ s ⊆ ⋃ y ∈ t, ball y ε 
goal: TotallyBounded s ↔ ∀ ε > 0, ∃ t ⊆ s, t.Finite ∧ s ⊆ ⋃ y ∈ t, EMetric.ball y ε

full_name: EMetric.subset_countable_closure_of_almost_dense_set
code: /-- For a set `s` in a pseudo emetric space, if for every `ε > 0` there exists a countable
set that is `ε`-dense in `s`, then there exists a countable subset `t ⊆ s` that is dense in `s`. -/
theorem subset_countable_closure_of_almost_dense_set (s : Set α)
    (hs : ∀ ε > 0, ∃ t : Set α, t.Countable ∧ s ⊆ ⋃ x ∈ t, closedBall x ε) :
    ∃ t, t ⊆ s ∧ t.Countable ∧ s ⊆ closure t 
goal: ∃ t ⊆ s, t.Countable ∧ s ⊆ closure t

full_name: TopologicalSpace.IsSeparable.exists_countable_dense_subset
code: /-- If a set `s` is separable in a (pseudo extended) metric space, then it admits a countable dense
subset. This is not obvious, as the countable set whose closure covers `s` given by the definition
of separability does not need in general to be contained in `s`. -/
theorem _root_.TopologicalSpace.IsSeparable.exists_countable_dense_subset
    {s : Set α} (hs : IsSeparable s) : ∃ t, t ⊆ s ∧ t.Countable ∧ s ⊆ closure t 
goal: ∃ t ⊆ s, t.Countable ∧ s ⊆ closure t

full_name: TopologicalSpace.IsSeparable.separableSpace
code: /-- If a set `s` is separable, then the corresponding subtype is separable in a (pseudo extended)
metric space.  This is not obvious, as the countable set whose closure covers `s` does not need in
general to be contained in `s`. -/
theorem _root_.TopologicalSpace.IsSeparable.separableSpace {s : Set α} (hs : IsSeparable s) :
    SeparableSpace s 
goal: TopologicalSpace.SeparableSpace ↑s

full_name: EMetric.subset_countable_closure_of_compact
code: /-- A compact set in a pseudo emetric space is separable, i.e., it is a subset of the closure of a
countable set.  -/
theorem subset_countable_closure_of_compact {s : Set α} (hs : IsCompact s) :
    ∃ t, t ⊆ s ∧ t.Countable ∧ s ⊆ closure t 
goal: ∃ t ⊆ s, t.Countable ∧ s ⊆ closure t

full_name: EMetric.secondCountable_of_sigmaCompact
code: /-- A sigma compact pseudo emetric space has second countable topology. -/
instance (priority := 90) secondCountable_of_sigmaCompact [SigmaCompactSpace α] :
    SecondCountableTopology α 
goal: SecondCountableTopology α

full_name: EMetric.secondCountable_of_almost_dense_set
code: theorem secondCountable_of_almost_dense_set
    (hs : ∀ ε > 0, ∃ t : Set α, t.Countable ∧ ⋃ x ∈ t, closedBall x ε = univ) :
    SecondCountableTopology α 
goal: SecondCountableTopology α

full_name: EMetric.diam
code: /-- The diameter of a set in a pseudoemetric space, named `EMetric.diam` -/
noncomputable def diam (s : Set α) 
goal: ℝ≥0∞

full_name: EMetric.diam_eq_sSup
code: theorem diam_eq_sSup (s : Set α) : diam s = sSup (image2 edist s s) 
goal: EMetric.diam s = sSup (Set.image2 edist s s)

full_name: EMetric.diam_le_iff
code: theorem diam_le_iff {d : ℝ≥0∞} : diam s ≤ d ↔ ∀ x ∈ s, ∀ y ∈ s, edist x y ≤ d 
goal: EMetric.diam s ≤ d ↔ ∀ x ∈ s, ∀ y ∈ s, edist x y ≤ d

full_name: EMetric.diam_image_le_iff
code: theorem diam_image_le_iff {d : ℝ≥0∞} {f : β → α} {s : Set β} :
    diam (f '' s) ≤ d ↔ ∀ x ∈ s, ∀ y ∈ s, edist (f x) (f y) ≤ d 
goal: EMetric.diam (f '' s) ≤ d ↔ ∀ x ∈ s, ∀ y ∈ s, edist (f x) (f y) ≤ d

full_name: EMetric.edist_le_of_diam_le
code: theorem edist_le_of_diam_le {d} (hx : x ∈ s) (hy : y ∈ s) (hd : diam s ≤ d) : edist x y ≤ d 
goal: edist x y ≤ d

full_name: EMetric.edist_le_diam_of_mem
code: /-- If two points belong to some set, their edistance is bounded by the diameter of the set -/
theorem edist_le_diam_of_mem (hx : x ∈ s) (hy : y ∈ s) : edist x y ≤ diam s 
goal: edist x y ≤ EMetric.diam s

full_name: EMetric.diam_le
code: /-- If the distance between any two points in a set is bounded by some constant, this constant
bounds the diameter. -/
theorem diam_le {d : ℝ≥0∞} (h : ∀ x ∈ s, ∀ y ∈ s, edist x y ≤ d) : diam s ≤ d 
goal: EMetric.diam s ≤ d

full_name: EMetric.diam_subsingleton
code: /-- The diameter of a subsingleton vanishes. -/
theorem diam_subsingleton (hs : s.Subsingleton) : diam s = 0 
goal: EMetric.diam s = 0

full_name: EMetric.diam_empty
code: /-- The diameter of the empty set vanishes -/
@[simp]
theorem diam_empty : diam (∅ : Set α) = 0 
goal: EMetric.diam ∅ = 0

full_name: EMetric.diam_singleton
code: /-- The diameter of a singleton vanishes -/
@[simp]
theorem diam_singleton : diam ({x} : Set α) = 0 
goal: EMetric.diam {x} = 0

full_name: EMetric.diam_zero
code: @[to_additive (attr := simp)]
theorem diam_one [One α] : diam (1 : Set α) = 0 
goal: EMetric.diam 0 = 0

full_name: EMetric.diam_one
code: @[to_additive (attr := simp)]
theorem diam_one [One α] : diam (1 : Set α) = 0 
goal: EMetric.diam 1 = 0

full_name: EMetric.diam_iUnion_mem_option
code: theorem diam_iUnion_mem_option {ι : Type*} (o : Option ι) (s : ι → Set α) :
    diam (⋃ i ∈ o, s i) = ⨆ i ∈ o, diam (s i) 
goal: EMetric.diam (⋃ i ∈ o, s i) = ⨆ i ∈ o, EMetric.diam (s i)

full_name: EMetric.diam_insert
code: theorem diam_insert : diam (insert x s) = max (⨆ y ∈ s, edist x y) (diam s) 
goal: EMetric.diam (insert x s) = max (⨆ y ∈ s, edist x y) (EMetric.diam s)

full_name: EMetric.diam_pair
code: theorem diam_pair : diam ({x, y} : Set α) = edist x y 
goal: EMetric.diam {x, y} = edist x y

full_name: EMetric.diam_triple
code: theorem diam_triple : diam ({x, y, z} : Set α) = max (max (edist x y) (edist x z)) (edist y z) 
goal: EMetric.diam {x, y, z} = max (max (edist x y) (edist x z)) (edist y z)

full_name: EMetric.diam_mono
code: /-- The diameter is monotonous with respect to inclusion -/
@[gcongr]
theorem diam_mono {s t : Set α} (h : s ⊆ t) : diam s ≤ diam t 
goal: EMetric.diam s ≤ EMetric.diam t

full_name: EMetric.diam_union
code: /-- The diameter of a union is controlled by the diameter of the sets, and the edistance
between two points in the sets. -/
theorem diam_union {t : Set α} (xs : x ∈ s) (yt : y ∈ t) :
    diam (s ∪ t) ≤ diam s + edist x y + diam t 
goal: EMetric.diam (s ∪ t) ≤ EMetric.diam s + edist x y + EMetric.diam t

full_name: EMetric.diam_union'
code: theorem diam_union' {t : Set α} (h : (s ∩ t).Nonempty) : diam (s ∪ t) ≤ diam s + diam t 
goal: EMetric.diam (s ∪ t) ≤ EMetric.diam s + EMetric.diam t

full_name: EMetric.diam_closedBall
code: theorem diam_closedBall {r : ℝ≥0∞} : diam (closedBall x r) ≤ 2 * r 
goal: EMetric.diam (EMetric.closedBall x r) ≤ 2 * r

full_name: EMetric.diam_ball
code: theorem diam_ball {r : ℝ≥0∞} : diam (ball x r) ≤ 2 * r 
goal: EMetric.diam (EMetric.ball x r) ≤ 2 * r

full_name: EMetric.diam_pi_le_of_le
code: theorem diam_pi_le_of_le {π : β → Type*} [Fintype β] [∀ b, PseudoEMetricSpace (π b)]
    {s : ∀ b : β, Set (π b)} {c : ℝ≥0∞} (h : ∀ b, diam (s b) ≤ c) : diam (Set.pi univ s) ≤ c 
goal: EMetric.diam (Set.univ.pi s) ≤ c

full_name: EMetricSpace
code: /-- We now define `EMetricSpace`, extending `PseudoEMetricSpace`. -/
class EMetricSpace (α : Type u) extends PseudoEMetricSpace α : Type u where
  eq_of_edist_eq_zero : ∀ {x y : α}, edist x y = 0 → x = y
goal: Type u

full_name: EMetricSpace.eq_of_edist_eq_zero
code: /-- We now define `EMetricSpace`, extending `PseudoEMetricSpace`. -/
class EMetricSpace (α : Type u) extends PseudoEMetricSpace α : Type u where
  eq_of_edist_eq_zero : ∀ {x y : α}, edist x y = 0 → x = y
goal: edist x y = 0 → x = y

full_name: EMetricSpace.ext
code: @[ext]
protected theorem EMetricSpace.ext
    {α : Type*} {m m' : EMetricSpace α} (h : m.toEDist = m'.toEDist) : m = m' 
goal: m = m'

full_name: edist_eq_zero
code: /-- Characterize the equality of points by the vanishing of their extended distance -/
@[simp]
theorem edist_eq_zero {x y : γ} : edist x y = 0 ↔ x = y 
goal: edist x y = 0 ↔ x = y

full_name: zero_eq_edist
code: @[simp]
theorem zero_eq_edist {x y : γ} : 0 = edist x y ↔ x = y 
goal: 0 = edist x y ↔ x = y

full_name: edist_le_zero
code: theorem edist_le_zero {x y : γ} : edist x y ≤ 0 ↔ x = y 
goal: edist x y ≤ 0 ↔ x = y

full_name: edist_pos
code: @[simp]
theorem edist_pos {x y : γ} : 0 < edist x y ↔ x ≠ y 
goal: 0 < edist x y ↔ x ≠ y

full_name: eq_of_forall_edist_le
code: /-- Two points coincide if their distance is `< ε` for all positive ε -/
theorem eq_of_forall_edist_le {x y : γ} (h : ∀ ε > 0, edist x y ≤ ε) : x = y 
goal: x = y

full_name: EMetricSpace.instT0Space
code: /-- An emetric space is separated -/
instance (priority := 100) EMetricSpace.instT0Space : T0Space γ 
goal: T0Space γ

full_name: EMetric.uniformEmbedding_iff'
code: /-- A map between emetric spaces is a uniform embedding if and only if the edistance between `f x`
and `f y` is controlled in terms of the distance between `x` and `y` and conversely. -/
theorem EMetric.uniformEmbedding_iff' [EMetricSpace β] {f : γ → β} :
    UniformEmbedding f ↔
      (∀ ε > 0, ∃ δ > 0, ∀ {a b : γ}, edist a b < δ → edist (f a) (f b) < ε) ∧
        ∀ δ > 0, ∃ ε > 0, ∀ {a b : γ}, edist (f a) (f b) < ε → edist a b < δ 
goal: UniformEmbedding f ↔
  (∀ ε > 0, ∃ δ > 0, ∀ {a b : γ}, edist a b < δ → edist (f a) (f b) < ε) ∧
    ∀ δ > 0, ∃ ε > 0, ∀ {a b : γ}, edist (f a) (f b) < ε → edist a b < δ

full_name: EMetricSpace.ofT0PseudoEMetricSpace
code: /-- If a `PseudoEMetricSpace` is a T₀ space, then it is an `EMetricSpace`. -/
-- Porting note: made `reducible`;
-- Porting note (#11215): TODO: make it an instance?
abbrev EMetricSpace.ofT0PseudoEMetricSpace (α : Type*) [PseudoEMetricSpace α] [T0Space α] :
    EMetricSpace α 
goal: EMetricSpace α

full_name: EMetricSpace.replaceUniformity
code: /-- Auxiliary function to replace the uniformity on an emetric space with
a uniformity which is equal to the original one, but maybe not defeq.
This is useful if one wants to construct an emetric space with a
specified uniformity. See Note [forgetful inheritance] explaining why having definitionally
the right uniformity is often important.
-/
def EMetricSpace.replaceUniformity {γ} [U : UniformSpace γ] (m : EMetricSpace γ)
    (H : 𝓤[U] = 𝓤[PseudoEMetricSpace.toUniformSpace]) : EMetricSpace γ 
goal: EMetricSpace γ

full_name: EMetricSpace.induced
code: /-- The extended metric induced by an injective function taking values in an emetric space. -/
def EMetricSpace.induced {γ β} (f : γ → β) (hf : Function.Injective f) (m : EMetricSpace β) :
    EMetricSpace γ 
goal: EMetricSpace γ

full_name: instEMetricSpaceSubtype
code: /-- EMetric space instance on subsets of emetric spaces -/
instance {α : Type*} {p : α → Prop} [EMetricSpace α] : EMetricSpace (Subtype p) 
goal: EMetricSpace (Subtype p)

full_name: instEMetricSpaceMulOpposite
code: /-- EMetric space instance on the multiplicative opposite of an emetric space. -/
@[to_additive "EMetric space instance on the additive opposite of an emetric space."]
instance {α : Type*} [EMetricSpace α] : EMetricSpace αᵐᵒᵖ 
goal: EMetricSpace αᵐᵒᵖ

full_name: instEMetricSpaceAddOpposite
code: /-- EMetric space instance on the multiplicative opposite of an emetric space. -/
@[to_additive "EMetric space instance on the additive opposite of an emetric space."]
instance {α : Type*} [EMetricSpace α] : EMetricSpace αᵐᵒᵖ 
goal: EMetricSpace αᵃᵒᵖ

full_name: instEMetricSpaceULift
code: instance {α : Type*} [EMetricSpace α] : EMetricSpace (ULift α) 
goal: EMetricSpace (ULift.{u_3, u_2} α)

full_name: Prod.emetricSpaceMax
code: /-- The product of two emetric spaces, with the max distance, is an extended
metric spaces. We make sure that the uniform structure thus constructed is the one
corresponding to the product of uniform spaces, to avoid diamond problems. -/
instance Prod.emetricSpaceMax [EMetricSpace β] : EMetricSpace (γ × β) 
goal: EMetricSpace (γ × β)

full_name: uniformity_edist
code: /-- Reformulation of the uniform structure in terms of the extended distance -/
theorem uniformity_edist : 𝓤 γ = ⨅ ε > 0, 𝓟 { p : γ × γ | edist p.1 p.2 < ε } 
goal: 𝓤 γ = ⨅ ε, ⨅ (_ : ε > 0), 𝓟 {p | edist p.1 p.2 < ε}

full_name: emetricSpacePi
code: /-- The product of a finite number of emetric spaces, with the max distance, is still
an emetric space.
This construction would also work for infinite products, but it would not give rise
to the product topology. Hence, we only formalize it in the good situation of finitely many
spaces. -/
instance emetricSpacePi [∀ b, EMetricSpace (π b)] : EMetricSpace (∀ b, π b) 
goal: EMetricSpace ((b : β) → π b)

full_name: EMetric.countable_closure_of_compact
code: /-- A compact set in an emetric space is separable, i.e., it is the closure of a countable set. -/
theorem countable_closure_of_compact {s : Set γ} (hs : IsCompact s) :
    ∃ t, t ⊆ s ∧ t.Countable ∧ s = closure t 
goal: ∃ t ⊆ s, t.Countable ∧ s = closure t

full_name: EMetric.diam_eq_zero_iff
code: theorem diam_eq_zero_iff : diam s = 0 ↔ s.Subsingleton 
goal: EMetric.diam s = 0 ↔ s.Subsingleton

full_name: EMetric.diam_pos_iff
code: theorem diam_pos_iff : 0 < diam s ↔ s.Nontrivial 
goal: 0 < EMetric.diam s ↔ s.Nontrivial

full_name: EMetric.diam_pos_iff'
code: theorem diam_pos_iff' : 0 < diam s ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y 
goal: 0 < EMetric.diam s ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y

full_name: instEDistSeparationQuotient
code: instance [PseudoEMetricSpace X] : EDist (SeparationQuotient X) 
goal: EDist (SeparationQuotient X)

full_name: SeparationQuotient.edist_mk
code: @[simp] theorem SeparationQuotient.edist_mk [PseudoEMetricSpace X] (x y : X) :
    edist (mk x) (mk y) = edist x y 
goal: edist (SeparationQuotient.mk x) (SeparationQuotient.mk y) = edist x y

full_name: instEMetricSpaceSeparationQuotient
code: instance [PseudoEMetricSpace X] : EMetricSpace (SeparationQuotient X) 
goal: EMetricSpace (SeparationQuotient X)

full_name: instEDistAdditive
code: instance : EDist (Additive X) 
goal: EDist (Additive X)

full_name: instEDistMultiplicative
code: instance : EDist (Multiplicative X) 
goal: EDist (Multiplicative X)

full_name: edist_ofMul
code: @[simp]
theorem edist_ofMul (a b : X) : edist (ofMul a) (ofMul b) = edist a b 
goal: edist (Additive.ofMul a) (Additive.ofMul b) = edist a b

full_name: edist_ofAdd
code: @[simp]
theorem edist_ofAdd (a b : X) : edist (ofAdd a) (ofAdd b) = edist a b 
goal: edist (Multiplicative.ofAdd a) (Multiplicative.ofAdd b) = edist a b

full_name: edist_toMul
code: @[simp]
theorem edist_toMul (a b : Additive X) : edist (toMul a) (toMul b) = edist a b 
goal: edist (Additive.toMul a) (Additive.toMul b) = edist a b

full_name: edist_toAdd
code: @[simp]
theorem edist_toAdd (a b : Multiplicative X) : edist (toAdd a) (toAdd b) = edist a b 
goal: edist (Multiplicative.toAdd a) (Multiplicative.toAdd b) = edist a b

full_name: instPseudoEMetricSpaceAdditive
code: instance [PseudoEMetricSpace X] : PseudoEMetricSpace (Additive X) 
goal: PseudoEMetricSpace (Additive X)

full_name: instPseudoEMetricSpaceMultiplicative
code: instance [PseudoEMetricSpace X] : PseudoEMetricSpace (Multiplicative X) 
goal: PseudoEMetricSpace (Multiplicative X)

full_name: instEMetricSpaceAdditive
code: instance [EMetricSpace X] : EMetricSpace (Additive X) 
goal: EMetricSpace (Additive X)

full_name: instEMetricSpaceMultiplicative
code: instance [EMetricSpace X] : EMetricSpace (Multiplicative X) 
goal: EMetricSpace (Multiplicative X)

full_name: instEDistOrderDual
code: instance : EDist Xᵒᵈ 
goal: EDist Xᵒᵈ

full_name: edist_toDual
code: @[simp]
theorem edist_toDual (a b : X) : edist (toDual a) (toDual b) = edist a b 
goal: edist (OrderDual.toDual a) (OrderDual.toDual b) = edist a b

full_name: edist_ofDual
code: @[simp]
theorem edist_ofDual (a b : Xᵒᵈ) : edist (ofDual a) (ofDual b) = edist a b 
goal: edist (OrderDual.ofDual a) (OrderDual.ofDual b) = edist a b

full_name: instPseudoEMetricSpaceOrderDual
code: instance [PseudoEMetricSpace X] : PseudoEMetricSpace Xᵒᵈ 
goal: PseudoEMetricSpace Xᵒᵈ

full_name: instEMetricSpaceOrderDual
code: instance [EMetricSpace X] : EMetricSpace Xᵒᵈ 
goal: EMetricSpace Xᵒᵈ