1 Introduction

In most cases means are defined using explicit formulas. In fact there are only few general approaches to this topic. One of the most famous are so-called Chisini means (or level-surface means) [8] which allows to express all reflexive means in a unified form.

We provide alternative way of defining means based on the idea emerging from the theory of regular languages. Our results bind two different scopes which, to the best of author’s knowledge, were not considered earlier. Due to this fact introduction is divided into few parts which are devoted to means (Sects. 1.1 and 1.2), regular languages (Sect. 1.3), and some algorithmic approach to solving problems (Sect. 1.4).

1.1 Means and Premeans

We call \(\mathscr {M}:\bigcup _{n=1}^\infty I^n \rightarrow I\) to be a mean (or a mean on I to emphasize its domain) if \(\min (v) \le \mathscr {M}(v) \le \max (v)\) for all \(v \in \bigcup _{n=1}^\infty I^n\) (it is often called simply mean property).

It implies that \(\mathscr {M}\) is reflexive, i.e.

$$\begin{aligned} \mathscr {M}(\underbrace{x,\dots ,x}_{k\text { times}})=x\qquad (x \in I,\,k \in \mathbb {N})\,. \end{aligned}$$

Reflexive functions are used to be called premeans (see Matkowski [17]).

Sometimes we restrict a domain of \(\mathscr {M}\) to \(I^n\) for some \(n \in \mathbb {N}\) and we speak about an n-variable mean (which is formally not a mean from the point of view of the previous definition). In particular, there are many 2-variable means that have no obvious extensions to more variables, for example Cauchy or Heronian means (see [7, section VI.2] for details and more examples).

Let us also recall the notion of level surface means (see [7, section VI.4.1] and references therein). For \(F:I^n \rightarrow \mathbb {R}\) the F-level mean of the argument \(v=(v_1\dots ,v_n) \in I^n\) is the solution \(\mu \) of the equation

$$\begin{aligned} F(\mu , \ldots ,\mu ) = F(v_1 \ldots v_n), \end{aligned}$$

provided F is such that \(\mu \) is uniquely determined for all \(v \in I^n\).

Note that if F is a premean then the F-level mean equals F. Therefore every premean restricted to \(I^n\) (\(n \in \mathbb {N}\)) is a level surface mean. Due to this fact level surface means are considered as the way of thinking or the way of expressing means rather than the family. Online premeans are in the same flavour (compare Remark 3) but, contrary to the level surface means, we redefine the family of all symmetric premeans.

Now we recall few properties of premeans. We say that \(\mathscr {M}:\bigcup _{n=1}^\infty I^n \rightarrow I\) is continuous (symmetric) if for all \(n \in \mathbb {N}\) its restriction \(\mathscr {M}|_{I^n}\) is continuous (symmetric). For \(I=\mathbb {R}_+\) we can define homogeneity in the same way. A premean \(\mathscr {M}\) is called repetition invariant if, for all \(n,m\in \mathbb {N}\) and \((v_1,\dots ,v_n)\in I^n\), the following identity is satisfied

$$\begin{aligned} \mathscr {M}(\underbrace{v_1,\dots ,v_1}_{m\text {-times}},\dots ,\underbrace{v_n,\dots ,v_n}_{m\text {-times}}) =\mathscr {M}(v_1,\dots ,v_n). \end{aligned}$$

This property was introduced, in the mean setting, by Páles-Pasteczka [23].

Finally, an element \(e \in I\) is called a negligible element of \(\mathscr {M}\) if for every vector \(v=(v_1,\dots ,v_n) \in I^n\) (\(n \ge 2\)) such that \(v_s=e\) for some \(s \in \{1,\dots ,n\}\) we have \(\mathscr {M}(v)=\mathscr {M}((v_{i})_{i \in \{1,\dots ,n\}\setminus \{s\}})\). In the other words element e does not affect the value of mean unless v is a constant vector having all entries equal to e. Obviously each mean has at most one negligible element (similarly to the neutral element in a group).

1.2 Selected Families of Means

In this section we introduce four closely related families of means. First define for \(p\in \mathbb {R}\), the pth power (or Hölder) mean of the positive numbers \(v_1,\dots ,v_n\) by

$$\begin{aligned} \mathscr {P}_p(v_1,\dots ,v_n) :=\left\{ \begin{array}{ll} \Big (\dfrac{v_1^p+\cdots +v_n^p}{n}\Big )^{\frac{1}{p}} &{}\text{ if } p\ne 0, \\ \root n \of {v_1\cdots v_n}\qquad &{}\text{ if } p=0. \end{array}\right. \end{aligned}$$

Now we indroduce the family which was defined in 1920s/30s [10, 15, 16, 18]. Let \(I\subseteq \mathbb {R}\) be an interval and \(f:I\rightarrow \mathbb {R}\) be a continuous strictly monotonic function then the quasi-arithmetic mean \(\mathscr {A}^{[f]}:\bigcup _{n=1}^\infty I^{n}\rightarrow I\) is defined by

$$\begin{aligned} \mathscr {A}^{[f]}(v_1,\dots ,v_n) :=f^{-1}\bigg (\frac{f(v_1)+\cdots +f(v_n)}{n}\bigg ), \text { for }n\in \mathbb {N}\text { and }v_1,\dots ,v_n\in I. \end{aligned}$$

Upon taking f as a power function or a logarithmic function on \(I=\mathbb {R}_+\), the resulting quasi-arithmetic mean is a power mean.

Another extension of power means was proposed in 1938 by Gini [11]. For \(p,q\in \mathbb {R}\), the Gini mean \(\mathscr {G}_{p,q}\) of the variables \(v_1,\dots ,v_n>0\) is defined as follows:

$$\begin{aligned} \mathscr {G}_{p,q}(v_1,\dots ,v_n) :=\left\{ \begin{array}{ll} \left( \dfrac{v_1^p+\cdots +v_n^p}{v_1^q+\cdots +v_n^q}\right) ^{\frac{1}{p-q}} &{}\text{ if } p\ne q, \\ \exp \left( \dfrac{v_1^p\ln (x_1)+\cdots +v_n^p\ln (x_n)}{v_1^p+\cdots +v_n^p}\right) \quad &{}\text{ if } p=q. \end{array}\right. \end{aligned}$$
(1.1)

Clearly, in the particular case \(q=0\), the mean \(\mathscr {G}_{p,q}\) reduces to the pth power mean \(\mathscr {P}_p\). It is also obvious that \(\mathscr {G}_{p,q}=\mathscr {G}_{q,p}\).

A common generalization of quasi-arithmetic means and Gini means can be obtained in terms of two arbitrary real functions. These idea was realized by Bajraktarević [2, 3] in 1958. Let \(I\subseteq \mathbb {R}\) be an interval and let \(f,g:I\rightarrow \mathbb {R}\) be continuous functions such that g is positive and f/g is strictly monotone. Then we define the Bajraktarević mean \(\mathscr {B}_{f,g}:\bigcup _{n=1}^\infty I^{n}\rightarrow I\) by

$$\begin{aligned} \mathscr {B}_{f,g}(v_1,\dots ,v_n) :=\Big (\frac{f}{g}\Big )^{-1}\bigg (\frac{f(v_1)+\cdots +f(v_n)}{g(v_1)+\cdots +g(v_n)}\bigg ), \end{aligned}$$
(1.2)

for \(n\in \mathbb {N}\) and \(v_1,\dots ,v_n\in I\). One can check that \(\mathscr {B}_{f,g}\) is a mean on I. In the particular case \(g\equiv 1\), the mean \(\mathscr {B}_{f,g}\) reduces to \(\mathscr {A}^{[f]}\), that is the class of Bajraktarević means contains all quasi-arithmetic means. By putting \((f,g)=(x^p,x^q)\) or \((f,g)=(x^p \ln (x),x^p)\) we can see that Gini means are Bajraktarević means, too.

Let us emphasize that Bajraktarević means are repetition invariant and have no negligible element. Moreover, there are following properties binding these four families:

  1. i.

    power means are the only homogeneous quasi-arithmetic means (cf. [12, 19, 22]);

  2. ii.

    every quasi-arithmetic mean is a Bajraktarević mean;

  3. iii.

    Gini means are the only homogeneous Bajraktarević means [1];

  4. iv.

    means which are simultaneously quasi-arithmetic and Gini means are exactly power means.

The are three more families of means which will be of our interest—Hamy means, Symmetric polynomial means and Biplanar means (vide Sect. 4).

Finally, let us mention that the family of Bajraktarević means can be generalized to so-called quasideviation means. A bivariate function \(E :I \times I \rightarrow I\) is called a quasideviation if,

  1. (a)

    \({{\,\mathrm{sign}\,}}(E(x,y))={{\,\mathrm{sign}\,}}(x-y)\) for all \(x,y \in I\),

  2. (b)

    for all \(x\in I\), the map \(y\mapsto E(x,y)\) is continuous and,

  3. (c)

    for all \(x<y\) in I, the mapping \((x,y)\ni t\mapsto \frac{E(y,t)}{E(x,t)}\) is strictly increasing.

Following Páles [20], for the function E as above we define a quasideviation mean \(\mathscr {D}_E:\bigcup _{n=1}^\infty I^n \rightarrow I\) at a vector \(v=(v_1,\dots ,v_n) \in I^n\) as a unique zero of the mapping \(I \ni y \mapsto \sum _{i=1}^n E(v_i,y)\).

In fact Páles [20] delivered two characterizations of this family which will be presented in a subsequent propositions

Proposition 1.1

Let I be an interval. A function \(\mathscr {M}:\bigcup _{n=1}^\infty I^n \rightarrow I\) is a quasideviation mean if and only if the following conditions are satisfied

  1. (i)

    \(\mathscr {M}\) is strict, i.e. \(\min (v)\le \mathscr {M}(v)\le \max (v)\) for all \(v \in \bigcup _{n=1}^\infty I^n\) and equalities hold only for a constant vector v;

  2. (ii)

    \(\mathscr {M}\) is symmetric, i.e. all n-variable restriction \(\mathscr {M}|_{I^n}\) is a symmetric function;

  3. (iii)

    \(\mathscr {M}\) is infinitesimal, i.e.

    $$\begin{aligned} \lim _{k \rightarrow \infty } \max _{m \in \{1,\dots ,k\}} |\mathscr {M}(\underbrace{x,\dots ,x}_{m\text { times}},\underbrace{y,\dots ,y}_{k-m\text { times}})- \mathscr {M}(\underbrace{x,\dots \dots ,x}_{m-1\text { times}},\underbrace{y,\dots \dots ,y}_{k-m+1\text { times}})|=0\,; \end{aligned}$$
  4. (iv)

    for all \(k \in \mathbb {N}\) and all vectors \(v^{(1)},\dots ,v^{(k)} \in \bigcup _{n=1}^\infty I^n\),

    $$\begin{aligned} \min _{i \in \{1,\dots ,k\}} \mathscr {M}\big (v^{(i)}\big )< \mathscr {M}\big (v^{(1)},\dots ,v^{(k)}\big )< \max _{i \in \{1,\dots ,k\}} \mathscr {M}\big (v^{(i)}\big ) \end{aligned}$$

    unless all \(\mathscr {M}(v^{(i)})\)-s are equal (coma stands for a concatenation of vectors), in the latter case this inequality becomes an equality.

Proposition 1.2

Let I be an interval. A function \(\mathscr {M}:\bigcup _{n=1}^\infty I^n \rightarrow I\) is a quasideviation mean if and only if all of the following conditions are satisfied

  1. (i)

    \(\mathscr {M}\) is reflexive;

  2. (ii)

    \(\mathscr {M}\) is symmetric;

  3. (iii)

    for all \(a,a',b,b' \in I\) with \(a<b<b'<a'\) there exist \(n,m \in \mathbb {N}\) such that

    $$\begin{aligned} b< \mathscr {M}(\underbrace{a,\dots ,a}_{n\text { times}},\underbrace{a',\dots ,a'}_{m\text { times}})<b'; \end{aligned}$$
  4. (iv)

    for all \(v,w \in \bigcup _{n=1}^\infty I^n\) with \(\mathscr {M}(v) < \mathscr {M}(w)\) we have

    $$\begin{aligned} \mathscr {M}(v)<\mathscr {M}(v,w)<\mathscr {M}(w); \end{aligned}$$
  5. (v)

    for all \(v,w \in \bigcup _{n=1}^\infty I^n\) with \(\mathscr {M}(v) = \mathscr {M}(w)\) we have

    $$\begin{aligned} \mathscr {M}(v,w)=\mathscr {M}(v). \end{aligned}$$

In fact a Bajraktarević mean have a nice characterization in terms of quasideviation means. Namely Bajraktarević mean are exactly these quasideviation means which satisfies so-called linking condition (see [20]), that is for all \(v,w \in \bigcup _{n=1}^\infty I^n\) and \(u,\tilde{u} \in \bigcup _{n=0}^\infty I^n\) we have

$$\begin{aligned} \mathscr {M}(v,u) \le \mathscr {M}(v,\tilde{u}) \wedge \mathscr {M}(w,u) \le \mathscr {M}(w,\tilde{u}) \Longrightarrow \mathscr {M}(v,u,w,u) \le \mathscr {M}(v,\tilde{u},w,\tilde{u})\,. \end{aligned}$$

Let us notice that in view of Propositions 1.1 and 1.2 one can characterize Bajraktarević means in two ways using either five or six axioms, respectively.

1.3 Theory of Languages

Now we present a britef introduction the the theory of regular languages. This section is to provide necessary background for our consideration, but we are not going to refer to results contained here directly. Therefore, all notions introduced here are valid till the end of this section, as it is handy. This very elementary introduction is based on Bojańczyk [6] and Hopcroft-Motwani-Ullman [13].

Let \(\varSigma \) be a finite set called an alphabet. Let \(\varSigma ^+\) be a set of all nonempty strings having symbols in \(\varSigma \). Let \(\varepsilon \) be an empty word and \(\varSigma ^*:=\varSigma ^+ \cup \{\varepsilon \}\). Every subset \(L \subseteq \varSigma ^*\) is called a language. Next, deterministic finite-state automata consists of

  1. 1.

    A finite set of states denoted by Q;

  2. 2.

    A finite set of input symbols denoted by \(\varSigma \);

  3. 3.

    A transition function \(\delta :Q \times \varSigma \rightarrow Q\);

  4. 4.

    A start state \(q_0 \in Q\);

  5. 5.

    A set of accepting states \(F\subset Q\).

Fig. 1
figure 1

Example of deterministic finite-state automata. Input symbols \(\varSigma =\{a,b\}\), the only accepting state is \(q_F\). Corresponding language is “at least two a-s and at least two b-s”

Processing of word \(w=(w_1,w_2,\dots ,w_n)\in \varSigma ^*\) is based on iterative applying the transition function. More precisely we define a function \(q :\varSigma ^* \rightarrow Q\) by

$$\begin{aligned} q(\varepsilon ):= & {} q_0, \nonumber \\ q(w_1):= & {} \delta (q_0,w_1),\nonumber \\ q(w_1\dots w_k):= & {} \delta (q(w_1\dots w_{k-1}),w_k) \,\text { for }k >2. \end{aligned}$$
(1.3)

Define \(\mathcal {L}(A):=q^{-1}(F)=\{w \in \varSigma ^* :q(w)\in F\}\). A language \(L \subseteq \varSigma ^*\) is called regular if \(L=\mathcal {L}(A)\) for some deterministic finite-state automata \(A=(Q,\varSigma ,\delta ,q_0,F)\).

Now we present two more approaches to regular languages. First, a language L is regular if and only if there exists a finite monoid \((M,\cdot ,1)\), a function \(e :\varSigma \rightarrow M\), and a subset \(F \subset M\) such that

$$\begin{aligned} (w_1,\dots ,w_n)\in L \iff e(w_1)\cdots e(w_n) \in F \end{aligned}$$

(empty word belongs to the language if an only if \(1 \in F\)).

Third definition is much more abstract. Define a relation \(\sim \) on \(\varSigma ^*\) (so-called Myhill relation) by

$$\begin{aligned} w \sim \tilde{w} :\iff \forall _{p,q \in \varSigma ^*} \big (pwq \in L \iff p\tilde{w}q \in L \big )\,. \end{aligned}$$

Obviously \(\sim \) is an equivalence relation. Moreover it is known that L is regular if and only if \(\varSigma ^*/_\sim \) is finite. This statement remains valid if we replace \(\sim \) by one-sided Myhill relations, i.e.

$$\begin{aligned} w \sim _- \tilde{w} :\iff \forall _{p \in \varSigma ^*} \big (pw \in L \iff p\tilde{w} \in L \big )\,;\\ w \sim _+ \tilde{w} :\iff \forall _{q \in \varSigma ^*} \big (wq \in L \iff \tilde{w}q \in L \big )\,. \end{aligned}$$

Note that if L is permutation-invariant (that is \((w_1,\dots ,w_n)\in L\) if and only if \((w_{\sigma (1)}\dots ,w_{\sigma (n)})\in L\) for every permutation \(\sigma \in S_n\)) then all these relation are equal to each other. Example of an automata recognizing such a language is presented on Fig. 1. Note that every state of this automata refers to some element of the quotient set \(\{a,b\}^* /_\sim \).

1.4 Online Evaluation

In this section we intend to show the intuition beyond the idea of online processing. We keep the convention that all notations are internal within this section. Similarly to the previous section define a tuple consisting of

  1. 1.

    A set of states denoted by Q;

  2. 2.

    An interval I;

  3. 3.

    A transition function \(\delta :Q \times I \rightarrow Q\);

  4. 4.

    A start state \(q_0 \in Q\);

  5. 5.

    An evaluation function \(F :Q \rightarrow I\).

Processing of vector is based on iterative applying the transition function to obtain a function \(q :\bigcup _{n=1}^\infty I^n \rightarrow Q\) defined by (1.3). We calculate the final value using the evaluation function, i.e. the outcome of our calculations is \(F\circ q :\bigcup _{n=1}^\infty I^n \rightarrow I\) (therefore its domain and set of values coincide with the one which is characteristic for a mean).

There appear a natural question: why is this consideration so important? Assume that we are given a sequence of elements in I. There are essentially two ways of input such sequence (to the computer). The first one is to allocate memory to store all sequence (offline input). Main difficulty is that we have to know in advance (at least an upper bound to) a number of elements.Footnote 1

The second way of processing is so-called online input. In this method we have some special terminating symbol (denoted here by \(\#\)) which appears at the end of input. The algorithm process a vector as follows:

figure a

In this method data is a stream, i.e. after each element we can either add next one or evaluate the final value. Note that we need to keep in memory only a state \(q \in Q\) (similarly like in a case of automata).

We will follow this idea (with simplified structure) to evaluate premeans. This is the reason why we refer to them as online premeans.

2 Online Premeans

Let \(I \subset \mathbb {R}\) be an interval, \((Y,+)\) be a commutative semigroup, \(F :I \rightarrow Y\), and \(G :\omega F(I) \rightarrow I\) such that \(G (nF(x))=x\) for all \(n \in \mathbb {N}\) and \(x \in I\), where \(\omega F(I)\) is closure of a union of all Minkowski sums, i.e.

$$\begin{aligned} \omega F(I):={{\,\mathrm{cl}\,}}\Big ( \bigcup _{n=1}^\infty nF(I) \Big )={{\,\mathrm{cl}\,}}\Big ( \bigcup _{n=1}^\infty \underbrace{F(I)+F(I)+\dots +F(I)}_{n\text { times}}\Big ). \end{aligned}$$

Define the online premean \(\mathscr {L}_{F,G} :\bigcup _{n=1}^\infty I^n \rightarrow I\) by

$$\begin{aligned} \mathscr {L}_{F,G}(v_1,\dots ,v_n):= G \Big ( F(v_1)+\cdots +F(v_n) \Big ), \end{aligned}$$
(2.1)

where \(n \in \mathbb {N}\) and \(v_1,\dots ,v_n \in I\). A pair (FG) is called a generating pair of \(\mathscr {L}_{F,G}\), Y is called a freedom space. It is easy to verify that online premeans are reflexive and symmetric.

The intuition beyond this name is quite natural. One we have a value \(F(v_1)+\cdots +F(v_k) \in Y\) we decide whether we would like to continue adding elements (i.e. add \(F(v_{k+1})\) and so on) of to finish (that is to apply function G to this value), exactly like in OnlineEvaluation procedure. Let us also stress the analogy between this setting and the monoid approach to regular languages.

Before we begin dealing with this family let us present a simple example explaining our idea.

Example 1

(Gini means) For \(p,q \in \mathbb {R}\) define \(F:\mathbb {R}_+ \rightarrow D\) and \(G :D \rightarrow \mathbb {R}_+\) (\(D=\mathbb {R}_+^2\) for \(p \ne q\) and \(D=\mathbb {R}\times \mathbb {R}_+\) for \(p=q\)) by

$$\begin{aligned} F(x):={\left\{ \begin{array}{ll} (x^p,x^q) &{}\text { for } p \ne q, \\ (x^p\ln x,x^p) &{}\text { for } p = q, \end{array}\right. } \qquad G(x,y):={\left\{ \begin{array}{ll} \big (\frac{x}{y}\big )^{\frac{1}{p-q}} &{}\text { for } p \ne q, \\ \exp \big (\frac{x}{y}\big ) &{}\text { for } p=q. \end{array}\right. } \end{aligned}$$

Then it is easy to verify that \(\mathscr {L}_{F,G}=\mathscr {G}_{p,q}\) for all \(p,q \in \mathbb {R}\).

Now let us present few preliminary observations concerning online premeans.

Remark 1

By \(G\circ F = \mathrm {id}_I\) we obtain that F is 1-1 and G is onto.

Remark 2

Note that if \(\mathscr {L}_{F,G}\) defined by (2.1) is a premean on I then we have \(G(nF(x)) =x\) for all \(x \in I\) and \(n \in \mathbb {N}\). Therefore we do not have to verify this condition provided (2.1) defines a premean on I.

Remark 3

(Páles [21]) Let I be an interval \((Y,\oplus )\) be a free abelian semigroup generated by the elements of I. Then there is a natural 1-1 correspondence between symmetric functions \(\mathscr {M}:\bigcup _{n=1}^\infty I^n \rightarrow \mathbb {R}\) and functions \(m :Y \rightarrow I\) given by the formula

$$\begin{aligned} m(v_1 \oplus \cdots \oplus v_n):=\mathscr {M}(v_1,\dots ,v_n) \qquad (n \in \mathbb {N},\, v \in I^n). \end{aligned}$$

Then \(\mathscr {L}_{\mathrm {id},m}=\mathscr {M}\), where \(\mathrm {id}\) is a natural embedding \(I \hookrightarrow Y\). In particular every symmetric mean is an online premean. In fact a converse implication is also valid since every online premean is symmetric.

Remark 4

Similarly to languages, for a given symmetric mean \(\mathscr {M}\) we can define the corresponding Myhill-type relation \(\sim \) on \(\bigcup _{n=1}^\infty I^n\) by

$$\begin{aligned} v \sim \tilde{v} :\iff \Big ( \mathscr {M}(v)=\mathscr {M}(\tilde{v}) \text { and } \mathscr {M}(v,w)=\mathscr {M}(\tilde{v},w) \text { for all }w \in \bigcup _{n=1}^\infty I^n \Big ). \end{aligned}$$

Obviously \(\sim \) is an equivalence relation. Moreover, \(Y:=\big (\bigcup _{n=1}^\infty I^n\big ) /_{\sim }\) is the minimal freedom space for a mean \(\mathscr {M}\).

Due to Remark 4 freedom space describes an amount of information which should be extract from a sequence in order to evaluate a mean and/or add elements. The aim now is to minimize freedom space for a given premean in a constructive way (abstract construction has been already described in the remark above).

If a freedom space has some topology then the following simple proposition is very useful:

Proposition 2.1

Let Y a be topological semigroup, \(Y'\) be its subspace (which is also a semigroup), and \(\imath :Y' \hookrightarrow Y\) be the inclusion map. Let \(F :I \rightarrow Y'\) and \(G :\omega F(Y') \rightarrow I\) be two continuous functions.

Then both \(F^*:=\imath \circ F :I \rightarrow Y\) and \(G^*:=G \circ \imath ^{-1}|_{\omega (i\circ F(I))} :\omega (i\circ F(I)) \rightarrow I\) are continuous. Moreover \(\mathscr {L}_{F,G}=\mathscr {L}_{F^*,G^*}\).

The intuition beyond this proposition is very natural. Namely, if a freedom space is larger (one is embeddable into another) then we can preserve more information—finite analogue is a number of equivalence classes of Myhill relation, however for every mean \(\mathscr {M}\) on I the cardinality of its freedom space is continuum.

Consequently we shall compare complexity of means based on their freedom spaces (or minimal freedom spaces) in the different way. Indeed, in view of Proposition 2.1 one can say that a mean \(\mathscr {M}_1\) is computationally simpler than a mean \(\mathscr {M}_2\) if a freedom space of \(\mathscr {M}_1\) is continuously embeddable into a freedom space of \(\mathscr {M}_2\). However, as it was mentioned, freedom space is difficult to calculate a’priori, furthermore there are no natural topology for a given freedom space, finally this condition would be very difficult to satisfy or even verify.

Therefore instead of taking minimal freedom spaces we will consider a sort of reference order. Namely we assume that either \(Y=\mathbb {R}^k\) or \(Y=\mathbb {R}^k \times \mathbb {Z}\) (\(k \in \mathbb {N}\)) and claim that both F and G are continuous.

2.1 Types of Premeans

A mean \(\mathscr {M}\) is of type \(\mathcal {E}_{k}\) (\(k\in \mathbb {N}\)) if \(\mathscr {M}=\mathscr {L}_{F,G}\) for some continuous functions \(F :I \rightarrow (\mathbb {R}^k,+)\) and \(G :\omega F(I) \rightarrow I\).

Analogously, if it is true with \(F :I \rightarrow (\mathbb {R}^k \times \mathbb {Z},+)\) then we say that \(\mathscr {M}\) is of type \(\mathcal {E}_{k}^+\) (\(k \in \mathbb {N}\)). In this case as F is continuous, it is constant on the last entry. Thus we can assume without loss of generality that it equals one on this coordinate (it is also the reason why there is no point to put more than one integer entry). Due to this fact, such a coordinate is called a counter.

In fact we slightly abuse these notions and denote by \(\mathcal {E}_{k}\) and \(\mathcal {E}_{k}^+\) classes of all means of this type (defined on any interval).

Observe that for all \(k \in \mathbb {N}\) there exist a natural continuous embeddings \((\mathbb {R}^k,+) \hookrightarrow (\mathbb {R}^k \times \mathbb {Z},+) \hookrightarrow (\mathbb {R}^{k+1},+)\). Thus in view of Proposition 2.1 we obtain a series of inclusions

$$\begin{aligned} \mathcal {E}_{1} \subseteq \mathcal {E}_{1}^+ \subseteq \mathcal {E}_{2} \subseteq \mathcal {E}_{2}^+ \subseteq \dots \end{aligned}$$
(2.2)

The remaining part of paper goes twofold. First, we characterize means of types \(\mathcal {E}_{1}\), \(\mathcal {E}_{1}^+\), and repetition invariant \(\mathcal {E}_{2}\) means without negligible elements—we obtain empty set, quasi-arithmetic means, and Bajraktarević means, respectively. Later, applying generalized symmetric polynomials, we show some examples of means of higher-order types.

To conclude this section let us stress that there are means which are not of any of these types.

Remark 5

For a (lower- or upper-) median, two vectors are in (Myhill-type) relation if an only if one is a permutation of another.

Proof of this statement is straightforward and therefore omitted.

3 Means of Low Types

3.1 Means of Type \(\mathcal {E}_{1}\) and \(\mathcal {E}_{1}^+\)

We begin our consideration with first two classes in a hierarchy mentioned in (2.2). These are the only two classes which reduce to well-known families (empty set and quasi-arithmetic means, respectively). These result are proved in the subsequent propositions.

Proposition 3.1

There are no means of type \(\mathcal {E}_{1}\).

Proof

Assume that \(\mathscr {M}\) is a mean of type \(\mathcal {E}_{1}\). Then there exists continuous functions \(F :I \rightarrow \mathbb {R}\) and \(G :\omega F(I) \rightarrow I\) such that \(\mathscr {M}\) is of the form (2.1). As F is continuous we obtain that it is strictly monotone and therefore invertible. Thus there exist \(x_1,x_2 \in I\) with \(x_1\ne x_2\) such that \(F(x_1)\) and \(F(x_2)\) are both nonzero, have the same sign, and \(\tfrac{F(x_1)}{F(x_2)}\) is a rational number, i.e. \(\tfrac{F(x_1)}{F(x_2)}=\tfrac{p}{q}\) for some \(p,q \in \mathbb {N}_+\). Then \(qF(x_1)=pF(x_2)\) and, consequently,

$$\begin{aligned} x_1 =\mathscr {L}_{F,G}(\underbrace{x_1,\dots ,x_1}_{q \text { times}}) =G(qF(x_1)) =G(pF(x_2)) =\mathscr {L}_{F,G}(\underbrace{x_2,\dots ,x_2}_{p \text { times}}) =x_2 \end{aligned}$$

contradicting the assumption. \(\square \)

Proposition 3.2

Means of type \(\mathcal {E}_{1}^+\) are precisely the quasi-arithmetic means.

Proof

To verify that every quasi-arithmetic mean is of type \(\mathcal {E}_{1}^+\) take any interval I and continuous, strictly monotone function \(f :I \rightarrow \mathbb {R}\). Define \(F(x)=(f(x),1)\) and \(G(y,n):=f^{-1}(y/n)\). For \(n \in \mathbb {N}\) and \((v_1,\dots ,v_n)\in I^n\) we get

$$\begin{aligned} \mathscr {L}_{F,G}(v_1,\dots ,v_n)= & {} G\Big (\sum _{i=1}^n F(v_i)\Big ) =G\Big (\sum _{i=1}^n (f(v_i),1)\Big ) =G\Big (\sum _{i=1}^nf(v_i),n\Big )\\= & {} f^{-1}\Big (\tfrac{1}{n}\sum _{i=1}^nf(v_i)\Big ) =\mathscr {A}^{[f]}(v_1,\dots ,v_n). \end{aligned}$$

Thus \(\mathscr {L}_{F,G}=\mathscr {A}^{[f]}\) which implies that \(\mathscr {A}^{[f]}\) is of type \(\mathcal {E}_{1}^+\).

We are now going to prove that every mean of type \(\mathcal {E}_{1}^+\) is a quasi-arithmetic mean. Take a single variable, continuous function \(f :I \rightarrow \mathbb {R}\) such that \(F(x)=(f(x),1)\). In view of Remark  1 we obtain that f is 1-1 and, as it is also continuous, strictly monotone.

Moreover, in view of reflexivity of \(\mathscr {L}_{F,G}\), we have

$$\begin{aligned} x =\mathscr {L}_{F,G}(x,\dots ,x)=G(nF(x))=G(nf(x),n) \qquad (x \in I,\, n \in \mathbb {N}). \end{aligned}$$

In particular, upon putting \(x:=f^{-1}(y/n)\) for \(n \in \mathbb {N}\) and \(y \in \{nu :u \in f(I)\}\), we obtain

$$\begin{aligned} G(y,n)=f^{-1}(y/n) \qquad (y \in \{nu :u \in f(I)\},\, n \in \mathbb {N}). \end{aligned}$$

As f is continuous and strictly monotone we have \(\{nu :u \in f(I)\}=n f(I)\). Repeating the same argumentation as in the previous implication we obtain \(\mathscr {L}_{F,G}=\mathscr {A}^{[f]}\). \(\square \)

3.2 Means of Type \(\mathcal {E}_{2}\)

This section consists of a single statement which characterizes Bajraktarević means. Next in two examples we show that its assumptions cannot be omitted.

In fact this statement was our motivation to write this paper. It turns out that we can characterize Bajraktarević mean using their complexity and very natural axioms. Its long and technical proof is shifted to the last section.

Theorem 3.1

Repetition invariant means of type \(\mathcal {E}_{2}\) without negligible element are precisely Bajraktarević means.

In fact this theorem is somehow related to Propositions 1.1 and 1.2 as in view of this theorem the following statements are easy to verify

Proposition 3.3

The following statements remains valid:

  1. A.

    Each of conditions: (i), (iii), (iv) in Proposition 1.1, and (iii), (iv) in Proposition 1.2 implies that a mean has no negligible element.

  2. B.

    Each of conditions: (iv) in Proposition 1.1, and (v) in Proposition 1.2 implies that a mean is repetition invariant.

In fact this proposition gives us (in total) five choices of axioms to guarantee that both assumptions in Theorem 3.1 are simultaneously valid (obviously none of them implies directly that a mean is \(\mathcal {E}_{2}\)).

In the following two examples we show that repetition invariance and having no negligible element in the theorem above is unavoidable, respectively.

Example 2

Let \(F :[3,4] \rightarrow \mathbb {R}^2\) and \(G :\mathbb {R}_+^2 \rightarrow \mathbb {R}\) be given by \(F(x):=(x^2,x)\) and \(G(r,s)=r/s\), respectively.

Then we obtain, for all \(n \in \mathbb {N}\) and \(v \in [3,4]^n\),

$$\begin{aligned} \mathscr {L}_{F,G}(v_1,\dots ,v_n)= & {} G(\sum _{i=1}^n F(v_i))=G(\sum _{i=1}^nv_i^2,\sum _{i=1}^nv_i)\\= & {} \frac{\sum _{i=1}^nv_i^2}{\sum _{i=1}^nv_i}=\mathscr {G}_{2,1}(v_1,\dots ,v_n), \end{aligned}$$

that is \(\mathscr {L}_{F,G}=\mathscr {G}_{2,1}|_{[3,4]}\).

Let \(H :\mathbb {R}\times \big ( [3,4] \cup [6,8] \cup [9,\infty ) \big ) \rightarrow \mathbb {R}\) be given by

$$\begin{aligned} H(r,s):={\left\{ \begin{array}{ll} s &{}\qquad \text { for } s \in [3,4];\\ s/2 &{}\qquad \text { for } s \in [6,8];\\ r/s &{}\qquad \text { for } s\in [9,+\infty ). \end{array}\right. } \end{aligned}$$

In the simplest case, \(n=1\), as \(v_1 \in [3,4]\) we have \(\mathscr {L}_{F,H}(v_1)=H(v_1^2,v_1)=v_1\).

For \(n=2\) one gets \(v_1+v_2 \in [6,8]\), thus

$$\begin{aligned} \mathscr {L}_{F,H}(v_1,v_2)=H(v_1^2+v_2^2,v_1+v_2)=\tfrac{1}{2}(v_1+v_2). \end{aligned}$$

For \(n\ge 3\) we obtain \(v_1+\dots +v_n \ge 9\), whence

$$\begin{aligned} \mathscr {L}_{F,H}(v_1,\dots ,v_n)= \mathscr {L}_{F,G}(v_1,\dots ,v_n)=\mathscr {G}_{2,1}(v_1,\dots ,v_n)\,. \end{aligned}$$

Binding all cases altogether we obtain

$$\begin{aligned} \mathscr {L}_{F,H}(v_1,\dots ,v_n)= {\left\{ \begin{array}{ll} v_1 &{}\text { for }n =1\,;\\ \frac{v_1+v_2}{2} &{}\text { for }n =2\,;\\ \frac{v_1^2+\cdots +v_n^2}{v_1+\cdots +v_n}&{}\text { for }n \ge 3\,. \end{array}\right. } \end{aligned}$$

Then \(\mathscr {L}_{F,H}\) is not repetition invariant as \(\mathscr {L}_{F,H}(3,4)=\tfrac{7}{2}\ne \tfrac{25}{7} =\mathscr {L}_{F,H}(3,3,4,4)\). Thus \(\mathscr {L}_{F,H}\) is a mean of type \(\mathcal {E}_{2}\) which is not a Bajraktarević mean.

Obviously \(\mathscr {L}_{F,G}\) and \(\mathscr {L}_{F,H}\) are two different means, which implies that the function F is not sufficient to determine a mean.

Example 3

Let \(F :\mathbb {R}\rightarrow \mathbb {R}^2\) be given by \(F(x)=(x^3,x^2)\). Let

$$\begin{aligned} D:=\{(x,y)\in \mathbb {R}^2:\left| x \right| \le \left| y \right| ^{3/2}\} \end{aligned}$$

and consider a function \(G:D \rightarrow \mathbb {R}\) given by

$$\begin{aligned} G(x,y)&:= {\left\{ \begin{array}{ll} 0 \qquad &{}\text { for }(x,y)=(0,0);\\ \tfrac{x}{y} \qquad &{}\text { otherwise}. \end{array}\right. } \end{aligned}$$

First we need to prove that G is continuous. In fact the only nontrivial point is (0, 0). However, for \(\varepsilon >0\), \(y \in (-\varepsilon ,\varepsilon ) \setminus \{0\}\) and \(x \in (-|y|^{3/2},|y|^{3/2})\) we have

$$\begin{aligned} \left| G(x,y) \right| =\left| x\cdot \frac{x^2}{y^3} \right| ^{1/3}\le |x|^{1/3}\le |y|^{1/2}\le \varepsilon ^{1/2}, \end{aligned}$$

what implies that G is a continuous at (0, 0) and, as a consequence, G is continuous.

Now we prove that \(\omega F(\mathbb {R}) \subset D\) or, equivalently,

$$\begin{aligned} \Big |\sum _{i=1}^n v_i^3\Big | \le \Big |\sum _{i=1}^n v_i^2\Big |^{3/2} \text { for all }n \in \mathbb {N}\text { and }v \in \mathbb {R}^n. \end{aligned}$$
(3.1)

One can assume that all \(v_i\)-s are positive (by omitting all zeros and replacing \(v_i\) by \(|v_i|\)) and rewrite (3.1) in a form

$$\begin{aligned} \mathscr {G}_{3,2}(v_1,\dots ,v_n)^2 \le \sum _{i=1}^n v_n^2 \qquad (n\in \mathbb {N},\,v\in \mathbb {R}_+^n). \end{aligned}$$

However \(\mathscr {G}_{3,2}(v_1,\dots ,v_n)^2 \le \max (v_1,\dots ,v_n)^2\le v_1^2+\dots +v_n^2\), which completes the proof of (3.1). Thus \(\omega F(\mathbb {R})\subset D\), and we obtain

$$\begin{aligned} \mathscr {L}_{F,G}(v_1,\dots ,v_n)= {\left\{ \begin{array}{ll} 0 &{} \text {for }v_1=\cdots =v_n=0,\\ \frac{v_1^3+\cdots +v_n^3}{v_1^2+\cdots +v_n^2} &{} \text {otherwise.} \end{array}\right. } \end{aligned}$$

This is obviously the continuous, repetition invariant mean defined of \(\mathbb {R}\) with a negligible element (equals 0) which is of type \(\mathcal {E}_{2}\). Thus \(\mathscr {L}_{F,G}\) is not a Bajraktarević mean as these means have no negligible element. In the same way \(\mathscr {L}_{F,G}\) is not a deviation (or even a semideviation) mean.

4 Means of Higher-Order Types

At the moment we intend to show some means of higher-order types. To this end, for every vector \((v_1,\dots ,v_n)\) having all positive entries define

$$\begin{aligned} \gamma _{p_1,\dots ,p_s}:= & {} {\left\{ \begin{array}{ll}\sum \limits _{\begin{array}{c} i_1,\dots ,i_s\\ i_k \ne i_l \end{array}}v_{i_1}^{p_1} \cdots v_{i_s}^{p_s} &{} \text{ for } s \ge n;\\ 0 &{} \text { for }s<n. \end{array}\right. }\qquad (s\in \mathbb {N}_+,\ p_1,\dots ,p_s\in \mathbb {R})\\ \sigma _{s,p}:= & {} \dfrac{\gamma _{p,\dots ,p}}{s!}={\left\{ \begin{array}{ll}\sum \limits _{1\le i_1<\cdots<i_s \le n}v_{i_1}^{p} \cdots v_{i_s}^{p} &{} \text{ for } s \ge n;\\ 0 &{} \text { for }s <n, \end{array}\right. } \qquad (s\in \mathbb {N}_+,\ p\in \mathbb {R}) \end{aligned}$$

The following technical lemma is of essential importance

Lemma 4.1

Let \(s \in \mathbb {N}\) and \((p_1,\dots ,p_s)\) be a vector of real numbers. Define the set

$$\begin{aligned} Q:=\Big \{\sum _{i \in T} p_i :T \subseteq \{1,\dots ,s\} \wedge T \ne \emptyset \Big \}. \end{aligned}$$

Then \(\gamma _{p_1,\dots ,p_s} \in \mathbb {Z}[\gamma _q :q \in Q]\). In particular \(\sigma _{s,p} \in \frac{1}{s!}\cdot \mathbb {Z}[\gamma _p,\gamma _{2p},\dots ,\gamma _{sp}]\).

Proof

We prove the statement by induction with respect to s. For \(s=1\) we get \(\gamma _{p_1} \in \mathbb {Z}[\gamma _{p_1}]\) which is trivial.

Now take a vector \((p_0,p_1,\dots ,p_s)\) of reals. Then we can easy verify that

$$\begin{aligned} \gamma _{p_1,\dots ,p_s}\gamma _{p_0}&=\gamma _{p_0,p_1,\dots ,p_s} +\gamma _{p_1+p_0,p_2,\dots ,p_s} +\gamma _{p_1,p_2+p_0,\dots ,p_s} +\cdots +\gamma _{p_1,p_2,\dots ,p_s+p_0}. \end{aligned}$$

Equivalently

$$\begin{aligned} \gamma _{p_0,p_1,\dots ,p_s}&= \gamma _{p_1,\dots ,p_s}\gamma _{p_0} -\gamma _{p_1+p_0,p_2,\dots ,p_s} -\gamma _{p_1,p_2+p_0,\dots ,p_s} -\dots -\gamma _{p_1,p_2,\dots ,p_s+p_0}. \end{aligned}$$

Therefore

$$\begin{aligned} \gamma _{p_0,\dots ,p_s} \in \mathbb {Z}[\gamma _{p_0},\gamma _{p_1,\dots ,p_s} ,\gamma _{p_1+p_0,p_2,\dots ,p_s} ,\dots ,\gamma _{p_1,p_2,\dots ,p_s+p_0} ]\,. \end{aligned}$$
(4.1)

However, if one defines

$$\begin{aligned} Q_0:= \Big \{\sum _{i \in T} p_i :T \subset \{0,\dots ,s\} \wedge T \ne \emptyset \Big \} \end{aligned}$$

Then \(\gamma _{p_1,\dots ,p_s} \in \mathbb {Z}[\gamma _q :q \in Q] \subset \mathbb {Z}[\gamma _q :q \in Q_0]\). Furthermore, using inductive assumption we obtain

$$\begin{aligned} \gamma _{p_1,p_2,\dots ,p_i+p_0,\dots ,p_s} \in \mathbb {Z}[\gamma _q :q \in Q_0] \qquad \text { for all }i \in \{1,\dots ,s\}. \end{aligned}$$

Finally, in view of (4.1) one gets \(\gamma _{p_0,\dots ,p_s} \in \mathbb {Z}[\gamma _q :q \in Q_0]\). \(\square \)

Example 4

(Hamy means) Let \(r \in \mathbb {N}\) and \(\mathfrak {ha}_r :\bigcup _{n=1}^\infty \mathbb {R}_+^n \rightarrow \mathbb {R}_+\) be given by

$$\begin{aligned} \mathfrak {ha}_r(v_1,\dots ,v_n):= {\left\{ \begin{array}{ll} \frac{v_1+\cdots +v_n}{n} &{}\text { for }n< r, \\ {\left( {\begin{array}{c}n\\ r\end{array}}\right) }^{-1} \sum \limits _{1\le i_1<\cdots <i_r \le n} \root r \of {v_{i_1}\cdots v_{i_r}}&\text { for }n \ge r. \end{array}\right. } \end{aligned}$$

One can rewrite it in a compact form

$$\begin{aligned} \mathfrak {ha}_r(v_1,\dots ,v_n):= {\left\{ \begin{array}{ll} n^{-1}\gamma _1 &{} \text { for }n < r, \\ {\left( {\begin{array}{c}n\\ r\end{array}}\right) }^{-1}\sigma _{r,1/r}&\text { for }n \ge r. \end{array}\right. } \end{aligned}$$

Using Lemma 4.1 we have \(\sigma _{r,1/r}\in \mathbb {Z}[\gamma _{1/r},\gamma _{2/r},\dots ,\gamma _{r/r}]\). Based on this there exists a continuous function \(G :\mathbb {R}^{r+1} \rightarrow \mathbb {R}\) such that

$$\begin{aligned} \mathfrak {ha}_r(x_1,\dots ,x_n)=G(\gamma _{1/r},\gamma _{2/r},\dots ,\gamma _{r/r},n) \end{aligned}$$

which implies \(\mathfrak {ha}_r \in \mathcal {E}_{r}^+\). Let us emphasize that it is still an open problem if \(\mathfrak {ha}_r \in \mathcal {E}_{r}\). In a sense we obtain only some upper estimation of the complexity of Hamy means.

Example 5

(Symmetric polynomial means) Let \(r \in \mathbb {N}\) and \(\mathfrak {s}_r :\bigcup _{n=1}^\infty \mathbb {R}_+^n \rightarrow \mathbb {R}_+\) be given by

$$\begin{aligned} \mathfrak {s}_r(v_1,\dots ,v_n):= {\left\{ \begin{array}{ll} \frac{v_1+\cdots +v_n}{n} &{}\text { for }n< r \\ \Big ({\left( {\begin{array}{c}n\\ r\end{array}}\right) }^{-1} \sum \limits _{1\le i_1<\cdots <i_r \le n} {v_{i_1}\cdots v_{i_r}}\Big )^{1/r}&\text { for }n \ge r \end{array}\right. } \end{aligned}$$

Similarly like in a case of Hamy means we obtain \(\mathfrak {s}_r \in \mathcal {E}_{r}^+\) for \(r \in \mathbb {N}\).

Observe that, for all \(r \in \mathbb {N}\) and \(n \ge r\) we have

$$\begin{aligned} \big (\mathfrak {ha}_r(x_1^r,\dots ,x_n^r)\big )^{1/r}=\mathfrak {s}_r(x_1,\dots ,x_n). \end{aligned}$$

This property refers to so-called conjugation of means; see [9] and [7, section VI.4.2]. In fact we can prove that, for each \(r\in \mathbb {N}\), the means \(\mathfrak {ha}_r\) and \(\mathfrak {s}_r\) have the same complexity and, moreover, their minimal freedom spaces are isomorphic.

Example 6

(Biplanar means) For \(p,q \in \mathbb {R}\) and \(c,d \in \mathbb {N}\) with \(cp\ne dq\) define a mean on \(\mathbb {R}_+\) by

$$\begin{aligned} \mathfrak {Bi}_{p,q,c,d}(v_1,\dots ,v_n):={\left\{ \begin{array}{ll} \left( \dfrac{\left( {\begin{array}{c}n\\ d\end{array}}\right) \sigma _{c,p}}{\left( {\begin{array}{c}n\\ c\end{array}}\right) \sigma _{d,q}}\right) ^{1/(cp-dq)} &{}\qquad \text {whenever }n \ge \max (c,d),\\ \mathscr {P}_p(v_1,\dots ,v_n) &{}\qquad \text {otherwise.} \end{array}\right. } \end{aligned}$$

Then \( \mathfrak {Bi}_{p,q,c,d}\) is a function of \((\gamma _0,\gamma _p,\gamma _{2p},\dots ,\gamma _{cp},\gamma _q,\gamma _{2q},\dots ,\gamma _{dq})\). Thus \(\mathfrak {Bi}_{p,q,c,d} \in \mathcal {E}_{k}^+\), where \(k:=|\{p,2p,\dots ,cp,q,2q,\dots ,dq\}|\).

We have a trivial inequality \(k \le c+d\) which lead to a fact that \(\mathfrak {Bi}_{p,q,c,d} \in \mathcal {E}_{c+d}^+\), however we can obtain better estimations in a particular cases. Indeed, for \((p,q,c,d):=(2,3,3,3)\) we have \(k=|\{2,4,6,3,6,9\}|=5\) so \(\mathfrak {Bi}_{2,3,3,3}\in \mathcal {E}_{5}^+\) (instead of \(\mathcal {E}_{3+3}^+=\mathcal {E}_{6}^+\)).

5 Proof of Theorem 3.1 and Auxiliary Results

First, it is easy to verify that Bajraktarević means have no negligible elements. Indeed, assume that e is a negligible element. Then we have, for all \(x \in I\),

$$\begin{aligned} x=\mathscr {B}_{f,g}(x,e)= & {} \Big (\frac{f}{g}\Big )^{-1}\bigg (\frac{f(x)+f(e)}{g(x)+g(e)}\bigg ) \\ \frac{f(x)}{g(x)}= & {} \frac{f(x)+f(e)}{g(x)+g(e)}\\ f(x)g(x)+f(x)g(e)= & {} f(x)g(x)+g(x)f(e) \\ \tfrac{f(x)}{g(x)} g(e)= & {} f(e) \end{aligned}$$

As \(\tfrac{f}{g}\) is a 1-1 we obtain \(f(e)=g(e)=0\) contradicting the assumption. Second, we can easily check that Bajraktarević means are repetition invariant \(\mathcal {E}_{2}\) means. The nontrivial part is to reverse this implication.

Remark 6

Take \(n\in \mathbb {N}\) and a pair of functions \(F :I \rightarrow \mathbb {R}^n\) and \(G :\mathbb {R}^n \rightarrow I\). Then for every invertible linear mapping \(L :\mathbb {R}^n \rightarrow \mathbb {R}^n\), we have \(\mathscr {L}_{F,G}=\mathscr {L}_{L\circ F,G \circ L^{-1}}\).

Lemma 5.1

Let I be a closed interval and \(F :I \rightarrow \mathbb {R}^2\) and \(G :\mathbb {R}^2 \rightarrow I\) be two continuous functions such that \(\mathscr {L}_{F,G}\) is a repetition invariant mean without negligible element.

If \(F(x)=(f(x),g(x))\) for \(f,g:I \rightarrow \mathbb {R}\) then there exists \(\alpha ,\beta \in \mathbb {R}\) such that the function \(\alpha f+\beta g\) is nowhere vanishing.

Proof

We first show that

$$\begin{aligned} \left| \begin{array}{ll} f(x) &{} f(y) \\ g(x) &{} g(y) \end{array}\right| \ne 0 \qquad \text { for all distinct }x,y \in I. \end{aligned}$$
(5.1)

Indeed, once we have \(\left| \begin{array}{ll} f(x) &{} f(y) \\ g(x) &{} g(y) \end{array}\right| = 0\) for some \(x,y \in I\) with \(x\ne y\) then either \(c F(x)=F(y)\) for some \(c \in \mathbb {R}_+\) or \(\omega F(I)\) contains the origin. We exclude both cases.

In the first case, since F is continuous one can assume that \(c=\tfrac{p}{q}\) for some \(p, q\in \mathbb {N}_+\). Then we have \(pF(x_0)=qF(y_0)\) and, applying G side-by-side we get \(x_0=y_0\), a contradiction. If \(\omega F(I)\) contains the origin, then as G is continuous on \(\omega F(I)\) and \(G(n x)=G(x)\) for all \(n \in \mathbb {N}\) we get \(G \equiv G(0)\) which leads to a contradiction again. Therefore (5.1) is valid.

In the second step, by [5, Theorem 2], our claim (5.1) yields that there exists \(\alpha ,\beta \in \mathbb {R}\) such that \(\alpha f+\beta g >0\) on the interior of I. Moreover, using some geometrical argumentation contained therein, we obtain that either \(\alpha f+\beta g\) is positive on I or

$$\begin{aligned} \alpha f(\inf I)+\beta g(\inf I)= \alpha f(\sup I)+\beta g(\sup I)=0. \end{aligned}$$

Nevertheless in the second case we have \(\frac{f(\inf I)}{g(\inf I)}=\frac{f(\sup I)}{g(\sup I)}\). In particular \(\left| \begin{array}{ll} f(\inf I) &{} f(\sup I) \\ g(\inf I) &{} g(\sup I) \end{array}\right| = 0\) contradicting (5.1). Consequently the first alternative holds, that is \(\alpha f+\beta g >0\).

Lemma 5.2

Let \(X \subset \mathbb {R}_+^2\) be a connected set. Then either X is contained in a line or for all directions \(\lambda \in {{\,\mathrm{int}\,}}\{\lambda \in S^1 :\lambda \cdot \mathbb {R}_+ \cap X \ne \emptyset \}=:\varLambda \) there exists \(M_\lambda \in \mathbb {R}\) such that \(M\cdot \lambda \in \omega X\) for all \(M > M_\lambda \).

Proof

By [4], the set \(X+X\) has a nonempty interior. Thus there exists a point \(s \in \mathbb {R}^2\) and a positive ratio \(\varepsilon \) such that a ball \(R_{\varepsilon }(s)\) is contained in \(X+X\). Define a projection \(\pi :\mathbb {R}_+^2 \rightarrow S^1\cap \mathbb {R}_+^2\) by

$$\begin{aligned} \pi (k\lambda )=\lambda \text { for all }k \in \mathbb {R}_+ \text { and }\lambda \in S^1 \cap \mathbb {R}_+^2 \end{aligned}$$

and introduce a natural order \(\prec \) on the quarter circle \(S^1 \cap \mathbb {R}_+^2\). Then, by the definition, \(\varLambda = {{\,\mathrm{int}\,}}\pi (X)\).

Fix \(\lambda \in \varLambda \) and \(\xi _0 \in \pi ^{-1}(\lambda ) \cap X\).

There exist elements \(\xi _-,\xi _+ \in R_{\varepsilon /4}(\xi _0) \cap X\) such that \(\pi (\xi _-) \prec \pi (\xi _0)\prec \pi (\xi _+)\). Then, for some \(K>0\), the set \(G:=\mathbb {N}\xi _-+\mathbb {N}\xi _+\) is an \(\tfrac{\varepsilon }{2}\)-net in a set

$$\begin{aligned} A:=\big \{a \in \mathbb {R}_+^2 :\left\| a \right\| _2\ge K \text { and }\pi (\xi _-)\prec \pi (a) \prec \pi (\xi +) \big \}. \end{aligned}$$

Consequently \(\omega X \supset G+R_\varepsilon (s) \supset s+A\).

Now we prove that there exists \(M_\lambda \in \mathbb {N}\) such that \(M \lambda \in \omega X\) for all \(M>M_\lambda \). As a matter of fact we show this assertion with \(\omega X\) replaced by \(s+A\). Equivalently we aim to show that

$$\begin{aligned} \lambda -\tfrac{1}{M} s \in \tfrac{1}{M} \cdot A\qquad \text { for all }M>M_\lambda . \end{aligned}$$

As for \(M'>M\) we have \(\tfrac{1}{M} \cdot A \subset \tfrac{1}{M'} \cdot A\), it suffices to prove that there exists a pair \((K_\lambda ,M_\lambda )\) such that \(K_\lambda >M_\lambda \) and

$$\begin{aligned} \lambda -\tfrac{1}{M} s \in \tfrac{1}{K_\lambda } \cdot A =[\tfrac{K}{K_\lambda },\infty ) \cdot [\pi (\xi _-),\pi (\xi +)]\qquad \text { for all }M>M_\lambda . \end{aligned}$$

Continuing, it suffices to prove that

$$\begin{aligned} R_{s/M_\lambda }(\lambda ) \subset [\tfrac{K}{K_\lambda },\infty ) \cdot [\pi (\xi _-),\pi (\xi +)]. \end{aligned}$$
(5.2)

To conclude the proof take: first \(M_\lambda >0\) such that

$$\begin{aligned} R_{s/M_\lambda }(\lambda ) \subset (0,+\infty ) \cdot [\pi (\xi _-),\pi (\xi +)]. \end{aligned}$$

Second, \(K_\lambda >M_\lambda \) such that (5.2) holds. \(\square \)

Lemma 5.3

Under the assumption of Lemma 5.1 suppose additionally that g is positive on its domain. Then the ratio f/g is an injective function.

Proof

Assume that there exists \(\alpha \in \mathbb {R}\) such that the set \(A:= \{x \in I :f(x)/g(x)=\alpha \}\) contains more than one element.

If A contains some interval V then \(f(x)=\alpha g(x)\) for all \(x \in V\). In particular \(\mathscr {L}_{F,\cdot }\) restricted to V equals \(\mathscr {L}_{f,\cdot }\), i.e. it is of type \(\mathcal {E}_{1}\) which lead to a contradiction as by Proposition 3.1 there are no means of this type.

As A is a closed subset of I, the only remaining case is that A has a gap. More precisely there exists \(p,q \in A\) such that \(p<q\) and \((p,q)\cap A=\emptyset \). Assume that

$$\begin{aligned} \frac{f(x)}{g(x)}>\alpha =\frac{f(p)}{g(p)}=\frac{f(q)}{g(q)}\text { for all }x \in (p,q)\,. \end{aligned}$$

The proof of the second case (with converse inequality sign) is completely analogous.

Let \(M:=F\big ([p,q]\big )\subset \mathbb {R}^2\) and \(\alpha _0:=\sup _{x \in (p,q)} \frac{f(x)}{g(x)}\), and \(r \in (p,q)\) be the smallest number with \(\alpha _0=\tfrac{f(r)}{g(r)}\). Then

$$\begin{aligned} {{\,\mathrm{int}\,}}{{\,\mathrm{cl}\,}}(\mathbb {Q}_+ \cdot \omega M)\supseteq & {} {{\,\mathrm{int}\,}}\Big \{\big (\alpha y,y\big ):\alpha \in (\tfrac{f}{g})(r,q),\,y \in \mathbb {R}_+\Big \}\\= & {} {{\,\mathrm{int}\,}}\Big \{\big (\alpha y,y\big ):\alpha \in (\tfrac{f}{g})(p,q),\,y \in \mathbb {R}_+\Big \}\\= & {} {{\,\mathrm{int}\,}}\Big \{\big (\tfrac{f(x)}{g(x)}y,y\big ):x \in (p,q),\,y \in \mathbb {R}_+\Big \}\\= & {} {{\,\mathrm{int}\,}}\Big \{\big (f(x)y,g(x)y\big ):x \in (p,q),\,y \in \mathbb {R}_+\Big \}. \end{aligned}$$

Fix \(x_0 \in (p,r)\). Then \((f(x_0),g(x_0)) \in {{\,\mathrm{int}\,}}{{\,\mathrm{cl}\,}}(\mathbb {Q}_+ \cdot \omega M)\). Consider two cases.

Case 1. If M is not a line then by Lemma 5.2 there exists \(k\in \mathbb {N}\) such that \((kf(x_0),kg(x_0)) \in \omega M\). By the definition \( (kf(x_0),kg(x_0)) \in nM\) for some \(n \in \mathbb {N}\). In the other words there exists a vector \((v_1,\dots ,v_n)\) of elements in (rq) such that

$$\begin{aligned} k\cdot F(x_0)= k\cdot (f(x_0),g(x_0))= \sum _{i=1}^n (f(v_i),g(v_i))=\sum _{i=1}^n F(v_i)\,. \end{aligned}$$

Using the definition of online premean, it implies

$$\begin{aligned} (r,q)\ni \mathscr {L}_{F,G}(v_1,\dots ,v_n)=\mathscr {L}_{F,G}(x_0,\dots ,x_0)=x_0 \in (p,r), \end{aligned}$$

which leads to a contradiction as \((r,q) \cap (p,r)=\emptyset \).

Case 2. If M is a line then there exist \(A,B,C \in \mathbb {R}\) such that

$$\begin{aligned} A f(x) + B g(x)+C=0 \text { for all } x \in (p,q)\,. \end{aligned}$$

If \(A=0\) or \(B=0\) then either g or f is constant on (pq). It implies that the second function is continuous and strictly monotone, so is the ratio f/g. It implies \(\tfrac{f(p)}{g(p)} \ne \tfrac{f(q)}{g(q)}\) which lead to a contradiction.

If both A and B are nonzero then: First, both f and g are 1-1 in (pq) (and therefore strictly monotone). Second,

$$\begin{aligned} \frac{f(x)}{g(x)}=\frac{-Bg(x)-C}{g(x)}=-B-\frac{C}{g(x)} \quad \text { for }x \in (p,q). \end{aligned}$$

It implies that f/g restricted to (pq) is 1-1, i.e \(\tfrac{f(p)}{g(p)} \ne \tfrac{f(q)}{g(q)}\) in this case too. \(\square \)

Lemma 5.4

Under the assumption of Lemma 5.1 there exists an invertible linear mapping \(L :\mathbb {R}^2 \rightarrow \mathbb {R}^2\) such that for a pair of functions \(f_1,g_1:I \rightarrow \mathbb {R}\) defined by \((f_1,g_1):= L \circ (f,g)\) we have: (i) \(g_1\) is positive and (ii) \(f_1/g_1\) is strictly increasing.

Proof

In view of Lemma 5.1 there exists \(\alpha ,\beta \in \mathbb {R}\) such that \(\alpha f+\beta g\) is nowhere vanishing. Define \(p:=1\) if \(\alpha f+\beta g\) is positive and \(p:=-1\) otherwise.

Take any vector \((\gamma ,\delta )\) which is linearly independent with \((\alpha ,\beta )\). Applying Lemma 5.3 with \(f \leftarrow \gamma f+\delta g\) and \(g \leftarrow \alpha f+\beta g\) we obtain that \(\frac{\gamma f+\delta g}{\alpha f+\beta g}\) is strictly monotone. Take \(q:=1\) if it is increasing and \(q:=-1\) otherwise. Let \(L:=\left( \begin{array}{ll} pq\gamma &{}pq\delta \\ p\alpha &{}p\beta \end{array}\right) \).

Then \(\det L=q \cdot \det \left( \begin{array}{ll} \gamma &{} \delta \\ \alpha &{} \beta \end{array}\right) \ne 0 \). Furthermore we can easily verify that both (i) and (ii) holds true for a pair \(f_1:=pq(\gamma f+\delta g)\) and \(g_1:=p(\alpha f+\beta g)\). \(\square \)

5.1 Proof of Theorem 3.1

Let \(\mathscr {L}_{F,G}\) be an arbitrary repetition invariant mean on I of type \(\mathcal {E}_{2}\) without negligible element, where \(F(x)=(f(x),g(x))\) for \(f,g:I \rightarrow \mathbb {R}\) and \(G :\omega F(I) \rightarrow I\).

By Lemma 5.4 and Remark 6 we may assume without loss of generality that g is positive and f/g is strictly increasing, that is the Bajraktarević mean \(\mathscr {B}_{f,g}\) is well defined.

Take \(n \in \mathbb {N}\), \(v \in I^n\), and define \(m:=\mathscr {B}_{f,g}(v)\). We shall prove that \(\mathscr {L}_{F,G}(v)=m\). Once v in given, by Lemma 5.4 we modify a pair \(F=(f,g)\) to put one of the coordinate of \(\sum _{i=1}^n F(v_i)\) on the axis. More precisely we set

$$\begin{aligned} \theta =\theta (m):=\frac{f(m)}{g(m)}= \frac{f(v_1)+f(v_2)+\cdots +f(v_n)}{g(v_1)+g(v_2)+\cdots +g(v_n)}. \end{aligned}$$

Then

$$\begin{aligned}&\theta (g(v_1)+g(v_2)+\cdots +g(v_n))=f(v_1)+f(v_2)+\cdots +f(v_n),\\&\quad (f(v_1)-\theta g(v_1))+\cdots +(f(v_n)-\theta g(v_n))=0 \end{aligned}$$

If we now replace f by \(f_m:=f-\theta g\) and consider \(F_m=(f_m,g)\) (and related function \(G_m\) so that \(\mathscr {L}_{F,G}=\mathscr {L}_{F_m,G_m}\)) we obtain

$$\begin{aligned} \sum _{i=1}^n (f_m(v_i),g(v_i))=\big (0,\sum _{i=1}^n g(v_i) \big )\,. \end{aligned}$$

As \(f_m(m)=0\) we get

$$\begin{aligned} G_m(0,ng(m))=G_m(n F_m(m))=\mathscr {L}_{F_m,G_m}(\underbrace{m,\dots ,m}_{n\text { times}})=m\qquad \text { for all }n \in \mathbb {N}. \end{aligned}$$

Furthermore, as \(f_m/g\) is strictly increasing, we get that \(f_m\) changes its sing in a neighbourhood of m. In particular for all \(\varepsilon >0\) there exists \(a,a'\in I\) such that \(a<a'\), \(m \in (a,a')\), \(f_m(a)=-f_m(a')\), and \(a'-a<\varepsilon \). Thus, applying the definition of \(\mathscr {L}_{F_m,G_m}\) on the vector \(( \underbrace{m,\dots ,m}_{n\text { times}},\underbrace{a,\dots ,a}_{k\text { times}}, \underbrace{a',\dots ,a'}_{k\text { times}})\) we have

$$\begin{aligned} G_m\big (0,ng(m)+k\big (g(a)+g(a')\big )\big ) \in (a,a')\quad \text { for all }n,\,k \in \mathbb {N}\,. \end{aligned}$$

In a narrow case when there exists \(\alpha \in \mathbb {R}\) such that \(f_m=\alpha g\) in a neighbourhood of m, we get \(f=(\alpha +\theta )g\), i.e. the mean restricted to this neighbourhood is of type \(\mathcal {E}_{1}\) what lead to a contradiction.

Otherwise one can find a pair \((b,b')\) (\(a<b<m<b'<a'\)) such that \(f_m(b)=-f_m(b')\) and \(g(a)+g(a')\ne g(b)+g(b')\). Then we have

$$\begin{aligned} G_m\big (0,g(m)+k\big (g(b)+g(b')\big )\big ) \in (b,b')\subset (a,a')\quad \text { for all }k \in \mathbb {N}\,. \end{aligned}$$
(5.3)

Consider two cases (recall that m is fixed).

Case 1. \(g=C+D f_m\) for some \(C, D \in \mathbb {R}\) on some interval \(X_m \ni m\).

Assume that \(X_m\) is a maximal interval with this property. Define the function \(\bar{G}(p,q):=G_m(p,qC+Dp)\). Then for all \(n \in \mathbb {N}\) and \(v =(v_1,\dots ,v_n)\in X_m^n\) we have

$$\begin{aligned} \mathscr {L}_{F_m,G_m}(v)= & {} G_m\Big (\sum _{i=1}^n f_m(v_i),\sum _{i=1}^n g(v_i)\Big )\\= & {} G_m\Big (\sum _{i=1}^n f_m(v_i),nC+\sum _{i=1}^n Df_m(v_i)\Big )=\bar{G}\Big (\sum _{i=1}^n f_m(v_i),n\Big ). \end{aligned}$$

which in view of (the proof of) Proposition 3.2 implies, for all \(v \in X_m^n\),

$$\begin{aligned} \mathscr {L}_{F,G}(v)=\mathscr {L}_{F_m,G_m}(v)=\mathscr {A}^{[f_m]}(v)=\mathscr {B}_{f_m,1}(v)=\mathscr {B}_{f_m,g}(v)=\mathscr {B}_{f,g}(v). \end{aligned}$$

Therefore \(G(p,q)=(\tfrac{f}{g})^{-1}(\frac{p}{q})\) for \((p,q) \in \omega F(X_m)\). Since \(f_m=f-\theta g\), there exist \(p,q \in \mathbb {R}\) such that \(g(x)=p+qf(x)\) for all \(x \in X_m\).

If \(X_m=I\) then, in view of Proposition 3.2, we have

$$\begin{aligned} \mathscr {L}_{F,G}(v)=\mathscr {A}^{[f]}(v)=\mathscr {B}_{f,g}(v)=m. \end{aligned}$$

Otherwise we have \(\mathscr {L}_{F,G}|_{X_m}=\mathscr {A}^{[f]}|_{X_m}=\mathscr {B}_{f,g}|_{X_m}\). In particular \(G(p,q)=(\tfrac{f}{g})^{-1}(\tfrac{p}{q})\) for all \((p,q) \in \omega F(X_m)\) such that \((\tfrac{f}{g})^{-1}(\tfrac{p}{q})=m\). Applying this for all \(m\in X_m\) we obtain

$$\begin{aligned} G(p,q)=(\tfrac{f}{g})^{-1}(\tfrac{p}{q})\text { for all }(p,q) \in \omega F(X_m). \end{aligned}$$
(5.4)

As \(\mathscr {L}_{F,G}\) is repetition invariant we have

$$\begin{aligned} G(tp,tq)=G(p,q)\text { for all } t \in \mathbb {Q},\,(p,q)\in \omega F(I) \text { with }(tp,tq)\in \omega F(I). \end{aligned}$$
(5.5)

Since F(I) is not a segment we obtain by Lemma 5.2, we get

$$\begin{aligned} (p,q) \in F(I) \Rightarrow \exists _{M_0>0} \forall _{M>M_0} (Mp,Mq)\in \omega F(I) \end{aligned}$$
(5.6)

Thus, as G is continuous, we have

$$\begin{aligned} G(x,y)=\lim _{\begin{array}{c} t \rightarrow \infty \\ (tx,ty)\in \omega F(I) \end{array}} G(tx,ty)\qquad \text { for all }(x,y)\in \omega F(I)\,. \end{aligned}$$

Binding this property with (5.4), (5.5), and (5.6) we have (see also [14])

$$\begin{aligned} G(p,q)=(\tfrac{f}{g})^{-1}(\tfrac{p}{q})\text { for all } (p,q) \in (\mathbb {R}_+ \cdot \omega F(X_m)) \cap \omega F(I). \end{aligned}$$

It implies that G(pq) equals \((\tfrac{f}{g})^{-1}(\tfrac{p}{q})\) on every semiline determined by some element of \(\omega F(X_m)\). Thus \(G(p,q)=m\) for all \((p,q) \in \omega F(I)\) with \((\tfrac{f}{g})^{-1}(\tfrac{p}{q})=m\). Thus \(\mathscr {L}_{F,G}(v)=m\).

Case 2. f and g are linearly independent in every neighbourhood of m.

There exist two sequences \((\phi _r)_{r \in \mathbb {R}_+}\) and \((\psi _r)_{r \in \mathbb {R}_+}\) of points in I such that:

  • The mapping \(r \mapsto (\phi _r,\psi _r) \) is continuous;

  • \((\phi _r)\) is increasing, and \((\psi _r)\) is deceasing;

  • \(\lim _{r \rightarrow \infty } \phi _r= \lim _{r \rightarrow \infty } \psi _r=m\);

  • \(\phi _r<m<\psi _r\) for all \(r \in \mathbb {R}_+\);

  • \(f(\phi _r) = -f(\psi _r)\) for all \(r \in \mathbb {R}_+\).

Then \(R:=\{r \in \mathbb {R}_+ :g(\phi _r)+g(\psi _r)\ne 2g(m)\}\) is a dense subset of \(\mathbb {R}_+\). Now, for each \(r \in R\), define an open interval

$$\begin{aligned} P_r:=\Big (\min \big (g(\phi _r)+g(\psi _r),2g(m)\big ),\max \big (g(\phi _r)+g(\psi _r),2g(m)\big )\Big ). \end{aligned}$$

Fix \(r_0 \in R\) arbitrarily. Applying (5.3) with \((b,b') \leftarrow (\phi _r,\psi _r)\) for all \(r \in (r_0,+\infty )\) simultaneously, we obtain

$$\begin{aligned}&G_m(0,g(m)+k(g(\phi _r)+g(\psi _r))) \in (\phi _r,\psi _r) \subset (v_{r_0},v'_{r_0})\\&\quad \text { for all }k\in \mathbb {N}\text { and }r\in (r_0,+\infty ). \end{aligned}$$

Moreover, as g is continuous we obtain that the mapping \((r_0,\infty ) \ni r \mapsto g(\phi _r)+g(v'_r)\) is onto \(P_{r_0}\), thus

$$\begin{aligned} G_m(0,g(m)+kx) \in (\phi _{r_0},\psi _{r_0}) \qquad \qquad \text { for all }k\in \mathbb {N}\text { and }x\in P_{r_0}. \end{aligned}$$

But, as \(P_{r_0}\) is an open interval and \(\sup P_{r_0} \ge 2g(m)>0\), there exists \(K_{r_0} \in \mathbb {R}\) such that \((K_{r_0},\infty ) \subset g(m)+\mathbb {N}\cdot P_{r_0}\). It implies \(G_m(0,z) \in (\phi _{r_0},\psi _{r_0})\) for all \(z >K_{r_0}\) and, as an immediate result,

$$\begin{aligned} \phi _{r_0} \le \liminf _{z \rightarrow \infty } G_m(0,z) \le \limsup _{z \rightarrow \infty } G_m(0,z) \le \psi _{r_0}. \end{aligned}$$

Upon passing the limit \(r_0 \rightarrow \infty \), \(r_0 \in R\) (recall that R is a dense subset of \(\mathbb {R}_+\)) we obtain

$$\begin{aligned} \lim _{z \rightarrow \infty } G_m(0,z)=m\,. \end{aligned}$$

But, in view of repetition invariance of \(\mathscr {L}_{F_m,G_m}\) on I, we have \(G_m(kx,ky)=G_m(x,y)\) for all \((x,y) \in \omega F_m(I)\) and \(k \in \mathbb {N}\) so

$$\begin{aligned} G_m(F_m(v_1)+\cdots +F_m(v_n))= & {} G_m\bigg (0,\sum _{i=1}^n g(v_i)\bigg ) =\lim _{k \rightarrow \infty } G_m\bigg (0,k\cdot \sum _{i=1}^n g(v_i)\bigg )\\= & {} \lim _{z \rightarrow \infty } G_m(0,z)=m. \end{aligned}$$

therefore \(\mathscr {L}_{F_m,G_m}(v)=m\). Now, as \(\mathscr {L}_{F,G}=\mathscr {L}_{F_m,G_m}\), we finally obtain

$$\begin{aligned} \mathscr {L}_{F,G}(v)=\mathscr {L}_{F_m,G_m}(v)=m=\mathscr {B}_{f,g}(v). \end{aligned}$$