L^p
distance on finite products of metric spaces #
Given finitely many metric spaces, one can put the max distance on their product, but there is also
a whole family of natural distances, indexed by a real parameter p ∈ [1, ∞)
, that also induce
the product topology. We define them in this file. The distance on Π i, α i
is given by
$$
d(x, y) = \left(\sum d(x_i, y_i)^p\right)^{1/p}.
$$
We give instances of this construction for emetric spaces, metric spaces, normed groups and normed spaces.
To avoid conflicting instances, all these are defined on a copy of the original Pi type, named
pi_Lp p hp α
, where hp : 1 ≤ p
. This assumption is included in the definition of the type
to make sure that it is always available to typeclass inference to construct the instances.
We ensure that the topology and uniform structure on pi_Lp p hp α
are (defeq to) the product
topology and product uniformity, to be able to use freely continuity statements for the coordinate
functions, for instance.
Implementation notes #
We only deal with the L^p
distance on a product of finitely many metric spaces, which may be
distinct. A closely related construction is the L^p
norm on the space of
functions from a measure space to a normed space, where the norm is
$$
\left(\int ∥f (x)∥^p dμ\right)^{1/p}.
$$
However, the topology induced by this construction is not the product topology, this only
defines a seminorm (as almost everywhere zero functions have zero L^p
norm), and some functions
have infinite L^p
norm. All these subtleties are not present in the case of finitely many
metric spaces (which corresponds to the basis which is a finite space with the counting measure),
hence it is worth devoting a file to this specific case which is particularly well behaved.
The general case is not yet formalized in mathlib.
To prove that the topology (and the uniform structure) on a finite product with the L^p
distance
are the same as those coming from the L^∞
distance, we could argue that the L^p
and L^∞
norms
are equivalent on ℝ^n
for abstract (norm equivalence) reasons. Instead, we give a more explicit
(easy) proof which provides a comparison between these two norms with explicit constants.
We also set up the theory for pseudo_emetric_space
and pseudo_metric_space
.
A copy of a Pi type, on which we will put the L^p
distance. Since the Pi type itself is
already endowed with the L^∞
distance, we need the type synonym to avoid confusing typeclass
resolution. Also, we let it depend on p
, to get a whole family of type on which we can put
different distances, and we provide the assumption hp
in the definition, to make it available
to typeclass resolution when it looks for a distance on pi_Lp p hp α
.
Canonical bijection between pi_Lp p hp α
and the original Pi type. We introduce it to be able
to compare the L^p
and L^∞
distances through it.
Equations
- pi_Lp.equiv p hp α = equiv.refl (pi_Lp p hp α)
The uniformity on finite L^p
products is the product uniformity #
In this section, we put the L^p
edistance on pi_Lp p hp α
, and we check that the uniformity
coming from this edistance coincides with the product uniformity, by showing that the canonical
map to the Pi type (with the L^∞
distance) is a uniform embedding, as it is both Lipschitz and
antiLipschitz.
We only register this emetric space structure as a temporary instance, as the true instance (to be registered later) will have as uniformity exactly the product uniformity, instead of the one coming from the edistance (which is equal to it, but not defeq). See Note [forgetful inheritance] explaining why having definitionally the right uniformity is often important.
Endowing the space pi_Lp p hp β
with the L^p
pseudoedistance. This definition is not
satisfactory, as it does not register the fact that the topology and the uniform structure coincide
with the product one. Therefore, we do not register it as an instance. Using this as a temporary
pseudoemetric space instance, we will show that the uniform structure is equal (but not defeq) to
the product one, and then register an instance in which we replace the uniform structure by the
product one using this pseudoemetric space and pseudo_emetric_space.replace_uniformity
.
Equations
- pi_Lp.pseudo_emetric_aux p hp β = have pos : 0 < p, from _, {to_has_edist := {edist := λ (f g : pi_Lp p hp β), (∑ (i : ι), edist (f i) (g i) ^ p) ^ (1 / p)}, edist_self := _, edist_comm := _, edist_triangle := _, to_uniform_space := uniform_space_of_edist (λ (f g : pi_Lp p hp β), (∑ (i : ι), edist (f i) (g i) ^ p) ^ (1 / p)) _ _ _, uniformity_edist := _}
Endowing the space pi_Lp p hp α
with the L^p
edistance. This definition is not satisfactory,
as it does not register the fact that the topology and the uniform structure coincide with the
product one. Therefore, we do not register it as an instance. Using this as a temporary emetric
space instance, we will show that the uniform structure is equal (but not defeq) to the product one,
and then register an instance in which we replace the uniform structure by the product one using
this emetric space and emetric_space.replace_uniformity
.
Equations
- pi_Lp.emetric_aux p hp α = {to_pseudo_emetric_space := {to_has_edist := pseudo_emetric_space.to_has_edist (pi_Lp.pseudo_emetric_aux p hp α), edist_self := _, edist_comm := _, edist_triangle := _, to_uniform_space := pseudo_emetric_space.to_uniform_space (pi_Lp.pseudo_emetric_aux p hp α), uniformity_edist := _}, eq_of_edist_eq_zero := _}
Instances on finite L^p
products #
Equations
- pi_Lp.uniform_space p hp β = Pi.uniform_space (λ (i : ι), β i)
pseudoemetric space instance on the product of finitely many pseudoemetric spaces, using the
L^p
pseudoedistance, and having as uniformity the product uniformity.
Equations
- pi_Lp.pseudo_emetric_space p hp β = (pi_Lp.pseudo_emetric_aux p hp β).replace_uniformity _
emetric space instance on the product of finitely many emetric spaces, using the L^p
edistance, and having as uniformity the product uniformity.
Equations
- pi_Lp.emetric_space p hp α = (pi_Lp.emetric_aux p hp α).replace_uniformity _
pseudometric space instance on the product of finitely many psuedometric spaces, using the
L^p
distance, and having as uniformity the product uniformity.
Equations
- pi_Lp.pseudo_metric_space p hp β = pseudo_emetric_space.to_pseudo_metric_space_of_dist (λ (f g : pi_Lp p hp β), (∑ (i : ι), dist (f i) (g i) ^ p) ^ (1 / p)) _ _
metric space instance on the product of finitely many metric spaces, using the L^p
distance,
and having as uniformity the product uniformity.
Equations
- pi_Lp.metric_space p hp α = emetric_space.to_metric_space_of_dist (λ (f g : pi_Lp p hp α), (∑ (i : ι), dist (f i) (g i) ^ p) ^ (1 / p)) _ _
seminormed group instance on the product of finitely many normed groups, using the L^p
norm.
Equations
- pi_Lp.semi_normed_group p hp β = {to_has_norm := {norm := λ (f : pi_Lp p hp β), (∑ (i : ι), ∥f i∥ ^ p) ^ (1 / p)}, to_add_comm_group := {add := add_comm_group.add pi.add_comm_group, add_assoc := _, zero := add_comm_group.zero pi.add_comm_group, zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul pi.add_comm_group, nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg pi.add_comm_group, sub := add_comm_group.sub pi.add_comm_group, sub_eq_add_neg := _, gsmul := add_comm_group.gsmul pi.add_comm_group, gsmul_zero' := _, gsmul_succ' := _, gsmul_neg' := _, add_left_neg := _, add_comm := _}, to_pseudo_metric_space := pi_Lp.pseudo_metric_space p hp β (λ (i : ι), semi_normed_group.to_pseudo_metric_space), dist_eq := _}
normed group instance on the product of finitely many normed groups, using the L^p
norm.
Equations
- pi_Lp.normed_group p hp α = {to_has_norm := semi_normed_group.to_has_norm (pi_Lp.semi_normed_group p hp α), to_add_comm_group := semi_normed_group.to_add_comm_group (pi_Lp.semi_normed_group p hp α), to_metric_space := pi_Lp.metric_space p hp α (λ (i : ι), normed_group.to_metric_space), dist_eq := _}
The product of finitely many seminormed spaces is a seminormed space, with the L^p
norm.
Equations
- pi_Lp.semi_normed_space p hp β 𝕜 = {to_module := {to_distrib_mul_action := module.to_distrib_mul_action (pi.module ι β 𝕜), add_smul := _, zero_smul := _}, norm_smul_le := _}
The product of finitely many normed spaces is a normed space, with the L^p
norm.
Equations
- pi_Lp.normed_space p hp α 𝕜 = {to_module := semi_normed_space.to_module (pi_Lp.semi_normed_space p hp α 𝕜), norm_smul_le := _}