Uniform spaces #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Uniform spaces are a generalization of metric spaces and topological groups. Many concepts directly generalize to uniform spaces, e.g.
- uniform continuity (in this file)
- completeness (in
cauchy.lean
) - extension of uniform continuous functions to complete spaces (in
uniform_embedding.lean
) - totally bounded sets (in
cauchy.lean
) - totally bounded complete sets are compact (in
cauchy.lean
)
A uniform structure on a type X
is a filter 𝓤 X
on X × X
satisfying some conditions
which makes it reasonable to say that ∀ᶠ (p : X × X) in 𝓤 X, ...
means
"for all p.1 and p.2 in X close enough, ...". Elements of this filter are called entourages
of X
. The two main examples are:
- If
X
is a metric space,V ∈ 𝓤 X ↔ ∃ ε > 0, { p | dist p.1 p.2 < ε } ⊆ V
- If
G
is an additive topological group,V ∈ 𝓤 G ↔ ∃ U ∈ 𝓝 (0 : G), {p | p.2 - p.1 ∈ U} ⊆ V
Those examples are generalizations in two different directions of the elementary example where
X = ℝ
and V ∈ 𝓤 ℝ ↔ ∃ ε > 0, { p | |p.2 - p.1| < ε } ⊆ V
which features both the topological
group structure on ℝ
and its metric space structure.
Each uniform structure on X
induces a topology on X
characterized by
nhds_eq_comap_uniformity : ∀ {x : X}, 𝓝 x = comap (prod.mk x) (𝓤 X)
where prod.mk x : X → X × X := (λ y, (x, y))
is the partial evaluation of the product
constructor.
The dictionary with metric spaces includes:
- an upper bound for
dist x y
translates into(x, y) ∈ V
for someV ∈ 𝓤 X
- a ball
ball x r
roughly corresponds touniform_space.ball x V := {y | (x, y) ∈ V}
for someV ∈ 𝓤 X
, but the later is more general (it includes in particular both open and closed balls for suitableV
). In particular we have:is_open_iff_ball_subset {s : set X} : is_open s ↔ ∀ x ∈ s, ∃ V ∈ 𝓤 X, ball x V ⊆ s
The triangle inequality is abstracted to a statement involving the composition of relations in X
.
First note that the triangle inequality in a metric space is equivalent to
∀ (x y z : X) (r r' : ℝ), dist x y ≤ r → dist y z ≤ r' → dist x z ≤ r + r'
.
Then, for any V
and W
with type set (X × X)
, the composition V ○ W : set (X × X)
is
defined as { p : X × X | ∃ z, (p.1, z) ∈ V ∧ (z, p.2) ∈ W }
.
In the metric space case, if V = { p | dist p.1 p.2 ≤ r }
and W = { p | dist p.1 p.2 ≤ r' }
then the triangle inequality, as reformulated above, says V ○ W
is contained in
{p | dist p.1 p.2 ≤ r + r'}
which is the entourage associated to the radius r + r'
.
In general we have mem_ball_comp (h : y ∈ ball x V) (h' : z ∈ ball y W) : z ∈ ball x (V ○ W)
.
Note that this discussion does not depend on any axiom imposed on the uniformity filter,
it is simply captured by the definition of composition.
The uniform space axioms ask the filter 𝓤 X
to satisfy the following:
- every
V ∈ 𝓤 X
contains the diagonalid_rel = { p | p.1 = p.2 }
. This abstracts the fact thatdist x x ≤ r
for every non-negative radiusr
in the metric space case and also thatx - x
belongs to every neighborhood of zero in the topological group case. V ∈ 𝓤 X → prod.swap '' V ∈ 𝓤 X
. This is tightly related the fact thatdist x y = dist y x
in a metric space, and to continuity of negation in the topological group case.∀ V ∈ 𝓤 X, ∃ W ∈ 𝓤 X, W ○ W ⊆ V
. In the metric space case, it corresponds to cutting the radius of a ball in half and applying the triangle inequality. In the topological group case, it comes from continuity of addition at(0, 0)
.
These three axioms are stated more abstractly in the definition below, in terms of operations on filters, without directly manipulating entourages.
Main definitions #
uniform_space X
is a uniform space structure on a typeX
uniform_continuous f
is a predicate saying a functionf : α → β
between uniform spaces is uniformly continuous :∀ r ∈ 𝓤 β, ∀ᶠ (x : α × α) in 𝓤 α, (f x.1, f x.2) ∈ r
In this file we also define a complete lattice structure on the type uniform_space X
of uniform structures on X
, as well as the pullback (uniform_space.comap
) of uniform structures
coming from the pullback of filters.
Like distance functions, uniform structures cannot be pushed forward in general.
Notations #
Localized in uniformity
, we have the notation 𝓤 X
for the uniformity on a uniform space X
,
and ○
for composition of relations, seen as terms with type set (X × X)
.
Implementation notes #
There is already a theory of relations in data/rel.lean
where the main definition is
def rel (α β : Type*) := α → β → Prop
.
The relations used in the current file involve only one type, but this is not the reason why
we don't reuse data/rel.lean
. We use set (α × α)
instead of rel α α
because we really need sets to use the filter library, and elements
of filters on α × α
have type set (α × α)
.
The structure uniform_space X
bundles a uniform structure on X
, a topology on X
and
an assumption saying those are compatible. This may not seem mathematically reasonable at first,
but is in fact an instance of the forgetful inheritance pattern. See Note [forgetful inheritance]
below.
References #
The formalization uses the books:
But it makes a more systematic use of the filter library.
The relation is invariant under swapping factors.
Equations
- symmetric_rel V = (prod.swap ⁻¹' V = V)
- uniformity : filter (α × α)
- refl : filter.principal id_rel ≤ self.uniformity
- symm : filter.tendsto prod.swap self.uniformity self.uniformity
- comp : self.uniformity.lift' (λ (s : set (α × α)), comp_rel s s) ≤ self.uniformity
This core description of a uniform space is outside of the type class hierarchy. It is useful for constructions of uniform spaces, when the topology is derived from the uniform space.
Instances for uniform_space.core
- uniform_space.core.has_sizeof_inst
- inhabited_uniform_space_core
An alternative constructor for uniform_space.core
. This version unfolds various
filter
-related definitions.
Equations
- uniform_space.core.mk' U refl symm comp = {uniformity := U, refl := _, symm := symm, comp := _}
Defining an uniform_space.core
from a filter basis satisfying some uniformity-like axioms.
Equations
- uniform_space.core.mk_of_basis B refl symm comp = {uniformity := B.filter, refl := _, symm := _, comp := _}
A uniform space generates a topological space
Equations
- u.to_topological_space = {is_open := λ (s : set α), ∀ (x : α), x ∈ s → {p : α × α | p.fst = x → p.snd ∈ s} ∈ u.uniformity, is_open_univ := _, is_open_inter := _, is_open_sUnion := _}
- to_topological_space : topological_space α
- to_core : uniform_space.core α
- is_open_uniformity : ∀ (s : set α), is_open s ↔ ∀ (x : α), x ∈ s → {p : α × α | p.fst = x → p.snd ∈ s} ∈ uniform_space.to_core.uniformity
A uniform space is a generalization of the "uniform" topological aspects of a
metric space. It consists of a filter on α × α
called the "uniformity", which
satisfies properties analogous to the reflexivity, symmetry, and triangle properties
of a metric.
A metric space has a natural uniformity, and a uniform space has a natural topology. A topological group also has a natural uniformity, even when it is not metrizable.
Instances of this typeclass
- uniform_space.completion.uniform_space
- pseudo_emetric_space.to_uniform_space
- pseudo_metric_space.to_uniform_space
- valued.to_uniform_space
- with_ideal.uniform_space
- ulift.uniform_space
- empty.uniform_space
- punit.uniform_space
- bool.uniform_space
- nat.uniform_space
- int.uniform_space
- additive.uniform_space
- multiplicative.uniform_space
- subtype.uniform_space
- mul_opposite.uniform_space
- add_opposite.uniform_space
- prod.uniform_space
- sum.uniform_space
- uniform_space.separation_setoid.uniform_space
- uniform_space.separation_quotient.uniform_space
- Pi.uniform_space
- uniform_fun.uniform_space
- uniform_on_fun.uniform_space
- Cauchy.uniform_space
- continuous_linear_map.uniform_space
- pi_Lp.uniform_space
- continuous_map.compact_convergence_uniform_space
- matrix.uniform_space
- compare_reals.Q.uniform_space
- compare_reals.bourbaki.uniform_space
- UniformSpace.uniform_space
- CpltSepUniformSpace.is_uniform_space
- schwartz_map.uniform_space
Instances of other typeclasses for uniform_space
Alternative constructor for uniform_space α
when a topology is already given.
Equations
- uniform_space.mk' t c is_open_uniformity = {to_topological_space := t, to_core := c, is_open_uniformity := is_open_uniformity}
Construct a uniform_space
from a uniform_space.core
.
Equations
- uniform_space.of_core u = {to_topological_space := u.to_topological_space, to_core := u, is_open_uniformity := _}
Construct a uniform_space
from a u : uniform_space.core
and a topological_space
structure
that is equal to u.to_topological_space
.
Equations
- uniform_space.of_core_eq u t h = {to_topological_space := t, to_core := u, is_open_uniformity := _}
The uniformity is a filter on α × α (inferred from an ambient uniform space structure on α).
Equations
Instances for uniformity
Replace topology in a uniform_space
instance with a propositionally (but possibly not
definitionally) equal one.
Equations
Define a uniform_space
using a "distance" function. The function can be, e.g., the distance in
a (usual or extended) metric space or an absolute value on a ring.
Equations
- uniform_space.of_fun d refl symm triangle half = uniform_space.of_core {uniformity := ⨅ (r : β) (H : r > 0), filter.principal {x : α × α | d x.fst x.snd < r}, refl := _, symm := _, comp := _}
If s ∈ 𝓤 α
, then for any natural n
, for a subset t
of a sufficiently small set in 𝓤 α
,
we have t ○ t ○ ... ○ t ⊆ s
(n
compositions).
If s ∈ 𝓤 α
, then for any natural n
, for a subset t
of a sufficiently small set in 𝓤 α
,
we have t ○ t ⊆ s
.
Relation λ f g, tendsto (λ x, (f x, g x)) l (𝓤 α)
is transitive.
Relation λ f g, tendsto (λ x, (f x, g x)) l (𝓤 α)
is symmetric
Relation λ f g, tendsto (λ x, (f x, g x)) l (𝓤 α)
is reflexive.
Symmetric entourages form a basis of 𝓤 α
See also comp_open_symm_mem_uniformity_sets
.
Balls in uniform spaces #
The ball around (x : β)
with respect to (V : set (β × β))
. Intended to be
used for V ∈ 𝓤 β
, but this is not needed for the definition. Recovers the
notions of metric space ball when V = {p | dist p.1 p.2 < r }
.
Equations
- uniform_space.ball x V = prod.mk x ⁻¹' V
The triangle inequality for uniform_space.ball
Neighborhoods in uniform spaces #
See also is_open_iff_open_ball_subset
.
Entourages are neighborhoods of the diagonal.
Entourages are neighborhoods of the diagonal.
Entourages are neighborhoods of the diagonal.
Closure and interior in uniform spaces #
Closed entourages form a basis of the uniformity filter.
The uniform neighborhoods of all points of a dense set cover the whole space.
Uniformity bases #
Open elements of 𝓤 α
form a basis of 𝓤 α
.
Open elements s : set (α × α)
of 𝓤 α
such that (x, y) ∈ s ↔ (y, x) ∈ s
form a basis
of 𝓤 α
.
Uniform continuity #
A function f : α → β
is uniformly continuous if (f x, f y)
tends to the diagonal
as (x, y)
tends to the diagonal. In other words, if x
is sufficiently close to y
, then
f x
is close to f y
no matter where x
and y
are located in α
.
Equations
- uniform_continuous f = filter.tendsto (λ (x : α × α), (f x.fst, f x.snd)) (uniformity α) (uniformity β)
Instances for uniform_continuous
A function f : α → β
is uniformly continuous on s : set α
if (f x, f y)
tends to
the diagonal as (x, y)
tends to the diagonal while remaining in s ×ˢ s
.
In other words, if x
is sufficiently close to y
, then f x
is close to
f y
no matter where x
and y
are located in s
.
Equations
- uniform_continuous_on f s = filter.tendsto (λ (x : α × α), (f x.fst, f x.snd)) (uniformity α ⊓ filter.principal (s ×ˢ s)) (uniformity β)
Equations
- uniform_space.partial_order = {le := λ (t s : uniform_space α), uniform_space.to_core.uniformity ≤ uniform_space.to_core.uniformity, lt := preorder.lt._default (λ (t s : uniform_space α), uniform_space.to_core.uniformity ≤ uniform_space.to_core.uniformity), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _}
Equations
- uniform_space.has_Inf = {Inf := λ (s : set (uniform_space α)), uniform_space.of_core {uniformity := ⨅ (u : uniform_space α) (H : u ∈ s), uniformity α, refl := _, symm := _, comp := _}}
Equations
- uniform_space.has_top = {top := uniform_space.of_core {uniformity := ⊤, refl := _, symm := _, comp := _}}
Equations
- uniform_space.has_bot = {bot := {to_topological_space := ⊥, to_core := {uniformity := filter.principal id_rel, refl := _, symm := _, comp := _}, is_open_uniformity := _}}
Equations
- uniform_space.has_inf = {inf := λ (u₁ u₂ : uniform_space α), (uniform_space.of_core {uniformity := uniform_space.to_core.uniformity ⊓ uniform_space.to_core.uniformity, refl := _, symm := _, comp := _}).replace_topology _}
Equations
- uniform_space.complete_lattice = {sup := λ (a b : uniform_space α), has_Inf.Inf {x : uniform_space α | a ≤ x ∧ b ≤ x}, le := partial_order.le uniform_space.partial_order, lt := partial_order.lt uniform_space.partial_order, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := has_inf.inf uniform_space.has_inf, inf_le_left := _, inf_le_right := _, le_inf := _, Sup := λ (tt : set (uniform_space α)), has_Inf.Inf {t : uniform_space α | ∀ (t' : uniform_space α), t' ∈ tt → t' ≤ t}, le_Sup := _, Sup_le := _, Inf := has_Inf.Inf uniform_space.has_Inf, Inf_le := _, le_Inf := _, top := ⊤, bot := ⊥, le_top := _, bot_le := _}
Equations
Given f : α → β
and a uniformity u
on β
, the inverse image of u
under f
is the inverse image in the filter sense of the induced function α × α → β × β
.
Equations
- uniform_space.comap f u = {to_topological_space := topological_space.induced f uniform_space.to_topological_space, to_core := {uniformity := filter.comap (λ (p : α × α), (f p.fst, f p.snd)) (uniformity β), refl := _, symm := _, comp := _}, is_open_uniformity := _}
A uniform space with the discrete uniformity has the discrete topology.
Equations
Equations
Equations
Equations
Equations
Equations
- additive.uniform_space = _inst_1
Equations
- multiplicative.uniform_space = _inst_1
Equations
Equations
Equations
Equations
A version of uniform_continuous_inf_dom_left
for binary functions
A version of uniform_continuous_inf_dom_right
for binary functions
A version of uniform_continuous_Inf_dom
for binary functions
Uniform continuity for functions of two variables.
Equations
Uniformity on a disjoint union. Entourages of the diagonal in the union are obtained by taking independently an entourage of the diagonal in the first part, and an entourage of the diagonal in the second part.
Equations
- uniform_space.core.sum = uniform_space.core.mk' (filter.map (λ (p : α × α), (sum.inl p.fst, sum.inl p.snd)) (uniformity α) ⊔ filter.map (λ (p : β × β), (sum.inr p.fst, sum.inr p.snd)) (uniformity β)) uniform_space.core.sum._proof_1 uniform_space.core.sum._proof_2 uniform_space.core.sum._proof_3
The union of an entourage of the diagonal in each set of a disjoint union is again an entourage of the diagonal.
Equations
Let c : ι → set α
be an open cover of a compact set s
. Then there exists an entourage
n
such that for each x ∈ s
its n
-neighborhood is contained in some c i
.
Let c : set (set α)
be an open cover of a compact set s
. Then there exists an entourage
n
such that for each x ∈ s
its n
-neighborhood is contained in some t ∈ c
.
A useful consequence of the Lebesgue number lemma: given any compact set K
contained in an
open set U
, we can find an (open) entourage V
such that the ball of size V
about any point of
K
is contained in U
.
Expressing continuity properties in uniform spaces #
We reformulate the various continuity properties of functions taking values in a uniform space
in terms of the uniformity in the target. Since the same lemmas (essentially with the same names)
also exist for metric spaces and emetric spaces (reformulating things in terms of the distance or
the edistance in the target), we put them in a namespace uniform
here.
In the metric and emetric space setting, there are also similar lemmas where one assumes that both the source and the target are metric spaces, reformulating things in terms of the distance on both sides. These lemmas are generally written without primes, and the versions where only the target is a metric space is primed. We follow the same convention here, thus giving lemmas with primes.