How can matrix multiplication with the zero matrix be commutative?

My textbook claims:

I don't understand how D can be true. Say I have a 2x4 matrix and I multiply it by the 4x2 zero matrix. I get a 2x2 zero matrix. Now assume I multiplied in the other order, I multiply the 4x2 zero matrix against the 2x4 matrix. I get the 4x4 zero matrix. They are both zero matrices, but they have different dimensions! Surely they can't be considered equal in this case?

• You are correct – David Peterson May 24 '17 at 1:26
• @DavidP answer with an answer instead of a comment and I will mark correct – Joseph Garvin May 24 '17 at 1:27
• your textbook indicates that the matrices must be of an appropriate size. Sorry, you matrices are of an inappropriate size ;) But, you are right, as operations could indeed be carried out in the example that you give :) – Mirko May 24 '17 at 3:21
• @littleo Actually you can reverse the order of multiplication even in cases where they aren't square. $p\times q$ and $q\times p$ can be multiplied in either order. – Matt Samuel May 24 '17 at 22:12
• @MattSamuel Oh yeah, thanks, I'm going to delete the comment. – littleO May 25 '17 at 0:31

The textbook says that we're working with matrices of appropriate sizes. You're 100% correct if $\mathbf{A}$ is not a square matrix, but if $\mathbf{A}$ is a square matrix then multiplication by the zero matrix is indeed commutative.