3 Matrices

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.7)

    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.8)

    (3.8) and (3.7) 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.

    This will be an exercise on one of your problem sets. ∎

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. ∎