# Matrix Logarithms

Consider the exponential map for matrices ${\exp : \text{End}(\mathbb{C}^{m}) \rightarrow \text{Gl}(m, \mathbb{C})}$, which can be defined by the formula

$\displaystyle e^{x} = \sum_{k = 0}^{\infty} \frac{(2 \pi i)^k}{k!} x^{k},$

where ${x}$ is a square matrix. A matrix logarithm is defined to be a right-inverse to the exponential; that is to say, it is a function ${\log: \text{Gl}(m, \mathbb{C}) \rightarrow \text{End}(\mathbb{C}^{m})}$ such that ${\exp \circ \log = \text{id}_{ \text{Gl}(m, \mathbb{C})}}$. It is a standard result of Lie theory that the exponential is a diffeomorphism in a neighbourhood of ${0}$ in ${\text{End}(\mathbb{C}^{m})}$, and hence there is a well-defined choice of logarithm in a neighbourhood of the identity in ${\text{Gl}(m, \mathbb{C})}$. However, it is not at all clear that a logarithm can be globally defined, or that there is a unique way of doing so. This problem also shows up in the more simple case of the exponential for complex numbers. Indeed, there are several choices for the complex logarithm, and none of them are analytic (or even continuous) on all of ${\mathbb{C}^{\times}}$. However, it turns out that choosing a complex logarithm is enough to determine a unique choice of a matrix logarithm in any dimension. More precisely, we have the following:

Theorem. Consider the exponential sequence for complex numbers

$\displaystyle 0 \rightarrow \mathbb{Z} \rightarrow \mathbb{C} \mathop{\rightarrow}^{\exp} \mathbb{C}^{\times} \rightarrow 0,$

and let ${\tau : \mathbb{C}^{\times} \rightarrow \mathbb{C}}$ be a set-theoretical splitting of this sequence, in other words, a (not-necessarily continuous) branch of the complex logarithm. Then for any positive integer ${m}$, there is a uniquely defined matrix logarithm

$\displaystyle \log: \text{Gl}(m, \mathbb{C}) \rightarrow \text{End}(\mathbb{C}^{m})$

such that for every ${x \in \text{Gl}(m, \mathbb{C})}$ the eigenvalues of ${\log(x)}$ lie in the image of ${\tau.}$

1. Matrix decompositions

Before discussing matrix logarithms, we’ll start by stating two decomposition results for square matrices. Recall that a matrix ${x}$ is semi-simple if it is diagonalizable, and that it is nilpotent if it gives ${0}$ when raised to some positive power. The Jordan-Chevalley decomposition can be stated as follows:

Proposition. Given a square matrix ${x}$, there are unique matrices ${x_{s}}$, ${x_{n}}$ such that ${x_{s}}$ is semi-simple, ${x_{n}}$ is nilpotent, ${x_{s}}$ and ${x_{n}}$ commute, and ${x = x_{s} + x_{n}}$. Furthermore, ${x_{s}}$ and ${x_{n}}$ commute with any matrix that commutes with ${x}$. Note also that ${x}$ and ${x_{s}}$ have the same set of eigenvalues.

The proof for this is standard and can be found, for example, in Humphreys’ book on Lie algebras and representation theory. Existence of the decomposition is obvious from Jordan normal form.

A corollary to this is a multiplicative version of the decomposition theorem in the case of invertible matrices. Recall that a matrix ${x}$ is unipotent if ${x - I}$ is nilpotent.

Corollary. Given an invertible matrix ${x}$, there are unique invertible matrices ${s}$ and ${u}$ such that ${s}$ is semi-simple, ${u}$ is unipotent, ${s}$ and ${u}$ commute, and ${x = su}$. Furthermore, ${s}$ and ${u}$ commute with any matrix which commutes with ${x}$. Note also that ${x}$ and ${s}$ have the same set of eigenvalues.

Sketch of proof. Using the Jordan-Chevalley decomposition we get ${x = x_{s} + x_{n}}$ for ${x_{s}}$ semi-simple and ${x_{n}}$ nilpotent. Then ${x = x_{s}(I + x_{s}^{-1} x_{n})}$; so let ${s := x_{s}}$, ${u := (I + x_{s}^{-1} x_{n})}$. Thus ${x = su}$, for ${s}$ semi-simple, and ${u}$ unipotent. ${\Box}$

2. Matrix logarithm for Unipotent matrices

We begin by describing the matrix exponential and logarithm in the case of nilpotent and unipotent matrices. Let ${N \subseteq \text{End}(\mathbb{C}^{m})}$ denote the subspace of nilpotent matrices, and let ${U \subseteq Gl(m,\mathbb{C})}$ denote the subset of unipotent matrices. If ${x \in N}$ is nilpotent, then observe that

$\displaystyle e^{x} = I + \sum_{k=1}^{\infty} \frac{1}{k!}(2 \pi i x)^{k}$

is a finite sum and is therefore unipotent. Hence the matrix exponential gives a map ${e: N \rightarrow U}$. On the other hand, given a unipotent matrix ${x \in U}$, the formal series expansion for the logarithm

$\displaystyle \widetilde{\log}(x) := \frac{i}{2 \pi} \sum_{k = 1}^{\infty} \frac{(-1)^k}{k} (x - I)^{k}$

is a finite sum of commuting nilpotent matrices, and is therefore a nilpotent matrix. Hence we have a map ${\widetilde{\log}}$ which sends unipotent matrices to nilpotent matrices: ${\widetilde{\log} : U \rightarrow N}$. Since the series expansions for ${\log}$ and ${e}$ are formally inverse to each other, our definitions for ${e}$ and ${\widetilde{\log}}$ in the present case are actually inverse to each other. Hence ${\widetilde{\log}}$ indeed defines a matrix logarithm and we have the following proposition

Proposition The exponential gives a bijection ${e: N \rightarrow U}$ between the nilpotent matrices and the unipotent matrices. In particular, given a unipotent matrix ${x}$, there is a unique nilpotent logarithm ${\log(x) \in N}$.

3. Matrix logarithm for Semi-simple matrices

We now describe the matrix logarithm in the case of semi-simple matrices. We will see that in this case, in order to define a matrix logarithm, we must first choose a set theoretical splitting ${\tau}$ of the exponential sequence as above. We begin with the following preliminary fact:

Lemma. ${x}$ is semi-simple if and only if ${e^x}$ is semi-simple.

Proof. One direction is obvious: if ${x}$ is semi-simple, then ${x = C D C^{-1}}$ for ${D}$ diagonal, and hence ${e^{x} = C e^{D} C^{-1}}$, where ${e^{D}}$ is diagonal. In general, let ${x = x_{s} + x_{n}}$; in this case ${e^x = e^{x_{s}}e^{x_{n}}}$. Since ${x_{n}}$ is nilpotent,

$\displaystyle e^{x_{n}} - I = \sum_{k = 1}^{\infty} \frac{(2 \pi i)^k}{k!} x_{n}^{k},$

is also nilpotent. Furthermore, since ${e^{x_{s}}}$ and ${e^{x_{n}} - I}$ commute, ${e^{x} = e^{x_{s}} + e^{x_{s}}(e^{x_{n}} - I)}$ is the Jordan-Chevalley decomposition. Hence, by uniqueness of this decomposition, if ${e^{x}}$ is semi-simple, then ${e^{x} = e^{x_{s}}}$ and ${e^{x_{s}}(e^{x_{n}} - I) = 0}$. But this implies that

$\displaystyle \sum_{k = 1}^{\infty} \frac{(2 \pi i)^k}{k!} x_{n}^{k} = 0.$

Choose a basis such that ${x_{n}}$ is strictly upper triangular. If ${x_{n} \neq 0}$, let ${(x_{n})_{i,j}}$ be a nonzero entry such that ${j - i}$ is maximal. Then for ${k > 1}$, ${(x_{n}^{k})_{i,j} = 0}$. Hence ${(e^{x_{n}} - I)_{i,j} = (x_{n})_{i,j} \neq 0}$, a contradiction. Hence ${x_{n} = 0}$, and ${x = x_{s}}$ is semi-simple. ${\Box}$

Corollary. Given any choice of a matrix logarithm, we have that ${x}$ is semi-simple if and only if ${\log(x)}$ is semi-simple.

We can now define a matrix logarithm in a unique way for semi-simple matrices given a choice of splitting ${\tau}$:

Theorem. Given a splitting ${\tau}$ of the exponential sequence as above, and a semi-simple invertible matrix ${x}$, there is a unique logarithm ${\log(x)}$ whose eigenvalues lie in the image of ${\tau}$.

Proof. We begin with existence: ${x}$ is semi-simple, so ${x = C D C^{-1}}$, for diagonal matrix

$\displaystyle D = \begin{pmatrix} d_{1} & & & & \\ & d_{2} & & & \\ & & & & \\ & & & d_{m-1}& \\ & & & & d_{m} \end{pmatrix},$

where all ${d_{i} \neq 0}$. Define

$\displaystyle \log(D) := \begin{pmatrix} \tau(d_{1}) & & & & \\ & \tau(d_{2}) & & & \\ & & & & \\ & & & \tau(d_{m-1})& \\ & & & & \tau(d_{m}) \end{pmatrix}.$

Then ${\log(x) := C \log(D) C^{-1}}$ solves the problem.

Uniqueness: Suppose ${y}$ is a logarith of ${x}$ such that its eigenvalues lie in the image of ${\tau}$. Then since ${x}$ is semi-simple, so is ${y}$ and hence ${y = EzE^{-1}}$ for diagonal matrix ${z}$ (with diagonal entries ${z_{1}, ..., z_{m}}$ in the image of ${\tau}$). Hence

$\displaystyle CDC^{-1} = x = e^{y} = E e^{z} E^{-1} \implies e^{z} = (E^{-1}C) D (E^{-1}C)^{-1}.$

The diagonal matrices ${e^{z}}$ and ${D}$ are conjugate, and therefore differ only by reordering of entries: there is a permutation matrix ${P}$ such that ${D = P e^{z} P^{-1} = e^{PzP^{-1}}}$. Then ${y = (EP^{-1})(PzP^{-1}) (EP^{-1})^{-1}}$, with ${e^{PzP^{-1}} = D}$. So there is no loss in generality by assuming that ${y = EzE^{-1}}$ with ${e^{z} = D}$. But then we have that ${e^{z_{i}} = d_{i}}$ for all ${i}$. And since the eigenvalues of ${y}$ lie in the image of ${\tau}$, we have that ${z_{i} = \tau(\xi_{i})}$. Hence ${d_{i} = e^{z_{i}} = e^{\tau(\xi_{i})} = \xi_{i}}$, implying that ${z_{i} = \tau(d_{i})}$. But then ${z = \log(D)}$, so ${y = E \log(D) E^{-1}}$. And since we have that ${D = (E^{-1}C) D (E^{-1}C)^{-1}}$, it follows that ${y = E \log(D) E^{-1} = C \log(D) C^{-1} = \log(x)}$, thus proving uniqueness. ${\Box}$

4. Matrix logarithm for invertible matrices

By combining the results above for unipotent and semi-simple matrices, we will show that we get a uniquely defined matrix logarithm for any invertible matrix, once we have chosen a set-theoretical splitting of the exponential sequence. Begin by choosing such a splitting ${\tau}$, thus fixing a logarithm for semi-simple matrices. We begin with the following fact:

Lemma. Let ${s}$ be a semi-simple invertible matrix, and let ${x}$ be a matrix which commutes with ${s}$. Then ${x}$ also commutes with ${\log(s)}$.

Proof. Consider the decomposition of ${\mathbb{C}^{m}}$ into the eigenspaces of ${s}$:

$\displaystyle \mathbb{C}^{m} = \oplus_{i} V_{i},$

where ${s(u) = d_{i} u}$ for ${u \in V_{i}}$. Since ${x}$ commutes with ${s}$, it preserves the above direct sum decomposition. The logarithm of ${s}$ is such that given ${u \in V_{i}}$, ${\log(s)(u) = \tau(d_{i}) u}$. So given a vector ${v}$, which can be written according to the direct sum decomposition as ${v = \sum_{i} u_{i}}$, we have

$\displaystyle x \log(s) (v) = \log(s) x(v) = \sum_{i}\tau(d_{i}) x(u_{i}).$  ${\Box}$

Theorem. Given a splitting ${\tau}$ of the exponential sequence as above, and an invertible matrix ${x}$, there is a unique logarithm ${\log(x)}$ whose eigenvalues lie in the image of ${\tau}$.

Proof. We begin with existence. The multiplicative Jordan-Chevalley decomposition lets us uniquely write ${x = su}$, with ${s}$ semi-simple and ${u}$ unipotent, and with ${s}$ and ${u}$ commuting. Therefore, both ${\log(s)}$ and ${\log(u)}$ can be defined as above. By the previous lemma, ${\log(s)}$ commutes with ${u}$, and therefore, with

$\displaystyle \log(u) = \frac{i}{2 \pi} \sum_{k = 1}^{\infty} \frac{(-1)^k}{k} (u - I)^{k}.$

Therefore, define ${\log(x) := \log(s) + \log(u)}$, which is already expressed in its additive Jordan-Chevalley decomposition. That this actually defines a logarithm can be seen as follows:

$\displaystyle e^{\log(x)} = e^{\log(s)} e^{\log(u)} = su = x,$

where we have used the fact that ${\log(s)}$ and ${\log(u)}$ commute. Furthermore, since the eigenvalues of ${\log(x)}$ are eigenvalues of ${\log(s)}$, they all lie in the image of ${\tau}$. This shows existence.

Now for uniqueness, suppose we have a logarithm ${y}$ of ${x}$, whose eigenvalues lie in the image of ${\tau}$. Let ${y = y_{s} + y_{n}}$ be the Jordan-Chevalley decomposition. Note that the eigenvalues of ${y_{s}}$ also lie in the image of ${\tau}$. Then we have

$\displaystyle x = e^{y} = e^{y_{s}} e^{y_{n}}.$

Since ${e^{y_{s}}}$ is semi-simple, ${e^{y_{n}}}$ is unipotent, and the matrices commute, this must be the multiplicative Jordan-Chevalley decomposition of ${x}$: hence ${s = e^{y_{s}}}$ and ${u = e^{y_{n}}}$. So ${y_{s}}$ is a logarithm of ${s}$ whose eigenvalues lie in the image of ${\tau}$; hence ${y_{s} = \log(s)}$. And ${\log(u) = \log(e^{y_{n}}) = y_{n}}$. Therefore, ${y = \log(s) + \log(u) = \log(x)}$, proving uniqueness. ${\Box}$

Remark. The matrix exponential sends the additive Jordan-Chevalley decomposition to the multiplicative one, and the matrix logarithm sends the multiplicative decomposition to the additive one. As such, we can view the matrix exponential and logarithm as acting component-wise on the Jordan-Chevalley decompositions.

We know that for commuting matrices ${x}$ and ${y}$, their exponentials ${e^{x}, e^{y}}$ also commute. The same is true for the matrix logarithm.

Corollary. If ${x}$ and ${y}$ commute, then ${\log(x)}$ and ${\log(y)}$ commute.