TOPICS
Search

Matrix Multiplication


Matrix multiplication forms the product C of two matrices A and B, defined as

 c_(ik)=a_(ij)b_(jk),
(1)

where j is summed over for all possible values of i and k and the notation above uses the Einstein summation convention. The implied summation over repeated indices without the presence of an explicit sum sign is called Einstein summation, and is commonly used in both matrix and tensor analysis. Therefore, in order for matrix multiplication to be defined, the dimensions of the matrices must satisfy

 (n×m)(m×p)=(n×p),
(2)

where (a×b) denotes a matrix with a rows and b columns. Writing out the product explicitly,

 [c_(11) c_(12) ... c_(1p); c_(21) c_(22) ... c_(2p); | | ... |; c_(n1) c_(n2) ... c_(np)]=[a_(11) a_(12) ... a_(1m); a_(21) a_(22) ... a_(2m); | | ... |; a_(n1) a_(n2) ... a_(nm)][b_(11) b_(12) ... b_(1p); b_(21) b_(22) ... b_(2p); | | ... |; b_(m1) b_(m2) ... b_(mp)],
(3)

where

c_(11)=a_(11)b_(11)+a_(12)b_(21)+...+a_(1m)b_(m1)
(4)
c_(12)=a_(11)b_(12)+a_(12)b_(22)+...+a_(1m)b_(m2)
(5)
c_(1p)=a_(11)b_(1p)+a_(12)b_(2p)+...+a_(1m)b_(mp)
(6)
c_(21)=a_(21)b_(11)+a_(22)b_(21)+...+a_(2m)b_(m1)
(7)
c_(22)=a_(21)b_(12)+a_(22)b_(22)+...+a_(2m)b_(m2)
(8)
c_(2p)=a_(21)b_(1p)+a_(22)b_(2p)+...+a_(2m)b_(mp)
(9)
c_(n1)=a_(n1)b_(11)+a_(n2)b_(21)+...+a_(nm)b_(m1)
(10)
c_(n2)=a_(n1)b_(12)+a_(n2)b_(22)+...+a_(nm)b_(m2)
(11)
c_(np)=a_(n1)b_(1p)+a_(n2)b_(2p)+...+a_(nm)b_(mp).
(12)

Matrix multiplication is associative, as can be seen by taking

 [(ab)c]_(ij)=(ab)_(ik)c_(kj)=(a_(il)b_(lk))c_(kj),
(13)

where Einstein summation is again used. Now, since a_(il), b_(lk), and c_(kj) are scalars, use the associativity of scalar multiplication to write

 (a_(il)b_(lk))c_(kj)=a_(il)(b_(lk)c_(kj))=a_(il)(bc)_(lj)=[a(bc)]_(ij).
(14)

Since this is true for all i and j, it must be true that

 (ab)c=a(bc).
(15)

That is, matrix multiplication is associative. The product can therefore be written

 [abc]_(ij)=a_(il)b_(lk)c_(kj),
(16)

without ambiguity. Due to associativity, the n×n matrices over a fixed ring form a semigroup under multiplication.

Matrix multiplication is also distributive. If A and B are m×n matrices and C and D are n×p matrices, then

A(C+D)=AC+AD
(17)
(A+B)C=AC+BC.
(18)

Since n×n matrices form an Abelian group under addition, n×n matrices form a ring.

However, matrix multiplication is not, in general, commutative. Two diagonal matrices of the same size commute when their entries belong to a commutative ring.

For compatibly partitioned block diagonal matrices, the product is obtained by multiplying corresponding diagonal blocks:

 [o o    ; o o    ;   o   ;    o o o;    o o o;    o o o][x x    ; x x    ;   x   ;    x x x;    x x x;    x x x]
 =[[o o; o o][x x; x x]  ;  [o][x] ;   [o o o; o o o; o o o][x x x; x x x; x x x]].
(19)

AlphaTensor, a reinforcement-learning system developed by DeepMind, found exact matrix multiplication algorithms matching or improving known ranks for several small matrix sizes. For example, it found a method for multiplying 4×4 matrices over Z_2 using 47 products of scalars. This improves on the 49 multiplications obtained by applying Strassen's formulas twice (Fawzi et al. 2022).

Tomar (2026) reported that the tensor decomposition rank of 3×3 matrix multiplication over the finite field F_2 is exactly 23. This also gives the lower bound 23 for bilinear algorithms with integer coefficients. This does not establish optimality over an arbitrary field of characteristic zero. Tomar (2026) reports two Lean proofs checking exhaustive-search certificates. In one, the largest checks use compiled code as well as the proof kernel. In the version of Oct. 19, 2026, a second proof evaluates every check in the kernel, and its final theorem is reported to depend only on Lean's three standard axioms.

Ivanov (2026) reported that every exact bilinear algorithm for multiplying two 3×3 matrices over any field requires at least 21 products of linear functionals of the two inputs. Together with Laderman's algorithm (Laderman 1976), the claimed bound gives

 21<=R_K<3,3,3><=23,
(20)

where R_K<3,3,3> is the tensor decomposition rank of 3×3 matrix multiplication over the field K. The claim includes every characteristic and does not determine the exact tensor decomposition rank over a general field. Ivanov reports substantial ChatGPT/Codex assistance with the mathematics and Lean formalization. As of Oct. 15, 2026, the project and registry reported successful machine checks, but independent specialist review had not been reported.

The matrix multiplication exponent measures the asymptotic number of arithmetic operations needed to multiply two n×n matrices. It concerns growing sizes rather than the number of multiplications in a particular small matrix product.


See also

Elementary Matrix, Iterated Matrix Multiplication, Linear Transformation, Matrix, Matrix Addition, Matrix Inverse, Matrix Multiplication Exponent, Matrix-Vector Multiplication, Strassen Formulas Explore this topic in the MathWorld classroom

Explore with Wolfram|Alpha

References

Arfken, G. Mathematical Methods for Physicists, 3rd ed. Orlando, FL: Academic Press, pp. 178-179, 1985.Fawzi, A. et al. "Discovering Faster Matrix Multiplication Algorithms With Reinforcement Learning." Nature 610, 47-53, 2022. https://doi.org/10.1038/s41586-022-05172-4.Higham, N. "Exploiting Fast Matrix Multiplication within the Level 3 BLAS." ACM Trans. Math. Soft. 16, 352-368, 1990.Ivanov, A. "A Lower Bound of 21 for 3×3 Matrix Multiplication over Every Field." Oct. 12, 2026. https://doi.org/10.5281/zenodo.23324839.Laderman, J. D. "A Noncommutative Algorithm for Multiplying 3×3 Matrices Using 23 Multiplications." Bull. Amer. Math. Soc. 82, 126-128, 1976. https://doi.org/10.1090/S0002-9904-1976-13988-2.Tomar, T. S. "The Rank of 3×3 Matrix Multiplication over F_2 Is 23." 8 Oct 2026. https://arxiv.org/abs/2610.11823.

Referenced on Wolfram|Alpha

Matrix Multiplication

Cite this as:

Weisstein, Eric W. "Matrix Multiplication." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/MatrixMultiplication.html

Subject classifications