# Condition for commuting matrices

Let $A,B$ be $n \times n$ matrices over the complex numbers. If $B=p(A)$ where $p(x) \in \mathbb{C}[x]$ then certainly $A,B$ commute. Under which conditions the converse is true?

Thanks :-)

-

1
What exactly do you mean by the converse? – copper.hat Jun 20 '12 at 15:06
i am looking for an if and only if statement – Manos Jun 20 '12 at 15:09
– Jonas Meyer Jun 20 '12 at 15:14
– Peter Sheldrick Jun 20 '12 at 15:17
So yeah going from what Jonas said, it probably is not the case, and it only works if $A$ has $n$ distinct eigenvalues. – Peter Sheldrick Jun 20 '12 at 15:24
show 7 more comments

## 3 Answers

The usual condition I have seen is that matrices commute if and only if they have a common basis of generalized eigenvectors.

See also Commuting Matrices

Another interpretation:

It has been pointed out that my first interpretation of the question is most likely wrong. The intended question is probably similar to this question. In that case, the answer would be that if a matrix $A$ has distinct eigenvalues, then $B$ commutes with $A$ if and only if $B=P(A)$ for some complex coefficient polynomial $P$. If $A$ is $n\times n$, then $P$ need be at most degree $n-1$.

Justification:

Suppose that $A$ has distinct eigenvalues, then it is diagonalizable with a basis of eigenvectors. Thus, we can write $A=ED_AE^{-1}$ where $D_A$ is a diagonal matrix whose diagonal entries are the distinct eigenvalues of $A$ and $E$ is a matrix whose columns are the eigenvectors of $A$.

Furthermore, suppose that $B$ commutes with $A$. Since $A$ shares its basis of eigenvectors with $B$, we have that $B=ED_BE^{-1}$, where $D_B$ is diagonal and the diagonal elements of $D_B$ are the eigenvalues of $B$.

Suppose $P$ is the degree $n-1$ polynomial that takes the $n$ distinct diagonal elements of $D_A$ to the $n$ diagonal elements of $D_B$. Then, because $D_A$ and $D_B$ are diagonal, $P(D_A)=D_B$, which then gives us $$P(A)=P(ED_AE^{-1})=EP(D_A)E^{-1}=ED_BE^{-1}=B$$

-

this concerne a single couple $(A,B)$ of matrices. The question concerne a given matrice $A$ , when $C(A) =\mathbb C[A]$ ? – Mohamed Jun 20 '12 at 15:53
@Mohamed: I second your apprehension that this might not be a full answer to the question, but I also don't believe that Manos has really yet clarified what exactly the question is.  Based on the comments, it seems that Manos might have been satisfied with the answer to a linked question, which is only a special case of your more general answer. – Jonas Meyer Jun 20 '12 at 16:07
@robjohn: Could you please clarify exactly what your first sentence is asserting?  The usual condition for what?  For one of the matrices to be a polynomial in the other? – Jonas Meyer Jun 20 '12 at 16:12
@JonasMeyer: I had interpreted the question as asking under what conditions on $A$ and $B$ does $AB=BA$. I may have misinterpreted the question. – robjohn♦ Jun 20 '12 at 16:29
@robjohn: I think you did, because however unclear the precise question is, it asks for a converse of an implication that concludes that $AB=BA$.  The question appears to be something like, "When does $AB=BA$ imply $B=p(A)$"?  Of course I do not know why Manos accepted this answer nor why Manos hasn't made precisely clear what is being asked. – Jonas Meyer Jun 20 '12 at 19:35
show 6 more comments

The converse is true if the minimal polynom degree equal $n$

If $C(A)$ denote the space of matrix $B$ who commut with $A$. There is o formulla who gives the $C(A)$ dimension using the similarity invariants of $A$, thus : if $P_1|...|P_s$ is the similarity invariants sequence of $A$ then : $$\dim (C(A))=\sum_{i=1}^{s} (2(s-i) + 1) d_i$$ where $d_i=\text{deg} P_i$

Since $\mathbb C[A] \subset C(A)$ this formula can help us to regard is convesly if minimal polynom degree equal $n$ thens $C(A)=\mathbb C[A]$

-

THEOREM: The following are equivalent conditions about a matrix $A$ with entries in $\mathbb C$:

(I) $A$ commutes only with matrices $B = p(A)$ for some $p(x) \in \mathbb C[x]$

(II) The minimal polynomial and characteristic polynomial of $A$ coincide

(III) $A$ is similar to a companion matrix.

(IV) Each characteristic value of $A$ occurs in only one Jordan block. This includes the possibility that all eigenvalues are distinct, but allows for repetition if they all occur in one Jordan block.

-

– Will Jagy Jun 21 '12 at 15:29
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 68, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9276222586631775, "perplexity_flag": "head"}