1 Introduction

Let \({\mathbb {R}}\) be the set of real numbers, \({\mathbb {C}}\) be the set of complex numbers, and \({\mathbb {T}}\) be the unit circle in \({\mathbb {C}}\). Let n be a fixed positive integer and \({\mathbb {T}}_n\) denote the finite cyclic subgroup of \({\mathbb {T}}\) consisting of the nth roots of unity, i.e., \({\mathbb {T}}_n:=\{e^{i\frac{2k\pi }{n}}: k=1, \cdots ,n\}\).

The celebrated Wigner’s theorem plays a fundamental role in the foundations of quantum mechanics and in representation theory in physics. It states that any quantum mechanical symmetry transformation can be represented by a unitary or an anti-unitary operator on a complex inner product space. In mathematical language, the result can be reformulated in the following way. For complex inner product spaces H and K, a mapping \(f: H \rightarrow K\) satisfies

$$\begin{aligned} |\langle f(x), f(y) \rangle | = |\langle x, y \rangle | \quad (x, y\in H) \end{aligned}$$
(1.1)

if and only if there exist a function (called phase function) \(\sigma : H \rightarrow {\mathbb {T}}\) and a linear or anti-linear (i.e. conjugate linear) isometry \(U:H \rightarrow K\) such that

$$\begin{aligned} f(x)=\sigma (x)U(x) \quad (x\in H). \end{aligned}$$
(1.2)

We then say that f is phase equivalent to a linear or anti-linear isometry. There are several proofs of this result, see [1, 4, 6, 7, 9, 18, 22] to list just some of them. For further generalizations of this fundamental result, we mention the papers [3, 5, 8, 16, 17, 19].

The real version of Wigner’s theorem was also obtained by Rätz [18, Corollary 8 (a)] and by Turnšek [22, Theorem 2.4 (i)] as follows. A mapping \(f: H \rightarrow K\) between real inner product spaces satisfies (1.1) if and only if there exist a function \(\sigma : H \rightarrow \{-1,1\}\) and a real linear isometry \(U:H \rightarrow K\) such that (1.2) holds. We then say that f is phase equivalent to a real linear isometry. By an easy argument, Maksa and Páles [15, Theorem 2] obtained that if H and K are real inner product spaces then \(f: H \rightarrow K\) satisfies the functional equation

$$\begin{aligned} \{\Vert f(x)+f(y)\Vert , \Vert f(x)-f(y)\Vert \}=\{\Vert x+y\Vert , \Vert x-y\Vert \} \quad (x,y\in H), \end{aligned}$$
(1.3)

if and only if f satisfies (1.1). Combining the two results above, Maksa and Páles [15, Theorem 2] then proved that the general solution of the functional Eq. (1.3) is phase equivalent to a real linear isometry.

Maksa and Páles [15] also at last formulated two open problems as follows.

Problem 1.1

[15] Under what conditions, when H and K are real normed but not necessarily inner product spaces, the solutions of (1.3) are phase equivalent to a real linear isometry?

Problem 1.2

[15] Let H and K be complex normed spaces and n be a fixed positive integer. Under what conditions the solutions \(f: H \rightarrow K\) of the following generalization of (1.3):

$$\begin{aligned} \{\Vert f(x)-\beta f(y)\Vert : \beta \in {\mathbb {T}}_n\}=\{\Vert x-\beta y\Vert : \beta \in {\mathbb {T}}_n\} \quad (x,y\in H) \end{aligned}$$
(1.4)

have the form (1.2) for some phase function \(\sigma : H \rightarrow {\mathbb {T}}_n\) and some linear or anti-linear isometry \(U: H\rightarrow K\)?

There are several recent papers dealing with Problem 1.1, see [10,11,12,13,14, 20, 21, 23]. Recently, Ilišević, Turnšek, etc. gave a positive answer to Problem 1.1. Namely, they proved that the solutions of Eq. (1.3) for a mapping \(f: H \rightarrow K\), where H and K are real normed spaces, are phase equivalent to a real linear isometry under the condition that either f is surjective [12] or K is strictly convex [13]. Huang and Tan in [10] introduced a weaker version of Eq. (1.3) as follows:

$$\begin{aligned} \min \{\Vert f(x)+f(y)\Vert , \Vert f(x)-f(y)\Vert \}=\min \{\Vert x+y\Vert , \Vert x-y\Vert \} \quad (x,y\in H). \end{aligned}$$

They also proved that every surjective mapping satisfying this equation between two real normed spaces is phase equivalent to a real linear isometry.

In this paper, we give a positive answer to Problem 1.2 for complex inner product spaces. Let H and K be two complex inner product spaces and f be a mapping \(f: H \rightarrow K\). We will show in Theorem 2.5 that for \(n\ge 3\), a mapping f satisfies (1.4) if and only if there is a phase function \(\sigma : H \rightarrow {\mathbb {T}}_n\) such that \(\sigma \cdot f\) is a linear or anti-linear isometry. Moreover, we will show in Corollary 2.7 that for \(n\ge 3\), a continuous mapping f satisfies (1.4) if and only if f is a linear or anti-linear isometry.

2 Results

Throughout this section, let H and K be complex inner product spaces, and n be a fixed positive integer.

First we present a simple and useful lemma. For convenience, we introduce two equations

$$\begin{aligned} \{\Vert f(x)+\beta f(y)\Vert : \beta \in {\mathbb {T}}_n\}=\{\Vert x+\beta y\Vert : \beta \in {\mathbb {T}}_n\} \quad (x,y\in H) \end{aligned}$$
(2.1)

and

$$\begin{aligned} \{\text{ Re } \beta \langle f(x), f(y) \rangle : \beta \in {\mathbb {T}}_n\}=\{\text{ Re } \beta \langle x, y \rangle : \beta \in {\mathbb {T}}_n\} \quad (x,y\in H). \end{aligned}$$
(2.2)

Lemma 2.1

For \(n\ge 2\) and a mapping \(f: H \rightarrow K\), the following statements are equivalent:

  1. (i)

    f satisfies Eq. (1.4);

  2. (ii)

    f satisfies Eq. (2.1);

  3. (iii)

    f satisfies Eq. (2.2).

Moreover, if this is the case, then f is norm preserving, i.e., \(\Vert f(x)\Vert =\Vert x\Vert \) for every \(x\in H\).

Proof

Putting \(y=x\), we deduce from each of Eqs. (1.4), (2.1) and (2.2) that f is norm preserving. For \(x,y\in H\) and \(\beta \in {\mathbb {T}}_n\), we obtain

$$\begin{aligned} \Vert x\pm \beta y\Vert ^2 =\Vert x\Vert ^2+\Vert y\Vert ^2\pm 2\text{ Re } \langle x, \beta y\rangle =\Vert x\Vert ^2+\Vert y\Vert ^2\pm 2\text{ Re }{\overline{\beta }} \langle x, y\rangle , \end{aligned}$$

and

$$\begin{aligned} \Vert f(x)\pm \beta f(y)\Vert ^2=\Vert f(x)\Vert ^2+\Vert f(y)\Vert ^2\pm 2\text{ Re }{\overline{\beta }} \langle f(x), f(y) \rangle . \end{aligned}$$

By the norm-preserving property and the fact that \(\beta \in {\mathbb {T}}_n\) if and only if \({\overline{\beta }}\in {\mathbb {T}}_n\), each of Eqs. (1.4) and (2.1) is equivalent to Eq. (2.2). The proof is complete. \(\square \)

Remark 2.2

In the case \(n=1\), Eqs. (1.4), (2.1) and (2.2) turn out to be

$$\begin{aligned} \Vert f(x)-f(y)\Vert= & {} \Vert x-y\Vert \quad (x,y\in H),\end{aligned}$$
(2.3)
$$\begin{aligned} \Vert f(x)+f(y)\Vert= & {} \Vert x+y\Vert \quad (x,y\in H), \end{aligned}$$
(2.4)

and

$$\begin{aligned} \text{ Re }\langle f(x), f(y)\rangle =\text{ Re }\langle x, y\rangle \quad (x,y\in H), \end{aligned}$$
(2.5)

respectively. By definition, f satisfies Eq. (2.3) if and only if f is an isometry. Since an inner product space is strictly convex, Baker [2] showed that \(f-f(0)\) is a real linear isometry if f is an isometry. However, an easy argument [15, Theorem 1] shows that Eqs. (2.4) and (2.5) are equivalent to each other and each of them is equivalent to f being a real linear isometry. Hence, in general, Lemma 2.1 does not hold for \(n=1\).

In the case \(n=2\), each of Eqs. (1.4) and (2.1) is the same as Eq. (1.3), and Eq. (2.2) becomes

$$\begin{aligned} |\text{ Re }\langle f(x), f(y)\rangle |=|\text{ Re }\langle x, y\rangle |\quad (x,y\in H). \end{aligned}$$
(2.6)

Note that every complex linear space is obviously a real linear space and if \(\langle \cdot ,\cdot \rangle \) is a complex inner product on H, then \(\text{ Re }\langle \cdot ,\cdot \rangle \) is a real inner product on H which induces the same norm. Therefore, from the real version of Wigner’s theorem, the following theorem follows immediately. See [15, Theorem 2] or [22, Theorem 2.4 (i)] for its proof.

Theorem 2.3

([15, 22]) For a mapping \(f: H \rightarrow K\), the following statements are equivalent:

  1. (i)

    f satisfies Eq. (1.3);

  2. (ii)

    f satisfies Eq. (2.6);

  3. (iii)

    there exist a phase function \(\sigma : H \rightarrow \{-1,1\}\) and a real linear isometry \(U:H \rightarrow K\) such that \(f=\sigma \cdot U\).

It may be worth noting that in (iii) of Theorem 2.3, the phrase “a real linear isometry” cannot be replaced by “a linear or anti-linear isometry”. To show this, we construct an example as follows.

Example

Let \(H={\mathbb {C}}\) and \(K={\mathbb {C}}^2\), both equipped with the usual inner products, i.e.,

$$\begin{aligned} \langle x,y\rangle =x{\overline{y}} \quad (x,y\in {\mathbb {C}}) \end{aligned}$$

and

$$\begin{aligned} \langle (x_1,x_2),(y_1,y_2)\rangle =x_1\overline{y_1}+x_2 \overline{y_2}\quad ((x_1,x_2),(y_1,y_2)\in {\mathbb {C}}^2). \end{aligned}$$

Define \(f:{\mathbb {C}}\rightarrow {\mathbb {C}}^2\) by

$$\begin{aligned} f(x)=\frac{1}{\sqrt{2}}(x,{\overline{x}}),\quad x\in {\mathbb {C}}. \end{aligned}$$

An easy calculation shows that f satisfies Eq. (2.6), but for any phase function \(\sigma : H \rightarrow \{-1, 1\}\), \(\sigma \cdot f\) is neither linear nor anti-linear.

However, in the case \(n\ge 3\), in sharp contrast with the cases \(n=1,2\), each of (1.4), (2.1) and (2.2) is equivalent to there being a phase function \(\sigma : H\rightarrow {\mathbb {T}}_n\) such that \(\sigma \cdot f\) is a linear or anti-linear isometry. This is the content of Theorem 2.5. To obtain it, we need an elementary lemma as follows.

Lemma 2.4

For \(n\ge 3\) and \(s,t\in {\mathbb {C}}\), the equation

$$\begin{aligned} \{\text{ Re } \beta s: \beta \in {\mathbb {T}}_n\}=\{\text{ Re } \beta t: \beta \in {\mathbb {T}}_n\} \end{aligned}$$
(2.7)

holds if and only if \(s=\beta _{0}t\) or \(s=\beta _{0}{\overline{t}}\) for some \(\beta _0\in {\mathbb {T}}_n\).

Proof

Sufficiency. If \(s=\beta _{0}t\) for some \(\beta _0\in {\mathbb {T}}_n\), then

$$\begin{aligned} \{\text{ Re } \beta s: \beta \in {\mathbb {T}}_n\}=\{\text{ Re }\beta _{0}\beta t: \beta \in {\mathbb {T}}_n\}=\{\text{ Re } \beta t: \beta \in {\mathbb {T}}_n\}, \end{aligned}$$

where the second equality follows from the fact that \(\beta _0{\mathbb {T}}_n={\mathbb {T}}_n\). If \(s=\beta _{0}{\overline{t}}\), then

$$\begin{aligned} \{\text{ Re } \beta s: \beta \in {\mathbb {T}}_n\}= & {} \{\text{ Re } \beta _{0}\beta {\overline{t}}: \beta \in {\mathbb {T}}_n\}=\{\text{ Re }\beta {\overline{t}}: \beta \in {\mathbb {T}}_n\}\\= & {} \{\text{ Re }{\overline{\beta }}t: \beta \in {\mathbb {T}}_n\}=\{\text{ Re } \beta t: \beta \in {\mathbb {T}}_n\}, \end{aligned}$$

where the fourth equality follows from the fact that \(\beta \in {\mathbb {T}}_n\) if and only if \({\overline{\beta }}\in {\mathbb {T}}_n\).

Necessity. Suppose that Eq. (2.7) holds. We first claim that \(|s|=|t|\). Indeed, taking \(t=|t|e^{i\theta }\) and \(\beta _k=e^{i\frac{2k\pi }{n}}\in {\mathbb {T}}_n\) for \(k=1, \cdots ,n\), we see that

$$\begin{aligned} (\text{ Re } \beta _k t)^2= & {} |t|^2\cos ^2\left( \theta +\frac{2k\pi }{n}\right) =\frac{|t|^2}{2}\left( 1+\cos \left( 2\theta +\frac{4k\pi }{n}\right) \right) \\= & {} \frac{|t|^2}{2}\left( 1+\cos 2\theta \cos \frac{4k\pi }{n}-\sin 2\theta \sin \frac{4k\pi }{n}\right) . \end{aligned}$$

Let us recall the formula of partial sums of trigonometric series

$$\begin{aligned} \sum _{k=1}^n \cos ku=\frac{\sin \frac{n}{2}u \cdot \cos \frac{n+1}{2}u}{\sin \frac{u}{2}} \quad \text{ and }\quad \sum _{k=1}^n \sin ku=\frac{\sin \frac{n}{2}u \cdot \sin \frac{n+1}{2}u}{\sin \frac{u}{2}} \end{aligned}$$

for \(u\in (0,2\pi )\). It follows that

$$\begin{aligned} \sum _{k=1}^n (\text{ Re } \beta _kt)^2=\frac{|t|^2}{2}\left( n+\cos 2\theta \cdot \sum _{k=1}^n\cos k\frac{4\pi }{n}-\sin 2\theta \cdot \sum _{k=1}^n\sin k\frac{4\pi }{n}\right) =\frac{|t|^2n}{2}. \end{aligned}$$

Similarly,

$$\begin{aligned} \sum _{k=1}^n (\text{ Re } \beta _ks)^2=\frac{|s|^2n}{2}. \end{aligned}$$

Therefore, Eq. (2.7) implies that \(|s|=|t|\) and the claim is proved. Furthermore, let us take \(s=|t|e^{i\theta _1}\) and \(t=|t|e^{i\theta }\). It follows from Eq. (2.7) that

$$\begin{aligned} \left\{ \cos \left( \theta _1+\frac{2k\pi }{n}\right) : k=1,\cdots , n\right\} =\left\{ \cos \left( \theta +\frac{2k\pi }{n}\right) : k=1,\cdots , n\right\} . \end{aligned}$$

Choose \(k_0\in \{1,\cdots , n\}\) such that \(\cos \theta _1=\cos (\theta +\frac{2k_0\pi }{n})\), or equivalently,

$$\begin{aligned} \pm \theta _1=\theta +\frac{2k_0\pi }{n}+2m\pi \end{aligned}$$

for some integer m. Therefore, we have \(s=\beta _{k_0} t\) or \(s=\overline{\beta _{k_0}}{\overline{t}}\). \(\square \)

Now we present our main theorem. For convenience, we introduce the equation

$$\begin{aligned} \begin{aligned} \langle f(x), f(y) \rangle&=\beta (x,y)\langle x, y \rangle \ \text{ or } \ \langle f(x), f(y) \rangle =\beta (x,y)\langle y, x \rangle \\&\quad \text{ for } \text{ some } \beta (x,y)\in {\mathbb {T}}_n \quad (x,y\in H). \end{aligned} \end{aligned}$$
(2.8)

Theorem 2.5

For \(n\ge 3\) and a mapping \(f: H \rightarrow K\), the following statements are equivalent:

  1. (i)

    f satisfies Eq. (1.4);

  2. (ii)

    f satisfies Eq. (2.1);

  3. (iii)

    f satisfies Eq. (2.2);

  4. (iv)

    f satisfies Eq. (2.8);

  5. (v)

    there exist a phase function \(\sigma : H\rightarrow {\mathbb {T}}_n\) and a linear or anti-linear isometry \(U:H \rightarrow K\) such that \(f=\sigma \cdot U\).

Proof

The equivalences (i) \(\Longleftrightarrow \) (ii) \(\Longleftrightarrow \) (iii) and (iii) \(\Longleftrightarrow \) (iv) are contained in Lemmas 2.1 and 2.4, respectively. We will complete the proof by establishing the implications (v) \(\Longrightarrow \) (i) and (iv) \(\Longrightarrow \) (v).

(v) \(\Longrightarrow \) (i). Suppose that \(f=\sigma \cdot U\) for some phase function \(\sigma : H\rightarrow {\mathbb {T}}_n\) and some linear isometry U (respectively, some anti-linear isometry U). For \(x,y\in H\) and \(\beta \in {\mathbb {T}}_n\),

$$\begin{aligned} \Vert f(x)-\beta f(y)\Vert= & {} \Vert \sigma (x)U(x)-\sigma (y)\beta U(y)\Vert =\Vert U(\sigma (x)x-\sigma (y)\beta y)\Vert \\= & {} \Vert \sigma (x)x-\sigma (y)\beta y\Vert =\Vert x-\overline{\sigma (x)}\sigma (y)\beta y\Vert \end{aligned}$$

(respectively,

$$\begin{aligned} \Vert f(x)-\beta f(y)\Vert= & {} \Vert \sigma (x)U(x)-\sigma (y)\beta U(y)\Vert =\Vert U(\overline{\sigma (x)}x-\overline{\sigma (y)\beta } y)\Vert \\= & {} \Vert \overline{\sigma (x)}x-\overline{\sigma (y)\beta } y\Vert =\Vert x-\sigma (x)\overline{\sigma (y)\beta } y\Vert ). \end{aligned}$$

Note that \(\beta {\mathbb {T}}_n={\mathbb {T}}_n\) and \({\overline{\beta }}\in {\mathbb {T}}_n\) for every \(\beta \in {\mathbb {T}}_n\). It follows that Eq. (1.4) holds.

(iv) \(\Longrightarrow \) (v). Suppose that Eq. (2.8) holds. Therefore Eq. (1.1) holds. By Wigner’s theorem, there exist a phase function \(\sigma _1: H \rightarrow {\mathbb {T}}\) and a linear or anti-linear isometry \(U_1:H \rightarrow K\) such that \(f=\sigma _1\cdot U_1\). Next, we will divide our proof into two cases: \(\dim H=1\) and \(\dim H\ge 2\).

  1. (I)

    The case that \(\dim H=1\). In this case, we have that \(f(H)\subset U_1(H)\) and \(\dim U_1(H)=1\). After a suitable identification, the mapping f can be regarded as a mapping \(f:{\mathbb {C}}\rightarrow {\mathbb {C}}\). Set

    $$\begin{aligned} A&:=\left\{ x\in {\mathbb {C}}\backslash \{0\}:\frac{x}{{\overline{x}}} \in {\mathbb {T}}_n\right\} ,\\ B&:=\left\{ x\in {\mathbb {C}}\backslash \{0\}:\frac{x}{{\overline{x}}} \notin {\mathbb {T}}_n \text{ and } f(x)=\beta (x,1)f(1)x\right\} , \end{aligned}$$

    and

    $$\begin{aligned} C:=\left\{ x\in {\mathbb {C}}\backslash \{0\}:\frac{x}{{\overline{x}}} \notin {\mathbb {T}}_n \text{ and } f(x)=\beta (x,1)f(1){\overline{x}}\right\} . \end{aligned}$$

    Obviously, the sets A, B and C are disjoint. By Eq. (2.8), we have that \(A\cup B\cup C={\mathbb {C}}\backslash \{0\}\). We claim that \(B=\emptyset \) or \(C=\emptyset \). Suppose, on contrary that \(x\in B\) and \(y\in C\). Then

    $$\begin{aligned} f(x)=\beta (x,1)f(1)x \quad \text{ and }\quad f(y)=\beta (y,1)f(1){\overline{y}}. \end{aligned}$$

    Substituting these into Eq. (2.8), we obtain that

    $$\begin{aligned} \beta (x,1)\overline{\beta (y,1)}xy=\beta (x,y)x{\overline{y}} \quad \text{ or }\quad \beta (x,1)\overline{\beta (y,1)}xy=\beta (x,y){\overline{x}}y, \end{aligned}$$

    which means that

    $$\begin{aligned} \frac{y}{{\overline{y}}}=\frac{\beta (x,y)}{\beta (x,1)\overline{\beta (y,1)}}\in {\mathbb {T}}_n \quad \text{ or }\quad \frac{x}{{\overline{x}}}=\frac{\beta (x,y)}{\beta (x,1)\overline{\beta (y,1)}}\in {\mathbb {T}}_n. \end{aligned}$$

    However, the fact \(x\in B\) and \(y\in C\) implies that

    $$\begin{aligned} \frac{x}{{\overline{x}}}\notin {\mathbb {T}}_n \quad \text{ and }\quad \frac{y}{{\overline{y}}}\notin {\mathbb {T}}_n. \end{aligned}$$

    This contradiction proves the claim. If \(C=\emptyset \), then we set

    $$\begin{aligned} A_1:=\left\{ x\in {\mathbb {C}}\backslash {\mathbb {R}}:\frac{x}{{\overline{x}}}\in {\mathbb {T}}_n \text{ and } f(x)=\beta (x,1)f(1){\overline{x}}\right\} . \end{aligned}$$

    If \(x\in A_1\), then

    $$\begin{aligned} \frac{{\overline{x}}}{x}\in {\mathbb {T}}_n \quad \text{ and }\quad f(x)=\beta (x,1)f(1){\overline{x}}=\beta (x,1)\frac{{\overline{x}}}{x}f(1)x. \end{aligned}$$

    If \(x\in A\backslash A_1\) or \(x\in B\), then Eq. (2.8) implies that

    $$\begin{aligned} f(x)=\beta (x,1)f(1)x. \end{aligned}$$

    Define

    $$\begin{aligned} \sigma (x)={\left\{ \begin{array}{ll} \beta (x,1)\frac{{\overline{x}}}{x}, &{} \quad x\in A_1\\ \beta (x,1), &{} \quad x\in (A\backslash A_1)\cup B\\ 1, &{} \quad x=0 \end{array}\right. } \end{aligned}$$

    and \(U(x)=f(1)x,\ x\in {\mathbb {C}}\). Then \(\sigma ({\mathbb {C}})\subset {\mathbb {T}}_n\), U is a linear isometry and \(f=\sigma \cdot U\). If \(B=\emptyset \), a similar argument shows that there exist a phase function \(\sigma : {\mathbb {C}}\rightarrow {\mathbb {T}}_n\) and an anti-linear isometry \(U:{\mathbb {C}} \rightarrow {\mathbb {C}}\) such that \(f=\sigma \cdot U\). This completes the proof of the case that \(\dim H=1\).

  2. (II)

    The case that \(\dim H\ge 2\). In this case, fix a unit vector \(e\in H\). Define

    $$\begin{aligned} \sigma (x)={\left\{ \begin{array}{ll} \overline{\sigma _1(e)}\sigma _1(x), &{} \quad x\in H\backslash \{0\}\\ 1, &{} \quad x=0 \end{array}\right. } \end{aligned}$$

    and \(U=\sigma _1(e)U_1\). Then \(\sigma : H \rightarrow {\mathbb {T}}\) is a phase function, \(U:H \rightarrow K\) is a linear or anti-linear isometry and \(f=\sigma \cdot U\). It suffices to show that \(\sigma (H\backslash \{0\})\subset {\mathbb {T}}_n\). From Eq. (2.8) it follows that if \(\langle x, y \rangle \in {\mathbb {R}}\backslash \{0\}\) then

    $$\begin{aligned} \beta (x,y)\langle x, y \rangle =\langle f(x), f(y) \rangle =\sigma (x)\overline{\sigma (y)}\langle x, y \rangle , \end{aligned}$$

    which implies that \(\sigma (x)\overline{\sigma (y)}=\beta (x,y)\in {\mathbb {T}}_n\). This is equivalent to saying that \(\sigma (x)\in {\mathbb {T}}_n\) if and only if \(\sigma (y)\in {\mathbb {T}}_n\) whenever \(\langle x, y \rangle \in {\mathbb {R}}\backslash \{0\}\). Let \(Z=({\mathbb {C}}e)^{\perp }=\{z\in H: \langle z, e\rangle =0\}\) and choose arbitrarily \(z\in Z\backslash \{0\}\). Since \(\sigma (e)=1\), the equations \(\langle e, e+z \rangle =1\) and \(\langle z, e+z \rangle =\Vert z\Vert ^2\) imply that \(\sigma (e+z)\in {\mathbb {T}}_n\) and hence \(\sigma (z)\in {\mathbb {T}}_n\). Moreover, for every \(t\in {\mathbb {C}}\backslash \{0\}\), the equation \(\langle z, te+z \rangle =\Vert z\Vert ^2\) implies that \(\sigma (te+z)\in {\mathbb {T}}_n\), and then the equation \(\langle te, te+z \rangle =|t|^2\) implies that \(\sigma (te)\in {\mathbb {T}}_n\). This completes the proof of the case that \(\dim H\ge 2\).

The proof is complete. \(\square \)

Remark 2.6

Note that in (v) of Theorem 2.5, the phrase “a linear or anti-linear isometry” cannot be replaced either by “a linear isometry” or by “an anti-linear isometry”. For example, the mappings \(f_1,f_2:{\mathbb {C}}\rightarrow {\mathbb {C}}\) defined by \(f_1(x)={\overline{x}}\) and \(f_2(x)=x\) both satisfy Eq. (2.8). However, it is easy to check that for any phase function \(\sigma : H \rightarrow {\mathbb {T}}_n\) where \(n\ge 3\), \(\sigma \cdot f_1\) cannot be linear and \(\sigma \cdot f_2\) cannot be anti-linear.

The following corollary describes the continuous solutions of (1.4).

Corollary 2.7

For \(n\ge 3\) and a continuous mapping \(f: H \rightarrow K\), each of Eqs. (1.4), (2.1), (2.2) and (2.8) holds if and only if f is a linear or anti-linear isometry.

Proof

By Theorem 2.5, we need only to prove that Eq. (1.4) implies that f is a linear or anti-linear isometry. Assume that f is a continuous mapping satisfying Eq. (1.4). Then there exists a phase function \(\sigma : H\rightarrow {\mathbb {T}}_n\) such that \(\sigma \cdot f\) is a linear or anti-linear isometry. Thus,

$$\begin{aligned} \sigma (x)\overline{\sigma (y)}\langle f(x), f(y) \rangle =\langle x, y \rangle \quad (x,y\in H) \end{aligned}$$

or

$$\begin{aligned} \sigma (x)\overline{\sigma (y)}\langle f(x), f(y) \rangle =\langle y, x \rangle \quad (x,y\in H). \end{aligned}$$

If \(y\ne 0\), then there exists an open ball \(V_y\) centered at y such that

$$\begin{aligned} \sigma (x)=\sigma (y)\frac{\langle x, y \rangle }{\langle f(x), f(y) \rangle } \quad (x\in V_y) \end{aligned}$$

or

$$\begin{aligned} \sigma (x)=\sigma (y)\frac{\langle y, x \rangle }{\langle f(x), f(y) \rangle } \quad (x\in V_y). \end{aligned}$$

This, by the continuity of f, shows that \(\sigma \) is continuous on \(V_y\). Since the phase function \(\sigma : H\rightarrow {\mathbb {T}}_n\) takes only finite values, we have that \(\sigma \) is constant on \(V_y\). By the fact that \(H\backslash \{0\}\) is connected, \(\sigma \) is constant on \(H\backslash \{0\}\), f must be a linear or anti-linear isometry. \(\square \)

Remark 2.8

The proof of Corollary 2.7 is similar to that of [15, Corollary 3], where the case \(n=2\) was considered as follows. For a continuous mapping \(f: H \rightarrow K\), each of Eqs. (1.3) and (2.6) holds if and only if f is a real linear isometry.