Proving that ${\rm vec}(A\,{\rm Diag}(b)\,C) = ((C^T\otimes 1_a)\odot(1_c\otimes A))\,b$

Solution 1:

Let $e_1,e_2,\dots,e_b$ denote the canonical basis of $\Bbb R^b$. We compute $$ \begin{align*} \operatorname{vec}(A \operatorname{diag}(b) C) &= \operatorname{vec}\left(A \left[\sum_{i=1}^b b_i e_ie_i^T\right] C\right) \\ & = \operatorname{vec}\left(\sum_{i=1}^b b_i (Ae_i)(C^Te_i)^T\right) \\ & = \sum_{i=1}^b b_i \,(C^Te_i) \otimes (Ae_i) \\ & = \pmatrix{(C^Te_1) \otimes (Ae_1) & \cdots & (C^Te_b) \otimes (Ae_b)} \pmatrix{b_1\\ \vdots \\ b_b} \end{align*} $$ (as you did, I have used $b$ to indicate both the diagonal vector of $B$ and the size of $B$). It then suffices to rewrite the matrix on the left as $$ \pmatrix{(C^Te_1) \otimes (Ae_1) & \cdots & (C^Te_b) \otimes (Ae_b)} = \Big((C^T\otimes 1_a)\odot(1_c\otimes A)\Big) $$ One way to do so is to write $$ \pmatrix{(C^Te_1) \otimes (Ae_1) & \cdots & (C^Te_b) \otimes (Ae_b)} =\\ \pmatrix{\operatorname{vec}([Ae_1][C^Te_1]^T) & \cdots & \operatorname{vec}([Ae_b][C^Te_b]^T)} $$ and from there, apply your Hadamard formula to each column to see that the $i$th column is indeed $((C^Te_i) \otimes 1_a) \odot (1_c \otimes (Ae_i))$, so that the matrix on the left is indeed $(C^T\otimes 1_a1_b^T)\odot(1_c1_b^T\otimes A)$.


Another approach: it suffices to check that $$ \Big((C^T\otimes 1_a1_b^T)\odot(1_c1_b^T\otimes A)\Big)\,{\rm vec}(e_ie_i^T) = ((C^Te_i) \otimes 1_a) \odot (1_c \otimes (Ae_i)) $$ Since we have $$ \Big((C^T\otimes 1_a1_b^T)\odot(1_c1_b^T\otimes A)\Big)\,{\rm vec}(B) = \sum_{i=1}^b b_i\,\Big((C^T\otimes 1_a1_b^T)\odot(1_c1_b^T\otimes A)\Big){\rm vec}(e_ie_i^T) $$


Regarding the end of my first approach: I meant that we could use your last formula to note that $$ \operatorname{vec}([Ae_k][C^Te_k]^T) = \operatorname{vec}([Ae_k]_{a \times 1}\,[1]_{1 \times 1}\,[C^Te_k]^T_{1 \times c}) =\\ \Big(([C^Te_k]\otimes 1_a1_1^T)\odot(1_c1_1^T\otimes [Ae_k])\Big)\,{\rm vec}([1]_{1 \times 1}) = \\ ([C^Te_k] \otimes 1_a) \odot (1_c \otimes [Ae_k]) $$