Topological study of spaces Π (n : ℕ), E n
#
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
When E n
are topological spaces, the space Π (n : ℕ), E n
is naturally a topological space
(with the product topology). When E n
are uniform spaces, it also inherits a uniform structure.
However, it does not inherit a canonical metric space structure of the E n
. Nevertheless, one
can put a noncanonical metric space structure (or rather, several of them). This is done in this
file.
Main definitions and results #
One can define a combinatorial distance on Π (n : ℕ), E n
, as follows:
pi_nat.cylinder x n
is the set of pointsy
withx i = y i
fori < n
.pi_nat.first_diff x y
is the first index at whichx i ≠ y i
.pi_nat.dist x y
is equal to(1/2) ^ (first_diff x y)
. It defines a distance onΠ (n : ℕ), E n
, compatible with the topology when theE n
have the discrete topology.pi_nat.metric_space
: the metric space structure, given by this distance. Not registered as an instance. This space is a complete metric space.pi_nat.metric_space_of_discrete_uniformity
: the same metric space structure, but adjusting the uniformity defeqness when theE n
already have the discrete uniformity. Not registered as an instancepi_nat.metric_space_nat_nat
: the particular case ofℕ → ℕ
, not registered as an instance.
These results are used to construct continuous functions on Π n, E n
:
pi_nat.exists_retraction_of_is_closed
: given a nonempty closed subsets
ofΠ (n : ℕ), E n
, there exists a retraction ontos
, i.e., a continuous map from the whole space tos
restricting to the identity ons
.exists_nat_nat_continuous_surjective_of_complete_space
: given any nonempty complete metric space with second-countable topology, there exists a continuous surjection fromℕ → ℕ
onto this space.
One can also put distances on Π (i : ι), E i
when the spaces E i
are metric spaces (not discrete
in general), and ι
is countable.
pi_countable.dist
is the distance onΠ i, E i
given bydist x y = ∑' i, min (1/2)^(encode i) (dist (x i) (y i))
.pi_countable.metric_space
is the corresponding metric space structure, adjusted so that the uniformity is definitionally the product uniformity. Not registered as an instance.
The first_diff function #
In a product space Π n, E n
, then first_diff x y
is the first index at which x
and y
differ. If x = y
, then by convention we set first_diff x x = 0
.
Cylinders #
In a product space Π n, E n
, the cylinder set of length n
around x
, denoted
cylinder x n
, is the set of sequences y
that coincide with x
on the first n
symbols, i.e.,
such that y i = x i
for all i < n
.
In the case where E
has constant value α
,
the cylinder cylinder x n
can be identified with the element of list α
consisting of the first n
entries of x
. See cylinder_eq_res
.
We call this list res x n
, the restriction of x
to n
.
Equations
- pi_nat.res x n.succ = x n :: pi_nat.res x n
- pi_nat.res x 0 = list.nil
The restrictions of x
and y
to n
are equal if and only if x m = y m
for all m < n
.
cylinder x n
is equal to the set of sequences y
with the same restriction to n
as x
.
A distance function on Π n, E n
#
We define a distance function on Π n, E n
, given by dist x y = (1/2)^n
where n
is the first
index at which x
and y
differ. When each E n
has the discrete topology, this distance will
define the right topology on the product space. We do not record a global has_dist
instance nor
a metric_space
instance, as other distances may be used on these spaces, but we register them as
local instances in this section.
The distance function on a product space Π n, E n
, given by dist x y = (1/2)^n
where n
is
the first index at which x
and y
differ.
A function to a pseudo-metric-space is 1
-Lipschitz if and only if points in the same cylinder
of length n
are sent to points within distance (1/2)^n
.
Not expressed using lipschitz_with
as we don't have a metric space structure
Metric space structure on Π (n : ℕ), E n
when the spaces E n
have the discrete topology,
where the distance is given by dist x y = (1/2)^n
, where n
is the smallest index where x
and
y
differ. Not registered as a global instance by default.
Warning: this definition makes sure that the topology is defeq to the original product topology,
but it does not take care of a possible uniformity. If the E n
have a uniform structure, then
there will be two non-defeq uniform structures on Π n, E n
, the product one and the one coming
from the metric structure. In this case, use metric_space_of_discrete_uniformity
instead.
Equations
- pi_nat.metric_space = metric_space.of_dist_topology has_dist.dist pi_nat.metric_space._proof_1 pi_nat.metric_space._proof_2 pi_nat.metric_space._proof_3 pi_nat.metric_space._proof_4 pi_nat.metric_space._proof_5
Metric space structure on Π (n : ℕ), E n
when the spaces E n
have the discrete uniformity,
where the distance is given by dist x y = (1/2)^n
, where n
is the smallest index where x
and
y
differ. Not registered as a global instance by default.
Equations
- pi_nat.metric_space_of_discrete_uniformity h = {to_pseudo_metric_space := {to_has_dist := pi_nat.has_dist (λ (n : ℕ), E n), dist_self := _, dist_comm := _, dist_triangle := _, edist := λ (x y : Π (n : ℕ), E n), ↑⟨(λ (x y : Π (n : ℕ), (λ (n : ℕ), E n) n), dite (x ≠ y) (λ (h : x ≠ y), (1 / 2) ^ pi_nat.first_diff x y) (λ (h : ¬x ≠ y), 0)) x y, _⟩, edist_dist := _, to_uniform_space := Pi.uniform_space (λ (n : ℕ), E n) (λ (i : ℕ), _inst_3 i), uniformity_dist := _, to_bornology := bornology.of_dist (λ (x y : Π (n : ℕ), (λ (n : ℕ), E n) n), dite (x ≠ y) (λ (h : x ≠ y), (1 / 2) ^ pi_nat.first_diff x y) (λ (h : ¬x ≠ y), 0)) pi_nat.metric_space_of_discrete_uniformity._proof_7 pi_nat.metric_space_of_discrete_uniformity._proof_8 pi_nat.metric_space_of_discrete_uniformity._proof_9, cobounded_sets := _}, eq_of_dist_eq_zero := _}
Metric space structure on ℕ → ℕ
where the distance is given by dist x y = (1/2)^n
,
where n
is the smallest index where x
and y
differ.
Not registered as a global instance by default.
Equations
- pi_nat.metric_space_nat_nat = pi_nat.metric_space_of_discrete_uniformity pi_nat.metric_space_nat_nat._proof_1
Retractions inside product spaces #
We show that, in a space Π (n : ℕ), E n
where each E n
is discrete, there is a retraction on
any closed nonempty subset s
, i.e., a continuous map f
from the whole space to s
restricting
to the identity on s
. The map f
is defined as follows. For x ∈ s
, let f x = x
. Otherwise,
consider the longest prefix w
that x
shares with an element of s
, and let f x = z_w
where z_w
is an element of s
starting with w
.
Given a point x
in a product space Π (n : ℕ), E n
, and s
a subset of this space, then
shortest_prefix_diff x s
if the smallest n
for which there is no element of s
having the same
prefix of length n
as x
. If there is no such n
, then use 0
by convention.
Equations
- pi_nat.shortest_prefix_diff x s = dite (∃ (n : ℕ), disjoint s (pi_nat.cylinder x n)) (λ (h : ∃ (n : ℕ), disjoint s (pi_nat.cylinder x n)), nat.find h) (λ (h : ¬∃ (n : ℕ), disjoint s (pi_nat.cylinder x n)), 0)
Given a point x
in a product space Π (n : ℕ), E n
, and s
a subset of this space, then
longest_prefix x s
if the largest n
for which there is an element of s
having the same
prefix of length n
as x
. If there is no such n
, use 0
by convention.
Equations
- pi_nat.longest_prefix x s = pi_nat.shortest_prefix_diff x s - 1
If two points x, y
coincide up to length n
, and the longest common prefix of x
with s
is strictly shorter than n
, then the longest common prefix of y
with s
is the same, and both
cylinders of this length based at x
and y
coincide.
Given a closed nonempty subset s
of Π (n : ℕ), E n
, there exists a Lipschitz retraction
onto this set, i.e., a Lipschitz map with range equal to s
, equal to the identity on s
.
Given a closed nonempty subset s
of Π (n : ℕ), E n
, there exists a retraction onto this
set, i.e., a continuous map with range equal to s
, equal to the identity on s
.
Any nonempty complete second countable metric space is the continuous image of the
fundamental space ℕ → ℕ
. For a version of this theorem in the context of Polish spaces, see
exists_nat_nat_continuous_surjective_of_polish_space
.
Products of (possibly non-discrete) metric spaces #
Given a countable family of metric spaces, one may put a distance on their product Π i, E i
.
It is highly non-canonical, though, and therefore not registered as a global instance.
The distance we use here is dist x y = ∑' i, min (1/2)^(encode i) (dist (x i) (y i))
.
Equations
- pi_countable.has_dist = {dist := λ (x y : Π (i : ι), F i), ∑' (i : ι), linear_order.min ((1 / 2) ^ encodable.encode i) (has_dist.dist (x i) (y i))}
Given a countable family of metric spaces, one may put a distance on their product Π i, E i
,
defining the right topology and uniform structure. It is highly non-canonical, though, and therefore
not registered as a global instance.
The distance we use here is dist x y = ∑' n, min (1/2)^(encode i) (dist (x n) (y n))
.
Equations
- pi_countable.metric_space = {to_pseudo_metric_space := {to_has_dist := pi_countable.has_dist (λ (i : ι), _inst_2 i), dist_self := _, dist_comm := _, dist_triangle := _, edist := λ (x y : Π (i : ι), F i), ↑⟨(λ (x y : Π (i : ι), (λ (i : ι), F i) i), ∑' (i : ι), linear_order.min ((1 / 2) ^ encodable.encode i) (has_dist.dist (x i) (y i))) x y, _⟩, edist_dist := _, to_uniform_space := Pi.uniform_space (λ (i : ι), F i) (λ (i : ι), pseudo_metric_space.to_uniform_space), uniformity_dist := _, to_bornology := bornology.of_dist (λ (x y : Π (i : ι), (λ (i : ι), F i) i), ∑' (i : ι), linear_order.min ((1 / 2) ^ encodable.encode i) (has_dist.dist (x i) (y i))) pi_countable.metric_space._proof_7 pi_countable.metric_space._proof_8 pi_countable.metric_space._proof_9, cobounded_sets := _}, eq_of_dist_eq_zero := _}