@@ -59,21 +59,22 @@ def uniformSpaceOfEDist (edist : α → α → ℝ≥0∞) (edist_self : ∀ x :
5959 ⟨ε / 2 , ENNReal.half_pos ε0 .ne', fun _ h₁ _ h₂ =>
6060 (ENNReal.add_lt_add h₁ h₂).trans_eq (ENNReal.add_halves _)⟩
6161
62- -- the uniform structure is embedded in the emetric space structure
63- -- to avoid instance diamond issues. See Note [forgetful inheritance].
64- /-- Extended (pseudo) metric spaces, with an extended distance `edist` possibly taking the
65- value ∞
66-
67- Each pseudo_emetric space induces a canonical `UniformSpace` and hence a canonical
68- `TopologicalSpace`.
69- This is enforced in the type class definition, by extending the `UniformSpace` structure. When
70- instantiating a `PseudoEMetricSpace` structure, the uniformity fields are not necessary, they
71- will be filled in by default. There is a default value for the uniformity, that can be substituted
72- in cases of interest, for instance when instantiating a `PseudoEMetricSpace` structure
73- on a product.
74-
75- Continuity of `edist` is proved in `Topology.Instances.ENNReal`
76- -/
62+ /-- A pseudo extended metric space is a type endowed with a `ℝ≥0∞`-valued distance `edist`
63+ satisfying reflexivity `edist x x = 0`, commutativity `edist x y = edist y x`, and the triangle
64+ inequality `edist x z ≤ edist x y + edist y z`.
65+
66+ Note that we do not require `edist x y = 0 → x = y`. See extended metric spaces (`EMetricSpace`) for
67+ the similar class with that stronger assumption.
68+
69+ Any pseudo extended metric space is a topological space and a uniform space (see `TopologicalSpace`,
70+ `UniformSpace`), where the topology and uniformity come from the metric.
71+ Note that a T1 pseudo extended metric space is just an extended metric space.
72+
73+ We make the uniformity/topology part of the data instead of deriving it from the metric. This eg
74+ ensures that we do not get a diamond when doing
75+ `[PseudoEMetricSpace α] [PseudoEMetricSpace β] : TopologicalSpace (α × β)`:
76+ The product metric and product topology agree, but not definitionally so.
77+ See Note [forgetful inheritance]. -/
7778class PseudoEMetricSpace (α : Type u) : Type u extends EDist α where
7879 edist_self : ∀ x : α, edist x x = 0
7980 edist_comm : ∀ x y : α, edist x y = edist y x
@@ -538,8 +539,21 @@ end Compact
538539
539540end EMetric
540541
541- --namespace
542- /-- We now define `EMetricSpace`, extending `PseudoEMetricSpace`. -/
542+ /-- An extended metric space is a type endowed with a `ℝ≥0∞`-valued distance `edist` satisfying
543+ `edist x y = 0 ↔ x = y`, commutativity `edist x y = edist y x`, and the triangle inequality
544+ `edist x z ≤ edist x y + edist y z`.
545+
546+ See pseudo extended metric spaces (`PseudoEMetricSpace`) for the similar class with the
547+ `edist x y = 0 ↔ x = y` assumption weakened to `edist x x = 0`.
548+
549+ Any extended metric space is a T1 topological space and a uniform space (see `TopologicalSpace`,
550+ `T1Space`, `UniformSpace`), where the topology and uniformity come from the metric.
551+
552+ We make the uniformity/topology part of the data instead of deriving it from the metric.
553+ This eg ensures that we do not get a diamond when doing
554+ `[EMetricSpace α] [EMetricSpace β] : TopologicalSpace (α × β)`:
555+ The product metric and product topology agree, but not definitionally so.
556+ See Note [forgetful inheritance]. -/
543557class EMetricSpace (α : Type u) : Type u extends PseudoEMetricSpace α where
544558 eq_of_edist_eq_zero : ∀ {x y : α}, edist x y = 0 → x = y
545559
0 commit comments