# General commutator $[f(A),g(B)]$ of functions

Let us have two hermitian operators $$A,B$$ and their commutator $$[A,B]:=AB−BA$$, then let us have two functions $$f,g$$ and we want to to calculate $$[f(A),g(B)]$$ (everything is still hermitian). I have a couple questions:

1. If $$[A,B]=0$$, is it true that $$[f(A),g(B)]=0$$? Note: it's easy to prove this for analytical functions, but what if $$f$$ and $$g$$ are not analytical?

2. If $$[A,B] \neq 0$$, is it true that $$[f(A),g(B)]\neq 0$$?

3. I've stumbled across this formula: $$[A,g(B)]=g'(B)[A,B]$$ from here in the case that $$[[A,B],B]=0$$. How does this generalise to $$[f(A),g(B)]$$ if $$[A,[A,B]]=0$$ and $$[[A,B],B]=0$$?

4. How do you prove $$[A,g(B)]=g'(B)[A,B]$$ or the more general formula for $$[f(A),g(B)]$$? Again, I'd like to have a general answer that works for non-analytical functions as well.

Edit for answering to a couple comments: the goal here is not to have mathematically rigourous answers, but rather having some general facts to be used (carefully) in theoretical physics. Obviously the best thing would be to study the problem case by case, but I think that some general statements can be made (and some useful discussion has already been made indeed). In particular I'm not looking for domain issues or other nitpicky details.

• The point is that rigorous statements would require rigorous definitions of $A,B,f(A),g(B)$, making precise distinctions beteween Hermitian, symmetric, and selfadjoint operators. As they stand your statements are formulated as standard folklore of theoretical physicists. Within that vague approach everything you wrote is true. Mathematically speaking nothing you wrote is correct. So, everything depends on your intention: rigorous mathematics or effective theoretical physics? Jun 6 '21 at 9:15
• In the latter case you should be content with vague statements, in the former you should re-start everything form scratch with the appropriate definitions before stating your questions. Jun 6 '21 at 9:19
• @ValterMoretti I like the "standard folklore of theoretical physics", but in the folklore your comment is not correct. E.g. for 2. if $f(A) = 1$, then $[f(A),f(B)]=0$. So even when one is folkloristic one needs a minimum of rigour ;-) Jun 6 '21 at 10:24
• Non-rigorous lore to help you with concrete examples, so you focus your question. As it is, you are asking for an essay. Jun 6 '21 at 10:59
• Hi Emanuele Giordano. Welcome to Phys.SE. Can we assume that $[A,[A,B]]=0$ and $[[A,B],B]=0$? Jun 6 '21 at 12:05

I think that after my comment I should provide some sort of answer to avoid appearing as a pedantic mathematician (mathematical physicist). Actually my PhD is in theoretical physics and I'm proud of it ...

First of all let us get rid of issues with domains and of the subtle distinctions between Hermitian, symmetric, selfadjoint and so on.

If we assume to deal with operators $$A,B$$ defined everywhere on a Hilbert space $${\cal H}$$, then $$[A,B]$$ is well defined and all the considered operators are also bounded (continuous) as a consequence of a well-known theorem on everywhere defined selfadjoint operators.

In this case, also the distinction between Hermitian, symmetric and selfadjoint becomes immaterial.

In this case, the spectra $$\sigma(A)$$ and $$\sigma(B)$$ are closed bounded subsets of $$\mathbb{R}$$. I stress that the spectra may include both continuous and point parts.

Unfortunately, the number of situations where this happens in physics is really negligible. The fundamental reason is that the spectrum is made of the observed values of the observables $$A$$ and $$B$$ and bounded spectra means that these observables attain finite ranges of values, which is not the case in the most frequent situations in physics.

The only really interesting case is when $${\cal H}$$ is finite-dimensional, for instance when dealing with the spin of particles.

In that case $$A = \sum_{j=1}^n \lambda_j P_j$$ and, by definition, $$f(A) := \sum_{j=1}^n f(\lambda_j) P_j$$ where $$\lambda_1,\ldots, \lambda_n$$ are the eigenvalues of $$A$$ and $$P_j$$ the corresponding orthogonal projectors onto the respective eigenspace.

You see that the used functions $$f$$ are defined on a discrete set and thus any issue on their regularity (analyticity) make no sense or is artificial''.

So, forgetting physical (ir)relevance, we assume that $${\cal H}$$ is infinite dimensional, but $$A$$, $$B$$, and thus $$[A,B]$$ are everywhere defined, thus bounded -- $$||A||, ||B|| < +\infty$$ -- and $$A$$ and $$B$$ are Hermitian (= selfadjoint) and their spectra are bounded closed sets.

The definition of $$f(A)$$, and this definition is valid also if $$A=A^*$$ has (dense) domain $$D(A) \subsetneq {\cal H}$$, is $$f(A) := \int_{\sigma(A)} f(\lambda) dP^{(A)}(\lambda)\tag{2}$$ where $$f: \mathbb{R} \to \mathbb{C}$$ is Borel measurable and $$P^{(A)}$$ is the spectral measure of $$A$$. Actually, only the restriction of $$f$$ to $$\sigma(A)$$ matters here. If $$A$$ and $$f$$ satify the said strong hypotheses $$\left|\left|\int_{\sigma(A)} f(\lambda) dP^{(A)}(\lambda)\right|\right| \leq ||f|_{\sigma(A)}||_\infty\:,$$ I will use this inequality below.

Within this setup let us consider the various raised questions.

1. $$[A,B]=0$$ implies $$[f(A),g(B)]=0$$.

YES it is true for every choice of Borel measurable (for instance continuous) $$f, g : \mathbb{R} \to \mathbb{C}$$ such that $$f$$ is bounded on the spectrum of $$A$$ and $$g$$ is bounded on the spectrum of $$B$$.

The proof is based on the fact that, in the considered case $$[A,B]=0$$ is equivalent to the commutativity of the spectral measures of $$A$$ and $$B$$ and this fact, in turn, implies the thesis.

Sketch of proof. Consider a sequence of simple functions $$s_n(x) = \sum_{k=1}^{N_n} s^{(n)}_{k} \chi_{E_{n,k}}(x)$$ such that converges uniformly to the function $$f$$ in a compact $$[a,b]$$ including $$\sigma(A)$$ and $$\Sigma(B)$$. A similar sequence $$t_n= \sum_{h=1}^{N_n} t^{(n)}_{h} \chi_{F_{n,h}}(x)$$ uniformly converges to $$g$$ on $$[a,b]$$. According to (2) $$s_n(A) = \sum_{k=1}^{N_n} s^{(n)}_{k} P^{(A)}_{E_{n,k}}$$ and $$t_n(B) = \sum_{h=1}^{N_n} s^{(n)}_{h} P^{(A)}_{F_{n,h}}$$ where $$[P^{(A)}_{E}, P^{(B)}_{F}]=0$$ as a consequence (it is true in our case) of $$[A,B]=0$$. We also have $$||f(A) -s_n(A)|| \leq ||f-s_n||_\infty \to 0\:, \quad ||g(B) -t_n(B)|| \leq ||g-t_n||_\infty \to 0$$ as $$n \to +\infty$$. And also $$[f(A),g(B)] = \lim_{n\to +\infty} \left[\sum_{k=1}^{N_n} s^{(n)}_{k} P^{(A)}_{E_{n,k}}, \sum_{h=1}^{N_n} t^{(n)}_{h} P^{(B)}_{F_{n,h}}\right]= \sum_{k_1}^{N_n}\sum_{h=1}^{N_n} s^{(n)}_{k} t^{(n)}_{h} [P^{(A)}_{E_{n,k}}, P^{(B)}_{F_{n,h}}]=0$$

1. $$[A,B] \neq 0$$ implies $$[f(A),g(B)]\neq 0$$.

NO. This is in general false. An easy counterexample was provided by @Oбжорoв: take $$f(x) =g(x) = 1$$ for every $$x\in \mathbb{R}$$. In that case $$f(A)=g(B)=I$$.

1. and 4. How to prove $$[A,g(B)]= g'(B)[A,B]$$, if $$A,B$$ are Hermitian everywhere defined in $${\cal H}$$ and $$[[A,B],B]=0$$?

Without this last hypothesis I do not know a proof and I think the identity is false (see the final ADDENDUM). I also assume that $$f$$ is $$C^1$$ (no analyticty is necessary).

Proposition.

If $$A,B$$ are Hermitian, everywhere defined in $${\cal H}$$, $$[[A,B],B]=0$$, and $$f$$ is a $$C^1$$ function defined on an bounded interval $$[a,b] \supset\sigma(B)$$, then $$[A,g(B)]= g'(B)[A,B]\:.$$

Proof. Using an easy extension of the Stone-Weierstrass theorem, one proves that, since $$[a,b]$$ is compact and $$g$$ is $$C^1$$, there is a sequence of polynomials $$p_n$$ such that $$p_n \to g$$ and $$p'_n \to g'$$ uniformly on $$[a,b]$$. As already established in another post in PSE via direct algebraic manipulations, $$[A,p_n(B)]= p_n'(B)[A,B]\tag{1}$$ is true for polynomials when $$[[A,B],B]=0$$ and assuming that $$A$$ and $$B$$ are everywhere defined. We have $$||[A,p_n(B)] - [A,g(B)]|| = ||[A,p_n(B)-g(B)]|| \leq 2||A||\: ||p_n(B)-g(B)||$$ $$\leq 2||A||\: ||p_n(x)-g(x)||_\infty \to 0 \quad \mbox{for n\to +\infty.}$$ Analogously $$||p_n'(B)[A,B]- g'(B)[A,B]|| \leq ||p_n'(B)- g'(B)|| 2||A||\:||B||$$ $$\leq ||p'_n-g'||_\infty 2||A||||B|| \to 0\:.$$ Since $$[A,p_n(B)] \to [A,g(B)]$$ and $$p_n'(B)[A,B]\to g'(B)[A,B]$$ in the operator norm as $$n\to +\infty$$ and (1) holds, we conclude that $$[A,g(B)]= g'(B)[A,B]\:.$$ QED

As a final comment, I stress that one could (should?) investigate what happens when assuming less rigid hypotheses more close to physics, i.e., $$A$$ and $$B$$ unbounded, selfadjoint defined in dense domains. In this case $$[A,B]=0$$ does not make sense in view od problems with domains, but in spirit it means that the observables $$A$$ and $$B$$ are compatible, i.e., their spectral measures commute...

ADDENDUM. The hypothesis $$[[A,B],B]=0$$ cannot be easily relaxed. Indeed, suppose that $$[A,g(B)]= g'(B)[A,B]$$ for a suitable class of functions $$g$$ as the function $$C^1$$, that includes the polynomials. We conclude that $$[A,B^2]= 2B[A,B]$$. On the other hand $$[A,B^2]= B[A,B] + [A,B]B$$. Taking the difference, $$B[A,B]-[A,B]B=0$$ that is $$[B,[A,B]]=0$$, namely $$-[[A,B],B]=0$$

• Ok, that's quite the proof I was searching for point 4, but could you please give some more information about point 3, about the $[f(A),g(B)]$ case. Could we just reproduce the same proof twice to end up with $[f(A),g(B)]=g'(B)[A,B]f'(A)$ in the case that $[A,[A,B]]=0$ and $[[A,B],B]=0$? Jun 6 '21 at 13:47
• I added a sketch of proof of 2. Regarding your last issue, now it is just matter of formal manipulations of polynomial functions: just try to produce your result assuming to deal with polynomials... If it holds it also holds for $C^1$ functions. Jun 6 '21 at 14:16