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
- One or more equations did not get rendered due to their size.
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
Equations
- (_ : SeparatedSpace γ) = (_ : SeparatedSpace γ)
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
- MetricSpace.ofT0PseudoMetricSpace α = MetricSpace.mk (_ : ∀ {x y : α}, dist x y = 0 → x = y)
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
- MetricSpace.replaceUniformity m H = MetricSpace.mk (_ : ∀ {x y : γ}, dist x y = 0 → x = y)
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
- MetricSpace.replaceTopology m H = MetricSpace.replaceUniformity m (_ : uniformity γ = uniformity γ)
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
- One or more equations did not get rendered due to their size.
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 (_ : ∀ {x y : α}, dist x y = 0 → x = y)
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 (_ : ∀ {x y : γ}, dist x y = 0 → x = y)
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
- One or more equations did not get rendered due to their size.
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
- Embedding.comapMetricSpace f h = MetricSpace.replaceTopology (MetricSpace.induced f (_ : Function.Injective f) m) (_ : inst = TopologicalSpace.induced f UniformSpace.toTopologicalSpace)
Instances For
Equations
- Subtype.metricSpace = MetricSpace.induced Subtype.val (_ : Function.Injective fun (a : Subtype p) => ↑a) inst
Equations
- instMetricSpaceAddOpposite = MetricSpace.induced AddOpposite.unop (_ : Function.Injective AddOpposite.unop) inst
Equations
- instMetricSpaceMulOpposite = MetricSpace.induced MulOpposite.unop (_ : Function.Injective MulOpposite.unop) inst
Equations
- instMetricSpaceEmpty = MetricSpace.mk (_ : ∀ {x y : Empty}, dist x y = 0 → x = y)
Equations
- instMetricSpacePUnit = MetricSpace.mk (_ : ∀ {x y : PUnit.{u + 1} }, dist x y = 0 → x = y)
Instantiate the reals as a metric space.
Equations
- instMetricSpaceNNReal = Subtype.metricSpace
Equations
- instMetricSpaceULift = MetricSpace.induced ULift.down (_ : Function.Injective 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
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
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
- (_ : ProperSpace (Additive X)) = inst
Equations
- (_ : ProperSpace (Multiplicative X)) = inst
Order dual #
The distance on this type synonym is inherited without change.
Equations
- instPseudoMetricSpaceOrderDual = inst
Equations
- instMetricSpaceOrderDual = inst
Equations
- (_ : ProperSpace Xᵒᵈ) = inst