3.4 Multiplication properties

Proposition 3.4.1.

Let A and A′ be m×n matrices, let B and B′ be n×p matrices, let C be a p×q matrix, and let λ be a number. Then

  1. 1.

    A⁢(B⁢C)=(A⁢B)⁢C (associativity),

  2. 2.

    (A+A′)⁢B=A⁢B+A′⁢B, and A⁢(B+B′)=A⁢B+A⁢B′ (distributivity),

  3. 3.

    (λ⁢A)⁢B=λ⁢(A⁢B)=A⁢(λ⁢B), and

  4. 4.

    (A⁢B)T=BT⁢AT.

Proof.

Let A=(ai⁢j),A′=(ai⁢j′),B=(bi⁢j),B′=(bi⁢j′),C=(ci⁢j). During this proof we also write Xi⁢j to mean the i,j entry of a matrix X.

  1. 1.

    A⁢B has i,j entry ∑k=1nai⁢k⁢bk⁢j, so the i,j entry of (A⁢B)⁢C is

    ∑l=1p(A⁢B)i⁢l⁢cl⁢j=∑l=1p∑k=1nai⁢k⁢bk⁢l⁢cl⁢j. (3.5)

    On the other hand, the i,j entry of B⁢C is ∑l=1pbi⁢l⁢cl⁢j so the i,j entry of A⁢(B⁢C) is

    ∑k=1nai⁢k⁢(B⁢C)k⁢j =∑k=1nai⁢k⁢∑l=1pbk⁢l⁢cl⁢j
    =∑k=1n∑l=1pai⁢k⁢bk⁢l⁢cl⁢j. (3.6)

    (3.6) and (3.5) are the same because it doesn’t matter if we do the k or l summation first: we just get the same terms in a different order.

  2. 2.

    The i,j entry of (A+A′)⁢B is ∑k=1n(ai⁢k+ai⁢k′)⁢bj⁢k which equals ∑k=1nai⁢k⁢bk⁢j+∑k=1nai⁢k′⁢bk⁢j, but this is the sum of the i,j entry of A⁢B and the i,j entry of A′⁢B, proving the first equality. The second is similar.

  3. 3.

    The i,j entry of λ⁢A is λ⁢ai⁢j, so the i,j entry of (λ⁢A)⁢B is

    ∑k=1n(λ⁢ai⁢k)⁢bk⁢j=λ⁢∑k=1nai⁢k⁢bk⁢j=λ⁢(A⁢B)i⁢j

    so (λ⁢A)⁢B and λ⁢(A⁢B) have the same i,j entry for any i,j, and are therefore equal. The second equality can be proved similarly.

  4. 4.

    One special case of this result is very easy: for any row vector 𝐚=(a1⋯an) and column vector 𝐛=(b1⋮bn) we have

    𝐚𝐛=∑k=1nai⁢bi=∑k=1nbi⁢ai=𝐛T⁢𝐚T.

    For the general case, we start of by checking that (A⁢B)T and BT⁢AT have the same size. A⁢B is m×p so (A⁢B)T is p×m, while BT and AT are p×n and n×m respectively so BT⁢AT is also p×m. Now we only need to show that for any i and j, they have the same i,j entry. Let 𝐫i be the ith row of A and 𝐜j the jth column of B. The i,j entry of A⁢B is 𝐫i⁢𝐜j, so the i,j entry of (A⁢B)T is 𝐫j⁢𝐜i. On the other hand, the ith row of BT is 𝐜iT and the jth column of AT is 𝐫jT, so the i,j entry of BT⁢AT is 𝐜iT⁢𝐫jT. These two are equal by the special case mentioned at the start of this proof. ∎

These results tell you that you can use some of the normal rules of algebra when you work with matrices, like what happened for permutations. Again, like permutations, what you can’t do is use the commutative property.

3.4.1 Matrix multiplication isn’t commutative

Definition 3.4.1.

Two matrices A and B are said to commute if A⁢B and B⁢A are both defined and A⁢B=B⁢A.

For some pairs of matrices, the product A⁢B is defined but B⁢A is not. For example, if A is 2×3 and B is 3×4 then A⁢B is defined but B⁢A isn’t. Even when both A⁢B and B⁢A are defined and have the same size they won’t in general be equal.

Example 3.4.1.

let A=(1234) and B=(5678). Then

A⁢B =(19224350)
B⁢A =(23343146).

3.4.2 The identity matrix

Definition 3.4.2.

The n×n identity matrix In is the matrix with i,j entry 1 if i=j and 0 otherwise.

For example,

I2=(1001),I3=(100010001).

The most important property of identity matrices is that they behave like the number 1 does when you multiply by them.

Theorem 3.4.2.

If A is an m×n matrix then Im⁢A=A⁢In=A.

Proof.

Let A=(ai⁢j),In=(δi⁢j), so δi⁢j is 1 if i=j and 0 otherwise. The formula for matrix multiplication tells us that for any i and j, the i,j entry of Im⁢A is ∑k=1mδi⁢k⁢ak⁢j The only term in this sum that can be nonzero is the one when k=i, so the sum equals 1×ai⁢j=ai⁢j. Thus the i,j entry of Im⁢A equals ai⁢j, the i,j entry of A.

The other equality can be proved similarly. ∎