1 Introduction and preliminaries

The study of modulars and modular spaces as generalizations of metric spaces was initiated by Nakano [20]. Since then several mathematicians, for example, Luxemburg, Mazur, Musielak and Orlicz [14, 16, 18, 19] developed it extensively. Up to now, the theory of modulars and modular spaces is widely applied in interpolation theory and Orlicz spaces.

To begin with, we consider some basic concepts concerning modular spaces.

Definition 1.1

([20]) Let X be a vector space over a field \(\mathbb {K}\) (\(\mathbb {R}\) or \(\mathbb {C}\)). A generalized function \(\rho :X\rightarrow [0,\infty ]\) is called a modular if for any \(\alpha ,\beta \in \mathbb {K}\) and \(x,y\in X\),

  1. (M1)

    \(\rho (x)=0\) if and only if \(x=0\),

  2. (M2)

    \(\rho (\alpha x)=\rho (x)\) for every \(\alpha \) with \(|\alpha |=1\),

  3. (M3)

    \(\rho (\alpha x+\beta y)\le \rho (x)+\rho (y)\) if \(\alpha +\beta =1\) and \(\alpha , \beta \ge 0\).

If the condition (M3) is replaced by

  1. (M4)

    \(\rho (\alpha x+\beta y)\le \alpha ^s\rho (x)+\beta ^s\rho (y)\) if \(\alpha ^s+\beta ^s=1\) and \(\alpha , \beta \ge 0\) with an \(s\in (0,1]\),

then \(\rho \) is called an s-convex modular. 1-convex modulars are called convex modulars.

For a modular \(\rho \), there corresponds a linear subspace \(X_{\rho }\) of X, given by

$$\begin{aligned} X_{\rho }=\{x\in X~|~\rho (\lambda x)\rightarrow 0~\text { as}~ \lambda \rightarrow 0\}. \end{aligned}$$

\(X_{\rho }\) is called a modular space.

Definition 1.2

Let \(X_{\rho }\) be a modular space and \(\{x_n\}\) be a sequence in \(X_{\rho }\).

  1. (1)

    \(\{x_n\}\) is \(\rho \)-convergent to a point \(x\in X_{\rho }\) if \(\rho (x_n-x)\rightarrow 0\) as \(n\rightarrow \infty \). The point x is called the \(\rho \)-limit of the sequence \(\{x_n\}\) and we write \(x_n{\mathop {\rightarrow }\limits ^{\rho }}x\).

  2. (2)

    \(\{x_n\}\) is called a \(\rho \)-Cauchy sequence if for any \(\varepsilon >0\) one has \(\rho (x_n-x_m)<\varepsilon \) for sufficiently large \(m,n\in \mathbb {N}\).

  3. (3)

    A subset \(S\subseteq X_{\rho }\) is called \(\rho \)-complete if every \(\rho \)-Cauchy sequence in S is \(\rho \)-convergent to a point of S.

Remark 1.3

Note that for a fixed \(x\in X_{\rho }\), the function \(\lambda ~(\in \mathbb {R})\mapsto \rho (\lambda x)\) is nondecreasing. If \(\rho \) is a convex modular and \(0<\lambda \le 1\), we have \(\rho (x)\le \lambda \rho \left( \frac{1}{\lambda }x\right) \) for all \(x\in X_{\rho }\). If \(x_n\xrightarrow {\rho }x\) and \(y_n\xrightarrow {\rho }y\), then \(\alpha x_n+\beta y_n\xrightarrow {\rho }\alpha x+\beta y\), where \(\alpha +\beta \le 1\) and \(\alpha ,\beta \ge 0\). The \(\rho \)-convergence of a sequence \(\{x_n\}\) to x does not imply that \(\{cx_n\}\) is \(\rho \)-convergent to cx for scalar c with \(|c|>1\). Thus, additional conditions on modular spaces were imposed by many mathematicians so that the sequence \(\{cx_n\}\) is \(\rho \)-convergent to cx for scalar c.

A modular \(\rho \) is said to have the Fatou property if \(\rho (x)\le \liminf _{n\rightarrow \infty }\rho (x_n)\) whenever the sequence \(\{x_n\}\) is \(\rho \)-convergent to x. A modular \(\rho \) is said to satisfy the \(\Delta _2\)-condition if there exists \(\kappa \ge 0\) such that \(\rho (2x)\le \kappa \rho (x)\) for all \(x\in X_{\rho }\).

Example 1.4

We consider Orlicz spaces as prototypes of modular spaces. Let \(\phi : [0,\infty )\rightarrow \mathbb {R}\) be a function such that \(\phi (0)=0, \phi (t)>0\) for \(t>0\), and \(\phi (t)\rightarrow \infty \) as \(t\rightarrow \infty \). If moreover \(\phi \) is continuous, convex and nondecreasing, then \(\phi \) is called an Orlicz function. For a measure space \((\Omega ,\Sigma ,\mu )\), let \(L^0(\mu )\) be the set of all measurable functions on \(\Omega \). Define for \( f\in L^0(\mu )\),

$$\begin{aligned} \rho _{\phi }(f)=\int _{\Omega }\phi (|f|)d\mu . \end{aligned}$$

Then \(\rho _{\phi }\) is a modular and the corresponding modular space is called an Orlicz space and denoted by

$$\begin{aligned} L^{\phi }=\{f\in L^0(\mu )~|~\rho _{\phi }(\lambda f)\rightarrow 0~\text {as}~\lambda \rightarrow 0\}. \end{aligned}$$

\(L^{\phi }\) is known to be \(\rho _{\phi }\)-complete.

We say that an equation is stable if any function satisfying the equation approximately is near to an exact solution of the equation. We also say that an equation is hyperstable if every approximate solution is an exact solution of the functional equation. In 1940, Ulam [28] raised the first stability problem. He proposed a question whether there exists an exact homomorphism near an approximate homomorphism. An answer to the problem was given by Hyers [9] in the setting of Banach spaces. Since then the stability problems have been extensively investigated for a variety of functional equations and spaces. We refer to [1,2,3, 6, 7, 10, 11, 24] for results, references and examples.

In most cases, a functional equation is algebraic in nature whereas the stability is rather metrical. Hence, a normed linear space is a suitable choice to work with the stability of functional equations. However, there are a great number of linear topological spaces whose topologies are not normable. Nakano [20] and Musielak and Orlicz [18] successfully considered replacing a norm by a so-called modular. A modular yields less properties than a norm does, but it makes a more sense in many special situations. When we work in a modular space, it is frequently assumed that the modular satisfies extra additional properties like some relaxed continuity or some \(\Delta _2\)-condition (see [12] for example).

Recently, Sadeghi [25] showed the stability of the Cauchy and Jensen functional equations on modular spaces. Wongkum et al. [29, 30] obtained stability results of the quadratic and quartic functional equations in modular spaces equipped with the Fatou property but without \(\Delta _2\)-condition. Cho et al. [4] presented a fixed point method to prove the generalized Hyers–Ulam stability of the system of additive-quadratic-cubic functional equations in \(\beta \)-homogeneous probabilitistic modular spaces. Also, Gordji et al. [8] proved a generalized Hyers–Ulam stability of Cauchy mappings in modular spaces endowed with a partial order. In [13], by using the direct method, the authors obtained the refined stability of additive and quadratic functional equations in modular spaces, which generalizes the results of [25] and [29]. In [22], the authors investigated the stability of additive and Jensen-additive functional equations without using the \(\Delta _2\)-condition by a fixed point method.

Let us recall that a pair \((G,[\cdot ])\), where G is a non-empty set and \([\cdot ]:G^3\rightarrow G\) is a function (which is said to be a ternary operation), is called a ternary groupoid. Given a mapping \(\oplus :G^2\rightarrow G\), we can define a ternary operation \([\cdot ]\) on G by

$$\begin{aligned}{}[xyz]:=(x\oplus y)\oplus z,\quad x,y,z\in G. \end{aligned}$$

Then we say that the operation \([\cdot ]\) is derived from \(\oplus \). Every linear space can be considered as a ternary groupoid with an operation derived from a vector space addition.

A ternary groupoid is said to be commutative if

$$\begin{aligned}{}[x_1x_2x_3]=[x_{\sigma (1)}x_{\sigma (2)}x_{\sigma (3)}],\quad x_1,x_2,x_3\in G,~ \sigma \in S_3, \end{aligned}$$

where \(S_3\) denotes the set of all permutations of the set \(\{1,2,3\}\).

We say that the ternary groupoid \((G,[\cdot ])\) is a ternary semigroup if the operation \([\cdot ]\) is associative, i.e., if

$$\begin{aligned}{}[[xyz]uv]=[x[yzu]v]=[xy[zuv]],\quad x,y,z,u,v\in G. \end{aligned}$$

It is obvious that linear spaces with binary \(+\) and associative algebras with multiplication are ternary semigroups.

Ternary algebraic structures appear in various domains of theoretical and mathematical physics (for example, the so-called “Nambu mechanics” which has been proposed by Nambu, and the algebra of “nonions”, which was introduced by Sylvester as a ternary analog of Hamilton’s quarternions).

Let \((G_1,[\cdot ]_1)\) and \((G_2,[\cdot ]_2)\) be ternary groupoids. A mapping \(f:G_1\rightarrow G_2\) is called a ternary homomorphism if

$$\begin{aligned} f([xyz]_1)=[f(x)f(y)f(z)]_2,\quad x,y,z\in G_1. \end{aligned}$$

In 2006, Amyari and Moslehian [1] proved the generalized Hyers–Ulam stability of ternary homomorphisms from commutative ternary semigroups into Banach spaces. In 2017, Ciepliński [5] generalized their result to n-Banach spaces as well as to non-Archimedean normed spaces. We refer the readers to [17, 23, 26, 27] and the references therein for more results.

The contents of the paper are as follows:

In Sect. 2, we prove the above mentioned result for modular spaces without using Fatou property and \(\Delta _2\)-condition.

In Sect. 3, since s-convex modular spaces can be made into s-homogeneous normed spaces we prove a similar result for \(\beta \)-homogeneous Banach spaces.

In Sect. 4, we show a hyperstability of an approximate homomorphism from ternary semigroups into normed algebras.

Throughout this paper we write \(x^3\) as [xxx].

2 Stability of ternary homomorphisms into modular spaces

We show the generalized Hyers–Ulam stability of ternary homomorphisms from commutative ternary semigroups into modular spaces.

Theorem 2.1

Let G be a ternary semigroup, \(X_{\rho }\) be a \(\rho \)-complete modular space where \(\rho \) is convex, and \(\varphi :G^3\rightarrow [0,\infty )\) be a function with

$$\begin{aligned} \widehat{\varphi }(x,y,z):=\frac{1}{3}\sum _{k=0}^{\infty }\frac{1}{3^k}\varphi (x^{3^k},y^{3^k},z^{3^k})<\infty ,\quad (x,y,z)\in G^3. \end{aligned}$$
(2.1)

Assume that \(f:G\rightarrow X_{\rho }\) is a mapping such that

$$\begin{aligned} \rho \bigl (f([xyz])-(f(x)+f(y)+f(z))\bigr )\le \varphi (x,y,z),\quad (x,y,z)\in G^3. \end{aligned}$$
(2.2)

Then there exists a unique mapping \(T:G\rightarrow X_{\rho }\) such that

$$\begin{aligned} \rho \big (f(x)-T(x)\bigr )\le \widehat{\varphi }(x,x,x) \end{aligned}$$
(2.3)

and

$$\begin{aligned} T(x^3)=3T(x) \end{aligned}$$
(2.4)

for all \(x\in G\). If, moreover, the semigroup is commutative, then T is a ternary homomorphism.

Proof

Putting \(x=y=z\) in (2.2), we get

$$\begin{aligned} \rho (f(x^3)-3f(x))\le \varphi (x,x,x), \quad x\in G. \end{aligned}$$
(2.5)

Then by induction, we have

$$\begin{aligned} \rho \left( \frac{f(x^{3^k})}{3^k}-f(x)\right) \le \frac{1}{3}\sum _{j=0}^{k-1}\frac{\varphi \left( x^{3^j},x^{3^j},x^{3^j}\right) }{3^j} \end{aligned}$$
(2.6)

for all \(x\in G\). Indeed, the case \(k=1\) follows from (2.5). Assume that (2.6) holds for \(k\in \mathbb {N}\). Then we obtain the following inequality

$$\begin{aligned} \begin{aligned} \rho \left( \frac{f(x^{3^{k+1}})}{3^{k+1}}-f(x)\right)&=\rho \left( \frac{1}{3}\left( \frac{f\left( (x^3)^{3^k}\right) }{3^k}-f(x^3)\right) +\frac{1}{3}\left( f(x^3)-3f(x)\right) \right) \\&\le \frac{1}{3}\rho \left( \frac{f\left( (x^3)^{3^k}\right) }{3^k}-f(x^3)\right) +\frac{1}{3}\rho \left( f(x^3)-3f(x)\right) \\&\le \frac{1}{3}\cdot \frac{1}{3}\sum _{j=0}^{k-1}\frac{\varphi \left( x^{3^{j+1}},x^{3^{j+1}}, x^{3^{j+1}}\right) }{3^j}+\frac{1}{3}\varphi (x,x,x)\\&=\frac{1}{3}\left( \sum _{j=0}^{k-1}\frac{\varphi \left( x^{3^{j+1}}, x^{3^{j+1}},x^{3^{j+1}}\right) }{3^{j+1}}+\varphi (x,x,x)\right) \\&=\frac{1}{3}\sum _{j=0}^k\frac{\varphi \left( x^{3^j},x^{3^j},x^{3^j}\right) }{3^j} \end{aligned} \end{aligned}$$

for all \(x\in G\). Hence (2.6) holds for every \(k\in \mathbb {N}\).

Let m and n be nonnegative integers with \(n>m\). Then by (2.6), we have

$$\begin{aligned} \rho \left( \frac{f\left( x^{3^n}\right) }{3^n}-\frac{f\left( x^{3^m}\right) }{3^m}\right)= & {} \rho \left( \frac{1}{3^m}\left( \frac{f\left( x^{3^n}\right) }{3^{n-m}}-f\left( x^{3^m}\right) \right) \right) \nonumber \\\le & {} \frac{1}{3^m}\cdot \frac{1}{3}\sum _{j=0}^{n-m-1}\frac{1}{3^j}\varphi \left( x^{3^{m+j}},x^{3^{m+j}},x^{3^{m+j}}\right) \nonumber \\= & {} \frac{1}{3}\sum _{j=0}^{n-m-1}\frac{1}{3^{m+j}}\varphi \left( x^{3^{m+j}},x^{3^{m+j}},x^{3^{m+j}}\right) \nonumber \\= & {} \frac{1}{3}\sum _{k=m}^{n-1}\frac{1}{3^{k}}\varphi \left( x^{3^k},x^{3^k},x^{3^k}\right) \end{aligned}$$
(2.7)

for all \(x\in G\).

We deduce by (2.1) and (2.7), the sequence \(\left\{ \frac{f(x^{3^n})}{3^n}\right\} \) is a \(\rho \)-Cauchy sequence in \(X_{\rho }\). By the \(\rho \)-completeness of \(X_{\rho }\), the sequence is \(\rho \)-convergent. Hence there exists a mapping \(T:G\rightarrow X_{\rho }\) defined by

$$\begin{aligned} T(x):=\rho -\text {limit}~ \frac{f\left( x^{3^n}\right) }{3^n} \end{aligned}$$
(2.8)

for all \(x\in G\).

We see

$$\begin{aligned} \begin{aligned} \rho \left( \frac{T(x^3)-3T(x)}{3^3}\right)&=\rho \left( \frac{1}{3^3}\left( T(x^3)-\frac{f(x^{3^{n+1}})}{3^n}\right) +\frac{1}{3}\left( \frac{1}{3}\cdot \frac{f(x^{3^{n+1}})}{3^{n+1}}-\frac{1}{3}T(x)\right) \right) \\&\le \frac{1}{3^3}\rho \left( T(x^3)-\frac{f(x^{3^{n+1}})}{3^n}\right) +\frac{1}{9}\rho \left( \frac{f(x^{3^{n+1}})}{3^{n+1}}-T(x)\right) \\ \end{aligned} \end{aligned}$$
(2.9)

for all \(x\in G\). Since \(T(x^3)=\rho -\text {limit}~\frac{f(x^{3^{n+1}})}{3^n}\) by (2.8), the last expression of (2.9) tends to 0 as \(n\rightarrow \infty \). Therefore, it follows that

$$\begin{aligned} T(x^3)=3T(x) \end{aligned}$$

for all \(x\in G\), so that (2.4) holds.

Next, we estimate \(\rho (T(x)-f(x))\). Note that for every \(n\in \mathbb {N}\), we get

$$\begin{aligned}&\rho \left( T(x)-f(x)\right) \nonumber \\&\quad =\rho \left( \sum _{k=1}^n\frac{f(x^{3^k})-3f(x^{3^{k-1}})}{3^{k}}+\left( T(x)-\frac{f(x^{3^n})}{3^{n}}\right) \right) \nonumber \\&\quad =\rho \left( \sum _{k=1}^n\frac{f(x^{3^k})-3f(x^{3^{k-1}})}{3^{k}}+\frac{1}{3}\left( T(x^3)-\frac{f\left( (x^3)^{3^{n-1}}\right) }{3^{n-1}}\right) \right) \end{aligned}$$
(2.10)

for all \(x\in G\). Since \(\sum _{k=1}^n\frac{1}{3^k}+\frac{1}{3}<1\), it follows from (2.5) and (2.10) that

$$\begin{aligned}&\rho \left( T(x)-f(x)\right) \nonumber \\&\quad \le \sum _{k=1}^n\frac{1}{3^k}\rho \left( f(x^{3^k})-3f(x^{3^{k-1}})\right) +\frac{1}{3}\rho \left( T(x^3)-\frac{f\left( (x^3)^{3^{n-1}}\right) }{3^{n-1}}\right) \nonumber \\&\quad \le \sum _{k=1}^n\frac{1}{3^k}\varphi \left( x^{3^{k-1}},x^{3^{k-1}},x^{3^{k-1}}\right) +\frac{1}{3}\rho \left( T(x^3)-\frac{f\left( (x^3)^{3^{n-1}}\right) }{3^{n-1}}\right) \end{aligned}$$
(2.11)

for all \(x\in G\). Letting \(n\rightarrow \infty \) in (2.11), we obtain

$$\begin{aligned} \rho (T(x)-f(x))\le \widehat{\varphi }(x,x,x) \end{aligned}$$

for all \(x\in G\). Hence we arrive at (2.3).

To show the aforementioned uniqueness of T, assume that \(T_1\) and \(T_2\) are mappings satisfying (2.3) and (2.4). Then we get

$$\begin{aligned} \rho \left( \frac{T_1(x)-T_2(x)}{2}\right)= & {} \rho \left( \frac{1}{2}\left( \frac{T_1(x^{3^{k}})}{3^k}-\frac{f(x^{3^{k}})}{3^k}\right) +\frac{1}{2}\left( \frac{f(x^{3^{k}})}{3^k}-\frac{T_2(x^{3^{k}})}{3^k}\right) \right) \\\le & {} \frac{1}{2}\rho \left( \frac{T_1(x^{3^{k}})}{3^k}-\frac{f(x^{3^{k}})}{3^k}\right) +\frac{1}{2}\rho \left( \frac{f(x^{3^{k}})}{3^k}-\frac{T_2(x^{3^{k}})}{3^k}\right) \\\le & {} \frac{1}{2}\cdot \frac{1}{3^k}\left\{ \rho \left( T_1(x^{3^k})-f(x^{3^k})\right) +\rho \left( T_2(x^{3^k})-f(x^{3^k})\right) \right\} \\\le & {} \frac{1}{3^k}\widehat{\varphi }(x^{3^k},x^{3^k},x^{3^k})\\= & {} \frac{1}{3}\sum _{j=k}^{\infty }\frac{1}{3^j}\varphi \left( x^{3^j},x^{3^j},x^{3^j}\right) \\&\rightarrow 0~\text {as}~ k\rightarrow \infty \end{aligned}$$

for all \(x\in G\). This implies that \(T_1=T_2\).

Finally assume that the semigroup G is commutative. We note that

$$\begin{aligned}&\rho \left( \frac{f([xyz]^{3^j})}{3^j}-\frac{f(x^{3^j})+f(y^{3^j})+f(z^{3^j})}{3^j}\right) \nonumber \\&\quad \le \frac{1}{3^j}\rho \left( f([xyz]^{3^j})-f(x^{3^j})-f(y^{3^j})-f(z^{3^j})\right) \nonumber \\&\quad \le \frac{1}{3^j}\varphi \left( x^{3^j},y^{3^j},z^{3^j}\right) \nonumber \\&\quad \rightarrow 0 ~\text {as}~ j\rightarrow \infty \end{aligned}$$
(2.12)

for all \(x,y,z\in G\). Then by (2.12) we obtain the following inequality

$$\begin{aligned} \begin{aligned}&\rho \left( \frac{T([xyz])-T(x)-T(y)-T(z)}{5}\right) \\&\quad \le \frac{1}{5}\left\{ \rho \left( T([xyz])-\frac{f([xyz]^{3^j})}{3^j}\right) +\rho \left( T(x)-\frac{f(x^{3^j})}{3^j}\right) \right. \\&\qquad +\left. \rho \left( T(y)-\frac{f(y^{3^j})}{3^j}\right) +\rho \left( T(z)-\frac{f(z^{3^j})}{3^j}\right) \right\} \\&\qquad +\frac{1}{5}\rho \left( \frac{f([xyz]^{3^j})}{3^j}-\frac{f(x^{3^j})}{3^j}-\frac{f(y^{3^j})}{3^j}-\frac{f(z^{3^j})}{3^j}\right) \\&\quad \rightarrow 0 ~\text {as}~ j\rightarrow \infty . \end{aligned} \end{aligned}$$

Therefore, we conclude that

$$\begin{aligned} T([xyz])=T(x)+T(y)+T(z) \end{aligned}$$

for all \(x,y,z\in G\), i.e., T is a ternary homomorphism. This completes the proof. \(\square \)

Putting \(\varphi \equiv \varepsilon > 0\) in Theorem 2.1, we immediately obtain the following result on classical Ulam stability of ternary homomorphisms under consideration.

Corollary 2.2

Let G be a ternary semigroup, and \(X_{\rho }\) be a \(\rho \)-complete modular space, where \(\rho \) is convex. If \(f:G\rightarrow X_{\rho }\) is a mapping such that

$$\begin{aligned} \rho \bigl (f([xyz])-(f(x)+f(y)+f(z))\bigr )\le \varepsilon \end{aligned}$$

for all \((x,y,z)\in G^3\), then there exists a unique mapping \(T:G\rightarrow X_{\rho }\) such that

$$\begin{aligned} \rho \bigl (f(x)-T(x)\bigr )\le \frac{\varepsilon }{2} \end{aligned}$$

and

$$\begin{aligned} T(x^3)=3T(x) \end{aligned}$$

for all \(x\in G\).

If, moreover, the semigroup G is commutative, then T is a ternary homomorphism.

Corollary 2.3

Let \(G=(\mathbb {R}\setminus \{0\},\cdot )\) and \(X_{\rho }=(\mathbb {R},+)\) with \(\rho (x)=|x|\) for all \(x\in \mathbb {R}\). Assume that \(f:\mathbb {R}\setminus \{0\}\rightarrow \mathbb {R}\) is a mapping, continuous in a point, such that

$$\begin{aligned} |f(xyz)-(f(x)+f(y)+f(z))|\le \varepsilon \end{aligned}$$

for all \(x,y,z\in \mathbb {R}\setminus \{0\}\). Then there exists a real constant c such that

$$\begin{aligned} |f(x)-c\ln |x||\le \frac{\varepsilon }{2} \end{aligned}$$

for all \(x\in \mathbb {R}\setminus \{0\}\).

Proof

From \(T(xyz)=T(x)+T(y)+T(z)\), it follows that \(T(1)=0\). Then

$$\begin{aligned} T(xy)=T(x)+T(y) \end{aligned}$$

for all \(x,y\in \mathbb {R}\setminus \{0\}\). It is well-known that T is of the form \(T(x)=c\ln |x|\) for all \(x\in \mathbb {R}\setminus \{0\}\). \(\square \)

3 Stability of ternary homomorphisms into \(\beta \)-homogeneous spaces

Definition 3.1

Let X be a linear space over \(\mathbb {C}\). A functional \(\Vert \cdot \Vert :X\rightarrow [0,\infty ]\) is an F-norm if it satisfies the following conditions;

  1. (N1)

    \(\Vert x\Vert =0\) if and only if \(x=0\),

  2. (N2)

    \(\Vert \lambda x\Vert =\Vert x\Vert \) for every \(x\in X\) and every \(\lambda \) with \(|\lambda |=1\),

  3. (N3)

    \(\Vert x+y\Vert \le \Vert x\Vert +\Vert y\Vert \) for all \(x,y\in X\),

  4. (N4)

    \(\Vert \lambda _n x\Vert \rightarrow 0\) provided \(\lambda _n\rightarrow 0\),

  5. (N5)

    \(\Vert \lambda x_n\Vert \rightarrow 0\) provided \(x_n\rightarrow 0\).

The linear metric space (Xd), where \(d(x,y)=\Vert x-y\Vert \), is called an F-space if d is a complete metric.

An F-norm is called \(\beta \)-homogeneous \((\beta >0)\) if \(\Vert tx\Vert =|t|^{\beta }\Vert x\Vert \) for all \(x\in X\) and \(t\in \mathbb {C}\). A \(\beta \)-homogeneous F-space is called a \(\beta \)-homogeneous complex Banach space.

Remark 3.2

A modular space \(X_{\rho }\) can be equipped with an F-norm defined by

$$\begin{aligned} \Vert x\Vert _{\rho }=\inf \left\{ \alpha >0~\bigg |~\rho \left( \frac{x}{\alpha }\right) \le \alpha \right\} . \end{aligned}$$

In case of an s-convex modular, the formula

$$\begin{aligned} \Vert x\Vert _{\rho }=\inf \left\{ \alpha ^s>0~\bigg |~\rho \left( \frac{x}{\alpha }\right) \le 1\right\} \end{aligned}$$

defines an F-norm with the additional property \(\Vert \lambda x\Vert _{\rho }=|\lambda |^s\Vert x\Vert _{\rho }\) so that \(\Vert \cdot \Vert _{\rho }\) is s-homogeneous. For \(s=1\), this norm is frequently called the Luxemburg norm.

In view of Remark 3.2, it is quite natural to consider the generalized Hyers–Ulam stability of ternary homomorphisms from commutative ternary semigroups into \(\beta \)-homogeneous Banach spaces.

Theorem 3.3

Let G be a ternary semigroup, X be a \(\beta \)-homogeneous complex Banach space \((0<\beta \le 1)\), and \(\varphi :G^3\rightarrow [0,\infty )\) be a function with

$$\begin{aligned} \widehat{\varphi }(x,y,z):=\frac{1}{3^{\beta }}\sum _{k=0}^{\infty }\frac{1}{3^{k\beta }}\varphi (x^{3^k},y^{3^k},z^{3^k})<\infty ,\quad (x,y,z)\in G^3. \end{aligned}$$
(3.1)

Assume that \(f:G\rightarrow X\) is a mapping such that

$$\begin{aligned} \Vert f([xyz])-(f(x)+f(y)+f(z))\Vert \le \varphi (x,y,z),\quad (x,y,z)\in G^3. \end{aligned}$$
(3.2)

Then there exists a unique mapping \(T:G\rightarrow X\) such that

$$\begin{aligned} \Vert f(x)-T(x)\Vert \le \widehat{\varphi }(x,x,x) \end{aligned}$$
(3.3)

and

$$\begin{aligned} T(x^3)=3T(x) \end{aligned}$$
(3.4)

for all \(x\in G\). If, moreover, the semigroup is commutative, then T is a ternary homomorphism.

Proof

Putting \(x=y=z\) in (3.2), we get

$$\begin{aligned} \Vert f(x^3)-3f(x)\Vert \le \varphi (x,x,x), \quad x\in G. \end{aligned}$$
(3.5)

By induction on \(k\in \mathbb {N}\), using (3.5) it is easy to see that

$$\begin{aligned} \left\| \frac{f(x^{3^k})}{3^k}-f(x)\right\| \le \frac{1}{3^{\beta }}\sum _{j=0}^{k-1}\frac{\varphi \left( x^{3^j},x^{3^j},x^{3^j}\right) }{3^{j\beta }} \end{aligned}$$
(3.6)

for all \(x\in G\). Let m and n be nonnegative integers with \(n>m\). Then we have by (3.6)

$$\begin{aligned}&\left\| \frac{f\left( x^{3^n}\right) }{3^n}-\frac{f\left( x^{3^m}\right) }{3^m}\right\| \nonumber \\&\quad =\left\| \frac{1}{3^m}\left( \frac{f(x^{3^n})}{3^{n-m}}-f(x^{3^m})\right) \right\| \nonumber \\&\quad \le \frac{1}{3^{m\beta }}\cdot \frac{1}{3^{\beta }}\sum _{j=0}^{n-m-1}\frac{\varphi (x^{3^{m+j}},x^{3^{m+j}},x^{3^{m+j}})}{3^{j\beta }}\nonumber \\&\quad =\frac{1}{3^{\beta }}\sum _{j=m}^{n-1}\frac{1}{3^{j\beta }}\varphi \left( x^{3^{j}},x^{3^{j}},x^{3^{j}}\right) \end{aligned}$$
(3.7)

for all \(x\in G\). Since the last term of (3.7) tends to zero by (3.1), it follows that for every \(x\in G\), the sequence \(\left\{ \frac{f(x^{3^n})}{3^n}\right\} \) is a Cauchy sequence in X. Due to the completeness of X, the sequence is convergent. Hence there exists a mapping \(T:G\rightarrow X\) defined by

$$\begin{aligned} T(x):=\lim _{n\rightarrow \infty } \frac{f\left( x^{3^n}\right) }{3^n} \end{aligned}$$
(3.8)

for all \(x\in G\). Letting \(m=0\) and passing the limit \(n\rightarrow \infty \) in (3.7), we obtain (3.3). (3.4) follows immediately from (3.8).

Next, assume that \(S:G\rightarrow X\) is another mapping satisfying (3.3) and (3.4). Then we have

$$\begin{aligned} \begin{aligned}&\left\| T(x)-S(x)\right\| \\&\quad \le \left\| \frac{T(x^{3^k})-f(x^{3^k})}{3^k}\right\| +\left\| \frac{S(x^{3^k})-f(x^{3^k})}{3^k}\right\| \\&\quad \le \frac{2}{3^{\beta }}\sum _{j=0}^{\infty }\frac{1}{3^{(j+k)\beta }}\varphi \left( x^{3^{j+k}},x^{3^{j+k}},x^{3^{j+k}}\right) \\&\quad =\frac{2}{3^{\beta }}\sum _{j=k}^{\infty }\frac{1}{3^{{j}\beta }}\varphi \left( x^{3^{j}},x^{3^{j}},x^{3^{j}}\right) \\&\quad \rightarrow 0 ~\text {as}~ k\rightarrow \infty \end{aligned} \end{aligned}$$

for all \(x\in G\), from which it follows that \(T=S\).

Finally, we assume that the semigroup G is commutative. Then we obtain

$$\begin{aligned} \begin{aligned}&\left\| \frac{1}{3^j}f([xyz]^{3^j})-\frac{f(x^{3^j})+f(y^{3^j})+f(z^{3^j})}{3^j}\right\| \\&\quad \le \frac{1}{3^{j\beta }}\varphi \left( x^{3^j},y^{3^j},z^{3^j}\right) \\&\quad \rightarrow 0 ~\text {as}~ j\rightarrow \infty , \end{aligned} \end{aligned}$$

and hence it follows that

$$\begin{aligned} T([xyz])=T(x)+T(y)+T(z) \end{aligned}$$

for all \(x,y,z\in G\), i.e., T is a ternary homomorphism. This completes the proof. \(\square \)

Putting \(\varphi \equiv \varepsilon > 0\) in Theorem 3.3, we immediately obtain the following result on classical Ulam stability of ternary homomorphisms under consideration.

Corollary 3.4

Let G be a ternary semigroup and X be a \(\beta \)-homogeneous complex Banach space with \(0<\beta \le 1\). If \(f:G\rightarrow X\) is a mapping such that

$$\begin{aligned} \Vert f([xyz])-(f(x)+f(y)+f(z))\Vert \le \varepsilon \end{aligned}$$

for all \((x,y,z)\in G^3\), then there exists a unique mapping \(T:G\rightarrow X\) such that

$$\begin{aligned} \Vert f(x)-T(x)\Vert \le \frac{\varepsilon }{3^{\beta }-1} \end{aligned}$$

and

$$\begin{aligned} T(x^3)=3T(x) \end{aligned}$$

for all \(x\in G\). If, moreover, the semigroup G is commutative, then T is a ternary homomorphism.

4 Hyperstability of ternary homomorphisms into normed algebras

In this section, we consider mappings from ternary semigroups into normed algebras. In [1, Theorem 3.1], the authors have shown the following result.

Theorem 4.1

Suppose that G is a ternary semigroup and X is a normed algebra whose norm is multiplicative, i.e., \(\Vert ab\Vert =\Vert a\Vert \cdot \Vert b\Vert \) for all \(a,b\in X\). Assume that \(\varepsilon \ge 0\) and \(f:G\rightarrow X\) satisfies the following condition

$$\begin{aligned} \Vert f([xyz])-f(x)f(y)f(z)\Vert \le \varepsilon \end{aligned}$$

for all \(x,y,z\in G\). Then either \(\Vert f(x)\Vert \le \delta \) for all \(x\in G\), where \(\delta =\frac{1+\sqrt{1+4\varepsilon }}{2}>1\) or else \(f([xyz])=f(x)f(y)f(z)\) for all \(x,y,z\in G\).

In the following theorem, we consider a similar problem to Theorem 4.1. As the norm is not multiplicative in many normed algebras, we impose a condition on the mapping, not on the normed algebra. In the proof, we adopt an idea of [1, Theorem 3.1].

Theorem 4.2

Suppose that G is a ternary semigroup, X is a normed algebra with unit I and \(f:G\rightarrow X\) is a mapping such that \(nI\in f(G)\) for all sufficiently large \(n\in \mathbb {N}\). If \(\varepsilon \ge 0\) and

$$\begin{aligned} \Vert f([xyz])-f(x)f(y)f(z)\Vert \le \varepsilon ,\quad (x,y,z)\in G^3 \end{aligned}$$

then

$$\begin{aligned} f([xyz])=f(x)f(y)f(z) \end{aligned}$$

for all \(x,y,z\in G\).

Proof

Let xyzts be elements of G. Then we estimate

$$\begin{aligned}&\left\| \bigl (f([xyz])-f(x)f(y)f(z)\bigr )f(t)f(s)\right\| \nonumber \\&\quad \le \Vert f([xyz])f(t)f(s)-f(x)f([yzt])f(s)\Vert \nonumber \\&\qquad +\Vert f(x)f([yzt])f(s)-f(x)f(y)f(z)f(t)f(s)\Vert \nonumber \\&\quad \le \Vert f([xyz])f(t)f(s)-f([[xyz]ts])\Vert +\Vert f([x[yzt]s])-f(x)f([yzt])f(s)\Vert \nonumber \\&\qquad +\left\| f(x)\bigl (f([yzt])-f(y)f(z)f(t)\bigr )f(s)\right\| \nonumber \\&\quad \le 2\varepsilon +\varepsilon \Vert f(x)\Vert \cdot \Vert f(s)\Vert . \end{aligned}$$
(4.1)

For any sufficiently large \(n\in \mathbb {N}\), choose \(t_n\in G\) such that \(f(t_n)=nI\). Letting \(t=s=t_n\) in (4.1), we have

$$\begin{aligned} \Vert f([xyz])-f(x)f(y)f(z)\Vert \le \frac{2\varepsilon +\varepsilon \Vert f(x)\Vert \cdot n}{n^2}. \end{aligned}$$

Letting \(n\rightarrow \infty \), we obtain that \(f([xyz])=f(x)f(y)f(z)\) for all \(x,y,z\in G\), i.e., f is a ternary homomorphism. \(\square \)

Recall that a ring R is called prime whenever \(aRb=\{0\}\), it implies either \(a=0\) or \(b=0\). it is well-known that B(X) for Banach spaces X and simple \(C^*\)-algebras are prime. In the following corollary, we assume that all algebras are \(\mathbb {C}\)-algebras.

Corollary 4.3

Let X be a unital prime algebra containing a nontrivial idempotent and Y a unital normed algebra with trivial center. If \(\varepsilon \ge 0\) and \(f:X\rightarrow Y\) is a bijective mapping such that

$$\begin{aligned} \Vert f(\lambda xyz)-\lambda f(x)f(y)f(z)\Vert \le \varepsilon \end{aligned}$$
(4.2)

for all \(\lambda \in \mathbb {T}^1:=\{\lambda \in \mathbb {C}~|~|\lambda |=1\}\) and all \(x,y,z\in X\), then either f or \(-f\) is a \(\mathbb {C}\)-linear algebra isomorphism.

Proof

Letting \(\lambda =1\) in (4.2), we obtain by Theorem 4.2 that

$$\begin{aligned} f(xyz)=f(x)f(y)f(z) \end{aligned}$$
(4.3)

for all \(x,y,z\in X\). By (4.3),

$$\begin{aligned} f(xy)=f(x)f(y)f(I)=f(I)f(x)f(y) \end{aligned}$$
(4.4)

for all \(x,y\in X\). Taking \(y\in X\) such that \(f(y)=I\), f(I) is a central element of Y by (4.4), so that \(f(I)=\mu I\) for some scalar \(\mu \). As \(\mu I=f(I)=f(I)^3=\mu ^3I\), we have \(\mu =0\) or \(\mu =1\) or \(\mu =-1\). Since f is surjective, the case \(\mu =0\) does not occur. Hence \(f(I)=I\) or \(f(I)=-I\).

Firstly assume that \(f(I)=I\). From (4.4), it follows that \(f(xy)=f(x)f(y)\) for all \(x,y\in X\). Then by [15], which states that every multiplicative bijective mapping of a prime ring with a nontrivial idempotent onto an arbitrary ring is additive, f is additive, and hence f is a ring isomorphism. Letting \(y=z=I\) in (4.2), we have

$$\begin{aligned} \Vert f(\lambda x)-\lambda f(x)\Vert \le \varepsilon \end{aligned}$$

for all \(\lambda \in \mathbb {T}^1\) and \(x\in X\). From the fact that f is additive, we have \(f(x)=\frac{f(nx)}{n}\) for all \(n\in \mathbb {N}\) and \(x\in X\). Hence

$$\begin{aligned} \Vert f(\lambda x)-\lambda f(x)\Vert =\left\| \frac{f(\lambda nx)-\lambda f(nx)}{n}\right\| \le \frac{\epsilon }{n}. \end{aligned}$$

If we let \(n\rightarrow \infty \), it follows that \(f(\lambda x)=\lambda f(x)\) for all \(\lambda \in \mathbb {T}^1\) and \(x\in X\). Then by the same reasoning as in the proof of [21, Theorem 2.1], the mapping f is \(\mathbb {C}\)-linear. Therefore f is a \(\mathbb {C}\)-linear algebra isomorphism.

Secondly assume that \(f(I)=-I\). Then by (4.4), it follows that \(f(xy)=-f(x)f(y)\) for all \(x,y\in X\). Letting \(g=-f\), we get \(g(xy)=g(x)g(y)\) for all \(x,y\in X\). Then arguing as in the case of \(f(I)=I\), we obtain that \(g=-f\) is a \(\mathbb {C}\)-linear algebra isomorphism. This completes the proof. \(\square \)

Corollary 4.4

Assume that \(\varepsilon \ge 0\) and \(f:M_n(\mathbb {C})\rightarrow M_m(\mathbb {C})\) is a bijective mapping satisfying (4.2) for all \(\lambda \in \mathbb {T}^1\) and all \(x,y,z\in M_n(\mathbb {C})\). Then \(n=m\) and there exists an invertible \(n\times n\) matrix t such that either \(f(x)=txt^{-1}\) or \(f(x)=-txt^{-1}\) for all \(x\in M_n(\mathbb {C})\).

5 Conclusions

In this article, we have proved the stability of ternary homomorphisms from commutative ternary semigroups to modular spaces without using the Fatou property and \(\Delta _2\)-condition. This generalizes the result of Amyari and Moslehian [1]. Since modular spaces can be made into \(\beta \)-homogeneous spaces, we also have solved the same problem for \(\beta \)-homogeneous Banach spaces and have shown a hyperstability of a mapping from ternary semigroups into normed algebras.