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 parameter p : ℝ≥0∞
, that also induce
the product topology. We define them in this file. For 0 < p < ∞
, the distance on Π i, α i
is given by
$$ d(x, y) = \left(\sum d(x_i, y_i)^p\right)^{1/p}. $$,
whereas for p = 0
it is the cardinality of the set ${i | d (x_i, y_i) ≠ 0}$. For p = ∞
the
distance is the supremum of the distances.
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 Π-type, named
PiLp p α
. The assumption [Fact (1 ≤ p)]
is required for the metric and normed space instances.
We ensure that the topology, bornology and uniform structure on PiLp p α
are (defeq to) the
product topology, product bornology 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 lp
, the L^p
norm on a product of (possibly
infinitely many) normed spaces, where the norm is
$$ \left(\sum ‖f (x)‖^p \right)^{1/p}. $$
However, the topology induced by this construction is not the product topology, and some functions
have infinite L^p
norm. These subtleties are not present in the case of finitely many metric
spaces, hence it is worth devoting a file to this specific case which is particularly well behaved.
Another related construction is MeasureTheory.Lp
, 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}. $$
This has all the same subtleties as lp
, and the further subtlety that this only
defines a seminorm (as almost everywhere zero functions have zero L^p
norm).
The construction PiLp
corresponds to the special case of MeasureTheory.Lp
in which the basis
is a finite space equipped with the counting measure.
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 PseudoEMetricSpace
and PseudoMetricSpace
.
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.
Instances For
Equations
- instCoeFunPiLpForall p α = { coe := ⇑(WithLp.equiv p ((i : ι) → α i)) }
Equations
- instInhabitedPiLp p α = { default := fun (x : ι) => default }
The projection on the i
-th coordinate of WithLp p (∀ i, α i)
, as a linear map.
Equations
- PiLp.projₗ p β i = LinearMap.proj i ∘ₗ ↑(WithLp.linearEquiv p 𝕜 ((i : ι) → β i))
Instances For
Note that the unapplied versions of these lemmas are deliberately omitted, as they break the use of the type synonym.
Definition of edist
, dist
and norm
on PiLp
#
In this section we define the edist
, dist
and norm
functions on PiLp p α
without assuming
[Fact (1 ≤ p)]
or metric properties of the spaces α i
. This allows us to provide the rewrite
lemmas for each of three cases p = 0
, p = ∞
and 0 < p.to_real
.
Endowing the space PiLp p β
with the L^p
edistance. We register this instance
separate from pi_Lp.pseudo_emetric
since the latter requires the type class hypothesis
[Fact (1 ≤ p)]
in order to prove the triangle inequality.
Registering this separately allows for a future emetric-like structure on PiLp p β
for p < 1
satisfying a relaxed triangle inequality. The terminology for this varies throughout the
literature, but it is sometimes called a quasi-metric or semi-metric.
Equations
- One or more equations did not get rendered due to their size.
This holds independent of p
and does not require [Fact (1 ≤ p)]
. We keep it separate
from pi_Lp.pseudo_emetric_space
so it can be used also for p < 1
.
This holds independent of p
and does not require [Fact (1 ≤ p)]
. We keep it separate
from pi_Lp.pseudo_emetric_space
so it can be used also for p < 1
.
Endowing the space PiLp p β
with the L^p
distance. We register this instance
separate from pi_Lp.pseudo_metric
since the latter requires the type class hypothesis
[Fact (1 ≤ p)]
in order to prove the triangle inequality.
Registering this separately allows for a future metric-like structure on PiLp p β
for p < 1
satisfying a relaxed triangle inequality. The terminology for this varies throughout the
literature, but it is sometimes called a quasi-metric or semi-metric.
Equations
- One or more equations did not get rendered due to their size.
Endowing the space PiLp p β
with the L^p
norm. We register this instance
separate from PiLp.seminormedAddCommGroup
since the latter requires the type class hypothesis
[Fact (1 ≤ p)]
in order to prove the triangle inequality.
Registering this separately allows for a future norm-like structure on PiLp p β
for p < 1
satisfying a relaxed triangle inequality. These are called quasi-norms.
The uniformity on finite L^p
products is the product uniformity #
In this section, we put the L^p
edistance on PiLp p α
, 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 PiLp p β
with the L^p
pseudoemetric structure. 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 PseudoEMetricSpace.replaceUniformity
.
Equations
- PiLp.pseudoEmetricAux p β = PseudoEMetricSpace.mk ⋯ ⋯ ⋯ (uniformSpaceOfEDist edist ⋯ ⋯ ⋯) ⋯
Instances For
An auxiliary lemma used twice in the proof of PiLp.pseudoMetricAux
below. Not intended for
use outside this file.
Endowing the space PiLp p α
with the L^p
pseudometric structure. This definition is not
satisfactory, as it does not register the fact that the topology, the uniform structure, and the
bornology coincide with the product ones. 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 and the bornology by the product ones using this pseudometric space,
PseudoMetricSpace.replaceUniformity
, and PseudoMetricSpace.replaceBornology
.
See note [reducible non-instances]
Equations
Instances For
Instances on finite L^p
products #
Equations
Equations
- PiLp.bornology p β = Pi.instBornology
pseudoemetric space instance on the product of finitely many pseudoemetric spaces, using the
L^p
pseudoedistance, and having as uniformity the product uniformity.
Equations
- PiLp.instPseudoEMetricSpace p β = (PiLp.pseudoEmetricAux p β).replaceUniformity ⋯
emetric space instance on the product of finitely many emetric spaces, using the L^p
edistance, and having as uniformity the product uniformity.
Equations
pseudometric space instance on the product of finitely many pseudometric spaces, using the
L^p
distance, and having as uniformity the product uniformity.
Equations
- PiLp.instPseudoMetricSpace p β = ((PiLp.pseudoMetricAux p β).replaceUniformity ⋯).replaceBornology ⋯
metric space instance on the product of finitely many metric spaces, using the L^p
distance,
and having as uniformity the product uniformity.
Equations
seminormed group instance on the product of finitely many normed groups, using the L^p
norm.
Equations
normed group instance on the product of finitely many normed groups, using the L^p
norm.
Equations
Equations
- ⋯ = ⋯
The product of finitely many normed spaces is a normed space, with the L^p
norm.
Equations
- PiLp.normedSpace p 𝕜 β = NormedSpace.mk ⋯
The canonical map WithLp.equiv
between PiLp ∞ β
and Π i, β i
as a linear isometric
equivalence.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An equivalence of finite domains induces a linearly isometric equivalence of finitely supported functions
Equations
- LinearIsometryEquiv.piLpCongrLeft p 𝕜 E e = { toLinearEquiv := LinearEquiv.piCongrLeft' 𝕜 (fun (x : ι) => E) e, norm_map' := ⋯ }
Instances For
A family of linearly isometric equivalences in the codomain induces an isometric equivalence between Pi types with the Lp norm.
This is the isometry version of LinearEquiv.piCongrRight
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
LinearEquiv.piCurry
for PiLp
, as an isometry.
Equations
- One or more equations did not get rendered due to their size.
Instances For
When p = ∞
, this lemma does not hold without the additional assumption Nonempty ι
because
the left-hand side simplifies to 0
, while the right-hand side simplifies to ‖b‖₊
. See
PiLp.nnnorm_equiv_symm_const'
for a version which exchanges the hypothesis p ≠ ∞
for
Nonempty ι
.
When IsEmpty ι
, this lemma does not hold without the additional assumption p ≠ ∞
because
the left-hand side simplifies to 0
, while the right-hand side simplifies to ‖b‖₊
. See
PiLp.nnnorm_equiv_symm_const
for a version which exchanges the hypothesis Nonempty ι
.
for p ≠ ∞
.
When p = ∞
, this lemma does not hold without the additional assumption Nonempty ι
because
the left-hand side simplifies to 0
, while the right-hand side simplifies to ‖b‖₊
. See
PiLp.norm_equiv_symm_const'
for a version which exchanges the hypothesis p ≠ ∞
for
Nonempty ι
.
When IsEmpty ι
, this lemma does not hold without the additional assumption p ≠ ∞
because
the left-hand side simplifies to 0
, while the right-hand side simplifies to ‖b‖₊
. See
PiLp.norm_equiv_symm_const
for a version which exchanges the hypothesis Nonempty ι
.
for p ≠ ∞
.
WithLp.equiv
as a continuous linear equivalence.
Equations
- PiLp.continuousLinearEquiv p 𝕜 β = { toLinearEquiv := WithLp.linearEquiv p 𝕜 ((i : ι) → β i), continuous_toFun := ⋯, continuous_invFun := ⋯ }
Instances For
The projection on the i
-th coordinate of PiLp p β
, as a continuous linear map.
Equations
- PiLp.proj p β i = { toLinearMap := PiLp.projₗ p β i, cont := ⋯ }
Instances For
A version of Pi.basisFun
for PiLp
.
Equations
- PiLp.basisFun p 𝕜 ι = Basis.ofEquivFun (WithLp.linearEquiv p 𝕜 (ι → 𝕜))