We start with recalling fundamental notions which will be used in the paper. If \(I \subset \mathbb {R}\) is an interval and \(M :I^{2} \rightarrow I\) is a function, then M is called a mean provided

$$\begin{aligned} {\mathrm {min}}\{ x,y\} \le M(x,y) \le {{\mathrm {max}}}\{ x,y \}\quad \text {for every}\ x,y\in I. \end{aligned}$$
(1)

Let \(I \subset \mathbb {R}\) be an interval and let \(M :I^{2} \rightarrow I\) be a mean. We say that the mean M is strict, if \(\mathrm {min}\{x,y\}< M(x,y) < {\mathrm {max}}\{x,y\}\) for every \(x,y\in I\) such that \(x\not = y\).

Let X be a set. A function \(M :X^{2} \rightarrow X\) is called reflexive, if

$$\begin{aligned} M(x,x)=x\quad \text {for every}\ x\in X. \end{aligned}$$
FormalPara Remark 1

Let \(I \subset \mathbb {R}\) be an interval. If \(M :I^{2} \rightarrow I\) is a mean, then applying (1) with \(y=x\) we deduce that the function M is reflexive. On the other hand, if \(M :I^{2} \rightarrow I\) is a reflexive function, strictly increasing with respect to each variable, then M is a strict mean.

Let \(I \subset \mathbb {R}\) be an interval and let \(M :I^{2} \rightarrow I\) be a mean. We say that M is a weighted quasi-arithmetic mean, if there exist a \(p\in (0,1)\) and a continuous strictly monotonic function \(g:I \rightarrow \mathbb {R}\) such that

$$\begin{aligned} M(x,y)=g^{-1} \Big ( pg(x)+(1-p)g(y)\Big ) \end{aligned}$$
(2)

for every \(x,y\in I\). In this situation the number p is called a weight of M and the function g is called a generator of M. If M is a weighted quasi-arithmetic mean and \(\frac{1}{2}\) is a weight of M, then the mean M is called quasi-arithmetic.

FormalPara Remark 2

Let \(I \subset \mathbb {R}\) be an interval and let \(M :I^{2} \rightarrow I\) be a weighed quasi-arithmetic mean. If \( {\text {int}}I \not = \emptyset \), then a weight of M is uniquely determined. One can check that M is symmetric if, and only if M is quasi-arithmetic. Moreover, if \(M(x,y)=M(y,x)\) for some different \(x,y\in I\), then M is symmetric and thus quasi-arithmetic. If \(f:I \rightarrow \mathbb {R}\) generates M, then the function \(-f\) generates M too. Therefore every weighted quasi-arithmetic mean has a strictly increasing generator (see [4, p. 67]).

The bisymmetry equation has the form

$$\begin{aligned} M(M(x,y),M(z,t))=M(M(x,z),M(y,t)). \end{aligned}$$
(3)

The next remark is an easy observation which will be useful in the sequel.

FormalPara Remark 3

Let \(I \subset \mathbb {R}\) be an interval. If \(M :I^{2} \rightarrow I\) is a weighted quasi-arithmetic mean, then M satisfies the bisymmetry equation.

The title theorem of J. Aczél is the following.

FormalPara Theorem A

([1]) Let \(I\subset \mathbb {R}\) be an interval and let \(M:I^{2} \rightarrow I\) be a continuous reflexive function. Assume that M is symmetric and strictly increasing with respect to each variable. Then M satisfies the bisymmetry equation if and only if M is a quasi-arithmetic mean.

Using Theorem A, R. Ger and T. Kochanek proved the following result.

Theorem GK ([3]) Let \(I,J \subset \mathbb {R}\) be intervals and let \(M:I^{2}\rightarrow I\) and \(K :J^{2} \rightarrow J\) be means, continuous with respect to each variable and strictly increasing with respect to each variable. Assume that the equation

$$\begin{aligned} f(M(x,y))=K(f(x),f(y)) \end{aligned}$$
(4)

has a non-constant solution \(f:I \rightarrow J\). Then the following statements hold:

  1. (a)

    if the mean K is quasi-arithmetic, then the mean M is quasi-arithmetic;

  2. (b)

    if the mean M is quasi-arithmetic, then K restricted to the set \(( \inf f(I), \sup f(I))^{2}\) is a quasi-arithmetic mean.

Theorem  was generalized by the author to the following result.

FormalPara Theorem B

([2]) Let \(I\subset \mathbb {R}\) be an interval and let \(M:I^{2}\rightarrow I\) be a strict mean continuous with respect to each variable. Assume that \(J \subset \mathbb {R}\) is an interval and \(K :J^{2} \rightarrow J\) is a quasi-arithmetic mean. If Eq. (4) has a non-constant solution \(f:I \rightarrow J\), then the mean M is quasi-arithmetic.

In this paper we generalize Theorem A and hence we obtain next generalizations of Theorem . Our first result is the following lemma.

FormalPara Lemma 4

Let \(I \subset \mathbb {R}\) be an interval and let \(M :I^{2} \rightarrow I\) be a mean continuous with respect to each variable. Assume that \(A \subset I\) is an arbitrary set and for every compact interval \(J \subset I\backslash {\text {int}}_{I}{\text {cl}}_{I} A\) the mean M restricted to \(J^{2}\) is strict. Then the following statements hold:

  1. (a)

    if \(M(A^{2}) \subset A\), then

    $$\begin{aligned} {\text {cl}}_{I} A=[ \inf A, \sup A] \cap I ; \end{aligned}$$
    (5)
  2. (b)

    if \(A \not = \emptyset \) and either \(M(I \times A) \subset A\) or \(M(A \times I) \subset A\), then \({\text {cl}}_{I} A=I\).

FormalPara Proof

It follows from the continuity of M with respect to each variable that

$$\begin{aligned} M({\text {cl}}_{I} B\times {\text {cl}}_{I} C) \subset {\text {cl}}_{I} M(B\times C)\quad \text {for every sets}\ B,C \subset I. \end{aligned}$$
(6)

Now we prove the point (a). Assume that \(M(A^{2}) \subset A\). We may assume that \( {\text {card}} A \ge 2\). Put \(P=[ \inf A, \sup A] \cap I\). Then \(P \subset I\), P is closed in I and \(A \subset P\). Hence \({\text {cl}}_{I} A \subset P\). Now we show that \(P \subset {\text {cl}}_{I} A\). Since A is not a singleton, it holds the equality \(P={\text {cl}}_{I} ( \inf A, \sup A)\). Therefore it is enough to prove that \(( \inf A, \sup A) \subset {\text {cl}}_{I} A\). Fix any \(x\in ( \inf A, \sup A)\). Suppose on the contrary that \(x\not \in {\text {cl}}_{I} A\). Put \(B=[ \inf A, x) \cap A\) and \(C=(x, \sup A ] \cap A\). The sets B and C are non-empty subsets of A. Moreover, \(B \subset (-\infty ,x)\) and \(C \subset (x,\infty )\). Let \(s= \sup B\) and \(t= \inf C\). Then

$$\begin{aligned} s \le x \le t. \end{aligned}$$
(7)

Since \(B \not = \emptyset \) and \(C \not = \emptyset \), using (7) we deduce that \(s\in I\) and \(t\in I\). Moreover \(s\in {\text {cl}}B\) and \(t\in {\text {cl}}C\) and hence \(s \in {\text {cl}}_{I} B\) and \(t\in {\text {cl}}_{I} C\). In particular, \(s \in {\text {cl}}_{I} A\) and \(t\in {\text {cl}}_{I} A\). Applying the supposition we deduce that \(x \not = s\) and \(x \not = t\). Therefore condition (7) implies \(s<x<t\). It follows from the supposition that \(x \not \in A\). Hence, using the definitions of B and C, we deduce that \((s,t) \subset I\backslash A \cup \{x\}=I\backslash A\). Therefore \({\text {int}}_{I}(s,t) \subset {\text {int}}_{I}(I\backslash A)\) which gives

$$\begin{aligned} (s,t)\subset I \backslash {\text {cl}}_{I} A, \end{aligned}$$
(8)

hence

$$\begin{aligned} {\text {cl}}_{I} (s,t) \subset {\text {cl}}_{I} (I \backslash {\text {cl}}_{I} A)=I \backslash {\text {int}}_{I}{\text {cl}}_{I} A. \end{aligned}$$
(9)

Since \(s<t\) and \(s,t \in I\), we have \({\text {cl}}_{I} (s,t)= [s,t]\). Therefore (9) implies \([s,t] \subset I\backslash {\text {int}}_{I}{\text {cl}}_{I} A\). Hence, by the assumption, the mean M restricted to the set \([s,t]^{2}\) is strict. Therefore \(M(s,t)\in (s,t)\). Using (8) we get

$$\begin{aligned} M(s,t) \in I \backslash {\text {cl}}_{I} A. \end{aligned}$$
(10)

Moreover \(s \in {\text {cl}}_{I} A\) and \(t \in {\text {cl}}_{I} A\), which in view of (6) implies

$$\begin{aligned} M(s,t) \in M({\text {cl}}_{I} A \times {\text {cl}}_{I} A) \subset {\text {cl}}_{I} M(A^{2}) \subset {\text {cl}}_{I} A. \end{aligned}$$

It contradicts (10). Therefore \(x\in {\text {cl}}_{I} A\).

Now we prove the point (b). Let \(A \subset I\) be a non-empty set such that \(M(I \times A) \subset A\) or \(M(A \times I) \subset A\). We may assume that \(M(I \times A) \subset A\), as in the second case the proof is analogous. Therefore, in particular, \(M(A^{2}) \subset A\). Applying the first part of the lemma we deduce that \({\text {cl}}_{I} A=[ \inf A, \sup A] \cap I\). Therefore it is enough to show that \( \inf A= \inf I\) and \( \sup A= \sup I\). We will prove only the first equality, because the second equality can be proved analogously. Suppose, on the contrary, that \( \inf A \not = \inf I\). Then \( \inf A > \inf I\) and therefore there exists an \(x \in I\) such that

$$\begin{aligned} x< \inf A. \end{aligned}$$
(11)

The set A is non-empty and therefore, using (11), we deduce that \( \inf A \in I\). In particular, \( \inf A \in \mathbb {R}\) and hence \( \inf A \in {\text {cl}}A\). Consequently \( \inf A \in {\text {cl}}_{I} A\). Applying condition (6) we obtain

$$\begin{aligned} M(x, \inf A) \in M(I \times {\text {cl}}_{I} A) \subset {\text {cl}}_{I} M(I \times A) \subset {\text {cl}}_{I} A. \end{aligned}$$

Hence, on account of (5), we get \(M(x, \inf A) \in [ \inf A, \sup A]\). Therefore

$$\begin{aligned} M(x, \inf A) \ge \inf A. \end{aligned}$$
(12)

Since \( \inf A > \inf I\), using (5) we obtain

$$\begin{aligned} {\text {int}}_{I}{\text {cl}}_{I} A= {\text {int}}_{I}\big ([ \inf A, \sup A] \cap I\big ) \subset ( \inf A, \sup A] \cap I. \end{aligned}$$

Therefore

$$\begin{aligned} {[}x, \inf A] \subset I \backslash \big (( \inf A, \sup A] \cap I\big ) \subset I \backslash {\text {int}}_{I}{\text {cl}}_{I} A. \end{aligned}$$

Hence, by the assumption, we deduce that the mean M restricted to the set \([x, \inf A]^{2}\) is strict. Making use of (11) we get \(M(x, \inf A)< \inf A\). It contradicts (12). \(\square \)

Now we present the first main result of this paper. It follows from Remark 1 that this result generalizes Theorem A.

FormalPara Theorem 5

Let \(I \subset \mathbb {R}\) be an interval and let \(M:I^{2} \rightarrow I\) be a (symmetric) strict mean continuous with respect to each variable. Then M satisfies the bisymmetry equation if, and only if M is a weighted quasi-arithmetic (quasi-arithmetic) mean.

FormalPara Proof

In view of Remark 2 it is enough to prove Theorem 5 only in the main case. Assume that M satisfies the bisymmetry equation. If \( {\text {int}}I = \emptyset \), then M is a weighted quasi-arithmetic mean with a weight \(\frac{1}{2}\) and a generator \({\mathrm {id}}_{I}\). Now we consider the case \( {\text {int}}I \not = \emptyset \).

We will show that M is injective with respect to the second variable. Fix \(x_{0},y,z\in I\) and assume that \(M(x_{0},y)=M(x_{0},z)\). Put \(A= \{x\in I : M(x,y)=M(x,z) \}\). Then \(x_{0}\in A\) and therefore \(A \not = \emptyset \). Since M is continuous with respect to the first variable, the set A is closed in I. We will prove that \(M(A \times I) \subset A\). Let \(x\in A\) and \(t\in I\). Then \(M(x,y)=M(x,z)\) and therefore

$$\begin{aligned} M(M(x,y),M(t,w))=M(M(x,z),M(t,w)) \end{aligned}$$
(13)

for every \(w\in I\). Making use of (13) and applying the bisymmetry equation we obtain

$$\begin{aligned} M(M(x,t),M(y,w))=M(M(x,t),M(z,w)) \end{aligned}$$
(14)

for every \(w\in I\). By Remark 1 the function M is reflexive. Applying (14) with \(w=y\) we get

$$\begin{aligned} M(M(x,t),y)=M(M(x,t),M(z,y)). \end{aligned}$$
(15)

Using the reflexivity of M and applying the bisymmetry equation we obtain

$$\begin{aligned} M(M(x,t),M(z,y))&=(M(M(x,t),M(x,t)),M(z,y))\\&=M(M(M(x,t),z),M(M(x,t),y)). \end{aligned}$$

The last condition together with (15) yields

$$\begin{aligned} M(M(x,t),y)=M(M(M(x,t),z),M(M(x,t),y)). \end{aligned}$$

Hence on account of the strictness of M we deduce that \(M(M(x,t),y)=M(M(x,t),z)\). Consequently \(M(x,t) \in A\). Therefore \(M(A \times I) \subset A\). Making use of Lemma 4 we obtain \({\text {cl}}_{I} A=I\) whence \(A=I\). In particular, \(y \in A\) and hence \(y=M(y,z)\). Using the strictness of M again, we deduce that \(y=z\).

Now we show that M is injective with respect to the first variable. Define a function \(N :I^{2} \rightarrow I\) by \(N(x,y)=M(y,x)\). The function N is a strict mean continuous with respect to each variable. We will check that N satisfies the bisymmetry equation. For every \(x,y,z,t\in I\) the equalities

$$\begin{aligned} N(N(x,y),N(z,t))&=N(M(y,x),M(t,z))=M(M(t,z),M(y,x))\\&=M(M(t,y),M(z,x))=M(N(y,t),N(x,z))\\&=N(N(x,z),N(y,t)). \end{aligned}$$

hold. Using the first part of the proof we deduce that N is injective with respect to the second variable. Consequently M is injective with respect to the first variable.

Therefore M is injective with respect to each variable. Moreover, M is a real function defined on a Cartesian product of intervals and continuous with respect to each variable. Consequently M is strictly monotonic with respect to each variable. Hence on account of the continuity of M with respect to each variable we deduce that M is continuous. Moreover, the function M is reflexive. Making use of Theorem 4 from [1] (p. 294) we state that there exist a \(p \in \mathbb {R} \backslash \{0,1\}\) and a strictly monotonic function \(g :I \rightarrow \mathbb {R}\) such that equality (2) holds for every \(x,y\in I\). The function M is a mean strictly monotonic with respect to each variable, and therefore M is strictly increasing with respect to each variable. Hence on account of the assumption \( {\text {int}}I \not = \emptyset \) we deduce that \(p > 0\) and \(1-p >0\). Therefore \(p\in (0,1)\) and using equality (2) we state that M is a weighted quasi-arithmetic mean. The converse is a consequence of Remark 3. \(\square \)

Making use of Theorem 5 we will prove Theorem 6 below. It follows from Remarks 3 and 2 that Theorem 6 generalizes Theorem .

FormalPara Theorem 6

Let \(I\subset \mathbb {R}\) be an interval and let \(M :I^{2} \rightarrow I\) be a [symmetric] solution of the bisymmetry equation. Assume that \(J \subset \mathbb {R}\) is an interval and \(K :J^{2} \rightarrow J\) is a strict mean continuous with respect to each variable. Let \(f :I \rightarrow J\) be a function. If the triple (fMK) satisfies Eq. (4), then K restricted to the set \({\big ([inf f(I),sup f(I)] \cap J\big )}^{2}\) is a weighted quasi-arithmetic (quasi-arithmetic) mean.

FormalPara Proof

First we proceed for the main case. Assume that the triple (fMK) satisfies Eq. (4). It follows from (4) that for every \(a,b,c,d\in I\) the following equalities hold:

$$\begin{aligned} K(K(f(a),f(b)),K(f(c),f(d)))&=K(f(M(a,b)),f(M(c,d)))\\&=f(M(M(a,b),M(c,d))). \end{aligned}$$

Since M satisfies the bisymmetry equation, the last term of the equalities above is symmetric with respect to b and c. Therefore the first term of these equalities also has this property. Consequently K satisfies equality (3) for every \(x,y,z,t\in f(I)\). Hence in view of the continuity of K with respect to each variable we deduce that K satisfies equality (3) for every \(x,y,z,t\in {{\text {cl}}_{J} f(I)}\). Put \(P=[ \inf f(I), \sup f(I)] \cap J\). It follows from (4) that \(K \big ({f(I)}^{2}\big ) \subset f(I)\). Using Lemma 4 we deduce that \({\text {cl}}_{J} f(I)=P\). Therefore the function K satisfies equality (3) for every \(x,y,z,t\in P\). The set P is an interval and the function K is a mean and hence \(K(P^{2}) \subset P\). Consequently the function K restricted to \(P^{2}\) is a solution of Eq. (3). Moreover K restricted to \(P^{2}\) is a strict mean continuous with respect to each variable. Using Theorem 5 we deduce that the function K restricted to the set \(P^{2}\) is a weighted quasi-arithmetic mean.

Now we prove the parallel version of the theorem. So assume additionally, that the function M is symmetric. Let the triple (fMK) satisfies Eq. (4). Put \(P=[ \inf f(I), \sup f(I)] \cap J\). By the first part of the proof the function K restricted to \(P^{2}\) is a weighted quasi-arithmetic mean. If f is constant, then P contains at most one point and thus K restricted to \(P^{2}\) is a quasi-arithmetic mean. Now assume that the function f is non-constant. We can find \(x,y\in I\) such that \(f(x) \not = f(y)\). The mean M is symmetric and therefore \(M(x,y)=M(y,x)\). Using (4) we obtain

$$\begin{aligned} K(f(x),f(y))=f(M(x,y))=f(M(y,x))=K(f(y),f(x)). \end{aligned}$$

Moreover \(f(x)\in P\) and \(f(y) \in P\). Applying Remark 2 we deduce that K restricted to \(P^{2}\) is a quasi-arithmetic mean. It completes the proof. \(\square \)

Using Theorem 6 and Remarks 3 and 2 we obtain the result below, which is a next generalization of Theorem .

FormalPara Corollary 7

Let \(I\subset \mathbb {R}\) be an interval and let \(M :I^{2} \rightarrow I\) be a weighted quasi-arithmetic [a quasi-arithmetic] mean. Assume that \(J \subset \mathbb {R}\) is an interval and \(K :J^{2} \rightarrow J\) is a strict mean continuous with respect to each variable. Let \(f :I \rightarrow J\) be a function. If the triple (fMK) satisfies Eq. (4), then K restricted to the set \({\big ([inf f(I),sup f(I)] \cap J\big )}^{2}\) is a weighted quasi-arithmetic (quasi-arithmetic) mean.

The lemma below comes from [2] and presents the solution of Eq. (4) in case when the means M and K are quasi-arithmetic.

FormalPara Lemma B

([2]) Let \(I,J \subset \mathbb {R}\) be intervals and let \(f:I \rightarrow J\) be a function. Assume that \(M:I^{2}\rightarrow I\) and \(K :J^{2} \rightarrow J\) are quasi-arithmetic means. The triple (fMK) satisfies Eq. (4) if, and only if there exist continuous and strictly increasing functions \(g:I \rightarrow \mathbb {R}\) and \(h:J \rightarrow \mathbb {R}\), an \(x_{0}\in \mathbb {R}\) and an additive function \(a:\mathbb {R}\rightarrow \mathbb {R}\) such that g generates M, h generates K, \(a(g(I))+x_{0} \subset h(J)\) and

$$\begin{aligned} f(x)=h^{-1}(a(g(x))+x_{0})\quad \text {for every}\ x\in I. \end{aligned}$$
(16)

The proof of Lemma B (see [2]) did not comprise the case \(I= \emptyset \). However, in this case the assertion of Lemma B remains valid because the triple (fMK) satisfies Eq. (4) and to obtain the right side of the equivalence in the assertion it is enough to put the empty function as g, an arbitrary strictly increasing generator of K as h, \(x_{0}=0\) and \(a=0\).

Making use of Corollary 7 and Lemma B we will prove the following result.

FormalPara Theorem 8

Let \(I\subset \mathbb {R}\) be an interval and let \(M :I^{2} \rightarrow I\) be a quasi-arithmetic mean. Assume that \(J \subset \mathbb {R}\) is an interval and \(K :J^{2} \rightarrow J\) is a strict mean continuous with respect to each variable. Let \(f:I \rightarrow J\) be a function. The triple (fMK) satisfies Eq. (4) if, and only if there exist an interval \(P \subset J\), continuous and strictly increasing functions \(g:I \rightarrow \mathbb {R}\) and \(h:P \rightarrow \mathbb {R}\), an \(x_{0}\in \mathbb {R}\) and an additive function \(a:\mathbb {R}\rightarrow \mathbb {R}\) such that g generates M, h generates K restricted to \(P^{2}\), \(a(g(I))+x_{0} \subset h(P)\) and condition (16) holds.

FormalPara Proof

Assume that the triple (fMK) satisfies Eq. (4). Put \(P= [ \inf f(I), \sup f(I)] \cap J\). The set P is an interval contained in J. Let \(K_{1}\) denotes the mean K restricted to \(P^{2}\). By Corollary 7 the mean \(K_{1}\) is quasi-arithmetic. Moreover \(f(I) \subset P\) and the triple \((f,M,K_{1})\) satisfies Eq. (4). Using Lemma B with \(J=P\) we obtain the right side of the equivalence in the assertion.

Now assume that the right side of the equivalence in the assertion holds. By \(K_{1}\) we denote the mean K restricted to \(P^{2}\). Applying condition (16) we obtain \(f(x)=h^{-1}(a(g(x))+x_{0}) \in P\) for every \(x\in I\). Hence \(f(I) \subset P\). Making use of Lemma B with \(J=P\) we state that the triple \((f,M,K_{1})\) satisfies Eq. (4). Therefore the triple (fMK) satisfies Eq. (4). \(\square \)