1 Introduction

In 1940 S. M. Ulam at the University of Wisconsin proposed the following problem: “Give conditions in order for a linear mapping near an approximately linear mapping to exist”. In 1968 S. U. Ulam proposed the more general problem: “When is it true that by changing a little the hypotheses of a theorem one can still assert that the thesis of the theorem remains true or approximately true?” (see [8]). In 1978, Gruber [4] reformulated his question by posing a more general stability problem: “Suppose a mathematical object satisfies a certain property approximately. Is it then possible to approximate this object by objects, satisfying the property exactly?”. This initiated a broad research program on the stability problem in theory of functional equations; for more information the reader may consult [5]. In [6] Najdecki considered the Ulam stability problem for the functional equation

$$\begin{aligned} f(x\star g(y))=f(x)f(y) \end{aligned}$$
(1)

and proved the following version of the Baker superstability result [1]

Theorem 1

(Najdecki). Let \((X,\star )\) be a semigroup, \(g:X\rightarrow X\), \(f:X\rightarrow \mathbb {K}\), where \(\mathbb {K}\in \{ \mathbb {R} ,\mathbb {C} \}\), and let \(\varepsilon \ge 0\). If

$$\begin{aligned} | f(x\star g(y)) - f(x)f(y)| \le \varepsilon ,\;\;x,y\in X, \end{aligned}$$

then either f is bounded and \(| f(x)| \le \frac{1+\sqrt{1+4\varepsilon }}{2}\), for \(x\in X\), or

$$\begin{aligned} f(x\star g(y)) = f(x)f(y) ,\;\;x,y\in X. \end{aligned}$$

Considering \(\mathbb {K}^{n}\) as an algebra (with multiplication by coordinates) Najdecki [6] proved also

Theorem 2

(Najdecki). Let \((X,\star )\) be a semigroup, \(g:X\rightarrow X\), \(F:X\rightarrow \mathbb {K}^{n}\) and let \(\varepsilon \ge 0\). If

$$\begin{aligned} \Vert F(x\star g(y)) - F(x)F(y)\Vert \le \varepsilon ,\;\;x,y\in X \end{aligned}$$

then there exist ideals \(I,J\subset \mathbb {K}^{n}\) such that \(\mathbb {K}^{n}=I\oplus J\), PF is bounded and (QFg) satisfies

$$\begin{aligned} QF(x\star g(y)) = QF(x)QF(y),\;\;x,y\in X, \end{aligned}$$

where \(P:\mathbb {K}^{n}\rightarrow I\) and \(Q:\mathbb {K}^{n}\rightarrow J\) are natural projections.

These studies was continued by Chung [2].

In the paper of Najdecki [6] we find the following statement: “We present a very short and simple proof that a similar result (similar to the results obtained by Ger and Šemrl [3]) is valid for function\(F:X\rightarrow \mathbb {K}^{n}\)satisfying (with any norm in\(\mathbb {K}^{n}\)) the following more general condition:

$$\begin{aligned} \Vert F(x\star g(y)) - F(x)F(y)\Vert \le \varepsilon ,\;\;x,y\in X''. \end{aligned}$$

Also Chung [2] states: “Generalizing the result of Ger and Šemrl [1], Najdecki [2] proved the stability of the functional equation

$$\begin{aligned} F(x\star g(y)) - F(x)F(y)=0,\;\;x,y\in X \end{aligned}$$

in the class of functions\(F:X\rightarrow \mathbb {K}^{n}\)”. But in the paper by Ger and Šemrl [3] we find the following two more general theorems for vector-valued functions.

Theorem 3

(Ger - Šemrl). Let \((S,+)\) be a semigroup and let A be a commutative semisimple complex Banach algebra. Assume that the mapping \(f:S\rightarrow A\) is such that

  1. (a)

    the transformation

    $$\begin{aligned} S^{2}\ni (x,y)\longrightarrow f(x+y)-f(x)f(y)\in A \end{aligned}$$

    is norm bounded,

  2. (b)

    for every nonzero linear multiplicative functional \(\varphi \) on A, the set \((\varphi \circ f)(S)\) is unbounded.

Then f is exponential, i.e.,

$$\begin{aligned} f(x+y)=f(x)f(y), \;\;x,y\in S. \end{aligned}$$

Theorem 4

(Ger - Šemrl). Let \((S,+)\) be a semigroup and let A be a commutative \(C^{\star }\)-algebra. Assume that \(\varepsilon \ge 0\) and that a mapping \(f:S\rightarrow A\) satisfies

$$\begin{aligned} \Vert f(x+y)-f(x)f(y)\Vert \le \varepsilon , \end{aligned}$$

for all \(x,y\in S\). Then there exists a commutative \(C^{\star }\)-algebra B such that

  1. (i)

    A is a \(C^{\star }\)-subalgebra of B (and therefore, f may be considered as a mapping from S into B),

  2. (ii)

    algebra B can be represented as a direct sum \(B=I\oplus J\), where I and J are closed ideals,

  3. (iii)

    if P and Q are projections corresponding to the direct sum decomposition \(B=I\oplus J\), then Pf is an exponential mapping, i.e., \(Pf(x+y)=Pf(x)Pf(y)\), for all \(x,y\in S\) and Qf is norm-bounded.

The following question appears: can we really get the results obtained by Ger and Šemrl [3] also for the stability problem of the equation \(f(x\star g(y))=f(x)f(y)\)? In the paper we give a positive answer to this question.

2 Main Results

As the analog of Theorem 3 we prove

Theorem 5

Let \((S,\star )\) be a semigroup, A be a commutative semisimple complex Banach algebra and let \(g:S\rightarrow S\). Assume that the mapping \(f:S\rightarrow A\) is such that

  1. (a)

    the transformation

    $$\begin{aligned} S^{2}\ni (x,y)\longrightarrow f(x\star g(y))-f(x)f(y)\in A \end{aligned}$$

    is norm bounded,

  2. (b)

    for every nonzero linear multiplicative functional \(\varphi \) on A, the set \((\varphi \circ f)(S)\) is unbounded.

Then f and g satisfy

$$\begin{aligned} f(x\star g(y))=f(x)f(y), \;\;x,y\in S. \end{aligned}$$

Proof

By assumption (a) there is a constant \(\varepsilon >0\) such that

$$\begin{aligned} \Vert f(x\star g(y))-f(x)f(y)\Vert \le \varepsilon ,\;\;x,y\in S. \end{aligned}$$

Let \(\varphi \) be a fixed element of the set \(\varPhi _{A}\) of all nonzero linear multiplicative functionals on A. Then, using the fact that \(\Vert \varphi \Vert =1\), we get

$$\begin{aligned} \begin{array}{r c l} &{}&{}\Vert (\varphi \circ f)(x\star g(z)) - (\varphi \circ f)(x)(\varphi \circ f)(y)\Vert \\ &{}&{}\quad = \Vert \varphi \left( f(x\star g(y))-f(x)f(y)\right) \Vert \\ &{}&{}\quad \le \Vert \varphi \Vert \Vert f(x\star g(z)) - f(x)f(y)\Vert \le \varepsilon , \end{array} \end{aligned}$$

for all \(x,y\in S\). Since \((\varphi \circ f)(S)\) is unbounded Najdecki’s result (Theorem 1) shows that the function \(\varphi \circ f\) satisfies Eq. (1) which means that \(f(x\star g(y))-f(x)f(y)\in \ker \varphi \), for all \(x,y\in S\). Thus, for \(x,y\in S\),

$$\begin{aligned} f(x\star g(y))-f(x)f(y)\in \bigcap \{\ker \varphi :\varphi \in \varPhi _{A}\} =\text{ rad } A. \end{aligned}$$

But A is semisimple (\(\text{ rad } A=\{ 0\}\)) which proves that \(f(x\star g(y))-f(x)f(y)=0\), for all \(x,y\in S\) and ends the proof. \(\square \)

If we assume that a semigroup S is commutative we can prove more. Namely, we can show the counterpart of Shtern’s theorem (see [7]) for the stability of our functional equation.

Theorem 6

Let \((S,\star )\) be a commutative semigroup and let A be a commutative Banach algebra, \(g:S\rightarrow S\) and let \(f:S\rightarrow A\). Assume that

  1. (A)

    the transformation

    $$\begin{aligned} S^{2}\ni (x,y)\longrightarrow f(x\star g(y))-f(x)f(y)\in A \end{aligned}$$

    is norm bounded,

  2. (B)

    every S-orbit

    $$\begin{aligned} O_{S}(b)=\{f(x)b\; :\; x\in S\} ,\;\;b\in A{\setminus }\{ 0\}, \end{aligned}$$

    in A is unbounded.

Then the pair (fg) satisfies

$$\begin{aligned} f(x\star g(y))=f(x)f(y),\;\;x,y\in S. \end{aligned}$$

Proof

Let \(\varepsilon \) be a positive constant such that

$$\begin{aligned} \Vert f(x\star g(y))-f(x)f(y)\Vert \le \varepsilon ,\;\;x,y\in S. \end{aligned}$$

Then for \(x,y,z\in S\) we have

$$\begin{aligned}&\Vert f(z)[ f(x)f(y) - f(x\star g(y)) ]\Vert \\&\quad \le \Vert f(x)f(z)f(y)-f(x\star g(z))f(y)\Vert \\&\qquad + \Vert f(x\star g(z))f(y) - f(x\star g(z)\star g(y)) \Vert \\&\qquad + \Vert f(x\star g(y)\star g(z))-f(x\star g(y))f(z)\Vert \\&\quad \le \varepsilon \cdot \Vert f(y)\Vert + \varepsilon +\varepsilon . \end{aligned}$$

This means that the S-orbit of the element \(f(x)f(y)-f(x\star g(y))\) is bounded and assumption (B) implies that

$$\begin{aligned} f(x\star g(y))=f(x)f(y), \end{aligned}$$

which ends the proof. \(\square \)

Let us point out that this theorem generalizes the previously proven theorem in the case of the commutative semigroup S.

Corollary 1

Let \((S,\star )\) be a commutative semigroup and let A be a commutative semisimple complex Banach algebra, \(g:S\rightarrow S\) and let \(f:S\rightarrow A\). Assume that

(\(\alpha \)):

the transformation

$$\begin{aligned} S^{2}\ni (x,y)\longrightarrow f(x\star g(y))-f(x)f(y)\in A \end{aligned}$$

is norm bounded,

(\(\beta \)):

for every nonzero linear multiplicative functional \(\varphi \) on A, the set \((\varphi \circ f)(S)\) is unbounded.

Then (fg) satisfies

$$\begin{aligned} f(x\star g(y))=f(x)f(y), \;\;x,y\in S. \end{aligned}$$

Proof

Let b be a nonzero element of A. Then, since the algebra A is semisimple, there is a linear multiplicative functional \(\phi \) such that \(\phi (b)\not = 0\). By condition (\(\beta \)) the set \((\phi \circ f)(S)\) is unbounded. Hence the set \((\phi \circ f)(S)\phi (b)\) is unbounded. But

$$\begin{aligned} \begin{array}{r c l} (\phi \circ f)(S)\phi (b) &{} = &{} \{\; \phi (f(x))\phi (b)\; :\; x\in S\;\} \\ &{} = &{} \{\; \phi (f(x)b)\; :\; x\in S\;\}\\ &{} = &{} \phi \left( \{\; f(x)b\; :\; x\in S\;\}\right) \\ &{} = &{} \phi \left( O_{S}(b)\right) . \end{array} \end{aligned}$$

Therefore, for every nonzero \(b\in A\), S-orbit \(O_{S}(b)\) is unbounded and by Theorem 6 the pair (fg) satisfies

$$\begin{aligned} f(x\star g(y))=f(x)f(y), \;\;x,y\in S. \end{aligned}$$

This ends the proof. \(\square \)

As the analogue of Theorem 4 we prove the following

Theorem 7

Let \((S,\star )\) be a semigroup and let A be a commutative \(C^{\star }\)-algebra. Assume that \(\varepsilon \ge 0\), \(g:S\rightarrow S\), \(f:S\rightarrow A\) and

$$\begin{aligned} \Vert f(x\star g(y))-f(x)f(y)\Vert \le \varepsilon , \end{aligned}$$

for all \(x,y\in S\). Then there exists a commutative \(C^{\star }\)-algebra B such that

  1. (i)

    A is a \(C^{\star }\)-subalgebra of B,

  2. (ii)

    algebra B can be represented as a direct sum \(B=I\oplus J\), where I and J are closed ideals,

  3. (iii)

    if P and Q are projections corresponding to the direct sum decomposition \(B=I\oplus J\), then the pair (Pfg) satisfies \(Pf(x\star g(y))=Pf(x)Pf(y)\), for all \(x,y\in S\) and Qf is norm-bounded.

Proof

Let \(G:A\rightarrow C_{0}(\varDelta )\) be the Gelfand transform of A onto the algebra of all complex continuous functions on a locally compact Hausdorff space \(\varDelta \) which vanish at infinity. Then the Gelfand map G (by the commutative Gelfand-Naimark theorem) is an isometric \(\star \)-isomorphism from A onto \(C_{0}(\varDelta )\). So, we can identify the algebra A with the algebra \(C_{0}(\varDelta )\). Moreover, using our assumption and the fact that the Gelfand transform G is an isometric \(\star \)-isomorphism, for every \(t\in \varDelta \), we see that

$$\begin{aligned} |G(f(x\star g(y)))(t)-G(f(x))(t)G(f(y))(t)|\le \varepsilon ,\;\;x,y\in S. \end{aligned}$$

It gives us that for every \(t\in \varDelta \) the complex-valued map

$$\begin{aligned} S\ni x\mapsto (G\circ f)(x)(t) \end{aligned}$$

satisfies inequality from Najdecki’s Theorem 1. By Najdecki’s result (Theorem 1) we known that for every \(t\in \varDelta \) either \((G\circ f)(\cdot )(t)\) is bounded (by \(\frac{1+\sqrt{1+4\varepsilon }}{2}\)) on S or satisfies the functional equation

$$\begin{aligned} G(f(x\star g(y)))(t)=G(f(x))(t)G(f(y))(t),\;\;x,y\in S. \end{aligned}$$

Let

$$\begin{aligned} \varDelta _{b}=\left\{ \;t\in \varDelta \;:\; | G(f(x))(t)| \le \frac{1+\sqrt{1+4\varepsilon }}{2},\;\;x\in S\;\right\} \end{aligned}$$

and, for \(x\in S\), let

$$\begin{aligned} \varDelta _{x}=\left\{ \;t\in \varDelta \;:\; | G(f(x))(t)| \le \frac{1+\sqrt{1+4\varepsilon }}{2}\;\right\} . \end{aligned}$$

Then

$$\begin{aligned} \varDelta _{b}=\bigcap _{x\in S} \varDelta _{x} \end{aligned}$$

and, by continuity of the function \((G\circ f)(x)(\cdot )\) on \(\varDelta \), the set \(\varDelta _{x}\) is a closed subset of \(\varDelta \), for every \(x\in S\). Therefore the set \(\varDelta _{b}\) is a closed subset of \(\varDelta \). Putting \(\varDelta _{s}=\text{ cl }(\varDelta \setminus \varDelta _{b})\) and using Najdecki’s theorem together with the continuity of the function \((G\circ f)(x)(\cdot )\) on \(\varDelta \), for every \(x\in S\), we obtain

$$\begin{aligned} G(f(x\star g(y)))(t)=G(f(x))(t)G(f(y))(t),\;\;x,y\in S, \end{aligned}$$

for every \(t\in \varDelta _{s}\). Consequently we get a commutative \(C^{\star }\)-algebra \(C_{0}(\varDelta _{s})\) for which the map \(G\circ f\) satisfies our functional equation and a commutative \(C^{\star }\)-algebra \(C_{0}(\varDelta _{b})\) for which the map \(G\circ f\) is bounded (by \(\frac{1+\sqrt{1+4\varepsilon }}{2}\)).

Let B be a commutative \(C^{\star }\)-algebra defined by \(B=C_{0}(\varDelta _{1})\oplus C_{0}(\varDelta _{2})\) with the norm given by \(\Vert u\oplus v\Vert =\max \{ \Vert u\Vert ,\Vert v\Vert \}\), for \(u\oplus v \in B\). Because a map F defined as follows

$$\begin{aligned} C_{0}(\varDelta )\ni \xi \mapsto \xi \mid _{\varDelta _{s}} \oplus \xi \mid _{\varDelta _{b}}\in B \end{aligned}$$

is an isometric \(\star \)-homomorphism (from \(C_{0}(\varDelta )\) into B) we can regarded on A as a \(C^{\star }\)-subalgebra of B (the map \(F\circ G\) is an isometric \(\star \)-homomorphism from A into B). Taking \(I=C_{0}(\varDelta _{s})\oplus \{ 0\}\) and \(J=\{ 0\}\oplus C_{0}(\varDelta _{b})\), in comparison to previous observations, the proof is finished. \(\square \)

3 Open problem

The functional equation (1) was studied in general terms (for functions with values in groups). We propose to study Ulam’s stability problem for the following “additive” version of Eq. (1)

$$\begin{aligned} f(x\star g(y))=f(x)+f(y). \end{aligned}$$