Loading…
Treat the basic matrix operations as entry-by-entry rules, and learn exactly when the operations make sense.
A matrix records quantities in named row-and-column positions. For example, rows may represent products and columns may represent months. Adding two such tables is meaningful only when the positions describe the same kind of data. Algebra expresses that requirement by insisting that the matrices have exactly the same size and that their entries are scalars from a common field.
Once those conditions are fixed, the operations are entrywise:
Concept lensStructural
In an entrywise operation, the output at position uses only the input entries at that same position. This explains both the same-size requirement and why the output retains that size: every position has a corresponding position in each input. A proof can therefore fix one arbitrary position and use ordinary scalar algebra there.
Matrix multiplication will use a different rule: an output entry combines a whole row of one matrix with a whole column of the other. Two matrices can be added, but their matrix product is undefined. The shape check must follow the particular operation; two matrices being acceptable inputs for addition says nothing by itself about their suitability for multiplication.
Definition 3.1.1
(Matrix equality)
Let and . The equation means both that and have the same size and that
for every permitted row index and column index . Matching a few entries is not enough; equality is an entry-by-entry statement over the whole matrix.
Fix positive integers and a scalar field , usually in this course. Write for the set of all matrices whose entries belong to . Saying that matrices and scalars use the same field prevents an undeclared mixture of number systems. If a real matrix is to be placed in a larger number system, that common field must first be chosen.
Definition 3.1.2
(Matrix addition, subtraction, and scalar multiplication)
Suppose and are both in , and let .
Addition and subtraction are undefined when the two matrices have different sizes. Scalar multiplication always preserves the size of its matrix.
Definition 3.1.3
(Zero matrix)
The zero matrix in , denoted here by , is the matrix whose every entry is zero. Its size is part of its identity: a zero matrix and a zero matrix are different objects.
The notation makes the entrywise rules compact. If and , then
These three formulas also provide a reliable equality test: to prove two matrix expressions equal, verify that they have the same size and then compare their arbitrary entries.
The three operations are often used together. If belong to and belong to , then
is called a linear combination of and . Its entry is , and its size is still . The conclusion that the result remains in is called closure. Closure is not merely a vocabulary item: it assures us that a calculation made from allowed objects does not suddenly leave the collection we are studying.
Several familiar expressions are special linear combinations. The difference uses coefficients and ; over , an average such as uses coefficients that sum to one; and can be written as . The coefficients may be positive, negative, or zero. “Scaling” therefore does not always mean making entries physically larger: a negative coefficient also reverses signs, and the coefficient zero collapses every entry to zero.
The same-size condition still governs the entire expression. If is and is , then is undefined even though and are individually defined. Scalar multiplication cannot repair a dimension mismatch. Likewise, the scalars and matrix entries must be read in the chosen common field so that every scalar product and sum has an agreed meaning.
Theorem 3.1.4
(Laws of matrix addition)
Let . Then
and
Therefore matrices of one fixed size over one fixed field are closed under addition and form a commutative additive system with a unique zero matrix and a unique additive inverse for each matrix.
Theorem 3.1.5
(Laws of scalar multiplication)
Let and let . Then
Consequently,
The two distributive laws are different: the first distributes one scalar over a matrix sum, whereas the second distributes a sum of scalars over one matrix.
Every law above follows from the corresponding scalar law, but a matrix proof must explicitly pass through its entries. First note that both sides of each identity are matrices. Fix an arbitrary position .
For associativity of addition,
The middle equality is associativity in . Because this holds at every position, matrix equality gives .
For distribution of a scalar over a matrix sum,
Likewise,
and
Commutativity, the zero law, the inverse law, and follow by replacing the arbitrary entry with the matching scalar identity. This is a reusable proof method: same size plus equality of every arbitrary entry proves equality of matrices.
The two theorems let us derive useful rules instead of memorizing them as new facts. Because , distribution gives
Indeed, , as can be checked at an arbitrary entry. Be careful, however: subtraction itself is generally neither commutative nor associative. Usually , and need not equal . Rewriting every subtraction as addition of an inverse reveals the correct parentheses and signs.
Addition also has a cancellation law. If belong to the same and satisfy , add to both sides. Associativity and the zero law reduce the equation to . For fixed , the equation in the unknown therefore has the unique solution . This justifies additive “moving to the other side”; it is shorthand for applying the same permitted operation to both sides.
Scalar cancellation needs a condition that additive cancellation does not. If and , multiplication by the scalar gives . If , both sides equal for every pair , so no equality between the original matrices follows. Similarly, implies only when is nonzero. Stating this hypothesis prevents a common logical error.
Finally, over , a matrix equation is really a system of scalar equations in matching positions. If and , then every entry satisfies . Solving these scalar equations simultaneously yields . The compact matrix manipulation and the entrywise method are not rival techniques; they are two descriptions of exactly the same reasoning.
Addition, subtraction, and scalar multiplication change entries while preserving the row-and-column positions and matrix size.
Follow same-size compatibility, entrywise addition, scalar scaling, subtraction by additive inverse, and the zero-matrix identity move in one short sequence.
Same-size gate
A + B and A - B require A and B to have the same m x n size, so every entry has a corresponding partner.
Entrywise addition
The output entry at position (i,j) is built from the two input entries in that same position: [A+B]_{ij}=a_{ij}+b_{ij}.
Scalar multiplication
A scalar multiplies every entry of A. The entries change, but the result is still an m x n matrix.
Subtraction via inverse
Subtraction is defined as A - B = A + (-B), so it uses the same size rule as addition.
Zero and inverse
The zero matrix O and the additive inverse -A must have the same size as A, so A+O=A and A+(-A)=O are well-defined.
Entrywise laws
The familiar algebraic laws are proved by checking the (i,j)-entry on both sides of the proposed matrix equality.
For addition and subtraction, the size match is part of the definition. For scalar multiplication, one scalar reaches every entry while the matrix shape stays fixed.
The live block below lets you switch among , , and . Before reading its output, predict one selected entry and the size of the result. No matter which operation you choose, the output keeps the same size as the input matrix or matrices.
Read entrywise matrix operations
Change c. Compare each output with A: muted cells have a different value from the corresponding entry in A.
| 1 | −2 |
| 3 | 0 |
| 4 | 1 |
| −1 | 2 |
| 5 | −1 |
| 2 | 2 |
| −3 | −3 |
| 4 | −2 |
| 2 | −4 |
| 6 | 0 |
Holds: Each operation preserves the matrix size
Addition and subtraction combine corresponding entries. Scalar multiplication applies the same c to every entry, including zero and negative entries.
NoticeMatrices must have the same dimensions for addition and subtraction. Changing c affects cA only; c=0 produces the zero matrix.
Worked example 3.1.6
(A rectangular numerical calculation)
Let
Both matrices are over , so their sum and difference are defined. Keeping the layout visible gives
and
Finally,
All three results remain ; the scalar changes signs and magnitudes, not dimensions.
Worked example 3.1.7
(Solve a matrix equation entrywise)
Suppose the matrices have real entries and
where
Matrix algebra permits the same additive rearrangement as scalar algebra:
Now compute rather than treating the fraction as “matrix division”:
so
Verification is part of the solution:
Worked example 3.1.8
(Verify a distributive law numerically)
Take
The left-hand side of is
The right-hand side is
One example does not prove the theorem, but it checks the arithmetic and shows how the general entrywise proof manifests in a concrete case.
If is the zero matrix of the same size as , then . This matters later because the vector space of matrices needs an additive identity. That identity depends on the size: a zero matrix cannot replace a zero matrix in an equality or addition.
The equation also has exactly one solution, namely . To see uniqueness, add to both sides and use associativity. Thus the zero matrix and additive inverse are structural objects, not merely convenient notation.
Common mistake
(Checking entries but forgetting dimensions)
The expressions and require equal numbers of rows and equal numbers of columns. Having the same total number of entries is insufficient: a matrix cannot be added to a matrix.
Common mistake
(Applying a scalar to only part of a matrix)
In , the scalar multiplies every entry, including zeros and negative entries. For example, ; losing this sign is a common arithmetic error.
Common mistake
(Treating a scalar as a matrix addend)
In this course, an expression such as is not defined. Do not add to every entry or only to diagonal entries unless a separate convention has been explicitly introduced.
Common mistake
(Calling scalar multiplication matrix division)
The step from to is multiplication by the scalar . It does not assert that division by a matrix is available.
Quick check
(Why is matrix addition only defined for matrices of the same size?)
Answer in one sentence using the phrase “corresponding entries.”
Matrix addition is entrywise, so each entry of one matrix must have a corresponding entry in the other matrix; this requires equal row and column counts.
Quick check
(If is a matrix, what is the size of ?)
Focus on shape, not on the signs of the entries.
is still a matrix because multiplication by changes every entry but does not change the number of rows or columns.
Quick check
(Let be and be . Which of , , and are defined?)
State each one separately.
is undefined because the sizes do not match. is undefined for the same reason. is defined and is because scalar multiplication needs only one matrix and one scalar.
Quick check
(Compute for and .)
Write first, and then subtract corresponding entries.
Both matrices are , so the expression is defined. We obtain
and hence
Quick check
(Solve when and .)
Isolate , compute it, and check one entry of the original equation.
Subtract from both sides:
For example, the entry checks as , matching the entry of ; computing the other three entries gives the full equality.
Quick check
(Why is the zero matrix called the additive identity?)
Use the equation that expresses its identity role and state the size condition.
For every , the zero matrix satisfies . The matrices must have the same size so that the additions are defined.
All matrices and unspecified scalar parameters in these exercises are real. Matrix dimensions are positive integers, and denotes the zero matrix of the required size.
Exercise 3.1.9
(Write out the five matrices and determine the scalars in their linear relation.)
Core
Let have the following entries, for .
(a) Write out . (b) Write out . (c) Write out . (d) Write out . (e) Write out . (f) Find such that , and verify the equality.
Fix and let run from to to obtain one row. For the relation, compare positions where is odd and where it is even.
Fill the constant and index-sum matrices
Each entry of is . In row of , the entries are .
Because: Matrix equality and the entrywise definitions.
Use parity to fill the two alternating patterns
The integers and differ by , so they have the same parity. Thus is where is , and where is .
Because: Matrix equality and the entrywise definitions.
Separate positions above, on, and below the diagonal
Because: The cases , , and cover every position.
Compare an odd position and an even position
Key step
At an odd position, , so . At an even position, , so . Both types of position occur in these matrices.
Because: Matrix equality and the entrywise definitions.
Verify the relation at every position
At even positions both sides are ; at odd positions both sides are . Together with the five matrices above, this answers every part.
Because: Matrix equality and the entrywise definitions.
Exercise 3.1.10
(Write out the matrices defined by reversed indices.)
Foundation
Let . Define and by
In terms of the entries of , write out (a) and (b) .
As runs from to , the index runs from to . Apply the same observation to .
Reverse the column index while keeping each row fixed
For fixed , row of is .
Because: Matrix equality and the entrywise definitions.
Reverse the row index as well
Row of comes from row of in reverse order; row comes from row , and so on. Thus
Because: Matrix equality and the entrywise definitions.
Check the two complete matrices against the definitions
The displayed reverses the columns of ; the displayed reverses both its rows and its columns. For every , their entries are respectively and , so both displays satisfy all entry conditions.
Because: Matrix equality and the entrywise definitions.
Exercise 3.1.11
(Prove negation of a sum and additive cancellation.)
CoreProof
Let . Prove both statements from the definitions or established scalar laws.
Fix an arbitrary position . For cancellation, subtract the same real number from both sides.
Compare the entries of the two negatives
Both matrices in (a) have size . For every valid ,
Because: Matrix equality and the entrywise definitions.
Cancel the common scalar entry
Under the hypothesis of (b), equality of corresponding entries gives
Because: Cancellation for addition of real numbers.
Conclude both matrix identities
In (a), every corresponding entry agrees, so . In (b), the equality holds at every position, so . The common size hypothesis makes every comparison and sum valid.
Because: Matrix equality and the entrywise definitions.
∎Exercise 3.1.12
(Prove that a positive integer multiple is repeated addition.)
CoreProof
Let . Use mathematical induction to prove that, for every positive integer ,
Start with . To pass from to , write and use the induction hypothesis.
Verify the base case
For , the identity is exactly a sum of one copy of .
Because: The definition of scalar multiplication: multiplication by 1 leaves every entry unchanged.
State the induction hypothesis
Fix an integer and assume that equals a sum of copies of . All these sums have the same size as .
Add one more copy
Key step
Because: Scalar distributivity, then the induction hypothesis.
Apply induction
The base case and induction step establish with exactly summands for every positive integer .
Because: The principle of mathematical induction.
∎Exercise 3.1.13
(Solve the matrix equation in terms of the given matrices.)
Foundation
Let . Determine all satisfying
Expand both sides, collect the terms, and multiply by the reciprocal of its nonzero scalar coefficient.
Distribute the scalar factors
Because: The distributive laws for scalar multiplication.
Isolate the unknown matrix
These operations are reversible because every matrix has the same size and the scalar is nonzero.
Because: Matrix equality and the entrywise definitions.
Verify and state the unique solution
Substitution gives on both sides of the original equation. Hence the unique solution is
Because: The distributive laws for scalar multiplication.
Exercise 3.1.14
(Find every matrix satisfying the identity-matrix equation.)
Foundation
Find every matrix such that .
After expanding the right-hand side, subtract from both sides and add .
Rearrange the equation
Because: Entrywise addition and scalar distributivity.
Compute and verify the unique solution
The diagonal entries are , and the off-diagonal entries are . Substituting gives . The reversible rearrangement proves uniqueness.
Because: Matrix equality and the entrywise definitions.
Exercise 3.1.15
(Factor the matrix difference as a column times a row.)
Core
Let , and define
Find one explicit choice of real numbers that makes the following factorization valid, and verify it.
Subtract corresponding entries and compare the resulting rows. A matrix with two equal rows can be factored using the column .
Subtract corresponding entries
Because: Matrix equality and the entrywise definitions.
Factor the two identical rows
Multiplying the column by the row reproduces that row twice, so it reproduces all eight entries of .
Because: The row-by-column definition of matrix multiplication.
State a choice that also covers the zero case
This choice works for all , including when or . If both are zero, any works; the question asks for one choice, not uniqueness.
Because: Matrix equality and the entrywise definitions.
Read 2.1 Matrix basics first if you want a slower introduction to rows, columns, entries, and matrix size.
Read 3.2 Matrix multiplication, identity matrices, and linear systems next to study the first matrix operation that is not entrywise.