Show that $||A-BC||_F^2 = ||A||_F^2+||BC||_F^2 - 2tr(C^TB^TA)$

I am trying to show the following: $||A-BC||_F^2 = ||A||_F^2+||BC||_F^2 - 2tr(C^tB^TA)$

$||\cdot||_F$ is the Frobenius norm, $A \in \mathbb{R}^{n \times m}, B \in \mathbb{R}^{n \times k}, C \in \mathbb{R}^{k \times m}$, $k \leq n \leq m$. What I tried is using the definition

$||A-BC||_F^2 = \sum^n_{i,j=1}|a_{ij}-(\sum_{p=1}^kb_{ip}c_{pj})|^2 = \sum^n_{i,j=1}(|a_{ij}|^2 + |\sum_{p=1}^kb_{ip}c_{pj}|^2 - 2|a_{ij}\sum_{p=1}^kb_{ip}c_{pj}|) = ||A||_F^2 + ||BC||_F^2 - \sum^n_{i,j=1} 2|a_{ij}\sum_{p=1}^kb_{ip}c_{pj}| $

Is this correct? If yes, how is the last part the trace of the matrix product? I´m struggling to convert the last sum into the trace.


Assume you know that $||A||_F^2 = tr(A^TA)$. Then
$||A-BC||_F^2 = tr((A-BC)^T(A-BC))\\ = tr(A^TA - (BC)^TA - A^TBC + (BC)^T(BC))\\ = tr(A^TA) - tr((BC)^A) - tr(A^T(BC)) + tr((BC)^T(BC))\\ = ||A||_F^2 - 2*tr((BC)^TA) + ||BC||_F^2$.