# Elastic Metrics on Spaces of Euclidean Curves: Theory and Algorithms

Martin Bauer  Nicolas Charon  Eric Klassen  Sebastian Kurtek  Tom Needham
Thomas Pierron  Florida State University, Department of Mathematics,
Tallahassee, Florida, USA  Johns Hopkins University, Department of Applied
Mathematics and Statistics, Baltimore, Maryland, USA  Ohio State University,
Department of Statistics, Columbus, Ohio, USA

###### Abstract

A main goal in the field of statistical shape analysis is to define computable
and informative metrics on spaces of immersed manifolds, such as the space of
curves in a Euclidean space. The approach taken in the elastic shape analysis
framework is to define such a metric by starting with a reparameterization-
invariant Riemannian metric on the space of parameterized shapes and inducing
a metric on the quotient by the group of diffeomorphisms. This quotient metric
is computed, in practice, by finding a registration of two shapes over the
diffeomorphism group. For spaces of Euclidean curves, the initial Riemannian
metric is frequently chosen from a two-parameter family of Sobolev metrics,
called elastic metrics. Elastic metrics are especially convenient because, for
several parameter choices, they are known to be locally isometric to
Riemannian metrics for which one is able to solve the geodesic boundary
problem explictly—well-known examples of these local isometries include the
complex square root transform of Younes, Michor, Mumford and Shah and square
root velocity (SRV) transform of Srivastava, Klassen, Joshi and Jermyn. In
this paper, we show that the SRV transform extends to elastic metrics for all
choices of parameters, for curves in any dimension, thereby fully generalizing
the work of many authors over the past two decades. We give a unified
treatment of the elastic metrics: we extend results of Trouvé and Younes,
Bruveris as well as Lahiri, Robinson and Klassen on the existence of solutions
to the registration problem, we develop algorithms for computing distances and
geodesics, and we apply these algorithms to metric learning problems, where we
learn optimal elastic metric parameters for statistical shape analysis tasks.

###### keywords:

Shape analysis , Elastic metrics , Infinite-dimensional Riemannian geometry ,
Metric learning

††journal: Pattern Recognition

##  1 Introduction

Shape is a fundamental physical property of objects and a key characteristic
of their appearance in images. As a result, shape analysis plays a central
role in various applications including computer vision, medical imaging,
graphics, biology, bioinformatics and anthropology, among others. In these
applications, one generally first extracts objects of interest from the
imaging data, and then studies their shapes via appropriate mathematical
representations and metrics. In statistical shape analysis, each observed
shape is treated as a random object with the primary goal of developing tools
for shape registration, comparison, statistical summarization, exploration of
variability, clustering, classification and other statistical procedures. Each
of the aforementioned statistical tasks heavily depends on the underlying
representation and associated metric chosen for shape analysis.

There is a rich literature on shape analysis that considers various
representations of shape including deformable templates [19], ordered and
unordered point sets [12], level sets [39], medial axes [18], and others.
However, perhaps the most natural representation of a boundary of an object
captured in an image is a parameterized curve. While accounting for the shape
preserving transformations of rigid motion and scaling is fairly standard in
this setting [40], one must additionally deal with parameterization
variability inherent in the given data. Some past methods standardize
parameterizations of observed curves to arc-length [51], but this has been
shown to be suboptimal in many applications [40]. A better solution is to
determine optimal reparameterizations in a pairwise manner via a process
referred to as _registration_. This, in turn, requires a metric on the space
of parameterized curves that is invariant to reparameterizations. The metric
plays a key role in shape analysis as it is used for joint registration and
comparison of shapes. Further, it serves as a backbone of other statistical
procedures for shape data including averaging and principal component
analysis.

In this article, we focus on shapes which are represented as curves in
Euclidean space $\operatorname{\mathbb{R}}^{d}$, $d\geq 2$. Our shape metrics
arise as geodesic distances with respect to Riemannian metrics on the
(infinite-dimensional) manifold
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$, whose points are immersions,
with domain $D$ either an interval or a circle. That is, each element of
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$ is a smooth parameterized curve
$c:D\to\operatorname{\mathbb{R}}^{d}$ with nowhere-vanishing derivative. In
order to induce a metric on the shape space of unparametrized curves, one
requires the Riemannian metric on
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$ to be invariant under
reparameterizations. To be precise, the group $\mathcal{D}(D)$ of
diffeomorphisms of $D$ acts on $\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$
by precomposition, and this action should be by isometries for the chosen
Riemannian metric. Due to this property, the metric then descends to the
quotient space $\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})/\mathcal{D}(D)$
of curves considered up to precomposition with a diffeomorphism—that is, the
quotient space can be considered as the space of unparameterized curves. The
process of computing geodesic distances in that quotient space naturally
involves solving a registration problem, so that the estimated geodesic
distance eventually provides a meaningful metric for shape comparison.
Moreover, the Riemannian formalism gives powerful tools for demonstrating the
existence of optimal registrations, along with well-defined notions of tangent
spaces, means, principal components, and other statistical concepts.

In this setup, a variety of different Riemannian metrics have been proposed in
the literature. The arguably simplest one, the invariant $L^{2}$-metric, has a
surprising degeneracy: it induces vanishing geodesic distance on both
parametrized [1] and unparametrized [34] curves; i.e., any two curves (shapes)
are regarded the same under the corresponding path-length distance. This
behavior renders the $L^{2}$-metric unsuitable for any applications in shape
analysis. Subsequently, several stronger Riemannian metrics have been
proposed, that consequently induce a meaningful measure of similarity on shape
space. This includes the class of almost local metrics [34], but also the
family of (higher order) Sobolev type metrics, see e.g. [32, 3, 41, 42] and
the references therein. In particular, Sobolev metrics of order one have
attracted a large body of work and a two-parameter family of Riemannian
metrics $G^{a,b}$, $a,b>0$, has been proposed [33]; elements of this family
are usually called _elastic metrics_ , for reasons that are highlighted in A.
The goal of this paper is to develop a comprehensive theoretical and
computational framework for the $G^{a,b}$ metrics on
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$ and the quotient
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})/\mathcal{D}(D)$, for all
parameters $a,b>0$ and all dimensions $d\geq 2$. Before precisely stating our
main contributions, we first give an overview of related work to provide
appropriate context.

A crucial component of an efficient algorithm for computing the desired
geodesic distances in the quotient space
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})/\mathcal{D}(D)$ is a method for
computing distances in the space
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$. The family of elastic metrics
is special: it has been shown that, for several values of the parameters $a$,
$b$ and $d$, the geodesic boundary value problem, and consequently the induced
geodesic distance, can be solved _explicitly_. The typical method in the
literature for deriving such explicit solutions is to construct an isometry
$(\mathcal{I}(D,\operatorname{\mathbb{R}}^{d}),G^{a,b})\to(\mathcal{M},G)$,
for particular values of $a$, $b$ and $d$, to some Riemannian manifold with
explicit formulas for geodesics, and to then describe geodesics in the source
space via pulling back. For the choice of parameters $a=1$ and
$b=\frac{1}{2}$, such an isometry is given by the well known _square root
velocity transform_ , as developed in [41] for arbitrary $d\geq 2$. For
$a=b=\frac{1}{2}$ and $d=2$, an isometry is given by the _complex square root
mapping_ constructed in [50], which is based on identifying
$\operatorname{\mathbb{R}}^{2}$ with the complex plane. The complex square
root mapping was generalized to curves in $\operatorname{\mathbb{R}}^{3}$ by
replacing complex constructions with their quaternionic counterparts in [35,
37]. For $a\leq 2b$ and $d=2$, a related construction has been developed in
[2], where the target manifold is a space of curves in a Euclidean cone.
Finally, for curves with values in $\mathbb{R}^{2}$, the transformations of
[50, 41, 2] have been extended to general values of the parameters $a$ and $b$
using a local isometry defined, once again, via the identification of
$\operatorname{\mathbb{R}}^{2}$ with the complex plane [38].

We can now state our main contributions and outline the structure of the
paper.

  * •

Simplifying isometry for general elastic metric parameters (Section 2). We
show that the square root velocity transform mentioned above can, in fact, be
used as a simplifying isometry of $G^{a,b}$ for general parameters $a$ and $b$
and for curves in arbitrary dimension (Theorem 2.1), thereby fully
generalizing the results of [41, 2, 38] and completing the story started over
a decade ago in [50]. We use this result to characterize the metric completion
of the space of curves and give an explicit formula for the distance in this
space (Theorem 2.1). This completion includes curves of lower regularity—in
particular, it includes the class of piecewise linear curves, which is
important for representing smooth curves in a discrete computational setting.
We also present a (to our knowledge, novel) relation between elastic metrics
and classical elasticity theory (A).

  * •

Existence of optimal reparameterizations (Section 3). To obtain the distance
on the quotient shape space, one needs to consider the following problem:
given two curves $c_{1},c_{2}\in\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$,
find a reparameterization $\gamma\in\mathcal{D}(D)$ such that the geodesic
distance between $c_{1}$ and $c_{2}\circ\gamma$, with respect to a given
elastic metric $G^{a,b}$, is minimized. It has been shown that a minimizer
exists (within certain extensions of the set $\mathcal{D}(D)$) for parameters
$a=1$ and $b=\frac{1}{2}$ (the original setting of the square root velocity
transform), under certain regularity assumptions on the curves $c_{i}$ [28,
6]. We extend these results to general parameters $a,b>0$, under technical
regularity assumptions (Theorems 3.1 and 3.2) and lay out some precise open
questions regarding dependence on regularity. Our proof uses classical results
of Trouvé and Younes [44]

  * •

Computational framework (Section 4). We develop a comprehensive framework for
computing geodesics in the quotient space
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})/\mathcal{D}(D)$. This
computation involves optimizing geodesic distance over reparameterizations, as
was described in the previous paragraph. We give an explicit polynomial-time
algorithm to find exact solutions in the setting of piecewise linear curves
(Theorem 4.1) and a faster dynamic programming algorithm for approximating the
optimizer (Section 4.2). We illustrate this approach with several
computational examples (Section 4.3). Our code is available under an open
source license111https://github.com/charoncode/Gab_metrics.

  * •

Metric Learning (Section 5). Finally, we consider the following question:
given a dataset of shapes, which metric from the family of elastic metrics
gives the best performance on various statistical analysis tasks? We frame
this as a _metric learning_ problem. A general approach to learning the
appropriate parameters for a given dataset is suggested (Section 5.1), based
on foundational work in metric learning [46]. We also give an alternative
approach to parameter estimation with the aim of training for geometric
protein classification (Section 5.2).

#### Acknowledgements

M. Bauer has been supported by NSF-grants DMS-1912037 and DMS-1953244 and by
the Austrian Science Fund grant P 35813-N, N. Charon by NSF grants DMS-1953267
and DMS-1945224, S. Kurtek by NSF grants CCF-1740761, CCF-1839252 and
DMS-2015226, and NIH grant R37-CA214955, T. Needham by NSF grant DMS–2107808
and T. Pierron by NSF-grant DMS-1912037.

##  2 Simplifying Transform for General Elastic Metrics

In this section, we will introduce the basic concepts and spaces under
consideration and introduce the class of Riemannian metrics that will be of
central interest. We then define a new family of transforms for simplifying
these Riemannian metrics.

###  2.1 Spaces of curves and elastic metrics

In the following, assume $d\geq 2$ and let

$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})=\\{c\in
C^{\infty}(D,\operatorname{\mathbb{R}}^{d})\,:\,c^{\prime}(u)\neq 0\;\forall
u\in D\\}\,,$ (1)

where $D$ is either the interval $I=[0,1]$ for open curves or the unit circle
$S^{1}$ for closed curves. This space is an open subset of the Fréchet space
$C^{\infty}(D,\operatorname{\mathbb{R}}^{d})$, and is thus an infinite-
dimensional manifold with tangent space $T_{c}\mathcal{I}(D,\mathbb{R}^{d})$
at a curve $c\in\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$ satisfying
$T_{c}\mathcal{I}(D,\mathbb{R}^{d})\approx C^{\infty}(D,\mathbb{R}^{d})$;
specifically, the identification is made by taking
$C^{\infty}(D,\operatorname{\mathbb{R}}^{d})$ to be the space of smooth vector
fields (or _deformation fields_) along $c$.

This article is concerned with the family of elastic $G^{a,b}$-metrics on
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$, indexed over pairs of positive
constants $a$, $b>0$:

$\displaystyle G^{a,b}_{c}(h,k)=\int_{D}a^{2}(D_{s}h^{\bot}\cdot
D_{s}k^{\bot})+b^{2}(D_{s}h^{\top}\cdot D_{s}k^{\top})ds\,,$ (2)

where $h,k\in T_{c}\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$ are
deformation fields (tangent vectors) to the curve
$c\in\mathcal{I}(D,\operatorname{\mathbb{R}}^{2})$, $\cdot$ denotes the
Euclidean inner product with norm $|\cdot|$ (evaluated pointwise),
$D_{s}=\frac{1}{|c^{\prime}|}\frac{d}{du}$ and $ds=|c^{\prime}|du$ are
differentiation and integration with respect to arc length, respectively ($u$
denoting the parameter of $c$), and $\bullet^{\top}$ and $\bullet^{\bot}$
denote projection onto the normal and tangential part of a tangent vector,
i.e.,

$D_{s}h^{\top}=\left(D_{s}h\cdot\tfrac{c^{\prime}}{|c^{\prime}|}\right)\tfrac{c^{\prime}}{|c^{\prime}|}\qquad\mbox{and}\qquad
D_{s}h^{\bot}=D_{s}h-D_{s}h^{\top}.$ (3)

The terminology of "elastic metrics" for (2) often used in the literature [49,
33, 23, 36] can be in fact justified from the theory of linear material
elasticity, specifically as the limit of the linear elastic energy of a
deforming shell as it becomes infinitely thin. Such a connection was recently
emphasized in [8] for the class of first order metrics on surfaces. We provide
in A a similar and more direct derivation in the case of parametrized planar
curves.

The group $\operatorname{\mathbb{R}}^{d}$ acts on
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})$ by rigid translations. Each
bilinear form (2) is degenerate on the space of all curves and therefore only
defines a Riemannian metric on the quotient
$\mathcal{I}(D,\operatorname{\mathbb{R}}^{d})/\operatorname{\mathbb{R}}^{d}$,
which can be identified with the space
$\mathcal{I}_{0}(D,\operatorname{\mathbb{R}}^{d})$ of curves starting at the
origin. Once we have defined a Riemannian metric, we can consider the
corresponding geodesic distance function

$d_{a,b}(c_{0},c_{1})=\operatorname{inf}\int_{0}^{1}\sqrt{G_{c}(c_{t},c_{t})}dt,$
(4)

where the infimum is taken over all paths
$c:[0,1]\to\mathcal{I}_{0}(D,\operatorname{\mathbb{R}}^{d}):t\mapsto c_{t}$
interpolating between the curves $c_{0}$ and $c_{1}$. For finite-dimensional
Riemannian manifolds, geodesic distance is indeed a true metric, but this is
not necessarily true in infinite dimensions: there are Riemannian metrics such
that the corresponding geodesic distance function is degenerate or might even
vanish identically [34, 4]. For the $G^{a,b}$-metrics this misbehavior has
been ruled out [34, 41], which consequently renders them as viable candidates
for shape analysis.

On the space of immersions, there is a natural action by the orientation-
preserving diffeomorphism group $\mathcal{D}(D)$ of the domain $D$: the
reparametrization action. Given a curve
$c\in\mathcal{I}_{0}(D,\operatorname{\mathbb{R}}^{d})$ and a diffeomorphism
$\varphi\in\mathcal{D}(D)$ this action is given by composition from the right,
i.e.,

$\mathcal{I}_{0}(D,\operatorname{\mathbb{R}}^{d})\times\mathcal{D}(D)\to\mathcal{I}_{0}(D,\operatorname{\mathbb{R}}^{d}),\qquad(c,\varphi)\mapsto
c\circ\varphi.$ (5)

A straightforward calculation shows that the $G^{a,b}$-metrics are invariant
under this action, i.e.,

$G^{a,b}_{c}(h,k)=G^{a,b}_{c\circ\varphi}(h\circ\varphi,k\circ\varphi),\qquad
h,k\in
T_{c}\mathcal{I}_{0}(D,\operatorname{\mathbb{R}}^{d}),\quad\varphi\in\mathcal{D}(D).$
(6)

Consequently, they descend to Riemannian metrics on the quotient shape space
of immersions modulo parametrizations
$\mathcal{S}(D,\mathbb{R}^{d}):=\mathcal{I}_{0}(D,\operatorname{\mathbb{R}}^{d})/\mathcal{D}(D)$.
On the quotient space, the corresponding geodesic distance function can be
calculated via

$d^{\mathcal{S}}_{a,b}([c_{0}],[c_{1}])=\underset{\varphi\in\mathcal{D}(D)}{\operatorname{inf}}d_{a,b}(c_{0},c_{1}\circ\varphi).$
(7)

###  2.2 The square root velocity transform for general elastic metrics

As we overviewed in the introduction, there have been many approaches in the
literature to understanding elastic metrics through _simplifying
transformations_ [50, 41, 2, 38]. That is, these works establish (local)
isometries of the form
$(\mathcal{I}(D,\operatorname{\mathbb{R}}^{d}),G^{a,b})\to(\mathcal{M},G)$,
for some choice of parameters $a$, $b$, and $d$, where the target space is
some Riemannian manifold with an easy-to-describe geodesic structure. Such a
transformation allows efficient computations involving the elastic metric by
transferring them to the simple target space. Of particular interest for this
paper is the _square root velocity transform_ of Srivastava et al., which we
denote as

$\displaystyle R:\mathcal{I}_{0}([0,1],\mathbb{R}^{d})$ $\displaystyle\to
C^{\infty}([0,1],\mathbb{R}^{d}\setminus\\{0\\})$ (8) $\displaystyle c$
$\displaystyle\mapsto\frac{c^{\prime}}{\sqrt{|c^{\prime}|}}.$

It was shown in [41] that $R$ is an isometry of the elastic metric
$G^{1,\frac{1}{2}}$ and the standard $L^{2}$ metric on
$C^{\infty}([0,1],\mathbb{R}^{d}\setminus\\{0\\})$, for any $d\geq 2$. Our
first main result below will show that $R$ is, for general parameters $a,b$,
an isometry of $G^{a,b}$ and a Riemannian metric on
$C^{\infty}([0,1],\mathbb{R}^{d}\setminus\\{0\\})$ which is non-Euclidean, but
still simple enough to admit explicit geodesic distances.

In order to formulate this result, we first introduce a Riemannian metric on
$\mathbb{R}^{d}\setminus\\{0\\}$. For
$q\in\operatorname{\mathbb{R}}^{d}\setminus\\{0\\}$, we identify
$T_{q}\left(\operatorname{\mathbb{R}}^{d}\setminus\\{0\\}\right)$ with
$\operatorname{\mathbb{R}}^{d}$ in the obvious way. We then decompose the
tangent space via $T_{q}\left(R^{d}\setminus\\{0\\}\right)=V\oplus W$, where
$V=\operatorname{\mathbb{R}}q$ and $W=V^{\bot}$, where the orthogonal
complement is with respect to the standard dot product on
$\operatorname{\mathbb{R}}^{d}$. We then define a Riemannian metric
$g^{\lambda}$ on
$T_{q}\left(\operatorname{\mathbb{R}}^{d}\setminus\\{0\\}\right)$ as follows:

$g^{\lambda}_{q}(v,w)=\lambda^{2}(v^{\bot}\cdot w^{\bot})+(v^{\top}\cdot
w^{\top}),$

where, in analogy with the notation used in Section 2.1,
$w^{\top}=\frac{(w\cdot q)}{(q\cdot q)}q$ is the projection of $w$ onto $V$
and $w^{\bot}=w-w^{\top}$ is the projection of $w$ onto $W$. For $\lambda=1$,
this is just a restriction of the standard Euclidean metric on
$\operatorname{\mathbb{R}}^{d}$; for $\lambda<1$, it makes
$\operatorname{\mathbb{R}}^{d}\setminus\\{0\\}$ isometric to a dense subset of
a cone in $\operatorname{\mathbb{R}}^{d+1}$ with an acute angle at the cone
point; for $\lambda>1$,
$(\operatorname{\mathbb{R}}^{d}\setminus\\{0\\},g^{\lambda})$ does not
isometrically embed in $\operatorname{\mathbb{R}}^{d+1}$.

The metric $g^{\lambda}$ induces an $L^{2}$-metric on the space of smooth
curves in $\operatorname{\mathbb{R}}^{d}\setminus\\{0\\}$:

$\displaystyle
G^{L^{2}_{\lambda}}_{q}(q_{1},q_{2})=\int_{0}^{1}g^{\lambda}_{q}(q_{1},q_{2})du.$
(9)

We now state our first main result, whose proof is postponed to C.

######  Theorem 2.1.

For $\lambda=\tfrac{a}{2b}$, the square root velocity transform $R$, defined
in (8), is an isometry of
$\left(\mathcal{I}_{0}([0,1],\mathbb{R}^{d}),G^{a,b}\right)$ and
$\left(C^{\infty}([0,1],\mathbb{R}^{d}\setminus\\{0\\}),4b^{2}G^{L^{2}_{\lambda}}\right)$.
Furthermore, for each $c_{0}\in\mathcal{I}_{0}([0,1],\mathbb{R}^{d})$ there
exists a neighborhood $\mathcal{U}(c_{0})$ such that the geodesic distance
between $c_{0}$ and any $c_{1}\in\mathcal{U}(c_{0})$ is given by:

$\operatorname{dist}_{a,b}(c_{1},c_{2})=2b\sqrt{\ell_{c_{1}}+\ell_{c_{2}}-2\int_{D}\sqrt{|c_{1}^{\prime}||c_{2}^{\prime}|}\cos\left(\tfrac{a}{2b}\theta\right)du},$
(10)

where

$\theta(u)=\cos^{-1}(R(c_{1})\cdot R(c_{2})/|R(c_{1})||R(c_{2})|).$ (11)

If $d\geq 3$, then the formula for the geodesic distance holds globally, i.e.,
for arbitrary $c_{1}\in\mathcal{I}_{0}([0,1],\mathbb{R}^{d})$, after replacing
the formula for $\theta$ by

$\theta(u)=\operatorname{min}\left(\cos^{-1}(R(c_{1})\cdot
R(c_{2})/|R(c_{1})||R(c_{2})|),\tfrac{2b\pi}{a}\right).$ (12)

To deal with the difficulty in the $d=2$ case (the formula of the geodesic
distance being only valid locally), we can extend geodesics across the origin
and obtain $C^{\infty}(I,\mathbb{R}^{d}_{\lambda})$ as the geodesic completion
in the sense of [26, 6]. This allows us to interpret (10) as the geodesic
distance on the geodesic completion. We will now extend the formula for the
geodesic distance of Theorem 2.1 to the metric completion, which will be
important in the next section where we will prove the existence of optimal
reparametrizations.

######  Corollary 2.1.

The completion (in the sense of Lemma B.2) of
$\mathcal{I}_{0}([0,1],\mathbb{R}^{d})$ with the $G^{a,b}$ metric is the space
of absolutely continuous open curves $AC_{0}([0,1],\mathbb{R}^{d})$. For any
two curves $c_{1},c_{2}\in AC_{0}([0,1],\mathbb{R}^{d})$ their corresponding
geodesic distance is given by

$\operatorname{dist}_{a,b}(c_{1},c_{2})=2b\sqrt{\ell_{c_{1}}+\ell_{c_{2}}-2\int_{0}^{1}\sqrt{|c_{1}^{\prime}||c_{2}^{\prime}|}\cos\left(\tfrac{a}{2b}\theta\right)du}.$
(13)

where $\ell_{c_{j}}$ is the length of the curve $c_{j}$ and

$\theta(u)=\begin{cases}\operatorname{min}\left(\cos^{-1}(c^{\prime}_{1}(u)\cdot
c^{\prime}_{2}(u)/|c^{\prime}_{1}(u)||c^{\prime}_{2}(u)|),\tfrac{2b\pi}{a}\right)&\text{
if $c^{\prime}_{1}(u),c^{\prime}_{2}(u)\neq 0$}\\\ \tfrac{2b\pi}{a}&\text{
otherwise.}\end{cases}$ (14)

###  2.3 Relation to previous work

In this subsection, we pin down the precise relationship between Theorem 2.1
and previous work on simplifying transforms [50, 41, 2, 38].

The transform in the literature which is most relevant to our result is
obviously the square root velocity transform (8), which was shown in [41] to
be an isometry of $G^{1,\frac{1}{2}}$ and the standard $L^{2}$ metric on
$C^{\infty}([0,1],\operatorname{\mathbb{R}}^{d}\setminus\\{0\\})$ for
arbitrary $d\geq 2$. This result is recovered directly from Theorem 2.1.

The _complex square root map_ of [50] takes an immersion $c$ in the plane to
the curve $\sqrt{c^{\prime}}$, where the square root is computed pointwise by
considering $c$ as a complex-valued function—there is some ambiguity here, so
the square root curve is chosen in a way to make it continuous. This transform
was shown to be a local isometry of $G^{\frac{1}{2},\frac{1}{2}}$ with the
standard $L^{2}$ metric on $C^{\infty}([0,1],\mathbb{C})\approx
C^{\infty}([0,1],\operatorname{\mathbb{R}}^{2})$. In [38], it was shown that
the complex square root map fits into a family of maps $F_{a,b}$, defined on a
smooth plane curve $c$ by
$F_{a,b}(c)=2b|c^{\prime}|^{\frac{1}{2}}\left(c^{\prime}/|c^{\prime}|\right)^{\frac{a}{2b}}$,
with exponentiation once again performed using the identification of
$\operatorname{\mathbb{R}}^{2}$ with the complex plane and choosing a
continuous curve as the image; when $a=b=\frac{1}{2}$, $F_{a,b}$ reduces to
the complex square root map. It was shown in [38] that $F_{a,b}$ defines a
local isometry between $G^{a,b}$ and the $L^{2}$ metric, for any choices of
$a,b>0$. In fact, the $F_{a,b}$ transform factors as

$\left(\mathrm{Imm}_{0}([0,1],\mathbb{C}),G^{a,b}\right)$$\left(C^{\infty}([0,1],\mathbb{C}^{\ast}),4b^{2}G^{L^{2}_{\lambda}}\right)$$\left(C^{\infty}([0,1],\mathbb{C}^{\ast}),G^{L^{2}}\right)$$R$$S_{a,b}$$F_{a,b}$

where $\mathbb{C}^{\ast}=\mathbb{C}\setminus\\{0\\}$, $\lambda=\frac{a}{2b}$,
$G^{L^{2}}=G^{L^{2}_{1}}$ is the standard $L^{2}$ metric and $S_{a,b}$ is a
local isometry defined by $S_{a,b}(q)=2b|q|^{1-\lambda}q^{\lambda}$—the local
isometry claim can be seen via calculations in complex coordinates, similar to
the proof of [38, Theorem 2.3]. The takeaway from Theorem 2.1 is that the
geometry of the metric $G^{L^{2}_{\lambda}}$ is simple enough that we can work
in the middle space of this diagram, allowing us to avoid technical issues
with isometries only being local, while simultaneously allowing the result to
be generalized to arbitrary dimension.

We should also mention [2], which gave a similar family of generalizations of
the complex square root map for plane curves, valid for $G^{a,b}$ with $a\leq
2b$. In this case, a curve $c$ in $\mathbb{C}$ is mapped to the curve in
$\operatorname{\mathbb{R}}^{3}\approx\mathbb{C}\times\operatorname{\mathbb{R}}$
given by

$R_{a,b}(c)=|c^{\prime}|^{\frac{1}{2}}\left(a\frac{c^{\prime}}{|c^{\prime}|},\sqrt{4b^{2}-a^{2}}\right).$

The image of $R_{a,b}$ lies on a certain cone in
$\operatorname{\mathbb{R}}^{3}$ and it is shown in [2] that the transform is
an isometry of $G^{a,b}$ and the metric on the cone induced from the ambient
Euclidean metric. As in the case of the $F_{a,b}$ transform described above,
one can factor $R_{a,b}$ as the SRV transform $R$ followed by an isometry
between the space of curves in the plane and the space of curves in the cone.

##  3 Existence of Optimal Reparameterizations

###  3.1 Existence of optimal reparametrizations for open curves

In the previous section we saw that the set of absolutely continuous functions
provides the natural space for studying the geodesic distance function of the
family of elastic metrics. In the following, we aim to prove the existence of
optimal reparametrizations in this space. Let
$\operatorname{dist}^{\mathcal{S}}_{a,b}$ be the induced distance of the
elastic $G^{a,b}$-metric on the space of absolutely continuous, unparametrized
and open curves
$\mathcal{S}(I,\mathbb{R}^{d}):=\operatorname{AC}_{0}(I,\mathbb{R}^{d})/\Gamma$,
which is defined by

$\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}])=\operatorname{inf}_{\gamma\in\Gamma}\operatorname{dist}_{a,b}(c_{1},c_{2}\circ\gamma),$
(15)

where $\operatorname{dist}_{a,b}$ denotes the geodesic distance function on
the space of parmetrized open curves
$\operatorname{AC}_{0}(I,\mathbb{R}^{d})$, and where $\Gamma$ denotes the
group of absolutely continuous diffeomorphisms on $I$, i.e.,

$\displaystyle\Gamma=\\{\gamma\in AC(I,I):\ \gamma(0)=0,\ \gamma(1)=1,\
\gamma^{\prime}>0\quad a.e.\\}.$

We will also need the closure (with respect to the norm topology) of this
group $\bar{\Gamma}$, which is the semigroup of weakly increasing, absolutely
continuous functions, i.e.,

$\displaystyle\bar{\Gamma}=\\{\gamma\in AC(I,I):\ \gamma(0)=0,\ \gamma(1)=1,\
\gamma^{\prime}\geq 0\quad a.e.\\}.$

With this notation, the induced distance
$\operatorname{dist}^{\mathcal{S}}_{a,b}$ on the quotient space
$\mathcal{S}(I,\mathbb{R}^{d})$ can be equivalently expressed via

$\displaystyle\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}])$
$\displaystyle=\inf_{\gamma\in\Gamma}\operatorname{dist}_{a,b}(c_{1},c_{2}\circ\gamma)=\inf_{\gamma_{1},\gamma_{2}\in\Gamma}\operatorname{dist}_{a,b}(c_{1}\circ\gamma_{1},c_{2}\circ\gamma_{2})$
$\displaystyle=\inf_{\gamma_{1},\gamma_{2}\in\bar{\Gamma}}\operatorname{dist}_{a,b}(c_{1}\circ\gamma_{1},c_{2}\circ\gamma_{2}).$
(16)

Here, the second equality in the first line follows from the invariance of the
distance, whereas the third equality follows from the density of $\Gamma$ in
$\bar{\Gamma}$. Our main result of this section concerns the existence of
optimal reparametrizations, i.e., the existence of reparametrization functions
such that the infimum is attained. We will see that for $a\leq b$ we really
need two reparametrization functions in $\bar{\Gamma}$, while for $a>b$ the
infimum can attained by one reparametrization function. Before we formulate
the theorem we need to introduce the function space of piecewise
differentiable functions:

$\displaystyle PC^{1}(I,\mathbb{R}^{d}):=$ $\displaystyle\left\\{c\in
C(I,\mathbb{R}^{d}):\exists\;0=t_{0}<t_{1}<\ldots<t_{n}=1\right.$
$\displaystyle\qquad\qquad\qquad\qquad\left.\text{ s.t.
}c|_{(t_{i},t_{i+1})}\in
C^{1}\big{(}(t_{i},t_{i+1}),\operatorname{\mathbb{R}}^{d}\big{)}\right\\}.$

Note that $PC^{1}(I,\mathbb{R}^{d})\subset AC(I,\mathbb{R}^{d})$. We also need
to introduce the space $\mathcal{D}^{*}$ of all functions that can be written
as

$\phi(s)=\mu([0,s[)$ (17)

where $\mu$ is a probability measure on $I$. These are equivalently (c.f.
[10], Chapter 4) bounded variation (BV) functions, which are non-decreasing
and left-continuous on $I$. We will denote the right limit of $\phi$ at $x$ by
$\phi(x+0^{+})$. Furthermore, we recall that since $\phi$ is nondecreasing,
$\phi$ is differentiable almost everywhere. For $\phi\in\mathcal{D}^{*}$, we
also introduce a generalized inverse $\phi^{-}\in\mathcal{D}^{*}$ defined by:

$\phi^{-}(y)=\sup\\{x\in[0,1],\ \phi(x)<y\\},$

where we use the convention $\sup\emptyset=0$; c.f. [44, Section 5.2.3].

We are now able to formulate the main result of this section.

######  Theorem 3.1.

Let $c_{1},c_{2}\in PC^{1}(I,\mathbb{R}^{d})$. Then the distance
$\operatorname{dist}^{\mathcal{S}}_{a,b}$ on the quotient space
$\mathcal{S}(I,\mathbb{R}^{d})$ is equivalently given by a supremum over the
space $\mathcal{D}^{*}$, i.e.,

$\displaystyle\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}])$
$\displaystyle=2b\sqrt{\ell_{c_{1}}+\ell_{c_{2}}-2\sup_{\phi\in\mathcal{D}^{*}}\int_{I}\sqrt{\dot{\phi}(x)}f_{a,b}\left(x,\phi(x)\right)dx},$
(18)

where $f_{a,b}:I\times I\rightarrow\mathbb{R}$ is defined by

$f_{a,b}(x,y)=\left\\{\begin{array}[]{cl}\sqrt{|\dot{c}_{1}(x)||\dot{c}_{2}(y)|}\cos\left(\frac{a}{2b}\cos^{-1}(\frac{\dot{c}_{1}(x)\cdot\dot{c}_{2}(y)}{|\dot{c}_{1}(x)||\dot{c}_{2}(y)|})\right)&\mbox{
if
}\frac{a}{2b}\cos^{-1}(\frac{\dot{c}_{1}(x)\cdot\dot{c}_{2}(y)}{|\dot{c}_{1}(x)||\dot{c}_{2}(y)|})\leq\frac{\pi}{2}\\\
0&\mbox{ otherwise.}\end{array}\right.$ (19)

We have the following statements concerning the existence of optimal
reparametrizations:

  1. 1.

$\mathbf{a<b:}$ for any $c_{1},c_{2}\in PC^{1}(I,\mathbb{R}^{d})$ there exists
a strictly increasing homeomorphism such that the infimum in (15) is attained.
If the derivatives $\dot{c}_{1},\dot{c}_{2}$ are Lipschitz continuous then
$\gamma\in\operatorname{Diff}_{C^{1}}(I)$, i.e., the optimal reparametrization
is a $C^{1}$-diffeomorphism.

  2. 2.

$\mathbf{a\geq b:}$ for $c_{1},c_{2}\in PC^{1}(I,\mathbb{R}^{d})$ there exists
a pair of generalized reparametrizations
$\gamma_{1},\gamma_{2}\in\bar{\Gamma}$ such that the infimum in (3.1) is
attained. On the other hand, there exists a pair of curves $c_{1},c_{2}\in
AC(I,\mathbb{R}^{d})$ such that the infimum in (3.1) is not attained in
$\bar{\Gamma}$ and consequently neither in $\Gamma$ or $\mathcal{D}^{*}$.

Our proof of this result, which makes repeated use of results by Trouve and
Younes [44] is presented in C.

######  Remark 3.1 (Open questions).

This result suggests the following questions, which remain open for future
research.

  * •

Counterexample for $a<b$: The proof of the non-existence result for $a\geq b$
will be based on constructing curves $c_{1},c_{2}$ such that $f_{a,b}(x,x)\leq
0$ for $x\in B$, where $B$ is a closed but nowhere dense subset. For $a<b$,
$f_{a,b}$ is positive and thus the same strategy fails.

  * •

Higher regularity: One would hope that a higher regularity of the curves
$c_{1}$ and $c_{2}$ would lead to a higher regularity of the obtained optimal
reparametrization functions. To deduce this result from the theorem of Trouve
and Younes [44] one would need that a higher regularity of the curves $c_{i}$
also leads to a higher regularity of the function $f_{a,b}$. This function is,
however, at best Lipschitz continuous and only locally of a higher regularity.
One can use the local regularity of $f_{a,b}$ and localize the arguments of
[44]to show that the optimal reparametrization functions are locally of class
$C^{k-1}$ provided that the curves are of class $C^{k}$, but as of now we do
not know how one could go a step further and obtain a global regularity
result.

######  Remark 3.2.

In the limit (and degenerate) case $a=0$, one can further show that for any
regular curves $c_{1},c_{2}\in PC^{1}(I,\mathbb{R}^{d})$ the infimum in (15)
is attained by the constant speed reparametrizations of $c_{1}$ and $c_{2}$,
i.e.:

$\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}])=\operatorname{dist}_{a,b}(c_{1}\circ\psi_{c_{1}}^{-1}\circ\psi_{c_{2}},c_{2})$

where $\psi_{c}(u)=\int_{0}^{u}|\dot{c}(s)|\mathrm{d}s.$ Indeed, let us first
assume that $c_{1}$ and $c_{2}$ are both constant speed parametrized, i.e.
$|\dot{c}_{1}|$ and $|\dot{c}_{2}|$ are constant on $I$ and equal to the curve
lengths $\ell_{c_{1}}$ and $\ell_{c_{2}}$, respectively. Therefore $f_{a,b}$
is just constant, and the optimization problem becomes:

$\displaystyle\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}])$
$\displaystyle=2b\sqrt{\ell_{c_{1}}+\ell_{c_{2}}-2f_{a,b}\left(0,0\right)\sup_{\phi\in\mathcal{D}^{*}}\int_{I}\sqrt{\dot{\phi}(x)}dx}.$
(20)

We have by Cauchy-Schwarz

$\left(\int_{I}\sqrt{\dot{\phi}(x)}dx\right)^{2}\leq
1\cdot\int_{I}\dot{\phi}(x)dx\leq 1\cdot 1=1$

and for $\phi=\operatorname{id}$, the previous inequality is an equality. The
result follows and we also obtain that the (pseudo-)distance is given by:

$\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}])=\sqrt{\ell_{c_{1}}+\ell_{c_{2}}-2\sqrt{\ell_{c_{1}}\ell_{c_{2}}}}=\left|\sqrt{\ell_{c_{1}}}-\sqrt{\ell_{c_{2}}}\right|$

In the general case where $c_{1},c_{2}\in PC^{1}(I,\mathbb{R}^{d})$, one has
that $c_{1}\circ\psi_{c_{1}}^{-1}$ and $c_{2}\circ\psi_{c_{2}}^{-1}$ have
constant speed, and

$\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}])=\operatorname{dist}_{a,b}(c_{1}\circ\psi_{c_{1}}^{-1}\circ\psi_{c_{2}},c_{2}).$

###  3.2 Existence of optimal reparametrizations on the space of closed curves

We will now extend the previous result to the case of closed curves, i.e. when
$D=S^{1}$. For closed parametrized curves, there does not exist anymore an
explicit formula for the geodesic distance associated to general elastic
$G^{a,b}$-metrics—to our knowledge, the only $G^{a,b}$ metric with explicit
geodesics for closed curves is the $a=b$ case for plane curves [50] and space
curves [37], both of which rely on specific constructions involving Hopf maps.
Nevertheless, the formula we obtained for open curves in Theorem 2.1 still
defines a reparametrization invariant distance function on the space of
closed, parametrized curves: the next result follows by the same analysis
applied in the open curve setting.

######  Corollary 3.1.

For $c_{1},c_{2}\in AC_{0}(S^{1},\mathbb{R}^{d})$ let
$\operatorname{dist}_{a,b}(c_{1},c_{2})$ be given by the same formula as in
(10) with integration over $I$ replaced by integration over $S^{1}$. Then
$\operatorname{dist}_{a,b}$ defines a metric on the space of closed,
absolutely continuous curves $AC_{0}(S^{1},\mathbb{R}^{d})$.

As previously, this allows us to construct a distance on the quotient space of
unparametrized closed curves by defining

$\operatorname{dist}^{\mathcal{S},\operatorname{cl}}_{a,b}([c_{1}],[c_{2}]):=\inf_{\gamma\in\Gamma_{\operatorname{cl}}}\operatorname{dist}_{a,b}(c_{1},c_{2}\circ\gamma),$
(21)

where $\operatorname{dist}_{a,b}$ is given by (10) and where
$\Gamma_{\operatorname{cl}}$ denotes the group of absolutely continuous
reparametrizations on the circle, i.e.,

$\displaystyle\Gamma_{\operatorname{cl}}=\\{\gamma\in
AC(S^{1},S^{1}):\gamma\text{ is bijective and }\gamma^{\prime}>0\quad a.e.\\}$

We introduce the shift operator on $S^{1}$ :

$\displaystyle S_{\tau}:\left\\{\begin{array}[]{ccc}S^{1}&\rightarrow&S^{1}\\\
\theta&\mapsto&\theta+\tau\end{array}\right.$

where $\tau\in S^{1}$. Then we can rewrite the group of absolutely continous
reparametrizations on the circle as

$\displaystyle\Gamma_{\operatorname{cl}}=\\{S_{\tau}\circ\gamma:\gamma\in\Gamma\text{
and }\tau\in S^{1}\\},$

and we also need, as before, the closure of this group
$\bar{\Gamma}_{\operatorname{cl}}=\\{S_{\tau}\circ\gamma:\gamma\in\bar{\Gamma}\text{
and }\tau\in S^{1}\\}$. Then, the induced distance
$\operatorname{dist}^{\mathcal{S},\operatorname{cl}}_{a,b}$ can be expressed
as

$\displaystyle\operatorname{dist}^{\mathcal{S},\operatorname{cl}}_{a,b}([c_{1}],[c_{2}])$
$\displaystyle=\inf_{\gamma\in\Gamma_{\operatorname{cl}}}\operatorname{dist}_{a,b}(c_{1},c_{2}\circ\gamma)=\inf_{\gamma_{1},\gamma_{2}\in\Gamma_{\operatorname{cl}}}\operatorname{dist}_{a,b}(c_{1}\circ\gamma_{1},c_{2}\circ\gamma_{2})$
$\displaystyle=\inf_{\gamma_{1},\gamma_{2}\in\bar{\Gamma}_{\operatorname{cl}}}\operatorname{dist}_{a,b}(c_{1}\circ\gamma_{1},c_{2}\circ\gamma_{2}).$
(22)

We can now formulate the existence result of optimal reparametrizations for
closed curves. Our proof, which will use the same method as [21] where the
result was shown for the SRV metric, is postponed to D.

######  Theorem 3.2.

Let $c_{1},c_{2}\in PC^{1}(S^{1},\mathbb{R}^{d})$. We have the following
statements concerning the existence of optimal reparametrizations:

  1. 1.

$\mathbf{a<b:}$ for any $c_{1},c_{2}\in PC^{1}(S^{1},\mathbb{R}^{d})$ there
exists a strictly increasing homeomorphism such that the infimum in (22) is
attained. If the derivatives $\dot{c}_{1},\dot{c}_{2}$ are Lipschitz
continuous then $\gamma\in\operatorname{Diff}_{C^{1}}(S^{1})$, i.e., the
optimal reparametrization is a $C^{1}$-diffeomorphism..

  2. 2.

$\mathbf{a\geq b:}$ for $c_{1},c_{2}\in PC^{1}(S^{1},\mathbb{R}^{d})$ there
exists a pair of generalized reparametrization
$\gamma_{1},\gamma_{2}\in\bar{\Gamma}_{\operatorname{cl}}$ such that the
infimum in (22) is attained.

##  4 Algorithms for the computation of quotient distances and geodesics

In the following, we will describe two different algorithms for the numerical
computation of the optimal reparametrization on the space of open curves: an
exact algorithm based on the work of Lahiri, Robinson and Klassen [28] and a
faster dynamic programming based approximation. Solving the registration
problem on the space of closed curves simply requires an additional
optimization over the starting point, i.e., one has to solve the registration
problem on the space of open curves for any choice of starting point.
Consequently, the numerical solution on the space of closed curves is
significantly more expensive.

###  4.1 Exact algorithm for piecewise linear curves

By the results of the previous section, we obtain the existence of optimal
reparametrizations in the case of open, piecewise linear curves. Furthermore,
using a result of Lahiri et. al. [28] we obtain an explicit algorithm for the
optimal reparametrizations $\gamma_{1}$ and $\gamma_{2}$. We have the
following result that follows directly from the corresponding analysis for the
SRV-metric.

######  Theorem 4.1.

Let $c_{1},c_{2}$ be two piecewise linear curves with values in
$\mathbb{R}^{d}$. Then the pair of generalized reparametrizations
$\gamma_{1},\gamma_{2}\in\bar{\Gamma}$ that attains the infimum in (3.1)
consists of two piecewise linear maps.

###### Proof.

First we note that piecewise linear curves, are piecewise smooth and thus in
particular piecewise $C^{1}$. This guarantees the existence of optimal
reparametrization by the results of Theorem 3.1.

Next, we introduce a notion from [28] and let $f:I\times
I\to\operatorname{\mathbb{R}}$. We call $f$ _rectangular_ if there exist
partitions $0=i_{0}<i_{1}<\dots<i_{m}=1$ and $0=j_{0}<i_{1}<\dots<j_{n}=1$
such that $f$ is constant on each rectangle of the form
$[i_{r-1},i_{r}]\times[j_{s-1},j_{s}]$.

Using again Theorem 3.1 we have shown that finding optimal reparametrizations
for the geodesic distance is equivalent to the optimization problem

$\sup_{\gamma_{1},\gamma_{2}\in\bar{\Gamma}}\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}f_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u)\right)du,$
(23)

where $f_{a,b}$ is defined in (19). It is clear that the function $f_{a,b}$ is
rectangular if the curves $c_{1}$ and $c_{2}$ are piecewise linear. From here,
the proof given in [28] goes through verbatim. ∎

Consequently, the exact algorithm from [28] can be adapted to find optimal
reparametrizations in our setting. This algorithm can find the optimal
piecewise linear trajectory $\gamma_{1},\gamma_{2}$ that maximizes
$\int_{I\times
I}W(\gamma_{1}(u),\gamma_{2}(u))\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}$
for general $W\in L^{2}(I\times I,\mathbb{R})$. For the $G^{a,b}$-metrics, we
simply have $W=f_{a,b}$. We use the implementation from Martins
Bruveris222https://github.com/martinsbruveris/libsrvf that computes
reparametrization for the usual $G^{1,1/2}$-metric, i.e. with
$W(x,y)=q_{1}(x)\cdot q_{2}(y)$. Recall that closed curves require an
additional optimization step to determine the starting point. For each vertex
of the piecewise linear curve $c_{1}$, we simply compute the resulting
distance with $c_{2}$ and choose the minimum.

###  4.2 Dynamic programming approach

The previous algorithm gives the exact optimal piecewise linear
reparametrization, but is in practice very slow to compute. An alternative
method is to use a dynamic programming scheme to estimate an approximation of
the optimal reparametrization, similar to the approach proposed in [43, 33].

We define a discretization $\mathcal{I}=\\{x_{0},...,x_{n}\\}$ of the
intervall $[0,1]$ and restrict the search to piecewise linear functions on the
grid $\mathcal{I}\times\mathcal{I}$. We denote by $PL_{\mathcal{I}}$ the set
of piecewise linear increasing functions with vertices on
$\mathcal{I}\times\mathcal{I}$. For $k<i$, $l<j$ and $\phi\in
PL_{\mathcal{I}}$, we define the partial cost function

$E(k,l,\phi)=\int_{x_{k}}^{x_{i}}\sqrt{\dot{\phi}(x)}f_{a,b}(x,\phi(x))dx.$

Let $L_{k,l,i,j}(x)=x_{l}+\frac{x_{j}-x_{l}}{x_{i}-x_{k}}(x-x_{k})$ be the
line between $(x_{k},x_{l})$ and $(x_{i},x_{j})$, and with a slight abuse of
notation, we shall write $E(k,l,i,j)=E(k,l,L_{k,l,i,j})$ as the energy of the
segment. By additivity, if $\phi\in PL_{\mathcal{I}}$ is defined by the
segments
$L_{k_{1},l_{1},k_{2},l_{2}},L_{k_{2},l_{2},k_{3},l_{3}},...,L_{k_{p-1},l_{p-1},k_{p},l_{p}}$,
the total energy of $\phi$ is

$E(\phi)=\sum_{n=1}^{p-1}E(k_{n},l_{n},k_{n+1},l_{n+1}).$

We thus have to find the sequence of nodes $(k_{n},l_{n})$ that minimizes the
energy. We define the partial value function to reach node $(i,j)$ by

$H(i,j)=\min_{k<i,l<j}E(k,l,i,j)+H(k,l)$ (24)

with $H(0,0)=0$; in other words, $H$ is defined recursively. Due to the
specific additive form of $E$, if for all $k<i,l<j$, $H(k,l)$ is the minimal
energy between $(0,0)$ and $(k,l)$, then by definition $H(i,j)$ is the minimal
energy between $(0,0)$ and $(i,j)$. Consequently, the global minimal energy
that we aim to find is given by $H(1,1)$.

The algorithm proceeds in two steps. First, we compute the different values of
$H$ on the grid $\mathcal{I}\times\mathcal{I}$ using equation (24). Then, we
determine the optimal path by backtracking from vertex $(1,1)$: if
$(x_{i},x_{j})$ is a vertex of the optimizer, we compute the node that joins
$(x_{i},x_{j})$ by solving the problem:

$(\hat{k},\hat{l})=\underset{k<i,l<j}{\operatorname{argmin}}E(k,l,i,j)+H(k,l).$

To speed-up the computation of the value function and optimal
reparametrization, a standard approach [33] is to restrict the search of the
node that connects to $(i,j)$ to a smaller set than $\\{k,l:k<i,l<j\\}$. In
our case, we define

$N_{i,j}=\\{k,l:i-6\leq k<i,j-6\leq l<j\\}$

and the corresponding partial energy

$H(i,j)=\min_{(k,l)\in N_{i,j}}E(k,l,i,j)+H(k,l).$

This will lead to a restriction of the admissible slopes and in general to a
less precise approximation of the reparametrization. Nevertheless, in all of
our experiments, this restriction still yields good approximations of the true
reparametrization functions, c.f. Figure 2.

###  4.3 Examples

Figure 1 shows several geodesics between pairs of plane curves—a pair of
simple synthetic curves and a pair of real leaf shapes. Geodesics are computed
for a variety of elastic metrics $G^{a,b}$; we fix $b=\frac{1}{2}$ and compute
geodesics for $a\in\\{0.1,0.5,1,5\\}$. All geodesics in this figure were
computed using our dynamic programming algorithm. These first examples clearly
illustrate that the intermediate shapes along the geodesics strongly depend on
the choice of metric parameters. Figure 2 compares the estimated
reparametrization functions found via the dynamic programming algorithm to
those found by the exact algorithm. We see here that the dynamic programming
algorithm typically returns registrations which are close to the true optimal
ones, while incurring a lower numerical burden. Indeed, for the synthetic
example, the average computational times for exact registrations were 306s,
269s, 40s, and 0.2s, respectively, for $a=0.1,0.5,1,5$; their counterparts
computed using the dynamic programming algorithm were orders of magnitude
smaller: 0.23s, 0.09s, 0.07s, and 0.06s. A similar trend held for the leaf
shapes, where we got 299s, 253s, 34s, and 0.19s for the exact algorithm and
0.22s, 0.03s, 0.025s, and 0.021s for dynamic programming. In the figure, we
report the performance of the dynamic programming algorithm by giving its
relative error $(d_{\mathrm{dyn}}-d_{\mathrm{ex}})/d_{\mathrm{ex}}$, where
$d_{\mathrm{dyn}}$ is geodesic distance (for given metric parameters) computed
via dynamic programming and $d_{\mathrm{ex}}$ is the exact distance.

Figure 1: Geodesics between open plane curves. Each panel shows several
geodesics between a pair of curves, with each row corresponding to a different
choice of parameters in the elastic metric. In the left panel, the source and
target curves are simple synthetic curves, designed to clearly illustrate the
dependence of the geodesic on the metric parameters. In the right panel, the
source and target curves are real leaf shapes—although the source and target
curves are actually closed, we compute each geodesic in the space of open
curves. In both the left and right panels, the metric parameters vary by row
and are given by $G^{a,\frac{1}{2}}$, with $a=0.1$, $0.5$, $1$ and $5$,
respectively. Figure 2: Comparison of registrations via the exact and dynamic
programming algorithms. The top row shows the registrations (i.e., optimal
diffeomorphisms of $[0,1]$) between the synthetic curves from Figure 1 with
respect to metric parameters $b=\frac{1}{2}$ and $a=0.1,0.5,1,5$,
respectively. In each figure, the exact registration is plotted in blue and
the dynamic programming registration is plotted in red. The last graph in the
row plots the relative error of dynamic programming versus the exact algorithm
(see the text) for a finer range of parameters $a\in\\{0,0.1,0.2,\ldots,2\\}$,
$b=\frac{1}{2}$. The bottom row shows the same experiment for the
registrations between the leaf shapes of Figure 1. Observe that the relative
error is generally on the order of a single digit percentage in each case.

Figure 3 applies our framework to compute geodesics between 3D curves (protein
backbones), for a variety of elastic metric parameters. These geodesics were
computed, once again, using the dynamic programming algorithm.

Figure 3: Geodesics between space curves. Each row shows a geodesic between
the same pair of protein backbones, modeled as space curves, for a particular
choice of elastic metric. The elastic metric parameters for the rows are
$b=\frac{1}{2}$, $a=0.1,\,0.5,\,1,\,5$, respectively.

##  5 Metric learning

The numerical experiments of the previous section illustrate both the
influence and importance of the choice of metric when comparing and matching
shapes. While certain heuristics may sometimes guide the selection of the
parameters $a$ and $b$ of the elastic metric for a given dataset and
application, it is often done via empirical trial and error approaches. Thus,
in recent years, there has been a growing interest in developing methods for
automatically estimating metrics on shape spaces.

Obviously, there is a priori no natural criterion to prefer one metric over
another for the basic task of matching two shapes. However, when considering
shape datasets and problems such as clustering or classification, it should be
expected that different metrics will lead to different ways of quantifying
differences across samples and consequently different properties from a
statistical perspective. This suggests the idea of attempting to optimize (or
learn) the choice of metric in order to improve the statistical power of shape
analysis methods. The elastic framework of this paper appears quite amenable
to such a task as learning the metric here reduces to learning a single
parameter (the ratio of $a$ and $b$). In this section, we consider the issue
of metric learning for shape classification using two different models. Our
primary focus is on demonstrating the feasibility and advantages of optimizing
the choice of the metric in such a context; we leave an in depth study of the
issue of developing efficient numerical algorithms for metric learning for
future work.

The literature on metric learning is vast, and we only summarize some main
ideas here—for more details, there are several surveys on the topic, e.g.,
[47, 5, 27, 25]. Generally, metric learning is a supervised machine learning
technique for choosing a metric from a parametric family which optimally
separates data coming from different classes. Classically, the data consists
of Euclidean feature vectors, and the metrics under consideration are
_Mahalanobis distances_ [46, 11, 48], which allows training via standard
techniques from convex optimization theory. Closer to the topic of this paper,
there has also been recent interest in metric learning on parametric families
of Riemannian metrics on manifolds, such as spaces of SPD matrices [45],
spaces of histograms [29] and graphs [22].

A common paradigm in metric learning is to represent data via _pairwise
constraints_ , where the training data consists of two sets
$S=\\{(x_{i},x_{j})\\}$ and $D=\\{(x_{k},x_{\ell})\\}$ so that each pair
$(x_{i},x_{j})\in S$ consists of _similar points_ (coming from the same class)
and each pair $(x_{k},x_{\ell})\in D$ consists of _dissimilar points_ (coming
from different classes). One then designs a loss function on the metric
parameter space which encourages distances between similar points to be small
and distances between dissimilar points to be large—the particulars of the
loss function are application-dependent, and several choices are described in
the survey papers cited above. An optimal metric with respect to a given loss
can then be used for downstream distance-based analysis tasks, such as
clustering, dimension reduction and $k$-nearest neighbors classification. This
is the approach that we take in Section 5.1, where we us the pairwise
constraints method to train metrics for various 2-dimensional shape datasets.
On the other hand, if one has a particular classification task in mind then it
is sensible to learn the metric which optimizes performance on this task
directly. We take this approach in Section 5.2 to learn a metric which
optimally classifies 3-dimensional protein backbone curves.

###  5.1 Pairwise Constraints

Let us first consider the goal of estimating, in a supervised fashion, the
metric that will best separate 2-dimensional shapes according to the pairwise
constraints paradigm described above. In other words, suppose that we have
training data consisting of a collection of unparametrized curves
$X=\\{c_{j}\\}_{j=1}^{N}$ together with known labels $y=\\{y_{j}\\}_{j=1}^{N}$
with each $y_{j}\in\\{1,\ldots,K\\}$ (that is, there are $K$ distinct
classes). We seek to determine the optimal parameters $(a,b)$ for the elastic
metric $G^{a,b}$ so that the geodesic distance
$\operatorname{dist}_{a,b}^{\mathcal{S}}$ optimally separates those classes.
By a simple normalization argument, we may fix one of the two metric
parameters, which we shall do in the following by setting $b=1/2$ and optimize
over $a\geq 0$.

The above task can be stated formally by introducing an adequate pairwise
constraint loss function depending on the distances
$\operatorname{dist}^{\mathcal{S}}_{a,b}(c_{i},c_{j})$ between the curves of
the training set. There have been various families of such loss functions
appearing most notably in the machine learning literature. As a proof-of-
concept, we choose here a simple loss which we can loosely think of as the
ratio of the intra-class variance by the inter-class variance of the shape
distances. Specifically, let $S\subset X\times X$ be the collection of ordered
pairs $(c_{i},c_{j})$ of curves with the same label ($y_{i}=y_{j}$) and
$D\subset X\times X$ the collection of ordered pairs with different labels
($y_{i}\neq y_{j}$). We define our loss function by:

$L(a)=\left(\frac{1}{|S|}\sum_{(c_{i},c_{j})\in
S}\operatorname{dist}^{\mathcal{S}}_{a,1/2}(c_{i},c_{j})^{2}\right)^{\frac{1}{2}}\cdot\left(\frac{1}{|D|}\sum_{(c_{k},c_{\ell})\in
D}\operatorname{dist}^{\mathcal{S}}_{a,1/2}(c_{k},c_{\ell})^{2}\right)^{-\frac{1}{2}}.$
(25)

Minimizing $L(a)$ should be achieved when one strikes a balance between
concentrating curves from the same class close to one another, while giving a
large separation between different classes. As was recently observed in [16,
15], minimizing this loss function is essentially equivalent to solving the
metric learning optimization problem described in the pioneering work of Xing
et al. [46].

For a given value of $a$, this loss function is calculated by first computing
each of the $N(N-1)/2$ pairwise distances
$\\{\operatorname{dist}^{\mathcal{S}}_{a,1/2}(c_{i},c_{j})\\}$, which requires
solving each of the corresponding registration problems. In our experiments,
this is done using the dynamic programming scheme for the sake of
computational efficiency. For the purpose of this work, we evaluate the loss
function over a range of different values for $a$ in order to determine the
approximate value of the minimizer. Note that, while the expression of the
loss when reparametrizations are fixed is relatively simple and could be
optimized easily with respect to $a$, the difficulty is that the optimal
reparametrizations leading to each pairwise distance value also depend on $a$.
This makes the derivation of more sophisticated and efficient schemes for the
minimization of (25) a non-trivial problem that we leave to future
investigation, c.f. the discussion below.

Results. We tested our metric learning pipeline on two shape datasets. Results
from the first dataset are reported in Figure 4. Here, the data consisted of
leaf shapes coming from four classes with 20 samples in each class. We chose 7
random examples from each class as training data and created pairwise data $S$
and $D$, with $S$ consisting of all pairs from the same class and $D$
consisting of all pairs from different classes. We then minimized the loss
function (25) via a grid search over the one-dimensional parameter space (a
gradient descent algorithm was also implemented, which gave the same results).
The efficacy of the learned metric was validated by testing the ability of the
resulting geodesic distance to separate shapes from different classes. We
measured this by computing the pairwise distance matrices for both the
training and testing data, partitioning each dataset into four classes by
applying complete linkage hierarchical clustering to the distance matrices and
computing the Rand index of the inferred clusters against the ground truth
classes. Similar results for the second dataset, consisting of shapes of four
different species of animals, are reported in Figure 5. Notably, the optimal
metrics computed for the two datasets are quite different, indicating that the
choice of optimal metric is data-dependent.

Figure 4: Metric learning on the leaf dataset. The left panel shows
representatives of each of the four classes in the leaf dataset. The middle
and right panels show MDS (multidimensional scaling) plots of the pairwise
distance matrices with respect to the learned metric for the training and
testing data, respectively. The optimal metric parameter learned for the loss
function (25) is $a=0.71$. The Rand indices (see text for a full description)
for the training and testing sets are 1 and 0.93, respectively. Figure 5:
Metric learning on the animal dataset. Similar to Figure 5, from left to right
the panels show representative shapes from each of the four classes, an MDS
plot for the training data and an MDS plot for the testing data, both with
respect to the pairwise distance matrices computed with the optimal metric
parameter. For this experiment, the optimal parameter was $a=0.52$ and the
Rand indices for the training and testing sets were both equal to $1$ (i.e.,
perfect clustering).

###  5.2 Metric learning for shape classification

As an alternative to optimizing the metric parameters with respect to the loss
(25), one may instead consider trying to maximize classification scores on the
training set in a cross-validation fashion. A simple approach could be, for
example, to evaluate leave-one-out nearest neighbor classification scores for
varying values of $a$. A usually more robust way however is to rather rely on
the estimation of conditional probabilities for the different classes. We
present one possible approach in the following description.

With the same notation as in the previous section, we introduce a leave-one-
out scheme in which for each $j=1,\ldots,N$, we denote by
$p_{j}(\ell|\hat{X}_{j})$ the probability of $c_{j}$ to be in the class
$\ell\in\\{1,\ldots,K\\}$ knowing only the curves in
$\hat{X}_{j}=\\{c_{j}\\}_{j\neq i}$ and their labels. In order to estimate the
conditional probabilities, we adapt a standard approach in many machine
learning works, see e.g. [17], Chapter 6.2. Namely, we set
$p^{(j)}(\ell|\hat{X}_{j})=\sigma(z^{(j)})_{\ell}$ where the vector
$z^{(j)}\in\operatorname{\mathbb{R}}^{k}$ is defined by

$(z^{(j)})_{\ell}=-\frac{1}{|\\{i\neq j:y_{i}=l\\}|}\sum_{i\neq
j,y_{i}=l}\operatorname{dist}^{a}(c_{i},c_{j})^{2}$

and $\sigma$ is the softmax function given by

$\sigma(z)_{\ell}=\frac{e^{\beta z_{\ell}}}{\sum_{m=1}^{K}e^{\beta z_{\ell}}}$

with $\beta>0$ a fixed (or tunable) parameter. Then, for each $j=1,\ldots,N$,
$p^{(j)}(y_{j}|\hat{X}_{j})$ gives an estimate of the probability for the
correct class $y_{j}$ of curve $j$. Thus, we seek to maximize the sum of the
log-likelihoods over all instances of the leave-one-out scheme. In other
words, we define the loss function to minimize to be:

$L(a)=-\sum_{j=1}^{N}\log(p^{(j)}(y_{j}|\hat{X}_{j})).$

Note that $-\log(p^{(j)}(y_{j}|\hat{X}_{j}))$ can also be interpreted as the
Kullback-Leibler divergence between the true probability distribution
$\delta_{y_{j}}$ and the estimated one $p^{(j)}(\cdot|\hat{X}_{j})$. As in the
previous section, we can calculate the above loss for each value of the metric
parameter $a$ by first solving all pairwise matching problems to obtain the
set of distances $\\{\operatorname{dist}^{a}(c_{i},c_{j})\\}$.

Results. We used data from the 3D Shape Retrieval Contest 2010 (SHREC’10) [31]
which contains a training dataset of 1000 protein structures from 100 classes,
each class containing 10 proteins. Only the 3D curves representing the protein
backbones were extracted and used in our experiments; two examples of such
protein shapes were shown earlier in Figure 3. In addition, 50 more proteins
from random classes formed the testing dataset that we used to evaluate the
metric learning process. Our goal is to compare results obtained with the
above approach to the methods from [31]. We calculated the classification loss
for a sample of values of the metric parameter $a$ between $0$ and $2$ (Figure
6) and found the optimal value to be $a=0.73$.

|
---|---
Figure 6: Scores for different values of $a$. In the left panel we show the
loss function described in Section 5.2. For comparison, on the right, we also
evaluate the cross-validation leave-one-out accuracy based on nearest neighbor
classification.

For evaluation, we use this optimal parameter to compute a matrix of the
distances between the 50 proteins in the testing set and each of the proteins
in the training set. The performance of the method is measured in the same two
ways as in the original contest.

  * •

Nearest neighbor: for each of the 50 proteins, we find the closest protein
from the training dataset to predict the class of the testing protein. We
calculate the overall percentage of correct predictions. For the optimal value
of the metric parameter determined by our method – $a=0.73$ – we obtain $82\%$
of correct predictions, which beats all methods from [31] (the best method in
the paper reaches $80\%$).

  * •

Receiver operating characteristic (ROC) curve: for each of the 50 proteins in
the testing dataset, we create a ranked list of the proteins from the training
dataset, from the closest protein to the most distant. This ranked list
contains 10 proteins in the actual class of the testing protein (the true
positives) and 990 proteins in a different class (the true negatives). The
ranked list is traversed sequentially and we plot the cumulative rate of true
positives against the cumulative rate of true negatives. Figure 7 shows
aggregate ROC curves for all of the 50 test protein curves, for different
parameters of the metric. For the optimal value of $a$, we also compute the
area under the curve (AUC) for the ROC curves of each testing protein and plot
it in the right panel of the figure.

Figure 7: Left: Aggregate ROC curves for different metric parameters: $a=2$
(green), $a=1$ (blue), and the optimal value $a=0.73$ (red). Right: Bar chart
showing the AUC for optimal metric parameter value $a=0.73$ for each testing
protein.

## References

  * [1] M. Bauer, M. Bruveris, P. Harms, and P. W. Michor.  Vanishing geodesic distance for the riemannian metric with geodesic equation the kdv-equation.  Annals of Global Analysis and Geometry, 41(4):461–472, 2012.
  * [2] M. Bauer, M. Bruveris, S. Marsland, and P. W. Michor.  Constructing reparameterization invariant metrics on spaces of plane curves.  Differential Geometry and its Applications, 34:139–165, 2014.
  * [3] M. Bauer, M. Bruveris, and P. W. Michor.  Overview of the geometries of shape spaces and diffeomorphism groups.  Journal of Mathematical Imaging and Vision, 50(1):60–97, 2014.
  * [4] M. Bauer, P. Harms, and S. C. Preston.  Vanishing distance phenomena and the geometric approach to sqg.  Archive for Rational Mechanics and Analysis, 235(3):1445–1466, 2020\.
  * [5] A. Bellet, A. Habrard, and M. Sebban.  A survey on metric learning for feature vectors and structured data.  arXiv preprint arXiv:1306.6709, 2013.
  * [6] M. Bruveris.  Optimal reparametrizations in the square root velocity framework.  SIAM Journal on Mathematical Analysis, 48(6):4335–4354, 2016.
  * [7] M. Bruveris.  The ${L}^{2}$-metric on ${C}^{\infty}({M},{N})$.  arXiv:1804.00577, 2018.
  * [8] N. Charon and L. Younes.  Shape spaces: From geometry to biological plausibility.  arXiv preprint arXiv:2205.01237, 2022.
  * [9] P. G. Ciarlet.  Three-dimensional elasticity, volume 20.  Elsevier, 1988.
  * [10] D. L. Cohn.  Measure theory, volume 1.  Springer, 2013.
  * [11] J. V. Davis, B. Kulis, P. Jain, S. Sra, and I. S. Dhillon.  Information-theoretic metric learning.  In Proceedings of the 24th international conference on Machine learning, pages 209–216, 2007.
  * [12] I. L. Dryden and K. Mardia.  Statistical Shape Analysis.  John Wiley & Son, 1998.
  * [13] K. J. Falconer.  The Geometry of Fractal Sets.  Cambridge Tracts in Mathematics. Cambridge University Press, 1985.
  * [14] H. Federer.  Geometric Measure Theory.  Springer, 1969.
  * [15] B. Ghojogh, A. Ghodsi, F. Karray, and M. Crowley.  Spectral, probabilistic, and deep metric learning: Tutorial and survey.  arXiv preprint arXiv:2201.09267, 2022.
  * [16] B. Ghojogh, F. Karray, and M. Crowley.  Fisher and kernel fisher discriminant analysis: Tutorial.  arXiv preprint arXiv:1906.09436, 2019.
  * [17] I. Goodfellow, Y. Bengio, and A. Courville.  Deep learning.  MIT press, 2016.
  * [18] K. Gorczowski, M. Styner, J. Jeong, J. Marron, J. Piven, H. Hazlett, S. Pizer, and G. Gerig.  Multi-object analysis of volume, pose, and shape using statistical discrimination.  IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(4):652–666, 2010.
  * [19] U. Grenander and M. I. Miller.  Computational anatomy: An emerging discipline.  Quarterly of Applied Mathematics, LVI(4):617–694, 1998.
  * [20] M. E. Gurtin.  An Introduction to Continuum Mechanics.  1981\.
  * [21] E. Hartman, Y. Sukurdeep, N. Charon, E. Klassen, and M. Bauer.  Supervised deep learning of elastic srv distances on the shape space of curves.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4425–4433, 2021.
  * [22] M. Heitz, N. Bonneel, D. Coeurjolly, M. Cuturi, and G. Peyré.  Ground metric learning on graphs.  Journal of Mathematical Imaging and Vision, 63(1):89–107, 2021\.
  * [23] I. H. Jermyn, S. Kurtek, E. Klassen, and A. Srivastava.  Elastic shape matching of parameterized surfaces using square root normal fields.  In European conference on computer vision, pages 804–817. Springer, 2012.
  * [24] M. Josephy.  Composing functions of bounded variation.  Proceedings of the American Mathematical Society, 83(2):354–356, 1981.
  * [25] M. Kaya and H. Ş. Bilge.  Deep metric learning: A survey.  Symmetry, 11(9):1066, 2019.
  * [26] B. Khesin and P. W. Michor.  The flow completion of burgers’ equation.  Infinite dimensional groups and manifolds. Editor: Tilmann Wurzbacher. IRMA Lectures in Mathematics and Theoretical Physics, 5:17–26, 2004\.
  * [27] B. Kulis et al.  Metric learning: A survey.  Foundations and Trends® in Machine Learning, 5(4):287–364, 2013.
  * [28] S. Lahiri, D. Robinson, and E. Klassen.  Precise matching of pl curves in $\mathbb{R}^{n}$ in the square root velocity framework.  Geometry, Imaging and Computing, 2(3):133–186, 2015.
  * [29] T. Le and M. Cuturi.  Unsupervised riemannian metric learning for histograms using aitchison transformations.  In International Conference on Machine Learning, pages 2002–2011. PMLR, 2015.
  * [30] P. Mattila.  Geometry of sets and measures in Euclidean spaces: fractals and rectifiability.  Number 44. Cambridge university press, 1999.
  * [31] L. Mavridis, V. Venkatraman, D. Ritchie, N. Morikawa, R. Andonov, A. Cornu, N. Malod-Dognin, J. Nicolas, M. Temerinac-Ott, M. Reisert, H. Burkhardt, A. Axenopoulos, and P. Daras.  Shrec’10 track: Protein model classification.  pages 117–124, 01 2010.
  * [32] P. W. Michor and D. Mumford.  An overview of the riemannian metrics on spaces of curves using the hamiltonian approach.  Applied and Computational Harmonic Analysis, 23(1):74–113, 2007\.
  * [33] W. Mio, A. Srivastava, and S. Joshi.  On shape of plane elastic curves.  International Journal of Computer Vision, 73(3):307–324, 2007.  Publisher: Springer.
  * [34] D. B. Mumford and P. W. Michor.  Riemannian geometries on spaces of plane curves.  Journal of the European Mathematical Society, 8(1):1–48, 2006.
  * [35] T. Needham.  Kähler structures on spaces of framed curves.  Annals of Global Analysis and Geometry, 54(1):123–153, 2018.
  * [36] T. Needham.  Knot types of generalized kirchhoff rods.  Journal of Knot Theory and Its Ramifications, 28(11):1940010, 2019\.
  * [37] T. Needham.  Shape analysis of framed space curves.  Journal of Mathematical Imaging and Vision, 61(8):1154–1172, 2019\.
  * [38] T. Needham and S. Kurtek.  Simplifying transforms for general elastic metrics on the space of plane curves.  SIAM journal on imaging sciences, 13(1):445–473, 2020.
  * [39] S. Osher and R. Fedkiw.  Level Set Methods and Dynamic Implicit Surfaces.  Springer Verlag, 2003.
  * [40] A. Srivastava and E. Klassen.  Functional and Shape Data Analysis.  Springer, 2016.
  * [41] A. Srivastava, E. Klassen, S. H. Joshi, and I. H. Jermyn.  Shape Analysis of Elastic Curves in Euclidean Spaces.  IEEE transactions on pattern analysis and machine intelligence, 33(7):1415–1428, 2010.
  * [42] G. Sundaramoorthi, A. Yezzi, and A. C. Mennucci.  Sobolev active contours.  International Journal of Computer Vision, 73(3):345–366, 2007.
  * [43] A. Trouvé and L. Younes.  Diffeomorphic matching problems in one dimension: Designing and minimizing matching functionals.  In European Conference on Computer Vision, pages 573–587. Springer, 2000.
  * [44] A. Trouvé and L. Younes.  On a class of diffeomorphic matching problems in one dimension.  SIAM J. Control and Optimization, 39:1112–1135, 12 2000.
  * [45] R. Vemulapalli and D. W. Jacobs.  Riemannian metric learning for symmetric positive definite matrices.  arXiv preprint arXiv:1501.02393, 2015.
  * [46] E. Xing, M. Jordan, S. J. Russell, and A. Ng.  Distance metric learning with application to clustering with side-information.  Advances in neural information processing systems, 15, 2002.
  * [47] L. Yang and R. Jin.  Distance metric learning: A comprehensive survey.  Michigan State Universiy, 2(2):4, 2006.
  * [48] Y. Ying and P. Li.  Distance metric learning with eigenvalue optimization.  The Journal of Machine Learning Research, 13(1):1–26, 2012.
  * [49] L. Younes.  Computable elastic distances between shapes.  SIAM Journal on Applied Mathematics, 58(2):565–586, 1998.  Publisher: Society for Industrial and Applied Mathematics.
  * [50] L. Younes, P. W. Michor, J. M. Shah, and D. B. Mumford.  A metric on shape space with explicit geodesics.  Rendiconti Lincei, 19(1):25–57, 2008.
  * [51] C. T. Zahn and R. Z. Roskies.  Fourier descriptors for plane closed curves.  IEEE Transactions on Computers, 21(3), 1972.

##  Appendix A An interpretation from linear elasticity theory

With the definitions and notations of Section 2.1, let us consider a portion
of an open smooth curve which is parametrized on an interval we will denote
$I$, i.e. $c:I\rightarrow\operatorname{\mathbb{R}}^{2}$ is an immersion of
class $C^{\infty}$, and define the thin shell domain
$\Omega\subset\operatorname{\mathbb{R}}^{2}$ of “thickness” $\delta>0$ around
that curve. Specifically, we take $\Omega$ as being given by the
parametrization $\omega:[-\delta/2,\delta/2]\times I\rightarrow\Omega$ defined
by $\omega(t,u)=c(u)+tn(u)$ where $n(u)$ is the unit normal vector to the
curve $c$ at $u$. It is easy to see that for $\delta$ small enough, $\omega$
is a diffeomorphism that we can view as a foliation of $\Omega$. Indeed, we
note that $\omega(0,\cdot)=c(\cdot)$ and for any $t\in[-\delta/2,\delta/2]$,
$\omega_{t}:u\mapsto\omega(t,u)$ defines a parametrized curve which
corresponds to layer $t$ of the foliation. Moreover,
$\omega_{t}^{\prime}(u)=c^{\prime}(u)+tn^{\prime}(u)$ and, as $n(u)$ is a unit
vector orthogonal to $c^{\prime}(u)$, we get that $\omega_{t}^{\prime}(u)$ is
parallel to $c^{\prime}(u)$ which implies that $n(u)$ is also the unit normal
vector to $\omega_{t}$ at $u$. Thus, for any $x=\omega(t,u)\in\Omega$, we can
define the orthonormal vector frame $F(x)=(\tau(x),n(x))$ by:

$\tau(x)=\frac{\omega_{t}^{\prime}(u)}{|\omega_{t}^{\prime}(u)|}=\frac{\partial_{u}\omega(t,u)}{|\partial_{u}\omega(t,u)|},\
\ n(x)=n(u)$

See the illustration given in Figure A.1.

Figure A.1: Illustration of the thin shell elastic domain model.

Now, we model $\Omega$ as a linear elastic material which undergoes an
infinitesimal deformation given by a smooth vector field
$v:\Omega\rightarrow\operatorname{\mathbb{R}}^{2}$. We shall further assume
that this deformation field is uniform along the transversal direction, in
other words that it takes the following form: for any $x=\omega(t,u)$,
$v(x)=h(u)$ where $h$ is a vector field defined along the curve $c$ as in the
previous section, c.f. again Figure A.1 for visualization. Note that this is a
natural assumption in the small thickness laminar model that we are interested
in here. Then, following the approach of classical linear elasticity [20, 9],
one introduces the $(2\times 2)$ symmetric tensor field defined for all
$x\in\Omega$ as $\varepsilon(x)=\frac{dv(x)+dv(x)^{T}}{2}$. This is known as
the strain tensor associated to the deformation field $v$ and expressed in the
canonical basis. Given the specific laminar structure of the domain here, it
will be more convenient to instead consider the strain tensor relative to the
above orthonormal frame $F(x)$, which is specifically
$S(x)=F(x)^{T}\varepsilon(x)F(x)$. The linear elastic energy associated to the
deformation field is obtained from Hooke’s law and take the general form:

$E(v)=\int_{\Omega}U(x,S(x))dx$ (26)

where $U(x,\cdot)$ is a quadratic form on the space of symmetric $(2\times 2)$
matrices which is usually referred to as the elastic or stiffness tensor. In
the present context, we will restrict the class of such elastic tensors by
making a few additional assumptions. First, we will consider the elastic
properties of the material to be uniform in the sense that $U(x,\cdot)$ does
not depend on $x\in\Omega$. Then, viewing any symmetric matrix
$S=(s_{ij})_{i,j=1,2}$ as the $(3\times 1)$ vector
$(s_{11},s_{22},s_{12})^{T}$, the quadratic form $U$ can be identified with a
single symmetric positive definite $(3\times 3)$ matrix which we write as:

$U=\begin{pmatrix}u_{1,1}&u_{1,2}&u_{1,12}\\\ u_{1,2}&u_{2,2}&u_{2,12}\\\
u_{1,12}&u_{2,12}&u_{12,12}\end{pmatrix}.$

The coefficients in $U$ assign weights to the different terms in the elastic
energy in the following way. Both coefficients $u_{1,1}$ and $u_{2,2}$
correspond to spring-like stiffness coefficients in the tangential and normal
directions respectively. Coefficient $u_{1,2}$, on the other hand, weighs the
relative compression/stretching between tangential and normal direction. The
coefficient $u_{12,12}$ can be associated with bending energy that results
from a change of angle between the two directions. We will make some further
symmetry assumptions on the material, namely that it is orthotropic with
respect to the two directions $\tau(x)$ and $n(x)$ at each point $x$. This
leads to the conditions $u_{1,12}=u_{2,12}=0$. Note that the orthotropy
assumption is relatively common in many materials (with the exception of
certain crystals) and include in particular fully isotropic materials, c.f.
Remark A.1 below.

Going back more specifically to the deformation of the foliated domain
$\Omega$, due to the particular form of the vector field $v$, we can see that
for any $x=\omega(t,u)\in\Omega$, $dv(x)\cdot n(x)=0$. This implies that the
strain tensor is of the form:

$S(x)=\begin{pmatrix}\tau(x)^{T}dv(x)\cdot\tau(x)&\frac{1}{2}(dv(x)\cdot\tau(x))^{T}n(x)\\\
\frac{1}{2}(dv(x)\cdot\tau(x))^{T}n(x)&0\end{pmatrix}$

and so, identified as a $(3\times 1)$ vector, we have
$S(x)=(s_{11}(x),0,s_{12}(x))^{T}$. Under the previous assumptions on the
elastic tensor, we find the the following elastic energy:

$\displaystyle E(v)$
$\displaystyle=\int_{\Omega}(u_{1,1}s_{11}(x)^{2}+u_{12,12}s_{12}(x)^{2})dx$
$\displaystyle=\int_{-\frac{\delta}{2}}^{+\frac{\delta}{2}}\int_{I}(u_{1,1}s_{11}(\omega(t,u))^{2}+u_{12,12}s_{12}(\omega(t,u))^{2})\left|J_{\omega}(t,u)\right|dudt.$

where $J_{\omega}$ denotes the Jacobian determinant of $\omega$. We have seen
that $\partial_{t}\omega(t,u)=n(u)$ and
$\partial_{t}\omega(t,u)=c^{\prime}(u)+tn^{\prime}(u)$ with $c^{\prime}(u)$
and $n^{\prime}(u)$ being parallel vectors both orthogonal to $n(u)$. Thus,
for all $(t,u)$, $|J_{\omega}(t,u)|=|c^{\prime}(u)+tn^{\prime}(u)|$.

Now, using the continuity with respect to $t$ of the inside integral and the
mean value theorem, we obtain that:

$\displaystyle\lim_{\delta\rightarrow
0}\frac{1}{\delta}E(v)=\int_{I}(u_{1,1}s_{11}(\omega(0,u))^{2}+u_{12,12}s_{12}(\omega(0,u))^{2})|c^{\prime}(u)|du.$

In addition, from $v(\omega(0,u))=h(u)$, we get by differentiating that
$dv(\omega(0,u))\cdot\tau(\omega(0,u))=h(u)/|c^{\prime}(u)|$. We can then
rewrite the above expressions of $s_{11}$ and $s_{12}$ as:

$\displaystyle
s_{11}(\omega(0,u))=\tau(\omega(0,u))^{T}\left(\frac{h^{\prime}(u)}{|c^{\prime}(u)|}\right)=\left(\frac{c^{\prime}(u)}{|c^{\prime}(u)|}\right)^{T}\frac{h^{\prime}(u)}{|c^{\prime}(u)|}$
$\displaystyle
s_{12}(\omega(0,u))=\frac{1}{2}\frac{n(\omega(0,u))^{T}h^{\prime}(u)}{|c^{\prime}(u)|}$

which finally leads to:

$\lim_{\delta\rightarrow
0}\frac{1}{\delta}E(v)=\int_{I}\left[u_{1,1}(D_{s}h^{\top})^{2}+\frac{u_{12,12}}{4}(D_{s}h^{\bot})^{2}\right]ds$

In summary, we have shown that the expression of the Riemannian metric
$G^{a,b}(h,h)$ of (2) is obtained as the limit of the elastic energy of an
orthotropic laminar thin shell domain as the thickness $\delta\rightarrow 0$,
in which $a^{2}=u_{11}$ and $b^{2}=u_{12,12}/4$ can be interpreted as
stretching and bending energy coefficients respectively.

######  Remark A.1.

In the special case of an isotropic elastic domain $\Omega$ (still with
respect to the frame vectors $\tau(x)$ and $n(x)$), the elastic tensor takes
the particular form:

$U=\begin{pmatrix}2\mu+\lambda&\lambda&0\\\ \lambda&2\mu+\lambda&0\\\
0&0&2\mu\end{pmatrix}.$

in which $\lambda,\mu\geq 0$ are the so called Lamé coefficients of the
material. This leads to $G^{a,b}$ metric for which $a^{2}=2\mu+\lambda$ and
$b^{2}=\mu/2$ i.e.

$\frac{b}{a}=\frac{1}{2}\sqrt{\frac{2\mu}{2\mu+\lambda}}\leq\frac{1}{2}.$

It is thus interesting to note that this stronger isotropy assumption on the
elastic domain imposes the constraint that $b\leq a/2$, the limiting case
$b=a/2$ corresponding precisely to the square root velocity (SRV) metric of
[41].

######  Remark A.2.

The previous derivations can be extended to curves in higher dimensions
relatively easily. In the case of a 3D curve for example, one can introduce a
tubular neighborhood of small radius $\delta$ around that curve that is again
deformed by a vector field uniform in the transverse direction. Then, assuming
a material with transversely isotropic elastic properties, one can show that,
as $\delta$ goes to $0$, the resulting elastic energy is again given by (2).

##  Appendix B Proof of Theorem 2.1 and Corollary 2.1

To derive the formula for geodesic distance (10), we will first prove a lemma
on distances in the finite-dimensional space
$(\operatorname{\mathbb{R}}^{d}\setminus\\{0\\},g^{\lambda})$. Clearly
$\mathbb{R}^{d}\setminus\\{0\\}$ is incomplete with respect to $g^{\lambda}$
for any $\lambda>0$. We can complete it as a metric space by reinserting the
origin. Let $\operatorname{\mathbb{R}}^{d}_{\lambda}$ denote the metric space
that is the completion with respect to the $g^{\lambda}$ metric. Note that, as
a point set, $\operatorname{\mathbb{R}}^{d}_{\lambda}$ is just
$\operatorname{\mathbb{R}}^{d}$, but $\operatorname{\mathbb{R}}^{d}_{\lambda}$
is not a Riemannian manifold when $\lambda\neq 1$, as the Riemannian metric
$g^{\lambda}$ cannot be smoothly extended to the origin in this case. We
obtain the following explicit formula for the distance $d_{\lambda}$ on this
completion:

######  Lemma B.1.

For $q_{1},q_{2}\in\operatorname{\mathbb{R}}^{d}_{\lambda}$. we let

$d_{\lambda}(q_{1},q_{2})=\sqrt{|q_{1}|^{2}+|q_{2}|^{2}-2|q_{1}||q_{2}|\cos(\lambda\theta)},$
(27)

where

$\theta=\begin{cases}\operatorname{min}\left(\cos^{-1}(q_{1}\cdot
q_{2}/|q_{1}||q_{2}|),\tfrac{\pi}{\lambda}\right)&\text{ if $q_{1}$ and
$q_{2}$ are both non-zero}\\\ \tfrac{\pi}{\lambda}&\text{ if $q_{1}$ or
$q_{2}$ is zero}\end{cases}$ (28)

Then $(\operatorname{\mathbb{R}}^{d}_{\lambda},d_{\lambda})$ is the metric
completion of the Riemannian manifold
$(\mathbb{R}^{d}\setminus\\{0\\},g^{\lambda})$.

###### Proof.

First we consider the case $d=2$. Without loss of generality, assume that
$q_{1}=(h,0)$ and $q_{2}=(k\cos\theta,k\sin\theta)$, where $h,k>0$ and
$0\leq\theta\leq\pi$. (This can easily be arranged, since reflections in the
$x$-axis and rotations about the origin are isometries of
$\operatorname{\mathbb{R}}^{2}_{\lambda}$.) Define the sector
$V_{\theta}\subset\operatorname{\mathbb{R}}^{n}_{\lambda}$ by
$V_{\theta}=\\{(r\cos\alpha,r\sin\alpha):0\leq\alpha\leq\theta\mbox{ and
}r\geq 0\\}$. Define a function $F:V_{\theta}\to\operatorname{\mathbb{R}}^{2}$
by

$F(r\cos\alpha,r\sin\alpha)=(r\cos\lambda\alpha,r\sin\lambda\alpha).$

We now consider the case $\lambda\theta\leq\pi$, and we show that $F$ is an
isometry from $V_{\theta}$ with metric given by the completion of the
Riemannian manifold $(\mathring{V_{\theta}},g^{\lambda})$ into
$\mathbb{R}^{2}$ with the Euclidian metric. In the following computations, we
fix a basepoint $q=(r\cos{\alpha},r\sin{\alpha})$ in the interior
$\mathring{V_{\theta}}$, and $v,w\in T_{q}\mathring{V_{\theta}}$. We can
easily see that $F\circ O_{-\alpha}=O_{-\lambda\alpha}\circ F$ where
$O_{\phi}:\operatorname{\mathbb{R}}^{2}\to\operatorname{\mathbb{R}}^{2}$ is
rotation by angle $\phi$. Therefore, as rotations are isometries for the
Euclidian metric $g^{1}$, we have

$\displaystyle g^{1}_{F(q)}(d_{q}F(v),d_{q}F(w))$
$\displaystyle=g^{1}_{O_{-\lambda\alpha}\circ
F(q)}(d_{F(q)}O_{-\lambda\alpha}\circ
d_{q}F(v),d_{F(q)}O_{-\lambda\alpha}\circ d_{q}F(w))$
$\displaystyle=g^{1}_{F\circ O_{-\alpha}(q)}(d_{O_{-\alpha}(q)}F\circ
d_{q}O_{-\alpha}(v),d_{O_{-\alpha}(q)}F\circ d_{q}O_{-\alpha}(w))$
$\displaystyle=g^{1}_{F(r,0)}(d_{(r,0)}F(\tilde{v}),d_{(r,0)}F(\tilde{w}))$

with $\tilde{v}:=d_{q}O_{-\alpha}(v)=O_{-\alpha}(v)$ and
$\tilde{w}:=d_{q}O_{-\alpha}(w)=O_{-\alpha}(w)$. We can easily compute that
$d_{(r,0)}F(\tilde{v})=(\tilde{v}^{\top},\lambda\tilde{v}^{\bot})$, and
putting this together with the calculation above yields

$\displaystyle g^{1}_{F(q)}(d_{q}F(v),d_{q}F(w))$
$\displaystyle=g^{1}_{F(r,0)}\left((\tilde{v}^{\top},\lambda\tilde{v}^{\bot}),(\tilde{w}^{\top},\lambda\tilde{w}^{\bot})\right)$
$\displaystyle=\tilde{v}^{\top}\tilde{w}^{\top}+\lambda^{2}\tilde{v}^{\bot}\tilde{w}^{\bot}$
$\displaystyle=g^{\lambda}_{(r,0)}(\tilde{v},\tilde{w})$

As $g^{\lambda}$ is invariant under rotations, we have

$g^{\lambda}_{(r,0)}(\tilde{v},\tilde{w})=g^{\lambda}_{O_{\alpha}(r,0)}(O_{\alpha}(v),O_{\alpha}(w))=g^{\lambda}_{q}(v,w)$

and it follows that $F$ is a Riemannian isometric embedding from
$(\mathring{V_{\theta}},g^{\lambda})$ into $(\mathbb{R}^{2},g^{1})$. It
extends to a metric isometric embedding from $V_{\theta}$ into
$\mathbb{R}^{2}$ by completion.

$F$ is also injective and $F(V_{\theta})$ is a convex subset of
$\operatorname{\mathbb{R}}^{2}$, so the geodesic (i.e. straight line) in
$F(V_{\theta})$ joining $F(q_{1})$ to $F(q_{2})$ remains in $F(V_{\theta})$.
Thus if we apply $F^{-1}$ to this straight line, we obtain a geodesic in
$\operatorname{\mathbb{R}}^{2}_{\lambda}$ joining $u$ to $v$. Since $F$ is an
isometry, the length of the geodesic in
$\operatorname{\mathbb{R}}^{2}_{\lambda}$ is the same as the length of the
straight line, and is given by the desired formula, as a simple application of
the law of cosines in $\operatorname{\mathbb{R}}^{2}$ shows.

In case that $\lambda\theta\geq\pi$, let
$\lambda^{\prime}=\frac{\lambda\theta}{\pi}$. We have $\lambda^{\prime}\geq
1$. We consider once again $F_{\frac{\pi}{\theta}}:V_{\theta}\rightarrow
V_{\pi}$:

$F_{\frac{\pi}{\theta}}(r\cos{\alpha},r\sin{\alpha})=(r\cos{\frac{\pi}{\theta}\alpha},r\sin{\frac{\pi}{\theta}\alpha})$

Then $F_{\frac{\pi}{\theta}}$ is an isometry from $(V_{\theta},g^{\lambda})$
to $(V_{\pi},g^{\frac{\lambda\theta}{\pi}})$, and therefore :

$\mbox{dist}_{g^{\lambda}}\left(\left(h,0\right),\left(r\cos{\theta},r\sin{\theta}\right)\right)=\mbox{dist}_{g^{\lambda^{\prime}}}\left((h,0),\left(-r,0\right)\right)$

Because $\lambda^{\prime}\geq 1$, for all $\omega\in\mathbb{R}^{2}$,
$g^{\lambda^{\prime}}(\omega,\omega)\geq|\omega^{\prime}|_{\mathrm{euc}}^{2}$,
and therefore
$\mbox{dist}_{g^{\lambda^{\prime}}}\geq\mbox{dist}_{\mathrm{euc}}$. But taking
the straight line between $(h,0)$ and $(-r,0)$, we then have
$\mbox{dist}_{g^{\lambda^{\prime}}}\left((h,0),\left(-r,0\right)\right)\leq
h+r$, and therefore
$\mbox{dist}_{g^{\lambda^{\prime}}}\left((h,0),\left(-r,0\right)\right)=h+r$.
This yields again the desired formula.

Having proved the theorem for $d=2$ it follows for general $d$, since any pair
of elements $u,v$ is contained in a totally geodesic copy of
$\operatorname{\mathbb{R}}^{2}_{\lambda}\subset\operatorname{\mathbb{R}}^{d}_{\lambda}$.
∎

###### Proof of Theorem 2.1 and Corollary 2.1..

The statement that $R$ is a diffeomorphism is clear from the definition of the
involved spaces; see also [6, 28]. It remains to show that $R$ is a Riemannian
isometry. To this end, we calculate the derivative of $R$ at
$c\in\mathcal{I}_{0}([0,1],\mathbb{R}^{d})$ in the direction $h\in
T_{c}I_{0}([0,1],\mathbb{R}^{d})$ as

$d_{c}R(h)=\frac{1}{\sqrt{|c^{\prime}|}}\left(h^{\prime}-\frac{1}{2}\left(h^{\prime}\cdot\frac{c^{\prime}}{|c^{\prime}|}\right)\frac{c^{\prime}}{|c^{\prime}|}\right).$

The component of $d_{c}R(h)$ tangential to $R(c)$ is

$\displaystyle\big{(}d_{c}R(h)\big{)}^{\top}$
$\displaystyle=\left(d_{c}R(h)\cdot\frac{c^{\prime}}{|c^{\prime}|}\right)\frac{c^{\prime}}{|c^{\prime}|}=\frac{1}{2\sqrt{|c^{\prime}|}}\left(h^{\prime}\cdot\frac{c^{\prime}}{|c^{\prime}|}\right)\frac{c^{\prime}}{|c^{\prime}|}$
$\displaystyle=\frac{\sqrt{|c^{\prime}|}}{2}\left(\frac{1}{|c^{\prime}|}h^{\prime}\cdot\frac{c^{\prime}}{|c^{\prime}|}\right)\frac{c^{\prime}}{|c^{\prime}|}=\frac{\sqrt{|c^{\prime}|}}{2}D_{s}h^{\top}.$

Similarly, the orthogonal component is given by
$\big{(}d_{c}R(h)\big{)}^{\bot}=\sqrt{|c^{\prime}|}D_{s}h^{\bot}.$ Therefore,
for $h,k\in T_{c}I_{0}([0,1],\mathbb{R}^{d})$, we have

$\displaystyle 4b^{2}G_{R(c)}^{L^{2}_{\lambda}}(d_{c}R(h),d_{c}R(k))$
$\displaystyle=4b^{2}\int_{0}^{1}\lambda^{2}|c^{\prime}|\big{(}D_{s}h^{\bot}\cdot
D_{s}k^{\bot}\big{)}+\frac{|c^{\prime}|}{4}\big{(}D_{s}h^{\top}\cdot
D_{s}k^{\top}\big{)}\;du$
$\displaystyle=\int_{0}^{1}a^{2}\big{(}D_{s}h^{\bot}\cdot
D_{s}k^{\bot}\big{)}+b^{2}\big{(}D_{s}h^{\top}\cdot
D_{s}k^{\top}\big{)}\;ds=G^{a,b}_{c}(h,k),$

where, in the last line, we use that $\lambda=\frac{a}{2b}$ and
$ds=|c^{\prime}(u)|du$. The proves that $R$ is an isometry.

It remains to derive the geodesic distance formula. To do so, we recall a
general fact about geodesics in path spaces. Let $(M,g)$ be a (finite-
dimensional) Riemannian manifold and consider the space

$\mathcal{M}:=C^{\infty}([0,1],M).$

By [7], a path in ${\mathcal{M}}$ given by $t\mapsto c_{t}$ is a length
minimizing geodesic with respect to the $L^{2}$-Riemannian metric (defined by

$G^{L^{2}}_{c}(h,k)=\int_{0}^{1}g_{c(u)}(h(u),k(u))du$

for $h,k\in T_{c}\mathcal{M}$ parameterized smooth vector fields along $c$) if
and only if for (almost all) fixed $u_{0}$, the curve given by $t\mapsto
c_{t}(u_{0})$ is a length-minimizing geodesic in $M$. Consequently, the
geodesic distance between $c_{0},c_{1}\in\mathcal{M}$ is given by

$\sqrt{\int_{0}^{1}\operatorname{dist}^{M}(c_{0}(u),c_{1}(u))^{2}du},$ (29)

where $\operatorname{dist}^{M}$ denotes geodesic distance in the finite-
dimensional manifold $M$.

We can now apply the above result with
$(M,g)=(\mathbb{R}^{d}\setminus\\{0\\},g^{\lambda})$. Let
$c_{0},c_{1}\in\mathcal{I}_{0}([0,1],\mathbb{R}^{d})$ such that the geodesic
in $(\mathbb{R}^{d},g^{\lambda})$ between $R(c_{0})(u)$ and $R(c_{1})(u)$ does
not pass through the origin for any $u\in[0,1]$. Then the formula for the
geodesic distance follows directly by the formula from Lemma B.1 and the above
considerations – note that in this case the minimum in the definition of
$\theta$ is always given by the arccos term. This proves the local formula for
the geodesic distance. To obtain the global formula one needs to smoothly
perturb any path that passes through the origin in such a way that the
perturbed path avoids the origin. It is easy to see that this is possible if
$d\geq 3$, which shows the global formula for the geodesic distance. For $d=2$
and $\lambda=1$ a counterexample, i.e., two curves where the minimizing path
can not be perturbed to avoid the origin, has been constructed in [6]. A
similar argument works for general $\lambda$ and thus the formula for the
geodesic distance is only valid locally in this case. ∎

To prove the statements on the metric completion we will first study these
completions in the space of $R$-transforms, i.e., on
$C^{\infty}(I,\mathbb{R}^{d}\setminus\\{0\\}$):

######  Lemma B.2.

For $q_{1},q_{2}\in L^{2}([0,1],\mathbb{R}^{d})$ we let

$d_{G^{L^{2}_{\lambda}}}(q_{1},q_{2})=\sqrt{\int_{0}^{1}|q_{1}(u)|^{2}+|q_{2}(u)|^{2}-2|q_{1}(u)||q_{2}(u)|\cos(\lambda\theta(u))du},$
(30)

where

$\theta(u)=\begin{cases}\operatorname{min}\left(\cos^{-1}(q_{1}(u)\cdot
q_{2}(u)/|q_{1}(u)||q_{2}(u)|),\tfrac{\pi}{\lambda}\right)&\text{ if
$q_{1}(u),q_{2}(u)\neq 0$}\\\ \tfrac{\pi}{\lambda}&\text{
otherwise.}\end{cases}$ (31)

We have the following two statements regarding the completion of the space of
smooth functions: The space
$\left(L^{2}([0,1],\mathbb{R}^{d}_{\lambda}),d_{G^{L^{2}_{\lambda}}}\right)$
is the metric completion of the geodesic completion
$C^{\infty}([0,1],\mathbb{R}^{d}_{\lambda})$. If $d\geq 3$, then
$\left(L^{2}([0,1],\mathbb{R}^{d}_{\lambda}),d_{G^{L^{2}_{\lambda}}}\right)$
is also the metric completion of
$\left(C^{\infty}([0,1],\mathbb{R}^{d}\setminus\\{0\\}),G^{L^{2}_{\lambda}}\right)$.

###### Proof.

This follows directly from the definition of the geodesic distance on
$C^{\infty}([0,1],\mathbb{R}^{d}\setminus\\{0\\})$, the proof of Theorem 2.1,
and Lemma B.1. ∎

Now corollary 2.1 follows from the results above and the formula for $R$.

##  Appendix C Proof of Theorem 3.1.

The main ingredient for the existence proof is the following result by Trouve
and Younes, concerning the existence of minimizers for a wide class of
optimization problems:

######  Theorem C.1 (Theorem 3.1 and Prop. 5.1 in [44]).

Let $f:[0,1]\times[0,1]\rightarrow\mathbb{R}_{\geq 0}$ be a bounded measurable
function that satisfies the following condition

  1. (H1)

There exists a finite family of closed segments $([a_{j},b_{j}])_{j\in J}$
such that each of them is horizontal or vertical and $f$ is continuous on
$[0,1]^{2}\backslash\bigcup_{j\in J}[a_{j},b_{j}]$

Then there exists an non-decreasing BV-function $\phi\in\mathcal{D}^{*}$ that
maximizes the functional
$\phi\mapsto\int_{D}\sqrt{\dot{\phi}}(x)f(x,\phi(x))dx$. Let $f_{s}$ be
defined by

$f_{s}(x_{0},y_{0})=\lim_{\delta\rightarrow
0}\left(\inf\left\\{f\left(x,y\right)|\left(x,y\right)\in[0,1]^{2}\backslash\bigcup_{j\in
J}[a_{j},b_{j}],|\left(x,y\right)-\left(x_{0},y_{0}\right)|<\delta\right\\}\right)$

Assume that $f_{s}$ satisfies in addition the condition:

  1. (H2)

There does not exist any nonempty open vertical or horizontal segment $]a,b[$
such that $f_{s}$ vanishes on $]a,b[$.

Then the optimizer $\phi^{*}\in\mathcal{D}^{*}$ is a strictly increasing
homeomorphism.

For the statements regarding the higher regularity case, we will in addition
need the following technical result:

######  Theorem C.2 (Theorem 3.3 in [44]).

Let $f$ be a nonnegative measurable function on $[0,1]^{2}$, and assume that
$U_{f}:\mathcal{D}^{*}\rightarrow\mathbb{R},\phi\mapsto\int_{D}\sqrt{\dot{\phi}(x)}f(x,\phi(x))dx$
reaches its maximal value at a strictly increasing continuous function
$\phi^{*}\in\mathcal{D}^{*}$. Then for any $x_{0}\in[0,1]$, if
$f(x_{0},\phi(x_{0}))>0$ and if $f$ is locally Hölder continuous, then
$\phi^{*}$ is differentiable at $x_{0}$, with strictly positive derivative,
and $\dot{\phi}^{*}$ is continuous in a neighborhood of $x_{0}$.

###### Proof of Theorem 3.1.

We start by proving the formula for the geodesic distance. Using the explicit
formula for parametrized curves that was obtained in Theorem 2.1, we can write
the geodesic distance as

$\displaystyle\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}])$
$\displaystyle=2b\sqrt{\ell_{c_{1}}+\ell_{c_{2}}-2\sup_{\gamma_{1},\gamma_{2}\in\bar{\Gamma}}\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}\tilde{f}_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u))\right)du},$
(32)

where $\tilde{f}_{a,b}:I\times I\rightarrow\mathbb{R}$ is defined by

$\tilde{f}_{a,b}(x,y)=\left\\{\begin{array}[]{cl}\sqrt{|\dot{c}_{1}(x)||\dot{c}_{2}(y)|}\cos\left(\frac{a}{2b}\cos^{-1}(\frac{\dot{c}_{1}(x)\cdot\dot{c}_{2}(y)}{|\dot{c}_{1}(x)||\dot{c}_{2}(y)|})\right)&\mbox{
if
}\frac{a}{2b}\cos^{-1}(\frac{\dot{c}_{1}(x)\cdot\dot{c}_{2}(y)}{|\dot{c}_{1}(x)||\dot{c}_{2}(y)|})\leq\pi\\\
-1&\mbox{ otherwise.}\end{array}\right.$

This formulation is, however, not convenient for us, as the function
$\tilde{f}_{a,b}$ is not non-negative and thus one cannot directly apply the
results of [44]. Thus we will first show that the the above optimization
problem does not change when we substitute $\tilde{f}_{a,b}$ by the non-
negative function $f_{a,b}$, as defined in (19). Since
$f_{a,b}=\max{(\tilde{f}_{a,b},0)}$, we have

$\displaystyle\sup_{\gamma_{1},\gamma_{2}\in\bar{\Gamma}}\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}\tilde{f}_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u))\right)du$
$\displaystyle\qquad\qquad\leq\sup_{\gamma_{1},\gamma_{2}\in\bar{\Gamma}}\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}f_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u))\right)du$

Let $\gamma_{1},\gamma_{2}\in\bar{\Gamma}$, and let $A=\\{u\in
I,\tilde{f}_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u))\right)<0\\}$ the open set
of negative parts of $\tilde{f}_{a,b}$. We can write $A$ as an at most
countable disjoint union of open intervals $A=\bigcup_{n}I_{n}$ with
$I_{n}=]u_{n}^{-},u_{n}^{+}[$. Now let us construct reparametrizations
$\tilde{\gamma}_{1},\tilde{\gamma}_{2}$ with derivatives equal to zero on $A$.
We set $\tilde{\gamma}_{1}(u)=\gamma_{1}(u)$,
$\tilde{\gamma}_{2}(u)=\gamma_{2}(u)$ for $u\in I\backslash A$ and :

$\tilde{\gamma}_{1}(u)=\begin{cases}\gamma_{1}(2u-u_{n}^{-})&\mbox{ for
}u\in]u_{n}^{-},1/2(u_{n}^{-}+u_{n}^{+})[\cr\gamma_{1}(u_{n}^{+})&\mbox{ for
}u\in]1/2(u_{n}^{-}+u_{n}^{+}),u_{n}^{+}[\end{cases}$
$\tilde{\gamma}_{2}(u)=\begin{cases}\gamma_{2}(u_{n}^{-})&\mbox{ for
}u\in]u_{n}^{-},1/2(u_{n}^{-}+u_{n}^{+})[\cr\gamma_{2}(2u-u_{n}^{+})&\mbox{
for }u\in]1/2(u_{n}^{-}+u_{n}^{+}),u_{n}^{+}[\end{cases}$

We clearly have $\tilde{\gamma}_{1},\tilde{\gamma}_{2}\in\bar{\Gamma}$ and for
$u\in I_{n}$, $\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}=0$, so

$\displaystyle\int_{I}\sqrt{\dot{\tilde{\gamma}}_{1}(u)\dot{\tilde{\gamma}}_{2}(u)}\tilde{f}_{a,b}\left(\tilde{\gamma}_{1}(u),\tilde{\gamma}_{2}(u))\right)du$
$\displaystyle=\int_{I\backslash
A}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}\tilde{f}_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u))\right)$
$\displaystyle=\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}f_{a,b}\left({\gamma}_{1}(u),{\gamma}_{2}(u))\right),$

which proves the equivalence of the two optimization problems.

Next we will prove the equivalent definition of the distance, where the
infimum is taken over one BV function in the space $\mathcal{D}^{*}$. Thus we
consider the two functionals

$\displaystyle\begin{array}[]{ccl}\mathcal{D}^{*}&\rightarrow&\mathbb{R}\\\
\phi&\mapsto&\int_{I}\sqrt{\dot{\phi}(x)}f_{a,b}(x,\phi(x))dx\end{array}$ (35)

and

$\displaystyle\begin{array}[]{ccl}\bar{\Gamma}\times\bar{\Gamma}&\rightarrow&\mathbb{R}\\\
(\gamma_{1},\gamma_{2})&\mapsto&\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}f_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u)\right)du.\end{array}$
(38)

We will show a slightly stronger statement, namely the following claim:
_Claim A: For $\phi\in\mathcal{D}^{*}$, there exist
$\gamma_{1},\gamma_{2}\in\bar{\Gamma}$, such that_

$\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}f_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u)\right)du=\int_{I}\sqrt{\dot{\phi}(x)}f_{a,b}(x,\phi(x))dx.$

_Conversely, for $\gamma_{1},\gamma_{2}\in\bar{\Gamma}$, there exists
$\phi\in\mathcal{D}^{*}$ such that_

$\int_{I}\sqrt{\dot{\phi}(x)}f_{a,b}(x,\phi(x))dx=\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}f_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u)\right)du.$

To show Claim A, let $\phi\in\mathcal{D}^{*}$ and $\mu$ the corresponding
probability measure given by 17. By Lebesgue’s decomposition theorem, we may
write
$\mu=\omega_{\phi}dx+\nu_{\phi}+\sum_{n\in\mathbb{N}}a_{n}\delta_{x_{n}}$,
where $\omega_{\phi}dx$ is the absolutely continuous part of $\mu$ with
respect to the Lebesgue measure, $\nu_{\phi}$ the singular continuous part,
and for all $n\in\mathbb{N}$, $x_{n}\in I$ and $a_{n}\geq 0$. The latter part
can be seen as the (at most countable) jumps of $\phi$ located at the points
$x_{n}$ and of amplitude $a_{n}$. We then consider the set

$C=\mbox{Graph}(\phi)\cup\bigcup_{n\in\mathbb{N}}\\{x_{n}\\}\times[\phi(x_{n}),\phi(x_{n})+a_{n}]$

Then $C$ is compact as it is clearly bounded and its closedness can be shown
from the definition using the left continuity of $\phi$. Furthermore, $C$ is
connected and $\mathcal{H}_{1}(C)<\infty$, since $\phi$ is of bounded
variation and $\sum_{n}a_{n}\leq 1<\infty$. Therefore $C$ is the image of a
rectifiable curve, that can be reparametrized as an injective, Lipschitz
continuous curve $\gamma$, cf. [13, Lemmas 3.1 and 3.12]. We write

$\displaystyle\gamma:\left\\{\begin{array}[]{ccl}[0,1]&\rightarrow&[0,1]^{2}\\\
u&\mapsto&(\gamma_{1}(u),\gamma_{2}(u))\end{array}\right.,$ (41)

where $\gamma_{1}$ and $\gamma_{2}$ are Lipschitz continuous, non-decreasing
and differentiable almost everywhere (and we will let $\dot{\gamma}_{i}(u)=0$
if $\gamma_{i}$ is not differentiable in $u$). We then calculate:

$\displaystyle\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}f_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u)\right)du$
$\displaystyle\qquad\qquad=\int_{I}\sqrt{\dot{\gamma_{1}}(u)\dot{\gamma_{2}}(u)}f_{a,b}(\gamma_{1}(u),\gamma_{2}(u))1_{\dot{\gamma_{1}}(u)>0}(u)du$
$\displaystyle\qquad\qquad=\int_{I}\dot{\gamma_{1}}(u)\sqrt{\frac{\dot{\gamma_{2}}(u)}{\dot{\gamma_{1}}(u)}}f_{a,b}(\gamma_{1}(u),\gamma_{2}(u))1_{\dot{\gamma_{1}}(u)>0}(u)du$
$\displaystyle\qquad\qquad=\int_{I}\sum_{u\in\gamma_{1}^{-1}(x)}\sqrt{\frac{\dot{\gamma_{2}}(u)}{\dot{\gamma_{1}}(u)}}f_{a,b}(\gamma_{1}(u),\gamma_{2}(u))1_{\dot{\gamma_{1}}(u)>0}(u)dx,$

where $\gamma_{1}^{-1}(x)=\\{u\in I,\gamma_{1}(u)=x\\}$ and $1_{C}$ denotes
the indicator function for condition $C$. The last equality follows from the
area formula [14, Theorem 3.2.3]. Indeed, given the assumptions on
$\gamma_{1}$, it is differentiable almost everywhere and we have by ([30],
p.103) that $\\{\gamma_{1}(u),\dot{\gamma}_{1}(u)=0\\}$ is of Lebesgue measure
zero. Thus, for almost all $x\in[0,1]$, $\gamma_{1}^{-1}(x)$ is reduced to a
single point. Then, by setting $x=\gamma_{1}(u)$, we have
$(\gamma_{1}(u),\gamma_{2}(u))=(x,\phi(x))$ with
$\phi(x)=\gamma_{2}(\gamma_{1}^{-1}(x))$.

It follows that for almost all $u$ such that $\dot{\gamma_{1}}(u)>0$, one has:

$\dot{\gamma}_{2}(u)=\frac{d}{du}(\phi\circ\gamma_{1}(u))=\dot{\phi}(\gamma_{1}(u))\dot{\gamma_{1}}(u)=\dot{\phi}(x)\dot{\gamma_{1}}(u),$

and thus $\dot{\phi}(x)=\frac{\dot{\gamma_{2}}(u)}{\dot{\gamma_{1}}(u)}$.
Going back to the original equality, this leads to

$\displaystyle\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}f_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u)\right)du$
$\displaystyle=\int_{I}\sum_{u\in\gamma_{1}^{-1}(x)}\sqrt{\frac{\dot{\gamma_{2}}(u)}{\dot{\gamma_{1}}(u)}}f_{a,b}(\gamma_{1}(u),\gamma_{2}(u))1_{\dot{\gamma_{1}}(u)>0}(u)dx$
$\displaystyle=\int_{I}\sqrt{\dot{\phi}(x)}f_{a,b}(x,\phi(x))dx,$

which proves the first direction of Claim A.

To prove the converse direction of Claim A, we let
$\gamma_{1},\gamma_{2}\in\bar{\Gamma}$, where we can choose
$\gamma_{1},\gamma_{2}$, up to a reparametrization, to be Lipschitz
continuous. We consider the generalised inverse
$\gamma_{1}^{-}\in\mathcal{D}^{*}$, and let
$\phi=\gamma_{2}\circ\gamma_{1}^{-}$. By [44, Lemma 5.8] the generalized
inverse is again an element of $\mathcal{D}^{*}$. Since $\gamma_{2}$ is
Lipschitz continuous, and since composition with Lipschitz functions keeps
$\mathcal{D}^{*}$ invariant, we have that $\phi\in\mathcal{D}^{*}$, see e.g.
[24, Theorem 4]. Now one can obtain the desired equality

$\int_{I}\sqrt{\dot{\phi}(x)}f_{a,b}(x,\phi(x))dx=\int_{I}\sqrt{\dot{\gamma}_{1}(u)\dot{\gamma}_{2}(u)}f_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u)\right)du,$

by a similar computation as above, which concludes the proof of Claim A.

Now the first statement of item 1 – $a<b$ and $c_{1},c_{2}\in
PC^{1}(I,\mathbb{R}^{d})$– follows directly from Theorem C.1: since $c_{1}$
and $c_{2}$ are assumed to be piecewise $C^{1}$, the function $f_{a,b}$ is
bounded and continuous when $\dot{c}_{1}$ and $\dot{c}_{2}$ are continuous.
For $x$ (resp. $y$) a point of discontinuity of $\dot{c}_{1}$ (resp.
$\dot{c}_{2}$), $f_{a,b}$ is not continous on the vertical segment
$\\{x\\}\times[0,1]$ (resp. the horizontal segment $[0,1]\times\\{y\\}$. Thus
$f_{a,b}$ satisfies (H1). For $a<b$ we have in addition that $f_{a,b}>c$ where
$c>0$ and thus we also have $f_{s}>c$ does not vanish. By Theorem C.1 this
implies that the minimizer exists in $\mathcal{D}^{*}$ and is a strictly
increasing homeomorphism.

It remains to prove the statements assuming additional smoothness of the
curves $c_{1}$ and $c_{2}$, namely that $\dot{c}_{i}$ are Lipschitz
continuous. Therefore we show that in this case the function $f_{a,b}$ is also
Lipschitz continuous: the application
$\theta\mapsto\cos(\frac{a}{2b}\cos^{-1}(\theta))$ is differentiable on
$]-1,1[$, and its derivative is bounded, therefore
$\theta\mapsto\cos(\frac{a}{2b}\cos^{-1}(\theta))$ is Lipschitz continuous on
$[-1,1]$. As $\dot{c}_{1}$ and $\dot{c}_{2}$ are Lipschitz continuous, the
function
$x,y\mapsto\frac{\dot{c}_{1}(x)\cdot\dot{c}_{2}(y)}{|\dot{c}_{1}(x)||\dot{c}_{2}(y)|}$
is also Lipschitz continuous. Therefore by composition, $f_{a,b}$ is Lipschitz
continuous and thus also Hölder continuous since we are working on a compact
domain. We have already shown that the minimizer $\phi$ is strictly increasing
and continuous. As $f_{a,b}$ is strictly positive everywhere we obtain by
Theorem C.2 that $\phi$ is of class $\mathcal{C}^{1}$ on all of $I$, which
concludes the proof of the second statement of point 1.

For the second item, $a\geq b$, there may exist areas where $f_{a,b}=0$, which
leads to optimizers that have jumps and are thus not continuous. To deal with
these difficulty, we will follow the same approach as in [6] and consider a
pair of generalized reparametrization functions, that might have vertical
parts but no jumps. Using Claim A we can still focus on maximizing (35) on the
space of BV functions, which allows us to use again the result of Trouvé and
Younes [44]. In particular by Theorem C.1, cf. [44, Proposition 5.1], there
exists $\phi\in\mathcal{D}^{*}$ that maximizes (35), and thus by Claim A there
exist $\gamma_{1},\gamma_{2}\in\bar{\Gamma}$ such that
$\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}])=\operatorname{dist}_{a,b}(c_{1}\circ\gamma_{1},c_{2}\circ\gamma_{2})$,
which proves the existence result in item 2.

Finally, we shall construct a counter-example when $a>b$ if the curves $c_{1}$
and $c_{2}$ are only in the space $AC(I,\mathbb{R}^{d})$. To that end, we
adapt the counter-example from [6, Section 6]. Let $0<\epsilon<\frac{1}{6}$
and define

$v_{1}(t)=\begin{pmatrix}\cos{\frac{2a\pi}{b}\epsilon t}\\\
\sin{\frac{2a\pi}{b}\epsilon t}\end{pmatrix},\quad
v_{2}=\begin{pmatrix}\cos{\frac{4a\pi}{3b}}\\\
\sin{\frac{4a\pi}{3b}}\end{pmatrix},\quad\mbox{and}\quad
v_{3}=\begin{pmatrix}\cos{\frac{4a\pi}{3b}}\\\
-\sin{\frac{4a\pi}{3b}}\end{pmatrix}.$

Then we have that $\frac{b}{2a}\cos^{-1}(\frac{v_{i}(t)\cdot
v_{j}(t)}{|v_{i}(t)||v_{j}(t)|})\geq\frac{\pi}{2}$ for each $i\neq j$, and
therefore $f_{a,b}\leq 0$ for those vectors. We define two curves
$c_{1},c_{2}\in AC(I,\mathbb{R}^{d}$) such that :

$\displaystyle\dot{c}_{1}(u)$ $\displaystyle=v_{1}(u)1_{A}(u)+v_{2}1_{B}(u)$
$\displaystyle\dot{c}_{2}(u)$ $\displaystyle=v_{1}(u)1_{A}(u)+v_{3}1_{B}(u)$

where $B\subset I$ a modified Cantor set such that $B$ is closed, nowhere
dense with $\lambda(B)=\frac{1}{2}$, and $A=I\backslash B$. Following the same
proof as in [6, section 6], we have that

$\sup_{\gamma_{1},\gamma_{2}\in\bar{\Gamma}}\int_{I}f_{a,b}\left(\gamma_{1}(u),\gamma_{2}(u)\right)dt=\lambda(A)$

and is not attained. ∎

##  Appendix D Proof of Theorem 3.2

###### Proof.

For $c_{1},c_{2}\in PC^{1}(S^{1},\mathbb{R}^{d})$ and $a,b>0$ we define the
functional

$\displaystyle F:\left\\{\begin{array}[]{ccl}S^{1}&\rightarrow&\mathbb{R}\\\
\tau&\mapsto&\inf_{\gamma_{1},\gamma_{2}\in\bar{\Gamma}}\operatorname{dist}_{a,b}(c_{1}\circ\gamma_{1},c_{2}\circ
S_{\tau}\circ\gamma_{2})\end{array}\right.$

We aim to show that $F$ is continuous, which will directly lead to the desired
conclusion. Therefore let $\epsilon>0,\tau,\tau^{\prime}\in S^{1}$. Then

$\displaystyle|F($
$\displaystyle\tau)-F(\tau^{\prime})|=\lvert\inf_{\gamma_{1},\gamma_{2}\in\bar{\Gamma}}\operatorname{dist}_{a,b}(c_{1}\circ\gamma_{1},c_{2}\circ
S_{\tau}\circ\gamma_{2})-\inf_{\gamma_{1}^{\prime},\gamma_{2}^{\prime}\in\bar{\Gamma}}\operatorname{dist}_{a,b}(c_{1}\circ\gamma_{1}^{\prime},c_{2}\circ
S_{\tau^{\prime}}\circ\gamma_{2}^{\prime})\rvert$
$\displaystyle=\lvert\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}\circ
S_{\tau}])-\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{1}],[c_{2}\circ
S_{\tau^{\prime}}])\lvert\leq\operatorname{dist}^{\mathcal{S}}_{a,b}([c_{2}\circ
S_{\tau}],[c_{2}\circ S_{\tau^{\prime}}]$
$\displaystyle\leq\inf_{\gamma,\gamma^{\prime}\in\bar{\Gamma}}\operatorname{dist}_{a,b}(c_{2}\circ
S_{\tau}\circ\gamma,c_{2}\circ
S_{\tau^{\prime}}\circ\gamma^{\prime})=\inf_{\gamma,\gamma^{\prime}\in\Gamma}\operatorname{dist}^{L^{2}_{a/(2b)}}\left(Q(c_{2}\circ
S_{\tau}\circ\gamma),Q(c_{2}\circ
S_{\tau^{\prime}}\circ\gamma^{\prime})\right)$
$\displaystyle\leq\operatorname{dist}^{L^{2}_{a/(2b)}}\left(Q(c_{2}\circ
S_{\tau}),Q(c_{2}\circ S_{\tau^{\prime}})\right).$

By definition, we have that $G^{L^{2}_{a/(2b)}}\leq\max(\frac{a}{2b},1)^{2}\
G^{L^{2}}$, therefore we can deduce that

$\operatorname{dist}^{L^{2}_{a/(2b)}}\left(Q(c_{2}\circ S_{\tau}),Q(c_{2}\circ
S_{\tau^{\prime}})\right)\leq\max{\left(\frac{a}{2b},1\right)}||Q(c_{2}\circ
S_{\tau})-Q(c_{2}\circ S_{\tau^{\prime}})\|_{L^{2}}.$

Since the space $C(I,\mathbb{R}^{d})$ is dense in $L^{2}(I,\mathbb{R}^{d})$,
we can choose $g\in C(I,\mathbb{R}^{d})$ such that
$\|Q(c_{2})-g\|_{L^{2}}\leq\epsilon/3$. By change of variable, we also have
$\|Q(c_{2})\circ S_{\tau}-g\circ S_{\tau}\|_{L^{2}}\leq\epsilon/3$ and
$\|Q(c_{2})\circ S_{\tau^{\prime}}-g\circ
S_{\tau^{\prime}}\|_{L^{2}}\leq\epsilon/3$. Since $g$ is continuous and $I$ is
compact, $g$ is also uniformly continuous by the Heine-Borel theorem. Thus we
have, for $|\tau-\tau^{\prime}|$ small enough,

$\|g\circ S_{\tau}-g\circ S_{\tau^{\prime}}\|_{L^{2}}\leq\epsilon/3$

Finally we have:

$\displaystyle\left|F(\tau)-F(\tau^{\prime})\right|$
$\displaystyle\leq\max{\left(\frac{a}{2b},1\right)}\|Q(c_{2}\circ
S_{\tau})-Q(c_{2}\circ S_{\tau^{\prime}})\|_{L^{2}}$
$\displaystyle\leq\max{\left(\frac{a}{2b},1\right)}\left(\|Q(c_{2}\circ
S_{\tau})-g\circ S_{\tau}\|_{L^{2}}\right.$
$\displaystyle\qquad\qquad\qquad+\left.\|g\circ S_{\tau}-g\circ
S_{\tau^{\prime}}\|_{L^{2}}+\|g\circ S_{\tau^{\prime}}-Q(c_{2}\circ
S_{\tau^{\prime}}\|_{L^{2}}\right)$
$\displaystyle\leq\max{\left(\frac{a}{2b},1\right)}(\epsilon/3+\epsilon/3+\epsilon/3)=\frac{a}{2b}\epsilon$

Thus we have shown that $F$ is continuous function on the compact set $S^{1}$.
Consequently there exists an optimal $\tau\in S^{1}$ such that
$F(\tau)=\inf_{S^{1}}F$. Now the remaining statement follows directly from
Theorem 3.1. ∎