Euclidean distance on a finite dimensional space #
When we define a smooth bump function on a normed space, it is useful to have a smooth distance on
the space. Since the default distance is not guaranteed to be smooth, we define toEuclidean
to be
an equivalence between a finite dimensional topological vector space and the standard Euclidean
space of the same dimension.
Then we define Euclidean.dist x y = dist (toEuclidean x) (toEuclidean y)
and
provide some definitions (Euclidean.ball
, Euclidean.closedBall
) and simple lemmas about this
distance. This way we hide the usage of toEuclidean
behind an API.
If E
is a finite dimensional space over ℝ
, then toEuclidean
is a continuous ℝ
-linear
equivalence between E
and the Euclidean space of the same dimension.
Equations
- toEuclidean = ContinuousLinearEquiv.ofFinrankEq (_ : FiniteDimensional.finrank ℝ E = FiniteDimensional.finrank ℝ (EuclideanSpace ℝ (Fin (FiniteDimensional.finrank ℝ E))))
Instances For
If x
and y
are two points in a finite dimensional space over ℝ
, then Euclidean.dist x y
is the distance between these points in the metric defined by some inner product space structure on
E
.
Equations
- Euclidean.dist x y = dist (toEuclidean x) (toEuclidean y)
Instances For
Closed ball w.r.t. the euclidean distance.
Equations
- Euclidean.closedBall x r = {y : E | Euclidean.dist y x ≤ r}
Instances For
Open ball w.r.t. the euclidean distance.
Equations
- Euclidean.ball x r = {y : E | Euclidean.dist y x < r}