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
A metric space is a type endowed with a ℝ
-valued distance dist
satisfying
dist x y = 0 ↔ x = y
, commutativity dist x y = dist y x
, and the triangle inequality
dist x z ≤ dist x y + dist y z
.
See pseudometric spaces (PseudoMetricSpace
) for the similar class with the dist x y = 0 ↔ x = y
assumption weakened to dist x x = 0
.
Any metric space is a T1 topological space and a uniform space (see TopologicalSpace
, T1Space
,
UniformSpace
), where the topology and uniformity come from the metric.
We make the uniformity/topology part of the data instead of deriving it from the metric.
This eg ensures that we do not get a diamond when doing
[MetricSpace α] [MetricSpace β] : TopologicalSpace (α × β)
:
The product metric and product topology agree, but not definitionally so.
See Note [forgetful inheritance].
- 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
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]. See Note [reducible non-instances].
Equations
- m.replaceUniformity H = { toPseudoMetricSpace := MetricSpace.toPseudoMetricSpace.replaceUniformity H, eq_of_dist_eq_zero := ⋯ }
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]. See Note [reducible non-instances].
Equations
- m.replaceTopology H = m.replaceUniformity ⋯
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]. See Note [reducible non-instances].
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
- instDistAdditive = inst✝
Equations
- instDistMultiplicative = inst✝
Equations
- instMetricSpaceAdditive = inst✝
Equations
Order dual #
The distance on this type synonym is inherited without change.
Equations
- instDistOrderDual = inst✝
Equations
- instMetricSpaceOrderDual = inst✝