1 Introduction

The concept of metric transforms can be traced back to Wilson [30], who investigated functions preserving the triangle inequality and some other properties. Similar problems were considered by Blumenthal in his paper [4], which followed shortly after this topic emerged. The theory of metric-preserving functions was developed by Borsík, Doboš and Piotrowski [5, 6, 11,12,13,14]. See also lectures on this theory by Doboš [10] and an introductory article by Corazza [9].

Recently, Petruşel et al. [26] have shown the role of such functions in metric fixed point theory. Similar research on this topic, also with emphasis on fixed point theory, was simultaneously conducted by Kirk and Shahzad [24].

A new approach to the topic was presented by Thai mathematicians, namely, Khemaratchatakumthorn, Pongsriiam, Samphavat and Termwuttipong [21,22,23, 27, 29]. They investigated these functions in order to find proper characterizations of the families preserving particular properties of quasimetrics – distance-type functions satisfying a weaker form of the triangle inequality. Although the concept of a quasimetric space was introduced as early as 1937 by Frink [20], recently, various generalizations of metric spaces are experiencing a renaissance now; see, e.g., a survey paper [1] and later articles [2, 17, 18, 32].

Part of the work which was more focused on functions preserving ultrametric-type inequalities between semimetric spaces was done by Dovgoshey [15, 16].

The purpose of this paper is to obtain characterizations of new classes of functions which preserve some properties of semimetric spaces. In particular, we get a precise characterization of functions preserving the regularity of a semimetric space in the sense of Bessenyei and Páles [3]. We then follow with a corresponding result for functions connected with semimetric spaces satisfying the relaxed polygonal inequality. Lastly, we revisit the theorem of Pongsriiam and Termwuttipong [28] in order to provide a simpler proof of their result characterizing functions, which transform metric spaces into ultrametric ones.

2 Preliminaries

We start with definitions of a semimetric space and some classes of such spaces.

Definition 1

A semimetric space is a non-empty set X equipped with a function \(d:X\times X\rightarrow [0,+\infty )\), satisfying the following conditions:

  1. (S1)

    For all \(x,y\in X\), \(d(x,y)=0\) if and only if \(x=y\);

  2. (S2)

    For all \(x,y\in X\), \(d(x,y)=d(y,x)\).

Then, the function d is called a semimetric.

Semimetric spaces tend to be very irregular and distance functions associated with them generally have poor properties. That is why some alternatives and generalizations of the triangle inequality are introduced. Below we will present some of the most important ones, starting from the strongest.

Definition 2

Let (Xd) be a semimetric space. If a function d satisfies

  1. (U)

    \(d(x,z)\leqslant \max \{d(x,y),d(y,z) \}\) for any \(x,y,z\in X\), then we call (Xd) an ultrametric space;

  2. (M)

    \( d(x,z)\leqslant d(x,y)+d(y,z)\) for all \(x,y,z\in X\), then (Xd) is a metric space;

  3. (RP)

    \(d(x_0, x_n) \leqslant K \cdot \sum _{i=1}^n d(x_{i-1},x_i)\) for any \(n\in {\mathbb {N}}\) and \(x_0,x_1,\dots , x_n\in X\) where \(K\geqslant 1\) is fixed, then we say that the space (Xd) satisfies the K-relaxed polygonal inequality;

  4. (Q)

    \(d(x,z)\leqslant K\left( d(x,y) + d(y,z) \right) \) for any \(x,y,z\in X\), where \(K\geqslant 1\) is fixed, then (Xd) is called a quasimetric space;

  5. (R)

    \(d(x,z)\leqslant \psi \left( d(x,y) + d(y,z) \right) \) for any \(x,y,z\in X\), where \(\psi :[0,+\infty )\rightarrow [0,+\infty ]\) is nondecreasing, continuous at the origin and \(\psi (0)=0\), then (Xd) is said to satisfy the Chittenden condition.

The condition (RP) was introduced by Fagin et al. [19]. In the literature, quasimetric spaces are also called b-metric spaces. All the above definitions can be found in [8, 25].

Remark 1

By [8, Theorem 3.2], the property (R) is equivalent to each of the following conditions:

  • (Chittenden [7]) there exists a function \(\psi :[0,+\infty )\rightarrow [0,+\infty ]\) such that \(\psi (0)=0\), \(\lim _{t\rightarrow 0} \psi (t) = 0\) and for any \(\varepsilon >0\) and \(x,y,z\in X\), the inequalities

    $$\begin{aligned} d(x,y)\leqslant \varepsilon \text{ and } d(y,z)\leqslant \varepsilon \text{ imply } \text{ that } d(x,z)\leqslant \psi (\varepsilon ); \end{aligned}$$
  • (Wilson [31]) for any sequences \((x_n)\), \((y_n)\) and \((z_n)\) of elements of X,

    $$\begin{aligned} d(x_n,y_n)\rightarrow 0, \text{ and } d(y_n,z_n) \rightarrow 0 \text{ implies } \text{ that } d(x_n,z_n)\rightarrow 0; \end{aligned}$$
  • (Bessenyei and Páles [3]) there exists a function \(\varPhi : [0,+\infty )^2 \rightarrow [0,+\infty ]\) such that \(\varPhi (0,0) = 0\), \(\varPhi \) is symmetric, continuous at (0, 0), nondecreasing in each of its variables and for all \(x,y,z\in X\),

    $$\begin{aligned} d(x,z)\leqslant \varPhi \left( d(x,y), d(y,z) \right) . \end{aligned}$$

In [3] a semimetric space satisfying the last condition is called regular.

We want to emphasize that the word regular in this notion is not connected to regular spaces (\(T_3\)-spaces) in topological sense, albeit semimetric spaces satisfying this axiom are metrizable (see [7, 8]), hence \(T_3\).

Having defined some extra properties of a semimetric space, we can move to the definition of properties-preserving functions. The definition below extends definitions from [21] and is heavily inspired by them.

Definition 3

Let (\(A_1\)), (\(A_2\)) be two properties of a semimetric space. We say that \(f:[0,+\infty ) \rightarrow [0,+\infty )\) is (\(A_1\))-(\(A_2\))-preserving, if for any semimetric space (Xd) satisfying the property (\(A_1\)), \(f\circ d\) is a semimetric and the space \((X,f\circ d)\) satisfies the condition (\(A_2\)).

In case when we consider functions preserving the same property (A), instead of ‘(A)-(A)-preserving’, we will write in short ‘(A)-preserving’. To acquaint the reader with the notation, consider the following example.

Example 1

If \(f(x):=\sqrt{x}\) for \(x\geqslant 0\), then f is an (M)-preserving function. Indeed, if (Xd) is a metric space, then the function \(d_f\) defined by

$$\begin{aligned} d_f(x,y):=\sqrt{d(x,y)}\quad \text {for any } x,y\in X \end{aligned}$$

is also a metric. Moreover, d and \(d_f\) induce the same topology on X.

For the purpose of the next example, we introduce another notion – (0), which refers to the lack of additional properties of a space.

Example 2

\(g:={\mathbb {1}}_{(0,+\infty )}\) is a (0)-(U)-preserving function. Indeed, consider any semimetric space (Xd). Then \((X,g\circ d)\) is an ultrametric space, since \(g\circ d = d_{disc}\), where \(d_{disc}\) is the discrete metric on X.

Now we will proceed with some known results from previous papers. Most of them consider (M)-preserving functions or those transferring (U) property to other ultrametric or metric spaces. Since most of these characterizations are similar, we will recall some definitions from [9, 21] as well as add two of our own, which will be useful later on.

Definition 4

Let \(f:[0,+\infty )\rightarrow [0,+\infty )\). We say that f is

  • Amenable  if \(f^{-1}(\{0\}) = \{0\}\);

  • Tightly bounded  if there exists \(v>0\) such that \(f(t)\in [v,2v]\) for all \(t>0\);

  • Subadditive  if for all \(s,t\in [0,+\infty )\) we have \(f(s+t)\leqslant f(s)+f(t)\);

  • Quasi-subadditive  if there exists \(K\geqslant 1\) such that for all \(s,t\in [0,+\infty )\) we have \(f(s+t)\leqslant K\cdot \left( f(s)+f(t) \right) \);

  • Weakly separated from 0  if for every \(\varepsilon >0\) we have \(\inf \left\{ f(t):t\geqslant \varepsilon \right\} >0 \);

  • Strictly separated from 0  if \(\inf \left\{ f(t):t>0 \right\} >0 \).

Remark 2

Any tightly bounded function is strictly separated from 0. Obviously, every function which is strictly separated from 0 is also weakly separated from 0. Lastly, it will be shown (see Lemma 3) that f is tightly bounded if and only if

$$\begin{aligned} f(s)\leqslant f(t)+f(u) \quad \text{ for } \text{ any } s,t,u>0. \end{aligned}$$

This implies immediately that any tightly bounded function is subadditive.

The following two inclusions between families of functions are obvious.

Lemma 1

(basic inclusions between families of properties-preserving functions) If property (\(A_2\)) implies (\(A_3\)) and f is (\(A_1\))–(\(A_2\))-preserving, then f is (\(A_1\))–(\(A_3\))-preserving as well.

If property (\(A_2\)) implies (\(A_3\)) and f is (\(A_3\))–(\(A_1\))-preserving, then f is (\(A_2\))–(\(A_1\))-preserving as well.

In the case of metric spaces, the functions which are (M)-preserving are rather well-studied. Many results on such functions can be found in papers of Borsik and Doboš [6, 10,11,12,13,14]. Here we recall two basic facts.

Theorem 1

(sufficient conditions for (M)-preservation) If one of the following is satisfied, then f is (M)-preserving.

  • f is amenable and concave;

  • f is amenable, subadditive and increasing;

  • f is amenable and tightly-bounded.

Theorem 2

(necessary condition for (M)-preservation) If f is (M)-preserving, then f is amenable and subadditive.

For more convenient presentation of inclusions between given classes of functions, we denote by \(P_{A_1, A_2}\) the class of all (\(A_1\))–(\(A_2\))-preserving functions.

Of course, \(P_{A_1}\) will denote the class of all (\(A_1\))-preserving functions.

Using this notation, we can express some other results from [21, 27] as follows:

Theorem 3

(inclusions between some classes of preserving functions) The following statements hold:

  1. (i)

    \(P_{Q,M}\subset P_{M}\);

  2. (ii)

    \(P_{M}\subset P_{Q}\);

  3. (iii)

    \(P_{Q} = P_{M,Q}\).

The inclusions (i) and (ii) are proper.

One could ask, whether similar results to Theorems 1 and 2 hold for other classes of functions and the answer to that question turns out to be positive. In particular, the following theorem was established in [27].

Theorem 4

(on (Q)-preserving functions) Assume that \(f:[0,+\infty )\rightarrow [0,+\infty )\) is amenable, quasi-subadditive and increasing. Then f is (Q)-preserving.

If, on the other hand, f is (Q)-preserving, then it is amenable and quasi-subadditive.

Finally, we recall a theorem giving a characterization of the (Q)-(M)-preserving functions, which was also obtained in [27].

Theorem 5

(on (Q)-(M)-preserving functions) Let \(f:[0,+\infty )\rightarrow [0,+\infty )\). Then f is (Q)-(M)-preserving if and only if it is amenable and tightly bounded.

One may also ask about similar results concerning other classes of functions. These have not been developed yet as these properties-preserving functions started to get increasingly popular just recently. This paper sheds some light on some classes of such functions.

3 Main results

We start with the lemma which will be a universal shortcut in proving the amenability of functions, which will follow.

Lemma 2

(on amenable functions) Let \(f:[0,+\infty ) \rightarrow [0,+\infty )\). The following statements are equivalent:

  1. (i)

    f is amenable;

  2. (ii)

    \(f\circ d\) satisfies (S1) for any semimetric space (Xd);

  3. (iii)

    \(f\circ d\) satisfies (S1) for some semimetric space (Xd) such that

    \(d\left( X^2\right) = [0,+\infty )\).

Proof

We omit an easy proof of (i)\(\implies \)(ii). Implication (ii)\(\implies \)(iii) is obvious. Now let (Xd) be as in (iii) and let \(x\in X\). By (iii), \(f\left( d(x,x) \right) =0,\) i.e., \(f(0)=0\). Assume that \(t\geqslant 0\) is such that \(f(t)=0\). Since \(d\left( X^2\right) =[0,+\infty )\), there exist \(x,y\in X\) such that \(d(x,y)=t\). Thus \(f\left( d(x,y)\right) =0\), so \(x=y\), since \(f\circ d\) satisfies (S1). Therefore f is amenable, which completes the proof of (iii)\(\implies \)(i). \(\square \)

The following theorem characterizes the family of (R)-preserving functions.

Theorem 6

(characterization of (R)-preserving functions) A function \(f:[0,+\infty )\rightarrow [0,+\infty )\) is (R)-preserving if and only if it is amenable and either it is strictly separated from 0, or both continuous at 0 and weakly separated from 0.

Proof

\(\Leftarrow \)”: Continuity at 0 combined with weak separation from 0 give us the following equivalence:

$$\begin{aligned} f(t_n)\rightarrow 0 \iff t_n\rightarrow 0 \text{ for } \text{ any } \text{ sequence } (t_n)_{n\in {\mathbb {N}}} \text{ of } \text{ non-negative } \text{ reals. } \end{aligned}$$
(1)

Let (Xd) be a regular semimetric space. Take three arbitrary sequences \((x_n),\)\((y_n),\)\((z_n)\) of elements of this space and assume that \(\left( f\circ d\right) (x_n,y_n)\rightarrow 0\) and \(\left( f\circ d\right) (y_n,z_n)\rightarrow 0\). Then, by (1), we obtain that \( d(x_n,y_n)\rightarrow 0\) and \(d(y_n,z_n)\rightarrow 0\). By regularity of (Xd), it follows that \(d(x_n,z_n)\rightarrow 0\). Using the other implication from (1) we get that \(\left( f\circ d\right) (x_n,z_n) \rightarrow 0\).

In the case of mappings which are strictly separated from 0, the problem is even easier, since for any sequences \((x_n)\) and \((y_n)\), \(\left( f\circ d\right) (x_n,y_n) \rightarrow 0\) implies that \(x_n = y_n\) for sufficiently large n.

\(\implies \)” Amenability follows from Lemma 2. Indeed, (iii) of Lemma 2 is fulfilled, for example for the Euclidean space \(({\mathbb {R}},d_e)\), which of course satisfies (R).

Now suppose on the contrary that f is not weakly separated from 0. Thus there exist an \(\varepsilon >0\) and \((t_n)\) such that \(t_n>\varepsilon \) for all \(n\in {\mathbb {N}}\) and \(f(t_n)\rightarrow 0\).

Consider \(X:={\mathbb {N}}\) equipped with d defined as follows: for \(x,y\in {\mathbb {N}}\),

$$\begin{aligned} d(x,y):={\left\{ \begin{array}{ll} 0,&{}\quad \text {if }x=y;\\ t_{\min \{x,y\}},&{}\quad \text {if } |x-y|=1;\\ 1,&{}\quad \text {if } |x-y|>1.\\ \end{array}\right. } \end{aligned}$$
(2)

This space is regular since it is discrete. However, \((X,f\circ d)\) is not regular. Indeed, it is enough to consider sequences \(x_n:=n,\)\(y_n:=n+1\) and \(z_n:=n+2\), since then

$$\begin{aligned} f\left( d(x_n,y_n) \right) = f(t_n) \rightarrow 0, \quad f\left( d(y_n,z_n) \right) = f(t_{n+1}) \rightarrow 0, \end{aligned}$$

but \( f\left( d(x_n,z_n) \right) = f(1)\not \rightarrow 0\). Thus f is weakly separated from 0.

Now suppose that f is neither continuous at 0 nor strictly separated from 0. This assumption together with weak separation from 0 yields the existence of two sequences \((s_n)\) and \((t_n)\) of positive real numbers, which tend to 0 as \(n\rightarrow +\infty \), and are such that \(f(s_n)\rightarrow 0\) and \(f(t_n) > \varepsilon _0\) for some \(\varepsilon _0> 0\).

Basing on these observations, we can redefine the semimetric introduced on set \(X:={\mathbb {N}}\) by (2) as follows:

$$\begin{aligned} d(x,y):={\left\{ \begin{array}{ll} 0, &{}\quad \text {if } x=y,\\ s_{\min \left\{ x,y \right\} }, &{}\quad \text {if } |x-y|=1\\ t_{\min \left\{ x,y \right\} }, &{}\quad \text {if } |x-y|>1. \end{array}\right. } \end{aligned}$$

If it is a regular space, then our claim would be true, since \((X,f\circ d)\) is not regular. Indeed, it is enough to consider the same three sequences \(x_n:=n\), \(y_n=n+1\) and \(z_n:=n+2\), since again

$$\begin{aligned} f\left( d(x_n,y_n) \right) = f(s_n) \rightarrow 0, \quad f\left( d(y_n,z_n) \right) = f(s_{n+1}) \rightarrow 0, \end{aligned}$$

but \( f\left( d(x_n,z_n) \right) = f(t_n)\not \rightarrow 0\).

So, we need to prove that (Xd) is a regular space, which turns out to be slightly less straightforward than previously.

Let \((x_n)\), \((y_n)\) and \((z_n)\) be sequences of elements of X such that \(d(x_n,y_n)\rightarrow 0\) and \(d(y_n,z_n)\rightarrow 0\). It suffices to show that for any subsequence \(\left( d\left( x_{k_n},z_{k_n}\right) \right) \) of sequence \(\left( d\left( x_n,z_n\right) \right) \), there exists a subsequence \(\left( d\left( x_{k_{m_n}},z_{k_{m_n}}\right) \right) \) convergent to 0.

Consider the subsequence \(\left( d\left( x_{k_n},z_{k_n}\right) \right) \). We have the following two cases:

\(1^\circ \). Both \(x_{k_n},z_{k_n}\rightarrow \infty \). Then the required convergence to 0 follows from the fact that

$$\begin{aligned} d\left( x_{k_n},z_{k_n} \right) \leqslant \max \left\{ s_{\min \left\{ x_{k_n},z_{k_n} \right\} }, t_{\min \left\{ x_{k_n},z_{k_n} \right\} } \right\} \rightarrow 0. \end{aligned}$$

\(2^\circ \). At least one of the sequences \((x_{k_n})\), \((z_{k_n})\) does not tend to infinity. Without loss of generality, we may assume that \(x_{k_n}\not \rightarrow \infty \). Therefore, \((x_{k_n})\) has a bounded subsequence, which yields the existence of subsequence \((x_{k_{m_n}})\) which is constant, i.e., \(x_{k_{m_n}}\equiv x_0\) for some \(x_0\in {\mathbb {N}}\).

Since \(d\left( x_{k_{m_n}},y_{k_{m_n}}\right) \rightarrow 0\), there exists \(n_1\in {\mathbb {N}}\) such that \(y_{k_{m_n}}=x_0\) for all \(n>n_1\). Analogously, \(d\left( y_{k_{m_{n+n_1}}},z_{k_{m_{n+n_1}}}\right) \rightarrow 0\), so for some \(n_2\in {\mathbb {N}}\), \( z_{k_{m_{n+n_1}}} = x_0\) for \(n>n_2\). Consequently,

$$\begin{aligned}d\left( x_{k_{m_{n+n_1+n_2}}},z_{k_{m_{n+n_1+n_2}}}\right) = d(x_0,x_0) = 0 \rightarrow 0. \end{aligned}$$

Concluding, \(d(x_n,z_n)\rightarrow 0\) which proves the regularity of (Xd). \(\square \)

Our next purpose is to give a characterization of (0)-(M)-preserving functions. We will need the following lemma on tightly bounded functions.

Lemma 3

(on tightly bounded functions) For an amenable function \(f:[0,+\infty )\rightarrow [0,+\infty )\), the following statements are equivalent:

  1. (i)

    f is tightly bounded;

  2. (ii)

    \(f(s)\leqslant f(t)+f(u)\) for any \(s,t,u>0\);

  3. (iii)

    \(f(s)\leqslant 2f(t)\) for any \(s,t>0\).

Proof

  1. (i)

    \(\implies \)(ii): Let \(v>0\) be such that \(f\left( (0,+\infty ) \right) \subset [v,2v]\). Fix \(s,t,u>0\). Then we have that

    $$\begin{aligned} f(s)\leqslant 2v = v+v \leqslant f(t)+f(u). \end{aligned}$$
  2. (ii)

    \(\implies \)(iii): It suffices to set \(u:=t\) in (ii).

  3. (iii)

    \(\implies \)(i): Set \(v:=\inf _{t>0} f(t)\). Fix \(s>0\). By (iii), \(f(t)\geqslant \frac{f(s)}{2}\) for any \(t>0\), so \(v\geqslant \frac{f(s)}{2}\). Since f is amenable, \(f(s)>0\), so \(v>0\). Moreover, \(f(s)\leqslant 2v\) for any \(s>0\), and simultaneously \(f(s)\geqslant v\) by the definition of v. Therefore, f is tightly bounded.

\(\square \)

Theorem 7

(characterization of (0)-(M)-preserving functions) Let \(f:[0,+\infty )\rightarrow [0,+\infty )\). Then f is (0)-(M)-preserving if and only if it is amenable and tightly bounded.

Proof

Let (Xd) be an arbitrary semimetric space.

\(\Leftarrow \)”: If f is amenable and tightly bounded, then due to Lemma 3, for any three distinct points \(x,y,z\in X\) we have

$$\begin{aligned} f\left( d(x,z) \right) \leqslant f\left( d(x,y) \right) + f\left( d(y,z) \right) . \end{aligned}$$

If \(x=y\ne z\) then

$$\begin{aligned} f\left( d(x,z) \right) = 0 + f\left( d(y,z) \right) = f\left( d(x,y) \right) + f\left( d(y,z) \right) . \end{aligned}$$

The rest of the cases are trivial.

\(\implies \)”: Due to Lemma 1 every (0)-(M)-preserving function is (Q)-(M)-preserving as well. By Theorem 5, any (Q)-(M)-preserving function is amenable and tightly bounded, which finishes the proof. \(\square \)

Thanks to this characterization we obtain the following

Corollary 1

The classes \(P_{Q,M}\), \(P_{R,M}\) and \(P_{0,M}\) are equal.

Proof

A simple consequence of Lemma 1 and Theorems 5 and 7. \(\square \)

Now, we will give a characterization of non-decreasing functions preserving semimetrics satisfying the relaxed polygonal inequality. We start with the following lemma involving subadditive functions.

Lemma 4

(on subadditive functions) Lef \(f:[0,+\infty ) \rightarrow [0,+\infty )\) be an arbitrary function and \(c\geqslant 1\). The following statements are equivalent:

  1. (i)

    \(f\left( \sum _{i=1}^n t_i \right) \leqslant c \sum _{i=1}^n f(t_i)\) for any \(n\in {\mathbb {N}}\) and \(t_1,\dots ,t_n\geqslant 0\);

  2. (ii)

    there exists a subadditive function \(g:[0,+\infty ) \rightarrow [0,+\infty )\) such that

    $$\begin{aligned}g(t)\leqslant f(t) \leqslant c \cdot g(t)\quad \text{ for } \text{ all } t\geqslant 0. \end{aligned}$$

Proof

We start by proving (ii)\(\implies \)(i): Fix \(n\in {\mathbb {N}}\) and \(t_1,\dots , t_n\geqslant 0\). Then, by the assumption,

$$\begin{aligned} f\left( \sum _{i=1}^n t_i \right) \leqslant c g\left( \sum _{i=1}^n t_i \right) \leqslant c \sum _{i=1}^n g\left( t_i \right) \leqslant c \sum _{i=1}^n f\left( t_i \right) . \end{aligned}$$

Therefore (i) holds. For the proof of the reverse, set

$$\begin{aligned} g(t):=\inf \left\{ \sum _{i=1}^n f(t_i) \; : \; n\in {\mathbb {N}}, t_1, \dots , t_n \geqslant 0, \sum _{i=1}^n t_i = t \right\} \quad \text { for } t\geqslant 0. \end{aligned}$$
(3)

Clearly, \(g\leqslant f\). Fix \(t\geqslant 0\), \(n\in {\mathbb {N}}\) and \(t_1,\dots , t_n\geqslant 0\) such that \(t= \sum _{i=1}^n t_i\). Then, by the assumption,

$$\begin{aligned} f(t)= f\left( \sum _{i=1}^n t_i \right) \leqslant c \sum _{i=1}^n f\left( t_i \right) ,\end{aligned}$$

so \(\frac{1}{c} f(t) \leqslant \sum _{i=1}^n f(t_i)\). From that and (3), we may infer that \(\frac{1}{c} f(t) \leqslant g(t)\). Consequently, we get that \(g\leqslant f \leqslant c\cdot g\). Now, we need to show that g is subadditive. Fix \(s,t\geqslant 0\) and \(\varepsilon >0\). By (3), there exist \(m,n\in {\mathbb {N}}\) as well as \(s_1,\dots , s_m,t_1,\dots , t_n \geqslant 0 \) such that

$$\begin{aligned} \sum _{i=1}^m s_i = s, \quad \sum _{i=1}^n t_i = t, \quad \sum _{i=1}^m f(s_i)<g(s) + \varepsilon , \quad \sum _{i=1}^n f(t_i) <g(t) + \varepsilon . \end{aligned}$$

Since \(\sum _{i=1}^m s_i + \sum _{i=1}^n t_i = s+ t\), we obtain again by definition of g that

$$\begin{aligned} g(s+t) \leqslant \sum _{i=1}^m f(s_i) + \sum _{i=1}^n f(t_i) < g(s)+g(t)+2\varepsilon . \end{aligned}$$

Thus, tending with \(\varepsilon \) to \(0^+\) we get that \(g(s+t)\leqslant g(s)+g(t)\). \(\square \)

With the help of Lemma 4, we will prove the following

Theorem 8

(characterization of nondecreasing (RP)- and (M)-(RP)-preserving functions) Let a function \(f:[0,+\infty )\rightarrow [0,+\infty )\) be nondecreasing. The following statements are equivalent:

  1. (i)

    for any semimetric space (Xd), if d satisfies the relaxed polygonal inequality, then so does \(f\circ d\) (possibly with a different constant);

  2. (ii)

    for any metric d, \(f\circ d\) satisfies the relaxed polygonal inequality;

  3. (iii)

    \(f\circ d_e\), where \(d_e\) is the Euclidean metric on \({\mathbb {R}}\), satisfies the relaxed polygonal inequality;

  4. (iv)

    there exist a constant \(c\geqslant 1 \) and a subadditive and amenable function

    \(g:[0,+\infty )\rightarrow [0,+\infty )\) such that

    $$\begin{aligned} g(t)\leqslant f(t) \leqslant c\cdot g(t) \quad \text{ for } \text{ all } t\geqslant 0. \end{aligned}$$
    (4)

Proof

Implications (i)\(\implies \)(ii) and (ii)\(\implies \)(iii) are obvious.

We move to implication (iii)\(\implies \)(iv). Fix \(n\in {\mathbb {N}}\) and \(t_1,\dots , t_n\geqslant 0\). Set \(x_0:=0\) and \(x_j:=\sum _{i=1}^j t_i\) for \(j=1,\dots , n\). By hypothesis, \(f\circ d_e\) satisfies the relaxed polygonal inequality with a constant \(c\geqslant 1\), so \(f\left( d_e (x_0,x_n) \right) \leqslant c \sum _{i=1}^n f\left( d_e(x_{i-1},x_i) \right) \), i.e.,

$$\begin{aligned} f\left( \sum _{i=1}^n t_i \right) \leqslant c \sum _{i=1}^n f(t_i). \end{aligned}$$

Now it suffices to apply Lemma 4 to get (iv).

Lastly, we prove (iv)\(\implies \)(i). Let (Xd) be any semimetric space satisfying K-relaxed polygonal inequality with some constant \(K\geqslant 1\). By (4), we may infer that f is amenable as well, which easily yields that \(f\circ d\) is a semimetric. Let \(n\in {\mathbb {N}}\) and \(t_1,\dots ,t_n \geqslant 0\). By Lemma 4, we get that

$$\begin{aligned} f\left( \sum _{i=1}^n t_i \right) \leqslant c \cdot \sum _{i=1}^n f \left( t_i \right) . \end{aligned}$$

In particular, this yields

$$\begin{aligned} f\left( nt\right) \leqslant c n f(t) \quad \text { for any } t\geqslant 0. \end{aligned}$$
(5)

Fix \(x_0,x_1,\dots ,x_n\in X\). By hypothesis,

$$\begin{aligned} d(x_0,x_n)\leqslant K\cdot \sum _{i=1}^n d \left( x_{i-1},x_i \right) \leqslant k\cdot \sum _{i=1}^n d \left( x_{i-1},x_i \right) , \end{aligned}$$

where \(k:=\lceil K \rceil \) is the smallest integer larger than or equal to K. By monotonicity of f, (4) and (5) we obtain

$$\begin{aligned} \begin{aligned} f\left( d(x_0,x_n) \right)&\leqslant f\left( k\sum _{i=1}^n d\left( x_{i-1},x_i \right) \right) \\&\leqslant ckf\left( \sum _{i=1}^n d\left( x_{i-1},x_i \right) \right) \leqslant c^2 k \sum _{i=1}^n f\left( d\left( x_{i-1},x_i \right) \right) ,\\ \end{aligned} \end{aligned}$$

so \(f\circ d\) satisfies the relaxed polygonal inequality with constant \(c^2 k\). \(\square \)

Notice that the monotonicity of f was needed only in the proof of implication (iv)\(\implies \)(i). Consequently, we have the following

Proposition 1

(necessary condition for (RP)-preservation) Let \(f:[0,+\infty )\rightarrow [0,+\infty )\) be a function such that for any semimetric d, if d satisfies the relaxed polygonal inequality, then so does \(f\circ d\). Then, there exist \(c\geqslant 1\) and a subadditive function \(g:[0,+\infty ) \rightarrow [0,+\infty )\) such that \(g\leqslant f \leqslant cg\).