mathlib documentation

topology.metric_space.pi_nat

Topological study of spaces Π (n : ℕ), E n #

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:

These results are used to construct continuous functions on Π n, E n:

One can also put distances on Π (i : ι), E i when the spaces E i are metric spaces (not discrete in general), and ι is countable.

The first_diff function #

noncomputable def pi_nat.first_diff {E : Type u_1} (x y : Π (n : ), E n) :

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.

Equations
theorem pi_nat.apply_first_diff_ne {E : Type u_1} {x y : Π (n : ), E n} (h : x y) :
theorem pi_nat.apply_eq_of_lt_first_diff {E : Type u_1} {x y : Π (n : ), E n} {n : } (hn : n < pi_nat.first_diff x y) :
x n = y n
theorem pi_nat.first_diff_comm {E : Type u_1} (x y : Π (n : ), E n) :
theorem pi_nat.min_first_diff_le {E : Type u_1} (x y z : Π (n : ), E n) (h : x z) :

Cylinders #

def pi_nat.cylinder {E : Type u_1} (x : Π (n : ), E n) (n : ) :
set (Π (n : ), E n)

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.

Equations
theorem pi_nat.cylinder_eq_pi {E : Type u_1} (x : Π (n : ), E n) (n : ) :
pi_nat.cylinder x n = (finset.range n).pi (λ (i : ), {x i})
@[simp]
theorem pi_nat.cylinder_zero {E : Type u_1} (x : Π (n : ), E n) :
theorem pi_nat.cylinder_anti {E : Type u_1} (x : Π (n : ), E n) {m n : } (h : m n) :
@[simp]
theorem pi_nat.mem_cylinder_iff {E : Type u_1} {x y : Π (n : ), E n} {n : } :
y pi_nat.cylinder x n ∀ (i : ), i < ny i = x i
theorem pi_nat.self_mem_cylinder {E : Type u_1} (x : Π (n : ), E n) (n : ) :
theorem pi_nat.mem_cylinder_iff_eq {E : Type u_1} {x y : Π (n : ), E n} {n : } :
theorem pi_nat.mem_cylinder_comm {E : Type u_1} (x y : Π (n : ), E n) (n : ) :
theorem pi_nat.mem_cylinder_iff_le_first_diff {E : Type u_1} {x y : Π (n : ), E n} (hne : x y) (i : ) :
theorem pi_nat.mem_cylinder_first_diff {E : Type u_1} (x y : Π (n : ), E n) :
theorem pi_nat.cylinder_eq_cylinder_of_le_first_diff {E : Type u_1} (x y : Π (n : ), E n) {n : } (hn : n pi_nat.first_diff x y) :
theorem pi_nat.Union_cylinder_update {E : Type u_1} (x : Π (n : ), E n) (n : ) :
(⋃ (k : E n), pi_nat.cylinder (function.update x n k) (n + 1)) = pi_nat.cylinder x n
theorem pi_nat.update_mem_cylinder {E : Type u_1} (x : Π (n : ), E n) (n : ) (y : E n) :

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_spaceinstance, as other distances may be used on these spaces, but we register them as local instances in this section.

@[protected]
noncomputable def pi_nat.has_dist {E : Type u_1} :
has_dist (Π (n : ), E n)

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.

Equations
theorem pi_nat.dist_eq_of_ne {E : Type u_1} {x y : Π (n : ), E n} (h : x y) :
@[protected]
theorem pi_nat.dist_self {E : Type u_1} (x : Π (n : ), E n) :
@[protected]
theorem pi_nat.dist_comm {E : Type u_1} (x y : Π (n : ), E n) :
@[protected]
theorem pi_nat.dist_nonneg {E : Type u_1} (x y : Π (n : ), E n) :
theorem pi_nat.dist_triangle_nonarch {E : Type u_1} (x y z : Π (n : ), E n) :
@[protected]
theorem pi_nat.dist_triangle {E : Type u_1} (x y z : Π (n : ), E n) :
@[protected]
theorem pi_nat.eq_of_dist_eq_zero {E : Type u_1} (x y : Π (n : ), E n) (hxy : has_dist.dist x y = 0) :
x = y
theorem pi_nat.mem_cylinder_iff_dist_le {E : Type u_1} {x y : Π (n : ), E n} {n : } :
theorem pi_nat.apply_eq_of_dist_lt {E : Type u_1} {x y : Π (n : ), E n} {n : } (h : has_dist.dist x y < (1 / 2) ^ n) {i : } (hi : i n) :
x i = y i
theorem pi_nat.lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {E : Type u_1} {α : Type u_2} [pseudo_metric_space α] {f : (Π (n : ), E n) → α} :
(∀ (x y : Π (n : ), E n), has_dist.dist (f x) (f y) has_dist.dist x y) ∀ (x y : Π (n : ), E n) (n : ), y pi_nat.cylinder x nhas_dist.dist (f x) (f y) (1 / 2) ^ n

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

theorem pi_nat.is_topological_basis_cylinders (E : Type u_1) [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] :
topological_space.is_topological_basis {s : set (Π (n : ), E n) | ∃ (x : Π (n : ), E n) (n : ), s = pi_nat.cylinder x n}
theorem pi_nat.is_open_iff_dist {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] (s : set (Π (n : ), E n)) :
is_open s ∀ (x : Π (n : ), E n), x s(∃ (ε : ) (H : ε > 0), ∀ (y : Π (n : ), E n), has_dist.dist x y < εy s)
@[protected]
noncomputable def pi_nat.metric_space {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] :
metric_space (Π (n : ), E n)

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
@[protected]
noncomputable def pi_nat.metric_space_of_discrete_uniformity {E : Type u_1} [Π (n : ), uniform_space (E n)] (h : ∀ (n : ), uniformity (E n) = filter.principal id_rel) :
metric_space (Π (n : ), E n)

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
noncomputable def pi_nat.metric_space_nat_nat  :

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
@[protected]
theorem pi_nat.complete_space {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] :
complete_space (Π (n : ), E n)

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.

theorem pi_nat.exists_disjoint_cylinder {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {s : set (Π (n : ), E n)} (hs : is_closed s) {x : Π (n : ), E n} (hx : x s) :
∃ (n : ), disjoint s (pi_nat.cylinder x n)
noncomputable def pi_nat.shortest_prefix_diff {E : Type u_1} (x : Π (n : ), E n) (s : set (Π (n : ), E n)) :

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
theorem pi_nat.first_diff_lt_shortest_prefix_diff {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {s : set (Π (n : ), E n)} (hs : is_closed s) {x y : Π (n : ), E n} (hx : x s) (hy : y s) :
theorem pi_nat.shortest_prefix_diff_pos {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {s : set (Π (n : ), E n)} (hs : is_closed s) (hne : s.nonempty) {x : Π (n : ), E n} (hx : x s) :
noncomputable def pi_nat.longest_prefix {E : Type u_1} (x : Π (n : ), E n) (s : set (Π (n : ), E n)) :

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
theorem pi_nat.first_diff_le_longest_prefix {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {s : set (Π (n : ), E n)} (hs : is_closed s) {x y : Π (n : ), E n} (hx : x s) (hy : y s) :
theorem pi_nat.inter_cylinder_longest_prefix_nonempty {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {s : set (Π (n : ), E n)} (hs : is_closed s) (hne : s.nonempty) (x : Π (n : ), E n) :
theorem pi_nat.disjoint_cylinder_of_longest_prefix_lt {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {s : set (Π (n : ), E n)} (hs : is_closed s) {x : Π (n : ), E n} (hx : x s) {n : } (hn : pi_nat.longest_prefix x s < n) :
theorem pi_nat.cylinder_longest_prefix_eq_of_longest_prefix_lt_first_diff {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {x y : Π (n : ), E n} {s : set (Π (n : ), E n)} (hs : is_closed s) (hne : s.nonempty) (H : pi_nat.longest_prefix x s < pi_nat.first_diff x y) (xs : x s) (ys : y s) :

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.

theorem pi_nat.exists_lipschitz_retraction_of_is_closed {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {s : set (Π (n : ), E n)} (hs : is_closed s) (hne : s.nonempty) :
∃ (f : (Π (n : ), E n)Π (n : ), E n), (∀ (x : Π (n : ), E n), x sf x = x) set.range f = s lipschitz_with 1 f

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.

theorem pi_nat.exists_retraction_of_is_closed {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {s : set (Π (n : ), E n)} (hs : is_closed s) (hne : s.nonempty) :
∃ (f : (Π (n : ), E n)Π (n : ), E n), (∀ (x : Π (n : ), E n), x sf x = x) set.range f = s continuous f

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.

theorem pi_nat.exists_retraction_subtype_of_is_closed {E : Type u_1} [Π (n : ), topological_space (E n)] [∀ (n : ), discrete_topology (E n)] {s : set (Π (n : ), E n)} (hs : is_closed s) (hne : s.nonempty) :
∃ (f : (Π (n : ), E n)s), (∀ (x : s), f x = x) function.surjective f continuous f

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 #

@[protected]
noncomputable def pi_countable.has_dist {ι : Type u_2} [encodable ι] {F : ι → Type u_3} [Π (i : ι), metric_space (F i)] :
has_dist (Π (i : ι), F i)

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
theorem pi_countable.dist_eq_tsum {ι : Type u_2} [encodable ι] {F : ι → Type u_3} [Π (i : ι), metric_space (F i)] (x y : Π (i : ι), F i) :
has_dist.dist x y = ∑' (i : ι), linear_order.min ((1 / 2) ^ encodable.encode i) (has_dist.dist (x i) (y i))
theorem pi_countable.dist_summable {ι : Type u_2} [encodable ι] {F : ι → Type u_3} [Π (i : ι), metric_space (F i)] (x y : Π (i : ι), F i) :
summable (λ (i : ι), linear_order.min ((1 / 2) ^ encodable.encode i) (has_dist.dist (x i) (y i)))
theorem pi_countable.min_dist_le_dist_pi {ι : Type u_2} [encodable ι] {F : ι → Type u_3} [Π (i : ι), metric_space (F i)] (x y : Π (i : ι), F i) (i : ι) :
theorem pi_countable.dist_le_dist_pi_of_dist_lt {ι : Type u_2} [encodable ι] {F : ι → Type u_3} [Π (i : ι), metric_space (F i)] {x y : Π (i : ι), F i} {i : ι} (h : has_dist.dist x y < (1 / 2) ^ encodable.encode i) :
@[protected]
noncomputable def pi_countable.metric_space {ι : Type u_2} [encodable ι] {F : ι → Type u_3} [Π (i : ι), metric_space (F i)] :
metric_space (Π (i : ι), F 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