# When do the invariant factors of a direct sum of matrices correspond to those of its summands?

(Tried asking this on math stackexchange, but no takers so far.)

I'm trying to prove something about matroids, which I have reduced to the following question:

Suppose I have a matrix $M$ which is a direct sum of submatrices $M_1,M_2,…,M_k.$ When do the invariant factors of the $\{M_i\}$ partition the set of invariant factors of $M$?

To be more explicit, let $d_1,…,d_n$ be the invariant factors of the matrix $M$ (so that $d_j|d_{j+1}$ for all $1≤j≤n−1$). Let $D$ be the set of these numbers, and similarly let $D_i$ be the set of invariant factors of the summand $M_i$ for each $i.$ Are there any known conditions under which:

$$\bigsqcup_iD_i=D?$$

By definition, $M$ is a block-diagonal matrix, where the blocks are the $\{M_i\}$. And in fact, it is not hard to see that for the purposes of this question we can assume without loss of generality that $M$ is actually diagonal (that is, each $M_i$ is a diagonal matrix). This means that I simply need conditions on the order and nature of the diagonal entries.

However, any information related to this scenario will be welcome, even if you think it is obvious! Please feel free to generally hold forth.

Thanks!

-
Suppose for simplicity that there are only 2 matrices $M_1$ and $M_2$ (you can always reduce to this case). Let $d_i$ (resp. $e_j$) be the invariants of $M_1$ (resp. of $M_2$) Then I think that a necessary and sufficient condition is that for each pair $(i,j)$ one has either $d_i \vert e_j$ or $e_j \vert d_i$. Isn't it? –  Oblomov Apr 27 '12 at 9:41

By definition $M-XI_n$ is equivalent, in $M_n(k[X])$ to ${\rm diag}(d_1,\ldots,d_n)$. Likewise, $M_j-XI_{n_j}$ is equivalent, in $M_n(k[X])$ to ${\rm diag}(d_{j,1},\ldots,d_{j,n_j})$. Therefore $M-X_I$ is equivalent to the diagonal matrix with diagonal entries the polynomials $d_{j,s}$ where $1\le j\le k$ and $1\le s\le n_j$. Conclusion: the latter polynomials are the invariant factors of $M$ if and only if they form an ordered sequence. In other words, if and only if, for every pairs $(j,s)$ and $(i,t)$, one among the polynomial $d_{j,s}$ and $d_{i,t}$ divides the other.