Let A A A be a q × n q \times n q × n matrix and B B B a p × m p \times m p × m matrix.
The Kronecker product A ⊗ B A \otimes B A ⊗ B is then a p q × n m pq \times nm pq × nm matrix defined as
A ⊗ B = [ A 11 B ⋯ A 1 n B ⋮ ⋱ ⋮ A q 1 B ⋯ A q n B ] A \otimes B = \begin{bmatrix}
A_{11} B & \cdots & A_{1n} B \\
\vdots & \ddots & \vdots \\
A_{q1} B & \cdots & A_{qn} B
\end{bmatrix}
A ⊗ B = A 11 B ⋮ A q 1 B ⋯ ⋱ ⋯ A 1 n B ⋮ A q n B
(A i j A_{ij} A ij denotes the element in the i i i th row and j j j th column of A A A ).
Furthermore, the vec \operatorname{vec} vec operator is defined as stacking the columns of a matrix into a single column vector.
For example, if X X X is a m × n m \times n m × n matrix, then vec ( X ) \operatorname{vec}(X) vec ( X ) is a m n × 1 mn \times 1 mn × 1 column vector:
vec ( X ) = [ X : , 1 X : , 2 ⋮ X : , n ] , \operatorname{vec}(X) = \begin{bmatrix}
X_{:,1} \\
X_{:,2} \\
\vdots \\
X_{:,n}
\end{bmatrix},
vec ( X ) = X : , 1 X : , 2 ⋮ X : , n ,
where X : , k X_{:,k} X : , k denotes the k k k th column of X X X .
We will now prove the following identity:
( A ⊗ B ) vec ( X ) = vec ( B X A T ) . (A \otimes B) \operatorname{vec}(X) = \operatorname{vec}(B X A^T).
( A ⊗ B ) vec ( X ) = vec ( BX A T ) .
First, we rewrite the k k k th column of B X A T B X A^T BX A T as
( B X A T ) : , k = B X ( A k , : ) T = B ∑ i = 1 n A k , i X : , i = [ A k , 1 B A k , 2 B ⋯ A k , n B ] [ X : , 1 X : , 2 ⋮ X : , n ] = ( A k , : ⊗ B ) vec ( X ) \begin{aligned}
(B X A^T)_{:,k} &= B X (A_{k,:})^T = B \sum_{i=1}^n A_{k,i} X_{:,i} \\
&= \begin{bmatrix}
A_{k,1} B \; A_{k,2} B \; \cdots \; A_{k,n} B
\end{bmatrix}
\begin{bmatrix}
X_{:,1} \\
X_{:,2} \\
\vdots \\
X_{:,n}
\end{bmatrix} \\
&= \big( A_{k,:} \otimes B \big) \operatorname{vec}(X)
\end{aligned}
( BX A T ) : , k = BX ( A k , : ) T = B i = 1 ∑ n A k , i X : , i = [ A k , 1 B A k , 2 B ⋯ A k , n B ] X : , 1 X : , 2 ⋮ X : , n = ( A k , : ⊗ B ) vec ( X )
for k = 1 , … , q k=1,\ldots,q k = 1 , … , q .
Now we just need to assemble the result:
vec ( B X A T ) = [ ( B X A T ) : , 1 ( B X A T ) : , 2 ⋮ ( B X A T ) : , q ] = [ A 1 , : ⊗ B A 2 , : ⊗ B ⋮ A q , : ⊗ B ] vec ( X ) = ( A ⊗ B ) vec ( X ) . \operatorname{vec}(B X A^T)
= \begin{bmatrix}
(B X A^T)_{:,1} \\
(B X A^T)_{:,2} \\
\vdots \\
(B X A^T)_{:,q}
\end{bmatrix}
= \begin{bmatrix}
A_{1,:} \otimes B \\
A_{2,:} \otimes B \\
\vdots \\
A_{q,:} \otimes B
\end{bmatrix} \operatorname{vec}(X)
= (A \otimes B) \operatorname{vec}(X).
vec ( BX A T ) = ( BX A T ) : , 1 ( BX A T ) : , 2 ⋮ ( BX A T ) : , q = A 1 , : ⊗ B A 2 , : ⊗ B ⋮ A q , : ⊗ B vec ( X ) = ( A ⊗ B ) vec ( X ) .
A very cool result!
Note how the identity has some useful corollaries:
( I n ⊗ B ) vec ( X ) = vec ( B X ) (I_n \otimes B) \operatorname{vec}(X) = \operatorname{vec}(B X)
( I n ⊗ B ) vec ( X ) = vec ( BX )
and
( A ⊗ I m ) vec ( X ) = vec ( X A T ) (A \otimes I_m) \operatorname{vec}(X) = \operatorname{vec}(X A^T)
( A ⊗ I m ) vec ( X ) = vec ( X A T )
where I n I_n I n and I m I_m I m are the identity matrices of size n n n and m m m , respectively.
In the paper The vec-permutation matrix, the vec operator and Kronecker products: a review ,
the authors point to the 1934 paper On direct product matrices by W. E. Roth as the
origin of this identity.
They also call the identity Roth's column lemma , although that name does not seem to be widely used.