# Is it true $\left\|\log(RS)\right\|≤\left\|\log(R)+\log(S)\right\|$ for all $R,S \in \mathrm{SO}(3)$, where $\|\cdot\|$ is the Frobenius norm?

$$\DeclareMathOperator\SO{SO}$$I asked this initially in math stack exchange, but thought to ask it here since it is more advanced and related to my research topic. I study optimization on Lie groups from a Riemannian geometry viewpoint. Naturally, one of the Lie groups I use the most is $$\SO(3) \subset \mathbb{R}^{3 \times 3}$$ equipped with the bi-invariant metric $$\langle \xi, \eta\rangle = \frac{1}{2} \operatorname{tr}(\xi^T\eta )$$, where $$\xi,\eta \in \mathfrak{so}(3)$$ are $$3 \times 3$$ skew-symmetric matrices. The way I parameterize $$\SO(3)$$ and $$\mathfrak{so}(3)$$ is not important ofc. I could just as easily use unit quaternions.

Lately in my studies, I've been interested in commutation error, and ways to bound it.

I was especially curious if there existed $$K > 0$$ such that $$\left\|\log(R^{-1}S)\right\| \leq K \left\|\log(S) - \log(R)\right\|$$ for all $$R,S \in \SO(3)$$ such that $$\log(S), \log(R), \log(R^{-1}S)$$ exists. Here, $$\log(\cdot)$$ is the Lie logarithm. Under my parameterization, it coincides with the matrix logarithm.

After generating random rotation matrices $$R,S$$ in a script, to my surprise I found $$K=1$$ every single time. I have yet to randomly generate or analytically derive a counterexample. Once again, I am only focusing on pairs $$(R,S)$$ such that each term above exists.

If true, this is a very powerful inequality! I'm surprised to see very little discussion about online. Surely, someone must've noticed this. Any idea how I could prove this?

• How do you define "the Lie logarithm"? (Of course, for M in SO(3), there are infinitely many Lie algebra elements v with exp(v) = M.) May 4 at 2:47
• If one could assign to every matrix $\begin{pmatrix}\cos t&-\sin t&0\\\sin t&\cos t & 0\\0&0&1\end{pmatrix}$ a Lie logarithm in a continuous way, one could lift continuously the circle to the line, and this is not possible.
– YCor
May 4 at 5:07
• If you remove the $\mathbb{RP}^2$ of elements in $\mathrm{SO}(3)$ with trace equal to the mimimum value of $-1$, there is a well-defined smooth logarithm on the open ball that remains. It satisfies $\exp(\log A) = A$. For unit quaternions (or, equivalently, $\mathrm{SU}(2)$), there is a well-defined, smooth logarithm after you remove the single element $-1$ (equivalently, $-I_2$). May 4 at 8:32
• Actually, OP requires rather a condition of "expanding distances".
– YCor
May 4 at 15:25
• @DanielAsimov Are you familiar with Lie theory? I cannot give an entire course in a small comment, but in my particular case the Lie and matrix logarithm coincide. So, it is simply the matrix logarithm, which is well-defined. Wikipedia has a good page on it. May 4 at 16:44

Now that I have written out the completely elementary proof above for the quaternions and for $$\mathrm{SO}(3)$$, I feel that I should point out that the statement $$|\log(ab)|\le |\log(a) + \log(b)|$$, suitably interpreted, is true for any compact connected Lie group $$G$$ endowed with a biïnvariant Riemannian metric. The proof is not completely elementary; but it only relies on facts that are covered in any first course on Riemannian geometry.

Let $$G$$ be a compact, connected Lie group with Lie algebra $${\frak{g}}=T_eG$$, and let $$<,>:\frak{g}\times\frak{g}\to\mathbb{R}$$ be an $$\mathrm{Ad}(G)$$-invariant positive definite inner product on $$\frak{g}$$. Let $$|v| = ^{1/2}$$ for $$v\in\frak{g}$$, as usual. There is a unique biïinvariant Riemannian metric $$g$$ on $$G$$ that equals $$g_0=<,>$$ on $${\frak{g}} = T_eG$$. Let $$d:G\times G\to \mathbb{R}$$ be the associated distance function of $$g$$. It satisfies $$d(ac,bc)=d(ca,cb)=d(a,b)$$ for all $$a,b,c\in G$$.

Because the sectional curvature of $$g$$ is non-negative, the Lie group exponential map (which is equal to the exponential map of $$g$$ at $$e\in G)$$, i.e., $$\exp:{\frak{g}}\to G$$, satisfies $$\exp^*(g)\le g_0$$ (as smooth quadratic forms on $$\frak{g}$$). (For a proof, see, for example, Helgason's Differential Geometry, Lie Groups, and Symmetric Spaces.)

Now, Let $$U\subset G$$ be the connected, dense open set of points $$a\in G$$ for which there is a unique $$g$$-length-minimizing geodesic from $$e$$ to $$a$$. (The complement of $$U$$ is a closed algebraic set in $$G$$ called the cut locus of $$G$$.) Then for each $$a$$ in $$U$$, there is a unique element $$\log a\in\frak{g}$$, such that the curve $$\gamma(t) = exp\bigl(t\log(a)\bigr)$$ for $$0\le t\le 1$$ is that unique $$g$$-length-minimizing geodesic. Then $$\log:U\to\frak{g}$$ is a smooth inverse to $$\exp$$ in the sense that $$\exp(\log a) = a$$.

By construction, $$|\log(a)| = d(a,e)$$, so, in particular, the function $$a\mapsto|\log(a)|$$ extends continuously to all of $$G$$, even though $$\log$$ does not.

Now, for $$a,b\in U$$, we have the following estimate: $$|\log(ab^{-1})| = d(e,ab^{-1}) = d(b,a) = d(a,b)$$ and the righthand number is less than or equal to the length of the curve $$\gamma(t) = \exp\bigl((1{-}t)\log(a)+t\log(b)\bigr)$$ for $$0\le t\le 1$$. However, because $$\exp^*(g)\le g_0$$, the $$g$$-length of $$\gamma$$ is less than or equal to the $$g_0$$-length of the line segment $$\alpha(t) = (1{-}t)\log(a)+t\log(b)$$ in $$\frak{g}$$, which is $$|\log(a)-\log(b)|$$. (Note that $$\alpha(t)$$ does not have to lie in the image of $$\log$$ for all $$0 in order for this statement to hold.)

Thus, $$|\log(ab^{-1})| \le |\log(a)-\log(b)|$$ for all $$a,b\in U$$, i.e., for all $$a$$ and $$b$$ for which $$\log$$ is defined. Replacing $$b$$ by $$b^{-1}$$ and using the fact that $$\log(b^{-1}) = -\log b$$ yields $$|\log(ab)| \le |\log(a)+\log(b)|$$ for all $$a,b$$ in the domain of $$\log:U\to \frak{g}$$. (It doesn't matter whether $$ab$$ is in the domain of $$\log$$.)

• Wow! What a remarkable inequality. Although I am not an expert in Lie theory, I have read quite a few papers and sections on the topic in textbooks. Though I never came across anything like this. I wonder if this could be generalized to compact Riemannian manifolds with non-negative sectional curvature. May 8 at 16:44
• I guess the generalization to complete Riemannian manifolds $(M,g)$ with nonnegative sectional curvature is that, for any $x\in M$, we have $\exp_x^*(g)\le g_x$ as quadratic forms on $T_xM$, which would then imply that $d\bigl(\exp_x(a),\exp_x(b)\bigr) \le |a-b|$ for $a,b\in T_x$ for which $\alpha(t) = \exp_x(ta)$ and $\beta(t) = \exp_x(tb)$ for $0\le t\le 1$ are $g$-length minimizing geodesics between their endpoints. May 8 at 17:34
• Could you explain what $\exp^*(g) \leq g_0$ means? What is $\exp^*$ and how can it be "less than" an inner product? Also, would you know where in Helgason I could find this proof? May 8 at 23:25
• I have the textbook in front of me, seems to be something related to differential invariants, of which I lack a bit of understanding. May 8 at 23:46
• About your question about the textbook, I don't have it in front of me, so I'll have to wait until tomorrow to answer that. May 9 at 0:18

I realized a problem with my 'counterexample', so I no longer claim that the desired inequality does not hold on $$\mathrm{SO}(3)$$. The proof that it does hold on the quaternions is still OK. I'll point out my error below and will explain how to use the proof for quaternions to prove the result for $$\mathrm{SO}(3)$$.

The goal is to prove the inequality $$\left\|\log(RS)\right\|\le\left\|\log(R)+\log(S)\right\|$$ for all $$R,S\in\mathrm{SO}(3)$$ for which $$\log(RS)$$, $$\log(R)$$, and $$\log(S)$$ are defined. (In what follows, I'm taking the Frobenius norm to be $$\|B\|^2 = \tfrac12\,\mathrm{tr}(B^TB)$$, but this normalization clearly does not affect the argument.)

Notice that the function $$B\mapsto \left\|\log(B)\right\|$$ is actually a continuous function on $$\mathrm{SO}(3)$$, because of the easily checked identity $$\cos\bigl(\left\|\log(B)\right\|\bigr) = \tfrac12\bigl(\operatorname{tr}(B)-1\bigr)$$ and the fact that $$\cos^{-1}:[-1,1]\to[0,\pi]$$ is a continuous, strictly decreasing function on $$[-1,1]$$. So even though $$\log(B)$$ is not defined when $$\mathrm{tr}(B)=-1$$, we can extend $$\left\|\log(B)\right\|$$ continuously (though not smoothly) to $$\mathrm{SO}(3)$$ by setting $$\|\log(B)\|=\pi$$ when $$\mathrm{tr}(B)=-1$$.

Thus, since the inequality trivially holds if $$\left\|\log(R)+\log(S)\right\|\ge\pi$$, one only needs to consider the cases where $$\left\|\log(R)+\log(S)\right\|\le\pi$$. In this case, because $$\cos:[0,\pi]\to[-1,1]$$ is a strictly decreasing function on $$[0,\pi]$$, the desired inequality is equivalent to $$\tfrac12\bigl(\operatorname{tr}(RS)-1\bigr) \ge \cos\bigl(\left\|\log(R)+\log(S)\right\|\bigr).$$

In my previous (flawed) analysis, I constructed $$R$$ and $$S$$ in $$\mathrm{SO}(3)$$ that violated this latter inequality. However, the example that I constructed has $$\left\|\log(R)+\log(S)\right\| > \pi$$, so it is not a counterexample to the original inequality.

I will now explain how one can prove the inequality after a detour through the quaternions, where the analysis turns out to be easier. We do indeed have $$\left|\log(pq)\right|\le \left|\log(p) + \log(q)\right|$$ for unit quaternions $$p$$ and $$q$$ different from $$-1$$, so long as we make the convention that $$\left|\log(-1)\right| = \pi$$, even though $$\log(-1)$$ cannot be defined continuously.

Consider the quaternions $$\mathbb{H}$$, i.e., expressions of the form $$q = x_0 + x_1\,i + x_2\,j + x_3\,k$$, where the $$x_i$$ are real numbers and $$i$$, $$j$$, and $$k$$ satisfy the usual relations $$i^2=j^2=k^2=-1$$ and $$ij-k=jk-i=ki-j=ji+k=kj+i=ji+k=0$$. The real part of $$q$$ is $$x_0$$ and the imaginary part of $$q$$ is $$x_1\,i + x_2\,j + x_3\,k$$. As usual, set $$|q| = (x_0^2+x_1^2+x_2^2+x_3^2)^{1/2}$$. The unit quaternions $$S^3\subset \mathbb{H}\simeq\mathbb{R}^4$$ form a group. Write $$\mathbb{H} = \mathbb{R} \oplus \mathrm{Im}\mathbb{H}$$, where $$\mathrm{Im}\mathbb{H}\simeq\mathbb{R}^3$$ is the quaternions with vanishing real part.

If $$u$$ is a unit imaginary quaternion then $$u^2=-1$$, so that, when $$a$$ is real, we have $$\exp(a\,u) = \cos a + \sin a \,u$$. Every unit quaternion $$q$$ other than $$-1$$ is of the form $$\exp(x)$$ for some unique purely imaginary quaterion $$x$$ with $$|x|<\pi$$. Then setting $$x := \log q$$ defines $$\log$$ as a smooth function on the unit quaternions minus the single element $$-1$$. Note that $$\left|\log q \right|) = |x| = |a|$$, so $$\cos\bigl(\left|\log q\right|\bigr) = \cos a$$, which is the real part of $$q$$.

Suppose that $$q = \cos a + \sin a \,u$$ while $$p=\cos b + \sin b \,v$$ where $$0\le a,b<\pi$$ and $$u$$ and $$v$$ are unit quaternions, with $$u\cdot v = \cos c$$ for some $$c$$. Note that the real part of $$uv$$ is $$-\cos c$$. Thus, we have the product expansion $$qp = (\cos a + \sin a \,u)(\cos b + \sin b \,v) = (\cos a\cos b-\sin a\sin b\cos c) + X$$ where $$X$$ is imaginary. Thus $$\cos\bigl(\left|\log(qp)\right|\bigr) = (\cos a\cos b-\sin a\sin b\cos c).$$ Meanwhile $$\left|\log q + \log p\right| = |au+bv| = \sqrt{a^2+2ab\cos c+b^2}.$$

Since $$\left|\log(qp)\right|\le\pi$$, in order to verify the inequality $$\left|\log(qp)\right|\le \left|\log q + \log p\right|$$, one only needs to deal with the cases in which $$0\le \left|\log q + \log p\right|\le \pi$$, which may as well be assumed. In this case, since $$\cos$$ is a strictly decreasing function on the interval $$[0,\pi]$$, the inequality $$\left|\log(qp)|\le \right|\log q + \log p|$$ is equivalent to $$\cos\bigl( \left| \log(qp) \right| \bigr)\ge \cos\bigl(\left|\log q + \log p\right|\bigr)$$, i.e., $$(\cos a\cos b-\sin a\sin b\cos c) \ge \cos\bigl(\sqrt{a^2+2ab\cos c+b^2}\bigr).$$ Now, it can be shown that this inequality does indeed hold for all $$c$$ and all $$a$$ and $$b$$ with $$|a|,|b|<\pi$$ (not just when $$a^2+2ab\cos c+b^2\le \pi^2$$). (In fact, by continuity, it holds for $$|a|,|b|\le \pi$$ and all $$c$$. Moreover, equality holds in this range of the variables only when $$a=0$$, $$b=0$$ or $$\cos c = \pm 1$$.) [A proof of the above inequality goes as follows: Let $$F(a,b,t)= \cos a\cos b-t \sin a\sin b-\cos\bigl(\sqrt{a^2+2abt+b^2}\bigr).$$ Then $$F$$ is an analytic function on $$\mathbb{R}^3$$ that vanishes when $$a=0$$, $$b=0$$ or $$t=\pm 1$$. Since $$F(-a,b,-t)=F(a,-b,-t)=F(a,b,t)$$ it suffices to prove the inequality for $$0. So fix such $$a$$ and $$b$$ and note the easily proved fact that, as a function of $$t$$, $$F(a,b,t)$$ vanishes at $$t=\pm 1$$ and has at most one critical point in the range $$|t|<1$$. (Just look at $$F_t(a,b,t)$$.) Thus, $$F(a,b,t)$$ cannot vanish or change sign when $$|t|<1$$. Now show that $$F(a,b,0) = \cos a\cos b-\cos\bigl(\sqrt{a^2+b^2})$$ is positive for small $$a,b>0$$ (by Taylor expansion). Since $$F(a,b,0)$$ can never vanish when $$0, it must be positive for all such $$a,b$$, and hence $$F(a,b,t)$$ must be positive when $$|t|<1$$.]

Thus, the desired inequality $$\left|\log(qp)\right|\le \left|\log q + \log p \right|$$ follows.

(Note that $$qp=-1$$ would imply that $$p=-\bar q$$, so $$\cos(a)+\cos(b)=0$$ and $$\sin a\,u=\sin b\,v$$. But then $$|\sin a|=|\sin b|$$. This forces $$a+b = \pi$$ (since we can assume that $$0\le a,b <\pi$$) and $$u=v$$, i.e., $$c=0$$. Thus, the inequality holds even when $$\log (qp)$$ does not exist.)

To deal with the case of $$\mathrm{SO}(3)$$, make use of the double covering homomorphism $$\rho:S^3\to\mathrm{SO}(3)$$ defined by $$\rho(q)(x) = q x \bar q$$ for $$q\in S^3$$ and $$x\in \mathrm{Im}\mathbb{H}$$. The homomorphism $$\rho$$ maps the unit quaterions with positive real part diffeomorphically onto the elements of $$\mathrm{SO}(3)$$ with trace greater than $$-1$$.

One then finds that $$\log(\rho(q)) = \mathrm{ad}(\log q)$$, and this allows one to use the inequality $$\left|\log(qp)\right|\le \left|\log q + \log p \right|$$ to show the desired inequality $$\left\|\log(RS)\right\|\le\left\|\log(R)+\log(S)\right\|$$ for all $$R,S\in\mathrm{SO}(3)$$ for which $$\log(RS)$$, $$\log(R)$$, and $$\log(S)$$ are defined.

• Hm, I plugged this in matlab and the inequality still holds for me. I, in particular, set $x=2.5$. Although my code could be incorrect, I highly doubt it considering my script is simple (just matrix exponential and logarithms, and traces). I'm happy to share my code with you. May 5 at 16:08
• Hm, if you provide me numerical evidence of this counterexample, I will select your answer. However, from my script, this example does not flip my inequality. May 5 at 23:01
• @SpencerKraisler: I realized my error, which was applying the cosine function to reverse the inequality on a range where cosine is not strictly decreasing. That's why the cosine'd inequality fails but it doesn't give a counterexample to your inequality. Things go better for the quaternions, and you'd think that would also work for $\mathrm{SO}(3)$, but I'm checking the details. May 6 at 15:10
• No worries. But if it holds for unit quaternions, and the unit quaternions are a double cover of $SO(3)$, I would think there's some nifty isometry trick one can use to match everything to $SO(3)$. At the end of the day, they're both Lie groups and we're dealing with two different embeddings of the "same" manifold (not the same ofc). May 6 at 18:14