## 3 Triangular Calculus
We then have  
\[f(x,z)-f(y,z)\leq\rho\big{(}f(x,y)+f(y,z)\big{)}-f(y,z)=\rho f(x,y)+(\rho-1)f( y,z)\leq\rho f(x,y)+(\rho-1)f(x,z),\]  
where the first inequality is by the approximated triangle inequality in (1), and the second inequality is by the assumption \(f(x,z)>f(y,z)\). How can we prove that a given function \(f:P^{2}\to[0,\infty)\) satisfies the condition of \(\rho\)-metric or \((\rho,\phi,\varepsilon)\)-metric? If \(f\) is some function of a metric distance, say, \(f(x)=\text{dist}^{r}(x)\) or most M-estimators functions such as \(f(x)=\min\left\{\text{dist}(x),1\right\}\), this may be easy via the following lemma. **Lemma 4** (Log-Log Lipschitz condition). : _Let \(g:[0,\infty)\to[0,\infty)\) be a monotonic nondecreasing function that satisfies the following (Log-Log Lipschitz) condition: there is \(r>0\) such that for every \(x>0\) and \(\Delta>1\) we have_  
\[g(\Delta x)\leq\Delta^{r}g(x). \tag{5}\]_Let \((P,\mathrm{dist})\) be a metric space, and \(f:P^{2}\to[0,\infty)\) be a mapping from every \(p,c\in P\) to \(f(p,c)=g(\mathrm{dist}(p,c))\). Then \((P,f)\) is a \((\rho,\phi,\varepsilon)\)-metric where_  
1. \(\rho=\max\left\{2^{r-1},1\right\}\)_,_
2. \(\phi=\left(\frac{r-1}{\varepsilon}\right)^{r-1}\) _and_ \(\varepsilon\in(0,r-1)\)_, if_ \(r>1\)_, and_
3. \(\phi=1\) _and_ \(\varepsilon=0\)_, if_ \(r\leq 1\)_._  
Proof. : We denote \(x=\mathrm{dist}(p,c)\), \(y=\mathrm{dist}(q,c)\) and \(z=\mathrm{dist}(p,q)\). (i) We need to prove that \(g(z)\leq\rho(g(x)+g(y))\). If \(y=0\) then \(q=c\), so  
\[g(z)=g(\mathrm{dist}(p,q))=g(\mathrm{dist}(p,c))=g(x), \tag{6}\]  
and Claim (i) holds for any \(\rho\geq 1\). Similarly, Claim (i) holds for \(x=0\) by symmetry. So we assume \(x,y>0\). For every \(b\in(0,1)\) we have  
\[ \begin{split} g(z)&=g(\mathrm{dist}(p,q))\\ &\leq g(\mathrm{dist}(p,c)+\mathrm{dist}(c,q))=g(x+y)=bg(x+y)+(1-b )g(x+y)\\ &=bg\left(x\cdot\frac{x+y}{x}\right)+(1-b)g\left(y\cdot\frac{x+y} {y}\right)\\ &\leqbg(x)\left(\frac{x+y}{x}\right)^{r}+(1-b)g(y)\left(\frac{x+ y}{y}\right)^{r}\\ &=(x+y)^{r}\left(\frac{bg(x)}{x^{r}}+\frac{(1-b)g(y)}{y^{r}} \right),\end{split}  \tag{8}\]  
where (7) is by the triangle inequality, and (8) is by substituting \(x\) and \(y\) respectively in (5). Substituting \(b=x^{r}/(x^{r}+y^{r})\) yields  
\[g(z)\leq(g(x)+g(y))\frac{(x+y)^{r}}{x^{r}+y^{r}}. \tag{9}\]  
We now compute the maximum of the factor \(h(x)=\frac{(x+y)^{r}}{x^{r}+y^{r}}\), whose derivative is zero when  
\[r(x+y)^{r-1}(x^{r}+y^{r})-(x+y)^{r}\cdot rx^{r-1}=0,\]  
i.e., when \(x=y\). In this case \(h(x)=2^{r-1}\). The other extremal values of \(h\) are \(x=0\) and \(x=\infty\) where \(h(x)=1\). Hence, \(\max_{x\geq 0}h(x)=2^{r-1}\) for \(r\geq 1\) and \(\max_{x\geq 0}h(x)=1\) for \(r\in(0,1)\). Plugging these bounds in (9) yields Claim (i)  
\[g(z)\leq\max\left\{2^{r-1},1\right\}(g(x)+g(y)).\]  
(ii)-(iii) We prove that \(g(x)-g(y)\leq\phi g(z)+\varepsilon g(x)\). If \(y>x\) then \(g(x)-g(y)\leq 0\leq\phi g(z)+\varepsilon g(y)\). If \(x\leq y\), we need to prove that \(g(x)-g(y)\leq\phi g(x)+\varepsilon g(x)\). If \(y=0\) then \(g(z)=g(x)\) by (6), and thus for every \(\phi\geq 1\) and \(\varepsilon>0\) we have  
\[g(x)-g(y)=g(x)=g(z)\leq\phi g(z)+\varepsilon g(y)\]  
as desired. We thus need to prove the last inequality for \(y>0\). We assume  
\[g(x)>\phi g(z), \tag{10}\]  
and \(x>y\) (so \(p\
eq q\) and thus \(z>0\)), otherwise the claim trivially holds. Let \(q=\max\left\{r,1\right\}\). Hence,  
\[g(x)=g(y\cdot x/y)\leq g(y)\cdot(x/y)^{r}\leq g(y)\cdot(x/y)^{q}\]where the first inequality is by (5) and the second is by the definition of \(q\) and the assumption \(x>y\geq 0\). Rearranging gives \(g(y)\geq g(x)\cdot(y/x)^{q}\), so  
\[g(x)-g(y)\leq g(x)\cdot(1-(y/x)^{q}). \tag{11}\]  
We now first prove that  
\[g(x)\cdot(1-(y/x)^{q})\leq cg(x)+\frac{\phi}{q^{q}}\cdot g(x)(1-(y/x)^{q})^{q}. \tag{12}\]  
Indeed, if \(q=1\) then \(r\leq 1\), \(\varepsilon=0\), \(\phi=1\) and (12) trivially holds with equality. Otherwise \((q>1)\), we let \(p=\frac{q}{q-1}\) so that  
\[