4.1 Multiplication de matrices

Soit \(S\) un anneau. Soient \(\mathbf{B} \in S^{m \times p}\) et \(\mathbf{x} \in S^p.\)

Le produit \(\mathbf{B}\mathbf{x}\) est défini par le \(m\)-uplet \[\begin{bmatrix} \displaystyle\sum_{j=1}^p b_{1j} x_j \\ \displaystyle\sum_{j=1}^p b_{2j} x_j \\ \vdots \\ \displaystyle\sum_{j=1}^p b_{mj} x_j. \end{bmatrix}\]

Rappelons que \(b_{ij}\) (ou \(b_{i,j}\)) dénote l’élément \((i,j)\) de \(\mathbf{B},\) c’est-à-dire l’élément à la \(i\)-ième ligne et la \(j\)-ième colonne de \(\mathbf{B}.\)

Soit \(\mathbf{A} \in S^{p\times n}\). Le produit \(\mathbf{B}\mathbf{A}\) est défini par la matrice telle que la \(j\)-ième colonne est donnée par \(\mathbf{B}\mathbf{A}_j\) pour \(j = 1,\ldots,n.\) Ici, \(\mathbf{A}_j\) dénote la \(j\)-ième colonne de \(\mathbf{A}.\)

Exemple 4.1 Soient \(\mathbf{A} = \begin{bmatrix} 1 & 2\\3 & 5\end{bmatrix}\) et \(\mathbf{B} = \begin{bmatrix} 1 & 0\\ -1 & 1\end{bmatrix}\).

Alors \(\mathbf{B}\mathbf{A}_1 = \begin{bmatrix} 1 & 0\\ -1 & 1\end{bmatrix} \begin{bmatrix} 1 \\3 \end{bmatrix}= \begin{bmatrix} 1(1) + 0(3)\\ -1(1) + 1(3) \end{bmatrix}= \begin{bmatrix} 1\\ 2 \end{bmatrix}\), et \(\mathbf{B}\mathbf{A}_2 = \begin{bmatrix} 1 & 0\\ -1 & 1\end{bmatrix} \begin{bmatrix} 2 \\5 \end{bmatrix}= \begin{bmatrix} 1(2) + 0(5)\\ -1(2) + 1(5) \end{bmatrix}= \begin{bmatrix} 2\\ 3 \end{bmatrix},\) d’où \(\mathbf{B}\mathbf{A} = \begin{bmatrix} 1&2\\ 2 &3 \end{bmatrix}\).

Exemple 4.2 Soient \(\mathbf{A} = \begin{bmatrix} 1 & 2 & 3\end{bmatrix}\) et \(\mathbf{B} = \begin{bmatrix} 1 & 4\\ -1 & 1 \\ 2 & -2\end{bmatrix}\).

Alors \(\mathbf{A}\mathbf{B}_1 = \begin{bmatrix} 1 & 2 & 3\end{bmatrix} \begin{bmatrix} 1 \\ -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 1(1) + 2(-1) + 3(2) \end{bmatrix} = \begin{bmatrix} 5\end{bmatrix}\), et \(\mathbf{A}\mathbf{B}_2 = \begin{bmatrix} 1 & 2 & 3\end{bmatrix} \begin{bmatrix} 4 \\ 1 \\ -2 \end{bmatrix} = \begin{bmatrix} 1(4) + 2(1) + 3(-2) \end{bmatrix}= \begin{bmatrix} 0\end{bmatrix}\). Ainsi, \(\mathbf{A}\mathbf{B} = \begin{bmatrix} 5 & 0 \end{bmatrix}\).

Exemple 4.3 Soient \(\mathbf{A} = \begin{bmatrix} 1 \\ -2 \end{bmatrix}\) et \(\mathbf{B} = \begin{bmatrix} 3 & 5\end{bmatrix}\).

Alors \(\mathbf{A}\mathbf{B}_1 = \begin{bmatrix} 1 \\ -2 \end{bmatrix} \begin{bmatrix} 3 \end{bmatrix} = \begin{bmatrix} 3 \\ -6 \end{bmatrix}\), et \(\mathbf{A}\mathbf{B}_2 = \begin{bmatrix} 1 \\ -2 \end{bmatrix} \begin{bmatrix} 5 \end{bmatrix} = \begin{bmatrix} 5 \\ -10 \end{bmatrix}\). Ainsi, \(\mathbf{A}\mathbf{B} = \begin{bmatrix} 3 & 5 \\ -6 & -10 \end{bmatrix}\).

Notons que le produit de \(\mathbf{A}\mathbf{B}\) est défini seulement lorsque le nombre de colonnes de \(\mathbf{A}\) est le même que le nombre de lignes de \(\mathbf{B}\).

En général \(\mathbf{A}\mathbf{B} \neq \mathbf{B}\mathbf{A}\) (quoique cela peut arriver). Par exemple, il est possible que le produit \(\mathbf{A}\mathbf{B}\) soit défini sans que \(\mathbf{B}\mathbf{A}\) ne le soit (lorsque le nombre de colonnes de \(\mathbf{B}\) n’est pas identique au nombre de lignes de \(\mathbf{A}\).)

Exemple 4.4 Soient \(\mathbf{A} = \begin{bmatrix} 1 & 0 \\ 2 & 0 \end{bmatrix}\) et \(\mathbf{B} = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\). Alors \(\mathbf{A}\mathbf{B} = \begin{bmatrix} 0 & 1 \\ 0 & 2 \end{bmatrix}\) mais \(\mathbf{B}\mathbf{A} = \begin{bmatrix} 2 & 0 \\ 1 & 0\end{bmatrix}\).

Exemple 4.5 Soient \(\mathbf{A} = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix}\) et \(\mathbf{B} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}\). Alors \(\mathbf{A}\mathbf{B} = \begin{bmatrix} 1 \\ 2\end{bmatrix}\) mais le produit \(\mathbf{B}\mathbf{A}\) n’est pas défini.

Exercices

  1. Calculez chacun des produits de matrices suivants.

    1. \(\begin{bmatrix} 1 & 3 \\ 2 & 4\end{bmatrix} \begin{bmatrix} -1 & 0 & 1 \\ 1 & 2 & 3\end{bmatrix}\)

    2. \(\begin{bmatrix} 0 & 1 & 2 & -1 \\ 4 & 3 & 0 & 2\end{bmatrix} \begin{bmatrix} -1 \\ 0 \\ 1 \\ 3\end{bmatrix}\)

    3. \(\begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} \begin{bmatrix} -1 & 1 \end{bmatrix}\)

  2. Soient \(\mathbf{A} = \begin{bmatrix} 1 & 2 \end{bmatrix}\), \(\mathbf{B} = \begin{bmatrix} 1 & 4\\ -1 & 1 \end{bmatrix}\), \(\mathbf{C} = \begin{bmatrix} 1 & 0 & 1 \\ -1 & 1 & 0 \end{bmatrix}\).

    1. Calculez \(\mathbf{A}\mathbf{B}\) et \(\mathbf{B}\mathbf{C}\).

    2. Utilisez les résultats de la partie précédant pour calculez \((\mathbf{A}\mathbf{B})\mathbf{C}\) et \(\mathbf{A}(\mathbf{B}\mathbf{C})\). Que pouvez-vous dire à propos de ces produits?

Solutions

    1. \(\begin{bmatrix} 2 & 6 & 10 \\ 2 & 8 & 14 \end{bmatrix}\).

    2. \(\begin{bmatrix} -1 \\ 2 \end{bmatrix}\).

    3. \(\begin{bmatrix} -1 & 1\\ -2 & 2 \\ -3 & 3 \end{bmatrix}\).

    1. \(\mathbf{A}\mathbf{B} = \begin{bmatrix} -1 & 6 \end{bmatrix}\) et \(\mathbf{B}\mathbf{C} = \begin{bmatrix} -3 & 4 & 1 \\ -2 & 1 & -1 \end{bmatrix}\).

    2. Les deux produits sont égaux à \(\begin{bmatrix} -7 & 6 & -1 \end{bmatrix}.\)