Metric spaces #
This file defines metric spaces and shows some of their basic properties.
Many definitions and theorems expected on metric spaces are already introduced on uniform spaces and topological spaces. This includes open and closed sets, compactness, completeness, continuity and uniform continuity.
TODO (anyone): Add "Main results" section.
Implementation notes #
A lot of elementary properties don't require eq_of_dist_eq_zero
, hence are stated and proven
for PseudoMetricSpace
s in PseudoMetric.lean
.
Tags #
metric, pseudo_metric, dist
We now define MetricSpace
, extending PseudoMetricSpace
.
- dist : α → α → ℝ
- edist : α → α → ENNReal
- edist_dist : ∀ (x y : α), PseudoMetricSpace.edist x y = ENNReal.ofReal (dist x y)
- toUniformSpace : UniformSpace α
- uniformity_dist : uniformity α = ⨅ (ε : ℝ), ⨅ (_ : ε > 0), Filter.principal {p : α × α | dist p.1 p.2 < ε}
- toBornology : Bornology α
Instances
Two metric space structures with the same distance coincide.
Construct a metric space structure whose underlying topological space structure (definitionally) agrees which a pre-existing topology which is compatible with a given distance function.
Equations
- MetricSpace.ofDistTopology dist dist_self dist_comm dist_triangle H eq_of_dist_eq_zero = let __src := PseudoMetricSpace.ofDistTopology dist dist_self dist_comm dist_triangle H; MetricSpace.mk ⋯
Instances For
Deduce the equality of points from the vanishing of the nonnegative distance
Characterize the equality of points as the vanishing of the nonnegative distance
A map between metric spaces is a uniform embedding if and only if the distance between f x
and f y
is controlled in terms of the distance between x
and y
and conversely.
If a PseudoMetricSpace
is a T₀ space, then it is a MetricSpace
.
Equations
Instances For
A metric space induces an emetric space
Equations
- MetricSpace.toEMetricSpace = EMetricSpace.ofT0PseudoEMetricSpace γ
If f : β → α
sends any two distinct points to points at distance at least ε > 0
, then
f
is a uniform embedding with respect to the discrete uniformity on β
.
Build a new metric space from an old one where the bundled uniform structure is provably (but typically non-definitionaly) equal to some given uniform structure. See Note [forgetful inheritance].
Equations
Instances For
Build a new metric space from an old one where the bundled topological structure is provably (but typically non-definitionaly) equal to some given topological structure. See Note [forgetful inheritance].
Equations
Instances For
One gets a metric space from an emetric space if the edistance is everywhere finite, by pushing the edistance to reals. We set it up so that the edist and the uniformity are defeq in the metric space and the emetric space. In this definition, the distance is given separately, to be able to prescribe some expression which is not defeq to the push-forward of the edistance to reals.
Equations
- EMetricSpace.toMetricSpaceOfDist dist edist_ne_top h = MetricSpace.ofT0PseudoMetricSpace α
Instances For
One gets a metric space from an emetric space if the edistance is everywhere finite, by pushing the edistance to reals. We set it up so that the edist and the uniformity are defeq in the metric space and the emetric space.
Equations
- EMetricSpace.toMetricSpace h = EMetricSpace.toMetricSpaceOfDist (fun (x y : α) => (edist x y).toReal) h ⋯
Instances For
Build a new metric space from an old one where the bundled bornology structure is provably (but typically non-definitionaly) equal to some given bornology structure. See Note [forgetful inheritance].
Equations
- MetricSpace.replaceBornology m H = let __src := PseudoMetricSpace.replaceBornology MetricSpace.toPseudoMetricSpace H; MetricSpace.mk ⋯
Instances For
Metric space structure pulled back by an injective function. Injectivity is necessary to
ensure that dist x y = 0
only if x = y
.
Equations
- MetricSpace.induced f hf m = let __src := PseudoMetricSpace.induced f MetricSpace.toPseudoMetricSpace; MetricSpace.mk ⋯
Instances For
Pull back a metric space structure by a uniform embedding. This is a version of
MetricSpace.induced
useful in case if the domain already has a UniformSpace
structure.
Equations
Instances For
Pull back a metric space structure by an embedding. This is a version of
MetricSpace.induced
useful in case if the domain already has a TopologicalSpace
structure.
Equations
Instances For
Equations
- Subtype.metricSpace = MetricSpace.induced Subtype.val ⋯ inst
Equations
- instMetricSpaceAddOpposite = MetricSpace.induced AddOpposite.unop ⋯ inst
Equations
- instMetricSpaceMulOpposite = MetricSpace.induced MulOpposite.unop ⋯ inst
Equations
Equations
Instantiate the reals as a metric space.
Equations
- instMetricSpaceNNReal = Subtype.metricSpace
Equations
- instMetricSpaceULift = MetricSpace.induced ULift.down ⋯ inst
Equations
- Prod.metricSpaceMax = MetricSpace.ofT0PseudoMetricSpace (γ × β)
A finite product of metric spaces is a metric space, with the sup distance.
Equations
- metricSpacePi = MetricSpace.ofT0PseudoMetricSpace ((b : β) → π b)
A metric space is second countable if one can reconstruct up to any ε>0
any element of the
space from countably many data.
Equations
- SeparationQuotient.instDist = { dist := SeparationQuotient.lift₂ dist ⋯ }
Equations
- SeparationQuotient.instMetricSpace = EMetricSpace.toMetricSpaceOfDist dist ⋯ ⋯
Additive
, Multiplicative
#
The distance on those type synonyms is inherited without change.
Equations
- instDistMultiplicative = inst
Equations
- instPseudoMetricSpaceAdditive = inst
Equations
- instPseudoMetricSpaceMultiplicative = inst
Equations
- instMetricSpaceAdditive = inst
Equations
- instMetricSpaceMultiplicative = inst
Equations
- ⋯ = inst
Equations
- ⋯ = inst
Equations
- MulOpposite.instMetricSpace = MetricSpace.induced MulOpposite.unop ⋯ inst
Order dual #
The distance on this type synonym is inherited without change.
Equations
- instPseudoMetricSpaceOrderDual = inst
Equations
- instMetricSpaceOrderDual = inst
Equations
- ⋯ = inst