SlowGuess/NeurIPS_2023_OCR huggingface dataset:
By minimisation, all inequalities are equalities. Jensen's case of equality implies for the first inequality that both  $\mu_{+|C_i}$  and  $\mu_{-|C_i}$  are Diracs, while the second inequality implies that either  $\alpha_{i} = 0$  or  $\beta_{i} = 0$ . Overall,  $\mu_{|C_i}$  is at most a single Dirac.
Now if  $\theta_i \notin \overline{C}_i \cup \overline{-C}_i$ , assume first that  $\langle \theta_i, (x_{i+1}, 1) \rangle > 0$ . This implies  $\langle \theta_i, (x_i, 1) \rangle > 0$  since  $\theta_i \notin \overline{C}_i \cup \overline{-C}_i$ . This then implies that either  $\alpha_i \in \overset{\circ}{C}_i$  or  $\beta_i \in \overset{\circ}{C}_i$ , depending on whether  $i \geq i_0$  or  $i < i_0$ . Assume first that  $\beta_i \in \overset{\circ}{C}_i$  ( $i \geq i_0$ ) and define
$$
t = \sup  \left\{t ^ {\prime} \in [ 0, 1 ] \mid t ^ {\prime} \alpha_ {i} - \beta_ {i} \in \overline {{- C}} _ {i} \right\}.
$$
By continuity,  $t\alpha_{i} - \beta_{i}\in \overline{C}_{i}$  . Moreover  $0 <   t <   1$  , since  $\beta_{i}\in \mathring{C}_{i}$  and  $\theta_{i}\notin \overline{C}_{i}$  . We now define
$$
\tilde {\mu} = \mu - \mu_ {| C _ {i}} + (1 - t) \| \alpha_ {i} \| \delta_ {\frac {\alpha_ {i}}{\| \alpha_ {i} \|}} + \| t \alpha_ {i} - \beta_ {i} \| \delta_ {\frac {t \alpha_ {i} - \beta_ {i}}{\| t \alpha_ {i} - \beta_ {i} \|}}.
$$
The function  $f_{\bar{\mu},a,b}$  still interpolates the data. Similarly to the case  $\theta_i \in \overline{C}_i \cup \overline{-C}_i$ , the minimisation of  $\| \mu \|_{\mathrm{TV}}$  implies that  $\mu_{|C_i}$  is at most a single Dirac.
If  $\alpha_{i}\in \mathring{C}_{i}$  instead, similar arguments follow defining
$$
t = \sup  \left\{t ^ {\prime} \in [ 0, 1 ] \mid \alpha_ {i} - t ^ {\prime} \beta_ {i} \in \bar {C} _ {i} \right\}.
$$
Symmetric arguments also hold if  $\langle \theta_i,(x_{i + 1},1)\rangle < 0$ . In any case,  $\mu_{|C_i}$  is at most a single Dirac. This holds for any  $i = 1,\dots ,n - 1$ , which finally leads to Lemma 1.
Before proving Lemma 2, let us show a one to one mapping from the parameterisation given by Lemma 1 to a parameterisation given by the sequences of slopes in the points  $x_{i}$ . Let us define the
$$
\begin{array}{l} \mathcal {S} = \left\{(s _ {1}, \dots , s _ {n}) \in \mathbb {R} ^ {n} \mid \forall i = 1, \dots , i _ {0} - 2, s _ {i} \in S _ {i} (s _ {i + 1}), \right. (23) \\ \left. \left(s _ {i _ {0} - 1}, s _ {i _ {0}}\right) \in \Lambda \quad \text {a n d} \quad \forall i = i _ {0}, \dots , n - 1, s _ {i + 1} \in S _ {i} \left(s _ {i}\right) \right\} (23) \\ \end{array}
$$
$$
\begin{array}{l} \mathcal {I} = \left\{(a, b, (a _ {i}, \tau_ {i}) _ {i = 1, \dots , n - 1}) | \forall j = 1, \dots , n, a x _ {j} + b + \sum_ {i = 1} ^ {n - 1} a _ {i} (x _ {j} - \tau_ {i}) _ {+} = y _ {j}, \quad \tau_ {i _ {0} - 1} \in (x _ {i _ {0} - 1}, x _ {i _ {0}}), \right. \\ \tau_ {i} = \frac {x _ {i} + x _ {i + 1}}{2} \text {i f} a _ {i} = 0, \quad \forall i \in \{1, \dots , i _ {0} - 2 \}, \tau_ {i} \in (x _ {i}, x _ {i + 1} ] \\ \text {a n d} \quad \forall i \in \left\{i _ {0}, \dots , n - 1 \right\}, \tau_ {i} \in \left[ x _ {i}, x _ {i + 1}\right) \\ \end{array}
$$
The condition  $\tau_{i} = \frac{x_{i} + x_{i + 1}}{2}$  if  $a_{i} = 0$  in the definition of  $\mathcal{I}$  is just to avoid redundancy, as any arbitrary value of  $\tau_{i}$  would yield the same interpolating function. Lemma 6 below gives a one to one mapping between these two sets.
Lemma 6. The function
$$
\begin{array}{l l} \psi : & \mathcal {I} \to \mathcal {S} \\ & (a _ {0}, b _ {0}, (a _ {i}, \tau_ {i}) _ {i = 1, \ldots , n - 1}) \mapsto (\sum_ {j = 0} ^ {i - 1} a _ {j}) _ {i = 1, \ldots , n - 1} \end{array}
$$
is a one to one mapping. Its inverse is given by
$$
\psi^ {- 1}: \begin{array}{l} \mathcal {S} \to \mathcal {I} \\ (s _ {i}) _ {i \in [ n ]} \mapsto (a _ {0}, b _ {0}, (a _ {i}, \tau_ {i}) _ {i \in [ n - 1 ]}) \end{array}
$$
$$
a _ {0} = s _ {1}; \quad b _ {0} = y _ {1} - s _ {1} x _ {1}; \quad a _ {i} = s _ {i + 1} - s _ {i} \quad f o r a n y i \in [ n - 1 ];
$$
$$
\tau_ {i} = \left\{ \begin{array}{l l} \frac {s _ {i + 1} - \delta_ {i}}{s _ {i + 1} - s _ {i}} x _ {i + 1} + \frac {\delta_ {i} - s _ {i}}{s _ {i + 1} - s _ {i}} x _ {i} & i f s _ {i + 1} \neq s _ {i} \\ \frac {x _ {i} + x _ {i + 1}}{2} & o t h e r w i s e \end{array} \right..
$$
Proof. For  $(a_0, b_0, (a_i, \tau_i)_{i=1,\dots,n-1}) \in \mathcal{I}$ , let  $f$  be the associated interpolator:
$$
f (x) = a _ {0} x + b _ {0} + \sum_ {i = 1} ^ {n - 1} a _ {i} (x - \tau_ {i}) _ {+}
$$
and let  $(s_i)_{i\in [n]} = \psi (a_0,b_0,(a_i,\tau_i)_i)$ . Given the definition of  $\psi$ , it is straightforward to check that  $s_i$  corresponds to the left (resp. right) derivative of  $f$  at  $x_{i}\geq 0$  (resp.  $x_{i} < 0$ ). We actually have the two following inequalities linking the parameters  $(a_0,b_0,(a_i,\tau_i)_i)$  and  $(s_i)_i$  for any  $i\in [n - 1]$ :
$$
s _ {i} + a _ {i} = s _ {i + 1},
$$
$$
y _ {i} + s _ {i} \left(x _ {i + 1} - x _ {i}\right) + a _ {i} \left(x _ {i + 1} - \tau_ {i}\right) = y _ {i + 1}.
$$
The first equality comes from the (left or right) derivatives of  $f$  in  $x_{i}$ , while the second equality is due to the interpolation of the data by  $f$ . These two equalities imply that an interpolator with ReLU parameters in  $\mathcal{I}$  (i.e.,  $f$ ) can be equivalently described by its (left or right) derivatives in each  $x_{i}$ . A straightforward computation then allows to show that  $\psi$  and  $\psi^{-1}$  are well defined and indeed verify  $\psi \circ \psi^{-1} = I_S$  and  $\psi^{-1} \circ \psi = I_{\mathcal{I}}$ .
Using this bijection from  $\mathcal{I}$  to  $S$ , we can now prove Lemma 2. Note for the remaining of the proof  $\alpha = \min_{\substack{f\\ \forall i\in [n],f(x_i) = y_i}}\int_{\mathbb{R}}\sqrt{1 + x^2}\mathrm{d}|f''(x)|$ . Thanks to Lemma 1, we have the first equivalence:
$$
\alpha = \min_{(a_{0},b_{0},(a_{i},\tau_{i})_{i = 1,\ldots ,n - 1})\in \mathcal{I}}\sum_{i = 1}^{n - 1}|a_{i}|\sqrt{1 + \tau_{i}^{2}}.
$$
For any  $(a_0, b_0, (a_i, \tau_i)_{i=1,\dots,n-1}) \in \mathcal{I}$ , we can define thanks to Lemma 6  $(s_i)_i = \psi(a_0, b_0, (a_i, \tau_i)_i) \in \mathcal{S}$ . We then have  $(a_0, b_0, (a_i, \tau_i)_i) = \psi^{-1}((s_i)_i)$ . Moreover, by definition
of  $\psi^{-1}$ , we can easily check that
$$
\begin{array}{l} \vert a _ {i} \vert \sqrt {1 + \tau_ {i} ^ {2}} = \sqrt {a _ {i} ^ {2} + (a _ {i} \tau_ {i}) ^ {2}} \\ = \sqrt {\left(s _ {i + 1} - s _ {i}\right) ^ {2} + \left(\left(s _ {i + 1} - \delta_ {i}\right) x _ {i + 1} + \left(s _ {i} - \delta_ {i}\right) x _ {i}\right) ^ {2}} \\ = g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right). \tag {24} \\ \end{array}
$$
As  $\psi$  is a one-to-one mapping, we have for any function  $h$  the equivalence  $\min_{u\in \psi^{-1}(\mathcal{S})}h(u) = \min_{s\in \mathcal{S}}h(\psi^{-1}(s))$ . In particular, thanks to Equation (24):
$$
\min  _ {\left(a _ {0}, b _ {0}, \left(a _ {i}, \tau_ {i}\right) _ {i = 1, \dots , n - 1}\right) \in \mathcal {I}} \sum_ {i = 1} ^ {n - 1} \left| a _ {i} \right| \sqrt {1 + \tau_ {i} ^ {2}} = \min  _ {\left(s _ {i}\right) _ {i} \in \mathcal {S}} \sum_ {i = 1} ^ {n - 1} g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right). \tag {25}
$$
From there, define for any  $i \geq i_0$ ,
$$
d_{i}(s_{i}) = \min_{\substack{(\tilde{s})_{j}\in \mathcal{S}\\ \text{s.t.} \tilde{s}_{i} = s_{i}}}\sum_{j = i}^{n - 1}g_{j + 1}(\tilde{s}_{j + 1},\tilde{s}_{j});
$$
and for any  $i <   i_0$
$$
d_{i}(s_{i}) = \min_{\substack{(\tilde{s})_{j}\in \mathcal{S}\\ \text{s.t.} \tilde{s}_{i} = s_{i}}}\sum_{j = 1}^{i - 1}g_{j + 1}(\tilde{s}_{j + 1},\tilde{s}_{j}).
$$
Obviously, we have from Equation (25) and the definition of  $S$  that
$$
\alpha = \min  _ {\left(s _ {i _ {0} - 1}, s _ {i _ {0}}\right) \in \Lambda} g _ {i _ {0}} \left(s _ {i _ {0}}, s _ {i _ {0} - 1}\right) + d _ {i _ {0} - 1} \left(s _ {i _ {0} - 1}\right) + d _ {i _ {0}} \left(s _ {i _ {0}}\right). \tag {26}
$$
It now remains to show by induction that for any  $i$  that  $c_{i} = d_{i}$ . This is obviously the case for  $i = n$ . Let us now consider  $i \in \{i_0, \dots, n - 1\}$ . The definition of  $d_{i}$  leads to
$$
\begin{array}{l} d_{i}(s_{i}) = \min_{\substack{(\tilde{s})_{j}\in \mathcal{S}\\ \text{s.t.} \tilde{s}_{i} = s_{i}}}\sum_{j = i}^{n - 1}g_{j + 1}(\tilde{s}_{j + 1},\tilde{s}_{j}) \\ = \min_{s_{i + 1}\in S_{i}(s_{i})}\min_{\substack{(\tilde{s})_{j}\in \mathcal{S}\\ \text{s.t.}\tilde{s}_{i} = s_{i}\\ \tilde{s}_{i + 1} = s_{i + 1}}}g_{i + 1}(s_{i + 1},s_{i}) + \sum_{j = i + 1}^{n - 1}g_{j + 1}(\tilde{s}_{j + 1},\tilde{s}_{j}) \\ = \min  _ {s _ {i + 1} \in S _ {i} \left(s _ {i}\right)} g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) + \min  _ {\substack {(\tilde {s}) _ {j} \in \mathcal {S} \\ \text{s.t.} \tilde {s} _ {i} = s _ {i} \\ \tilde {s} _ {i + 1} = s _ {i + 1}}} \sum_ {j = i + 1} ^ {n - 1} g _ {j + 1} \left(\tilde {s} _ {j + 1}, \tilde {s} _ {j}\right). \tag{27} \\ \end{array}
$$
Now note that for any  $s_{i+1} \in S_i(s_i)$ , we have the equality of the sets
$$
\left\{\left(\tilde {s} _ {j}\right) _ {j \geq i + 1} \mid \left(\tilde {s}\right) _ {j \in [ n - 1 ]} \in \mathcal {S} \text {s . t .} \tilde {s} _ {i} = s _ {i} \text {a n d} \tilde {s} _ {i + 1} = s _ {i + 1} \right\} = \left\{\left(\tilde {s} _ {j}\right) _ {j \geq i + 1} \mid \left(\tilde {s}\right) _ {j \in [ n - 1 ]} \in \mathcal {S} \text {s . t .} \tilde {s} _ {i + 1} = s _ {i + 1} \right\}
$$
Since the last term in Equation (27) only depends on  $(\tilde{s}_j)_{j\geq i + 1}$ , this implies that
$$
\begin{array}{l} d_{i}(s_{i}) = \min_{s_{i + 1}\in S_{i}(s_{i})}g_{i + 1}(s_{i + 1},s_{i}) + \min_{\substack{(\tilde{s})_{j}\in \mathcal{S}\\ \text{s.t.}\tilde{s}_{i + 1} = s_{i + 1}}}\sum_{j = i + 1}^{n - 1}g_{j + 1}(\tilde{s}_{j + 1},\tilde{s}_{j}) \\ = \min  _ {s _ {i + 1} \in S _ {i} (s _ {i})} g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) + d _ {i + 1} \left(s _ {i + 1}\right). \\ \end{array}
$$
By induction, it naturally comes from the definition of  $c_{i}$  that  $c_{i} = d_{i}$  for any  $i \geq i_0$ . Symmetric arguments hold for any  $i < i_0$ , which finally gives  $c_{i} = d_{i}$  for any  $i \in [n]$ . Equation (26) then yields Lemma 2.
E Proof of Section 5
The proofs of this section are shown in the case where  $x_{1} < 0$  and  $x_{n} \geq 0$ . When all the  $x$  are positive, i.e.,  $x_{1} \geq 0$ , the adapted version of Lemma 2 would yield for  $i_{0} = 1$  the equivalence<sup>11</sup>
$$
\min_{\substack{f\\ \forall i\in [n],f(x_{i}) = y_{i}}}\int_{\mathbb{R}}\sqrt{1 + x^{2}}\mathrm{d}|f^{\prime \prime}(x)| = \min_{s_{i_{0}}\in \mathbb{R}}c_{i_{0}}(s_{i_{0}}).
$$
The proofs of Appendix E can then be easily adapted to this case (and similarly if  $x_{n} < 0$ ). Appendix E.5 at the end of the section more precisely states how to adapt them to this case.
E.1 Proof of Theorem 2
Before proving Theorem 2, Lemma 7 below provides important properties verified by the functions  $c_{i}$  defined in Equation (8).
Lemma 7. For each  $i \in \{i_0, \ldots, n-1\}$ , the function  $c_i$  is convex,  $\sqrt{1 + x_i^2}$ -Lipschitz on  $\mathbb{R}$  and minimised for  $s_i = \delta_i$ .
Moreover, on both intervals  $(-\infty ,\delta_i]$  and  $[\delta_i, + \infty)$  ..
1. either  $c_i(s_i) = \sqrt{1 + x_i^2} |s_i - \delta_i| + c_{i+1}(\delta_i)$  for all  $s_i$  in the considered interval, or  $c_i$  is strictly convex on the considered interval;
2.  $|c_i(s_i) - c_i(s_i')| \geq \frac{1 + x_i x_{i+1}}{\sqrt{1 + x_{i+1}^2}} |s_i - s_i'|$  for all  $s_i, s_i'$  in the considered interval.
Similarly, for each  $i \in \{1, \dots, i_0 - 2\}$ , the function  $c_{i+1}$  is convex,  $\sqrt{1 + x_{i+1}^2}$ -Lipschitz on  $\mathbb{R}$  and and minimised for  $s_{i+1} = \delta_i$ .
Moreover, on both intervals  $(-\infty, \delta_i]$  and  $[\delta_i, +\infty)$ :
1. either  $c_{i+1}(s_{i+1}) = \sqrt{1 + x_{i+1}^2} |s_{i+1} - \delta_i| + c_i(\delta_i)$  for all  $s_{i+1}$  in the considered interval, or  $c_{i+1}$  is strictly convex on the considered interval;
2.  $|c_{i+1}(s_{i+1}) - c_{i+1}(s_{i+1}')| \geq \frac{1 + x_i x_{i+1}}{\sqrt{1 + x_i^2}} |s_{i+1} - s_{i+1}'|$  for all  $s_{i+1}, s_{i+1}'$  in the considered interval.
Proof. For any  $i \in \{1, \dots, i_0 - 2\}$ , we prove the result by (backward) induction. Since  $c_n = 0$ , a straightforward calculation gives
$$
c _ {n - 1} (s _ {n - 1}) = \sqrt {1 + x _ {n - 1} ^ {2}} | s _ {n - 1} - \delta_ {n - 1} |,
$$
which gives the wanted properties for  $i = n - 1$ .
Now consider  $i \in \{i_0, \dots, n - 2\}$  such that  $c_{i + 1}$  verifies all the properties in the first part of Lemma 7. We first show the Lipschitz property of  $c_i$ . Let  $s_i, s_i' < \delta_i$  first. By inductive assumption, the function  $s_{i + 1} \mapsto g_{i + 1}(s_{i + 1}, s_i) + c_{i + 1}(s_{i + 1})$  reaches a minimum on  $[\delta_i, +\infty)$ . Consider  $s_{i + 1} \geq \delta_i$  such that
$$
c _ {i} \left(s _ {i}\right) = g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) + c _ {i + 1} \left(s _ {i + 1}\right).
$$
Also by minimisation,  $c_{i}(s_{i}^{\prime})\leq g_{i + 1}(s_{i + 1},s_{i}^{\prime}) + c_{i + 1}(s_{i + 1})$  . For the vectors  $u = (x_{i + 1},1)$  and  $v = (x_i,1)$  , it then holds:
$$
\begin{array}{l} c _ {i} \left(s _ {i} ^ {\prime}\right) - c _ {i} \left(s _ {i}\right) \leq g _ {i + 1} \left(s _ {i + 1}, s _ {i} ^ {\prime}\right) - g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) \\ = \| \left(s _ {i + 1} - \delta_ {i}\right) u - \left(s _ {i} ^ {\prime} - \delta_ {i}\right) v \| - \| \left(s _ {i + 1} - \delta_ {i}\right) u - \left(s _ {i} - \delta_ {i}\right) v \| \\ \leq \| (s _ {i} - s _ {i} ^ {\prime}) v \| = \sqrt {1 + x _ {i} ^ {2}} | s _ {i} - s _ {i} ^ {\prime} |. \\ \end{array}
$$
The first equality comes from the definition of  $g_{i + 1}$  as a norm and the second inequality comes from the triangle inequality. By symmetry, we showed  $|c_i(s_i') - c_i(s_i)| \leq \sqrt{1 + x_i^2} |s_i - s_i'|$  for  $s_i, s_i' < \delta_i$ .
<sup>11</sup>Note that in that case  $c_{1} \neq 0$ . Instead,  $c_{1}$  is defined through the recursion given in Equation (8).
This calculation uses the fact that both  $x_{n-1}$  and  $x_n$  are positive, which implies that the minimal  $s_n$  in the definition of  $c_{n-1}$  is  $\delta_{n-1}$ .
Note that if  $s_i = \delta_i$ , then  $s_{i+1} = \delta_i$  and we show similarly that  $c_i(s_i') - c_i(\delta_i) \leq \sqrt{1 + x_i^2} |\delta_i - s_i'|$ . Moreover,
$$
\begin{array}{l} c _ {i} \left(s _ {i} ^ {\prime}\right) - c _ {i} (\delta_ {i}) = \min  _ {s _ {i + 1} ^ {\prime} \geq \delta_ {i}} \| \left(s _ {i + 1} ^ {\prime} - \delta_ {i}\right) u - \left(s _ {i} ^ {\prime} - \delta_ {i}\right) v \| + c _ {i + 1} \left(s _ {i + 1} ^ {\prime}\right) - c _ {i + 1} (\delta_ {i}) \\ \geq \min  _ {s _ {i + 1} ^ {\prime} \geq \delta_ {i}} \| (s _ {i + 1} ^ {\prime} - \delta_ {i}) u - (s _ {i} ^ {\prime} - \delta_ {i}) v \| - \| (s _ {i + 1} ^ {\prime} - \delta_ {i}) u \| \\ \geq 0. \\ \end{array}
$$
The first inequality comes from the Lipschitz property of  $c_{i+1}$ . The second from the fact that  $(s_{i+1}' - \delta_i)u$  and  $(s_i' - \delta_i)v$  are negatively correlated, since  $x_i$  and  $x_{i+1}$  are both positive. As a consequence,  $c_i$  is  $\sqrt{1 + x_i^2}$ -Lipschitz on  $(-\infty, \delta_i]$ . Symmetrically, it is also  $\sqrt{1 + x_i^2}$ -Lipschitz on  $[\delta_i, +\infty)$ , which finally implies it is  $\sqrt{1 + x_i^2}$ -Lipschitz on  $\mathbb{R}$ . Moreover, the last calculation also shows that  $c_i$  is minimised for  $s_i = \delta_i$ .
Let us now show that  $c_{i}$  verifies the first point on  $(-\infty, \delta_{i}]$ . By continuity, we only have to show it on  $(-\infty, \delta_{i})$ . Let  $s_{i} \in (-\infty, \delta_{i})$ , we then have by definition
$$
c _ {i} \left(s _ {i}\right) = \min  _ {s _ {i + 1} \geq \delta_ {i}} g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) + c _ {i + 1} \left(s _ {i + 1}\right).
$$
If  $\delta_{i + 1}\leq \delta_i$ , note that both functions  $g_{i + 1}(\cdot ,s_i)$  and  $c_{i + 1}$  are increasing on  $[\delta_i, + \infty)^{13}$ . The minimum is thus reached for  $s_{i + 1} = \delta_{i}$  and
$$
c _ {i} (s _ {i}) = \sqrt {1 + x _ {i} ^ {2}} | s _ {i} - \delta_ {i} | + c _ {i + 1} (\delta_ {i}).
$$
If  $\delta_{i + 1} > \delta_i$ , both functions  $g_{i + 1}(\cdot ,s_i)$  and  $c_{i + 1}$  are increasing on  $[\delta_{i + 1}, + \infty)$ . As a consequence, we can then rewrite
$$
c _ {i} \left(s _ {i}\right) = \min  _ {s _ {i + 1} \in \left[ \delta_ {i}, \delta_ {i + 1} \right]} g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) + c _ {i + 1} \left(s _ {i + 1}\right). \tag {28}
$$
Assume first that  $c_{i+1}(s_{i+1}) = \sqrt{1 + x_{i+1}^2 |s_{i+1} - \delta_{i+1}|} + c_{i+2}(\delta_{i+1})$  on  $[\delta_i, \delta_{i+1}]$ . By triangle inequality, we actually have
$$
g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) \geq g _ {i + 1} \left(\delta_ {i + 1}, s _ {i}\right) - \sqrt {1 + x _ {i + 1} ^ {2}} \left| \delta_ {i + 1} - s _ {i + 1} \right|.
$$
This leads for  $s_{i + 1} \in [\delta_i, \delta_{i + 1}]$  to
$$
g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) + c _ {i + 1} \left(s _ {i + 1}\right) \geq g _ {i + 1} \left(\delta_ {i + 1}, s _ {i}\right) + c _ {i + 2} \left(\delta_ {i + 1}\right).
$$
The minimum in Equation (28) is thus reached for  $s_{i + 1} = \delta_{i + 1}$ , which finally gives for any  $s_i\leq \delta_i$
$$
c _ {i} \left(s _ {i}\right) = g _ {i + 1} \left(\delta_ {i + 1}, s _ {i}\right) + c _ {i + 2} \left(\delta_ {i + 1}\right).
$$
Since  $\delta_{i + 1} > \delta_i$ , it is easy to check that  $g_{i + 1}(\delta_{i + 1},\cdot)$  is strictly convex on  $(-\infty ,\delta_i)$  and so is  $c_{i}$ .
Let us now assume the last case, where  $c_{i+1}$  is strictly convex on  $[\delta_i, \delta_{i+1}]$ . By contradiction, assume that the first point on  $(-\infty, \delta_i]$  does not hold. Note in the following  $h(s_{i+1}, s_i) = g_{i+1}(s_{i+1}, s_i) + c_{i+1}(s_{i+1})$ . For  $s_i, s_i' < \delta_i$ , by continuity of  $h$ , let  $s_{i+1}, s_{i+1}' \in [\delta_i, \delta_{i+1}]$  be such that
$$
c _ {i} \left(s _ {i}\right) = h \left(s _ {i + 1}, s _ {i}\right) \quad \text {a n d} \quad c _ {i} \left(s _ {i} ^ {\prime}\right) = h \left(s _ {i + 1} ^ {\prime}, s _ {i} ^ {\prime}\right).
$$
For any  $t\in (0,1)$ , by convexity of  $h$ :
$$
\begin{array}{l} c _ {i} \left(t s _ {i} + (1 - t) s _ {i} ^ {\prime}\right) \leq h \left(t \left(s _ {i + 1}, s _ {i}\right) + (1 - t) \left(s _ {i + 1}, s _ {i}\right)\right) \\ \leq t h \left(s _ {i + 1}, s _ {i}\right) + (1 - t) h \left(s _ {i + 1} ^ {\prime}, s _ {i} ^ {\prime}\right) \\ = t c _ {i} \left(s _ {i}\right) + (1 - t) c _ {i} \left(s _ {i} ^ {\prime}\right). \\ \end{array}
$$
$c_{i}$  is thus convex on  $(-\infty, \delta_{i}]$ . Moreover, the case of equality corresponds to the case of equality for both  $g_{i+1}$  and  $c_{i+1}$ :
$$
\begin{array}{l} g _ {i + 1} \left(t \left(s _ {i + 1}, s _ {i}\right) + (1 - t) \left(s _ {i + 1}, s _ {i}\right)\right) = t g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) + (1 - t) g _ {i + 1} \left(s _ {i + 1} ^ {\prime}, s _ {i} ^ {\prime}\right) \\ c _ {i + 1} \left(t s _ {i + 1} + (1 - t) s _ {i + 1} ^ {\prime}\right) = t c _ {i + 1} \left(s _ {i + 1}\right) + (1 - t) c _ {i + 1} \left(s _ {i + 1} ^ {\prime}\right). \\ \end{array}
$$
The former leads to the colinearity of the vectors  $(s_{i+1} - \delta_i, s_i - \delta_i)$  and  $(s_{i+1}' - \delta_i, s_i' - \delta_i)$ ; the latter gives  $s_{i+1} = s_{i+1}'$  by strict convexity of  $c_{i+1}$ . Two cases are then possible
$$
\left\{ \begin{array}{l} \text {e i t h e r} s _ {i + 1} = \delta_ {i} = s _ {i + 1} ^ {\prime} \\ \text {o r} s _ {i} = s _ {i} ^ {\prime}. \end{array} \right.
$$
<sup>13</sup>Here again, we use the fact that  $x_{i}$  and  $x_{i+1}$  are positive.
The former case then implies that  $c_{i}(s_{i}) = \sqrt{1 + x_{i}^{2}} |s_{i} - \delta_{i}| + c_{i + 1}(\delta_{i})$ . Since  $c_{i}(\delta_{i}) = c_{i + 1}(\delta_{i})$ ,  $c_{i}$  is  $\sqrt{1 + x_{i}^{2}}$ -Lipschitz and convex on  $(-\infty, \delta_{i}]$ , this leads to  $c_{i}(s) = \sqrt{1 + x_{i}^{2}} |s - \delta_{i}| + c_{i + 1}(\delta_{i})$  for any  $s \in (-\infty, \delta_{i}]$ . This contradicts the assumption that the first point does not hold on  $(-\infty, \delta_{i}]$ . Necessarily, we have  $s_{i} = s_{i}'$ . So  $c_{i}$  is strictly convex on  $(-\infty, \delta_{i}]$ , which leads to another contradiction: the first point does hold on  $(-\infty, \delta_{i}]$ .
Finally, we just showed that in any case,  $c_{i}$  is either strictly convex or equal to  $s_{i} \mapsto \sqrt{1 + x_{i}^{2}} |s_{i} - \delta_{i}|$  on  $(-\infty, \delta_{i}]$ . Symmetric arguments yield the same on  $[\delta_{i}, +\infty)$ .  $c_{i}$  is thus minimised in  $\delta_{i}$ ,  $\sqrt{1 + x_{i}^{2}}$ . Lipschitz and verifies the first point on both intervals  $(-\infty, \delta_{i}]$  and  $[\delta_{i}, +\infty)$ . This directly implies that  $c_{i}$  is convex on  $\mathbb{R}$ .
It now remains to show the second point on the two intervals. Let us show it on  $(-\infty, \delta_i]$ : on  $(- \infty, \delta_i)$  is actually sufficient by continuity. Consider  $s_i < s_i' < \delta_i$  and  $s_{i+1} \in [\delta_i, +\infty)$  such that
By definition of  $c_{i}$
$$
c _ {i} \left(s _ {i}\right) - c _ {i} \left(s _ {i} ^ {\prime}\right) \geq g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right) - g _ {i + 1} \left(s _ {i + 1}, s _ {i} ^ {\prime}\right).
$$
Straightforward computations yield that the function
$$
h _ {2}: \begin{array}{c} (- \infty , \delta_ {i} ] \to \mathbb {R} _ {+} \\ s \mapsto g _ {i + 1} (s _ {i + 1}, s) \end{array}
$$
is convex and  $h_2^\prime (\delta_i) = -\frac{1 + x_ix_{i + 1}}{\sqrt{1 + x_i^2}_{i + 1}}$ . Thus,  $h_2^\prime \leq -\frac{1 + x_ix_{i + 1}}{\sqrt{1 + x_i^2}_{i + 1}}$ , which finally implies
$$
\begin{array}{l} c _ {i} \left(s _ {i}\right) - c _ {i} \left(s _ {i} ^ {\prime}\right) \geq h \left(s _ {i}\right) - h \left(s _ {i} ^ {\prime}\right) \\ \geq \frac {1 + x _ {i} x _ {i + 1}}{\sqrt {1 + x _ {i + 1} ^ {2}}} (s _ {i} ^ {\prime} - s _ {i}). \\ \end{array}
$$
The second point is thus verified on  $(-\infty, \delta_i)$  and on  $(-\infty, \delta_i]$  by continuity. Symmetric arguments lead to the same property on  $[\delta_i, +\infty)$ .
By induction, this implies the first part of Lemma 7. Symmetric arguments lead to the second part of Lemma 7 for  $i \leq i_0 - 2$ .
We can now prove Theorem 2. Following the proof of Lemma 2, there is a unique minimiser of Equation (4) if and only if the following problem admits a unique minimiser:
$$
\min  _ {\mathbf {s} \in \mathcal {S}} \sum_ {i = 1} ^ {n - 1} g _ {i + 1} \left(s _ {i + 1}, s _ {i}\right). \tag {29}
$$
We already know that the minimum is attained thanks to Lemma 1. By construction of the functions  $c_{i}$ , any minimum  $\tilde{\mathbf{s}}$  of Equation (29) verifies
$$
\tilde {s} _ {i} \in \underset {s _ {i} \in S _ {i} (\tilde {s} _ {i + 1})} {\operatorname {a r g m i n}} g _ {i + 1} \left(\tilde {s} _ {i + 1}, s _ {i}\right) + c _ {i} \left(s _ {i}\right) \quad \text {f o r a n y} i \in [ i _ {0} - 2 ] \tag {30}
$$
$$
\left(\tilde {s} _ {i _ {0} - 1}, \tilde {s} _ {i _ {0}}\right) \in \underset {\left(s _ {i _ {0} - 1}, s _ {i _ {0}}\right) \in \Lambda} {\operatorname {a r g m i n}} g _ {i _ {0}} \left(s _ {i _ {0}}, s _ {i _ {0} - 1}\right) + c _ {i _ {0} - 1} \left(s _ {i _ {0} - 1}\right) + c _ {i _ {0}} \left(s _ {i _ {0}}\right) \tag {31}
$$
$$
\tilde {s} _ {i + 1} \in \operatorname * {a r g m i n} _ {s _ {i + 1} \in S _ {i} (\tilde {s} _ {i})} g _ {i + 1} (s _ {i + 1}, \tilde {s} _ {i}) + c _ {i + 1} (s _ {i + 1}) \quad \text {f o r a n y} i \in \{i _ {0}, \dots , n - 1 \}
$$
It now remains to show that all these problems admit unique minimisers. First assume Equation (31) admits different minimisers  $(s_{i_0 - 1}, s_{i_0})$  and  $(s_{i_0 - 1}', s_{i_0}')$ . Note in the following  $h_{i_0 - 1} : (s, s') \mapsto g_{i_0}(s, s') + c_{i_0 - 1}(s') + c_{i_0}(s)$ . By minimisation and convexity of the three functions  $g_{i_0}, c_{i_0 - 1}, c_{i_0}$ , for any  $t \in (0, 1)$ :