Multiplication of matrices [00IW]
- January 17, 2024
- Jon Sterling, with contributions from Marcelo Fiore
Remark Matrix multiplication in geometry [00IU]
- January 17, 2024
- Jon Sterling
Although we do not explore it in this course, the viewpoint of matrix multiplication as relational composition generalises to a correct explanation of the role of matrices in geometry as presentations of linear maps between vector spaces in terms of an (uncanonical) choice of basis.
Definition Product of matrices [00IV]
- January 17, 2024
- Jon Sterling
Let M be an {\mathopen {}\left (l\times m\right )\mathclose {}}-matrix and let N be a {\mathopen {}\left (m\times n\right )\mathclose {}}-matrix. The product of M and N, written M\otimes N, is the following {\mathopen {}\left (l\times n\right )\mathclose {}}-matrix:
{\mathopen {}\left (N\otimes M\right )\mathclose {}}_{i: {\mathopen {}\left [l\right ]\mathclose {}},j:{\mathopen {}\left [n\right ]\mathclose {}}} = \bigoplus _{k: {\mathopen {}\left [m\right ]\mathclose {}}} N_{k,j}\odot M_{i,k}Lemma Associativity and unit laws of matrix products [00J3]
- January 17, 2024
- Jon Sterling, with contributions from Marcelo Fiore
The product of matrices is associative and has the identity matrix as neutral element.
Proof.
- January 17, 2024
- Jon Sterling
For associativity, fix matrices L:\mathrm {Mat}_{S}{\mathopen {}\left (k,l\right )\mathclose {}}, M:\mathrm {Mat}_{S}{\mathopen {}\left (l,m\right )\mathclose {}} and N:\mathrm {Mat}_{S}{\mathopen {}\left (m,n\right )\mathclose {}} to check that {\mathopen {}\left (N\otimes M\right )\mathclose {}}\otimes L = N\otimes {\mathopen {}\left (M\otimes L\right )\mathclose {}}. Below we use the associativity of multiplication, commutativity of addition, and distributivity of multiplication over addition in the semiring S:
\begin {aligned} {\mathopen {}\left ({\mathopen {}\left (N\otimes M\right )\mathclose {}}\otimes L\right )\mathclose {}}_{a,d} &= \bigoplus _{b:{\mathopen {}\left [l\right ]\mathclose {}}} {\mathopen {}\left (N\otimes M\right )\mathclose {}}_{b,d}\odot L_{a,b} \\ &= \bigoplus _{b:{\mathopen {}\left [l\right ]\mathclose {}}} {\mathopen {}\left ( \bigoplus _{c:{\mathopen {}\left [m\right ]\mathclose {}}} N_{c,d}\odot M_{b,c} \right )\mathclose {}} \odot L_{a,b} \\ &= \bigoplus _{b:{\mathopen {}\left [l\right ]\mathclose {}}} \bigoplus _{c: {\mathopen {}\left [m\right ]\mathclose {}}} N_{c,d}\odot M_{b,c}\odot L_{a,b} \\ &= \bigoplus _{c: {\mathopen {}\left [m\right ]\mathclose {}}} N_{c,d}\odot \bigoplus _{b:{\mathopen {}\left [l\right ]\mathclose {}}} M_{b,c}\odot L_{a,b} \\ &= \bigoplus _{c: {\mathopen {}\left [m\right ]\mathclose {}}} N_{c,d}\odot {\mathopen {}\left (M\otimes L\right )\mathclose {}}_{a,c} \\ &= {\mathopen {}\left (N\otimes {\mathopen {}\left (M\otimes L\right )\mathclose {}}\right )\mathclose {}}_{a,d} \end {aligned}For one unit law, we fix M:\mathrm {Mat}_{S}{\mathopen {}\left (m,n\right )\mathclose {}} and recall the definition of the identity matrix to check that M\otimes I^m = M.
\begin {aligned} {\mathopen {}\left (M\otimes I^m\right )\mathclose {}}_{i,j} &= \bigoplus _{k: {\mathopen {}\left [m\right ]\mathclose {}}} M_{k, j} \odot I^m_{i,k} \end {aligned}Unfolding the definition of I^m_{i,j} as given in Definition [00IT], we see that the iterated sum above expands to m-1 copies of 0\odot M_{k,j} for various k \not = i and one copy of 1\odot M_{i,j}. Thus, we conclude that M\otimes I^m_{i,j} = M_{i,j} using the absorption and unit laws for multiplication as well as the unit laws for addition in S.
The other unit law follows in an analogous way.
Lemma Matrix product is relational composition [00J2]
- January 17, 2024
- Jon Sterling, with contributions from Marcelo Fiore
Under the correspondence between boolean matrices and finite relations (§ [00J1], Lemma [00IX]), matrix products of boolean matrices correspond to relational composites. In particular, given M:\mathrm {Mat}_{\mathbb {B}}{\mathopen {}\left (l,m\right )\mathclose {}} and N:\mathrm {Mat}_{\mathbb {B}}{\mathopen {}\left (m,n\right )\mathclose {}}, we have:
\operatorname {\underline {rel}}_\mathbb {B}{\mathopen {}\left (N\otimes M\right )\mathclose {}} = \operatorname {\underline {rel}}_\mathbb {B} N\circ \operatorname {\underline {rel}}_\mathbb {B} MProof.
- January 17, 2024
- Jon Sterling
We use the fact that the additive operation of the boolean semiring is disjunction and the multiplicative operation is conjunction:
\begin {aligned} {\mathopen {}\left (N\otimes M\right )\mathclose {}}_{i,j} &= \bigoplus _{k:{\mathopen {}\left [m\right ]\mathclose {}}} N_{k,j}\odot M_{i,k} \\ &= \bigvee _{k:{\mathopen {}\left [m\right ]\mathclose {}}} N_{k,j}\land M_{i,k} \\ &= \exists k:{\mathopen {}\left [m\right ]\mathclose {}}\mathpunct {.} M_{i,k}\land N_{k,j} \end {aligned}