mathlib3 documentation

topology.metric_space.emetric_space

Extended metric spaces #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

This file is devoted to the definition and study of emetric_spaces, i.e., metric spaces in which the distance is allowed to take the value ∞. This extended distance is called edist, and takes values in ℝ≥0∞.

Many definitions and theorems expected on emetric spaces are already introduced on uniform spaces and topological spaces. For example: open and closed sets, compactness, completeness, continuity and uniform continuity.

The class emetric_space therefore extends uniform_space (and topological_space).

Since a lot of elementary properties don't require eq_of_edist_eq_zero we start setting up the theory of pseudo_emetric_space, where we don't require edist x y = 0 → x = y and we specialize to emetric_space at the end.

theorem uniformity_dist_of_mem_uniformity {α : Type u} {β : Type v} [linear_order β] {U : filter × α)} (z : β) (D : α α β) (H : (s : set × α)), s U (ε : β) (H : ε > z), {a b : α}, D a b < ε (a, b) s) :
U = (ε : β) (H : ε > z), filter.principal {p : α × α | D p.fst p.snd < ε}

Characterizing uniformities associated to a (generalized) distance function D in terms of the elements of the uniformity.

@[class]
structure has_edist (α : Type u_2) :
Type u_2

has_edist α means that α is equipped with an extended distance.

Instances of this typeclass
Instances of other typeclasses for has_edist
  • has_edist.has_sizeof_inst
noncomputable def uniform_space_of_edist {α : Type u} (edist : α α ennreal) (edist_self : (x : α), edist x x = 0) (edist_comm : (x y : α), edist x y = edist y x) (edist_triangle : (x y z : α), edist x z edist x y + edist y z) :

Creating a uniform space from an extended distance.

Equations
@[class]
structure pseudo_emetric_space (α : Type u) :

Extended (pseudo) metric spaces, with an extended distance edist possibly taking the value ∞

Each pseudo_emetric 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 pseudo_emetric_space structure, the uniformity fields are not necessary, they will be filled in by default. There is a default value for the uniformity, that can be substituted in cases of interest, for instance when instantiating a pseudo_emetric_space structure on a product.

Continuity of edist is proved in topology.instances.ennreal

Instances of this typeclass
Instances of other typeclasses for pseudo_emetric_space
  • pseudo_emetric_space.has_sizeof_inst

Triangle inequality for the extended distance

theorem edist_congr_right {α : Type u} [pseudo_emetric_space α] {x y z : α} (h : has_edist.edist x y = 0) :
theorem edist_congr_left {α : Type u} [pseudo_emetric_space α] {x y z : α} (h : has_edist.edist x y = 0) :
theorem edist_le_Ico_sum_edist {α : Type u} [pseudo_emetric_space α] (f : α) {m n : } (h : m n) :
has_edist.edist (f m) (f n) (finset.Ico m n).sum (λ (i : ), has_edist.edist (f i) (f (i + 1)))

The triangle (polygon) inequality for sequences of points; finset.Ico version.

theorem edist_le_range_sum_edist {α : Type u} [pseudo_emetric_space α] (f : α) (n : ) :
has_edist.edist (f 0) (f n) (finset.range n).sum (λ (i : ), has_edist.edist (f i) (f (i + 1)))

The triangle (polygon) inequality for sequences of points; finset.range version.

theorem edist_le_Ico_sum_of_edist_le {α : Type u} [pseudo_emetric_space α] {f : α} {m n : } (hmn : m n) {d : ennreal} (hd : {k : }, m k k < n has_edist.edist (f k) (f (k + 1)) d k) :
has_edist.edist (f m) (f n) (finset.Ico m n).sum (λ (i : ), d i)

A version of edist_le_Ico_sum_edist with each intermediate distance replaced with an upper estimate.

theorem edist_le_range_sum_of_edist_le {α : Type u} [pseudo_emetric_space α] {f : α} (n : ) {d : ennreal} (hd : {k : }, k < n has_edist.edist (f k) (f (k + 1)) d k) :
has_edist.edist (f 0) (f n) (finset.range n).sum (λ (i : ), d i)

A version of edist_le_range_sum_edist with each intermediate distance replaced with an upper estimate.

theorem uniformity_pseudoedist {α : Type u} [pseudo_emetric_space α] :
uniformity α = (ε : ennreal) (H : ε > 0), filter.principal {p : α × α | has_edist.edist p.fst p.snd < ε}

Reformulation of the uniform structure in terms of the extended distance

theorem uniformity_basis_edist {α : Type u} [pseudo_emetric_space α] :
(uniformity α).has_basis (λ (ε : ennreal), 0 < ε) (λ (ε : ennreal), {p : α × α | has_edist.edist p.fst p.snd < ε})
theorem mem_uniformity_edist {α : Type u} [pseudo_emetric_space α] {s : set × α)} :
s uniformity α (ε : ennreal) (H : ε > 0), {a b : α}, has_edist.edist a b < ε (a, b) s

Characterization of the elements of the uniformity in terms of the extended distance

@[protected]
theorem emetric.mk_uniformity_basis {α : Type u} [pseudo_emetric_space α] {β : Type u_1} {p : β Prop} {f : β ennreal} (hf₀ : (x : β), p x 0 < f x) (hf : (ε : ennreal), 0 < ε ( (x : β) (hx : p x), f x ε)) :
(uniformity α).has_basis p (λ (x : β), {p : α × α | has_edist.edist p.fst p.snd < f x})

Given f : β → ℝ≥0∞, 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_edist, uniformity_basis_edist', uniformity_basis_edist_nnreal, and uniformity_basis_edist_inv_nat.

@[protected]
theorem emetric.mk_uniformity_basis_le {α : Type u} [pseudo_emetric_space α] {β : Type u_1} {p : β Prop} {f : β ennreal} (hf₀ : (x : β), p x 0 < f x) (hf : (ε : ennreal), 0 < ε ( (x : β) (hx : p x), f x ε)) :
(uniformity α).has_basis p (λ (x : β), {p : α × α | has_edist.edist p.fst p.snd f x})

Given f : β → ℝ≥0∞, if f sends {i | p i} to a set of positive numbers accumulating to zero, then closed f i-neighborhoods of the diagonal form a basis of 𝓤 α.

For specific bases see uniformity_basis_edist_le and uniformity_basis_edist_le'.

theorem uniformity_basis_edist_le {α : Type u} [pseudo_emetric_space α] :
(uniformity α).has_basis (λ (ε : ennreal), 0 < ε) (λ (ε : ennreal), {p : α × α | has_edist.edist p.fst p.snd ε})
theorem uniformity_basis_edist' {α : Type u} [pseudo_emetric_space α] (ε' : ennreal) (hε' : 0 < ε') :
(uniformity α).has_basis (λ (ε : ennreal), ε set.Ioo 0 ε') (λ (ε : ennreal), {p : α × α | has_edist.edist p.fst p.snd < ε})
theorem uniformity_basis_edist_le' {α : Type u} [pseudo_emetric_space α] (ε' : ennreal) (hε' : 0 < ε') :
(uniformity α).has_basis (λ (ε : ennreal), ε set.Ioo 0 ε') (λ (ε : ennreal), {p : α × α | has_edist.edist p.fst p.snd ε})
theorem uniformity_basis_edist_nnreal {α : Type u} [pseudo_emetric_space α] :
(uniformity α).has_basis (λ (ε : nnreal), 0 < ε) (λ (ε : nnreal), {p : α × α | has_edist.edist p.fst p.snd < ε})
theorem uniformity_basis_edist_nnreal_le {α : Type u} [pseudo_emetric_space α] :
(uniformity α).has_basis (λ (ε : nnreal), 0 < ε) (λ (ε : nnreal), {p : α × α | has_edist.edist p.fst p.snd ε})
theorem uniformity_basis_edist_inv_nat {α : Type u} [pseudo_emetric_space α] :
(uniformity α).has_basis (λ (_x : ), true) (λ (n : ), {p : α × α | has_edist.edist p.fst p.snd < (n)⁻¹})
theorem uniformity_basis_edist_inv_two_pow {α : Type u} [pseudo_emetric_space α] :
(uniformity α).has_basis (λ (_x : ), true) (λ (n : ), {p : α × α | has_edist.edist p.fst p.snd < 2⁻¹ ^ n})
theorem edist_mem_uniformity {α : Type u} [pseudo_emetric_space α] {ε : ennreal} (ε0 : 0 < ε) :
{p : α × α | has_edist.edist p.fst p.snd < ε} uniformity α

Fixed size neighborhoods of the diagonal belong to the uniform structure

theorem emetric.uniform_continuous_on_iff {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {f : α β} {s : set α} :
uniform_continuous_on f s (ε : ennreal), ε > 0 ( (δ : ennreal) (H : δ > 0), {a : α} {H : a s} {b : α} {H : b s}, has_edist.edist a b < δ has_edist.edist (f a) (f b) < ε)

ε-δ characterization of uniform continuity on a set for pseudoemetric spaces

theorem emetric.uniform_continuous_iff {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {f : α β} :
uniform_continuous f (ε : ennreal), ε > 0 ( (δ : ennreal) (H : δ > 0), {a b : α}, has_edist.edist a b < δ has_edist.edist (f a) (f b) < ε)

ε-δ characterization of uniform continuity on pseudoemetric spaces

theorem emetric.uniform_embedding_iff {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {f : α β} :
uniform_embedding f function.injective f uniform_continuous f (δ : ennreal), δ > 0 ( (ε : ennreal) (H : ε > 0), {a b : α}, has_edist.edist (f a) (f b) < ε has_edist.edist a b < δ)

ε-δ characterization of uniform embeddings on pseudoemetric spaces

theorem emetric.controlled_of_uniform_embedding {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {f : α β} :
uniform_embedding f (( (ε : ennreal), ε > 0 ( (δ : ennreal) (H : δ > 0), {a b : α}, has_edist.edist a b < δ has_edist.edist (f a) (f b) < ε)) (δ : ennreal), δ > 0 ( (ε : ennreal) (H : ε > 0), {a b : α}, has_edist.edist (f a) (f b) < ε has_edist.edist a b < δ))

If a map between pseudoemetric spaces is a uniform embedding then the edistance between f x and f y is controlled in terms of the distance between x and y.

@[protected]
theorem emetric.cauchy_iff {α : Type u} [pseudo_emetric_space α] {f : filter α} :
cauchy f f (ε : ennreal), ε > 0 ( (t : set α) (H : t f), (x : α), x t (y : α), y t has_edist.edist x y < ε)

ε-δ characterization of Cauchy sequences on pseudoemetric spaces

theorem emetric.complete_of_convergent_controlled_sequences {α : Type u} [pseudo_emetric_space α] (B : ennreal) (hB : (n : ), 0 < B n) (H : (u : α), ( (N n m : ), N n N m has_edist.edist (u n) (u m) < B N) ( (x : α), filter.tendsto u filter.at_top (nhds x))) :

A very useful criterion to show that a space is complete is to show that all sequences which satisfy a bound of the form edist (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.

A sequentially complete pseudoemetric space is complete.

theorem emetric.tendsto_locally_uniformly_on_iff {α : Type u} {β : Type v} [pseudo_emetric_space α] {ι : Type u_1} [topological_space β] {F : ι β α} {f : β α} {p : filter ι} {s : set β} :
tendsto_locally_uniformly_on F f p s (ε : ennreal), ε > 0 (x : β), x s ( (t : set β) (H : t nhds_within x s), ∀ᶠ (n : ι) in p, (y : β), y t has_edist.edist (f y) (F n y) < ε)

Expressing locally uniform convergence on a set using edist.

theorem emetric.tendsto_uniformly_on_iff {α : Type u} {β : Type v} [pseudo_emetric_space α] {ι : Type u_1} {F : ι β α} {f : β α} {p : filter ι} {s : set β} :
tendsto_uniformly_on F f p s (ε : ennreal), ε > 0 (∀ᶠ (n : ι) in p, (x : β), x s has_edist.edist (f x) (F n x) < ε)

Expressing uniform convergence on a set using edist.

theorem emetric.tendsto_locally_uniformly_iff {α : Type u} {β : Type v} [pseudo_emetric_space α] {ι : Type u_1} [topological_space β] {F : ι β α} {f : β α} {p : filter ι} :
tendsto_locally_uniformly F f p (ε : ennreal), ε > 0 (x : β), (t : set β) (H : t nhds x), ∀ᶠ (n : ι) in p, (y : β), y t has_edist.edist (f y) (F n y) < ε

Expressing locally uniform convergence using edist.

theorem emetric.tendsto_uniformly_iff {α : Type u} {β : Type v} [pseudo_emetric_space α] {ι : Type u_1} {F : ι β α} {f : β α} {p : filter ι} :
tendsto_uniformly F f p (ε : ennreal), ε > 0 (∀ᶠ (n : ι) in p, (x : β), has_edist.edist (f x) (F n x) < ε)

Expressing uniform convergence using edist.

Auxiliary function to replace the uniformity on a pseudoemetric space with a uniformity which is equal to the original one, but maybe not defeq. This is useful if one wants to construct a pseudoemetric space with a specified uniformity. See Note [forgetful inheritance] explaining why having definitionally the right uniformity is often important.

Equations
def pseudo_emetric_space.induced {α : Type u_1} {β : Type u_2} (f : α β) (m : pseudo_emetric_space β) :

The extended pseudometric induced by a function taking values in a pseudoemetric space.

Equations
@[protected, instance]

Pseudoemetric space instance on subsets of pseudoemetric spaces

Equations
theorem subtype.edist_eq {α : Type u} [pseudo_emetric_space α] {p : α Prop} (x y : subtype p) :

The extended psuedodistance on a subset of a pseudoemetric space is the restriction of the original pseudodistance, by definition

@[protected, instance]

Pseudoemetric space instance on the additive opposite of a pseudoemetric space.

Equations
@[protected, instance]

Pseudoemetric space instance on the multiplicative opposite of a pseudoemetric space.

Equations
@[simp]
theorem ulift.edist_up_up {α : Type u} [pseudo_emetric_space α] (x y : α) :
@[protected, instance]

The product of two pseudoemetric spaces, with the max distance, is an extended pseudometric spaces. We make sure that the uniform structure thus constructed is the one corresponding to the product of uniform spaces, to avoid diamond problems.

Equations
@[protected, instance]
def pseudo_emetric_space_pi {β : Type v} {π : β Type u_2} [fintype β] [Π (b : β), pseudo_emetric_space (π b)] :
pseudo_emetric_space (Π (b : β), π b)

The product of a finite number of pseudoemetric spaces, with the max distance, is still a pseudoemetric space. This construction would also work for infinite products, but it would not give rise to the product topology. Hence, we only formalize it in the good situation of finitely many spaces.

Equations
theorem edist_pi_def {β : Type v} {π : β Type u_2} [fintype β] [Π (b : β), pseudo_emetric_space (π b)] (f g : Π (b : β), π b) :
has_edist.edist f g = finset.univ.sup (λ (b : β), has_edist.edist (f b) (g b))
theorem edist_le_pi_edist {β : Type v} {π : β Type u_2} [fintype β] [Π (b : β), pseudo_emetric_space (π b)] (f g : Π (b : β), π b) (b : β) :
theorem edist_pi_le_iff {β : Type v} {π : β Type u_2} [fintype β] [Π (b : β), pseudo_emetric_space (π b)] {f g : Π (b : β), π b} {d : ennreal} :
has_edist.edist f g d (b : β), has_edist.edist (f b) (g b) d
theorem edist_pi_const_le {α : Type u} {β : Type v} [pseudo_emetric_space α] [fintype β] (a b : α) :
has_edist.edist (λ (_x : β), a) (λ (_x : β), b) has_edist.edist a b
@[simp]
theorem edist_pi_const {α : Type u} {β : Type v} [pseudo_emetric_space α] [fintype β] [nonempty β] (a b : α) :
has_edist.edist (λ (x : β), a) (λ (_x : β), b) = has_edist.edist a b
def emetric.ball {α : Type u} [pseudo_emetric_space α] (x : α) (ε : ennreal) :
set α

emetric.ball x ε is the set of all points y with edist y x < ε

Equations
@[simp]
theorem emetric.mem_ball {α : Type u} [pseudo_emetric_space α] {x y : α} {ε : ennreal} :
theorem emetric.mem_ball' {α : Type u} [pseudo_emetric_space α] {x y : α} {ε : ennreal} :
def emetric.closed_ball {α : Type u} [pseudo_emetric_space α] (x : α) (ε : ennreal) :
set α

emetric.closed_ball x ε is the set of all points y with edist y x ≤ ε

Equations
@[simp]
theorem emetric.mem_closed_ball {α : Type u} [pseudo_emetric_space α] {x y : α} {ε : ennreal} :
theorem emetric.pos_of_mem_ball {α : Type u} [pseudo_emetric_space α] {x y : α} {ε : ennreal} (hy : y emetric.ball x ε) :
0 < ε
theorem emetric.mem_ball_self {α : Type u} [pseudo_emetric_space α] {x : α} {ε : ennreal} (h : 0 < ε) :
theorem emetric.mem_ball_comm {α : Type u} [pseudo_emetric_space α] {x y : α} {ε : ennreal} :
theorem emetric.ball_subset_ball {α : Type u} [pseudo_emetric_space α] {x : α} {ε₁ ε₂ : ennreal} (h : ε₁ ε₂) :
emetric.ball x ε₁ emetric.ball x ε₂
theorem emetric.closed_ball_subset_closed_ball {α : Type u} [pseudo_emetric_space α] {x : α} {ε₁ ε₂ : ennreal} (h : ε₁ ε₂) :
theorem emetric.ball_disjoint {α : Type u} [pseudo_emetric_space α] {x y : α} {ε₁ ε₂ : ennreal} (h : ε₁ + ε₂ has_edist.edist x y) :
disjoint (emetric.ball x ε₁) (emetric.ball y ε₂)
theorem emetric.ball_subset {α : Type u} [pseudo_emetric_space α] {x y : α} {ε₁ ε₂ : ennreal} (h : has_edist.edist x y + ε₁ ε₂) (h' : has_edist.edist x y ) :
emetric.ball x ε₁ emetric.ball y ε₂
theorem emetric.exists_ball_subset_ball {α : Type u} [pseudo_emetric_space α] {x y : α} {ε : ennreal} (h : y emetric.ball x ε) :
(ε' : ennreal) (H : ε' > 0), emetric.ball y ε' emetric.ball x ε
theorem emetric.ball_eq_empty_iff {α : Type u} [pseudo_emetric_space α] {x : α} {ε : ennreal} :
emetric.ball x ε = ε = 0

Relation “two points are at a finite edistance” is an equivalence relation.

Equations
@[simp]
theorem emetric.ball_zero {α : Type u} [pseudo_emetric_space α] {x : α} :
theorem emetric.nhds_basis_eball {α : Type u} [pseudo_emetric_space α] {x : α} :
(nhds x).has_basis (λ (ε : ennreal), 0 < ε) (emetric.ball x)
theorem emetric.nhds_within_basis_eball {α : Type u} [pseudo_emetric_space α] {x : α} {s : set α} :
(nhds_within x s).has_basis (λ (ε : ennreal), 0 < ε) (λ (ε : ennreal), emetric.ball x ε s)
theorem emetric.nhds_basis_closed_eball {α : Type u} [pseudo_emetric_space α] {x : α} :
(nhds x).has_basis (λ (ε : ennreal), 0 < ε) (emetric.closed_ball x)
theorem emetric.nhds_within_basis_closed_eball {α : Type u} [pseudo_emetric_space α] {x : α} {s : set α} :
(nhds_within x s).has_basis (λ (ε : ennreal), 0 < ε) (λ (ε : ennreal), emetric.closed_ball x ε s)
theorem emetric.nhds_eq {α : Type u} [pseudo_emetric_space α] {x : α} :
nhds x = (ε : ennreal) (H : ε > 0), filter.principal (emetric.ball x ε)
theorem emetric.mem_nhds_iff {α : Type u} [pseudo_emetric_space α] {x : α} {s : set α} :
s nhds x (ε : ennreal) (H : ε > 0), emetric.ball x ε s
theorem emetric.mem_nhds_within_iff {α : Type u} [pseudo_emetric_space α] {x : α} {s t : set α} :
s nhds_within x t (ε : ennreal) (H : ε > 0), emetric.ball x ε t s
theorem emetric.tendsto_nhds_within_nhds_within {α : Type u} {β : Type v} [pseudo_emetric_space α] {s : set α} [pseudo_emetric_space β] {f : α β} {t : set β} {a : α} {b : β} :
filter.tendsto f (nhds_within a s) (nhds_within b t) (ε : ennreal), ε > 0 ( (δ : ennreal) (H : δ > 0), ⦃x : α⦄, x s has_edist.edist x a < δ f x t has_edist.edist (f x) b < ε)
theorem emetric.tendsto_nhds_within_nhds {α : Type u} {β : Type v} [pseudo_emetric_space α] {s : set α} [pseudo_emetric_space β] {f : α β} {a : α} {b : β} :
filter.tendsto f (nhds_within a s) (nhds b) (ε : ennreal), ε > 0 ( (δ : ennreal) (H : δ > 0), {x : α}, x s has_edist.edist x a < δ has_edist.edist (f x) b < ε)
theorem emetric.tendsto_nhds_nhds {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] {f : α β} {a : α} {b : β} :
filter.tendsto f (nhds a) (nhds b) (ε : ennreal), ε > 0 ( (δ : ennreal) (H : δ > 0), ⦃x : α⦄, has_edist.edist x a < δ has_edist.edist (f x) b < ε)
theorem emetric.is_open_iff {α : Type u} [pseudo_emetric_space α] {s : set α} :
is_open s (x : α), x s ( (ε : ennreal) (H : ε > 0), emetric.ball x ε s)
theorem emetric.is_open_ball {α : Type u} [pseudo_emetric_space α] {x : α} {ε : ennreal} :
theorem emetric.ball_mem_nhds {α : Type u} [pseudo_emetric_space α] (x : α) {ε : ennreal} (ε0 : 0 < ε) :
theorem emetric.closed_ball_mem_nhds {α : Type u} [pseudo_emetric_space α] (x : α) {ε : ennreal} (ε0 : 0 < ε) :
theorem emetric.ball_prod_same {α : Type u} {β : Type v} [pseudo_emetric_space α] [pseudo_emetric_space β] (x : α) (y : β) (r : ennreal) :
theorem emetric.mem_closure_iff {α : Type u} [pseudo_emetric_space α] {x : α} {s : set α} :
x closure s (ε : ennreal), ε > 0 ( (y : α) (H : y s), has_edist.edist x y < ε)

ε-characterization of the closure in pseudoemetric spaces

theorem emetric.tendsto_nhds {α : Type u} {β : Type v} [pseudo_emetric_space α] {f : filter β} {u : β α} {a : α} :
filter.tendsto u f (nhds a) (ε : ennreal), ε > 0 (∀ᶠ (x : β) in f, has_edist.edist (u x) a < ε)
theorem emetric.tendsto_at_top {α : Type u} {β : Type v} [pseudo_emetric_space α] [nonempty β] [semilattice_sup β] {u : β α} {a : α} :
filter.tendsto u filter.at_top (nhds a) (ε : ennreal), ε > 0 ( (N : β), (n : β), n N has_edist.edist (u n) a < ε)
@[nolint]
theorem emetric.cauchy_seq_iff {α : Type u} {β : Type v} [pseudo_emetric_space α] [nonempty β] [semilattice_sup β] {u : β α} :
cauchy_seq u (ε : ennreal), ε > 0 ( (N : β), (m : β), m N (n : β), n N has_edist.edist (u m) (u n) < ε)

In a pseudoemetric space, Cauchy sequences are characterized by the fact that, eventually, the pseudoedistance between its elements is arbitrarily small

theorem emetric.cauchy_seq_iff' {α : Type u} {β : Type v} [pseudo_emetric_space α] [nonempty β] [semilattice_sup β] {u : β α} :
cauchy_seq u (ε : ennreal), ε > 0 ( (N : β), (n : β), n N has_edist.edist (u n) (u N) < ε)

A variation around the emetric characterization of Cauchy sequences

theorem emetric.cauchy_seq_iff_nnreal {α : Type u} {β : Type v} [pseudo_emetric_space α] [nonempty β] [semilattice_sup β] {u : β α} :
cauchy_seq u (ε : nnreal), 0 < ε ( (N : β), (n : β), N n has_edist.edist (u n) (u N) < ε)

A variation of the emetric characterization of Cauchy sequences that deals with ℝ≥0 upper bounds.

theorem emetric.totally_bounded_iff {α : Type u} [pseudo_emetric_space α] {s : set α} :
totally_bounded s (ε : ennreal), ε > 0 ( (t : set α), t.finite s (y : α) (H : y t), emetric.ball y ε)
theorem emetric.totally_bounded_iff' {α : Type u} [pseudo_emetric_space α] {s : set α} :
totally_bounded s (ε : ennreal), ε > 0 ( (t : set α) (H : t s), t.finite s (y : α) (H : y t), emetric.ball y ε)
theorem emetric.subset_countable_closure_of_almost_dense_set {α : Type u} [pseudo_emetric_space α] (s : set α) (hs : (ε : ennreal), ε > 0 ( (t : set α), t.countable s (x : α) (H : x t), emetric.closed_ball x ε)) :
(t : set α) (H : t s), t.countable s closure t

For a set s in a pseudo emetric space, if for every ε > 0 there exists a countable set that is ε-dense in s, then there exists a countable subset t ⊆ s that is dense in s.

theorem emetric.subset_countable_closure_of_compact {α : Type u} [pseudo_emetric_space α] {s : set α} (hs : is_compact s) :
(t : set α) (H : t s), t.countable s closure t

A compact set in a pseudo emetric space is separable, i.e., it is a subset of the closure of a countable set.

A sigma compact pseudo emetric space has second countable topology. This is not an instance to avoid a loop with sigma_compact_space_of_locally_compact_second_countable.

noncomputable def emetric.diam {α : Type u} [pseudo_emetric_space α] (s : set α) :

The diameter of a set in a pseudoemetric space, named emetric.diam

Equations
theorem emetric.diam_le_iff {α : Type u} [pseudo_emetric_space α] {s : set α} {d : ennreal} :
emetric.diam s d (x : α), x s (y : α), y s has_edist.edist x y d
theorem emetric.diam_image_le_iff {α : Type u} {β : Type v} [pseudo_emetric_space α] {d : ennreal} {f : β α} {s : set β} :
emetric.diam (f '' s) d (x : β), x s (y : β), y s has_edist.edist (f x) (f y) d
theorem emetric.edist_le_of_diam_le {α : Type u} [pseudo_emetric_space α] {x y : α} {s : set α} {d : ennreal} (hx : x s) (hy : y s) (hd : emetric.diam s d) :
theorem emetric.edist_le_diam_of_mem {α : Type u} [pseudo_emetric_space α] {x y : α} {s : set α} (hx : x s) (hy : y s) :

If two points belong to some set, their edistance is bounded by the diameter of the set

theorem emetric.diam_le {α : Type u} [pseudo_emetric_space α] {s : set α} {d : ennreal} (h : (x : α), x s (y : α), y s has_edist.edist x y d) :

If the distance between any two points in a set is bounded by some constant, this constant bounds the diameter.

theorem emetric.diam_subsingleton {α : Type u} [pseudo_emetric_space α] {s : set α} (hs : s.subsingleton) :

The diameter of a subsingleton vanishes.

@[simp]

The diameter of the empty set vanishes

@[simp]
theorem emetric.diam_singleton {α : Type u} [pseudo_emetric_space α] {x : α} :

The diameter of a singleton vanishes

theorem emetric.diam_Union_mem_option {α : Type u} [pseudo_emetric_space α] {ι : Type u_1} (o : option ι) (s : ι set α) :
emetric.diam ( (i : ι) (H : i o), s i) = (i : ι) (H : i o), emetric.diam (s i)
theorem emetric.diam_insert {α : Type u} [pseudo_emetric_space α] {x : α} {s : set α} :
theorem emetric.diam_pair {α : Type u} [pseudo_emetric_space α] {x y : α} :
theorem emetric.diam_mono {α : Type u} [pseudo_emetric_space α] {s t : set α} (h : s t) :

The diameter is monotonous with respect to inclusion

theorem emetric.diam_union {α : Type u} [pseudo_emetric_space α] {x y : α} {s t : set α} (xs : x s) (yt : y t) :

The diameter of a union is controlled by the diameter of the sets, and the edistance between two points in the sets.

theorem emetric.diam_union' {α : Type u} [pseudo_emetric_space α] {s t : set α} (h : (s t).nonempty) :
theorem emetric.diam_ball {α : Type u} [pseudo_emetric_space α] {x : α} {r : ennreal} :
theorem emetric.diam_pi_le_of_le {β : Type v} {π : β Type u_1} [fintype β] [Π (b : β), pseudo_emetric_space (π b)] {s : Π (b : β), set (π b)} {c : ennreal} (h : (b : β), emetric.diam (s b) c) :
@[class]
structure emetric_space (α : Type u) :

We now define emetric_space, extending pseudo_emetric_space.

Instances of this typeclass
Instances of other typeclasses for emetric_space
  • emetric_space.has_sizeof_inst
@[simp]
theorem edist_eq_zero {γ : Type w} [emetric_space γ] {x y : γ} :

Characterize the equality of points by the vanishing of their extended distance

@[simp]
theorem zero_eq_edist {γ : Type w} [emetric_space γ] {x y : γ} :
theorem edist_le_zero {γ : Type w} [emetric_space γ] {x y : γ} :
@[simp]
theorem edist_pos {γ : Type w} [emetric_space γ] {x y : γ} :
theorem eq_of_forall_edist_le {γ : Type w} [emetric_space γ] {x y : γ} (h : (ε : ennreal), ε > 0 has_edist.edist x y ε) :
x = y

Two points coincide if their distance is < ε for all positive ε

@[protected, instance]

An emetric space is separated

theorem emetric.uniform_embedding_iff' {β : Type v} {γ : Type w} [emetric_space γ] [emetric_space β] {f : γ β} :
uniform_embedding f ( (ε : ennreal), ε > 0 ( (δ : ennreal) (H : δ > 0), {a b : γ}, has_edist.edist a b < δ has_edist.edist (f a) (f b) < ε)) (δ : ennreal), δ > 0 ( (ε : ennreal) (H : ε > 0), {a b : γ}, has_edist.edist (f a) (f b) < ε has_edist.edist a b < δ)

A map between emetric spaces is a uniform embedding if and only if the edistance between f x and f y is controlled in terms of the distance between x and y and conversely.

Auxiliary function to replace the uniformity on an emetric space with a uniformity which is equal to the original one, but maybe not defeq. This is useful if one wants to construct an emetric space with a specified uniformity. See Note [forgetful inheritance] explaining why having definitionally the right uniformity is often important.

Equations
def emetric_space.induced {γ : Type u_1} {β : Type u_2} (f : γ β) (hf : function.injective f) (m : emetric_space β) :

The extended metric induced by an injective function taking values in a emetric space.

Equations
@[protected, instance]
def subtype.emetric_space {α : Type u_1} {p : α Prop} [emetric_space α] :

Emetric space instance on subsets of emetric spaces

Equations
@[protected, instance]

Emetric space instance on the multiplicative opposite of an emetric space.

Equations
@[protected, instance]

Emetric space instance on the additive opposite of an emetric space.

Equations
@[protected, instance]
def prod.emetric_space_max {β : Type v} {γ : Type w} [emetric_space γ] [emetric_space β] :

The product of two emetric spaces, with the max distance, is an extended metric spaces. We make sure that the uniform structure thus constructed is the one corresponding to the product of uniform spaces, to avoid diamond problems.

Equations
theorem uniformity_edist {γ : Type w} [emetric_space γ] :
uniformity γ = (ε : ennreal) (H : ε > 0), filter.principal {p : γ × γ | has_edist.edist p.fst p.snd < ε}

Reformulation of the uniform structure in terms of the extended distance

@[protected, instance]
def emetric_space_pi {β : Type v} {π : β Type u_2} [fintype β] [Π (b : β), emetric_space (π b)] :
emetric_space (Π (b : β), π b)

The product of a finite number of emetric spaces, with the max distance, is still an emetric space. This construction would also work for infinite products, but it would not give rise to the product topology. Hence, we only formalize it in the good situation of finitely many spaces.

Equations
theorem emetric.countable_closure_of_compact {γ : Type w} [emetric_space γ] {s : set γ} (hs : is_compact s) :
(t : set γ) (H : t s), t.countable s = closure t

A compact set in an emetric space is separable, i.e., it is the closure of a countable set.

theorem emetric.diam_pos_iff {γ : Type w} [emetric_space γ] {s : set γ} :
0 < emetric.diam s (x : γ) (H : x s) (y : γ) (H : y s), x y

Separation quotient #

@[simp]

additive, multiplicative #

The distance on those type synonyms is inherited without change.

@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations
@[protected, instance]
Equations

Order dual #

The distance on this type synonym is inherited without change.

@[protected, instance]
Equations
@[protected, instance]
Equations