1 Background and motivation

The question about an error one commits replacing an object with some properties by an object satisfying them only approximately is natural and interesting both in mathematics and in many other scientific investigations. To deal with it the notion of the Ulam stability can be used.

Let us recall that in 1940 Ulam, during his talk at the University of Wisconsin, posed the problem of the stability of group homomorphisms, i.e. the Cauchy functional equation

$$\begin{aligned} f(x+y)=f(x)+f(y), \end{aligned}$$
(1)

and Hyers in [32] gave its solution in the case of Banach spaces. Hyers’ result was extended by Aoki in [4] and Rassias in [44] (see also a remark of Bourgin in [8]) in the following way.

Let \(E_1\) and \(E_2\) be Banach spaces, \(\varepsilon \ge 0\), \(p\in [0,1)\) and \(f: E_1\rightarrow E_2\) be a mapping with

$$\begin{aligned} \Vert f(x+y)-f(x)-f(y)\Vert \le \varepsilon (\Vert x\Vert ^p+\Vert y\Vert ^p),\quad x, y \in E_1. \end{aligned}$$

Then there is a unique additive mapping, i.e. a solution of Eq. (1), \(a: E_1 \rightarrow E_2\) such that

$$\begin{aligned} \Vert f(x)-a(x)\Vert \le \frac{2\varepsilon }{2-2^p}\Vert x\Vert ^p,\quad x \in E_1. \end{aligned}$$

Next, Rassias noticed that a similar result is also valid for \(p<0\), and Gajda in [29] proved it for \(p>1\) and provided an example showing that for \(p=1\) such an outcome is not possible.

In recent years, the Ulam stability of various (among others functional, difference, differential and integral) equations and other objects (for example groups, C*-algebras and flows) has been intensively studied (see for instance [6, 7, 11, 12, 25, 27, 30, 33, 35, 38, 39] and references therein).

In this paper, we prove the Ulam stability of two general functional equations in several variables in 2-Banach spaces. We also get, as corollaries from the main results, some outcomes on the stability of a few known equations being special cases of the considered ones. In particular, we thus extend several recent results on the stability of functional equations in 2-Banach spaces which were published in [3, 10, 14, 15, 18, 21, 22, 45].

Let us yet mention that in the proofs of our main results a variant of the fixed point method is applied. More precisely, we use a fixed point theorem of Diaz and Margolis from [24]. More information about the fixed point method one can find in [9, 17].

Throughout the paper \(\mathbb {N}\) stands for the set of all positive integers and we put \(\mathbb {N}_0 :=\mathbb {N}\cup \{0\}\). Moreover, we assume that \(n\in \mathbb {N}\), X is a linear space over the field \(\mathbb {F}\), and Y is a linear space over the field \(\mathbb {K}\).

2 Introduction

Let \(a_{11},a_{12},\ldots ,a_{n1},a_{n2}\in \mathbb {F}\), \(a_{1,j_1,\ldots ,j_n},\ldots ,a_{n,j_1,\ldots ,j_n}\in \mathbb {F}\) for \(j_1,\ldots ,j_n \in \{-1,1\}\) and \(A_{i_1,\ldots ,i_n}\in \mathbb {K}\) for \(i_1,\ldots ,i_n\in \{1,2\}\) be given scalars. Put, moreover,

$$\begin{aligned} A:=\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n} \end{aligned}$$

and assume that \(A\ne 0\).

We deal with the following functional equations:

$$\begin{aligned}&f(a_{11}x_{11}+a_{12}x_{12},\ldots , a_{n1}x_{n1}+a_{n2}x_{n2})\nonumber \\&\qquad =\sum \nolimits _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}f(x_{1{i_1}},\ldots ,x_{ni_n}) \end{aligned}$$
(2)

and

$$\begin{aligned}&\sum \nolimits _{j_1,\ldots ,j_n \in \{-1,1\}} f(a_{1,j_1,\ldots ,j_n}(x_{11}+j_1 x_{12}),\ldots , a_{n,j_1,\ldots ,j_n}(x_{n1}+j_n x_{n2}))\nonumber \\&\qquad =\sum \nolimits _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}f(x_{1{i_1}},\ldots ,x_{ni_n}). \end{aligned}$$
(3)

Equation (2) was very recently introduced in [20], and it generalizes among others the known functional equations

$$\begin{aligned}&f(x_{11}+x_{12},\ldots , x_{n1}+x_{n2})=\sum _{i_1,\ldots ,i_n\in \{1,2\}} f(x_{1{i_1}},\ldots ,x_{ni_n}),\\&\quad f\left( \frac{1}{2}x_{11}+\frac{1}{2}x_{12},\ldots , \frac{1}{2}x_{n1}+\frac{1}{2}x_{n2}\right) =\sum _{i_1,\ldots ,i_n\in \{1,2\}} \frac{1}{2^n}f(x_{1{i_1}},\ldots ,x_{ni_n})\nonumber \end{aligned}$$
(4)

and, for \(n\ge 2\) and \(1\le k<n\),

$$\begin{aligned}&f(x_{11}+x_{12},\ldots , x_{k1}+x_{k2}, \frac{1}{2}x_{k+11}+\frac{1}{2}x_{k+12},\ldots , \frac{1}{2}x_{n1}+\frac{1}{2}x_{n2})\nonumber \\&\qquad =\sum \nolimits _{i_1,\ldots ,i_n\in \{1,2\}} \frac{1}{2^{n-k}}f(x_{1{i_1}},\ldots ,x_{ni_n}) \end{aligned}$$
(5)

(see [5, 16, 43], and [20] for more details).

Let us also mention that the case \(n=2\) was studied in [19], and for \(n=1\), we get the linear functional equation

$$\begin{aligned} f(a_1x_1+a_2x_2)=A_1f(x_1)+A_2f(x_2), \end{aligned}$$
(6)

which includes, among others, the Cauchy equation and the famous Jensen functional equation

$$\begin{aligned} f\Big (\frac{x+y}{2}\Big )=\frac{f(x)+f(y)}{2}. \end{aligned}$$

A lot of information about the Cauchy and Jensen equations as well as their applications and stability can be found in [1, 35,36,37], whereas some very recent stability outcomes on Eq. (6) were published for instance in [2, 42] (see also [3], where the stability of yet another special case of (6) was considered in 2-Banach spaces).

A particular case of Eq. (2) is the functional equation

$$\begin{aligned}&\sum \nolimits _{j_1,\ldots ,j_n \in \{-1,1\}} f(x_{11}+j_1 x_{12},\ldots , x_{n1}+j_n x_{n2})\nonumber \\&\quad =\sum \nolimits _{i_1,\ldots ,i_n\in \{1,2\}} 2^n f(x_{1{i_1}},\ldots ,x_{ni_n}), \end{aligned}$$
(7)

which (see [34, 47], where its Ulam stability is also studied) characterizes the so-called n-quadratic mappings. For \(n=1\) it leads to the well-known Jordan–von Neumann equation

$$\begin{aligned} q(x+y)+q(x-y)=2q(x)+2q(y). \end{aligned}$$

A lot of information about solutions of the Jordan–von Neumann equation (i.e. quadratic mappings), its applications and Ulam stability can be found in [35, 36] (see also [23, 46] for some classical stability results on this equation). On the other hand, the case \(n=2\) was considered in [40].

Another particular case of Eq. (3), i.e. the functional equation

$$\begin{aligned}&f(x_{11}+x_{12},x_{21}+x_{22})+f(x_{11}+x_{12},x_{21}-x_{22})\nonumber \\&\qquad +f(x_{11}-x_{12},x_{21}+x_{22})+f(x_{11}-x_{12},x_{21}-x_{22})\nonumber \\&\quad =A_{1,1}f(x_{11},x_{21})+A_{1,2}f(x_{11},x_{22})\nonumber \\&\qquad +A_{2,1}f(x_{12},x_{21})+A_{2,2}f(x_{12},x_{22}), \end{aligned}$$
(8)

with \(A_{1,1}, A_{1,2}, A_{2,1}, A_{2,2}\ge 0\), was very recently investigated in [26], where its characterizations and representations of set-valued solutions are obtained.

3 Preliminaries

Let us recall that a 2-normed space was defined by Gähler in [28] as a pair \((X, \Vert \cdot , \cdot \Vert )\), where X is an at least two-dimensional real linear space and \(\Vert \cdot , \cdot \Vert :X\times X\rightarrow [0, \infty )\) is a mapping such that for any \(\alpha \in \mathbb {R},\, x, y, z\in X\), we have

$$\begin{aligned} \Vert x, y\Vert= & {} 0 \iff x\; \mathrm{and}\; y\; \mathrm{are}\; \mathrm{linearly}\; \mathrm{dependent},\\ \Vert x, y\Vert= & {} \Vert y, x\Vert ,\\ \Vert x, y+z\Vert\le & {} \Vert x, y\Vert +\Vert x, z\Vert ,\\ \Vert \alpha x, y\Vert= & {} |\alpha |\Vert x, y\Vert . \end{aligned}$$

The following known definitions and facts will be used in the sequel.

Let \((x_k )_{k\in \mathbb {N}}\) be a sequence of elements of a 2-normed space \((X, \Vert \cdot , \cdot \Vert )\). This sequence is called Cauchy if there exist linearly independent \(y, z\in X\) for which

$$\begin{aligned} \lim _{n,m\rightarrow \infty }\Vert x_n -x_m , y\Vert =0=\lim _{n,m\rightarrow \infty }\Vert x_n -x_m , z\Vert , \end{aligned}$$

while \((x_n )_{n\in \mathbb {N}}\) is said to be convergent provided there is an \(x\in X\) with

$$\begin{aligned} \lim _{k\rightarrow \infty }\Vert x_k -x, y\Vert =0,\quad y\in X. \end{aligned}$$

In the latter case, the element x is called the limit of the sequence \((x_k)_{k\in \mathbb {N}}\) and we denote it by \(\lim _{k\rightarrow \infty }x_k\). Clearly, every convergent sequence possesses a unique limit. Moreover, the standard properties of the limit of a sum and a scalar product hold.

By a 2-Banach space we mean a 2-normed space such that each its Cauchy sequence is convergent.

Remark 1

Assume that \((X, \Vert \cdot , \cdot \Vert )\) is a 2-normed space and \((x_k)_{k\in \mathbb {N}}\) is a sequence of elements of X. Then

  1. (i)

    if \(x\in X\) and \(\Vert x, y\Vert =0\) for any \(y\in X\), then \(x=0\);

  2. (ii)

    if the sequence \((x_k)_{k\in \mathbb {N}}\) is convergent, then

    $$\begin{aligned} \lim _{k\rightarrow \infty }\Vert x_k , y\Vert =\big \Vert \lim _{k\rightarrow \infty }x_k , y\big \Vert ,\quad y\in X. \end{aligned}$$

Let us also recall that a pair (Gd) is said to be a generalized metric space provided G is a nonempty set and \(d :G\times G\rightarrow [0,\, \infty ]\) is a function satisfying the standard metric axioms.

The following result from [24] plays a crucial role in the proof of the main results of this paper.

Proposition 2

Assume that \(({\mathcal {G}}, d)\) is a complete generalized metric space and \(T:{\mathcal {G}}\rightarrow {\mathcal {G}}\) is a strictly contractive operator with the Lipschitz constant \(L<1\). If there are \(n_0\in \mathbb {N}_0\) and \(x\in {\mathcal {G}}\) such that \(d(T^{n_{0}+1}x,\, T^{n_{0}}x)<\infty \), then:

  1. (i)

    the sequence \((T^j x)_{j\in \mathbb {N}}\) is convergent, and its limit \(x^*\) is a fixed point of the operator T;

  2. (ii)

    \(x^*\) is the unique fixed point of T in the set

    $$\begin{aligned} {\mathcal {G}}^*:=\{y\in {\mathcal {G}}: d(T^{n_{0}}x, y)<\infty \}; \end{aligned}$$
  3. (iii)

    if \(y\in {\mathcal {G}}^*\), then

    $$\begin{aligned} d(y, x^*)\le \frac{1}{1-L}d(Ty, y). \end{aligned}$$

4 Main results

In this section, we prove the Ulam stability of functional equations (2) and (3). We start with the first of them.

Theorem 3

Assume that Y is a 2-Banach space, \(|A|>1\) and \(\varepsilon >0\). If \(f:X^{n} \rightarrow Y\) is a function satisfying

$$\begin{aligned}&\bigg \Vert f(a_{11}x_{11}+a_{12}x_{12}, \ldots , a_{n1}x_{n1}+a_{n2}x_{n2})\nonumber \\&\quad -\sum \nolimits _{i_1, \ldots , i_n\in \{1,2\}} A_{i_1, \ldots ,i_n}f(x_{1{i_1}}, \ldots , x_{ni_n}), y\bigg \Vert \le \varepsilon \end{aligned}$$
(9)

for \((x_{11}, x_{12}, \ldots , x_{n1}, x_{n2})\in X^{2n}\) and \(y\in Y\), then there exists a unique solution \(F :X^{n}\rightarrow Y\) of Eq. (2) for which

$$\begin{aligned}&\Vert f(x_{1}, \ldots , x_{n})-F(x_{1} , \ldots , x_{n}), y\Vert \le \frac{\varepsilon }{|A|-1},\nonumber \\&\quad (x_{1}, \ldots , x_{n})\in X^{n},\; y\in Y. \end{aligned}$$
(10)

The mapping F is given by

$$\begin{aligned} F(x_{1},\ldots ,x_{n}):=\lim _{j\rightarrow \infty }\frac{f(a_1^jx_{1}, \ldots ,a_n^jx_{n})}{A^{j}},\quad (x_{1}, \ldots ,x_{n})\in X^n. \end{aligned}$$
(11)

Proof

Let us consider a complete generalized metric space \(({\mathcal {G}}, d)\), where

$$\begin{aligned} {\mathcal {G}}:=Y^{X^{n}} \end{aligned}$$

and

$$\begin{aligned} d (g, h):= & {} \inf \{C\in [0, \infty ]: \Vert g(x_1, \ldots , x_{n})-h(x_1, \ldots , x_{n}), y\Vert \\\le & {} C\varepsilon ,\, (x_1 , \ldots , x_{n})\in X^{n},\; y\in Y\},\quad g, h\in {\mathcal {G}}. \end{aligned}$$

Put also

$$\begin{aligned} a_i:=a_{i1}+a_{i2},\quad i\in \{1,\ldots ,n\} \end{aligned}$$

and

$$\begin{aligned} T g(x_1, \ldots , x_{n}):=\frac{1}{A}g(a_1x_1, \ldots , a_nx_{n}),\quad g\in {\mathcal {G}},\, (x_1, \ldots , x_{n})\in X^{n}. \end{aligned}$$

We show that \(T:{\mathcal {G}}\rightarrow {\mathcal {G}}\) is a strictly contractive operator with the Lipschitz constant \(\frac{1}{|A|}\). To do this, fix \(g, h\in {\mathcal {G}}\), \((x_1 , \ldots , x_{n})\in X^{n}\), \(y\in Y\) and \(C_{g,h}\in [0, \infty ]\) with \(d (g, h)\le C_{g,h}\). Then

$$\begin{aligned} \Vert g(x_1 , \ldots , x_{n})-h(x_1 , \ldots , x_{n}), y\Vert \le C_{g,h}\varepsilon , \end{aligned}$$
(12)

and consequently

$$\begin{aligned}&\Vert T g(x_1, \ldots , x_{n})- T h(x_1, \ldots , x_{n}), y\Vert \\&\quad =\frac{1}{|A|}\Vert g(a_1x_1 , \ldots , a_nx_{n})-h(a_1x_1, \ldots , a_nx_{n}), y\Vert \le \frac{1}{|A|}C_{g,h}\varepsilon . \end{aligned}$$

Therefore, \(d (T g, T h)\le \frac{1}{|A|}C_{g,h}\) and \(d (T g, T h)\le \frac{1}{|A|}d (g,h)\), as claimed.

Let us next observe that from (9) it follows that

$$\begin{aligned}&\Vert T f(x_1 , \ldots , x_{n})-f(x_1 , \ldots , x_{n}), y\Vert \\&\quad =\left\| \frac{1}{A}f(a_1x_1 , \ldots , a_nx_{n})-f(x_1, \ldots , x_{n}), y\right\| \le \frac{1}{|A|}\varepsilon , \end{aligned}$$

and thus

$$\begin{aligned} d(T f, f)\le \frac{1}{|A|}<\infty . \end{aligned}$$
(13)

We can now apply Proposition 2 for the space \(({\mathcal {G}}, d)\), the operator T, \(L=\frac{1}{|A|}\), \(n_0=0\) and \(x=f\) to deduce that the sequence \((T ^j f)_{j\in \mathbb {N}}\) is convergent in \(({\mathcal {G}}, d)\) and its limit F is a fixed point of T.

Thus,

$$\begin{aligned} F(x_1, \ldots , x_{n})=\lim _{j\rightarrow \infty } T^j f(x_1, \ldots , x_{n}) \end{aligned}$$
(14)

and

$$\begin{aligned} \frac{1}{A}F(a_1x_1, \ldots , a_nx_{n})=F(x_1, \ldots , x_{n}). \end{aligned}$$
(15)

Since, by induction, we also have

$$\begin{aligned} T^j f(x_1, \ldots , x_{n})=\frac{1}{A^{j}}f(a_1^j x_1, \ldots , a_n^j x_{n}),\quad j\in \mathbb {N} \end{aligned}$$

(11) follows.

Next, note that obviously \(f\in {\mathcal {G}}^*\), and therefore, Proposition 2(iii) and (13) imply

$$\begin{aligned} d(f, F)\le \frac{1}{1-\frac{1}{|A|}}d(T f, f)\le \frac{1}{|A|-1}, \end{aligned}$$

which proves (10).

Let us now observe that from (9) we get

$$\begin{aligned}&\left\| \frac{f(a_1^j(a_{11}x_{11}+a_{12}x_{12}),\ldots , a_n^j(a_{n1}x_{n1}+a_{n2}x_{n2}))}{A^j}\right. \\&\quad \left. -\sum \nolimits _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}\frac{f(a_1^jx_{1{i_1}},\ldots ,a_n^jx_{ni_n})}{A^j}, y\right\| \le \frac{\varepsilon }{|A|^j} \end{aligned}$$

for \((x_{11},x_{12},\ldots , x_{n1},x_{n2})\in X^{2n}\), \(y\in Y\) and \(j\in \mathbb {N}_0\). Letting \(j\rightarrow \infty \), and applying (11) and Remark 1(ii) we deduce hence that

$$\begin{aligned}&\bigg \Vert F(a_{11}x_{11}+a_{12}x_{12},\ldots , a_{n1}x_{n1}+a_{n2}x_{n2})\\&\quad -\sum \nolimits _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}F(x_{1{i_1}},\ldots ,x_{ni_n}), y\bigg \Vert \le 0 \end{aligned}$$

for \((x_{11},x_{12},\ldots , x_{n1},x_{n2})\in X^{2n}\) and \(y\in Y\), and thus by Remark 1(i) we see that the mapping \(F:X^n\rightarrow Y\) is a solution of functional equation (2).

Let us finally suppose that \(F' :X^{n}\rightarrow Y\) is a solution of Eq. (2) fulfilling inequality (10). Then \(F'\) satisfies (15), and therefore, it is a fixed point of the operator T. Furthermore, by (10), we obtain

$$\begin{aligned} d(f, F')\le \frac{1}{|A|-1}<\infty , \end{aligned}$$

and consequently \(F'\in {\mathcal {G}}^*\). Proposition 2(ii) now shows that \(F' =F\). \(\square \)

Next, we show the stability of Eq. (3).

Theorem 4

Assume that Y is a 2-Banach space, \(|A|>1\) and \(\varepsilon >0\). If \(f:X^n\rightarrow Y\) is a function such that \(f(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero and

$$\begin{aligned}&\left\| \sum _{j_1,\ldots ,j_n \in \{-1,1\}} f(a_{1,j_1,\ldots ,j_n}(x_{11}+j_1 x_{12}),\ldots , a_{n,j_1,\ldots ,j_n}(x_{n1}+j_n x_{n2}))\right. \nonumber \\&\quad \left. -\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}f(x_{1{i_1}},\ldots ,x_{ni_n}), y\right\| \le \varepsilon \end{aligned}$$
(16)

for \((x_{11}, x_{12}, \ldots , x_{n1}, x_{n2})\in X^{2n}\) and \(y\in Y\), then there exists a unique solution \(F :X^{n}\rightarrow Y\) of Eq. (3) such that inequality (10) holds and \(F(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero. The mapping F is given by

$$\begin{aligned} F(x_{1},\ldots ,x_{n})= & {} \lim \nolimits _{j\rightarrow \infty }\frac{1}{A^{j}}f\big ((2a_{1,1,\ldots ,1})^jx_{1},\ldots , (2a_{n,1,\ldots ,1})^jx_{n}\big ),\nonumber \\&(x_{1},\ldots ,x_{n})\in X^n. \end{aligned}$$
(17)

Proof

Let us consider a complete generalized metric space \(({\mathcal {G}}, d)\), where

$$\begin{aligned} {\mathcal {G}}:= & {} \{f:X^n\rightarrow Y: f(x_{1},\ldots ,x_{n})=0\; \mathrm{for} \; \mathrm{any} \; (x_{1},\ldots ,x_{n})\in X^n \\&\mathrm{with} \; \mathrm{at} \; \mathrm{least} \; \mathrm{one} \; \mathrm{component}\; \mathrm{which} \; \mathrm{is} \; \mathrm{equal} \; \mathrm{to} \; \mathrm{zero}\} \end{aligned}$$

and d is as in the proof of Theorem 3. Put also

$$\begin{aligned} T g(x_1 , \ldots , x_{n}):= & {} \frac{1}{A}g(2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n}),\\&\quad g\in {\mathcal {G}},\, (x_1 , \ldots , x_{n})\in X^{n}. \end{aligned}$$

We show that \(T:{\mathcal {G}}\rightarrow {\mathcal {G}}\) is a strictly contractive operator with the Lipschitz constant \(\frac{1}{|A|}\). To do this, fix \(g, h\in {\mathcal {G}}\), \((x_1 , \ldots , x_{n})\in X^{n}\), \(y\in Y\) and \(C_{g,h}\in [0, \infty ]\) with \(d (g, h)\le C_{g,h}\). Then (12) holds, whence

$$\begin{aligned}&\Vert T g(x_1 , \ldots , x_{n})- T h(x_1 , \ldots , x_{n}), y\Vert \\&\quad =\frac{1}{|A|}\Vert g(2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n})-h(2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n}), y\Vert \\&\quad \le \frac{1}{|A|}C_{g,h}\varepsilon , \end{aligned}$$

and thus T is strictly contractive with the constant \(\frac{1}{|A|}\).

Let us next observe that from (16) and the fact that \(f(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero it follows that

$$\begin{aligned}&\Vert T f(x_1 , \ldots , x_{n})-f(x_1 , \ldots , x_{n}), y\Vert \\&\quad =\left\| \frac{1}{A}f(2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n})-f(x_1 , \ldots , x_{n}), y\right\| \le \frac{\varepsilon }{|A|}, \end{aligned}$$

and thus (13) holds true. From Proposition 2, we see that the sequence \((T ^j f)_{j\in \mathbb {N}}\) is convergent in \(({\mathcal {G}}, d)\) and its limit F is a fixed point of T.

Therefore, we get (14) and

$$\begin{aligned} \frac{1}{A}F(2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n})=F(x_1 , \ldots , x_{n}). \end{aligned}$$
(18)

Since, by induction, we also have

$$\begin{aligned} T^j f(x_1 , \ldots , x_{n})=\frac{1}{A^{j}}f((2a_{1,1,\ldots ,1})^j x_1 , \ldots , (2a_{n,1,\ldots ,1})^j x_{n}),\quad j\in \mathbb {N}, \end{aligned}$$

(17) follows.

Let us now observe that inequality (10) can be shown as in the proof of Theorem 3.

Next, from (16) we get

$$\begin{aligned}&\left\| \sum \nolimits _{j_1,\ldots ,j_n \in \{-1,1\}} \frac{1}{A^j}f\big ((2a_{1,1,\ldots ,1})^{j}a_{1,j_1,\ldots ,j_n}(x_{11}+j_1 x_{12}),\ldots ,\right. \\&\quad (2a_{n,1,\ldots ,1})^{j}a_{n,j_1,\ldots ,j_n}(x_{n1}+j_n x_{n2})\big )\\&\quad \left. -\sum \nolimits _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}\frac{1}{A^j}f\big ((2a_{1,1,\ldots ,1})^jx_{1{i_1}},\ldots ,(2a_{n,1,\ldots ,1})^jx_{ni_n}\big ), y\right\| \\&\quad \le \frac{\varepsilon }{|A|^j} \end{aligned}$$

for \((x_{11},x_{12},\ldots , x_{n1},x_{n2})\in X^{2n}\), \(y\in Y\) and \(j\in \mathbb {N}_0\). Letting \(j\rightarrow \infty \), and applying (17) and Remark 1 we deduce hence that the mapping \(F:X^n\rightarrow Y\) is a solution of functional Eq. (3).

Let us finally suppose that \(F' :X^{n}\rightarrow Y\) is a solution of Eq. (3) such that inequality (10) holds and \(F'(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero. Then \(F'\) satisfies (18), and therefore it is a fixed point of the operator T. As in the proof of Theorem 3 we now conclude that \(F' =F\). \(\square \)

5 Some consequences

Now, we present some consequences of Theorems 3 and 4. First, we deduce from them a few outcomes on the stability of the functional equations mentioned in Sect. 2.

Let us start with the case \(a_{11}=a_{12}=\ldots =a_{n1}=a_{n2}=1\) and \(A_{i_1,\ldots ,i_n}=1\) for \(i_1,\ldots ,i_n\in \{1,2\}\). Then from Theorem 3 we get the following outcome on the Ulam stability of functional equation (4) (see [18] and note that for \(n=1\) it clearly means the stability of the Cauchy equation, which was investigated, among others, in [10, 14, 15]).

Corollary 5

Assume that Y is a 2-Banach space and \(\varepsilon >0\). If \(f:X^n\rightarrow Y\) is a function satisfying

$$\begin{aligned} \left\| f(x_{11}+x_{12},\ldots , x_{n1}+x_{n2})-\sum _{i_1,\ldots ,i_n\in \{1,2\}} f(x_{1{i_1}},\ldots ,x_{ni_n}), y\right\| \le \varepsilon \end{aligned}$$

for \((x_{11},x_{12},\ldots , x_{n1},x_{n2})\in X^{2n}\) and \(y\in Y\), then there is a unique solution \(F:X^n\rightarrow Y\) of Eq. (4) such that

$$\begin{aligned}&\Vert f(x_1,\ldots ,x_n)-F(x_1,\ldots ,x_n), y\Vert \le \frac{\varepsilon }{2^n-1},\\&\quad (x_{1},\ldots , x_{n})\in X^n,\; y\in Y. \end{aligned}$$

The mapping F is given by

$$\begin{aligned} F(x_{1},\ldots ,x_{n}):=\lim _{j\rightarrow \infty }\frac{f(2^jx_{1},\ldots ,2^jx_{n})}{2^{jn}},\quad (x_{1},\ldots ,x_{n})\in X^n. \end{aligned}$$

Let us next note that Theorem 3 is a generalization of Theorem 3.3 in [19], and thus its consequences are also some further results on the Ulam stability of a few known functional equations (see [19] for the details).

Theorem 3 with \(n=1\) gives also obviously some stability outcomes on Eq. (6), and thus on its particular case \(a_1=A_1, a_2=A_2\in \mathbb {N}\) which was studied in [3].

Now, we present some consequences of Theorem 4.

Let us first consider the case \(a_{1,j_1,\ldots ,j_n}=\ldots =a_{n,j_1,\ldots ,j_n}=1\) for \(j_1,\ldots ,j_n \in \{-1,1\}\) and \(A_{i_1,\ldots ,i_n}=2^n\) for \(i_1,\ldots ,i_n\in \{1,2\}\). Then from Theorem 4 we get the following outcome on the Ulam stability of functional equation (7) (see [22] and note that for \(n=1\) it clearly means the stability of the Jordan–von Neumann equation, which was investigated, among others, in [14, 15, 45]).

Corollary 6

Assume that Y is a 2-Banach space and \(\varepsilon >0\). If \(f:X^n\rightarrow Y\) is a function such that \(f(x_{1}, \ldots ,x_{n})=0\) for any \((x_{1}, \ldots ,x_{n})\in X^n\) with at least one component which is equal to zero and

$$\begin{aligned}&\left\| \sum \nolimits _{j_1, \ldots ,j_n \in \{-1,1\}} f(x_{11}+j_1 x_{12}, \ldots , x_{n1}+j_n x_{n2})\right. \\&\left. \quad -\sum \nolimits _{i_1, \ldots ,i_n\in \{1,2\}} 2^nf(x_{1{i_1}}, \ldots ,x_{ni_n}), y\right\| \le \varepsilon \end{aligned}$$

for \((x_{11}, x_{12}, \ldots , x_{n1}, x_{n2})\in X^{2n}\) and \(y\in Y\), then there exists a unique solution \(F :X^{n}\rightarrow Y\) of Eq. (7) such that \(F(x_{1}, \ldots ,x_{n})=0\) for any \((x_{1}, \ldots ,x_{n})\in X^n\) with at least one component which is equal to zero and

$$\begin{aligned}&\Vert f(x_1,\ldots ,x_n)-F(x_1,\ldots ,x_n), y\Vert \le \frac{\varepsilon }{4^n-1},\\&\quad (x_{1},\ldots , x_{n})\in X^n, y\in Y. \end{aligned}$$

The mapping F is given by

$$\begin{aligned} F(x_{1},\ldots ,x_{n}):=\lim _{j\rightarrow \infty }\frac{f(2^jx_{1},\ldots ,2^jx_{n})}{4^{jn}},\quad (x_{1},\ldots ,x_{n})\in X^n. \end{aligned}$$

Let us next note that Theorem 4 is a generalization of Theorem 2 in [21].

As for the Ulam stability of Eq. (8), Theorem 4 with \(n=2\), \(a_{1,1,1}=a_{2,1,1}=a_{1,1,-1}=a_{2,1,-1}=a_{1,-1,1}=a_{2,-1,1}=a_{1,-1,-1}=a_{2,-1,-1}=1\) yields the following.

Corollary 7

Assume that Y is a 2-Banach space, \(|A|>1\) and \(\varepsilon >0\). If \(f:X^2\rightarrow Y\) is a function such that

$$\begin{aligned} f(x_{1}, 0)=0=f(0, x_{2}), \quad (x_{1}, x_{2})\in X^2 \end{aligned}$$
(19)

holds and

$$\begin{aligned}&\big \Vert f(x_{11}+x_{12},x_{21}+x_{22})+f(x_{11}+x_{12},x_{21}-x_{22})\\&\quad +f(x_{11}-x_{12},x_{21}+x_{22})+f(x_{11}-x_{12},x_{21}-x_{22})\\&\quad -A_{1,1}f(x_{11},x_{21})-A_{1,2}f(x_{11},x_{22})\\&\quad -A_{2,1}f(x_{12},x_{21})-A_{2,2}f(x_{12},x_{22}), y\big \Vert \le \varepsilon \end{aligned}$$

for \((x_{11}, x_{12}, x_{21}, x_{22})\in X^{4}\) and \(y\in Y\), then there exists a unique solution \(F :X^{2}\rightarrow Y\) of Eq. (8) fulfilling condition (19) and

$$\begin{aligned} \Vert f(x_1, x_2)-F(x_1, x_2)\Vert \le \frac{\varepsilon }{|A|-1},\quad (x_1, x_2)\in X^2,\; y\in Y. \end{aligned}$$

The mapping F is given by

$$\begin{aligned} F(x_1, x_2)=\lim _{j\rightarrow \infty }\frac{1}{A^{j}}f\big (2^jx_1, 2^jx_2\big ),\quad (x_1, x_2)\in X^2. \end{aligned}$$

Finally, we derive from Theorem 4 the Ulam stability of the functional equations

$$\begin{aligned}&f(x_{11}+x_{12}, x_{21}+x_{22})+f(x_{11}-x_{12}, x_{21}-x_{22})\nonumber \\&\quad =2f(x_{11}, x_{21})+2f(x_{11}, x_{22}) \end{aligned}$$
(20)

and

$$\begin{aligned}&f(x_{11}+x_{12},x_{21}+x_{22})+f(x_{11}+x_{12},x_{21}-x_{22})\nonumber \\&\quad =2f(x_{11},x_{21})+2f(x_{11},x_{22})+2f(x_{12},x_{21})+2f(x_{12},x_{22}) \end{aligned}$$
(21)

(let us mention that the stability of Eq. (20) in Banach spaces was very recently studied in [31], whereas Eq. (21) was introduced and studied in [41]).

Theorem 4 with \(n=2\), \(a_{1,1,1}=a_{2,1,1}=a_{1,-1,-1}=a_{2,-1,-1}=1\), \(a_{1,1,-1}=a_{2,1,-1}=a_{1,-1,1}=a_{2,-1,1}=0\), \(A_{1,1}=A_{1,2}=2\) and \(A_{2,1}=A_{2,2}=0\) gives the following outcome on the stability of Eq. (20).

Corollary 8

Assume that Y is a 2-Banach space and \(\varepsilon >0\). If \(f:X^2\rightarrow Y\) is a function such that condition (19) holds and

$$\begin{aligned}&\Big \Vert f(x_{11}+x_{12}, x_{21}+x_{22})+f(x_{11}-x_{12}, x_{21}-x_{22})\\&\quad -2f(x_{11}, x_{21})-2f(x_{11}, x_{22}), y\Big \Vert \le \varepsilon \end{aligned}$$

for \((x_{11}, x_{12}, x_{21}, x_{22})\in X^{4}\) and \(y\in Y\), then there exists a unique solution \(F :X^{2}\rightarrow Y\) of Eq. (20) fulfilling (19) and

$$\begin{aligned} \Vert f(x_{1}, x_{2})-F(x_{1}, x_{2}), y\Vert \le \frac{\varepsilon }{3},\quad (x_{1}, x_{2})\in X^2,\; y\in Y. \end{aligned}$$

The mapping F is given by

$$\begin{aligned} \begin{array}{cc} F(x_{1}, x_{2})=\lim _{j\rightarrow \infty }\frac{1}{4^{j}}f\big (2^jx_{1}, 2^jx_{2}\big ),\quad (x_{1}, x_{2})\in X^2. \end{array} \end{aligned}$$

On the other hand, applying Theorem 4 with \(n=2\), \(a_{1,1,1}=a_{2,1,1}=a_{1,1,-1}=a_{2,1,-1}=1\), \(a_{1,-1,1}=a_{2,-1,1}=a_{1,-1,-1}=a_{2,-1,-1}=0\), \(A_{1,1}=A_{1,2}=A_{2,1}=A_{2,2}=2\) we obtain the following.

Corollary 9

Assume that Y is a 2-Banach space and \(\varepsilon >0\). If \(f:X^2\rightarrow Y\) is a function such that (19) holds and

$$\begin{aligned}&\big \Vert f(x_{11}+x_{12},x_{21}+x_{22})+f(x_{11}+x_{12},x_{21}-x_{22})\\&\quad -2f(x_{11},x_{21})-2f(x_{11},x_{22})-2f(x_{12},x_{21})-2f(x_{12},x_{22}), y\big \Vert \le \varepsilon \end{aligned}$$

for \((x_{11}, x_{12}, x_{21}, x_{22})\in X^{4}\) and \(y\in Y\), then there exists a unique solution \(F :X^{2}\rightarrow Y\) of Eq. (21) fullfiling (19) and

$$\begin{aligned} \Vert f(x_1, x_2)-F(x_1, x_2), y\Vert \le \frac{\varepsilon }{7},\quad (x_1, x_2)\in X^2,\; y\in Y. \end{aligned}$$

The mapping F is given by

$$\begin{aligned} F(x_1, x_2)=\lim _{j\rightarrow \infty }\frac{1}{8^{j}}f\big (2^jx_1, 2^jx_2\big ),\quad (x_1, x_2)\in X^2. \end{aligned}$$