Construct a uniform structure from a distance function and metric space axioms
Equations
- uniform_space_of_dist dist dist_self dist_comm dist_triangle = uniform_space.of_core {uniformity := ⨅ (ε : ℝ) (H : ε > 0), filter.principal {p : α × α | dist p.fst p.snd < ε}, refl := _, symm := _, comp := _}
- dist : α → α → ℝ
The distance function (given an ambient metric space on α
), which returns
a nonnegative real number dist x y
given x y : α
.
- to_has_dist : has_dist α
- dist_self : ∀ (x : α), has_dist.dist x x = 0
- eq_of_dist_eq_zero : ∀ {x y : α}, has_dist.dist x y = 0 → x = y
- dist_comm : ∀ (x y : α), has_dist.dist x y = has_dist.dist y x
- dist_triangle : ∀ (x y z : α), has_dist.dist x z ≤ has_dist.dist x y + has_dist.dist y z
- edist : α → α → ennreal
- edist_dist : (∀ (x y : α), metric_space.edist x y = ennreal.of_real (has_dist.dist x y)) . "control_laws_tac"
- to_uniform_space : uniform_space α
- uniformity_dist : (uniformity α = ⨅ (ε : ℝ) (H : ε > 0), filter.principal {p : α × α | has_dist.dist p.fst p.snd < ε}) . "control_laws_tac"
Metric space
Each metric space induces a canonical uniform_space
and hence a canonical topological_space
.
This is enforced in the type class definition, by extending the uniform_space
structure. When
instantiating a metric_space
structure, the uniformity fields are not necessary, they will be
filled in by default. In the same way, each metric space induces an emetric space structure.
It is included in the structure, but filled in by default.
Instances
- normed_group.to_metric_space
- normed_ring.to_metric_space
- normed_field.to_metric_space
- real.metric_space
- subtype.metric_space
- nnreal.metric_space
- prod.metric_space_max
- metric_space_pi
- rat.metric_space
- int.metric_space
- complex.metric_space
- bounded_continuous_function.metric_space
- enorm.metric_space
- pi_Lp.metric_space
- padic.metric_space
- padic_int.metric_space
- measure_theory.l1.metric_space
- metric.nonempty_compacts.metric_space
- metric.completion.metric_space
- premetric.metric_space_quot
- metric.metric_space_glue_space
- metric.metric_space_inductive_limit
- Gromov_Hausdorff.optimal_GH_coupling.metric_space
- Gromov_Hausdorff.rep_GH_space_metric_space
- Gromov_Hausdorff.GH_space_metric_space
Equations
- metric_space.to_has_edist = {edist := metric_space.edist _inst_1}
The triangle (polygon) inequality for sequences of points; finset.Ico
version.
The triangle (polygon) inequality for sequences of points; finset.range
version.
A version of dist_le_Ico_sum_dist
with each intermediate distance replaced
with an upper estimate.
A version of dist_le_range_sum_dist
with each intermediate distance replaced
with an upper estimate.
Distance as a nonnegative real number.
Equations
- nndist a b = ⟨has_dist.dist a b, _⟩
Express nndist
in terms of edist
Express edist
in terms of nndist
In a metric space, the extended distance is always finite
In a metric space, the extended distance is always finite
nndist x x
vanishes
Express dist
in terms of nndist
Express nndist
in terms of dist
Deduce the equality of points with the vanishing of the nonnegative distance
Characterize the equality of points with the vanishing of the nonnegative distance
Triangle inequality for the nonnegative distance
Express dist
in terms of edist
ball x ε
is the set of all points y
with dist y x < ε
Equations
- metric.ball x ε = {y : α | has_dist.dist y x < ε}
closed_ball x ε
is the set of all points y
with dist y x ≤ ε
Equations
- metric.closed_ball x ε = {y : α | has_dist.dist y x ≤ ε}
sphere x ε
is the set of all points y
with dist y x = ε
Equations
- metric.sphere x ε = {y : α | has_dist.dist y x = ε}
Given f : β → ℝ
, 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_dist
, uniformity_basis_dist_inv_nat_succ
,
and uniformity_basis_dist_inv_nat_pos
.
Given f : β → ℝ
, if f
sends {i | p i}
to a set of positive numbers
accumulating to zero, then closed neighborhoods of the diagonal of sizes {f i | p i}
form a basis of 𝓤 α
.
Currently we have only one specific basis uniformity_basis_dist_le
based on this constructor.
More can be easily added if needed in the future.
Contant size closed neighborhoods of the diagonal form a basis of the uniformity filter.
A constant size neighborhood of the diagonal is an entourage.
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.
A metric space space is totally bounded if one can reconstruct up to any ε>0 any element of the space from finitely many data.
Expressing locally uniform convergence on a set using dist
.
Expressing uniform convergence on a set using dist
.
Expressing locally uniform convergence using dist
.
Expressing uniform convergence using dist
.
Equations
Expressing the uniformity in terms of edist
A metric space induces an emetric space
Equations
- metric_space.to_emetric_space = {to_has_edist := {edist := has_edist.edist metric_space.to_has_edist}, edist_self := _, eq_of_edist_eq_zero := _, edist_comm := _, edist_triangle := _, to_uniform_space := metric_space.to_uniform_space _inst_1, uniformity_edist := _}
Balls defined using the distance or the edistance coincide
Balls defined using the distance or the edistance coincide
Closed balls defined using the distance or the edistance coincide
Closed balls defined using the distance or the edistance coincide
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
- m.replace_uniformity H = {to_has_dist := {dist := has_dist.dist metric_space.to_has_dist}, dist_self := _, eq_of_dist_eq_zero := _, dist_comm := _, dist_triangle := _, edist := has_edist.edist metric_space.to_has_edist, edist_dist := _, to_uniform_space := U, uniformity_dist := _}
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
- emetric_space.to_metric_space_of_dist dist edist_ne_top h = let m : metric_space α := {to_has_dist := {dist := dist}, dist_self := _, eq_of_dist_eq_zero := _, dist_comm := _, dist_triangle := _, edist := λ (x y : α), has_edist.edist x y, edist_dist := _, to_uniform_space := uniform_space_of_dist dist _ _ _, uniformity_dist := _} in m.replace_uniformity _
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
- emetric_space.to_metric_space h = emetric_space.to_metric_space_of_dist (λ (x y : α), (has_edist.edist x y).to_real) h emetric_space.to_metric_space._proof_1
A very useful criterion to show that a space is complete is to show that all sequences
which satisfy a bound of the form dist (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.
Instantiate the reals as a metric space.
Equations
- real.metric_space = {to_has_dist := {dist := λ (x y : ℝ), abs (x - y)}, dist_self := real.metric_space._proof_1, eq_of_dist_eq_zero := real.metric_space._proof_2, dist_comm := real.metric_space._proof_3, dist_triangle := real.metric_space._proof_4, edist := λ (x y : ℝ), ennreal.of_real ((λ (x y : ℝ), abs (x - y)) x y), edist_dist := real.metric_space._proof_5, to_uniform_space := uniform_space_of_dist (λ (x y : ℝ), abs (x - y)) real.metric_space._proof_6 real.metric_space._proof_7 real.metric_space._proof_8, uniformity_dist := real.metric_space._proof_9}
Special case of the sandwich theorem; see tendsto_of_tendsto_of_tendsto_of_le_of_le'
for the
general case.
Special case of the sandwich theorem; see tendsto_of_tendsto_of_tendsto_of_le_of_le
and tendsto_of_tendsto_of_tendsto_of_le_of_le'
for the general case.
In a metric space, Cauchy sequences are characterized by the fact that, eventually, the distance between its elements is arbitrarily small
A variation around the metric characterization of Cauchy sequences
If the distance between s n
and s m
, n, m ≥ N
is bounded above by b N
and b
converges to zero, then s
is a Cauchy sequence.
A Cauchy sequence on the natural numbers is bounded.
Yet another metric characterization of Cauchy sequences on integers. This one is often the most efficient.
Metric space structure pulled back by an injective function. Injectivity is necessary to
ensure that dist x y = 0
only if x = y
.
Equations
- metric_space.induced f hf m = {to_has_dist := {dist := λ (x y : α), has_dist.dist (f x) (f y)}, dist_self := _, eq_of_dist_eq_zero := _, dist_comm := _, dist_triangle := _, edist := λ (x y : α), has_edist.edist (f x) (f y), edist_dist := _, to_uniform_space := uniform_space.comap f metric_space.to_uniform_space, uniformity_dist := _}
Equations
- subtype.metric_space = metric_space.induced coe subtype.metric_space._proof_1 t
Equations
- nnreal.metric_space = nnreal.metric_space._proof_1.mpr subtype.metric_space
Equations
- prod.metric_space_max = {to_has_dist := {dist := λ (x y : α × β), max (has_dist.dist x.fst y.fst) (has_dist.dist x.snd y.snd)}, dist_self := _, eq_of_dist_eq_zero := _, dist_comm := _, dist_triangle := _, edist := λ (x y : α × β), max (has_edist.edist x.fst y.fst) (has_edist.edist x.snd y.snd), edist_dist := _, to_uniform_space := prod.uniform_space metric_space.to_uniform_space', uniformity_dist := _}
ε-characterization of the closure in metric spaces
A finite product of metric spaces is a metric space, with the sup distance.
Equations
- metric_space_pi = emetric_space.to_metric_space_of_dist (λ (f g : Π (b : β), π b), ↑(finset.univ.sup (λ (b : β), nndist (f b) (g b)))) metric_space_pi._proof_1 metric_space_pi._proof_2
An open ball in a product space is a product of open balls. The assumption 0 < r
is necessary for the case of the empty product.
A closed ball in a product space is a product of closed balls. The assumption 0 ≤ r
is necessary for the case of the empty product.
Any compact set in a metric space can be covered by finitely many balls of a given positive radius
- compact_ball : ∀ (x : α) (r : ℝ), is_compact (metric.closed_ball x r)
A metric space is proper if all closed balls are compact.
If all closed balls of large enough radius are compact, then the space is proper. Especially useful when the lower bound for the radius is 0.
Equations
A proper space is locally compact
Equations
A proper space is complete
Equations
A proper metric space is separable, and therefore second countable. Indeed, any ball is compact, and therefore admits a countable dense subset. Taking a countable union over the balls centered at a fixed point and with integer radius, one obtains a countable set which is dense in the whole space.
Equations
A finite product of proper spaces is proper.
Equations
A metric space is second countable if, for every ε > 0
, there is a countable set which is
ε
-dense.
A metric space space is second countable if one can reconstruct up to any ε>0
any element of
the space from countably many data.
Boundedness of a subset of a metric space. We formulate the definition to work even in the empty space.
Equations
- metric.bounded s = ∃ (C : ℝ), ∀ (x y : α), x ∈ s → y ∈ s → has_dist.dist x y ≤ C
Subsets of a bounded set are also bounded
Closed balls are bounded
Open balls are bounded
Given a point, a bounded subset is included in some ball around this point
The union of two bounded sets is bounded iff each of the sets is bounded
A finite union of bounded sets is bounded
A compact set is bounded
A finite set is bounded
A singleton is bounded
Characterization of the boundedness of the range of a function
In a compact space, all sets are bounded
The Heine–Borel theorem: In a proper space, a set is compact if and only if it is closed and bounded
The image of a proper space under an expanding onto map is proper.
The diameter of a set in a metric space. To get controllable behavior even when the diameter should be infinite, we express it in terms of the emetric.diameter
Equations
- metric.diam s = (emetric.diam s).to_real
The diameter of a set is always nonnegative
The empty set has zero diameter
A singleton has zero diameter
If the distance between any two points in a set is bounded by some constant C
,
then ennreal.of_real C
bounds the emetric diameter of this set.
If the distance between any two points in a set is bounded by some non-negative constant, this constant bounds the diameter.
If the distance between any two points in a nonempty set is bounded by some constant, this constant bounds the diameter.
The distance between two points in a set is controlled by the diameter of the set.
Characterize the boundedness of a set in terms of the finiteness of its emetric.diameter.
The distance between two points in a set is controlled by the diameter of the set.
An unbounded set has zero diameter. If you would prefer to get the value ∞, use emetric.diam
.
This lemma makes it possible to avoid side conditions in some situations
If s ⊆ t
, then the diameter of s
is bounded by that of t
, provided t
is bounded.
The diameter of a union is controlled by the sum of the diameters, and the distance between
any two points in each of the sets. This lemma is true without any side condition, since it is
obviously true if s ∪ t
is unbounded.
If two sets intersect, the diameter of the union is bounded by the sum of the diameters.
The diameter of a closed ball of radius r
is at most 2 r
.
The diameter of a ball of radius r
is at most 2 r
.